function_taggedTemplateLiteral(e,t){returnObject.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}functiongup(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");vart="[\\?&]"+e+"=([^&#]*)",n=newRegExp(t),o=n.exec(window.location.href);returnnull===o?"":o[1]}!function(e,t){"object"==typeofmodule&&"object"==typeofmodule.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)thrownewError("jQuery requires a window with a document");returnt(e)}:t(e)}("undefined"!=typeofwindow?window:this,function(e,t){functionn(e){vart="length"ine&&e.length,n=J.type(e);return"function"===n||J.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeoft&&t>0&&t-1ine}functiono(e,t,n){if(J.isFunction(t))returnJ.grep(e,function(e,o){return!!t.call(e,o,e)!==n});if(t.nodeType)returnJ.grep(e,function(e){returne===t!==n});if("string"==typeoft){if(re.test(t))returnJ.filter(t,e,n);t=J.filter(t,e)}returnJ.grep(e,function(e){returnX.call(t,e)>=0!==n})}functioni(e,t){for(;(e=e[t])&&1!==e.nodeType;);returne}functiona(e){vart=fe[e]={};returnJ.each(e.match(he)||[],function(e,n){t[n]=!0}),t}functions(){Z.removeEventListener("DOMContentLoaded",s,!1),e.removeEventListener("load",s,!1),J.ready()}functionr(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=J.expando+r.uid++}functionl(e,t,n){varo;if(void0===n&&1===e.nodeType)if(o="data-"+t.replace(we,"-$1").toLowerCase(),n=e.getAttribute(o),"string"==typeofn){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:ye.test(n)?J.parseJSON(n):n}catch(i){}ve.set(e,t,n)}elsen=void0;returnn}functionc(){return!0}functionu(){return!1}functiond(){try{returnZ.activeElement}catch(e){}}functionp(e,t){returnJ.nodeName(e,"table")&&J.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}functionh(e){returne.type=(null!==e.getAttribute("type"))+"/"+e.type,e}functionf(e){vart=Pe.exec(e.type);returnt?e.type=t[1]:e.removeAttribute("type"),e}functionm(e,t){for(varn=0,o=e.length;o>n;n++)ge.set(e[n],"globalEval",!t||ge.get(t[n],"globalEval"))}functionb(e,t){varn,o,i,a,s,r,l,c;if(1===t.nodeType){if(ge.hasData(e)&&(a=ge.access(e),s=ge.set(t,a),c=a.events)){deletes.handle,s.events={};for(iinc)for(n=0,o=c[i].length;o>n;n++)J.event.add(t,i,c[i][n])}ve.hasData(e)&&(r=ve.access(e),l=J.extend({},r),ve.set(t,l))}}functiong(e,t){varn=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];returnvoid0===t||t&&J.nodeName(e,t)?J.merge([e],n):n}functionv(e,t){varn=t.nodeName.toLowerCase();"input"===n&&_e.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}functiony(t,n){varo,i=J(n.createElement(t)).appendTo(n.body),a=e.getDefaultComputedStyle&&(o=e.getDefaultComputedStyle(i[0]))?o.display:J.css(i[0],"display");returni.detach(),a}functionw(e){vart=Z,n=Fe[e];returnn||(n=y(e,t),"none"!==n&&n||(Re=(Re||J("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement),t=Re[0].contentDocument,t.write(),t.close(),n=y(e,t),Re.detach()),Fe[e]=n),n}functionx(e,t,n){varo,i,a,s,r=e.style;returnn=n||Be(e),n&&(s=n.getPropertyValue(t)||n[t]),n&&(""!==s||J.contains(e.ownerDocument,e)||(s=J.style(e,t)),Ue.test(s)&&He.test(t)&&(o=r.width,i=r.minWidth,a=r.maxWidth,r.minWidth=r.maxWidth=r.width=s,s=n.width,r.width=o,r.minWidth=i,r.maxWidth=a)),void0!==s?s+"":s}functionj(e,t){return{get:function(){returne()?voiddeletethis.get:(this.get=t).apply(this,arguments)}}}functionT(e,t){if(tine)returnt;for(varn=t[0].toUpperCase()+t.slice(1),o=t,i=Ve.length;i--;)if(t=Ve[i]+n,tine)returnt;returno}function_(e,t,n){varo=ze.exec(t);returno?Math.max(0,o[1]-(n||0))+(o[2]||"px"):t}functionk(e,t,n,o,i){for(vara=n===(o?"border":"content")?4:"width"===t?1:0,s=0;4>a;a+=2)"margin"===n&&(s+=J.css(e,n+je[a],!0,i)),o?("content"===n&&(s-=J.css(e,"padding"+je[a],!0,i)),"margin"!==n&&(s-=J.css(e,"border"+je[a]+"Width",!0,i))):(s+=J.css(e,"
!0},l=function(e){p();vart=n("input[name='"+e+"']");t.classList.add("error"),t.select(),n().classList.remove("basicModal--fadeIn","basicModal--shake"),setTimeout(function(){returnn().classList.add("basicModal--shake")},1)},c=function(){returnnull!=n()?!0:!1},u=function(){vare=n("#basicModal__action");returnnull!=e?(e.click(),!0):!1},d=function(){vare=n("#basicModal__cancel");returnnull!=e?(e.click(),!0):!1},p=function(){for(vare=n(".basicModal__button",!0),t=0;t<e.length;++t)e[t].classList.remove("basicModal__button--active");for(varo=n("input",!0),t=0;t<o.length;++t)o[t].classList.remove("error");return!0},h=function(t){if(c()===!1)return!1;t!==!0&&(t=!1);varo=n().parentElement;return"false"===o.getAttribute("data-closable")&&t===!1?!1:(o.classList.remove("basicModalContainer--fadeIn"),o.classList.add("basicModalContainer--fadeOut"),setTimeout(function(){returno.parentNode.removeChild(o)},300),null!=e&&(e.focus(),e=null),!0)};return{THEME:t,show:r,visible:c,getValues:a,action:u,cancel:d,error:l,reset:p,close:h}});var_templateObject=_taggedTemplateLiteral(["<p>Are you sure you want to delete the album '$","' and all of the photos it contains? This action can't be undone!</p>"],["<p>Are you sure you want to delete the album '$","' and all of the photos it contains? This action can't be undone!</p>"]),_templateObject2=_taggedTemplateLiteral(["<p>Are you sure you want to delete all $"," selected albums and all of the photos they contain? This action can't be undone!</p>"],["<p>Are you sure you want to delete all $"," selected albums and all of the photos they contain? This action can't be undone!</p>"]),_templateObject3=_taggedTemplateLiteral(["<input class='text' name='title' type='text' maxlength='50' placeholder='Title' value='$","'>"],["<input class='text' name='title' type='text' maxlength='50' placeholder='Title' value='$","'>"]),_templateObject4=_taggedTemplateLiteral(["<p>Enter a new title for this album: ","</p>"],["<p>Enter a new title for this album: ","</p>"]),_templateObject5=_taggedTemplateLiteral(["<p>Enter a title for all $"," selected albums: ","</p>"],["<p>Enter a title for all $"," selected albums: ","</p>"]),_templateObject6=_taggedTemplateLiteral(["<p>Please enter a description for this album: <input class='text' name='description' type='text' maxlength='800' placeholder='Description' value='$","'></p>"],["<p>Please enter a description for this album: <input class='text' name='description' type='text' maxlength='800' placeholder='Description' value='$","'></p>"]),_templateObject7=_taggedTemplateLiteral(["<p>Are you sure you want to merge the album '$","' into the album '$","'?</p>"],["<p>Are you sure you want to merge the album '$","' into the album '$","'?</p>"]),_templateObject8=_taggedTemplateLiteral(["<p>Are you sure you want to merge all selected albums into the album '$","'?</p>"],["<p>Are you sure you want to merge all selected albums into the album '$","'?</p>"]),_templateObject9=_taggedTemplateLiteral(["<svg class='iconic $","'><use xlink:href='#$","' /></svg>"],["<svg class='iconic $","'><use xlink:href='#$","' /></svg>"]),_templateObject10=_taggedTemplateLiteral(["<div class='divider'><h1>$","</h1></div>"],["<div class='divider'><h1>$","</h1></div>"]),_templateObject11=_taggedTemplateLiteral(["<div id='$","' class='edit'>","</div>"],["<div id='$","' class='edit'>","</div>"]),_templateObject12=_taggedTemplateLiteral(["<div id='multiselect' style='top: $","px; left: $","px;'></div>"],["<div id='multiselect' style='top: $","px; left: $","px;'></div>"]),_templateObject13=_taggedTemplateLiteral(["\n <div class='album' data-id='$","'>\n <img src='$","' width='200' height='200' alt='thumb' data-overlay='false'>\n <img src='$","' width='200' height='200' alt='thumb' data-overlay='false'>\n <img src='$","' width='200' height='200' alt='thumb' data-overlay='$","'>\n <div class='overlay'>\n <h1 title='$","'>$","</h1>\n <a>$","</a>\n </div>\n "],["\n<divclass='album'data-id=
})},photo.deleteTag=function(e,t){varn=void0;n=photo.json.tags.split(","),n.splice(t,1),photo.json.tags=n.toString(),photo.setTags([e],photo.json.tags)},photo.share=function(e,t){varn="",o=photo.getViewLink(e);switch(t){case"twitter":n="https://twitter.com/share?url="+encodeURI(o);break;case"facebook":n="http://www.facebook.com/sharer.php?u="+encodeURI(o)+"&t="+encodeURI(photo.json.title);break;case"mail":n="mailto:?subject="+encodeURI(photo.json.title)+"&body="+encodeURI(o);break;case"dropbox":lychee.loadDropbox(function(){vare=photo.json.title+"."+photo.getDirectLink().split(".").pop();Dropbox.save(photo.getDirectLink(),e)});break;default:n=""}""!==n.length&&(location.href=n)},photo.getSize=function(){vare="big",t=!1,n=""!==photo.json.medium,o=window.devicePixelRatio,i={width:$(window).width()-60,height:$(window).height()-100};return(photo.json.width>i.width||photo.json.height>i.height)&&(t=!0),null!=o&&o>1&&(i.width=i.width*o,i.height=i.height*o),n===!0&&1920>i.width&&1080>i.height&&(e="medium"),t===!1&&photo.json.width<i.width&&photo.json.width<i.height&&(e="small"),e},photo.getArchive=function(e){vart=void0,n=api.path+"?function=Photo::getArchive&photoID="+e;t=location.href.indexOf("index.html")>0?location.href.replace(location.hash,"").replace("index.html",n):location.href.replace(location.hash,"")+n,lychee.publicMode===!0&&(t+="&password="+encodeURIComponent(password.value)),location.href=t},photo.getDirectLink=function(){vare="";returnphoto.json&&photo.json.url&&""!==photo.json.url&&(e=photo.json.url),e},photo.getViewLink=function(e){vart="view.php?p="+e;returnlocation.href.indexOf("index.html")>0?location.href.replace("index.html"+location.hash,t):location.href.replace(location.hash,t)},search={hash:null},search.find=function(e){clearTimeout($(window).data("timeout")),$(window).data("timeout",setTimeout(function(){0!==$("#search").val().length?api.post("search",{term:e},function(e){vart="",n="",o="";e&&e.albums&&(albums.json={albums:e.albums},$.each(albums.json.albums,function(){albums.parse(this),n+=build.album(this)})),e&&e.photos&&(album.json={content:e.photos},$.each(album.json.content,function(){o+=build.photo(this)})),t=""===n&&""===o?"error":""===n?build.divider("Photos")+o:""===o?build.divider("Albums")+n:build.divider("Photos")+o+build.divider("Albums")+n,search.hash!==e.hash&&($(".no_content").remove(),lychee.animate("#content","contentZoomOut"),search.hash=e.hash,setTimeout(function(){"error"===t?(lychee.content.html(""),$("body").append(build.no_content("magnifying-glass"))):(lychee.content.html(t),lychee.animate("#content","contentZoomIn"))},300))}):search.reset()},250))},search.reset=function(){$("#search").val(""),$(".no_content").remove(),null!=search.hash&&(albums.json=null,album.json=null,photo.json=null,search.hash=null,lychee.animate(".divider","fadeOut"),albums.load())},settings={},settings.createConfig=function(){vare=function(e){vart=e.dbName||"",n=e.dbUser||"",o=e.dbPassword||"",i=e.dbHost||"",a=e.dbTablePrefix||"";if(n.length<1)returnbasicModal.error("dbUser"),!1;i.length<1&&(i="localhost"),t.length<1&&(t="lychee");vars={dbName:t,dbUser:n,dbPassword:o,dbHost:i,dbTablePrefix:a};api.post("Database::createConfig",s,function(e){returne!==!0?-1!==e.indexOf("Warning: Connection failed!")?(basicModal.show({body:"<p>Unable to connect to host database because access was denied. Double-check your host, username and password and ensure that access from your current location is permitted.</p>",buttons:{action:{title:"Retry",fn:settings.createConfig}}}),!1):-1!==e.indexOf("Warning: Creation failed!")?(basicModal.show({body:"<p>Unable to create the database. Double-check your host, username and password and ensure that the specified user has the rights to modify and add content to the database.</p>",buttons:{action:{title:"Retry",fn:settings.createConfig}}}),!1):-1!==e.indexOf("Warning: Could not create file!")?(basicModal.show({body:"<p>Unabletosavethisconfiguration.Permissiondeniedin<b>'data/'</b>. Please set the read, write and execute rights for others in <b>'data/'</b>a