{"version":3,"sources":["home.js"],"names":["const","lsKeys","token","chunkSize","parallelUploads","uploadsHistoryOrder","previewImages","fileLength","uploadAge","page","localStorage","private","enableUserAccounts","maxSize","temporaryUploadAges","fileIdentifierLength","album","maxSizeBytes","urlMaxSize","urlMaxSizeBytes","tabs","activeTab","albumSelect","previewTemplate","dropzone","clipboardJS","lazyLoad","urlsQueue","activeUrlsQueue","imageExts","videoExts","albumTitleMaxLength","albumDescMaxLength","onInitError","error","document","querySelector","classList","add","querySelectorAll","forEach","element","uploadButton","innerText","remove","addEventListener","location","reload","response","onAxiosError","onError","console","content","createElement","innerHTML","toString","swal","title","icon","statusText","520","521","522","523","524","525","526","527","530","status","description","data","checkIfPublic","let","renderShown","axios","get","onDownloadProgress","doRender","then","parseInt","preparePage","catch","prepareUpload","verifyToken","button","href","reloadOnError","post","success","text","removeItem","value","prepareShareX","fetchAlbums","prepareUploadConfig","getPrettyBytes","prepareDropzone","event","addUrlsToQueue","tabsContainer","loop","i","id","dataset","tabContent","setActiveTab","push","tab","length","index","headers","Array","isArray","albums","option","name","appendChild","previewNode","parentNode","removeChild","tabDiv","div","className","previewsContainer","Dropzone","body","url","paramName","clickable","maxFilesize","uploadMultiple","createImageThumbnails","autoProcessQueue","chunking","Boolean","parallelChunkUploads","timeout","init","this","on","file","previewElement","xhr","ontimeout","instances","getUploadingFiles","filter","instance","_handleUploadError","undefined","_start","Date","now","upload","chunked","setRequestHeader","chunks","progress","prettyBytesPerSec","total","Math","max","size","percentage","bytesSent","toFixed","upl","prefix","skipProgress","done","last","totalChunkCount","chunkIndex","elapsed","bytesPerSec","files","updateTemplate","test","updateTemplateIcon","chunksUploaded","uuid","original","type","albumid","filelength","age","urls","split","trim","firstChild","processUrlsQueue","shiftQueue","initUrlUpload","match","finishedUrlUpload","shift","templateElement","iconClass","iconElement","link","a","clipboard","clipboardText","parentElement","exec","extname","toLowerCase","includes","img","setAttribute","src","onerror","currentTarget","update","expirydate","expiryDate","getPrettyDate","createAlbum","buttons","cancel","confirm","closeModal","download","checked","public","selected","fallback","min","config","siBytes","label","select","help","valueHandler","display","number","round","disabled","force","isNaN","suffix","uploadFields","stored","parseFloat","String","getPrettyUploadAge","default","form","preventDefault","configKeys","Object","keys","key","conf","field","parsed","control","opts","j","opt","join","tmp","submit","checkValidity","elements","hours","minutes","days","window","items","clipboardData","originalEvent","item","kind","blob","getAsFile","File","addFile","onload","ClipboardJS","timer","LazyLoad","elements_selector"],"mappings":"AAEAA,IAAMC,OAAS,CACbC,MAAO,QACPC,UAAW,YACXC,gBAAiB,kBACjBC,oBAAqB,sBACrBC,cAAe,gBACfC,WAAY,aACZC,UAAW,aAGPC,KAAO,CAEXP,MAAOQ,aAAaT,OAAOC,OAG3BS,QAAS,KACTC,mBAAoB,KACpBC,QAAS,KACTV,UAAW,KACXW,oBAAqB,KACrBC,qBAAsB,KAGtBC,MAAO,KAEPZ,gBAAiB,EACjBE,cAAe,KACfC,WAAY,KACZC,UAAW,KAEXS,aAAc,KACdC,WAAY,KACZC,gBAAiB,KAEjBC,KAAM,GACNC,UAAW,KACXC,YAAa,KACbC,gBAAiB,KAEjBC,SAAU,KACVC,YAAa,KACbC,SAAU,KAGVC,UAAW,GACXC,gBAAiB,EAIjBC,UAAW,CAAC,QAAS,OAAQ,QAAS,OAAQ,OAAQ,OAAQ,QAAS,OAAQ,QAC/EC,UAAW,CAAC,QAAS,OAAQ,OAAQ,OAAQ,OAAQ,QAErDC,oBAAqB,GACrBC,mBAAoB,IAItBC,YAAgB,SAAGC,GAEjBC,SAASC,cAAc,aAAaC,UAAUC,IAAI,aAClDH,SAASC,cAAc,SAASC,UAAUC,IAAI,aAC9CH,SAASI,iBAAiB,gBAAgBC,SAAO,SAACC,GAChD,OAAOA,EAAQJ,UAAUC,IAAI,gBAI/BtC,IAAM0C,EAAeP,SAASC,cAAc,kBAC5CM,EAAaC,UAAY,oCACzBD,EAAaL,UAAUO,OAAO,cAC9BF,EAAaL,UAAUO,OAAO,aAE9BF,EAAaG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XhR,KAAKgB,YAAYmH,GAAG,QAASnI,KAAKyC,SAElCzC,KAAKiB,SAAW,IAAIgQ,SAAS,CAC3BC,kBAAmB,uBAGrBxP,SAASC,cAAc,gBAAgBS,iBAAiB,SAAO,WAC7DpC,KAAKiN","file":"home.js","sourcesContent":["/* global swal, axios, Dropzone, ClipboardJS, LazyLoad */\n\nconst lsKeys = {\n token: 'token',\n chunkSize: 'chunkSize',\n parallelUploads: 'parallelUploads',\n uploadsHistoryOrder: 'uploadsHistoryOrder',\n previewImages: 'previewImages',\n fileLength: 'fileLength',\n uploadAge: 'uploadAge'\n}\n\nconst page = {\n // user token\n token: localStorage[lsKeys.token],\n\n // configs from api/check\n private: null,\n enableUserAccounts: null,\n maxSize: null,\n chunkSize: null,\n temporaryUploadAges: null,\n fileIdentifierLength: null,\n\n // store album id that will be used with upload requests\n album: null,\n\n parallelUploads: 2,\n previewImages: null,\n fileLength: null,\n uploadAge: null,\n\n maxSizeBytes: null,\n urlMaxSize: null,\n urlMaxSizeBytes: null,\n\n tabs: [],\n activeTab: null,\n albumSelect: null,\n previewTemplate: null,\n\n dropzone: null,\n clipboardJS: null,\n lazyLoad: null,\n\n // additional vars for url uploads\n urlsQueue: [],\n activeUrlsQueue: 0,\n\n // Include BMP for uploads preview only, cause the real images will be used\n // Sharp isn't capable of making their thumbnails for dashboard and album public pages\n imageExts: ['.webp', '.jpg', '.jpeg', '.bmp', '.gif', '.png', '.tiff', '.tif', '.svg'],\n videoExts: ['.webm', '.mp4', '.wmv', '.avi', '.mov', '.mkv'],\n\n albumTitleMaxLength: 70,\n albumDescMaxLength: 4000\n}\n\n// Handler for errors during initialization\npage.onInitError = error => {\n // Hide these elements\n document.querySelector('#albumDiv').classList.add('is-hidden')\n document.querySelector('#tabs').classList.add('is-hidden')\n document.querySelectorAll('.tab-content').forEach(element => {\n return element.classList.add('is-hidden')\n })\n\n // Update upload button\n const uploadButton = document.querySelector('#loginToUpload')\n uploadButton.innerText = 'An error occurred. Try to reload?'\n uploadButton.classList.remove('is-loading')\n uploadButton.classList.remove('is-hidden')\n\n uploadButton.addEventListener('click', () => {\n location.reload()\n })\n\n if (error.response)\n page.onAxiosError(error)\n else\n page.onError(error)\n}\n\n// Handler for regular JS errors\npage.onError = error => {\n console.error(error)\n\n const content = document.createElement('div')\n content.innerHTML = `${error.toString()}
`\n return swal({\n title: 'An error occurred!',\n icon: 'error',\n content\n })\n}\n\n// Handler for Axios errors\npage.onAxiosError = error => {\n console.error(error)\n\n // Better Cloudflare errors\n const cloudflareErrors = {\n 520: 'Unknown Error',\n 521: 'Web Server Is Down',\n 522: 'Connection Timed Out',\n 523: 'Origin Is Unreachable',\n 524: 'A Timeout Occurred',\n 525: 'SSL Handshake Failed',\n 526: 'Invalid SSL Certificate',\n 527: 'Railgun Error',\n 530: 'Origin DNS Error'\n }\n\n const statusText = cloudflareErrors[error.response.status] || error.response.statusText\n const description = error.response.data && error.response.data.description\n ? error.response.data.description\n : 'There was an error with the request, please check the console for more information.'\n\n return swal(`${error.response.status} ${statusText}`, description, 'error')\n}\n\npage.checkIfPublic = () => {\n let renderShown = false\n return axios.get('api/check', {\n onDownloadProgress: () => {\n // Only show render after this request has been initiated\n if (!renderShown && typeof page.doRender === 'function') {\n page.doRender()\n renderShown = true\n }\n }\n }).then(response => {\n page.private = response.data.private\n page.enableUserAccounts = response.data.enableUserAccounts\n page.maxSize = parseInt(response.data.maxSize)\n page.maxSizeBytes = page.maxSize * 1e6\n page.chunkSize = parseInt(response.data.chunkSize)\n page.temporaryUploadAges = response.data.temporaryUploadAges\n page.fileIdentifierLength = response.data.fileIdentifierLength\n return page.preparePage()\n }).catch(page.onInitError)\n}\n\npage.preparePage = () => {\n if (page.private)\n if (page.token) {\n return page.verifyToken(page.token, true)\n } else {\n const button = document.querySelector('#loginToUpload')\n button.href = 'auth'\n button.classList.remove('is-loading')\n if (page.enableUserAccounts)\n button.innerText = 'Anonymous upload is disabled. Log in to upload.'\n else\n button.innerText = 'Running in private mode. Log in to upload.'\n }\n else\n return page.prepareUpload()\n}\n\npage.verifyToken = (token, reloadOnError) => {\n return axios.post('api/tokens/verify', { token }).then(response => {\n if (response.data.success === false)\n return swal({\n title: 'An error occurred!',\n text: response.data.description,\n icon: 'error'\n }).then(() => {\n if (!reloadOnError) return\n localStorage.removeItem('token')\n location.reload()\n })\n\n localStorage[lsKeys.token] = token\n page.token = token\n return page.prepareUpload()\n }).catch(page.onInitError)\n}\n\npage.prepareUpload = () => {\n // I think this fits best here because we need to check for a valid token before we can get the albums\n if (page.token) {\n // Display the album selection\n document.querySelector('#albumDiv').classList.remove('is-hidden')\n\n page.albumSelect = document.querySelector('#albumSelect')\n page.albumSelect.addEventListener('change', () => {\n page.album = parseInt(page.albumSelect.value)\n // Re-generate ShareX config file\n if (typeof page.prepareShareX === 'function')\n page.prepareShareX()\n })\n\n // Fetch albums\n page.fetchAlbums()\n }\n\n // Prepare & generate config tab\n page.prepareUploadConfig()\n\n // Update elements wherever applicable\n document.querySelector('#maxSize > span').innerHTML = page.getPrettyBytes(page.maxSizeBytes)\n document.querySelector('#loginToUpload').classList.add('is-hidden')\n\n if (!page.token && page.enableUserAccounts)\n document.querySelector('#loginLinkText').innerHTML = 'Create an account and keep track of your uploads'\n\n // Prepare & generate files upload tab\n page.prepareDropzone()\n\n // Generate ShareX config file\n if (typeof page.prepareShareX === 'function')\n page.prepareShareX()\n\n // Prepare urls upload tab\n const urlMaxSize = document.querySelector('#urlMaxSize')\n if (urlMaxSize) {\n page.urlMaxSize = parseInt(urlMaxSize.innerHTML)\n page.urlMaxSizeBytes = page.urlMaxSize * 1e6\n urlMaxSize.innerHTML = page.getPrettyBytes(page.urlMaxSizeBytes)\n document.querySelector('#uploadUrls').addEventListener('click', event => {\n page.addUrlsToQueue()\n })\n }\n\n // Get all tabs\n const tabsContainer = document.querySelector('#tabs')\n const tabs = tabsContainer.querySelectorAll('li')\n for (let i = 0; i < tabs.length; i++) {\n const id = tabs[i].dataset.id\n const tabContent = document.querySelector(`#${id}`)\n if (!tabContent) continue\n\n tabs[i].addEventListener('click', () => {\n page.setActiveTab(i)\n })\n page.tabs.push({ tab: tabs[i], content: tabContent })\n }\n\n // Set first valid tab as the default active tab\n if (page.tabs.length) {\n page.setActiveTab(0)\n tabsContainer.classList.remove('is-hidden')\n }\n}\n\npage.setActiveTab = index => {\n for (let i = 0; i < page.tabs.length; i++)\n if (i === index) {\n page.tabs[i].tab.classList.add('is-active')\n page.tabs[i].content.classList.remove('is-hidden')\n page.activeTab = index\n } else {\n page.tabs[i].tab.classList.remove('is-active')\n page.tabs[i].content.classList.add('is-hidden')\n }\n}\n\npage.fetchAlbums = () => {\n return axios.get('api/albums', { headers: { token: page.token } }).then(response => {\n if (response.data.success === false)\n return swal('An error occurred!', response.data.description, 'error')\n\n // Create an option for each album\n if (Array.isArray(response.data.albums) && response.data.albums.length)\n for (let i = 0; i < response.data.albums.length; i++) {\n const album = response.data.albums[i]\n const option = document.createElement('option')\n option.value = album.id\n option.innerHTML = album.name\n page.albumSelect.appendChild(option)\n }\n }).catch(page.onInitError)\n}\n\npage.prepareDropzone = () => {\n // Parse template element\n const previewNode = document.querySelector('#tpl')\n page.previewTemplate = previewNode.innerHTML\n previewNode.parentNode.removeChild(previewNode)\n\n // Generate files upload tab\n const tabDiv = document.querySelector('#tab-files')\n const div = document.createElement('div')\n div.className = 'control is-expanded'\n div.innerHTML = `\n
Max length is ${page.albumTitleMaxLength} characters.
\nMax length is ${page.albumDescMaxLength} characters.
\n${help}
` : ''}\n `\n field.querySelector('div.control').appendChild(control)\n\n form.appendChild(field)\n }\n\n const submit = document.createElement('div')\n submit.className = 'field'\n submit.innerHTML = `\n\n \n
\n\n This configuration will only be used in this browser.
\n After reloading the page, some of them will also be applied to the ShareX config that you can download by clicking on the ShareX icon below.\n