{"version":3,"sources":["home.js"],"names":["const","lsKeys","token","chunkSize","parallelUploads","uploadsHistoryOrder","previewImages","fileLength","uploadAge","stripTags","page","localStorage","private","enableUserAccounts","maxSize","temporaryUploadAges","fileIdentifierLength","stripTagsConfig","album","maxSizeBytes","urlMaxSize","urlMaxSizeBytes","tabs","activeTab","albumSelect","albumSelectOnChange","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","_uplSpeedCalc","lastSent","timestamp","Date","now","bytes","upload","chunked","setRequestHeader","chunks","progress","prettyBytesPerSec","total","Math","max","size","percentage","bytesSent","toFixed","upl","prefix","skipProgress","done","last","totalChunkCount","chunkIndex","elapsed","bytesPerSec","fullSec","splice","excessDuration","duration","files","updateTemplate","test","updateTemplateIcon","chunksUploaded","uuid","original","type","albumid","filelength","age","striptags","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","default","video","isNaN","suffix","uploadFields","stored","parseFloat","String","getPrettyUploadAge","form","preventDefault","configKeys","Object","keys","key","conf","field","parsed","find","sel","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,YACXC,UAAW,aAGPC,KAAO,CAEXR,MAAOS,aAAaV,OAAOC,OAG3BU,QAAS,KACTC,mBAAoB,KACpBC,QAAS,KACTX,UAAW,KACXY,oBAAqB,KACrBC,qBAAsB,KACtBC,gBAAiB,KAGjBC,MAAO,KAEPd,gBAAiB,EACjBE,cAAe,KACfC,WAAY,KACZC,UAAW,KAEXW,aAAc,KACdC,WAAY,KACZC,gBAAiB,KAEjBC,KAAM,GACNC,UAAW,KACXC,YAAa,KACbC,oBAAqB,KACrBC,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,OAAQ,OAAQ,SAErEC,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,UA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Q,EAAMD,OAAQP,IAAK,CACrCzG,IAAM+R,EAAOH,EAAM3K,EAAMR,IACzB,GAAkB,SAAdsL,EAAKC,KAAiB,CACxBhS,IAAMiS,EAAOF,EAAKG,YAEZlJ,EAAO,IAAImJ,KAAK,CAACF,GAAO,gBAAgBA,EAAKhG,KAAKY,MAAM,sBAAsB,GAAM,CACxFZ,KAAMgG,EAAKhG,OAEbvL,KAAKiB,SAASyQ,QAAQpJ,QAK5B2I,OAAOU,OAAM,WACX3R,KAAKiE,gBAELjE,KAAKkB,YAAc,IAAI0Q,YAAY,iBAEnC5R,KAAKkB,YAAYmH,GAAG,WAAS,WAC3B,OAAOpF,KAAK,GAAI,yCAA0C,UAAW,CACnE2K,SAAS,EACTiE,MAAO,UAIX7R,KAAKkB,YAAYmH,GAAG,QAASrI,KAAK2C,SAElC3C,KAAKmB,SAAW,IAAI2Q,SAAS,CAC3BC,kBAAmB,uBAGrBnQ,SAASC,cAAc,gBAAgBS,iBAAiB,SAAO,WAC7DtC,KAAK2N","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 stripTags: 'stripTags'\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 stripTagsConfig: 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 albumSelectOnChange: 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', '.m4v', '.m2ts'],\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 page.stripTagsConfig = response.data.stripTags\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.albumSelectOnChange = () => {\n page.album = parseInt(page.albumSelect.value)\n // Re-generate ShareX config file\n if (typeof page.prepareShareX === 'function')\n page.prepareShareX()\n }\n page.albumSelect.addEventListener('change', page.albumSelectOnChange)\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