photos/js/photos-src_mixins_FetchAlbu...

3 lines
32 KiB
JavaScript

/*! For license information please see photos-src_mixins_FetchAlbumsMixin_js-node_modules_vue-material-design-icons_Plus_vue-src_components-4c933a.js.LICENSE.txt */
"use strict";(self.webpackChunkphotos=self.webpackChunkphotos||[]).push([["src_mixins_FetchAlbumsMixin_js-node_modules_vue-material-design-icons_Plus_vue-src_components-4c933a"],{12945:(n,e,o)=>{o.d(e,{Z:()=>h});var a=o(20629),r=o(80351),l=o.n(r),i=o(82880),s=o(45994),c=o(81067),u=o(59537),m=o(94236);function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function b(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,o)}return e}function d(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?b(Object(e),!0).forEach((function(n){f(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):b(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}function f(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function A(t,n,e,o,a,r,l){try{var i=t[r](l),s=i.value}catch(t){return void e(t)}i.done?n(s):Promise.resolve(s).then(o,a)}function g(t){return function(){var n=this,e=arguments;return new Promise((function(o,a){var r=t.apply(n,e);function l(t){A(r,o,a,l,i,"next",t)}function i(t){A(r,o,a,l,i,"throw",t)}l(void 0)}))}}const h={name:"FetchAlbumsMixin",data:function(){return{errorFetchingAlbums:null,loadingAlbums:!1}},mixins:[o(69363).Z],beforeMount:function(){var t=this;return g(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t.fetchAlbums();case 1:case"end":return n.stop()}}),n)})))()},computed:d({},(0,a.Se)(["albums"])),methods:{fetchAlbums:function(){var n=this;return g(regeneratorRuntime.mark((function e(){var o,a,r,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.loadingAlbums){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,n.loadingAlbums=!0,n.errorFetchingAlbums=null,e.next=7,c.Z.getDirectoryContents("/photos/".concat(null===(o=(0,s.ts)())||void 0===o?void 0:o.uid,"/albums"),{data:'<?xml version="1.0"?>\n\t\t\t\t\t\t\t<d:propfind xmlns:d="DAV:"\n\t\t\t\t\t\t\t\txmlns:oc="http://owncloud.org/ns"\n\t\t\t\t\t\t\t\txmlns:nc="http://nextcloud.org/ns"\n\t\t\t\t\t\t\t\txmlns:ocs="http://open-collaboration-services.org/ns">\n\t\t\t\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t\t\t\t<nc:last-photo />\n\t\t\t\t\t\t\t\t\t<nc:nbItems />\n\t\t\t\t\t\t\t\t\t<nc:location />\n\t\t\t\t\t\t\t\t\t<nc:dateRange />\n\t\t\t\t\t\t\t\t\t<nc:collaborators />\n\t\t\t\t\t\t\t\t\t<nc:publicLink />\n\t\t\t\t\t\t\t\t</d:prop>\n\t\t\t\t\t\t\t</d:propfind>',details:!0,signal:n.abortController.signal});case 7:a=e.sent,r=a.data.filter((function(t){var n;return t.filename!=="/photos/".concat(null===(n=(0,s.ts)())||void 0===n?void 0:n.uid,"/albums")})).map((function(t){return""===t.props.collaborators?t.props.collaborators=[]:"object"===p(t.props.collaborators.collaborator)&&(Array.isArray(t.props.collaborators.collaborator)?t.props.collaborators=t.props.collaborators.collaborator:t.props.collaborators=[t.props.collaborators.collaborator]),t})).map((function(t){return(0,m.AX)(t)})).map((function(t){var e,o,a=JSON.parse(null!==(e=null===(o=t.dateRange)||void 0===o?void 0:o.replace(/&quot;/g,'"'))&&void 0!==e?e:"{}");null===a.start&&(a.start=l()().unix(),a.end=l()().unix());var r={startDate:l().unix(a.start).format("MMMM YYYY"),endDate:l().unix(a.end).format("MMMM YYYY")};return d(d({},t),{},r.startDate===r.endDate?{date:r.startDate}:{date:n.t("photos","{startDate} to {endDate}",r)})})),n.$store.dispatch("addAlbums",{albums:r}),u.Z.debug("[FetchAlbumsMixin] Fetched ".concat(r.length," new files: "),r),e.next=26;break;case 13:if(e.prev=13,e.t0=e.catch(2),404!==(null===(b=e.t0.response)||void 0===b?void 0:b.status)){e.next=19;break}n.errorFetchingAlbums=404,e.next=24;break;case 19:if("ERR_CANCELED"!==e.t0.code){e.next=23;break}return e.abrupt("return");case 23:n.errorFetchingAlbums=e.t0;case 24:u.Z.error(t("photos","Failed to fetch albums list."),e.t0),(0,i.x2)(t("photos","Failed to fetch albums list."));case 26:return e.prev=26,n.loadingAlbums=!1,e.finish(26);case 29:case"end":return e.stop()}}),e,null,[[2,13,26,29]])})))()}}}},17963:(t,n,e)=>{e.d(n,{Z:()=>i});var o=e(87537),a=e.n(o),r=e(23645),l=e.n(r)()(a());l.push([t.id,".album-form[data-v-33f82244]{display:flex;flex-direction:column;height:350px;padding:16px}.album-form .form-title[data-v-33f82244]{font-weight:bold}.album-form .form-subtitle[data-v-33f82244]{color:var(--color-text-lighter)}.album-form .form-inputs[data-v-33f82244]{flex-grow:1;justify-items:flex-end}.album-form .form-inputs input[data-v-33f82244]{width:100%}.album-form .form-inputs label[data-v-33f82244]{display:flex;margin-top:16px}.album-form .form-inputs label[data-v-33f82244] svg{margin-right:12px}.album-form .form-buttons[data-v-33f82244]{display:flex;justify-content:space-between}.album-form .form-buttons .left-buttons[data-v-33f82244],.album-form .form-buttons .right-buttons[data-v-33f82244]{display:flex}.album-form .form-buttons .right-buttons[data-v-33f82244]{justify-content:flex-end}.album-form .form-buttons button[data-v-33f82244]{margin-right:16px}.left-buttons[data-v-33f82244]{flex-grow:1}","",{version:3,sources:["webpack://./src/components/AlbumForm.vue"],names:[],mappings:"AAwOA,6BACC,YAAA,CACA,qBAAA,CACA,YAAA,CACA,YAAA,CAEA,yCACC,gBAAA,CAGD,4CACC,+BAAA,CAGD,0CACC,WAAA,CACA,sBAAA,CAEA,gDACC,UAAA,CAGD,gDACC,YAAA,CACA,eAAA,CAEA,qDACC,iBAAA,CAKH,2CACC,YAAA,CACA,6BAAA,CAEA,mHACC,YAAA,CAGD,0DACC,wBAAA,CAGD,kDACC,iBAAA,CAKH,+BACC,WAAA",sourcesContent:['$sizes: ("400": ("count": 3, "marginTop": 66, "marginW": 8), "700": ("count": 4, "marginTop": 66, "marginW": 8), "1024": ("count": 5, "marginTop": 66, "marginW": 44), "1280": ("count": 4, "marginTop": 66, "marginW": 44), "1440": ("count": 5, "marginTop": 88, "marginW": 66), "1600": ("count": 6, "marginTop": 88, "marginW": 66), "2048": ("count": 7, "marginTop": 88, "marginW": 66), "2560": ("count": 8, "marginTop": 88, "marginW": 88), "3440": ("count": 9, "marginTop": 88, "marginW": 88), "max": ("count": 10, "marginTop": 88, "marginW": 88));\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.album-form {\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 350px;\n\tpadding: 16px;\n\n\t.form-title {\n\t\tfont-weight: bold;\n\t}\n\n\t.form-subtitle {\n\t\tcolor: var(--color-text-lighter);\n\t}\n\n\t.form-inputs {\n\t\tflex-grow: 1;\n\t\tjustify-items: flex-end;\n\n\t\tinput {\n\t\t\twidth: 100%;\n\t\t}\n\n\t\tlabel {\n\t\t\tdisplay: flex;\n\t\t\tmargin-top: 16px;\n\n\t\t\t::v-deep svg {\n\t\t\t\tmargin-right: 12px;\n\t\t\t}\n\t\t}\n\t}\n\n\t.form-buttons {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\n\t\t.left-buttons, .right-buttons {\n\t\t\tdisplay: flex;\n\t\t}\n\n\t\t.right-buttons {\n\t\t\tjustify-content: flex-end;\n\t\t}\n\n\t\tbutton {\n\t\t\tmargin-right: 16px;\n\t\t}\n\t}\n}\n\n.left-buttons {\n\tflex-grow: 1;\n}\n'],sourceRoot:""}]);const i=l},92575:(t,n,e)=>{e.d(n,{Z:()=>i});var o=e(87537),a=e.n(o),r=e(23645),l=e.n(r)()(a());l.push([t.id,".manage-collaborators[data-v-995bfdfc]{display:flex;flex-direction:column;padding:20px}.manage-collaborators__title[data-v-995bfdfc]{font-weight:bold}.manage-collaborators__subtitle[data-v-995bfdfc]{color:var(--color-text-lighter)}.manage-collaborators__public-link-button[data-v-995bfdfc]{margin:4px 0}.manage-collaborators__form[data-v-995bfdfc]{margin-top:4px 0;display:flex;flex-direction:column;height:500px}.manage-collaborators__form__input[data-v-995bfdfc]{flex-grow:1;justify-items:flex-end;position:relative}.manage-collaborators__form__input .magnify-icon[data-v-995bfdfc]{position:absolute;top:10px;left:8px;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.manage-collaborators__form__input input[data-v-995bfdfc]{width:100%;padding-left:34px}.manage-collaborators__form__input .loader[data-v-995bfdfc]{position:absolute;top:-4px;right:4px;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.manage-collaborators__form__input .loader[data-v-995bfdfc] .icon-loading::after{height:16px;width:16px}.manage-collaborators__form__selection[data-v-995bfdfc]{min-height:25px;padding:8px}.manage-collaborators__form__selection li[data-v-995bfdfc]{margin-right:4px;display:inline-block}.manage-collaborators__form__selection li .close-icon[data-v-995bfdfc]{cursor:pointer}.manage-collaborators__form__list__result[data-v-995bfdfc]{padding:8px;border-radius:100px;box-sizing:border-box}.manage-collaborators__form__list__result[data-v-995bfdfc],.manage-collaborators__form__list__result *[data-v-995bfdfc]{cursor:pointer}.manage-collaborators__form__list__result[data-v-995bfdfc]:hover,.manage-collaborators__form__list__result--selected[data-v-995bfdfc]{background:var(--color-background-dark)}.manage-collaborators .slot-buttons[data-v-995bfdfc]{display:flex;justify-content:flex-end}","",{version:3,sources:["webpack://./src/components/CollaboratorsSelectionForm.vue"],names:[],mappings:"AAiRA,uCACC,YAAA,CACA,qBAAA,CACA,YAAA,CAEA,8CACC,gBAAA,CAGD,iDACC,+BAAA,CAGD,2DACC,YAAA,CAGD,6CACC,gBAAA,CACA,YAAA,CACA,qBAAA,CACA,YAAA,CAEA,oDACC,WAAA,CACA,sBAAA,CACA,iBAAA,CAEA,kEACC,iBAAA,CACA,QAAA,CACA,QAAA,CACA,yBAAA,CAAA,sBAAA,CAAA,iBAAA,CAGD,0DACC,UAAA,CACA,iBAAA,CAGD,4DACC,iBAAA,CACA,QAAA,CACA,SAAA,CACA,yBAAA,CAAA,sBAAA,CAAA,iBAAA,CAEA,kFACC,WAAA,CACA,UAAA,CAKH,wDACC,eAAA,CACA,WAAA,CAEA,2DACC,gBAAA,CACA,oBAAA,CAEA,uEACC,cAAA,CAMF,2DACC,WAAA,CACA,mBAAA,CACA,qBAAA,CAEA,wHACC,cAAA,CAGD,sIACC,uCAAA,CAMJ,qDACC,YAAA,CACA,wBAAA",sourcesContent:['$sizes: ("400": ("count": 3, "marginTop": 66, "marginW": 8), "700": ("count": 4, "marginTop": 66, "marginW": 8), "1024": ("count": 5, "marginTop": 66, "marginW": 44), "1280": ("count": 4, "marginTop": 66, "marginW": 44), "1440": ("count": 5, "marginTop": 88, "marginW": 66), "1600": ("count": 6, "marginTop": 88, "marginW": 66), "2048": ("count": 7, "marginTop": 88, "marginW": 66), "2560": ("count": 8, "marginTop": 88, "marginW": 88), "3440": ("count": 9, "marginTop": 88, "marginW": 88), "max": ("count": 10, "marginTop": 88, "marginW": 88));\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.manage-collaborators {\n\tdisplay: flex;\n\tflex-direction: column;\n\tpadding: 20px;\n\n\t&__title {\n\t\tfont-weight: bold;\n\t}\n\n\t&__subtitle {\n\t\tcolor: var(--color-text-lighter);\n\t}\n\n\t&__public-link-button {\n\t\tmargin: 4px 0;\n\t}\n\n\t&__form {\n\t\tmargin-top: 4px 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\theight: 500px;\n\n\t\t&__input {\n\t\t\tflex-grow: 1;\n\t\t\tjustify-items: flex-end;\n\t\t\tposition: relative;\n\n\t\t\t.magnify-icon {\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: 10px;\n\t\t\t\tleft: 8px;\n\t\t\t\twidth: fit-content;\n\t\t\t}\n\n\t\t\tinput {\n\t\t\t\twidth: 100%;\n\t\t\t\tpadding-left: 34px;\n\t\t\t}\n\n\t\t\t.loader {\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: -4px;\n\t\t\t\tright: 4px;\n\t\t\t\twidth: fit-content;\n\n\t\t\t\t::v-deep .icon-loading::after {\n\t\t\t\t\theight: 16px;\n\t\t\t\t\twidth: 16px;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t&__selection {\n\t\t\tmin-height: 25px;\n\t\t\tpadding: 8px;\n\n\t\t\tli {\n\t\t\t\tmargin-right: 4px;\n\t\t\t\tdisplay: inline-block;\n\n\t\t\t\t.close-icon {\n\t\t\t\t\tcursor: pointer;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t&__list {\n\t\t\t&__result {\n\t\t\t\tpadding: 8px;\n\t\t\t\tborder-radius: 100px;\n\t\t\t\tbox-sizing: border-box;\n\n\t\t\t\t&, & * {\n\t\t\t\t\tcursor: pointer;\n\t\t\t\t}\n\n\t\t\t\t&:hover, &--selected {\n\t\t\t\t\tbackground: var(--color-background-dark);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t.slot-buttons {\n\t\tdisplay: flex;\n\t\tjustify-content: flex-end;\n\t}\n}\n'],sourceRoot:""}]);const i=l},40502:(t,n,e)=>{e.d(n,{Z:()=>a});const o={name:"PlusIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};const a=(0,e(51900).Z)(o,(function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("span",t._b({staticClass:"material-design-icon plus-icon",attrs:{"aria-hidden":!t.title,"aria-label":t.title,role:"img"},on:{click:function(n){return t.$emit("click",n)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports},75400:(t,n,e)=>{e.d(n,{Z:()=>a});const o={name:"SendIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};const a=(0,e(51900).Z)(o,(function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("span",t._b({staticClass:"material-design-icon send-icon",attrs:{"aria-hidden":!t.title,"aria-label":t.title,role:"img"},on:{click:function(n){return t.$emit("click",n)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M2,21L23,12L2,3V10L17,12L2,14V21Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports},14684:(t,n,e)=>{e.d(n,{Z:()=>j});var o=e(20629),a=e(93050);const r={name:"AccountMultiplePlusIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var l=e(51900);const i=(0,l.Z)(r,(function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("span",t._b({staticClass:"material-design-icon account-multiple-plus-icon",attrs:{"aria-hidden":!t.title,"aria-label":t.title,role:"img"},on:{click:function(n){return t.$emit("click",n)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M19 17V19H7V17S7 13 13 13 19 17 19 17M16 8A3 3 0 1 0 13 11A3 3 0 0 0 16 8M19.2 13.06A5.6 5.6 0 0 1 21 17V19H24V17S24 13.55 19.2 13.06M18 5A2.91 2.91 0 0 0 17.11 5.14A5 5 0 0 1 17.11 10.86A2.91 2.91 0 0 0 18 11A3 3 0 0 0 18 5M8 10H5V7H3V10H0V12H3V15H5V12H8Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports;var s=e(75400),c=e(33476),u=e(80351),m=e.n(u),p=e(13096);function b(t,n,e,o,a,r,l){try{var i=t[r](l),s=i.value}catch(t){return void e(t)}i.done?n(s):Promise.resolve(s).then(o,a)}function d(t){return function(){var n=this,e=arguments;return new Promise((function(o,a){var r=t.apply(n,e);function l(t){b(r,o,a,l,i,"next",t)}function i(t){b(r,o,a,l,i,"throw",t)}l(void 0)}))}}function f(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,o)}return e}function A(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?f(Object(e),!0).forEach((function(n){g(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):f(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}function g(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}const h={name:"AlbumForm",components:{MapMarker:a.Z,AccountMultiplePlus:i,Send:s.Z,NcButton:c.NcButton,NcLoadingIcon:c.NcLoadingIcon,NcTextField:c.NcTextField,CollaboratorsSelectionForm:p.Z},props:{album:{type:Object,default:null},displayBackButton:{type:Boolean,default:!1}},data:function(){return{showCollaboratorView:!1,albumName:"",albumLocation:"",loading:!1}},computed:{editMode:function(){return null!==this.album}},mounted:function(){var t=this;this.editMode&&(this.albumName=this.album.basename,this.albumLocation=this.album.location),this.$nextTick((function(){t.$refs.nameInput.$el.getElementsByTagName("input")[0].focus()}))},methods:A(A({},(0,o.nv)(["createAlbum","renameAlbum","updateAlbum"])),{},{submit:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];""===this.albumName||this.loading||(this.editMode?this.handleUpdateAlbum():this.handleCreateAlbum(t))},handleCreateAlbum:function(){var t=arguments,n=this;return d(regeneratorRuntime.mark((function e(){var o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.length>0&&void 0!==t[0]?t[0]:[],e.prev=1,n.loading=!0,e.next=5,n.createAlbum({album:{basename:n.albumName,nbItems:0,location:n.albumLocation,lastPhoto:-1,date:m()().format("MMMM YYYY"),collaborators:o}});case 5:if(a=e.sent,""===n.albumLocation&&0===o.length){e.next=10;break}return e.next=9,n.updateAlbum({albumName:n.albumName,properties:{location:n.albumLocation,collaborators:o}});case 9:a=e.sent;case 10:n.$emit("done",{album:a});case 11:return e.prev=11,n.loading=!1,e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[1,,11,14]])})))()},handleUpdateAlbum:function(){var t=this;return d(regeneratorRuntime.mark((function n(){var e;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,t.loading=!0,e=A({},t.album),t.album.basename===t.albumName){n.next=7;break}return n.next=6,t.renameAlbum({currentAlbumName:t.album.basename,newAlbumName:t.albumName});case 6:e=n.sent;case 7:if(t.album.location===t.albumLocation){n.next=11;break}return n.next=10,t.updateAlbum({albumName:t.albumName,properties:{location:t.albumLocation}});case 10:e.location=n.sent;case 11:t.$emit("done",{album:e});case 12:return n.prev=12,t.loading=!1,n.finish(12);case 15:case"end":return n.stop()}}),n,null,[[0,,12,15]])})))()},back:function(){this.$emit("back")}})};var C=e(93379),v=e.n(C),_=e(7795),y=e.n(_),x=e(90569),k=e.n(x),w=e(3565),O=e.n(w),B=e(19216),S=e.n(B),N=e(44589),L=e.n(N),P=e(17963),M={};M.styleTagTransform=L(),M.setAttributes=O(),M.insert=k().bind(null,"head"),M.domAPI=y(),M.insertStyleElement=S();v()(P.Z,M);P.Z&&P.Z.locals&&P.Z.locals;const j=(0,l.Z)(h,(function(){var t=this,n=t.$createElement,e=t._self._c||n;return t.showCollaboratorView?e("CollaboratorsSelectionForm",{attrs:{"album-name":t.albumName,"allow-public-link":!1},scopedSlots:t._u([{key:"default",fn:function(n){var o=n.collaborators;return[e("span",{staticClass:"left-buttons"},[e("NcButton",{attrs:{"aria-label":t.t("photos","Back to the new album form."),type:"tertiary"},on:{click:function(n){t.showCollaboratorView=!1}}},[t._v("\n\t\t\t\t"+t._s(t.t("photos","Back"))+"\n\t\t\t")])],1),t._v(" "),e("span",{staticClass:"right-buttons"},[e("NcButton",{attrs:{"aria-label":t.editMode?t.t("photos","Save."):t.t("photos","Create the album."),type:"primary",disabled:""===t.albumName.trim()||t.loading},on:{click:function(n){return t.submit(o)}},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading?e("NcLoadingIcon"):e("Send")]},proxy:!0}],null,!0)},[t._v("\n\t\t\t\t"+t._s(t.editMode?t.t("photos","Save"):t.t("photos","Create album"))+"\n\t\t\t")])],1)]}}])}):e("form",{staticClass:"album-form",on:{submit:function(n){return n.preventDefault(),t.submit.apply(null,arguments)}}},[e("div",{staticClass:"form-inputs"},[e("NcTextField",{ref:"nameInput",attrs:{value:t.albumName,type:"text",name:"name",required:!0,autofocus:"true",placeholder:t.t("photos","Name of the album")},on:{"update:value":function(n){t.albumName=n}}}),t._v(" "),e("label",[e("MapMarker"),e("NcTextField",{attrs:{value:t.albumLocation,name:"location",type:"text",placeholder:t.t("photos","Location of the album")},on:{"update:value":function(n){t.albumLocation=n}}})],1)],1),t._v(" "),e("div",{staticClass:"form-buttons"},[e("span",{staticClass:"left-buttons"},[t.displayBackButton?e("NcButton",{attrs:{"aria-label":t.t("photos","Go back to the previous view."),type:"tertiary"},on:{click:t.back}},[t._v("\n\t\t\t\t"+t._s(t.t("photos","Back"))+"\n\t\t\t")]):t._e()],1),t._v(" "),e("span",{staticClass:"right-buttons"},[t.editMode?t._e():e("NcButton",{attrs:{"aria-label":t.t("photos","Go to the add collaborators view."),type:"secondary",disabled:""===t.albumName.trim()||t.loading},on:{click:function(n){t.showCollaboratorView=!0}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("AccountMultiplePlus")]},proxy:!0}],null,!1,1531126728)},[t._v("\n\t\t\t\t"+t._s(t.t("photos","Add collaborators"))+"\n\t\t\t")]),t._v(" "),e("NcButton",{attrs:{"aria-label":t.editMode?t.t("photos","Save."):t.t("photos","Create the album."),type:"primary",disabled:""===t.albumName||t.loading},on:{click:function(n){return t.submit()}},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading?e("NcLoadingIcon"):e("Send")]},proxy:!0}],null,!1,3914512768)},[t._v("\n\t\t\t\t"+t._s(t.editMode?t.t("photos","Save"):t.t("photos","Create album"))+"\n\t\t\t")])],1)])])}),[],!1,null,"33f82244",null).exports},13096:(n,e,o)=>{o.d(e,{Z:()=>R});const a={name:"MagnifyIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var r=o(51900);const l=(0,r.Z)(a,(function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("span",t._b({staticClass:"material-design-icon magnify-icon",attrs:{"aria-hidden":!t.title,"aria-label":t.title,role:"img"},on:{click:function(n){return t.$emit("click",n)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports;const i={name:"ContentCopyIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};const s=(0,r.Z)(i,(function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("span",t._b({staticClass:"material-design-icon content-copy-icon",attrs:{"aria-hidden":!t.title,"aria-label":t.title,role:"img"},on:{click:function(n){return t.$emit("click",n)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports;var c=o(14625),u=o(31894),m=o(26937),p=o(82880),b=o(45994),d=o(79753),f=o(33476),A=o(20561),g=o(59537);function h(t,n,e,o,a,r,l){try{var i=t[r](l),s=i.value}catch(t){return void e(t)}i.done?n(s):Promise.resolve(s).then(o,a)}function C(t){return function(){var n=this,e=arguments;return new Promise((function(o,a){var r=t.apply(n,e);function l(t){h(r,o,a,l,i,"next",t)}function i(t){h(r,o,a,l,i,"throw",t)}l(void 0)}))}}function v(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,o)}return e}function _(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?v(Object(e),!0).forEach((function(n){y(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):v(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}function y(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var x={USER:0,GROUP:1,EMAIL:4,REMOTE:6,CIRCLE:7};const k={name:"CollaboratorsSelectionForm",components:{ContentCopy:s,Magnify:l,Close:u.default,Check:c.default,VirtualScrolling:A.Z,NcLoadingIcon:f.NcLoadingIcon,NcButton:f.NcButton,NcListItemIcon:f.NcListItemIcon,NcUserBubble:f.NcUserBubble},props:{albumName:{type:String,required:!0},collaborators:{type:Array,default:function(){return[]}},publicLink:{type:String,default:""},allowPublicLink:{type:Boolean,default:!0}},data:function(){return{searchText:"",availableCollaborators:{},selectedCollaboratorsKey:[],currentSearchResults:[],loadingCollaborators:!1,randomId:Math.random().toString().substring(2,10),publicLinkCopied:!1}},computed:{vsItems:function(){var t=this;return this.currentSearchResults.filter((function(t){return t.id!==(0,b.ts)().uid})).map((function(t){var n=t.source,e=t.id;return"".concat(n,":").concat(e)})).filter((function(n){return!t.selectedCollaboratorsKey.includes(n)})).map((function(t){return{key:t,height:48}}))},selectedCollaborators:function(){var t=this;return this.selectedCollaboratorsKey.map((function(n){return t.availableCollaborators[n]}))}},mounted:function(){this.searchCollaborators(),this.selectedCollaboratorsKey=this.collaborators.map((function(t){var n=t.source,e=t.id;return"".concat(n,":").concat(e)})),this.availableCollaborators=_(_({},this.availableCollaborators),this.collaborators.reduce((function(t,n){return _(_({},t),{},y({},"".concat(n.source,":").concat(n.id),n))}),{}))},methods:{searchCollaborators:function(){var n=this;return C(regeneratorRuntime.mark((function e(){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n.loadingCollaborators=!0,e.next=4,m.Z.get((0,d.generateOcsUrl)("core/autocomplete/get"),{params:{search:n.searchText,itemType:"share-recipients",shareTypes:[x.USER,x.GROUP]}});case 4:o=e.sent,n.currentSearchResults=o.data.ocs.data,n.availableCollaborators=_(_({},n.availableCollaborators),o.data.ocs.data.reduce((function(t,n){return _(_({},t),{},y({},"".concat(n.source,":").concat(n.id),n))}),{})),e.next=14;break;case 9:e.prev=9,e.t0=e.catch(0),n.errorFetchingCollaborators=e.t0,g.Z.error(t("photos","Failed to fetch collaborators list."),e.t0),(0,p.x2)(t("photos","Failed to fetch collaborators list."));case 14:return e.prev=14,n.loadingCollaborators=!1,e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[0,9,14,17]])})))()},createPublicLinkForAlbum:function(){var t=this;return C(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",m.Z.get((0,d.generateOcsUrl)("apps/photos/createPublicLink/".concat(t.albumName))));case 1:case"end":return n.stop()}}),n)})))()},copyPublicLink:function(){var t=this;return C(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,navigator.clipboard.writeText(t.publicLink);case 2:t.publicLinkCopied=!0,setTimeout((function(){t.publicLinkCopied=!1}),1e4);case 4:case"end":return n.stop()}}),n)})))()},selectEntity:function(t){this.selectedCollaboratorsKey.includes(t)||this.selectedCollaboratorsKey.push(t)},unselectEntity:function(t){var n=this.selectedCollaboratorsKey.indexOf(t);this.selectedCollaboratorsKey.splice(n,1)}}};var w=o(93379),O=o.n(w),B=o(7795),S=o.n(B),N=o(90569),L=o.n(N),P=o(3565),M=o.n(P),j=o(19216),D=o.n(j),E=o(44589),T=o.n(E),Z=o(92575),I={};I.styleTagTransform=T(),I.setAttributes=M(),I.insert=L().bind(null,"head"),I.domAPI=S(),I.insertStyleElement=D();O()(Z.Z,I);Z.Z&&Z.Z.locals&&Z.Z.locals;const R=(0,r.Z)(k,(function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("div",{staticClass:"manage-collaborators"},[e("h2",{staticClass:"manage-collaborators__title"},[t._v("\n\t\t"+t._s(t.t("photos","Add collaborators"))+"\n\t")]),t._v(" "),e("div",{staticClass:"manage-collaborators__subtitle"},[t._v("\n\t\t"+t._s(t.t("photos","Add users or group who can edit your album"))+"\n\t")]),t._v(" "),t.allowPublicLink?[t.publicLink?e("NcButton",{staticClass:"manage-collaborators__public-link-button",attrs:{type:"tertiary-no-background"},on:{click:t.copyPublicLink},scopedSlots:t._u([{key:"icon",fn:function(){return[t.publicLinkCopied?e("Check"):e("ContentCopy")]},proxy:!0}],null,!1,845538853)},[t.publicLinkCopied?[t._v("\n\t\t\t\t"+t._s(t.t("photos","Public link copied!"))+"\n\t\t\t")]:[t._v("\n\t\t\t\t"+t._s(t.t("photos","Copy public link"))+"\n\t\t\t")]],2):e("NcButton",{staticClass:"manage-collaborators__public-link-button",attrs:{type:"tertiary-no-background"},on:{click:t.createPublicLinkForAlbum}},[t._v("\n\t\t\t"+t._s(t.t("photos","Share this album via link"))+"\n\t\t")])]:t._e(),t._v(" "),e("form",{staticClass:"manage-collaborators__form",on:{submit:function(t){t.preventDefault()}}},[e("label",{staticClass:"manage-collaborators__form__input"},[e("Magnify",{attrs:{size:20}}),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.searchText,expression:"searchText"}],attrs:{type:"search",name:"search","aria-label":t.t("photos","Search for collaborators"),"aria-autocomplete":"list","aria-controls":"manage-collaborators__form__selection-"+t.randomId+" manage-collaborators__form__list-"+t.randomId,placeholder:t.t("photos","Search users or groups")},domProps:{value:t.searchText},on:{input:[function(n){n.target.composing||(t.searchText=n.target.value)},t.searchCollaborators]}}),t._v(" "),t.loadingCollaborators?e("NcLoadingIcon"):t._e()],1),t._v(" "),e("ul",{staticClass:"manage-collaborators__form__selection"},t._l(t.selectedCollaboratorsKey,(function(n){return e("li",{key:n},[e("NcUserBubble",{attrs:{user:"users"===t.availableCollaborators[n].source?t.availableCollaborators[n].id:void 0,"display-name":t.availableCollaborators[n].label}},[e("template",{slot:"title"},[e("Close",{attrs:{size:20,role:"button","aria-label":t.t("photos","Remove {collaboratorLabel} from the collaborators list",{collaboratorLabel:t.availableCollaborators[n].label})},on:{click:function(e){return t.unselectEntity(n)}}})],1)],2)],1)})),0),t._v(" "),e("VirtualScrolling",{staticClass:"manage-collaborators__form__list",attrs:{rows:t.vsItems},scopedSlots:t._u([{key:"default",fn:function(n){var o=n.renderedRows;return e("ul",{attrs:{id:"manage-collaborators__form__list-"+t.randomId}},t._l(o,(function(n){return e("li",{key:n.key,style:{height:n.height+"px"}},[e("NcListItemIcon",{staticClass:"manage-collaborators__form__list__result",class:{"manage-collaborators__form__list__result--selected":n.key in t.selectedCollaboratorsKey},attrs:{id:t.availableCollaborators[n.key].id,title:t.availableCollaborators[n.key].id,search:t.searchText,"display-name":t.availableCollaborators[n.key].label,"is-selected":n.key in t.selectedCollaboratorsKey,"aria-label":t.t("photos","Add {collaboratorLabel} to the collaborators list",{collaboratorLabel:t.availableCollaborators[n.key].label})},on:{click:function(e){return t.selectEntity(n.key)}}})],1)})),0)}}])})],1),t._v(" "),e("div",{staticClass:"slot-buttons"},[t._t("default",null,{collaborators:t.selectedCollaborators})],2)],2)}),[],!1,null,"995bfdfc",null).exports}}]);
//# sourceMappingURL=photos-src_mixins_FetchAlbumsMixin_js-node_modules_vue-material-design-icons_Plus_vue-src_components-4c933a.js.map?v=573555613b96f2192c91