Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/photos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorentin Mors <corentin.mors@dashlane.com>2019-12-26 18:41:39 +0300
committerCorentin Mors <corentin.mors@dashlane.com>2019-12-26 18:41:39 +0300
commitc3da84c390624754d04b86b3ba6dddeebc921a08 (patch)
tree65f78b8880dc053e875a4d7a93ad7223f94913df /js/photos.js
parent42c89a1c886b0fe8ef797600b1556d998c1c1c2f (diff)
(Refactor) Remove unused array to chunk
Signed-off-by: Corentin Mors <corentin.mors@dashlane.com>
Diffstat (limited to 'js/photos.js')
-rw-r--r--js/photos.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/js/photos.js b/js/photos.js
index d8d7d4eb..ee9a1242 100644
--- a/js/photos.js
+++ b/js/photos.js
@@ -400,7 +400,7 @@ var Ie=function(t){var e=fe.a.CancelToken.source();return{request:function(){var
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- */var dn=function(){return hn.apply(this,arguments)};function hn(){return(hn=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){ln(o,r,i,a,s,"next",t)}function s(t){ln(o,r,i,a,s,"throw",t)}a(void 0)}))}}(regeneratorRuntime.mark((function t(){var e,n,r,i,a,s,c=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=c.length>0&&void 0!==c[0]&&c[0],n=c.length>1&&void 0!==c[1]?c[1]:{},n=Object.assign({},{page:0,perPage:10*fn.sizes.max.count},n),r="/files/".concat(Object(o.getCurrentUser)().uid),i=me.reduce((function(t,e){return"".concat(t,"\n\t\t<d:eq>\n\t\t\t<d:prop>\n\t\t\t\t<d:getcontenttype/>\n\t\t\t</d:prop>\n\t\t\t<d:literal>").concat(e,"</d:literal>\n\t\t</d:eq>\n\t")}),""),a=e?"<d:eq>\n\t\t\t\t<d:prop>\n\t\t\t\t\t<oc:favorite/>\n\t\t\t\t</d:prop>\n\t\t\t\t<d:literal>1</d:literal>\n\t\t\t</d:eq>":"",n=Object.assign({method:"SEARCH",headers:{"content-Type":"text/xml"},data:'<?xml version="1.0" encoding="UTF-8"?>\n\t\t\t<d:searchrequest xmlns:d="DAV:"\n\t\t\t\txmlns:oc="http://owncloud.org/ns"\n\t\t\t\txmlns:nc="http://nextcloud.org/ns"\n\t\t\t\txmlns:ns="https://github.com/icewind1991/SearchDAV/ns"\n\t\t\t\txmlns:ocs="http://open-collaboration-services.org/ns">\n\t\t\t\t<d:basicsearch>\n\t\t\t\t\t<d:select>\n\t\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t\t'.concat(un,"\n\t\t\t\t\t\t</d:prop>\n\t\t\t\t\t</d:select>\n\t\t\t\t\t<d:from>\n\t\t\t\t\t\t<d:scope>\n\t\t\t\t\t\t\t<d:href>").concat(r,"</d:href>\n\t\t\t\t\t\t\t<d:depth>infinity</d:depth>\n\t\t\t\t\t\t</d:scope>\n\t\t\t\t\t</d:from>\n\t\t\t\t\t<d:where>\n\t\t\t\t\t\t<d:and>\n\t\t\t\t\t\t\t<d:or>\n\t\t\t\t\t\t\t\t").concat(i,"\n\t\t\t\t\t\t\t</d:or>\n\t\t\t\t\t\t\t").concat(a,"\n\t\t\t\t\t\t\t<d:eq>\n\t\t\t\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t\t\t\t<oc:owner-id/>\n\t\t\t\t\t\t\t\t</d:prop>\n\t\t\t\t\t\t\t\t<d:literal>").concat(Object(o.getCurrentUser)().uid,"</d:literal>\n\t\t\t\t\t\t\t</d:eq>\n\t\t\t\t\t\t</d:and>\n\t\t\t\t\t</d:where>\n\t\t\t\t\t<d:orderby>\n\t\t\t\t\t\t<d:order>\n\t\t\t\t\t\t\t<d:prop><d:getlastmodified/></d:prop>\n\t\t\t\t\t\t\t<d:descending/>\n\t\t\t\t\t\t</d:order>\n\t\t\t\t\t</d:orderby>\n\t\t\t\t\t<d:limit>\n\t\t\t\t\t\t<d:nresults>").concat(n.perPage,"</d:nresults>\n\t\t\t\t\t\t<ns:firstresult>").concat(n.page*n.perPage,"</ns:firstresult>\n\t\t\t\t\t</d:limit>\n\t\t\t\t</d:basicsearch>\n\t\t\t</d:searchrequest>"),deep:!0,details:!0},n),t.next=9,cn.getDirectoryContents("",n);case 9:return s=t.sent,t.abrupt("return",s.data.map((function(t){return ge(t)})).map((function(t){return Object.assign({},t,{filename:t.filename.replace(r,"")})})));case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var pn=r(111),An=r.n(pn),gn=r(109),vn=r.n(gn);const mn=(t,e)=>{const n=vn()(),r={},i=()=>{vn()()-n>=e?t.call(null):r.value=An()(i)};return r.value=An()(i),r};var yn=new c.default({data:function(){return{gridConfig:fn.sizes.max}},watch:{gridConfig:function(t){this.$emit("changed",t)}},created:function(){window.addEventListener("resize",this.handleWindowResize),this.handleWindowResize()},beforeDestroy:function(){window.removeEventListener("resize",this.handleWindowResize)},methods:{handleWindowResize:function(){var t=Object.keys(fn.sizes).find((function(t){return t>document.documentElement.clientWidth}));this.gridConfig=fn.sizes[t]}}}),bn={data:function(){return{gridConfig:{}}},created:function(){var t=this;yn.$on("changed",(function(e){t.gridConfig=e})),console.debug("Current grid config",yn.gridConfig),this.gridConfig=yn.gridConfig},beforeDestroy:function(){yn.$off("changed",this.gridConfig)}},wn={name:"VirtualGrid",components:{Grid:Fe},mixins:[bn],props:{list:{type:Array,default:function(){return[]}},props:{type:Function,default:function(){return{}}},component:{type:Function,required:!0},loadingPage:{type:Boolean,default:!1}},data:function(){return{shownFirstRow:0,shownLastRow:this.getRowNumber(this.list.length-1)}},computed:{shownList:function(){var t=this;return this.list.filter((function(e,n){return t.isVisible(n)}))},topPadding:function(){return"".concat(100*this.shownFirstRow,"%")},bottomPadding:function(){return"".concat(100*(this.lastRow-this.shownLastRow),"%")},lastRow:function(){return this.getRowNumber(this.list.length-1)}},created:function(){window.addEventListener("scroll",this.onDocumentScroll)},mounted:function(){this.onDocumentScroll()},beforeDestroy:function(){window.removeEventListener("scroll",this.onDocumentScroll)},methods:{debounceOnDocumentScroll:function(){var t;this.debounceOnDocumentScrollRequest&&(t=this.debounceOnDocumentScrollRequest,Object(pn.cancel)(t.value)),this.debounceOnDocumentScrollRequest=mn(this.onDocumentScroll,150)},onDocumentScroll:function(){var t=this.$refs.grid.$el,e=getComputedStyle(t),n=parseFloat(e.gridTemplateColumns.split(" ")[0],10),r=this.roundToTen(window.pageYOffset-this.gridConfig.marginTop),i=Math.floor(r/(n+this.gridConfig.gap))-1,o=Math.ceil(window.innerHeight/n)+i+1;this.shownFirstRow=Math.max(i,0),this.shownLastRow=Math.min(o,this.lastRow),this.shownLastRow>=this.lastRow&&this.$emit("bottomReached")},isVisible:function(t){var e=this.getRowNumber(t);return e>=this.shownFirstRow&&e<this.shownLastRow+1},getRowNumber:function(t){var e=this.gridConfig?this.gridConfig.count:this.list.length;return Math.floor(t/e)},roundToTen:function(t){return 10*Math.floor(t/10)}}},_n=(r(655),E(wn,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Grid",{ref:"grid"},[n("span",{directives:[{name:"show",rawName:"v-show",value:t.shownFirstRow>0,expression:"shownFirstRow > 0"}],key:"filler-top",ref:"filler-top",staticClass:"grid-filler grid-filler--top",style:{paddingBottom:t.topPadding},attrs:{role:"none"}}),t._v(" "),t._l(t.shownList,(function(e,r){return n(t.component(e),t._b({key:e.fileid,ref:"item-"+r,refInFor:!0,tag:"component",class:"row-"+t.getRowNumber(r)},"component",t.props(e),!1))})),t._v(" "),t.loadingPage?n("div",{key:"grid-loading",staticClass:"grid-loading icon-loading",attrs:{role:"none"}}):t._e(),t._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:t.shownLastRow<t.lastRow,expression:"shownLastRow < lastRow"}],key:"filler-bottom",ref:"filler-bottom",staticClass:"grid-filler grid-filler--bottom",style:{paddingBottom:t.bottomPadding},attrs:{role:"none"}})],2)}),[],!1,null,"58a31b68",null).exports),xn=function(t){return Array.apply(null,Array(t)).map((function(t,e){return e}))};
+ */var dn=function(){return hn.apply(this,arguments)};function hn(){return(hn=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){ln(o,r,i,a,s,"next",t)}function s(t){ln(o,r,i,a,s,"throw",t)}a(void 0)}))}}(regeneratorRuntime.mark((function t(){var e,n,r,i,a,s,c=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=c.length>0&&void 0!==c[0]&&c[0],n=c.length>1&&void 0!==c[1]?c[1]:{},n=Object.assign({},{page:0,perPage:10*fn.sizes.max.count},n),r="/files/".concat(Object(o.getCurrentUser)().uid),i=me.reduce((function(t,e){return"".concat(t,"\n\t\t<d:eq>\n\t\t\t<d:prop>\n\t\t\t\t<d:getcontenttype/>\n\t\t\t</d:prop>\n\t\t\t<d:literal>").concat(e,"</d:literal>\n\t\t</d:eq>\n\t")}),""),a=e?"<d:eq>\n\t\t\t\t<d:prop>\n\t\t\t\t\t<oc:favorite/>\n\t\t\t\t</d:prop>\n\t\t\t\t<d:literal>1</d:literal>\n\t\t\t</d:eq>":"",n=Object.assign({method:"SEARCH",headers:{"content-Type":"text/xml"},data:'<?xml version="1.0" encoding="UTF-8"?>\n\t\t\t<d:searchrequest xmlns:d="DAV:"\n\t\t\t\txmlns:oc="http://owncloud.org/ns"\n\t\t\t\txmlns:nc="http://nextcloud.org/ns"\n\t\t\t\txmlns:ns="https://github.com/icewind1991/SearchDAV/ns"\n\t\t\t\txmlns:ocs="http://open-collaboration-services.org/ns">\n\t\t\t\t<d:basicsearch>\n\t\t\t\t\t<d:select>\n\t\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t\t'.concat(un,"\n\t\t\t\t\t\t</d:prop>\n\t\t\t\t\t</d:select>\n\t\t\t\t\t<d:from>\n\t\t\t\t\t\t<d:scope>\n\t\t\t\t\t\t\t<d:href>").concat(r,"</d:href>\n\t\t\t\t\t\t\t<d:depth>infinity</d:depth>\n\t\t\t\t\t\t</d:scope>\n\t\t\t\t\t</d:from>\n\t\t\t\t\t<d:where>\n\t\t\t\t\t\t<d:and>\n\t\t\t\t\t\t\t<d:or>\n\t\t\t\t\t\t\t\t").concat(i,"\n\t\t\t\t\t\t\t</d:or>\n\t\t\t\t\t\t\t").concat(a,"\n\t\t\t\t\t\t\t<d:eq>\n\t\t\t\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t\t\t\t<oc:owner-id/>\n\t\t\t\t\t\t\t\t</d:prop>\n\t\t\t\t\t\t\t\t<d:literal>").concat(Object(o.getCurrentUser)().uid,"</d:literal>\n\t\t\t\t\t\t\t</d:eq>\n\t\t\t\t\t\t</d:and>\n\t\t\t\t\t</d:where>\n\t\t\t\t\t<d:orderby>\n\t\t\t\t\t\t<d:order>\n\t\t\t\t\t\t\t<d:prop><d:getlastmodified/></d:prop>\n\t\t\t\t\t\t\t<d:descending/>\n\t\t\t\t\t\t</d:order>\n\t\t\t\t\t</d:orderby>\n\t\t\t\t\t<d:limit>\n\t\t\t\t\t\t<d:nresults>").concat(n.perPage,"</d:nresults>\n\t\t\t\t\t\t<ns:firstresult>").concat(n.page*n.perPage,"</ns:firstresult>\n\t\t\t\t\t</d:limit>\n\t\t\t\t</d:basicsearch>\n\t\t\t</d:searchrequest>"),deep:!0,details:!0},n),t.next=9,cn.getDirectoryContents("",n);case 9:return s=t.sent,t.abrupt("return",s.data.map((function(t){return ge(t)})).map((function(t){return Object.assign({},t,{filename:t.filename.replace(r,"")})})));case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var pn=r(111),An=r.n(pn),gn=r(109),vn=r.n(gn);const mn=(t,e)=>{const n=vn()(),r={},i=()=>{vn()()-n>=e?t.call(null):r.value=An()(i)};return r.value=An()(i),r};var yn=new c.default({data:function(){return{gridConfig:fn.sizes.max}},watch:{gridConfig:function(t){this.$emit("changed",t)}},created:function(){window.addEventListener("resize",this.handleWindowResize),this.handleWindowResize()},beforeDestroy:function(){window.removeEventListener("resize",this.handleWindowResize)},methods:{handleWindowResize:function(){var t=Object.keys(fn.sizes).find((function(t){return t>document.documentElement.clientWidth}));this.gridConfig=fn.sizes[t]}}}),bn={data:function(){return{gridConfig:{}}},created:function(){var t=this;yn.$on("changed",(function(e){t.gridConfig=e})),console.debug("Current grid config",yn.gridConfig),this.gridConfig=yn.gridConfig},beforeDestroy:function(){yn.$off("changed",this.gridConfig)}},wn={name:"VirtualGrid",components:{Grid:Fe},mixins:[bn],props:{list:{type:Array,default:function(){return[]}},props:{type:Function,default:function(){return{}}},component:{type:Function,required:!0},loadingPage:{type:Boolean,default:!1}},data:function(){return{shownFirstRow:0,shownLastRow:this.getRowNumber(this.list.length-1)}},computed:{shownList:function(){var t=this;return this.list.filter((function(e,n){return t.isVisible(n)}))},topPadding:function(){return"".concat(100*this.shownFirstRow,"%")},bottomPadding:function(){return"".concat(100*(this.lastRow-this.shownLastRow),"%")},lastRow:function(){return this.getRowNumber(this.list.length-1)}},created:function(){window.addEventListener("scroll",this.onDocumentScroll)},mounted:function(){this.onDocumentScroll()},beforeDestroy:function(){window.removeEventListener("scroll",this.onDocumentScroll)},methods:{debounceOnDocumentScroll:function(){var t;this.debounceOnDocumentScrollRequest&&(t=this.debounceOnDocumentScrollRequest,Object(pn.cancel)(t.value)),this.debounceOnDocumentScrollRequest=mn(this.onDocumentScroll,150)},onDocumentScroll:function(){var t=this.$refs.grid.$el,e=getComputedStyle(t),n=parseFloat(e.gridTemplateColumns.split(" ")[0],10),r=this.roundToTen(window.pageYOffset-this.gridConfig.marginTop),i=Math.floor(r/(n+this.gridConfig.gap))-1,o=Math.ceil(window.innerHeight/n)+i+1;this.shownFirstRow=Math.max(i,0),this.shownLastRow=Math.min(o,this.lastRow),this.shownLastRow>=this.lastRow&&this.$emit("bottomReached")},isVisible:function(t){var e=this.getRowNumber(t);return e>=this.shownFirstRow&&e<this.shownLastRow+1},getRowNumber:function(t){var e=this.gridConfig?this.gridConfig.count:this.list.length;return Math.floor(t/e)},roundToTen:function(t){return 10*Math.floor(t/10)}}},_n=(r(655),E(wn,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Grid",{ref:"grid"},[n("span",{directives:[{name:"show",rawName:"v-show",value:t.shownFirstRow>0,expression:"shownFirstRow > 0"}],key:"filler-top",ref:"filler-top",staticClass:"grid-filler grid-filler--top",style:{paddingBottom:t.topPadding},attrs:{role:"none"}}),t._v(" "),t._l(t.shownList,(function(e,r){return n(t.component(e),t._b({key:e.fileid,ref:"item-"+r,refInFor:!0,tag:"component",class:"row-"+t.getRowNumber(r)},"component",t.props(e),!1))})),t._v(" "),t.loadingPage?n("div",{key:"grid-loading",staticClass:"grid-loading icon-loading",attrs:{role:"none"}}):t._e(),t._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:t.shownLastRow<t.lastRow,expression:"shownLastRow < lastRow"}],key:"filler-bottom",ref:"filler-bottom",staticClass:"grid-filler grid-filler--bottom",style:{paddingBottom:t.bottomPadding},attrs:{role:"none"}})],2)}),[],!1,null,"58a31b68",null));
/**
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
*
@@ -421,7 +421,7 @@ var Ie=function(t){var e=fe.a.CancelToken.source();return{request:function(){var
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- */function En(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function Mn(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){En(o,r,i,a,s,"next",t)}function s(t){En(o,r,i,a,s,"throw",t)}a(void 0)}))}}function Cn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Tn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var In,Sn,Bn=E({name:"Timeline",components:{EmptyContent:Ce,VirtualGrid:_n},mixins:[bn],props:{loading:{type:Boolean,required:!0},onlyFavorites:{type:Boolean,default:!1}},data:function(){return{cancelRequest:function(){},done:!1,error:null,loadingPage:!1,page:0}},computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Cn(Object(n),!0).forEach((function(e){Tn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Cn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},Object(ce.c)(["files","timeline"]),{fileList:function(){var t=this;return this.timeline.map((function(e){return t.files[e]})).filter((function(t){return!!t}))},isEmpty:function(){return 0===this.fileList.length},chunkedList:function(){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;return xn(Math.ceil(t.length/e)).map((function(n,r){return t.slice(r*e,r*e+e)}))}(this.fileList,this.gridConfig.count)}}),watch:{onlyFavorites:(Sn=Mn(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.resetState(),this.$emit("update:loading",!0),this.fetchContent();case 3:case"end":return t.stop()}}),t,this)}))),function(){return Sn.apply(this,arguments)})},beforeMount:function(){var t=Mn(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.resetState(),this.fetchContent();case 2:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),beforeDestroy:function(){this.cancelRequest()},methods:{fetchContent:(In=Mn(regeneratorRuntime.mark((function t(){var e,n,r,i,o=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.loadingPage){t.next=2;break}return t.abrupt("return");case 2:return this.cancelRequest("Changed view"),OCA.Viewer.close(),0===this.timeline.length&&this.$emit("update:loading",!0),this.error=null,this.loadingPage=!0,e=Ie(dn),n=e.request,r=e.cancel,this.cancelRequest=r,t.prev=9,t.next=12,n(this.onlyFavorites,{page:this.page,perPage:5*this.gridConfig.count});case 12:i=t.sent,this.$store.dispatch("updateTimeline",i),this.$store.dispatch("appendFiles",i),i.length===5*this.gridConfig.count?this.page++:(console.debug("We loaded the last page"),this.done=!0),t.next=22;break;case 18:t.prev=18,t.t0=t.catch(9),t.t0.response&&t.t0.response.status&&(404===t.t0.response.status?(this.error=404,setTimeout((function(){o.$router.push({name:o.$route.name})}),3e3)):this.error=t.t0),console.error("Error fetching timeline",t.t0);case 22:return t.prev=22,this.$emit("update:loading",!1),this.loadingPage=!1,t.finish(22);case 26:case"end":return t.stop()}}),t,this,[[9,18,22,26]])}))),function(){return In.apply(this,arguments)}),getProps:function(t){return t},getComponent:function(){return Re},debounceOnBottomReached:tn()((function(){this.onBottomReached()}),1e3),onBottomReached:function(){this.loadingPage||this.done||(console.debug("Loading next page",this.page),this.fetchContent())},resetState:function(){this.$store.dispatch("resetTimeline"),this.done=!1,this.error=null,this.loadingPage=!1,this.page=0,this.page=0}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return 404===t.error?n("EmptyContent",{attrs:{"illustration-name":"folder"}},[t._v("\n\t"+t._s(t.t("photos","This folder does not exists"))+"\n")]):t.error?n("EmptyContent",[t._v("\n\t"+t._s(t.t("photos","An error occurred"))+"\n")]):!t.loading&&t.isEmpty?n("EmptyContent",{attrs:{"illustration-name":"empty"}},[t._v("\n\t"+t._s(t.t("photos","No photos in here"))+"\n")]):t.loading?t._e():n("VirtualGrid",{attrs:{component:t.getComponent,list:t.fileList,"loading-page":t.loadingPage,props:t.getProps},on:{bottomReached:t.onBottomReached}})}),[],!1,null,null,null).exports;function On(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}
+ */function xn(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function En(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){xn(o,r,i,a,s,"next",t)}function s(t){xn(o,r,i,a,s,"throw",t)}a(void 0)}))}}function Mn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Cn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Tn,In,Sn=E({name:"Timeline",components:{EmptyContent:Ce,VirtualGrid:_n.exports},mixins:[bn],props:{loading:{type:Boolean,required:!0},onlyFavorites:{type:Boolean,default:!1}},data:function(){return{cancelRequest:function(){},done:!1,error:null,loadingPage:!1,page:0}},computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Mn(Object(n),!0).forEach((function(e){Cn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},Object(ce.c)(["files","timeline"]),{fileList:function(){var t=this;return this.timeline.map((function(e){return t.files[e]})).filter((function(t){return!!t}))},isEmpty:function(){return 0===this.fileList.length}}),watch:{onlyFavorites:(In=En(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.resetState(),this.$emit("update:loading",!0),this.fetchContent();case 3:case"end":return t.stop()}}),t,this)}))),function(){return In.apply(this,arguments)})},beforeMount:function(){var t=En(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.resetState(),this.fetchContent();case 2:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),beforeDestroy:function(){this.cancelRequest()},methods:{fetchContent:(Tn=En(regeneratorRuntime.mark((function t(){var e,n,r,i,o=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.loadingPage){t.next=2;break}return t.abrupt("return");case 2:return this.cancelRequest("Changed view"),OCA.Viewer.close(),0===this.timeline.length&&this.$emit("update:loading",!0),this.error=null,this.loadingPage=!0,e=Ie(dn),n=e.request,r=e.cancel,this.cancelRequest=r,t.prev=9,t.next=12,n(this.onlyFavorites,{page:this.page,perPage:5*this.gridConfig.count});case 12:i=t.sent,this.$store.dispatch("updateTimeline",i),this.$store.dispatch("appendFiles",i),i.length===5*this.gridConfig.count?this.page++:(console.debug("We loaded the last page"),this.done=!0),t.next=22;break;case 18:t.prev=18,t.t0=t.catch(9),t.t0.response&&t.t0.response.status&&(404===t.t0.response.status?(this.error=404,setTimeout((function(){o.$router.push({name:o.$route.name})}),3e3)):this.error=t.t0),console.error("Error fetching timeline",t.t0);case 22:return t.prev=22,this.$emit("update:loading",!1),this.loadingPage=!1,t.finish(22);case 26:case"end":return t.stop()}}),t,this,[[9,18,22,26]])}))),function(){return Tn.apply(this,arguments)}),getProps:function(t){return t},getComponent:function(){return Re},debounceOnBottomReached:tn()((function(){this.onBottomReached()}),1e3),onBottomReached:function(){this.loadingPage||this.done||(console.debug("Loading next page",this.page),this.fetchContent())},resetState:function(){this.$store.dispatch("resetTimeline"),this.done=!1,this.error=null,this.loadingPage=!1,this.page=0,this.page=0}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return 404===t.error?n("EmptyContent",{attrs:{"illustration-name":"folder"}},[t._v("\n\t"+t._s(t.t("photos","This folder does not exists"))+"\n")]):t.error?n("EmptyContent",[t._v("\n\t"+t._s(t.t("photos","An error occurred"))+"\n")]):!t.loading&&t.isEmpty?n("EmptyContent",{attrs:{"illustration-name":"empty"}},[t._v("\n\t"+t._s(t.t("photos","No photos in here"))+"\n")]):t.loading?t._e():n("VirtualGrid",{attrs:{component:t.getComponent,list:t.fileList,"loading-page":t.loadingPage,props:t.getProps},on:{bottomReached:t.onBottomReached}})}),[],!1,null,null,null).exports;function Bn(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}
/**
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
*
@@ -442,7 +442,7 @@ var Ie=function(t){var e=fe.a.CancelToken.source();return{request:function(){var
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- */var Dn=function(t){return Nn.apply(this,arguments)};function Nn(){return(Nn=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){On(o,r,i,a,s,"next",t)}function s(t){On(o,r,i,a,s,"throw",t)}a(void 0)}))}}(regeneratorRuntime.mark((function t(e){var n,r,i=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},t.next=3,cn.getDirectoryContents("/systemtags/",Object.assign({},{data:'<?xml version="1.0"?>\n\t\t\t<d:propfind xmlns:d="DAV:"\n\t\t\t\txmlns:oc="http://owncloud.org/ns">\n\t\t\t\t<d:prop>\n\t\t\t\t\t<oc:id />\n\t\t\t\t\t<oc:display-name />\n\t\t\t\t\t<oc:user-visible />\n\t\t\t\t\t<oc:user-assignable />\n\t\t\t\t\t<oc:can-assign />\n\t\t\t\t</d:prop>\n\t\t\t</d:propfind>',details:!0},n));case 3:return r=t.sent,t.abrupt("return",r.data.map((function(t){return ge(t)})));case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function kn(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}
+ */var On=function(t){return Dn.apply(this,arguments)};function Dn(){return(Dn=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Bn(o,r,i,a,s,"next",t)}function s(t){Bn(o,r,i,a,s,"throw",t)}a(void 0)}))}}(regeneratorRuntime.mark((function t(e){var n,r,i=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},t.next=3,cn.getDirectoryContents("/systemtags/",Object.assign({},{data:'<?xml version="1.0"?>\n\t\t\t<d:propfind xmlns:d="DAV:"\n\t\t\t\txmlns:oc="http://owncloud.org/ns">\n\t\t\t\t<d:prop>\n\t\t\t\t\t<oc:id />\n\t\t\t\t\t<oc:display-name />\n\t\t\t\t\t<oc:user-visible />\n\t\t\t\t\t<oc:user-assignable />\n\t\t\t\t\t<oc:can-assign />\n\t\t\t\t</d:prop>\n\t\t\t</d:propfind>',details:!0},n));case 3:return r=t.sent,t.abrupt("return",r.data.map((function(t){return ge(t)})));case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Nn(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}
/**
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
*
@@ -484,7 +484,7 @@ var Ie=function(t){var e=fe.a.CancelToken.source();return{request:function(){var
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- */var jn=function(t){return Ln.apply(this,arguments)};function Ln(){return(Ln=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){kn(o,r,i,a,s,"next",t)}function s(t){kn(o,r,i,a,s,"throw",t)}a(void 0)}))}}(regeneratorRuntime.mark((function t(e){var n,r,i,a=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},n=Object.assign({method:"REPORT",data:'<?xml version="1.0"?>\n\t\t\t<oc:filter-files\n\t\t\t\txmlns:d="DAV:"\n\t\t\t\txmlns:oc="http://owncloud.org/ns"\n\t\t\t\txmlns:nc="http://nextcloud.org/ns"\n\t\t\t\txmlns:ocs="http://open-collaboration-services.org/ns">\n\t\t\t\t<d:prop>\n\t\t\t\t\t'.concat(un,"\n\t\t\t\t</d:prop>\n\t\t\t\t<oc:filter-rules>\n\t\t\t\t\t<oc:systemtag>").concat(e,"</oc:systemtag>\n\t\t\t\t</oc:filter-rules>\n\t\t\t</oc:filter-files>"),details:!0},n),r="/files/".concat(Object(o.getCurrentUser)().uid),t.next=5,cn.getDirectoryContents(r,n);case 5:return i=t.sent,t.abrupt("return",i.data.map((function(t){return ge(t)})).map((function(t){return Object.assign({},t,{filename:t.filename.replace(r,"")})})));case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Pn(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function Rn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Un(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Fn=E({name:"Tag",components:{FolderTagPreview:Be},inheritAttrs:!1,props:{displayName:{type:String,required:!0},id:{type:Number,required:!0}},data:function(){return{cancelRequest:function(){}}},computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Rn(Object(n),!0).forEach((function(e){Un(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Rn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},Object(ce.c)(["files","tags"]),{folderContent:function(){return this.tags[this.id].files},fileList:function(){var t=this;return this.folderContent?this.folderContent.map((function(e){return t.files[e]})).filter((function(t){return!!t})).slice(0,4):[]}}),beforeDestroy:function(){this.cancelRequest("Navigated away")},created:function(){var t=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Pn(o,r,i,a,s,"next",t)}function s(t){Pn(o,r,i,a,s,"throw",t)}a(void 0)}))}}(regeneratorRuntime.mark((function t(){var e,n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=Ie(jn),n=e.request,r=e.cancel,this.cancelRequest=r,t.prev=2,t.next=5,n(this.id);case 5:i=t.sent,this.$store.dispatch("updateTag",{id:this.id,files:i}),this.$store.dispatch("appendFiles",i),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(2),t.t0.response&&t.t0.response.status&&console.error("Failed to get folder content",this.id,t.t0.response);case 13:case"end":return t.stop()}}),t,this,[[2,10]])})));return function(){return t.apply(this,arguments)}}()},(function(){var t=this.$createElement;return(this._self._c||t)("FolderTagPreview",{attrs:{id:this.id,icon:"icon-tag",name:this.displayName,path:this.displayName,"file-list":this.fileList}})}),[],!1,null,null,null).exports;function Qn(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function zn(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Qn(o,r,i,a,s,"next",t)}function s(t){Qn(o,r,i,a,s,"throw",t)}a(void 0)}))}}function Gn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Yn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var $n,Hn,Wn=E({name:"Tags",components:{EmptyContent:Ce,File:Re,Tag:Fn,Grid:Fe,Navigation:$e},props:{rootTitle:{type:String,required:!0},path:{type:String,default:""},loading:{type:Boolean,required:!0},isRoot:{type:Boolean,default:!0}},data:function(){return{error:null,cancelRequest:function(){}}},computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Gn(Object(n),!0).forEach((function(e){Yn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Gn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},Object(ce.c)(["files","tags","tagsNames"]),{tagId:function(){return this.$store.getters.tagId(this.path)},tag:function(){return this.tags[this.tagId]},fileList:function(){var t=this;return this.tag&&this.tag.files.map((function(e){return t.files[e]})).filter((function(t){return!!t}))},isEmpty:function(){return this.isRoot?0===Object.keys(this.tagsNames).length:0===this.fileList.length}}),watch:{path:(Hn=zn(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.tagId){t.next=3;break}return t.next=3,this.fetchRootContent();case 3:this.isRoot||this.fetchContent();case 4:case"end":return t.stop()}}),t,this)}))),function(){return Hn.apply(this,arguments)})},beforeDestroy:function(){this.cancelRequest("Changed view")},beforeMount:function(){var t=zn(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.tagId){t.next=3;break}return t.next=3,this.fetchRootContent();case 3:this.isRoot||this.fetchContent();case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),methods:{fetchRootContent:($n=zn(regeneratorRuntime.mark((function t(){var e,n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.cancelRequest("Changed folder"),OCA.Viewer.close(),this.tags[this.tagId]||this.$emit("update:loading",!0),this.error=null,e=Ie(Dn),n=e.request,r=e.cancel,this.cancelRequest=r,t.prev=6,t.next=9,n();case 9:i=t.sent,this.$store.dispatch("updateTags",i),t.next=17;break;case 13:t.prev=13,t.t0=t.catch(6),console.error(t.t0),this.error=!0;case 17:return t.prev=17,this.$emit("update:loading",!1),t.finish(17);case 20:case"end":return t.stop()}}),t,this,[[6,13,17,20]])}))),function(){return $n.apply(this,arguments)}),fetchContent:function(){var t=zn(regeneratorRuntime.mark((function t(){var e,n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.cancelRequest(),OCA.Viewer.close(),this.tags[this.tagId]||this.$emit("update:loading",!0),this.error=null,e=Ie(jn),n=e.request,r=e.cancel,this.cancelRequest=r,t.next=8,n(this.tagId);case 8:i=t.sent,this.$store.dispatch("updateTag",{id:this.tagId,files:i}),this.$store.dispatch("appendFiles",i),this.$emit("update:loading",!1);case 12:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.error?n("EmptyContent",[t._v("\n\t"+t._s(t.t("photos","An error occurred"))+"\n")]):t.loading?t._e():n("Grid",[n("Navigation",{key:"navigation",attrs:{basename:t.path,filename:"/"+t.path,"root-title":t.rootTitle}}),t._v(" "),t.isRoot?t._l(t.tagsNames,(function(e){return n("Tag",t._b({key:e,attrs:{fileid:e,basename:t.tags[e].displayName}},"Tag",t.tags[e],!1))})):[t.isEmpty?n("EmptyContent",{key:"emptycontent",attrs:{"illustration-name":"empty"},scopedSlots:t._u([{key:"desc",fn:function(){return[t._v("\n\t\t\t\t"+t._s(t.t("photos","Photos with tags will show up here"))+"\n\t\t\t")]},proxy:!0}],null,!1,3269923249)},[t._v("\n\t\t\t"+t._s(t.t("photos","No tags yet"))+"\n\t\t\t")]):t._e(),t._v(" "),t._l(t.fileList,(function(e){return n("File",t._b({key:e.fileid},"File",e,!1))}))]],2)}),[],!1,null,null,null).exports,qn=Object(ve.loadState)("photos","maps");
+ */var kn=function(t){return jn.apply(this,arguments)};function jn(){return(jn=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Nn(o,r,i,a,s,"next",t)}function s(t){Nn(o,r,i,a,s,"throw",t)}a(void 0)}))}}(regeneratorRuntime.mark((function t(e){var n,r,i,a=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},n=Object.assign({method:"REPORT",data:'<?xml version="1.0"?>\n\t\t\t<oc:filter-files\n\t\t\t\txmlns:d="DAV:"\n\t\t\t\txmlns:oc="http://owncloud.org/ns"\n\t\t\t\txmlns:nc="http://nextcloud.org/ns"\n\t\t\t\txmlns:ocs="http://open-collaboration-services.org/ns">\n\t\t\t\t<d:prop>\n\t\t\t\t\t'.concat(un,"\n\t\t\t\t</d:prop>\n\t\t\t\t<oc:filter-rules>\n\t\t\t\t\t<oc:systemtag>").concat(e,"</oc:systemtag>\n\t\t\t\t</oc:filter-rules>\n\t\t\t</oc:filter-files>"),details:!0},n),r="/files/".concat(Object(o.getCurrentUser)().uid),t.next=5,cn.getDirectoryContents(r,n);case 5:return i=t.sent,t.abrupt("return",i.data.map((function(t){return ge(t)})).map((function(t){return Object.assign({},t,{filename:t.filename.replace(r,"")})})));case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ln(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function Pn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Rn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Un=E({name:"Tag",components:{FolderTagPreview:Be},inheritAttrs:!1,props:{displayName:{type:String,required:!0},id:{type:Number,required:!0}},data:function(){return{cancelRequest:function(){}}},computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Pn(Object(n),!0).forEach((function(e){Rn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Pn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},Object(ce.c)(["files","tags"]),{folderContent:function(){return this.tags[this.id].files},fileList:function(){var t=this;return this.folderContent?this.folderContent.map((function(e){return t.files[e]})).filter((function(t){return!!t})).slice(0,4):[]}}),beforeDestroy:function(){this.cancelRequest("Navigated away")},created:function(){var t=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Ln(o,r,i,a,s,"next",t)}function s(t){Ln(o,r,i,a,s,"throw",t)}a(void 0)}))}}(regeneratorRuntime.mark((function t(){var e,n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=Ie(kn),n=e.request,r=e.cancel,this.cancelRequest=r,t.prev=2,t.next=5,n(this.id);case 5:i=t.sent,this.$store.dispatch("updateTag",{id:this.id,files:i}),this.$store.dispatch("appendFiles",i),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(2),t.t0.response&&t.t0.response.status&&console.error("Failed to get folder content",this.id,t.t0.response);case 13:case"end":return t.stop()}}),t,this,[[2,10]])})));return function(){return t.apply(this,arguments)}}()},(function(){var t=this.$createElement;return(this._self._c||t)("FolderTagPreview",{attrs:{id:this.id,icon:"icon-tag",name:this.displayName,path:this.displayName,"file-list":this.fileList}})}),[],!1,null,null,null).exports;function Fn(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function Qn(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Fn(o,r,i,a,s,"next",t)}function s(t){Fn(o,r,i,a,s,"throw",t)}a(void 0)}))}}function zn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Gn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Yn,$n,Hn=E({name:"Tags",components:{EmptyContent:Ce,File:Re,Tag:Un,Grid:Fe,Navigation:$e},props:{rootTitle:{type:String,required:!0},path:{type:String,default:""},loading:{type:Boolean,required:!0},isRoot:{type:Boolean,default:!0}},data:function(){return{error:null,cancelRequest:function(){}}},computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?zn(Object(n),!0).forEach((function(e){Gn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},Object(ce.c)(["files","tags","tagsNames"]),{tagId:function(){return this.$store.getters.tagId(this.path)},tag:function(){return this.tags[this.tagId]},fileList:function(){var t=this;return this.tag&&this.tag.files.map((function(e){return t.files[e]})).filter((function(t){return!!t}))},isEmpty:function(){return this.isRoot?0===Object.keys(this.tagsNames).length:0===this.fileList.length}}),watch:{path:($n=Qn(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.tagId){t.next=3;break}return t.next=3,this.fetchRootContent();case 3:this.isRoot||this.fetchContent();case 4:case"end":return t.stop()}}),t,this)}))),function(){return $n.apply(this,arguments)})},beforeDestroy:function(){this.cancelRequest("Changed view")},beforeMount:function(){var t=Qn(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.tagId){t.next=3;break}return t.next=3,this.fetchRootContent();case 3:this.isRoot||this.fetchContent();case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),methods:{fetchRootContent:(Yn=Qn(regeneratorRuntime.mark((function t(){var e,n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.cancelRequest("Changed folder"),OCA.Viewer.close(),this.tags[this.tagId]||this.$emit("update:loading",!0),this.error=null,e=Ie(On),n=e.request,r=e.cancel,this.cancelRequest=r,t.prev=6,t.next=9,n();case 9:i=t.sent,this.$store.dispatch("updateTags",i),t.next=17;break;case 13:t.prev=13,t.t0=t.catch(6),console.error(t.t0),this.error=!0;case 17:return t.prev=17,this.$emit("update:loading",!1),t.finish(17);case 20:case"end":return t.stop()}}),t,this,[[6,13,17,20]])}))),function(){return Yn.apply(this,arguments)}),fetchContent:function(){var t=Qn(regeneratorRuntime.mark((function t(){var e,n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.cancelRequest(),OCA.Viewer.close(),this.tags[this.tagId]||this.$emit("update:loading",!0),this.error=null,e=Ie(kn),n=e.request,r=e.cancel,this.cancelRequest=r,t.next=8,n(this.tagId);case 8:i=t.sent,this.$store.dispatch("updateTag",{id:this.tagId,files:i}),this.$store.dispatch("appendFiles",i),this.$emit("update:loading",!1);case 12:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.error?n("EmptyContent",[t._v("\n\t"+t._s(t.t("photos","An error occurred"))+"\n")]):t.loading?t._e():n("Grid",[n("Navigation",{key:"navigation",attrs:{basename:t.path,filename:"/"+t.path,"root-title":t.rootTitle}}),t._v(" "),t.isRoot?t._l(t.tagsNames,(function(e){return n("Tag",t._b({key:e,attrs:{fileid:e,basename:t.tags[e].displayName}},"Tag",t.tags[e],!1))})):[t.isEmpty?n("EmptyContent",{key:"emptycontent",attrs:{"illustration-name":"empty"},scopedSlots:t._u([{key:"desc",fn:function(){return[t._v("\n\t\t\t\t"+t._s(t.t("photos","Photos with tags will show up here"))+"\n\t\t\t")]},proxy:!0}],null,!1,3269923249)},[t._v("\n\t\t\t"+t._s(t.t("photos","No tags yet"))+"\n\t\t\t")]):t._e(),t._v(" "),t._l(t.fileList,(function(e){return n("File",t._b({key:e.fileid},"File",e,!1))}))]],2)}),[],!1,null,null,null).exports,Wn=Object(ve.loadState)("photos","maps");
/**
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
*
@@ -506,7 +506,7 @@ var Ie=function(t){var e=fe.a.CancelToken.source();return{request:function(){var
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-c.default.use(se);var Vn=Object(i.generateUrl)("/apps/maps");qn||(Vn=Object(i.generateUrl)("/settings/apps/integration/maps"));var Zn=new se({mode:"history",base:Object(i.generateUrl)("/apps/photos",""),linkActiveClass:"active",routes:[{path:"/",component:Bn,name:"root"},{path:"/albums/:path*",component:Je,name:"albums",props:function(e){return{path:"/".concat(e.params.path?e.params.path:""),isRoot:!e.params.path,rootTitle:t("photos","Your albums")}}},{path:"/shared/:path*",component:Je,name:"shared",props:function(e){return{path:"/".concat(e.params.path?e.params.path:""),isRoot:!e.params.path,rootTitle:t("photos","Shared albums"),showShared:!0}}},{path:"/favorites",component:Bn,name:"favorites",props:{onlyFavorites:!0}},{path:"/tags/:path*",component:Wn,name:"tags",props:function(e){return{path:"".concat(e.params.path?e.params.path:""),isRoot:!e.params.path,rootTitle:t("photos","Tagged photos")}}},{path:"/maps",name:"maps",beforeEnter:function(){window.open(Vn,"_blank")}}]});function Xn(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}
+c.default.use(se);var qn=Object(i.generateUrl)("/apps/maps");Wn||(qn=Object(i.generateUrl)("/settings/apps/integration/maps"));var Vn=new se({mode:"history",base:Object(i.generateUrl)("/apps/photos",""),linkActiveClass:"active",routes:[{path:"/",component:Sn,name:"root"},{path:"/albums/:path*",component:Je,name:"albums",props:function(e){return{path:"/".concat(e.params.path?e.params.path:""),isRoot:!e.params.path,rootTitle:t("photos","Your albums")}}},{path:"/shared/:path*",component:Je,name:"shared",props:function(e){return{path:"/".concat(e.params.path?e.params.path:""),isRoot:!e.params.path,rootTitle:t("photos","Shared albums"),showShared:!0}}},{path:"/favorites",component:Sn,name:"favorites",props:{onlyFavorites:!0}},{path:"/tags/:path*",component:Hn,name:"tags",props:function(e){return{path:"".concat(e.params.path?e.params.path:""),isRoot:!e.params.path,rootTitle:t("photos","Tagged photos")}}},{path:"/maps",name:"maps",beforeEnter:function(){window.open(qn,"_blank")}}]});function Zn(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}
/**
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
*
@@ -527,7 +527,7 @@ c.default.use(se);var Vn=Object(i.generateUrl)("/apps/maps");qn||(Vn=Object(i.ge
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- */(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var Jn={state:{files:{}},mutations:{updateFiles:function(t,e){e.forEach((function(e){e.fileid>=0&&c.default.set(t.files,e.fileid,e)}))},setSubFolders:function(t,e){var n=e.fileid,r=e.folders;if(t.files[n]){var i=r.map((function(t){return t.fileid})).filter((function(t){return t>=0}));c.default.set(t.files[n],"folders",i)}}},getters:{files:function(t){return t.files}},actions:{updateFiles:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.folder,r=e.files,i=void 0===r?[]:r,o=e.folders,a=void 0===o?[]:o;t.commit("updateFiles",[n].concat(Xn(i),Xn(a))),t.commit("setSubFolders",{fileid:n.fileid,folders:a})},appendFiles:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];t.commit("updateFiles",e)}}},Kn={state:{paths:{},folders:{}},mutations:{updateFolders:function(t,e){var n=e.fileid,r=e.files;if(r.length>0){var i=r.sort((function(t,e){return Ae(t,e,"lastmod")})).filter((function(t){return t.fileid>=0}));c.default.set(t.folders,n,i.map((function(t){return t.fileid})))}else c.default.set(t.folders,n,[])},addPath:function(t,e){var n=e.path,r=e.fileid;r>=0&&c.default.set(t.paths,n,r)}},getters:{folders:function(t){return t.folders},folder:function(t){return function(e){return t.folders[e]}},folderId:function(t){return function(e){return t.paths[e]}}},actions:{updateFolders:function(t,e){var n=e.fileid,r=e.files,i=e.folders;t.commit("updateFolders",{fileid:n,files:r}),i.forEach((function(e){return t.commit("addPath",{path:e.filename,fileid:e.fileid})}))},addPath:function(t,e){var n=e.path,r=e.fileid;t.commit("addPath",{path:n,fileid:r})}}},tr={state:{tags:{},names:{}},mutations:{updateTags:function(t,e){e.length>0&&e.sort((function(t,e){return Ae(t,e,"displayName")})).forEach((function(e){c.default.set(t.tags,e.id,e),c.default.set(t.tags[e.id],"files",[]),c.default.set(t.names,e.displayName,e.id)}))},updateTag:function(t,e){var n=e.id,r=e.files.sort((function(t,e){return Ae(t,e,"lastmod")}));console.info(n,r),c.default.set(t.tags[n],"files",r.map((function(t){return t.fileid})))}},getters:{tags:function(t){return t.tags},tagsNames:function(t){return t.names},tag:function(t){return function(e){return t.tags[e]}},tagId:function(t){return function(e){return t.names[e]}}},actions:{updateTags:function(t,e){t.commit("updateTags",e)},updateTag:function(t,e){var n=e.id,r=e.files;t.commit("updateTag",{id:n,files:r})}}};function er(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}
+ */(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var Xn={state:{files:{}},mutations:{updateFiles:function(t,e){e.forEach((function(e){e.fileid>=0&&c.default.set(t.files,e.fileid,e)}))},setSubFolders:function(t,e){var n=e.fileid,r=e.folders;if(t.files[n]){var i=r.map((function(t){return t.fileid})).filter((function(t){return t>=0}));c.default.set(t.files[n],"folders",i)}}},getters:{files:function(t){return t.files}},actions:{updateFiles:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.folder,r=e.files,i=void 0===r?[]:r,o=e.folders,a=void 0===o?[]:o;t.commit("updateFiles",[n].concat(Zn(i),Zn(a))),t.commit("setSubFolders",{fileid:n.fileid,folders:a})},appendFiles:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];t.commit("updateFiles",e)}}},Jn={state:{paths:{},folders:{}},mutations:{updateFolders:function(t,e){var n=e.fileid,r=e.files;if(r.length>0){var i=r.sort((function(t,e){return Ae(t,e,"lastmod")})).filter((function(t){return t.fileid>=0}));c.default.set(t.folders,n,i.map((function(t){return t.fileid})))}else c.default.set(t.folders,n,[])},addPath:function(t,e){var n=e.path,r=e.fileid;r>=0&&c.default.set(t.paths,n,r)}},getters:{folders:function(t){return t.folders},folder:function(t){return function(e){return t.folders[e]}},folderId:function(t){return function(e){return t.paths[e]}}},actions:{updateFolders:function(t,e){var n=e.fileid,r=e.files,i=e.folders;t.commit("updateFolders",{fileid:n,files:r}),i.forEach((function(e){return t.commit("addPath",{path:e.filename,fileid:e.fileid})}))},addPath:function(t,e){var n=e.path,r=e.fileid;t.commit("addPath",{path:n,fileid:r})}}},Kn={state:{tags:{},names:{}},mutations:{updateTags:function(t,e){e.length>0&&e.sort((function(t,e){return Ae(t,e,"displayName")})).forEach((function(e){c.default.set(t.tags,e.id,e),c.default.set(t.tags[e.id],"files",[]),c.default.set(t.names,e.displayName,e.id)}))},updateTag:function(t,e){var n=e.id,r=e.files.sort((function(t,e){return Ae(t,e,"lastmod")}));console.info(n,r),c.default.set(t.tags[n],"files",r.map((function(t){return t.fileid})))}},getters:{tags:function(t){return t.tags},tagsNames:function(t){return t.names},tag:function(t){return function(e){return t.tags[e]}},tagId:function(t){return function(e){return t.names[e]}}},actions:{updateTags:function(t,e){t.commit("updateTags",e)},updateTag:function(t,e){var n=e.id,r=e.files;t.commit("updateTag",{id:n,files:r})}}};function tr(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}
/**
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
*
@@ -548,7 +548,7 @@ c.default.use(se);var Vn=Object(i.generateUrl)("/apps/maps");qn||(Vn=Object(i.ge
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- */(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var nr={state:{timeline:[]},mutations:{updateTimeline:function(t,e){var n;(n=t.timeline).push.apply(n,er(e.map((function(t){return t.fileid})).filter((function(t){return t>=0}))))},resetTimeline:function(t){t.timeline=[]}},getters:{timeline:function(t){return t.timeline}},actions:{updateTimeline:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];t.commit("updateTimeline",e)},resetTimeline:function(t){t.commit("resetTimeline")}}};
+ */(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var er={state:{timeline:[]},mutations:{updateTimeline:function(t,e){var n;(n=t.timeline).push.apply(n,tr(e.map((function(t){return t.fileid})).filter((function(t){return t>=0}))))},resetTimeline:function(t){t.timeline=[]}},getters:{timeline:function(t){return t.timeline}},actions:{updateTimeline:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];t.commit("updateTimeline",e)},resetTimeline:function(t){t.commit("resetTimeline")}}};
/**
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
*
@@ -570,7 +570,7 @@ c.default.use(se);var Vn=Object(i.generateUrl)("/apps/maps");qn||(Vn=Object(i.ge
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-c.default.use(ce.b);var rr=new ce.a({modules:{files:Jn,folders:Kn,systemtags:tr,timeline:nr},strict:!1});
+c.default.use(ce.b);var nr=new ce.a({modules:{files:Xn,folders:Jn,systemtags:Kn,timeline:er},strict:!1});
/**
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
*
@@ -591,5 +591,5 @@ c.default.use(ce.b);var rr=new ce.a({modules:{files:Jn,folders:Kn,systemtags:tr,
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- */r.nc=btoa(Object(o.getRequestToken)()),r.p=Object(i.generateFilePath)("photos","","js/"),Object(a.sync)(rr,Zn),c.default.prototype.t=s.translate,c.default.prototype.n=s.translatePlural,window.addEventListener("DOMContentLoaded",(function(){window.OCA.Files||(window.OCA.Files={}),Object.assign(window.OCA.Files,{App:{fileList:{filesClient:OC.Files.getClient()}}},window.OCA.Files)}));n.default=new c.default({el:"#content",name:"PhotosRoot",router:Zn,store:rr,render:function(t){return t(M)}})}]);
+ */r.nc=btoa(Object(o.getRequestToken)()),r.p=Object(i.generateFilePath)("photos","","js/"),Object(a.sync)(nr,Vn),c.default.prototype.t=s.translate,c.default.prototype.n=s.translatePlural,window.addEventListener("DOMContentLoaded",(function(){window.OCA.Files||(window.OCA.Files={}),Object.assign(window.OCA.Files,{App:{fileList:{filesClient:OC.Files.getClient()}}},window.OCA.Files)}));n.default=new c.default({el:"#content",name:"PhotosRoot",router:Vn,store:nr,render:function(t){return t(M)}})}]);
//# sourceMappingURL=photos.js.map \ No newline at end of file