var lsKeys={token:"token",viewType:{uploads:"viewTypeUploads",uploadsAll:"viewTypeUploadsAll"},selected:{uploads:"selectedUploads",uploadsAll:"selectedUploadsAll",albums:"selectedAlbums",albumsAll:"selectedAlbumsAll",users:"selectedUsers"},originalNames:{uploads:"originalNames",uploadsAll:"originalNamesAll"}},page={section:null,dom:null,token:localStorage[lsKeys.token],username:null,permissions:null,menusContainer:null,menus:[],currentView:null,views:{uploads:{type:localStorage[lsKeys.viewType.uploads],originalNames:"1"===localStorage[lsKeys.originalNames.uploads],album:null,pageNum:null},uploadsAll:{type:localStorage[lsKeys.viewType.uploadsAll],originalNames:"1"===localStorage[lsKeys.originalNames.uploadsAll],filters:null,pageNum:null,all:!0},albums:{filters:null,pageNum:null},albumsAll:{filters:null,pageNum:null,all:!0},users:{filters:null,pageNum:null}},prevPageNums:{uploads:null,uploadsAll:null,albums:null,albumsAll:null,users:null},selected:{uploads:[],uploadsAll:[],albums:[],albumsAll:[],users:[]},checkboxes:[],lastSelected:[],selectAlbumContainer:null,cache:{},clipboardJS:null,lazyLoad:null,albumsSidebarCollapse:null,albumsSidebarCollapsible:null,imageExts:[".gif",".jpeg",".jpg",".png",".svg",".tif",".tiff",".webp"],videoExts:[".3g2",".3gp",".asf",".avchd",".avi",".divx",".evo",".flv",".h264",".h265",".hevc",".m2p",".m2ts",".m4v",".mk3d",".mkv",".mov",".mp4",".mpeg",".mpg",".mxf",".ogg",".ogv",".ps",".qt",".rmvb",".ts",".vob",".webm",".wmv"],audioExts:[".flac",".mp3",".wav",".wma"],isSomethingLoading:!1,fadingIn:null,albumTitleMaxLength:70,albumDescMaxLength:4e3,cloudflareErrors:{520:"Unknown Error",521:"Web Server Is Down",522:"Connection Timed Out",523:"Origin Is Unreachable",524:"A Timeout Occurred",525:"SSL Handshake Failed",526:"Invalid SSL Certificate",527:"Railgun Error",530:"Origin DNS Error"},unhide:function(){document.querySelector("#loader").classList.add("is-hidden"),page.section.classList.remove("is-hidden")},onError:function(e){console.error(e);var a=document.createElement("div");return a.innerHTML="\n

"+e.toString()+"

\n

Please check your console for more information.

\n ",swal({title:"An error occurred!",icon:"error",content:a})},onAxiosError:function(e){if(!e.response)return page.onError(e);var a=page.cloudflareErrors[e.response.status]||e.response.statusText,t=e.response.data&&e.response.data.description?e.response.data.description:"There was an error with the request.\nPlease check the console for more information.";return swal(e.response.status+" "+a,t,"error")},preparePage:function(){page.token?page.verifyToken(page.token):window.location="auth"},checkClientVersion:function(e){var a=document.querySelector("#mainScript").src.match(/\?_=(\d+)$/);if(a&&a[1]&&a[1]!==e)return swal({title:"Update detected!",text:"Client assets have been updated. Reload to display the latest version?",icon:"info",buttons:{confirm:{text:"Reload",closeModal:!1}}}).then((function(){window.location.reload()}))},verifyToken:function(e){axios.post("api/tokens/verify",{token:e}).then((function(a){axios.defaults.headers.common.token=e,localStorage[lsKeys.token]=e,a.data.version&&page.checkClientVersion(a.data.version),page.token=e,page.username=a.data.username,page.permissions=a.data.permissions,page.prepareDashboard()})).catch((function(e){return page.onAxiosError(e).then((function(){e.response.data&&10001===e.response.data.code&&(localStorage.removeItem(lsKeys.token),window.location="auth")}))}))},prepareDashboard:function(){page.section=document.querySelector("#dashboard"),page.dom=page.section.querySelector("#page"),page.dom.addEventListener("click",page.domClick,!0),page.dom.addEventListener("submit",(function(e){if(e.target&&e.target.classList.contains("prevent-default"))return e.preventDefault()}),!0),page.menusContainer=document.querySelector("#menu");for(var e=[{selector:"#itemUploads",onclick:page.getUploads},{selector:"#itemDeleteUploadsByNames",onclick:page.deleteUploadsByNames},{selector:"#itemManageYourAlbums",onclick:page.getAlbums},{selector:"#itemManageToken",onclick:page.changeToken},{selector:"#itemChangePassword",onclick:page.changePassword},{selector:"#itemLogout",onclick:page.logout},{selector:"#itemManageUploads",onclick:page.getUploads,params:{all:!0},group:"moderator"},{selector:"#itemManageAlbums",onclick:page.getAlbums,params:{all:!0},group:"moderator"},{selector:"#itemStatistics",onclick:page.getStatistics,group:"admin"},{selector:"#itemManageUsers",onclick:page.getUsers,group:"admin"}],a=function(a){if(!e[a].group||page.permissions[e[a].group]){var t=document.querySelector(e[a].selector);t.addEventListener("click",(function(t){if(page.isSomethingLoading)return page.warnSomethingLoading();e[a].onclick.call(null,Object.assign(e[a].params||{},{trigger:t.currentTarget,forceScroll:!0}))})),t.classList.remove("is-hidden"),page.menus.push(t)}},t=0;t\n '+('\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n
\n ')+'\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n ',c='\n
\n \n \n \n
\n ',p="bFilters",u="bJumpToPage",g=d.replace(/id="filters"/,'id="'+p+'"').replace(/(data-action="filter-uploads")/,'$1 data-filtersid="'+p+'"').replace(/id="jumpToPage"/,'id="'+u+'"').replace(/(data-action="jump-to-page")/g,'$1 data-jumpid="'+u+'"'),m=o.replace(/(data-action="page-ellipsis")/g,'$1 data-jumpid="'+u+'"'),b=!1,h=e.all&&e.filters&&e.filters.includes("albumid:"),f=s.some((function(e){return void 0!==e.expirydate})),v=page.views[page.currentView].originalNames,y=0;y\n \n '+c+"\n "+g+"\n "+m+"\n ";for(var k=document.querySelector("#table"),x=0;x"+S.prettyUser+" – ":""),e.all&&!h||(T+=S.prettyAlbum?""+S.prettyAlbum+" – ":"");var A=document.createElement("div");A.className="image-container column",A.dataset.id=S.id,void 0===S.thumb?A.innerHTML='

'+(S.extname||"N/A")+"

":A.innerHTML=''+S.name+'',A.innerHTML+='\n \n
\n '+(S.previewable?'\n \n \n \n ':"")+'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n

'+S.name+"

\n "+(v?'

'+S.original+"

":"")+'\n

'+T+S.prettyBytes+"

\n "+(f&&S.prettyExpiryDate?'

EXP: "+S.prettyExpiryDate+"

":"")+"\n
\n ",k.appendChild(A),page.checkboxes=k.querySelectorAll('.checkbox[data-action="select"]')}}else{page.dom.innerHTML="\n "+o+"\n "+d+"\n "+c+'\n
\n \n \n \n \n \n '+(v?'':"")+"\n "+(e.all?'':"")+"\n "+(!e.all||h?'':"")+'\n \n '+(e.all?'':"")+'\n \n '+(f?'':"")+'\n \n \n \n \n \n
File nameOriginal nameUserAlbumSizeIPUpload dateExpiry date('+a.data.count+' total)
\n
\n '+c+"\n "+g+"\n "+m+"\n ";for(var N=document.querySelector("#table"),L=0;L\n '+U.name+"\n "+(v?''+U.original+"":"")+"\n "+(e.all?''+U.prettyUser+"":"")+"\n "+(!e.all||h?''+U.prettyAlbum+"":"")+'\n '+U.prettyBytes+"\n "+(e.all?''+(U.ip||"")+"":"")+'\n '+U.prettyDate+"\n "+(f?'"+(U.prettyExpiryDate||"-")+"":"")+'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '+(e.all?"":'\n \n \n \n ')+'\n \n \n \n \n \n \n ',N.appendChild(V),page.checkboxes=N.querySelectorAll('.checkbox[data-action="select"]')}}var P=document.querySelector("#selectAll");s.length&&P&&!b&&(P.checked=!0,P.title="Unselect all"),page.fadeIn(page.dom);var M=s.length?e.pageNum:0;if(e.forceScroll||null===page.prevPageNums[page.currentView]||page.prevPageNums[page.currentView]!==M){var D=!e.forceScroll&&"thumbs"===page.views[page.currentView].type;page.scrollTo(page.dom,D)}"thumbs"===page.views[page.currentView].type&&page.lazyLoad.update(),page.updateTrigger(e.trigger,"active"),"uploads"===page.currentView&&(page.views.uploads.album=e.album),page.views[page.currentView].filters=e.filters,page.views[page.currentView].pageNum=page.prevPageNums[page.currentView]=M})).catch((function(a){page.updateTrigger(e.trigger),page.onAxiosError(a)}))},setUploadsView:function(e,a){if(page.isSomethingLoading)return page.warnSomethingLoading();"list"===e?(delete localStorage[lsKeys.viewType[page.currentView]],page.views[page.currentView].type=void 0):(localStorage[lsKeys.viewType[page.currentView]]=e,page.views[page.currentView].type=e),page.getUploads(Object.assign(page.views[page.currentView],{trigger:a}))},toggleOriginalNames:function(e){if(page.isSomethingLoading)return page.warnSomethingLoading();page.views[page.currentView].originalNames?(delete localStorage[lsKeys.originalNames[page.currentView]],page.views[page.currentView].originalNames=!1):(localStorage[lsKeys.originalNames[page.currentView]]="1",page.views[page.currentView].originalNames=!0),page.getUploads(Object.assign(page.views[page.currentView],{trigger:e}))},displayPreview:function(e){var a=page.cache[e];if(a.previewable){var t=document.createElement("div");if(t.innerHTML='\n
\n

\n

'+a.name+'
\n
'+a.original+"
\n

\n "+(a.thumb?'

\n \n

':"")+"\n
\n ",a.file&&["picture","video","audio"].includes(a.type))if(t.innerHTML+='\n \n ","picture"===a.type)t.querySelector("#swalOriginal").addEventListener("click",(function(e){var n=e.currentTarget;if(!n.classList.contains("is-danger")){n.classList.add("is-loading");var s=t.querySelector("#swalThumb");s.src=a.file,s.onload=function(){n.classList.add("is-hidden"),document.body.querySelector(".swal-overlay .swal-modal:not(.is-expanded)").classList.add("is-expanded")},s.onerror=function(e){e.currentTarget.classList.add("is-hidden"),n.className="button is-danger is-fullwidth",n.innerHTML='\n \n \n \n Unable to load original\n '}}}));else{var n=a.file.match(/.*\/(.*)$/);(n||n[1])&&(t.querySelector("#swalOriginal").setAttribute("href","v/"+n[1]),t.querySelector("#swalOriginal").setAttribute("target","_blank"))}return swal({content:t,buttons:!1}).then((function(){document.body.querySelector(".swal-overlay .swal-modal").classList.remove("is-expanded")}))}},selectAll:function(e){for(var a=0;an&&s>n&&st&&suser (username) and ip.\n user and ip keys can be specified more than once.\n For usernames with whitespaces, wrap them with double quotes (\").\n To match uploads by non-registered users, or have no IPs respectively, use user:- or ip:-.\n\n To exclude certain users/IPs while still listing every other uploads, add negation sign (-) before the keys.\n Negation signs can also be used to exclude uploads by non-registered users, or have no IPs (i.e. -user:- or -ip:-).\n\n If you know the ID of a user's album, you can list its uploads with albumid key.\n Negation sign works for this key as well.":"There is only 1 filter key, namely albumid.\n albumid key can be specified more than once.\n To match uploads with no albums, use albumid:-.\n\n To exclude certain albums while still listing every other uploads, add negation sign (-) before the keys.\n Negation sign can also be used to exclude uploads with no albums (i.e. -albumid:-).")+'\n\n There are 2 range keys: date (upload date) and expiry (expiry date).\n Their formats are: "YYYY/MM/DD HH:MM:SS-YYYY/MM/DD HH:MM:SS" ("from" date and "to" date respectively),\n unix timestamps in seconds resolution, OR human-readable relative time duration (available units).\n You may choose to specify only either dates.\n If "to" date is missing, \'now\' will be used. If "from" date is missing, \'beginning of time\' will be used.\n If any of the subsequent date or time units are not specified, their first value will be used (e.g. January for month, 1 for day, and so on).\n If only time is specified, today\'s date will be used.\n If you do not need to specify both date and time, you may omit the double quotes.\n In conclusion, the following examples are all valid: date:"2020/01/01 01:23-2018/01/01 06", expiry:-2020/05, date:12:34:56, date:1663976000, date:<7days.\n date and expiry keys can only be specified once each.\n\n What about timezones?\n Feel free to query the dates in your own timezone.\n API requests to the filter endpoint will attach your browser\'s timezone offset, so the server will automatically calculate timezone differences.\n\n Matches can also be sorted with sort keys.\n Their format is: sort:columnName[:d[escending]], where :d[escending] is an optional tag to set the direction to descending.\n This key must be used with internal column names used in the database (id, '+(a?"userid":"albumid")+", and so on),\n but there are 2 shortcuts available: date for timestamp column and expiry for expirydate column.\n Set your uploads view to \"List view\", then hover any of the table's column headers to see tooltips displaying their internal column names.\n sort key can be specified more than once, where their order will decide the sorting steps.\n\n Finally, there are type-is keys to refine by types.\n You can use is:image, is:video, and is:audio to list images, videos, audios respectively.\n This will only use image, video and audio extensions that are whitelisted internally in the safe.\n For images and videos specifically, they will be the ones whose thumbnails can be generated by the safe.\n Negation sign works for this key as well.\n Mixing inclusion and exclusion is not allowed (i.e. is:image -is:video), since the second key will be redundant.\n\n Alternatively, you can filter by their actual mime types using type keys.\n For example, type:image/jpeg, type:video/mp4.\n Negation sign works for this key as well.\n\n Any leftover keywords which do not use keys (non-keyed keywords) will be matched against the matches' randomly generated and original names.\n Excluding certain keywords is also supported by adding negation sign before the keywords.\n\n Internal steps:\n "+(a?"- Query uploads passing ALL exclusion filter keys OR matching ANY filter keys, if any.\n - Refine matches":"- Filter uploads")+" using date key, if any.\n - Refine matches using expiry key, if any.\n - Refine matches using type-is keys, if any.\n - Refine matches using type keys, if any.\n - Refine matches using ANY non-keyed keywords, if any.\n - Filter matches using ALL exclusion non-keyed keywords, if any.\n - Sort matches using sort keys, if any.\n\n Examples:\n "+(a?'- Uploads from users named "demo" AND/OR "John Doe" AND/OR non-registered users:\n user:demo user:"John Doe" user:-\n - ALL uploads, but NOT the ones from user named "demo" AND "John Doe":\n -user:demo -user:"John Doe"\n - Uploads from IP "127.0.0.1" AND which file names match "*.rar" OR "*.zip":\n ip:127.0.0.1 *.rar *.zip\n ':"")+'- Uploads without albums:\n albumid:-\n - ALL uploads, but NOT the ones from album with ID 69:\n -albumid:69\n - Uploads uploaded since "1 June 2019 00:00:00":\n date:2019/06\n - Uploads uploaded between "7 April 2020 12:00:00" and "7 April 2020 23:59:59":\n date:"2020/04/07 12-2020/04/07 23:59:59"\n - Uploads uploaded before "5 February 2020 00:00:00":\n date:-2020/02/05\n - Uploads uploaded within the last 24 hours (1 day):\n date:<1d\n - Uploads uploaded before the last 6 months:\n date:>6months\n - Uploads that will expire within the next 7 days and 12 hours:\n expiry:"<7 days 12 hours"\n - Uploads which file names match "*.gz" but NOT "*.tar.gz":\n *.gz -*.tar.gz\n - Sort matches by "size" column in ascending and descending order respectively:\n '+(a?'user:"John Doe"':"*.txt")+" sort:size\n *.mp4 "+(a?"user:- ":"")+"sort:size:d\n "+(page.permissions.moderator?"":"Notice: Regular users may face some limitations in the amount of keys that can be used at a time.")+"\n Friendly reminder: This window can be scrolled up!\n ").trim().replace(/^\s*/g,"").replace(/\n/g,"
"),swal({content:t}).then((function(){document.body.querySelector(".swal-overlay .swal-modal").classList.remove("is-expanded")})),document.body.querySelector(".swal-overlay .swal-modal:not(.is-expanded)").classList.add("is-expanded")},uniquifyUploadsFilters:function(e){return e.trim().replace(/\t/g," ").replace(/(^|\s)((albumid|ip|user|date|expiry|is|sort|orderby):)\s+/gi,"$2").split(" ").filter((function(e,a,t){if(!e)return!1;var n=e.match(/^(sort|orderby):(\w+)(:.*)?$/i);if(n&&n[2]){var s=t.findLastIndex((function(e){return new RegExp("^(sort|orderby):"+n[2]+"(:.*)?$","i").test(e)}));return s===a}return a===t.lastIndexOf(e)}))},filterUploads:function(e){var a=document.querySelector("#"+(e.dataset.filtersid||"filters")).value,t=page.uniquifyUploadsFilters(a);page.getUploads(Object.assign(page.views[page.currentView],{filters:t.join(" "),pageNum:0,trigger:e}))},sortUploads:function(e){var a=e.title;if(a){var t=a.match(/^key: (.*)$/i);if(t&&t[1]){var n=e.dataset.defaultSort||"asc",s=new RegExp("^(sort|orderby):("+t[1]+")(:.*)?$","i"),i=document.querySelector("#filters").value,l=page.uniquifyUploadsFilters(i),r=n,o=l.filter((function(e,a,t){var n=e.match(s);return!n||!n[2]||(n[3]&&(r=/^:d/i.test(n[3])?"asc":"desc"),!1)}));o.push("sort:"+t[1]+":"+r),page.getUploads(Object.assign(page.views[page.currentView],{filters:o.join(" "),pageNum:0,trigger:e}))}}},filterUploadsWith:function(e){var a=e.dataset.actionData||"",t=page.uniquifyUploadsFilters(a);page.getUploads({all:!0,filters:t.join(" "),pageNum:0,trigger:document.querySelector("#itemManageUploads")})},filterUploadsByType:function(e){var a=e.innerText.trim();if(a){var t=/\s/.test(a)?'"'+a+'"':a;page.getUploads({all:!0,filters:"type:"+t,pageNum:0,trigger:document.querySelector("#itemManageUploads")})}},viewUserUploads:function(e,a){var t=page.cache[e];if(t){a.classList.add("is-loading");var n=/\s/.test(t.username)?'"'+t.username+'"':t.username;page.getUploads({all:!0,filters:"user:"+n,trigger:document.querySelector("#itemManageUploads")})}},viewAlbumUploads:function(e,a){if(page.cache[e]){a.classList.add("is-loading");var t="albumsAll"===page.currentView&&page.permissions.moderator;page.getUploads({all:t,filters:"albumid:"+e,trigger:t?document.querySelector("#itemManageUploads"):document.querySelector("#itemUploads")})}},deleteUpload:function(e){page.postBulkDeleteUploads({all:"uploadsAll"===page.currentView,field:"id",values:[e],cb:function(a){!a.length&&page.selected[page.currentView].includes(e)&&page.selected[page.currentView].splice(page.selected[page.currentView].indexOf(e),1),page.selected[page.currentView].length?localStorage[lsKeys.selected[page.currentView]]=JSON.stringify(page.selected[page.currentView]):delete localStorage[lsKeys.selected[page.currentView]],page.getUploads(Object.assign(page.views[page.currentView],{autoPage:!0}))}})},bulkDeleteUploads:function(){if(!page.selected[page.currentView].length)return swal("An error occurred!","You have not selected any uploads.","error");page.postBulkDeleteUploads({all:"uploadsAll"===page.currentView,field:"id",values:page.selected[page.currentView],cb:function(e){e.length?page.selected[page.currentView]=page.selected[page.currentView].filter((function(a){return e.includes(a)})):page.selected[page.currentView]=[],page.selected[page.currentView].length?localStorage[lsKeys.selected[page.currentView]]=JSON.stringify(page.selected[page.currentView]):delete localStorage[lsKeys.selected[page.currentView]],page.getUploads(Object.assign(page.views[page.currentView],{autoPage:!0}))}})},deleteUploadsByNames:function(e){void 0===e&&(e={});var a="";page.permissions.moderator&&(a="
Hint: You can use this feature to delete uploads by other users."),page.dom.innerHTML='\n
\n
\n \n
\n \n
\n

Separate each entry with a new line.'+a+'

\n
\n
\n
\n \n
\n
\n
\n ',page.fadeIn(page.dom),page.scrollTo(page.dom),page.updateTrigger(e.trigger,"active"),document.querySelector("#submitBulkDelete").addEventListener("click",(function(){if(page.isSomethingLoading)return page.warnSomethingLoading();var e=document.querySelector("#bulkDeleteNames"),a={},t=e.value.split(/\r?\n/).map((function(e){var a=e.trim();return/^[^\s]+$/.test(a)?a:""})).filter((function(e){return!(!e||Object.prototype.hasOwnProperty.call(a,e))&&(a[e]=!0)}));if(e.value=t.join("\n"),!t.length)return swal("An error occurred!","You have not entered any upload names.","error");page.postBulkDeleteUploads({all:!0,field:"name",values:t,cb:function(a){e.value=a.join("\n")}})}))},postBulkDeleteUploads:function(e){void 0===e&&(e={});var a=e.values.length,t=e.values.length+" upload"+(1===a?"":"s"),n="

You won't be able to recover "+t.replace(/^(\d*)(.*)/,"$1$2")+"!

";e.all&&(n+="\n

Warning: You may be nuking "+(1===a?"an upload":"some uploads")+" by "+(1===a?"another user":"other users")+"!

");var s=document.createElement("div");s.innerHTML=n,swal({title:"Are you sure?",content:s,icon:"warning",dangerMode:!0,buttons:{cancel:!0,confirm:{text:"Yes, nuke "+(1===e.values.length?"it":"them")+"!",closeModal:!1}}}).then((function(n){n&&axios.post("api/upload/bulkdelete",{field:e.field,values:e.values}).then((function(n){if(n){if(!1===n.data.success)return"No token provided"===n.data.description?page.verifyToken(page.token):swal("An error occurred!",n.data.description,"error");var s=Array.isArray(n.data.failed)?n.data.failed:[];s.length===e.values.length?swal("An error occurred!","Unable to delete any of the "+t+".","error"):s.length&&s.length\n

You are about to add '+t+" upload"+(1===t?"":"s")+' to an album.

\n

If an upload is already in an album, it will be moved.

\n \n
\n
\n
\n \n
\n
\n
\n ',swal({icon:"warning",content:n,buttons:{cancel:!0,confirm:{text:"OK",closeModal:!1}}}).then((function(t){if(t){var n=parseInt(document.querySelector("#swalAlbum").value);if(isNaN(n))return swal("An error occurred!","You did not choose an album.","error");axios.post("api/albums/addfiles",{ids:e,albumid:n}).then((function(t){if(t)if(!1!==t.data.success){var s=e.length;t.data.failed&&t.data.failed.length&&(s-=t.data.failed.length);var i="upload"+(1===e.length?"":"s");if(!s)return swal("An error occurred!","Could not add the "+i+" to the album.","error");swal("Woohoo!","Successfully "+(n<0?"removed":"added")+" "+s+" "+i+" "+(n<0?"from":"to")+" the album.","success",{buttons:!1,timer:1500}),a(t.data.failed)}else"No token provided"===t.data.description?page.verifyToken(page.token):swal("An error occurred!",t.data.description,"error")})).catch(page.onAxiosError)}})),axios.get("api/albums",{headers:{simple:"1"}}).then((function(e){if(!1!==e.data.success){var a=document.querySelector("#swalAlbum");a&&(a.innerHTML+=e.data.albums.map((function(e){return'"})).join("\n"),a.getElementsByTagName("option")[1].innerHTML="Choose an album",a.removeAttribute("disabled"))}else"No token provided"===e.data.description?page.verifyToken(page.token):swal("An error occurred!",e.data.description,"error")})).catch(page.onAxiosError)},getAlbums:function(e){if(void 0===e&&(e={}),e&&e.all&&!page.permissions.moderator)return swal("An error occurred!","You cannot do this!","error");if(page.isSomethingLoading)return page.warnSomethingLoading();page.updateTrigger(e.trigger,"loading"),"number"!=typeof e.pageNum&&(e.pageNum=0);var a={};e.all&&(a.all="1");var t="api/albums/"+e.pageNum;axios.get(t,{headers:a}).then((function(a){if(a){if(!1===a.data.success)return"No token provided"===a.data.description?page.verifyToken(page.token):(page.updateTrigger(e.trigger),swal("An error occurred!",a.data.description,"error"));var t=a.data.albumsPerPage||25,n=Math.ceil(a.data.count/t),s=a.data.albums;if(e.pageNum&&0===s.length)return page.updateTrigger(e.trigger),e.autoPage?(e.pageNum=n-1,page.getAlbums(e)):swal("An error occurred!","There are no more albums to populate page "+(e.pageNum+1)+".","error");page.currentView=e.all?"albumsAll":"albums",page.cache={};var i=a.data.users,l=a.data.homeDomain||window.location.origin;e.pageNum<0&&(e.pageNum=Math.max(0,n+e.pageNum));var r=page.paginate(a.data.count,t,e.pageNum),o='\n
\n '+('\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n
\n ')+'\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
\n ',d='\n \n ",c="bFilters",p="bJumpToPage",u=o.replace(/id="filters"/,'id="'+c+'"').replace(/(data-action="filter-uploads")/,'$1 data-filtersid="'+c+'"').replace(/id="jumpToPage"/,'id="'+p+'"').replace(/(data-action="jump-to-page")/g,'$1 data-jumpid="'+p+'"'),g=r.replace(/(data-action="page-ellipsis")/g,'$1 data-jumpid="'+p+'"'),m=!1,b='\n

Create new album

\n
\n
\n
\n \n
\n

Max length is '+page.albumTitleMaxLength+' characters.

\n
\n
\n
\n \n
\n

Max length is '+page.albumDescMaxLength+' characters.

\n
\n
\n
\n \n
\n
\n
\n
\n ';page.dom.innerHTML="\n "+(e.all?"":b)+"\n "+r+"\n "+o+"\n "+d+'\n
\n \n \n \n \n \n \n '+(e.all?"":"")+'\n \n \n \n \n \n \n \n \n \n \n \n
IDNameUserUploadsSizeCreated atZIP sizeZIP generated atPublic link('+a.data.count+' total)
\n
\n '+d+"\n "+u+"\n "+g+"\n ";for(var h=document.querySelector("#table"),f=0;fv.editedAt);var x=0!==v.enabled;page.cache[v.id]={name:v.name,download:v.download,public:v.public,description:v.description,descriptionHtml:v.descriptionHtml,enabled:x,homeDomain:l,urlPath:"/a/",identifier:v.identifier};var S=document.createElement("tr");S.dataset.id=v.id,S.innerHTML='\n \n "+v.id+"\n "+v.name+"\n "+(e.all?""+(v.userid&&i[v.userid]||"")+"":"")+"\n "+v.uploads+'\n '+page.getPrettyBytes(v.size)+'\n '+v.prettyDate+"\n "+(v.hasZip?page.getPrettyBytes(v.zipSize):"-")+"\n "+(v.hasZip?v.prettyZipDate:"-")+"\n '+y+'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '+(e.all?'\n \n \n \n ':"")+"\n \n ",h.appendChild(S),page.checkboxes=h.querySelectorAll('.checkbox[data-action="select"]')}var T=document.querySelector("#selectAll");s.length&&T&&!m&&(T.checked=!0,T.title="Unselect all"),page.fadeIn(page.dom);var A=s.length?e.pageNum:0;(e.forceScroll||null===page.prevPageNums[page.currentView]||page.prevPageNums[page.currentView]!==A)&&page.scrollTo(page.dom),page.updateTrigger(e.trigger,"active"),"albumsAll"===page.currentView&&(page.views[page.currentView].filters=e.filters),page.views[page.currentView].pageNum=page.prevPageNums[page.currentView]=A}})).catch((function(a){page.updateTrigger(e.trigger),page.onAxiosError(a)}))},editAlbum:function(e){var a=page.cache[e];if(a){var t=a.urlPath+a.identifier,n=a.homeDomain+t,s=document.createElement("div");s.innerHTML='\n
\n
\n \n
\n

Max length is '+page.albumTitleMaxLength+' characters.

\n
\n
\n
\n \n
\n

Markdown supported. Max length is '+page.albumDescMaxLength+" characters.

\n
\n "+(a.descriptionHtml?'
\n
\n '+a.descriptionHtml+'\n
\n

Save changes then re-open this Edit prompt to refresh this preview.

\n
':"")+"\n "+("albumsAll"===page.currentView&&page.permissions.moderator?'
\n
\n \n
\n
":"")+'\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n

Current public link: '+t+"

\n
\n ",swal({title:"Edit album",icon:"info",content:s,buttons:{cancel:!0,confirm:{closeModal:!1}}}).then((function(t){if(t){var n={id:e,name:document.querySelector("#swalName").value.trim(),description:document.querySelector("#swalDescription").value.trim(),download:document.querySelector("#swalDownload").checked,public:document.querySelector("#swalPublic").checked,requestLink:document.querySelector("#swalRequestLink").checked};"albumsAll"===page.currentView&&page.permissions.moderator&&(n.enabled=document.querySelector("#swalEnabled").checked),axios.post("api/albums/edit",n).then((function(e){if(e){if(!1===e.data.success)return"No token provided"===e.data.description?page.verifyToken(page.token):swal("An error occurred!",e.data.description,"error");e.data.identifier?swal("Success!","The album's new identifier is: "+e.data.identifier+".","success"):e.data.name!==a.name?swal("Success!","The album was renamed to: "+e.data.name+".","success"):swal("Success!","The album was edited.","success",{buttons:!1,timer:1500}),page.getAlbumsSidebar(),page.getAlbums(Object.assign(page.views[page.currentView],{autoPage:!0}))}})).catch(page.onAxiosError)}}))}},disableAlbum:function(e){swal({title:"Are you sure?",text:"This won't delete the uploads associated with the album!",icon:"warning",dangerMode:!0,buttons:{cancel:!0,confirm:{text:"Yes, disable it!",closeModal:!1},purge:{text:"Umm, delete the uploads, please?",value:"purge",className:"swal-button--danger",closeModal:!1}}}).then((function(a){a&&axios.post("api/albums/disable",{id:e,purge:"purge"===a}).then((function(e){if(!1===e.data.success){var a=Array.isArray(e.data.failed)?e.data.failed:[];return"No token provided"===e.data.description?page.verifyToken(page.token):a.length?swal("An error occurred!","Unable to delete "+a.length+" of the album's upload"+(1===a.length?"":"s")+".","error"):swal("An error occurred!",e.data.description,"error")}swal("Disabled!","The album has been disabled.","success",{buttons:!1,timer:1500}),page.getAlbumsSidebar(),page.getAlbums(Object.assign(page.views[page.currentView],{autoPage:!0}))})).catch(page.onAxiosError)}))},deleteAlbum:function(e){swal({title:"Are you sure?",text:"You won't be able to recover this album!\nThis also won't delete the uploads associated with the album!",icon:"warning",dangerMode:!0,buttons:{cancel:!0,confirm:{text:"Yes, delete it!",closeModal:!1},purge:{text:"Umm, delete the uploads, please?",value:"purge",className:"swal-button--danger",closeModal:!1}}}).then((function(a){a&&axios.post("api/albums/delete",{id:e,purge:"purge"===a}).then((function(e){if(!1===e.data.success){var a=Array.isArray(e.data.failed)?e.data.failed:[];return"No token provided"===e.data.description?page.verifyToken(page.token):a.length?swal("An error occurred!","Unable to delete "+a.length+" of the album's upload"+(1===a.length?"":"s")+".","error"):swal("An error occurred!",e.data.description,"error")}swal("Disabled!","The album has been deleted.","success",{buttons:!1,timer:1500}),page.getAlbumsSidebar(),page.getAlbums(Object.assign(page.views[page.currentView],{autoPage:!0}))})).catch(page.onAxiosError)}))},submitAlbum:function(e){page.updateTrigger(e,"loading"),axios.post("api/albums",{name:document.querySelector("#albumName").value.trim(),description:document.querySelector("#albumDescription").value.trim()}).then((function(a){if(a){if(page.updateTrigger(e),!1===a.data.success)return"No token provided"===a.data.description?page.verifyToken(page.token):swal("An error occurred!",a.data.description,"error");swal("Woohoo!","Album was created successfully.","success",{buttons:!1,timer:1500}),page.getAlbumsSidebar(),page.getAlbums({pageNum:-1})}})).catch((function(a){page.updateTrigger(e),page.onAxiosError(a)}))},getAlbumsSidebar:function(){axios.get("api/albums",{headers:{simple:"1"}}).then((function(e){if(e){if(!1===e.data.success)return"No token provided"===e.data.description?page.verifyToken(page.token):swal("An error occurred!",e.data.description,"error");var a=e.data.albums,t=e.data.count,n=document.querySelector("#albumsSidebar"),s=n.querySelectorAll("li > a"),i=s.length!==t;if(s.length){for(var l=0;l\n \n
\n
\n \n
\n
\n \n \n ',page.fadeIn(page.dom),page.scrollTo(page.dom),page.updateTrigger(e.trigger,"active"),document.querySelector("#getNewToken").addEventListener("click",(function(e){if(page.isSomethingLoading)return page.warnSomethingLoading();var a=e.currentTarget;page.updateTrigger(a,"loading"),axios.post("api/tokens/change").then((function(e){if(!1===e.data.success)return"No token provided"===e.data.description?page.verifyToken(page.token):(page.updateTrigger(a),swal("An error occurred!",e.data.description,"error"));page.updateTrigger(a),swal({title:"Woohoo!",text:"Your token was successfully changed.",icon:"success",buttons:!1,timer:1500}).then((function(){axios.defaults.headers.common.token=e.data.token,localStorage[lsKeys.token]=e.data.token,page.token=e.data.token,page.changeToken()}))})).catch((function(e){page.updateTrigger(a),page.onAxiosError(e)}))}))},changePassword:function(e){void 0===e&&(e={}),page.dom.innerHTML='\n
\n
\n \n
\n \n
\n
\n
\n \n
\n \n
\n
\n
\n
\n \n
\n
\n
\n ',page.fadeIn(page.dom),page.scrollTo(page.dom),page.updateTrigger(e.trigger,"active"),document.querySelector("#sendChangePassword").addEventListener("click",(function(e){if(page.isSomethingLoading)return page.warnSomethingLoading();page.dom.querySelector("form").checkValidity()&&(document.querySelector("#password").value===document.querySelector("#passwordConfirm").value?page.sendNewPassword(document.querySelector("#password").value,e.currentTarget):swal({title:"Password mismatch!",text:"Your passwords do not match, please try again.",icon:"error"}))}))},sendNewPassword:function(e,a){page.updateTrigger(a,"loading"),axios.post("api/password/change",{password:e}).then((function(e){if(!1===e.data.success)return"No token provided"===e.data.description?page.verifyToken(page.token):(page.updateTrigger(a),swal("An error occurred!",e.data.description,"error"));page.updateTrigger(a),swal({title:"Woohoo!",text:"Your password was successfully changed.",icon:"success",buttons:!1,timer:1500}).then((function(){page.changePassword()}))})).catch((function(e){page.updateTrigger(a),page.onAxiosError(e)}))},getUsers:function(e){if(void 0===e&&(e={}),!page.permissions.admin)return swal("An error occurred!","You cannot do this!","error");if(page.isSomethingLoading)return page.warnSomethingLoading();page.updateTrigger(e.trigger,"loading"),"number"!=typeof e.pageNum&&(e.pageNum=0);var a="api/users/"+e.pageNum;axios.get(a).then((function(a){if(!1===a.data.success)return"No token provided"===a.data.description?page.verifyToken(page.token):(page.updateTrigger(e.trigger),swal("An error occurred!",a.data.description,"error"));var t=a.data.usersPerPage||25,n=Math.ceil(a.data.count/t),s=a.data.users;if(e.pageNum&&0===s.length)return page.updateTrigger(e.trigger),e.autoPage?(e.pageNum=n-1,page.getUsers(e)):swal("An error occurred!","There are no more users to populate page "+(e.pageNum+1)+".","error");page.currentView="users",page.cache={},e.pageNum<0&&(e.pageNum=Math.max(0,n+e.pageNum));var i=page.paginate(a.data.count,t,e.pageNum),l='\n
\n '+('\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n
\n ')+'\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
\n ',r='\n \n ',o="bFilters",d="bJumpToPage",c=l.replace(/id="filters"/,'id="'+o+'"').replace(/(data-action="filter-uploads")/,'$1 data-filtersid="'+o+'"').replace(/id="jumpToPage"/,'id="'+d+'"').replace(/(data-action="jump-to-page")/g,'$1 data-jumpid="'+d+'"'),p=i.replace(/(data-action="page-ellipsis")/g,'$1 data-jumpid="'+d+'"'),u=!1;page.dom.innerHTML="\n "+i+"\n "+l+"\n "+r+'\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
UsernameUploadsUsageGroupRegistration dateLast token update('+a.data.count+' total)
\n
\n '+r+"\n "+c+"\n "+p+"\n ";for(var g=document.querySelector("#table"),m=0;m\n "+b.username+"\n "+b.uploads+"\n "+page.getPrettyBytes(b.usage)+"\n "+f+"\n "+k+"\n "+x+'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ',g.appendChild(S),page.checkboxes=g.querySelectorAll('.checkbox[data-action="select"]')}var T=document.querySelector("#selectAll");s.length&&T&&!u&&(T.checked=!0,T.title="Unselect all"),page.fadeIn(page.dom);var A=s.length?e.pageNum:0;(e.forceScroll||null===page.prevPageNums[page.currentView]||page.prevPageNums[page.currentView]!==A)&&page.scrollTo(page.dom),page.updateTrigger(e.trigger,"active"),page.views[page.currentView].pageNum=page.prevPageNums[page.currentView]=A})).catch((function(a){page.updateTrigger(e.trigger),page.onAxiosError(a)}))},createUser:function(){var e=Object.keys(page.permissions).map((function(e,a,t){return'"})).join("\n"),a=document.createElement("div");a.innerHTML='\n
\n \n
\n \n
\n
\n
\n \n
\n \n
\n
\n
\n \n
\n
\n \n
\n
\n
\n ",swal({title:"Create new user",icon:"info",content:a,buttons:{cancel:!0,confirm:{closeModal:!1}}}).then((function(e){e&&axios.post("api/users/create",{username:document.querySelector("#swalUsername").value,password:document.querySelector("#swalPassword").value,group:document.querySelector("#swalGroup").value}).then((function(e){if(e){if(!1===e.data.success)return"No token provided"===e.data.description?page.verifyToken(page.token):swal("An error occurred!",e.data.description,"error");var a=document.createElement("div");a.innerHTML="\n

Username: "+e.data.username+"

\n

Password: "+e.data.password+"

\n

User group: "+e.data.group+"

\n ",swal({title:"Created a new user!",icon:"success",content:a}),page.getUsers(Object.assign(page.views.users,{pageNum:-1}))}})).catch(page.onAxiosError)}))},editUser:function(e){var a=page.cache[e];if(a){var t=!1,n=Object.keys(page.permissions).map((function(e,n,s){var i=e===a.displayGroup;return i&&(t=void 0!==s[n+1]&&page.permissions[s[n+1]]),'"})).join("\n"),s=t?"":" disabled",i=document.createElement("div");i.innerHTML='\n
\n

User ID: '+e+'

\n
\n
\n \n
\n \n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n "+(t?"":'
\n You cannot modify user in the same or higher group as you.\n
')+"\n ",swal({title:"Edit user",icon:"info",content:i,buttons:{cancel:!0,confirm:{closeModal:!1}}}).then((function(t){t&&axios.post("api/users/edit",{id:e,username:document.querySelector("#swalUsername").value,group:document.querySelector("#swalGroup").value,enabled:document.querySelector("#swalEnabled").checked,resetPassword:document.querySelector("#swalResetPassword").checked}).then((function(e){if(e){if(!1===e.data.success)return"No token provided"===e.data.description?page.verifyToken(page.token):swal("An error occurred!",e.data.description,"error");var t=!0,n=document.createElement("div"),s=a.username;e.data.update.username!==a.username&&(n.innerHTML+="

"+a.username+" was renamed into: "+e.data.update.username+".

",t=!1,s=e.data.update.username),e.data.update.password&&(n.innerHTML+="\n

"+s+"'s new password is:

\n

"+e.data.update.password+"

\n ",t=!1),e.data.update.enabled!==a.enabled&&(n.innerHTML+="

"+s+" has been "+(e.data.update.enabled?"enabled":"disabled")+"!

"),n.innerHTML||(n.innerHTML="

"+s+" was edited!

"),swal({title:"Success!",icon:"success",content:n,buttons:!t,timer:t?1500:null}),page.getUsers(page.views.users)}})).catch(page.onAxiosError)}))}},disableUser:function(e){var a=page.cache[e];if(a&&a.enabled){var t=document.createElement("div");t.innerHTML="\n

You will be disabling a user named "+page.cache[e].username+".

\n

Their files will remain.

\n ",swal({title:"Are you sure?",icon:"warning",content:t,dangerMode:!0,buttons:{cancel:!0,confirm:{text:"Yes, disable them!",closeModal:!1}}}).then((function(a){a&&axios.post("api/users/disable",{id:e}).then((function(a){if(a){if(!1===a.data.success)return"No token provided"===a.data.description?page.verifyToken(page.token):swal("An error occurred!",a.data.description,"error");swal("Success!",page.cache[e].username+" has been disabled.","success",{buttons:!1,timer:1500}),page.getUsers(page.views.users)}})).catch(page.onAxiosError)}))}},deleteUser:function(e){if(page.cache[e]){var a=document.createElement("div");a.innerHTML="\n

You will be deleting a user named "+page.cache[e].username+".

\n

Their uploads will still remain, unless you choose otherwise.

\n ",swal({title:"Are you sure?",icon:"warning",content:a,dangerMode:!0,buttons:{cancel:!0,confirm:{text:"Yes, ONLY the user!",closeModal:!1},purge:{text:"Yes, AND their uploads too!",value:"purge",className:"swal-button--danger",closeModal:!1}}}).then((function(a){a&&axios.post("api/users/delete",{id:e,purge:"purge"===a}).then((function(a){if(a){if(!1===a.data.success){var t=Array.isArray(a.data.failed)?a.data.failed:[];return"No token provided"===a.data.description?page.verifyToken(page.token):t.length?swal("An error occurred!","Unable to delete "+t.length+" of the user's upload"+(1===t.length?"":"s")+".","error"):swal("An error occurred!",a.data.description,"error")}swal("Success!",page.cache[e].username+" has been deleted.","success",{buttons:!1,timer:1500}),page.getUsers(Object.assign(page.views.users,{autoPage:!0}))}})).catch(page.onAxiosError)}))}},paginate:function(e,a,t){t+=1;var n=Math.ceil(e/a),s="",i=function(e,a){for(var n=e;n<=a;++n)s+='
  • '+n+"
  • "},l=function(){s+='\n
  • 1
  • \n
  • \n '},r=function(){s+='\n
  • \n
  • '+n+"
  • \n "};return 7>=n?i(1,n):t<6?(i(1,6),r()):t>n-6+1?(l(),i(n-6+1,n)):(l(),i(t-3+1,t+3-1),r()),'\n \n "},buildStatisticTable:function(e,a){var t=[],n="",s="";if(a)try{for(var i=Object.keys(a),l=function(e){if("meta"!==i[e]){var t=a[i[e]],n="object"==typeof t&&t,l=n&&t.type||"auto";if("hidden"!==l){var r=n?t.value:t,o=void 0;switch(l){case"byte":o=page.getPrettyBytes(r);break;case"byteUsage":if("object"==typeof r){var d=void 0!==r.available?r.used+r.available:r.total;o=page.getPrettyBytes(r.used)+" / "+page.getPrettyBytes(r.total)+" ("+(r.used/d*100).toFixed(2)+"%)"}else o=r;break;case"detailed":o='\n \n \n '+Object.keys(r).map((function(e){var a=void 0;if("number"==typeof r[e])a=r[e].toLocaleString();else a=r[e];return"\n \n "+e+"\n \n \n "})).join("\n")+"\n \n
    "+a+"
    \n ";break;case"tempC":o="number"==typeof r?r+" C":r;break;case"uptime":o=page.getPrettyUptime(r);break;case"unavailable":o="N/A";break;case"auto":if("number"==typeof r)o=r.toLocaleString();else o=r;break;default:o=r}var c="";n&&t.action&&(c+=' data-action="'+t.action+'"',t.actionData&&(c+=' data-action-data="'+t.actionData+'"')),s+="\n \n "+i[e]+"\n "+o+"\n \n "}}},r=0;r')),void 0!==a.meta.generatedOn&&t.push("Generated on "+page.getPrettyDate(new Date(a.meta.generatedOn))),"number"==typeof a.meta.maxAge?t.push("("+a.meta.maxAge/1e3+"s)"):t.push("(auto)"))}catch(e){s="\n \n Error parsing response. Try again?\n \n \n ",page.onError(e)}else s+="\n \n Still being generated, please try again later…\n \n \n ";return"\n \n \n \n \n \n \n \n \n \n "+s+"\n \n
    '+e+''+t.join(" ")+"
    \n \n "},getStatistics:function(e){if(void 0===e&&(e={}),!page.permissions.admin)return swal("An error occurred!","You cannot do this!","error");if(page.isSomethingLoading)return page.warnSomethingLoading();page.updateTrigger(e.trigger,"loading");axios.get("api/stats").then((function(a){if(!1===a.data.success)return"No token provided"===a.data.description?page.verifyToken(page.token):(page.updateTrigger(e.trigger),swal("An error occurred!",a.data.description,"error"));for(var t="",n=Object.keys(a.data.stats),s=0;s\n
    \n Time taken: '+a.data.hrtime[0]+"s "+Math.ceil(a.data.hrtime[1]/1e6)+"ms.\n
    \n \n "),page.dom.innerHTML=t,page.fadeIn(page.dom),page.scrollTo(page.dom),page.updateTrigger(e.trigger,"active")})).catch((function(a){page.updateTrigger(e.trigger),page.onAxiosError(a)}))},getStatisticsCategory:function(e){if(void 0===e&&(e={}),!page.permissions.admin)return swal("An error occurred!","You cannot do this!","error");if(page.isSomethingLoading)return page.warnSomethingLoading();if(!e.key)return swal("An error occurred!","Missing stats category key!","error");page.updateTrigger(e.trigger,"loading");var a="api/stats/"+e.key;axios.get(a).then((function(a){if(!1===a.data.success)return"No token provided"===a.data.description?page.verifyToken(page.token):(page.updateTrigger(e.trigger),swal("An error occurred!",a.data.description,"error"));var t=Object.entries(a.data.stats).find((function(a){a[0];var t=a[1];return t&&t.meta&&t.meta.key===e.key})),n=t[0],s=t[1];if(!n)return swal("An error occurred!","Server did not return required stats data.","error");var i=document.querySelector("#stats-"+e.key);if(i){if(i.innerHTML=page.buildStatisticTable(n,s),Array.isArray(a.data.hrtime)){var l=document.querySelector("#stats-hrtime");l&&(l.innerHTML='\n
    \n
    \n Time taken: '+a.data.hrtime[0]+"s "+Math.ceil(a.data.hrtime[1]/1e6)+"ms.\n
    \n
    \n ")}page.fadeIn(i),page.updateTrigger(e.trigger,"active")}})).catch((function(a){page.updateTrigger(e.trigger),page.onAxiosError(a)}))},reloadStatsCategory:function(e){var a=e.dataset.key;a&&page.getStatisticsCategory({key:a,trigger:document.querySelector("#itemStatistics")})}};window.addEventListener("DOMContentLoaded",(function(){"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,a){"use strict";var t=arguments;if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),s=1;s