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=!!e&&"length"ine&&e.length,n=ae.type(e);return"function"===n||ae.isWindow(e)?!1:"array"===n||0===t||"number"==typeoft&&t>0&&t-1ine}functiono(e,t,n){if(ae.isFunction(t))returnae.grep(e,function(e,o){return!!t.call(e,o,e)!==n});if(t.nodeType)returnae.grep(e,function(e){returne===t!==n});if("string"==typeoft){if(me.test(t))returnae.filter(t,e,n);t=ae.filter(t,e)}returnae.grep(e,function(e){returnJ.call(t,e)>-1!==n})}functioni(e,t){for(;(e=e[t])&&1!==e.nodeType;);returne}functiona(e){vart={};returnae.each(e.match(xe)||[],function(e,n){t[n]=!0}),t}functionr(){V.removeEventListener("DOMContentLoaded",r),e.removeEventListener("load",r),ae.ready()}functions(){this.expando=ae.expando+s.uid++}functionl(e,t,n){varo;if(void0===n&&1===e.nodeType)if(o="data-"+t.replace($e,"-$&").toLowerCase(),n=e.getAttribute(o),"string"==typeofn){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:Ce.test(n)?ae.parseJSON(n):n}catch(i){}ke.set(e,t,n)}elsen=void0;returnn}functionu(e,t,n,o){vari,a=1,r=20,s=o?function(){returno.cur()}:function(){returnae.css(e,t,"")},l=s(),u=n&&n[3]||(ae.cssNumber[t]?"":"px"),c=(ae.cssNumber[t]||"px"!==u&&+l)&&Ae.exec(ae.css(e,t));if(c&&c[3]!==u){u=u||c[3],n=n||[],c=+l||1;doa=a||".5",c/=a,ae.style(e,t,c+u);while(a!==(a=s()/l)&&1!==a&&--r)}returnn&&(c=+c||+l||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],o&&(o.unit=u,o.start=c,o.end=i)),i}functionc(e,t){varn="undefined"!=typeofe.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeofe.querySelectorAll?e.querySelectorAll(t||"*"):[];returnvoid0===t||t&&ae.nodeName(e,t)?ae.merge([e],n):n}functiond(e,t){for(varn=0,o=e.length;o>n;n++)Me.set(e[n],"globalEval",!t||Me.get(t[n],"globalEval"))}functionp(e,t,n,o,i){for(vara,r,s,l,u,p,h=t.createDocumentFragment(),f=[],m=0,b=e.length;b>m;m++)if(a=e[m],a||0===a)if("object"===ae.type(a))ae.merge(f,a.nodeType?[a]:a);elseif(Ne.test(a)){for(r=r||h.appendChild(t.createElement("div")),s=(Pe.exec(a)||["",""])[1].toLowerCase(),l=Oe[s]||Oe._default,r.innerHTML=l[1]+ae.htmlPrefilter(a)+l[2],p=l[0];p--;)r=r.lastChild;ae.merge(f,r.childNodes),r=h.firstChild,r.textContent=""}elsef.push(t.createTextNode(a));for(h.textContent="",m=0;a=f[m++];)if(o&&ae.inArray(a,o)>-1)i&&i.push(a);elseif(u=ae.contains(a.ownerDocument,a),r=c(h.appendChild(a),"script"),u&&d(r),n)for(p=0;a=r[p++];)Ie.test(a.type||"")&&n.push(a);returnh}functionh(){return!0}functionf(){return!1}functionm(){try{returnV.activeElement}catch(e){}}functionb(e,t,n,o,i,a){varr,s;if("object"==typeoft){"string"!=typeofn&&(o=o||n,n=void0);for(sint)b(e,s,n,o,t[s],a);returne}if(null==o&&null==i?(i=n,o=n=void0):null==i&&("string"==typeofn?(i=o,o=void0):(i=o,o=n,n=void0)),i===!1)i=f;elseif(!i)returnthis;return1===a&&(r=i,i=function(e){returnae().off(e),r.apply(this,arguments)},i.guid=r.guid||(r.guid=ae.guid++)),e.each(function(){ae.event.add(this,t,i,o,n)})}functiong(e,t){returnae.nodeName(e,"table")&&ae.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e:e}functionv(e){returne.type=(null!==e.getAttribute("type"))+"/"+e.type,e}functiony(e){vart=We.exec(e.type);returnt?e.type=t[1]:e.removeAttribute("type"),e}functionw(e,t){varn,o,i,a,r,s,l,u;if(1===t.nodeType){if(Me.hasData(e)&&(a=Me.access(e),r=Me.set(t,a),u=a.events)){deleter.handle,r.events={};for(iinu)for(n=0,o=u[i].length;o>n;n++)ae.event.add(t,i,u[i][n])}ke.hasData(e)&&(s=ke.access(e),l=ae.extend({},s),ke.set(t,l))}}functionx(e,t){varn=t.nodeName.toLowerCase();"input"=
e){case"magnifying-glass":t+="<p>No results</p>";break;case"eye":t+="<p>No public albums</p>";break;case"cog":t+="<p>No configuration</p>";break;case"question-mark":t+="<p>Photo not found</p>"}returnt+="</div>"},build.uploadModal=function(e,t){varn="";n+=lychee.html(_templateObject21,e);for(varo=0;o<t.length;){vari=t[o];i.name.length>40&&(i.name=i.name.substr(0,17)+"..."+i.name.substr(i.name.length-20,20)),n+=lychee.html(_templateObject22,i.name),n+=i.supported===!0?"<a class='status'></a>":"<a class='status error'>Not supported</a>",n+="\n <p class='notice'></p>\n </div>\n ",o++}returnn+="</div>"},build.tags=function(e){vart="";return""!==e?(e=e.split(","),e.forEach(function(e,n,o){t+=lychee.html(_templateObject23,e,n,build.iconic("x"))})):t="<div class='empty'>No Tags</div>",t},contextMenu={},contextMenu.add=function(e){vart=[{title:build.iconic("image")+"Upload Photo",fn:function(){return$("#upload_files").click()}},{},{title:build.iconic("link-intact")+"Import from Link",fn:upload.start.url},{title:build.iconic("dropbox","ionicons")+"Import from Dropbox",fn:upload.start.dropbox},{title:build.iconic("terminal")+"Import from Server",fn:upload.start.server},{},{title:build.iconic("folder")+"New Album",fn:album.add}];basicContext.show(t,e.originalEvent),upload.notify()},contextMenu.settings=function(e){vart=[{title:build.iconic("person")+"Change Login",fn:settings.setLogin},{title:build.iconic("sort-ascending")+"Change Sorting",fn:settings.setSorting},{title:build.iconic("dropbox","ionicons")+"Set Dropbox",fn:settings.setDropboxKey},{},{title:build.iconic("info")+"About Lychee",fn:function(){returnwindow.open(lychee.website)}},{title:build.iconic("wrench")+"Diagnostics",fn:function(){returnwindow.open("plugins/Diagnostics/")}},{title:build.iconic("align-left")+"Show Log",fn:function(){returnwindow.open("plugins/Log/")}},{},{title:build.iconic("account-logout")+"Sign Out",fn:lychee.logout}];basicContext.show(t,e.originalEvent)},contextMenu.album=function(e,t){if("0"===e||"f"===e||"s"===e||"r"===e)return!1;varn=albums.json&&albums.json.albums&&Object.keys(albums.json.albums).length>1,o=[{title:build.iconic("pencil")+"Rename",fn:function(){returnalbum.setTitle([e])}},{title:build.iconic("collapse-left")+"Merge",visible:n,fn:function(){basicContext.close(),contextMenu.mergeAlbum(e,t)}},{title:build.iconic("trash")+"Delete",fn:function(){returnalbum["delete"]([e])}}];$('.album[data-id="'+e+'"]').addClass("active"),basicContext.show(o,t.originalEvent,contextMenu.close)},contextMenu.albumMulti=function(e,t){multiselect.stopResize();varn=e.length>1?!0:!1,o=albums.json&&albums.json.albums&&Object.keys(albums.json.albums).length>1,i=[{title:build.iconic("pencil")+"Rename All",fn:function(){returnalbum.setTitle(e)}},{title:build.iconic("collapse-left")+"Merge All",visible:o&&n,fn:function(){returnalbum.merge(e)}},{title:build.iconic("collapse-left")+"Merge",visible:o&&!n,fn:function(){basicContext.close(),contextMenu.mergeAlbum(e[0],t)}},{title:build.iconic("trash")+"Delete All",fn:function(){returnalbum["delete"](e)}}];i.push(),basicContext.show(i,t.originalEvent,contextMenu.close)},contextMenu.albumTitle=function(e,t){api.post("Albums::get",{},function(n){varo=[];n.albums&&n.num>1&&($.each(n.albums,function(){vart=this;this.thumbs[0]||(this.thumbs[0]="src/images/no_cover.svg");varn=lychee.html(_templateObject24,this.thumbs[0],this.title);this.id!=e&&o.push({title:n,fn:function(){returnlychee["goto"](t.id)}})}),o.unshift({})),o.unshift({title:build.iconic("pencil")+"Rename",fn:function(){returnalbum.setTitle([e])}}),basicContext.show(o,t.originalEvent,contextMenu.close)})},contextMenu.mergeAlbum=function(e,t){api.post("Albums::get",{},function(n){varo=[];returnn.albums&&n.num>1&&$.each(n.albums,function(){vart=this;this.thumbs[0]||(this.thumbs[0]="src/images/no_cover.svg");varn=lychee.html(_templateObject24,this.thumbs[0],this.title);this.id!=e&&o.push({title:n,fn:function(){returnalbum.merge([e,t.id])}})}),0===o.length?!1:voidbasicContext.show(o,t.originalEvent,context
view.album.content["delete"](e)}),albums.refresh();vari={photoIDs:e.join(),albumID:t};api.post("Photo::setAlbum",i,function(e){e!==!0&&lychee.error(null,i,e)})},photo.setStar=function(e){if(!e)return!1;visible.photo()&&(photo.json.star="0"===photo.json.star?"1":"0",view.photo.star()),e.forEach(function(e,t,n){album.json.content[e].star="0"===album.json.content[e].star?"1":"0",view.album.content.star(e)}),albums.refresh();vart={photoIDs:e.join()};api.post("Photo::setStar",t,function(e){e!==!0&&lychee.error(null,t,e)})},photo.setPublic=function(e,t){if("2"===photo.json["public"]){varn=function(){basicModal.close(),lychee["goto"](photo.json.original_album)};returnbasicModal.show({body:"<p>This photo is located in a public album. To make this photo private or public, edit the visibility of the associated album.</p>",buttons:{action:{title:"Show Album",fn:n},cancel:{title:"Cancel",fn:basicModal.close}}}),!1}visible.photo()&&(photo.json["public"]="0"===photo.json["public"]?"1":"0",view.photo["public"](),"1"===photo.json["public"]&&contextMenu.sharePhoto(e,t)),album.json.content[e]["public"]="0"===album.json.content[e]["public"]?"1":"0",view.album.content["public"](e),albums.refresh(),api.post("Photo::setPublic",{photoID:e},function(e){e!==!0&&lychee.error(null,params,e)})},photo.setDescription=function(e){vart=photo.json.description,n=function(t){basicModal.close();varn=t.description;visible.photo()&&(photo.json.description=n,view.photo.description());varo={photoID:e,description:n};api.post("Photo::setDescription",o,function(e){e!==!0&&lychee.error(null,o,e)})};basicModal.show({body:lychee.html(_templateObject31,t),buttons:{action:{title:"Set Description",fn:n},cancel:{title:"Cancel",fn:basicModal.close}}})},photo.editTags=function(e){vart="",n="";if(!e)return!1;einstanceofArray==!1&&(e=[e]),visible.photo()?t=photo.json.tags:visible.album()&&1===e.length?t=album.json.content[e].tags:visible.search()&&1===e.length?t=album.json.content[e].tags:visible.album()&&e.length>1&&!function(){varn=!0;e.forEach(function(t,o,i){n=album.json.content[t].tags===album.json.content[e[0]].tags&&n===!0?!0:!1}),n===!0&&(t=album.json.content[e[0]].tags)}(),t=t.replace(/,/g,", ");varo=function(t){basicModal.close(),photo.setTags(e,t.tags)},i=lychee.html(_templateObject32,t);n=1===e.length?lychee.html(_templateObject33,i):lychee.html(_templateObject34,e.length,i),basicModal.show({body:n,buttons:{action:{title:"Set Tags",fn:o},cancel:{title:"Cancel",fn:basicModal.close}}})},photo.setTags=function(e,t){if(!e)return!1;einstanceofArray==!1&&(e=[e]),t=t.replace(/(\ ,\ )|(\ ,)|(,\ )|(,{1,}\ {0,})|(,$|^,)/g,","),t=t.replace(/,$|^,|(\ ){0,}$/g,""),visible.photo()&&(photo.json.tags=t,view.photo.tags()),e.forEach(function(e,n,o){album.json.content[e].tags=t});varn={photoIDs:e.join(),tags:t};api.post("Photo::setTags",n,function(e){e!==!0&&lychee.error(null,n,e)})},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&&(location.href=n)},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.hre