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){"use strict";"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){"use strict";functionn(e,t){t=t||ne;varn=t.createElement("script");n.text=e,t.head.appendChild(n).parentNode.removeChild(n)}functiono(e){vart=!!e&&"length"ine&&e.length,n=be.type(e);return"function"!==n&&!be.isWindow(e)&&("array"===n||0===t||"number"==typeoft&&t>0&&t-1ine)}functioni(e,t){returne.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}functiona(e,t,n){returnbe.isFunction(t)?be.grep(e,function(e,o){return!!t.call(e,o,e)!==n}):t.nodeType?be.grep(e,function(e){returne===t!==n}):"string"!=typeoft?be.grep(e,function(e){returnle.call(t,e)>-1!==n}):je.test(t)?be.filter(t,e,n):(t=be.filter(t,e),be.grep(e,function(e){returnle.call(t,e)>-1!==n&&1===e.nodeType}))}functionr(e,t){for(;(e=e[t])&&1!==e.nodeType;);returne}functionl(e){vart={};returnbe.each(e.match(Ce)||[],function(e,n){t[n]=!0}),t}functions(e){returne}functionc(e){throwe}functionu(e,t,n,o){vari;try{e&&be.isFunction(i=e.promise)?i.call(e).done(t).fail(n):e&&be.isFunction(i=e.then)?i.call(e,t,n):t.apply(void0,[e].slice(o))}catch(e){n.apply(void0,[e])}}functiond(){ne.removeEventListener("DOMContentLoaded",d),e.removeEventListener("load",d),be.ready()}functionp(){this.expando=be.expando+p.uid++}functionh(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Pe.test(e)?JSON.parse(e):e)}functionf(e,t,n){varo;if(void0===n&&1===e.nodeType)if(o="data-"+t.replace(Ie,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(o))){try{n=h(n)}catch(e){}Le.set(e,t,n)}elsen=void0;returnn}functionb(e,t,n,o){vari,a=1,r=20,l=o?function(){returno.cur()}:function(){returnbe.css(e,t,"")},s=l(),c=n&&n[3]||(be.cssNumber[t]?"":"px"),u=(be.cssNumber[t]||"px"!==c&&+s)&&Ne.exec(be.css(e,t));if(u&&u[3]!==c){c=c||u[3],n=n||[],u=+s||1;do{a=a||".5",u/=a,be.style(e,t,u+c)}while(a!==(a=l()/s)&&1!==a&&--r)}returnn&&(u=+u||+s||0,i=n[1]?u+(n[1]+1)*n[2]:+n[2],o&&(o.unit=c,o.start=u,o.end=i)),i}functionm(e){vart,n=e.ownerDocument,o=e.nodeName,i=He[o];returni?i:(t=n.body.appendChild(n.createElement(o)),i=be.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),He[o]=i,i)}functiong(e,t){for(varn,o,i=[],a=0,r=e.length;a<r;a++)o=e[a],o.style&&(n=o.style.display,t?("none"===n&&(i[a]=Se.get(o,"display")||null,i[a]||(o.style.display="")),""===o.style.display&&Fe(o)&&(i[a]=m(o))):"none"!==n&&(i[a]="none",Se.set(o,"display",n)));for(a=0;a<r;a++)null!=i[a]&&(e[a].style.display=i[a]);returne}functionv(e,t){varn;returnn=void0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void0===t||t&&i(e,t)?be.merge([e],n):n}functiony(e,t){for(varn=0,o=e.length;n<o;n++)Se.set(e[n],"globalEval",!t||Se.get(t[n],"globalEval"))}functionw(e,t,n,o,i){for(vara,r,l,s,c,u,d=t.createDocumentFragment(),p=[],h=0,f=e.length;h<f;h++)if((a=e[h])||0===a)if("object"===be.type(a))be.merge(p,a.nodeType?[a]:a);elseif(ze.test(a)){for(r=r||d.appendChild(t.createElement("div")),l=(Be.exec(a)||["",""])[1].toLowerCase(),s=Xe[l]||Xe._default,r.innerHTML=s[1]+be.htmlPrefilter(a)+s[2],u=s[0];u--;)r=r.lastChild;be.merge(p,r.childNodes),r=d.firstChild,r.textContent=""}elsep.push(t.createTextNode(a));for(d.textContent="",h=0;a=p[h++];)if(o&&be.inArray(a,o)>-1)i&&i.push(a);elseif(c=be.contains(a.ownerDocument,a),r=v(d.appendChild(a),"script"),c&&y(r),n)for(u=0;a=r[u++];)We.test(a.type||"")&&n.push(a);returnd}functionx(){return!0}functionj(){return!1}function_(){try{returnne.activeElement}catch(e){}}functionT(e,t,n,o,i,a){varr,l;if("object"==typeoft)
t+="1"===e.cameraDate?lychee.html(_templateObject16,build.iconic("camera-slr"),e.sysdate):lychee.html(_templateObject17,e.sysdate),t+="</div>",lychee.publicMode===!1&&(t+=lychee.html(_templateObject18,"1"===e.star?"badge--visible":"",build.iconic("star"),"1"===e.public&&"1"!==album.json.public?"badge--visible":"",build.iconic("eye"))),t+="</div>"},build.imageview=function(e,t){varn="";returnn+=""!==e.medium==!1?lychee.html(_templateObject19,t===!0?"":"full",e.url):lychee.html(_templateObject20,t===!0?"":"full",e.url,e.medium,e.url,e.width),n+="\n\t <div class='arrow_wrapper arrow_wrapper--previous'><a id='previous'>"+build.iconic("caret-left")+"</a></div>\n\t <div class='arrow_wrapper arrow_wrapper--next'><a id='next'>"+build.iconic("caret-right")+"</a></div>\n\t "},build.no_content=function(e){vart="";switch(t+="\n\t <div class='no_content fadeIn'>\n\t "+build.iconic(e)+"\n\t ",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),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,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.th
;visible.photo()&&(photo.json.title=""===n?"Untitled":n,view.photo.title()),e.forEach(function(e,t,o){album.json.content[e].title=n,view.album.content.title(e)});varo={photoIDs:e.join(),title:n};api.post("Photo::setTitle",o,function(e){e!==!0&&lychee.error(null,o,e)})},i=lychee.html(_templateObject3,t);n=1===e.length?lychee.html(_templateObject29,i):lychee.html(_templateObject30,e.length,i),basicModal.show({body:n,buttons:{action:{title:"Set title",fn:o},cancel:{title:"Cancel",fn:basicModal.close}}})},photo.setAlbum=function(e,t){varn=null,o=null;if(!e)return!1;einstanceofArray==!1&&(e=[e]),e.forEach(function(e,t,i){""===album.json.content[e].nextPhoto&&""===album.json.content[e].previousPhoto||(n=album.json.content[e].nextPhoto,o=album.json.content[e].previousPhoto,album.json.content[o].nextPhoto=n,album.json.content[n].previousPhoto=o),deletealbum.json.content[e],view.album.content.delete(e)}),albums.refresh(),visible.photo()&&null!=n&&n!==photo.getID()?lychee.goto(album.getID()+"/"+n):visible.albums()||lychee.goto(album.getID());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;if(einstanceofArray==!1&&(e=[e]),visible.photo())t=photo.json.tags;elseif(visible.album()&&1===e.length)t=album.json.content[e].tags;elseif(visible.search()&&1===e.length)t=album.json.content[e].tags;elseif(visible.album()&&e.length>1){varo=!0;e.forEach(function(t,n,i){o=album.json.content[t].tags===album.json.content[e[0]].tags&&o===!0}),o===!0&&(t=album.json.content[e[0]].tags)}t=t.replace(/,/g,", ");vari=function(t){basicModal.close(),photo.setTags(e,t.tags)},a=lychee.html(_templateObject32,t);n=1===e.length?lychee.html(_templateObject33,a):lychee.html(_templateObject34,e.length,a),basicModal.show({body:n,buttons:{action:{title:"Set Tags",fn:i},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=photo.getViewLink(e);switch(t){case"twit