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||te;varn=t.createElement("script");n.text=e,t.head.appendChild(n).parentNode.removeChild(n)}functiono(e){vart=!!e&&"length"ine&&e.length,n=fe.type(e);return"function"!==n&&!fe.isWindow(e)&&("array"===n||0===t||"number"==typeoft&&t>0&&t-1ine)}functioni(e,t,n){returnfe.isFunction(t)?fe.grep(e,function(e,o){return!!t.call(e,o,e)!==n}):t.nodeType?fe.grep(e,function(e){returne===t!==n}):"string"!=typeoft?fe.grep(e,function(e){returnre.call(t,e)>-1!==n}):Te.test(t)?fe.filter(t,e,n):(t=fe.filter(t,e),fe.grep(e,function(e){returnre.call(t,e)>-1!==n&&1===e.nodeType}))}functiona(e,t){for(;(e=e[t])&&1!==e.nodeType;);returne}functionr(e){vart={};returnfe.each(e.match(Ae)||[],function(e,n){t[n]=!0}),t}functionl(e){returne}functions(e){throwe}functionc(e,t,n){varo;try{e&&fe.isFunction(o=e.promise)?o.call(e).done(t).fail(n):e&&fe.isFunction(o=e.then)?o.call(e,t,n):t.call(void0,e)}catch(e){n.call(void0,e)}}functionu(){te.removeEventListener("DOMContentLoaded",u),e.removeEventListener("load",u),fe.ready()}functiond(){this.expando=fe.expando+d.uid++}functionp(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Ne.test(e)?JSON.parse(e):e)}functionh(e,t,n){varo;if(void0===n&&1===e.nodeType)if(o="data-"+t.replace(qe,"-$&").toLowerCase(),n=e.getAttribute(o),"string"==typeofn){try{n=p(n)}catch(e){}Oe.set(e,t,n)}elsen=void0;returnn}functionf(e,t,n,o){vari,a=1,r=20,l=o?function(){returno.cur()}:function(){returnfe.css(e,t,"")},s=l(),c=n&&n[3]||(fe.cssNumber[t]?"":"px"),u=(fe.cssNumber[t]||"px"!==c&&+s)&&Re.exec(fe.css(e,t));if(u&&u[3]!==c){c=c||u[3],n=n||[],u=+s||1;doa=a||".5",u/=a,fe.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}functionb(e){vart,n=e.ownerDocument,o=e.nodeName,i=We[o];returni?i:(t=n.body.appendChild(n.createElement(o)),i=fe.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),We[o]=i,i)}functionm(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]=Ie.get(o,"display")||null,i[a]||(o.style.display="")),""===o.style.display&&Ue(o)&&(i[a]=b(o))):"none"!==n&&(i[a]="none",Ie.set(o,"display",n)));for(a=0;a<r;a++)null!=i[a]&&(e[a].style.display=i[a]);returne}functiong(e,t){varn;returnn="undefined"!=typeofe.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeofe.querySelectorAll?e.querySelectorAll(t||"*"):[],void0===t||t&&fe.nodeName(e,t)?fe.merge([e],n):n}functionv(e,t){for(varn=0,o=e.length;n<o;n++)Ie.set(e[n],"globalEval",!t||Ie.get(t[n],"globalEval"))}functiony(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],a||0===a)if("object"===fe.type(a))fe.merge(p,a.nodeType?[a]:a);elseif(Ve.test(a)){for(r=r||d.appendChild(t.createElement("div")),l=(ze.exec(a)||["",""])[1].toLowerCase(),s=Ke[l]||Ke._default,r.innerHTML=s[1]+fe.htmlPrefilter(a)+s[2],u=s[0];u--;)r=r.lastChild;fe.merge(p,r.childNodes),r=d.firstChild,r.textContent=""}elsep.push(t.createTextNode(a));for(d.textContent="",h=0;a=p[h++];)if(o&&fe.inArray(a,o)>-1)i&&i.push(a);elseif(c=fe.contains(a.ownerDocument,a),r=g(d.appendChild(a),"script"),c&&v(r),n)for(u=0;a=r[u++];)Ye.test(a.type||"")&&n.push(a);returnd}functionw(){return!0}functionx(){return!1}functionj(){try{returnte.activeElement}catch(e){}}function_(e,t,n,o,i,a){varr,l;if("object"==typeoft){"string"!=typeofn&&(o=o||n,n=void0);for(lint)_(e,l,n,o,t[
t+="</div>"},build.photo=function(e){vart="",n=lychee.retinize(e.thumbUrl),o=n.path;returnt+=lychee.html(_templateObject15,e.album,e.id,e.thumbUrl,o,e.title,e.title),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="",o=""!==e.medium;returnn+=o===!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.originalEv
1===e.length&&(photo.json?t=photo.json.title:album.json&&(t=album.json.content[e].title));varo=function(t){basicModal.close();varn=t.title;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;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}),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.jso