function_taggedTemplateLiteral(t,e){returnObject.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}functiongup(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");vare="[\\?&]"+t+"=([^&#]*)",i=newRegExp(e),n=i.exec(window.location.href);returnnull===n?"":n[1]}!function(t,e){"use strict";"object"==typeofmodule&&"object"==typeofmodule.exports?module.exports=t.document?e(t,!0):function(t){if(!t.document)thrownewError("jQuery requires a window with a document");returne(t)}:e(t)}("undefined"!=typeofwindow?window:this,function(t,e){"use strict";functioni(t,e){e=e||it;vari=e.createElement("script");i.text=t,e.head.appendChild(i).parentNode.removeChild(i)}functionn(t){vare=!!t&&"length"int&&t.length,i=mt.type(t);return"function"!==i&&!mt.isWindow(t)&&("array"===i||0===e||"number"==typeofe&&e>0&&e-1int)}functions(t,e){returnt.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}functiono(t,e,i){returnmt.isFunction(e)?mt.grep(t,function(t,n){return!!e.call(t,n,t)!==i}):e.nodeType?mt.grep(t,function(t){returnt===e!==i}):"string"!=typeofe?mt.grep(t,function(t){returnrt.call(e,t)>-1!==i}):Dt.test(e)?mt.filter(e,t,i):(e=mt.filter(e,t),mt.grep(t,function(t){returnrt.call(e,t)>-1!==i&&1===t.nodeType}))}functiona(t,e){for(;(t=t[e])&&1!==t.nodeType;);returnt}functionr(t){vare={};returnmt.each(t.match(St)||[],function(t,i){e[i]=!0}),e}functionl(t){returnt}functionc(t){throwt}functionh(t,e,i,n){vars;try{t&&mt.isFunction(s=t.promise)?s.call(t).done(e).fail(i):t&&mt.isFunction(s=t.then)?s.call(t,e,i):e.apply(void0,[t].slice(n))}catch(t){i.apply(void0,[t])}}functionu(){it.removeEventListener("DOMContentLoaded",u),t.removeEventListener("load",u),mt.ready()}functiond(){this.expando=mt.expando+d.uid++}functionp(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:Lt.test(t)?JSON.parse(t):t)}functionf(t,e,i){varn;if(void0===i&&1===t.nodeType)if(n="data-"+e.replace($t,"-$&").toLowerCase(),"string"==typeof(i=t.getAttribute(n))){try{i=p(i)}catch(t){}Ht.set(t,e,i)}elsei=void0;returni}functionm(t,e,i,n){vars,o=1,a=20,r=n?function(){returnn.cur()}:function(){returnmt.css(t,e,"")},l=r(),c=i&&i[3]||(mt.cssNumber[e]?"":"px"),h=(mt.cssNumber[e]||"px"!==c&&+l)&&Ft.exec(mt.css(t,e));if(h&&h[3]!==c){c=c||h[3],i=i||[],h=+l||1;do{o=o||".5",h/=o,mt.style(t,e,h+c)}while(o!==(o=r()/l)&&1!==o&&--a)}returni&&(h=+h||+l||0,s=i[1]?h+(i[1]+1)*i[2]:+i[2],n&&(n.unit=c,n.start=h,n.end=s)),s}functiong(t){vare,i=t.ownerDocument,n=t.nodeName,s=Bt[n];returns||(e=i.body.appendChild(i.createElement(n)),s=mt.css(e,"display"),e.parentNode.removeChild(e),"none"===s&&(s="block"),Bt[n]=s,s)}functionb(t,e){for(vari,n,s=[],o=0,a=t.length;o<a;o++)n=t[o],n.style&&(i=n.style.display,e?("none"===i&&(s[o]=Nt.get(n,"display")||null,s[o]||(n.style.display="")),""===n.style.display&&Rt(n)&&(s[o]=g(n))):"none"!==i&&(s[o]="none",Nt.set(n,"display",i)));for(o=0;o<a;o++)null!=s[o]&&(t[o].style.display=s[o]);returnt}functionv(t,e){vari;returni=void0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void0===e||e&&s(t,e)?mt.merge([t],i):i}function_(t,e){for(vari=0,n=t.length;i<n;i++)Nt.set(t[i],"globalEval",!e||Nt.get(e[i],"globalEval"))}functiony(t,e,i,n,s){for(varo,a,r,l,c,h,u=e.createDocumentFragment(),d=[],p=0,f=t.length;p<f;p++)if((o=t[p])||0===o)if("object"===mt.type(o))mt.merge(d,o.nodeType?[o]:o);elseif(Xt.test(o)){for(a=a||u.appendChild(e.createElement("div")),r=(Yt.exec(o)||["",""])[1].toLowerCase(),l=Vt[r]||Vt._default,a.innerHTML=l[1]+mt.htmlPrefilter(o)+l[2],h=l[0];h--;)a=a.lastChild;mt.merge(d,a.childNodes),a=u.firstChild,a.textContent=""}elsed.push(e.createTextNode(o));for(u.textContent="",p=0;o=d[p++];)if(n&&mt.inArray(o,n)>-1)s&&s.push(o);elseif(c=mt.contains(o.ownerDocument,o),a=v(u.appendChild(o),"script"),c&&_(a),i)for(h=0;o=a[h++];)Kt.test(o.type||"")&&i.push(o);returnu}functionw(){return!0}functionx(){return!1}functionk(){try{returnit.activeElement}catch(t){}}functionC(t,e,i,n,s,o){vara,r;if("object"==typeofe){
s=this.buttons.last().find(".ui-icon"),this._removeClass(s,null,this.options.icons.down),this._addClass(s,null,e.down)),voidthis._super(t,e))},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:r(function(t){this._super(t)}),_parse:function(t){return"string"==typeoft&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){vart=this.value();returnnull!==t&&t===this._adjustValue(t)},_value:function(t,e){vari;""!==t&&null!==(i=this._parse(t))&&(e||(i=this._adjustValue(i)),t=this._format(i)),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:r(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:r(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:r(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:r(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){returnarguments.length?voidr(this._value).call(this,t):this._parse(this.element.val())},widget:function(){returnthis.uiSpinner}}),!1!==t.uiBackCompat&&t.widget("ui.spinner",t.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}}),t.ui.spinner,t.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){vart=/#.*$/;returnfunction(e){vari,n;i=e.href.replace(t,""),n=location.href.replace(t,"");try{i=decodeURIComponent(i)}catch(t){}try{n=decodeURIComponent(n)}catch(t){}returne.hash.length>1&&i===n}}(),_create:function(){vare=this,i=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,i.collapsible),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){returne.tabs.index(t)}))).sort()),this.active=!1!==this.options.active&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){vare=this.options.active,i=this.options.collapsible,n=location.hash.substring(1);returnnull===e&&(n&&this.tabs.each(function(i,s){returnt(s).attr("aria-controls")===n?(e=i,!1):void0}),null===e&&(e=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===e||-1===e)&&(e=!!this.tabs.length&&0)),!1!==e&&-1===(e=this.tabs.index(this.tabs.eq(e)))&&(e=!i&&0),!i&&!1===e&&this.anchors.length&&(e=0),e},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(e){vari=t(t.ui.safeActiveElement(this.document[0])).closest("li"),n=this.tabs.index(i),s=!0;if(!this._handlePageNav(e)){switch(e.keyCode){caset.ui.keyCode.RIGHT:caset.ui.keyCode.DOWN:n++;break;caset.ui.keyCode.UP:caset.ui.keyCode.LEFT:s=!1,n--;break;caset.ui.keyCode.END:n=this.anchors.length-1;break;caset.ui.keyCode.HOME:n=0;break;caset.u
;this.classList.add("basicModal__button--active"),t.buttons.action.fn(l())}),o(s("input",!0),function(t){t.oninput=t.onblur=function(){this.classList.remove("error")}}),o(s("select",!0),function(t){t.onchange=t.onblur=function(){this.classList.remove("error")}}),!0},h=(i.show=functiont(e){if(!1===a(e))return!1;if(null!=s())returnd(!0),setTimeout(function(){returnt(e)},301),!1;n=document.activeElement;vari=r(e);document.body.insertAdjacentHTML("beforeend",i),c(e);varo=s("input");null!=o&&o.select();varl=s("select");returnnull==o&&null!=l&&l.focus(),null!=e.callback&&e.callback(e),!0},i.error=function(t){u();vare=s("input[name='"+t+"']")||s("select[name='"+t+"']");if(null==e)return!1;e.classList.add("error"),"function"==typeofe.select?e.select():e.focus(),s().classList.remove("basicModal--fadeIn","basicModal--shake"),setTimeout(function(){returns().classList.add("basicModal--shake")},1)},i.visible=function(){returnnull!=s()}),u=(i.action=function(){vart=s("#basicModal__action");returnnull!=t&&(t.click(),!0)},i.cancel=function(){vart=s("#basicModal__cancel");returnnull!=t&&(t.click(),!0)},i.reset=function(){vart=s(".basicModal__button",!0);o(t,function(t){returnt.classList.remove("basicModal__button--active")});vare=s("input",!0);o(e,function(t){returnt.classList.remove("error")});vari=s("select",!0);returno(i,function(t){returnt.classList.remove("error")}),!0}),d=i.close=function(){vart=arguments.length>0&&void0!==arguments[0]&&arguments[0];if(!1===h())return!1;vare=s().parentElement;return("false"!==e.getAttribute("data-closable")||!1!==t)&&(e.classList.remove("basicModalContainer--fadeIn"),e.classList.add("basicModalContainer--fadeOut"),setTimeout(function(){returnnull!=e&&null!=e.parentElement&&voide.parentElement.removeChild(e)},300),null!=n&&(n.focus(),n=null),!0)}},{}]},{},[1])(1)});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
n=album.json.content[e].tags===album.json.content[t[0]].tags&&!0===n}),!0===n&&(e=album.json.content[t[0]].tags)}e=e.replace(/,/g,", ");vars=function(e){basicModal.close(),photo.setTags(t,e.tags)},o=lychee.html(_templateObject32,e);i=1===t.length?lychee.html(_templateObject33,o):lychee.html(_templateObject34,t.length,o),basicModal.show({body:i,buttons:{action:{title:"Set Tags",fn:s},cancel:{title:"Cancel",fn:basicModal.close}}})},photo.setTags=function(t,e){if(!t)return!1;tinstanceofArray==!1&&(t=[t]),e=e.replace(/(\ ,\ )|(\ ,)|(,\ )|(,{1,}\ {0,})|(,$|^,)/g,","),e=e.replace(/,$|^,|(\ ){0,}$/g,""),visible.photo()&&(photo.json.tags=e,view.photo.tags()),t.forEach(function(t,i,n){album.json.content[t].tags=e});vari={photoIDs:t.join(),tags:e};api.post("Photo::setTags",i,function(t){!0!==t&&lychee.error(null,i,t)})},photo.deleteTag=function(t,e){vari=void0;i=photo.json.tags.split(","),i.splice(e,1),photo.json.tags=i.toString(),photo.setTags([t],photo.json.tags)},photo.share=function(t,e){vari=photo.getViewLink(t);switch(e){case"twitter":window.open("https://twitter.com/share?url="+encodeURI(i));break;case"facebook":window.open("http://www.facebook.com/sharer.php?u="+encodeURI(i)+"&t="+encodeURI(photo.json.title));break;case"mail":location.href="mailto:?subject="+encodeURI(photo.json.title)+"&body="+encodeURI(i);break;case"dropbox":lychee.loadDropbox(function(){vart=photo.json.title+"."+photo.getDirectLink().split(".").pop();Dropbox.save(photo.getDirectLink(),t)})}},photo.getArchive=function(t){vare=void0,i=api.path+"?function=Photo::getArchive&photoID="+t;e=location.href.indexOf("index.html")>0?location.href.replace(location.hash,"").replace("index.html",i):location.href.replace(location.hash,"")+i,!0===lychee.publicMode&&(e+="&password="+encodeURIComponent(password.value)),location.href=e},photo.getDirectLink=function(){vart="";returnphoto.json&&photo.json.url&&""!==photo.json.url&&(t=photo.json.url),t},photo.getViewLink=function(t){vare="view.php?p="+t;returnlocation.href.indexOf("index.html")>0?location.href.replace("index.html"+location.hash,e):location.href.replace(location.hash,e)},search={hash:null},search.find=function(t){clearTimeout($(window).data("timeout")),$(window).data("timeout",setTimeout(function(){0!==header.dom(".header__search").val().length?api.post("search",{term:t},function(t){vare="",i="",n="";t&&t.albums&&(albums.json={albums:t.albums},$.each(albums.json.albums,function(){albums.parse(this),i+=build.album(this)})),t&&t.photos&&(album.json={content:t.photos},$.each(album.json.content,function(){n+=build.photo(this)})),e=""===i&&""===n?"error":""===i?build.divider("Photos")+n:""===n?build.divider("Albums")+i:build.divider("Albums")+i+build.divider("Photos")+n,search.hash!==t.hash&&($(".no_content").remove(),lychee.animate(".content","contentZoomOut"),search.hash=t.hash,setTimeout(function(){"error"===e?(lychee.content.html(""),$("body").append(build.no_content("magnifying-glass"))):(lychee.content.html(e),lychee.animate(lychee.content,"contentZoomIn"))},300))}):search.reset()},250))},search.reset=function(){header.dom(".header__search").val(""),$(".no_content").remove(),null!=search.hash&&(albums.json=null,album.json=null,photo.json=null,search.hash=null,lychee.animate(".divider","fadeOut"),lychee.goto())},settings={},settings.createConfig=function(){vart=function(t){vare=t.dbName||"",i=t.dbUser||"",n=t.dbPassword||"",s=t.dbHost||"",o=t.dbTablePrefix||"";if(i.length<1)returnbasicModal.error("dbUser"),!1;s.length<1&&(s="localhost"),e.length<1&&(e="lychee");vara={dbName:e,dbUser:i,dbPassword:n,dbHost:s,dbTablePrefix:o};api.post("Config::create",a,function(t){if(!0!==t)return"Warning: Connection failed!"===t?(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):"Warning: Creation failed!"===t?(basicModal.show({body:"<p>Unabletocreatethedatabase.Double-checkyourhost,user