{"version":3,"sources":["home.js"],"names":["const","lsKeys","token","chunkSize","parallelUploads","uploadsHistoryOrder","previewImages","fileLength","uploadAge","stripTags","page","localStorage","apiChecked","private","enableUserAccounts","maxSize","chunkSizeConfig","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","window","location","reload","response","onAxiosError","onError","console","content","createElement","innerHTML","toString","swal","title","icon","cont","statusText","520","521","522","523","524","525","526","527","530","status","data","description","success","checkClientVersion","apiVersion","match","src","text","buttons","confirm","closeModal","then","checkIfPublic","axios","get","onDownloadProgress","render","done","do","newsfeed","version","parseInt","max","default","preparePage","catch","prepareUpload","verifyToken","button","href","reloadOnError","post","removeItem","authLink","setAttribute","value","prepareShareX","fetchAlbums","prepareUploadConfig","getPrettyBytes","prepareDropzone","uploadUrls","event","addUrlsToQueue","tabsContainer","loop","i","id","dataset","tabContent","setActiveTab","push","tab","length","index","let","headers","simple","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","_uplSpeedCalc","lastSent","timestamp","Date","now","bytes","upload","chunked","setRequestHeader","chunks","progress","prettyBytesPerSec","total","Math","size","percentage","bytesSent","toFixed","upl","prefix","skipProgress","last","totalChunkCount","chunkIndex","elapsed","bytesPerSec","fullSec","splice","excessDuration","duration","files","updateTemplate","err","Error","test","updateTemplateIcon","chunksUploaded","uuid","original","type","albumid","filelength","age","striptags","urls","split","trim","firstChild","processUrlsQueue","shiftQueue","initUrlUpload","finishedUrlUpload","shift","templateElement","iconClass","iconElement","link","a","clipboard","clipboardText","parentElement","exec","extname","toLowerCase","includes","img","onerror","currentTarget","update","expirydate","expiryDate","getPrettyDate","createAlbum","cancel","download","checked","public","selected","fallback","min","config","siBytes","label","select","help","valueHandler","display","number","round","undefined","disabled","force","video","suffix","uploadFields","stored","parseFloat","String","getPrettyUploadAge","isNaN","form","preventDefault","configKeys","Object","keys","key","conf","field","parsed","find","sel","control","opts","j","opt","join","tmp","submit","checkValidity","elements","hours","minutes","days","items","clipboardData","originalEvent","item","kind","blob","getAsFile","File","addFile","cookieconsent","initialise","cookie","path","pathname","expiryDays","secure","protocol","palette","popup","background","theme","position","message","dismiss","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,YAAY,EACZC,QAAS,KACTC,mBAAoB,KACpBC,QAAS,KACTC,gBAAiB,KACjBC,oBAAqB,KACrBC,qBAAsB,KACtBC,gBAAiB,KAGjBC,MAAO,KAEPhB,gBAAiB,KACjBE,cAAe,KACfC,WAAY,KACZC,UAAW,KACXC,UAAW,KAEXY,aAAc,KACdC,WAAY,KACZC,gBAAiB,KACjBpB,UAAW,KAEXqB,KAAM,GACNC,UAAW,KACXC,YAAa,KACbC,oBAAqB,KACrBC,gBAAiB,KAEjBC,SAAU,KACVC,YAAa,KACbC,SAAU,KAGVC,UAAW,GACXC,gBAAiB,EAIjBC,UAAW,CAAC,OAAQ,QAAS,OAAQ,OAAQ,OAAQ,OAAQ,QAAS,QAAS,QAC/EC,UAAW,CAAC,OAAQ,QAAS,OAAQ,OAAQ,OAAQ,OAAQ,QAAS,QAEtEC,oBAAqB,GACrBC,mBAAoB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const 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 apiChecked: false,\n private: null,\n enableUserAccounts: null,\n maxSize: null,\n chunkSizeConfig: 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: null,\n previewImages: null,\n fileLength: null,\n uploadAge: null,\n stripTags: null,\n\n maxSizeBytes: null,\n urlMaxSize: null,\n urlMaxSizeBytes: null,\n chunkSize: 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: ['.gif', '.jpeg', '.jpg', '.png', '.svg', '.tif', '.tiff', '.webp', '.bmp'],\n videoExts: ['.avi', '.m2ts', '.m4v', '.mkv', '.mov', '.mp4', '.webm', '.wmv'],\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 window.location.reload()\n })\n\n if (error.response) page.onAxiosError(error)\n else 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 = `\n
${error.toString()}
Please check your console for more information.
\n `\n return swal({\n title: 'An error occurred!',\n icon: 'error',\n content\n })\n}\n\n// Handler for Axios errors\npage.onAxiosError = (error, cont) => {\n if (!cont) 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\n if (!cont) {\n const description = error.response.data && error.response.data.description\n ? error.response.data.description\n : 'There was an error with the request.\\nPlease check the console for more information.'\n return swal(`${error.response.status} ${statusText}`, description, 'error')\n } else if (error.response.data && error.response.data.description) {\n return error.response\n } else {\n const description = error.response\n ? `${error.response.status} ${statusText}`\n : error.toString()\n return { data: { success: false, description } }\n }\n}\n\npage.checkClientVersion = apiVersion => {\n const self = document.querySelector('#mainScript')\n const match = self.src.match(/\\?_=(\\d+)$/)\n if (match && match[1] && match[1] !== apiVersion) {\n return swal({\n title: 'Update detected!',\n text: 'Client assets have been updated. Reload to display the latest version?',\n icon: 'info',\n buttons: {\n confirm: {\n text: 'Reload',\n closeModal: false\n }\n }\n }).then(() => {\n window.location.reload()\n })\n }\n}\n\npage.checkIfPublic = () => {\n return axios.get('api/check', {\n onDownloadProgress: () => {\n // Only do render and/or newsfeed after this request has been initiated to avoid blocking\n /* global render */\n if (typeof render !== 'undefined' && !render.done) render.do()\n /* global newsfeed */\n if (typeof newsfeed !== 'undefined' && !newsfeed.done) newsfeed.do()\n if (!page.apiChecked) page.apiChecked = true\n }\n }).then(response => {\n if (response.data.version) {\n page.checkClientVersion(response.data.version)\n }\n\n page.private = response.data.private\n page.enableUserAccounts = response.data.enableUserAccounts\n\n page.maxSize = parseInt(response.data.maxSize)\n page.maxSizeBytes = page.maxSize * 1e6\n page.chunkSizeConfig = {\n max: (response.data.chunkSize && parseInt(response.data.chunkSize.max)) || 95,\n default: response.data.chunkSize && parseInt(response.data.chunkSize.default)\n }\n\n page.temporaryUploadAges = response.data.temporaryUploadAges\n page.fileIdentifierLength = response.data.fileIdentifierLength\n page.stripTagsConfig = response.data.stripTags\n\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.\\nLog in or register to upload.'\n } else {\n button.innerText = 'Running in private mode.\\nLog in to upload.'\n }\n }\n } else {\n return page.prepareUpload()\n }\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 window.location.reload()\n })\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 // Change /auth link to /dashboard\n const authLink = document.querySelector('#linksColumn a[href=\"auth\"]')\n if (authLink) authLink.setAttribute('href', 'dashboard')\n\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') page.prepareShareX()\n }\n page.albumSelect.addEventListener('change', page.albumSelectOnChange)\n\n // Fetch albums\n page.fetchAlbums()\n } else if (page.enableUserAccounts) {\n document.querySelector('#loginLinkText').innerHTML = 'Create an account and keep track of your uploads'\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 // Prepare & generate files upload tab\n page.prepareDropzone()\n\n // Generate ShareX config file\n if (typeof page.prepareShareX === 'function') 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 }\n\n const uploadUrls = document.querySelector('#uploadUrls')\n if (uploadUrls) {\n 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}\n\npage.fetchAlbums = () => {\n return axios.get('api/albums', {\n headers: {\n simple: '1',\n token: page.token\n }\n }).then(response => {\n if (response.data.success === false) {\n return swal('An error occurred!', response.data.description, 'error')\n }\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 }\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 = `\nMax 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