/*! For license information please see files_sharing-files_sharing_tab.js.LICENSE.txt */ !function(){"use strict";var e,n={10223:function(e,n,r){var i=r(20144),a=r(31352),s=r(1794),o=r(79753),c=r(75925),l=r.n(c),u=r(4820),h=r(79954);function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function f(e,t){for(var n=0;nthis.config.minSearchStringLength},options:function(){return this.isValidQuery?this.suggestions:this.recommendations},noResultText:function(){return this.loading?t("files_sharing","Searching …"):t("files_sharing","No elements found.")}},mounted:function(){this.getRecommendations()},methods:{handleOpen:function(){(0,X.j8)("viewer:trapElements:changed",this.$refs.select.$el)},asyncFind:function(e){var t=this;return be(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t.query=e.trim(),!t.isValidQuery){n.next=5;break}return t.loading=!0,n.next=5,t.debounceGetSuggestions(e);case 5:case"end":return n.stop()}}),n)})))()},getSuggestions:function(e){var n=arguments,r=this;return be(regeneratorRuntime.mark((function i(){var a,s,c,l,h,d,f,p,g,m,v,y,_;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return a=n.length>1&&void 0!==n[1]&&n[1],r.loading=!0,!0===OC.getCapabilities().files_sharing.sharee.query_lookup_default&&(a=!0),s=[r.SHARE_TYPES.SHARE_TYPE_USER,r.SHARE_TYPES.SHARE_TYPE_GROUP,r.SHARE_TYPES.SHARE_TYPE_REMOTE,r.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP,r.SHARE_TYPES.SHARE_TYPE_CIRCLE,r.SHARE_TYPES.SHARE_TYPE_ROOM,r.SHARE_TYPES.SHARE_TYPE_GUEST,r.SHARE_TYPES.SHARE_TYPE_DECK,r.SHARE_TYPES.SHARE_TYPE_SCIENCEMESH],!0===OC.getCapabilities().files_sharing.public.enabled&&s.push(r.SHARE_TYPES.SHARE_TYPE_EMAIL),c=null,i.prev=6,i.next=9,u.default.get((0,o.generateOcsUrl)("apps/files_sharing/api/v1/sharees"),{params:{format:"json",itemType:"dir"===r.fileInfo.type?"folder":"file",search:e,lookup:a,perPage:r.config.maxAutocompleteResults,shareType:s}});case 9:c=i.sent,i.next=16;break;case 12:return i.prev=12,i.t0=i.catch(6),ge.error("Error fetching suggestions",i.t0),i.abrupt("return");case 16:l=c.data.ocs.data,h=c.data.ocs.data.exact,l.exact=[],d=Object.values(h).reduce((function(e,t){return e.concat(t)}),[]),f=Object.values(l).reduce((function(e,t){return e.concat(t)}),[]),p=r.filterOutExistingShares(d).map((function(e){return r.formatForMultiselect(e)})).sort((function(e,t){return e.shareType-t.shareType})),g=r.filterOutExistingShares(f).map((function(e){return r.formatForMultiselect(e)})).sort((function(e,t){return e.shareType-t.shareType})),m=[],l.lookupEnabled&&!a&&m.push({id:"global-lookup",isNoUser:!0,displayName:t("files_sharing","Search globally"),lookup:!0}),v=r.externalResults.filter((function(e){return!e.condition||e.condition(r)})),y=p.concat(g).concat(v).concat(m),_=y.reduce((function(e,t){return t.displayName?(e[t.displayName]||(e[t.displayName]=0),e[t.displayName]++,e):e}),{}),r.suggestions=y.map((function(e){return _[e.displayName]>1&&!e.desc?ye(ye({},e),{},{desc:e.shareWithDisplayNameUnique}):e})),r.loading=!1,ge.info("suggestions",r.suggestions);case 31:case"end":return i.stop()}}),i,null,[[6,12]])})))()},debounceGetSuggestions:te()((function(){this.getSuggestions.apply(this,arguments)}),300),getRecommendations:function(){var e=this;return be(regeneratorRuntime.mark((function t(){var n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.loading=!0,n=null,t.prev=2,t.next=5,u.default.get((0,o.generateOcsUrl)("apps/files_sharing/api/v1/sharees_recommended"),{params:{format:"json",itemType:e.fileInfo.type}});case 5:n=t.sent,t.next=12;break;case 8:return t.prev=8,t.t0=t.catch(2),ge.error("Error fetching recommendations",t.t0),t.abrupt("return");case 12:r=e.externalResults.filter((function(t){return!t.condition||t.condition(e)})),i=Object.values(n.data.ocs.data.exact).reduce((function(e,t){return e.concat(t)}),[]),e.recommendations=e.filterOutExistingShares(i).map((function(t){return e.formatForMultiselect(t)})).concat(r),e.loading=!1,ge.info("recommendations",e.recommendations);case 17:case"end":return t.stop()}}),t,null,[[2,8]])})))()},filterOutExistingShares:function(e){var t=this;return e.reduce((function(e,n){if("object"!==me(n))return e;try{if(n.value.shareType===t.SHARE_TYPES.SHARE_TYPE_USER){if(n.value.shareWith===(0,J.ts)().uid)return e;if(t.reshare&&n.value.shareWith===t.reshare.owner)return e}if(n.value.shareType===t.SHARE_TYPES.SHARE_TYPE_EMAIL){if(-1!==t.linkShares.map((function(e){return e.shareWith})).indexOf(n.value.shareWith.trim()))return e}else{var r=t.shares.reduce((function(e,t){return e[t.shareWith]=t.type,e}),{}),i=n.value.shareWith.trim();if(i in r&&r[i]===n.value.shareType)return e}e.push(n)}catch(t){return e}return e}),[])},shareTypeToIcon:function(e){switch(e){case this.SHARE_TYPES.SHARE_TYPE_GUEST:return{icon:"icon-user",iconTitle:t("files_sharing","Guest")};case this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP:case this.SHARE_TYPES.SHARE_TYPE_GROUP:return{icon:"icon-group",iconTitle:t("files_sharing","Group")};case this.SHARE_TYPES.SHARE_TYPE_EMAIL:return{icon:"icon-mail",iconTitle:t("files_sharing","Email")};case this.SHARE_TYPES.SHARE_TYPE_CIRCLE:return{icon:"icon-circle",iconTitle:t("files_sharing","Circle")};case this.SHARE_TYPES.SHARE_TYPE_ROOM:return{icon:"icon-room",iconTitle:t("files_sharing","Talk conversation")};case this.SHARE_TYPES.SHARE_TYPE_DECK:return{icon:"icon-deck",iconTitle:t("files_sharing","Deck board")};case this.SHARE_TYPES.SHARE_TYPE_SCIENCEMESH:return{icon:"icon-sciencemesh",iconTitle:t("files_sharing","Science Mesh")};default:return{}}},formatForMultiselect:function(e){var n,r;if(e.value.shareType===this.SHARE_TYPES.SHARE_TYPE_USER&&this.config.shouldAlwaysShowUnique)n=null!==(r=e.shareWithDisplayNameUnique)&&void 0!==r?r:"";else if(e.value.shareType!==this.SHARE_TYPES.SHARE_TYPE_REMOTE&&e.value.shareType!==this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP||!e.value.server)if(e.value.shareType===this.SHARE_TYPES.SHARE_TYPE_EMAIL)n=e.value.shareWith;else{var i;n=null!==(i=e.shareWithDescription)&&void 0!==i?i:""}else n=t("files_sharing","on {server}",{server:e.value.server});return ye({id:"".concat(e.value.shareType,"-").concat(e.value.shareWith),shareWith:e.value.shareWith,shareType:e.value.shareType,user:e.uuid||e.value.shareWith,isNoUser:e.value.shareType!==this.SHARE_TYPES.SHARE_TYPE_USER,displayName:e.name||e.label,subtitle:n,shareWithDisplayNameUnique:e.shareWithDisplayNameUnique||""},this.shareTypeToIcon(e.value.shareType))},addShare:function(e){var t=this;return be(regeneratorRuntime.mark((function n(){var r,i,a,s;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t.value=null,!e.lookup){n.next=6;break}return n.next=4,t.getSuggestions(t.query,!0);case 4:return t.$nextTick((function(){t.$refs.select.$children[0].open=!0})),n.abrupt("return",!0);case 6:if(!e.handler){n.next=12;break}return n.next=9,e.handler(t);case 9:return r=n.sent,t.$emit("add:share",new A(r)),n.abrupt("return",!0);case 12:if(t.loading=!0,ge.debug("Adding a new share from the input for",e),n.prev=14,i=null,!t.config.enforcePasswordForPublicLink||e.shareType!==t.SHARE_TYPES.SHARE_TYPE_EMAIL){n.next=20;break}return n.next=19,ce();case 19:i=n.sent;case 20:return a=(t.fileInfo.path+"/"+t.fileInfo.name).replace("//","/"),n.next=23,t.createShare({path:a,shareType:e.shareType,shareWith:e.shareWith,password:i,permissions:t.fileInfo.sharePermissions&OC.getCapabilities().files_sharing.default_permissions,attributes:JSON.stringify(t.fileInfo.shareAttributes)});case 23:if(s=n.sent,!i){n.next=32;break}return s.newPassword=i,n.next=28,new Promise((function(e){t.$emit("add:share",s,e)}));case 28:n.sent.open=!0,n.next=33;break;case 32:t.$emit("add:share",s);case 33:return n.next=35,t.getRecommendations();case 35:n.next=42;break;case 37:n.prev=37,n.t0=n.catch(14),t.$nextTick((function(){t.$refs.select.$children[0].open=!0})),t.query=e.shareWith,ge.error("Error while adding new share",n.t0);case 42:return n.prev=42,t.loading=!1,n.finish(42);case 45:case"end":return n.stop()}}),n,null,[[14,37,42,45]])})))()}}},Ee=we,Se=r(49082),Ce={};Ce.styleTagTransform=j(),Ce.setAttributes=L(),Ce.insert=O().bind(null,"head"),Ce.domAPI=R(),Ce.insertStyleElement=Y(),D()(Se.Z,Ce),Se.Z&&Se.Z.locals&&Se.Z.locals;var xe=(0,W.Z)(Ee,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"sharing-search"},[t("label",{attrs:{for:"sharing-search-input"}},[e._v(e._s(e.t("files_sharing","Search for share recipients")))]),e._v(" "),t("NcSelect",{ref:"select",staticClass:"sharing-search__input",attrs:{id:"sharing-search-input",disabled:!e.canReshare,loading:e.loading,filterable:!1,placeholder:e.inputPlaceholder,"clear-search-on-blur":function(){return!1},"user-select":!0,options:e.options},on:{open:e.handleOpen,search:e.asyncFind,"option:selected":e.addShare},scopedSlots:e._u([{key:"no-options",fn:function(t){var n=t.search;return[e._v("\n\t\t\t"+e._s(n?e.noResultText:e.t("files_sharing","No recommendations. Start typing."))+"\n\t\t")]}}]),model:{value:e.value,callback:function(t){e.value=t},expression:"value"}})],1)}),[],!1,null,null,null),ke=xe.exports,Pe=r(45400),De=r.n(Pe),Te=r(65358),Re=r(1162),Ne=r.n(Re),Oe=r(25746),Ie=r(25108);function Le(e){return Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Le(e)}function He(e,t,n,r,i,a,s){try{var o=e[a](s),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,i)}function Ye(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){He(a,r,i,s,o,"next",e)}function o(e){He(a,r,i,s,o,"throw",e)}s(void 0)}))}}var Ue={mixins:[pe,b],props:{fileInfo:{type:Object,default:function(){},required:!0},share:{type:A,default:null},isUnique:{type:Boolean,default:!0}},data:function(){var e;return{config:new p,errors:{},loading:!1,saving:!1,open:!1,updateQueue:new Oe.Z({concurrency:1}),reactiveState:null===(e=this.share)||void 0===e?void 0:e.state}},computed:{hasNote:{get:function(){return""!==this.share.note},set:function(e){this.share.note=e?null:""}},dateTomorrow:function(){return new Date((new Date).setDate((new Date).getDate()+1))},lang:function(){var e=window.dayNamesShort?window.dayNamesShort:["Sun.","Mon.","Tue.","Wed.","Thu.","Fri.","Sat."],t=window.monthNamesShort?window.monthNamesShort:["Jan.","Feb.","Mar.","Apr.","May.","Jun.","Jul.","Aug.","Sep.","Oct.","Nov.","Dec."];return{formatLocale:{firstDayOfWeek:window.firstDay?window.firstDay:0,monthsShort:t,weekdaysMin:e,weekdaysShort:e},monthFormat:"MMM"}},isShareOwner:function(){return this.share&&this.share.owner===(0,J.ts)().uid}},methods:{checkShare:function(e){return(!e.password||"string"==typeof e.password&&""!==e.password.trim())&&!(e.expirationDate&&!e.expirationDate.isValid())},parseDateString:function(e){var t;if(e)return new Date(null===(t=e.match(/([0-9]{4}-[0-9]{2}-[0-9]{2})/i))||void 0===t?void 0:t.pop())},formatDateToString:function(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())).toISOString().split("T")[0]},onExpirationChange:function(e){this.share.expireDate=this.formatDateToString(e),this.queueUpdate("expireDate")},onExpirationDisable:function(){this.share.expireDate="",this.queueUpdate("expireDate")},onNoteChange:function(e){this.$set(this.share,"newNote",e.trim())},onNoteSubmit:function(){this.share.newNote&&(this.share.note=this.share.newNote,this.$delete(this.share,"newNote"),this.queueUpdate("note"))},onDelete:function(){var e=this;return Ye(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,e.loading=!0,e.open=!1,n.next=5,e.deleteShare(e.share.id);case 5:Ie.debug("Share deleted",e.share.id),r="file"===e.share.itemType?t("files_sharing",'File "{path}" has been unshared',{path:e.share.path}):t("files_sharing",'Folder "{path}" has been unshared',{path:e.share.path}),(0,w.s$)(r),e.$emit("remove:share",e.share),n.next=14;break;case 11:n.prev=11,n.t0=n.catch(0),e.open=!0;case 14:return n.prev=14,e.loading=!1,n.finish(14);case 17:case"end":return n.stop()}}),n,null,[[0,11,14,17]])})))()},queueUpdate:function(){for(var e=this,n=arguments.length,r=new Array(n),i=0;i=0&&(e.$delete(e.share,"newPassword"),e.share.passwordExpirationTime=i.password_expiration_time),e.$delete(e.errors,r[0]),(0,w.s$)(t("files_sharing","Share {propertyName} saved",{propertyName:r[0]})),n.next=15;break;case 11:n.prev=11,n.t0=n.catch(2),(s=n.t0.message)&&""!==s&&(e.onSyncError(r[0],s),(0,w.x2)(t("files_sharing",s)));case 15:return n.prev=15,e.saving=!1,n.finish(15);case 18:case"end":return n.stop()}}),n,null,[[2,11,15,18]])}))))}Ie.debug("Updated local share",this.share)}},onSyncError:function(e,t){switch(this.open=!0,e){case"password":case"pending":case"expireDate":case"label":case"note":this.$set(this.errors,e,t);var n=this.$refs[e];if(n){n.$el&&(n=n.$el);var r=n.querySelector(".focusable");r&&r.focus()}break;case"sendPasswordByTalk":this.$set(this.errors,e,t),this.share.sendPasswordByTalk=!this.share.sendPasswordByTalk}},debounceQueueUpdate:te()((function(e){this.queueUpdate(e)}),500)}},je={name:"SharingEntryInherited",components:{NcActionButton:De(),NcActionLink:S(),NcActionText:Ne(),NcAvatar:l(),SharingEntrySimple:F},mixins:[Ue],props:{share:{type:A,required:!0}},computed:{viaFileTargetUrl:function(){return(0,o.generateUrl)("/f/{fileid}",{fileid:this.share.viaFileid})},viaFolderName:function(){return(0,Te.EZ)(this.share.viaPath)}}},Me=r(24147),Be={};Be.styleTagTransform=j(),Be.setAttributes=L(),Be.insert=O().bind(null,"head"),Be.domAPI=R(),Be.insertStyleElement=Y(),D()(Me.Z,Be),Me.Z&&Me.Z.locals&&Me.Z.locals;var We=(0,W.Z)(je,(function(){var e=this,t=e._self._c;return t("SharingEntrySimple",{key:e.share.id,staticClass:"sharing-entry__inherited",attrs:{title:e.share.shareWithDisplayName},scopedSlots:e._u([{key:"avatar",fn:function(){return[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{user:e.share.shareWith,"display-name":e.share.shareWithDisplayName}})]},proxy:!0}])},[e._v(" "),t("NcActionText",{attrs:{icon:"icon-user"}},[e._v("\n\t\t"+e._s(e.t("files_sharing","Added by {initiator}",{initiator:e.share.ownerDisplayName}))+"\n\t")]),e._v(" "),e.share.viaPath&&e.share.viaFileid?t("NcActionLink",{attrs:{icon:"icon-folder",href:e.viaFileTargetUrl}},[e._v("\n\t\t"+e._s(e.t("files_sharing","Via “{folder}”",{folder:e.viaFolderName}))+"\n\t")]):e._e(),e._v(" "),e.share.canDelete?t("NcActionButton",{attrs:{icon:"icon-close"},on:{click:function(t){return t.preventDefault(),e.onDelete.apply(null,arguments)}}},[e._v("\n\t\t"+e._s(e.t("files_sharing","Unshare"))+"\n\t")]):e._e()],1)}),[],!1,null,"23251e4a",null),Fe=We.exports,qe=r(25108);function Ze(e,t,n,r,i,a,s){try{var o=e[a](s),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,i)}var $e={name:"SharingInherited",components:{NcActionButton:De(),SharingEntryInherited:Fe,SharingEntrySimple:F},props:{fileInfo:{type:Object,default:function(){},required:!0}},data:function(){return{loaded:!1,loading:!1,showInheritedShares:!1,shares:[]}},computed:{showInheritedSharesIcon:function(){return this.loading?"icon-loading-small":this.showInheritedShares?"icon-triangle-n":"icon-triangle-s"},mainTitle:function(){return t("files_sharing","Others with access")},subTitle:function(){return this.showInheritedShares&&0===this.shares.length?t("files_sharing","No other users with access found"):""},toggleTooltip:function(){return"dir"===this.fileInfo.type?t("files_sharing","Toggle list of others with access to this directory"):t("files_sharing","Toggle list of others with access to this file")},fullPath:function(){return"".concat(this.fileInfo.path,"/").concat(this.fileInfo.name).replace("//","/")}},watch:{fileInfo:function(){this.resetState()}},methods:{toggleInheritedShares:function(){this.showInheritedShares=!this.showInheritedShares,this.showInheritedShares?this.fetchInheritedShares():this.resetState()},fetchInheritedShares:function(){var e,n=this;return(e=regeneratorRuntime.mark((function e(){var r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.loading=!0,e.prev=1,r=(0,o.generateOcsUrl)("apps/files_sharing/api/v1/shares/inherited?format=json&path={path}",{path:n.fullPath}),e.next=5,u.default.get(r);case 5:i=e.sent,n.shares=i.data.ocs.data.map((function(e){return new A(e)})).sort((function(e,t){return t.createdTime-e.createdTime})),qe.info(n.shares),n.loaded=!0,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),OC.Notification.showTemporary(t("files_sharing","Unable to fetch inherited shares"),{type:"error"});case 14:return e.prev=14,n.loading=!1,e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])})),function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){Ze(a,r,i,s,o,"next",e)}function o(e){Ze(a,r,i,s,o,"throw",e)}s(void 0)}))})()},resetState:function(){this.loaded=!1,this.loading=!1,this.showInheritedShares=!1,this.shares=[]},removeShare:function(e){var t=this.shares.findIndex((function(t){return t===e}));this.shares.splice(t,1)}}},Ge=$e,Ve=r(16843),Ke={};Ke.styleTagTransform=j(),Ke.setAttributes=L(),Ke.insert=O().bind(null,"head"),Ke.domAPI=R(),Ke.insertStyleElement=Y(),D()(Ve.Z,Ke),Ve.Z&&Ve.Z.locals&&Ve.Z.locals;var Qe=(0,W.Z)(Ge,(function(){var e=this,t=e._self._c;return t("ul",{attrs:{id:"sharing-inherited-shares"}},[t("SharingEntrySimple",{staticClass:"sharing-entry__inherited",attrs:{title:e.mainTitle,subtitle:e.subTitle,"aria-expanded":e.showInheritedShares},scopedSlots:e._u([{key:"avatar",fn:function(){return[t("div",{staticClass:"avatar-shared icon-more-white"})]},proxy:!0}])},[e._v(" "),t("NcActionButton",{attrs:{icon:e.showInheritedSharesIcon,"aria-label":e.toggleTooltip,title:e.toggleTooltip},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.toggleInheritedShares.apply(null,arguments)}}})],1),e._v(" "),e._l(e.shares,(function(n){return t("SharingEntryInherited",{key:n.id,attrs:{"file-info":e.fileInfo,share:n},on:{"remove:share":e.removeShare}})}))],2)}),[],!1,null,"3462b966",null),ze=Qe.exports,Je=r(81807),Xe=r.n(Je),et=r(79570),tt=r.n(et),nt=r(875),rt=r.n(nt),it=r(18074),at=r.n(it),st={name:"ExternalShareAction",props:{id:{type:String,required:!0},action:{type:Object,default:function(){return{}}},fileInfo:{type:Object,default:function(){},required:!0},share:{type:A,default:null}},computed:{data:function(){return this.action.data(this)}}},ot=(0,W.Z)(st,(function(){var e=this;return(0,e._self._c)(e.data.is,e._g(e._b({tag:"Component"},"Component",e.data,!1),e.action.handlers),[e._v("\n\t"+e._s(e.data.text)+"\n")])}),[],!1,null,null,null).exports,ct=r(30158),lt=r.n(ct),ut={NONE:0,READ:1,UPDATE:2,CREATE:4,DELETE:8,SHARE:16},ht={READ_ONLY:ut.READ,UPLOAD_AND_UPDATE:ut.READ|ut.UPDATE|ut.CREATE|ut.DELETE,FILE_DROP:ut.CREATE,ALL:ut.UPDATE|ut.CREATE|ut.READ|ut.DELETE|ut.SHARE};function dt(e,t){return e!==ut.NONE&&(e&t)===t}function ft(e){return!(!dt(e,ut.READ)&&!dt(e,ut.CREATE)||!dt(e,ut.READ)&&(dt(e,ut.UPDATE)||dt(e,ut.DELETE)))}function pt(e,t){return dt(e,t)?function(e,t){return e&~t}(e,t):function(e,t){return e|t}(e,t)}var gt=r(55976),mt=r(32964),vt={name:"SharePermissionsEditor",components:{NcActionButton:De(),NcActionCheckbox:Xe(),NcActionRadio:lt(),Tune:gt.Z,ChevronLeft:mt.default},mixins:[Ue],data:function(){return{randomFormName:Math.random().toString(27).substring(2),showCustomPermissionsForm:!1,atomicPermissions:ut,bundledPermissions:ht}},computed:{sharePermissionsSummary:function(){var e=this;return Object.values(this.atomicPermissions).filter((function(t){return e.shareHasPermissions(t)})).map((function(t){switch(t){case e.atomicPermissions.CREATE:return e.t("files_sharing","Upload");case e.atomicPermissions.READ:return e.t("files_sharing","Read");case e.atomicPermissions.UPDATE:return e.t("files_sharing","Edit");case e.atomicPermissions.DELETE:return e.t("files_sharing","Delete");default:return null}})).filter((function(e){return null!==e})).join(", ")},sharePermissionsIsBundle:function(){var e=this;return Object.values(ht).map((function(t){return e.sharePermissionEqual(t)})).filter((function(e){return e})).length>0},sharePermissionsSetIsValid:function(){return ft(this.share.permissions)},isFolder:function(){return"dir"===this.fileInfo.type},fileHasCreatePermission:function(){return!!(this.fileInfo.permissions&ut.CREATE)}},mounted:function(){this.showCustomPermissionsForm=!this.sharePermissionsIsBundle},methods:{sharePermissionEqual:function(e){return(this.share.permissions&~ut.SHARE)===e},shareHasPermissions:function(e){return dt(this.share.permissions,e)},setSharePermissions:function(e){this.share.permissions=e,this.queueUpdate("permissions")},canToggleSharePermissions:function(e){return function(e,t){return ft(pt(e,t))}(this.share.permissions,e)},toggleSharePermissions:function(e){this.share.permissions=pt(this.share.permissions,e),ft(this.share.permissions)&&this.queueUpdate("permissions")}}},yt=r(73286),_t={};_t.styleTagTransform=j(),_t.setAttributes=L(),_t.insert=O().bind(null,"head"),_t.domAPI=R(),_t.insertStyleElement=Y(),D()(yt.Z,_t),yt.Z&&yt.Z.locals&&yt.Z.locals;var At=(0,W.Z)(vt,(function(){var e=this,t=e._self._c;return t("li",[t("ul",[e.isFolder?e._e():t("NcActionCheckbox",{attrs:{checked:e.shareHasPermissions(e.atomicPermissions.UPDATE),disabled:e.saving},on:{"update:checked":function(t){return e.toggleSharePermissions(e.atomicPermissions.UPDATE)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Allow editing"))+"\n\t\t")]),e._v(" "),e.isFolder&&e.fileHasCreatePermission&&e.config.isPublicUploadEnabled?[e.showCustomPermissionsForm?t("span",{class:{error:!e.sharePermissionsSetIsValid}},[t("NcActionCheckbox",{attrs:{checked:e.shareHasPermissions(e.atomicPermissions.READ),disabled:e.saving||!e.canToggleSharePermissions(e.atomicPermissions.READ)},on:{"update:checked":function(t){return e.toggleSharePermissions(e.atomicPermissions.READ)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Read"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.shareHasPermissions(e.atomicPermissions.CREATE),disabled:e.saving||!e.canToggleSharePermissions(e.atomicPermissions.CREATE)},on:{"update:checked":function(t){return e.toggleSharePermissions(e.atomicPermissions.CREATE)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Upload"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.shareHasPermissions(e.atomicPermissions.UPDATE),disabled:e.saving||!e.canToggleSharePermissions(e.atomicPermissions.UPDATE)},on:{"update:checked":function(t){return e.toggleSharePermissions(e.atomicPermissions.UPDATE)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Edit"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.shareHasPermissions(e.atomicPermissions.DELETE),disabled:e.saving||!e.canToggleSharePermissions(e.atomicPermissions.DELETE)},on:{"update:checked":function(t){return e.toggleSharePermissions(e.atomicPermissions.DELETE)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Delete"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionButton",{on:{click:function(t){e.showCustomPermissionsForm=!1}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("ChevronLeft")]},proxy:!0}],null,!1,1018742195)},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Bundled permissions"))+"\n\t\t\t\t")])],1):[t("NcActionRadio",{attrs:{checked:e.sharePermissionEqual(e.bundledPermissions.READ_ONLY),value:e.bundledPermissions.READ_ONLY,name:e.randomFormName,disabled:e.saving},on:{change:function(t){return e.setSharePermissions(e.bundledPermissions.READ_ONLY)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Read only"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionRadio",{attrs:{checked:e.sharePermissionEqual(e.bundledPermissions.UPLOAD_AND_UPDATE),value:e.bundledPermissions.UPLOAD_AND_UPDATE,disabled:e.saving,name:e.randomFormName},on:{change:function(t){return e.setSharePermissions(e.bundledPermissions.UPLOAD_AND_UPDATE)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Allow upload and editing"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionRadio",{staticClass:"sharing-entry__action--public-upload",attrs:{checked:e.sharePermissionEqual(e.bundledPermissions.FILE_DROP),value:e.bundledPermissions.FILE_DROP,disabled:e.saving,name:e.randomFormName},on:{change:function(t){return e.setSharePermissions(e.bundledPermissions.FILE_DROP)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","File drop (upload only)"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionButton",{attrs:{title:e.t("files_sharing","Custom permissions")},on:{click:function(t){e.showCustomPermissionsForm=!0}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("Tune")]},proxy:!0}],null,!1,961531849)},[e._v("\n\t\t\t\t\t"+e._s(e.sharePermissionsIsBundle?"":e.sharePermissionsSummary)+"\n\t\t\t\t")])]]:e._e()],2)])}),[],!1,null,"5e957d09",null).exports,bt=r(25108);function wt(e){return wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wt(e)}function Et(e,t,n,r,i,a,s){try{var o=e[a](s),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,i)}function St(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){Et(a,r,i,s,o,"next",e)}function o(e){Et(a,r,i,s,o,"throw",e)}s(void 0)}))}}var Ct={name:"SharingEntryLink",components:{NcActions:x(),NcActionButton:De(),NcActionCheckbox:Xe(),NcActionInput:tt(),NcActionLink:S(),NcActionText:Ne(),NcActionTextEditable:at(),NcActionSeparator:rt(),NcAvatar:l(),ExternalShareAction:ot,SharePermissionsEditor:At},mixins:[Ue],props:{canReshare:{type:Boolean,default:!0},index:{type:Number,default:null}},data:function(){return{copySuccess:!0,copied:!1,pending:!1,ExternalLegacyLinkActions:OCA.Sharing.ExternalLinkActions.state,ExternalShareActions:OCA.Sharing.ExternalShareActions.state}},computed:{title:function(){if(this.share&&this.share.id){if(!this.isShareOwner&&this.share.ownerDisplayName)return this.isEmailShareType?t("files_sharing","{shareWith} by {initiator}",{shareWith:this.share.shareWith,initiator:this.share.ownerDisplayName}):t("files_sharing","Shared via link by {initiator}",{initiator:this.share.ownerDisplayName});if(this.share.label&&""!==this.share.label.trim())return this.isEmailShareType?t("files_sharing","Mail share ({label})",{label:this.share.label.trim()}):t("files_sharing","Share link ({label})",{label:this.share.label.trim()});if(this.isEmailShareType)return this.share.shareWith}return this.index>1?t("files_sharing","Share link ({index})",{index:this.index}):t("files_sharing","Share link")},subtitle:function(){return this.isEmailShareType&&this.title!==this.share.shareWith?this.share.shareWith:null},hasExpirationDate:{get:function(){return this.config.isDefaultExpireDateEnforced||!!this.share.expireDate},set:function(e){var t=this.config.defaultExpirationDate||new Date((new Date).setDate((new Date).getDate()+1));this.share.expireDate=e?this.formatDateToString(t):"",bt.debug("Expiration date status",e,this.share.expireDate)}},dateMaxEnforced:function(){return this.config.isDefaultExpireDateEnforced?new Date((new Date).setDate((new Date).getDate()+this.config.defaultExpireDate)):null},isPasswordProtected:{get:function(){return this.config.enforcePasswordForPublicLink||!!this.share.password},set:function(e){var t=this;return St(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.t0=i.ZP,n.t1=t.share,!e){n.next=8;break}return n.next=5,ce();case 5:n.t2=n.sent,n.next=9;break;case 8:n.t2="";case 9:n.t3=n.t2,n.t0.set.call(n.t0,n.t1,"password",n.t3),i.ZP.set(t.share,"newPassword",t.share.password);case 12:case"end":return n.stop()}}),n)})))()}},passwordExpirationTime:function(){if(null===this.share.passwordExpirationTime)return null;var e=moment(this.share.passwordExpirationTime);return!(e.diff(moment())<0)&&e.fromNow()},isTalkEnabled:function(){return void 0!==OC.appswebroots.spreed},isPasswordProtectedByTalkAvailable:function(){return this.isPasswordProtected&&this.isTalkEnabled},isPasswordProtectedByTalk:{get:function(){return this.share.sendPasswordByTalk},set:function(e){var t=this;return St(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t.share.sendPasswordByTalk=e;case 1:case"end":return n.stop()}}),n)})))()}},isEmailShareType:function(){return!!this.share&&this.share.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL},canTogglePasswordProtectedByTalkAvailable:function(){return!(!this.isPasswordProtected||this.isEmailShareType&&!this.hasUnsavedPassword)},pendingPassword:function(){return this.config.enableLinkPasswordByDefault&&this.share&&!this.share.id},pendingEnforcedPassword:function(){return this.config.enforcePasswordForPublicLink&&this.share&&!this.share.id},pendingExpirationDate:function(){return this.config.isDefaultExpireDateEnforced&&this.share&&!this.share.id},hasUnsavedPassword:function(){return void 0!==this.share.newPassword},shareLink:function(){return window.location.protocol+"//"+window.location.host+(0,o.generateUrl)("/s/")+this.share.token},actionsTooltip:function(){return t("files_sharing",'Actions for "{title}"',{title:this.title})},copyLinkTooltip:function(){return this.copied?this.copySuccess?"":t("files_sharing","Cannot copy, please copy the link manually"):t("files_sharing",'Copy public link of "{title}" to clipboard',{title:this.title})},externalLegacyLinkActions:function(){return this.ExternalLegacyLinkActions.actions},externalLinkActions:function(){return this.ExternalShareActions.actions.filter((function(e){return e.shareType.includes(g.D.SHARE_TYPE_LINK)||e.shareType.includes(g.D.SHARE_TYPE_EMAIL)}))},isPasswordPolicyEnabled:function(){return"object"===wt(this.config.passwordPolicy)},canChangeHideDownload:function(){return this.fileInfo.shareAttributes.some((function(e){return"download"===e.key&&"permissions"===e.scope&&!1===e.enabled}))}},methods:{onNewLinkShare:function(){var e=this;return St(regeneratorRuntime.mark((function n(){var r,i,a,s;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.loading){n.next=2;break}return n.abrupt("return");case 2:if(r={share_type:g.D.SHARE_TYPE_LINK},e.config.isDefaultExpireDateEnforced&&(r.expiration=e.formatDateToString(e.config.defaultExpirationDate)),!(e.config.enableLinkPasswordByDefault||e.config.enforcePasswordForPublicLink||e.config.isDefaultExpireDateEnforced)){n.next=37;break}if(e.pending=!0,!e.share||e.share.id){n.next=24;break}if(!e.checkShare(e.share)){n.next=21;break}return n.prev=8,n.next=11,e.pushNewLinkShare(e.share,!0);case 11:n.next=18;break;case 13:return n.prev=13,n.t0=n.catch(8),e.pending=!1,bt.error(n.t0),n.abrupt("return",!1);case 18:return n.abrupt("return",!0);case 21:return e.open=!0,OC.Notification.showTemporary(t("files_sharing","Error, please enter proper password and/or expiration date")),n.abrupt("return",!1);case 24:if(!e.config.enableLinkPasswordByDefault&&!e.config.enforcePasswordForPublicLink){n.next=28;break}return n.next=27,ce();case 27:r.password=n.sent;case 28:return i=new A(r),n.next=31,new Promise((function(t){e.$emit("add:share",i,t)}));case 31:a=n.sent,e.open=!1,e.pending=!1,a.open=!0,n.next=40;break;case 37:return s=new A(r),n.next=40,e.pushNewLinkShare(s);case 40:case"end":return n.stop()}}),n,null,[[8,13]])})))()},pushNewLinkShare:function(e,n){var r=this;return St(regeneratorRuntime.mark((function i(){var a,s,o,c,l,u,h,d,f;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(i.prev=0,!r.loading){i.next=3;break}return i.abrupt("return",!0);case 3:return r.loading=!0,r.errors={},a=(r.fileInfo.path+"/"+r.fileInfo.name).replace("//","/"),s={path:a,shareType:g.D.SHARE_TYPE_LINK,password:e.password,expireDate:e.expireDate,attributes:JSON.stringify(r.fileInfo.shareAttributes)},bt.debug("Creating link share with options",s),i.next=10,r.createShare(s);case 10:if(o=i.sent,r.open=!1,bt.debug("Link share created",o),!n){i.next=19;break}return i.next=16,new Promise((function(e){r.$emit("update:share",o,e)}));case 16:c=i.sent,i.next=22;break;case 19:return i.next=21,new Promise((function(e){r.$emit("add:share",o,e)}));case 21:c=i.sent;case 22:r.config.enforcePasswordForPublicLink||c.copyLink(),(0,w.s$)(t("files_sharing","Link share created")),i.next=35;break;case 26:if(i.prev=26,i.t0=i.catch(0),f=null===i.t0||void 0===i.t0||null===(l=i.t0.response)||void 0===l||null===(u=l.data)||void 0===u||null===(h=u.ocs)||void 0===h||null===(d=h.meta)||void 0===d?void 0:d.message){i.next=33;break}return(0,w.x2)(t("files_sharing","Error while creating the share")),bt.error(i.t0),i.abrupt("return");case 33:throw f.match(/password/i)?r.onSyncError("password",f):f.match(/date/i)?r.onSyncError("expireDate",f):r.onSyncError("pending",f),i.t0;case 35:return i.prev=35,r.loading=!1,i.finish(35);case 38:case"end":return i.stop()}}),i,null,[[0,26,35,38]])})))()},onLabelChange:function(e){this.$set(this.share,"newLabel",e.trim())},onLabelSubmit:function(){"string"==typeof this.share.newLabel&&(this.share.label=this.share.newLabel,this.$delete(this.share,"newLabel"),this.queueUpdate("label"))},copyLink:function(){var e=this;return St(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,navigator.clipboard.writeText(e.shareLink);case 3:(0,w.s$)(t("files_sharing","Link copied")),e.$refs.copyButton.$el.focus(),e.copySuccess=!0,e.copied=!0,n.next=14;break;case 9:n.prev=9,n.t0=n.catch(0),e.copySuccess=!1,e.copied=!0,bt.error(n.t0);case 14:return n.prev=14,setTimeout((function(){e.copySuccess=!1,e.copied=!1}),4e3),n.finish(14);case 17:case"end":return n.stop()}}),n,null,[[0,9,14,17]])})))()},onPasswordChange:function(e){this.$set(this.share,"newPassword",e)},onPasswordDisable:function(){this.share.password="",this.$delete(this.share,"newPassword"),this.share.id&&this.queueUpdate("password")},onPasswordSubmit:function(){this.hasUnsavedPassword&&(this.share.password=this.share.newPassword.trim(),this.queueUpdate("password"))},onPasswordProtectedByTalkChange:function(){this.hasUnsavedPassword&&(this.share.password=this.share.newPassword.trim()),this.queueUpdate("sendPasswordByTalk","password")},onMenuClose:function(){this.onPasswordSubmit(),this.onNoteSubmit()},onCancel:function(){this.$emit("remove:share",this.share)}}},xt=Ct,kt=r(80055),Pt={};Pt.styleTagTransform=j(),Pt.setAttributes=L(),Pt.insert=O().bind(null,"head"),Pt.domAPI=R(),Pt.insertStyleElement=Y(),D()(kt.Z,Pt),kt.Z&&kt.Z.locals&&kt.Z.locals;var Dt=(0,W.Z)(xt,(function(){var e=this,t=e._self._c;return t("li",{staticClass:"sharing-entry sharing-entry__link",class:{"sharing-entry--share":e.share}},[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{"is-no-user":!0,"icon-class":e.isEmailShareType?"avatar-link-share icon-mail-white":"avatar-link-share icon-public-white"}}),e._v(" "),t("div",{staticClass:"sharing-entry__desc"},[t("span",{staticClass:"sharing-entry__title",attrs:{title:e.title}},[e._v("\n\t\t\t"+e._s(e.title)+"\n\t\t")]),e._v(" "),e.subtitle?t("p",[e._v("\n\t\t\t"+e._s(e.subtitle)+"\n\t\t")]):e._e()]),e._v(" "),e.share&&!e.isEmailShareType&&e.share.token?t("NcActions",{ref:"copyButton",staticClass:"sharing-entry__copy"},[t("NcActionLink",{attrs:{href:e.shareLink,target:"_blank",title:e.copyLinkTooltip,"aria-label":e.copyLinkTooltip,icon:e.copied&&e.copySuccess?"icon-checkmark-color":"icon-clippy"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.copyLink.apply(null,arguments)}}})],1):e._e(),e._v(" "),!e.pending&&(e.pendingPassword||e.pendingEnforcedPassword||e.pendingExpirationDate)?t("NcActions",{staticClass:"sharing-entry__actions",attrs:{"aria-label":e.actionsTooltip,"menu-align":"right",open:e.open},on:{"update:open":function(t){e.open=t},close:e.onNewLinkShare}},[e.errors.pending?t("NcActionText",{class:{error:e.errors.pending},attrs:{icon:"icon-error"}},[e._v("\n\t\t\t"+e._s(e.errors.pending)+"\n\t\t")]):t("NcActionText",{attrs:{icon:"icon-info"}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Please enter the following required information before creating the share"))+"\n\t\t")]),e._v(" "),e.pendingEnforcedPassword?t("NcActionText",{attrs:{icon:"icon-password"}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Password protection (enforced)"))+"\n\t\t")]):e.pendingPassword?t("NcActionCheckbox",{staticClass:"share-link-password-checkbox",attrs:{checked:e.isPasswordProtected,disabled:e.config.enforcePasswordForPublicLink||e.saving},on:{"update:checked":function(t){e.isPasswordProtected=t},uncheck:e.onPasswordDisable}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Password protection"))+"\n\t\t")]):e._e(),e._v(" "),e.pendingEnforcedPassword||e.share.password?t("NcActionInput",{staticClass:"share-link-password",attrs:{value:e.share.password,disabled:e.saving,required:e.config.enableLinkPasswordByDefault||e.config.enforcePasswordForPublicLink,minlength:e.isPasswordPolicyEnabled&&e.config.passwordPolicy.minLength,icon:"",autocomplete:"new-password"},on:{"update:value":function(t){return e.$set(e.share,"password",t)},submit:e.onNewLinkShare}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Enter a password"))+"\n\t\t")]):e._e(),e._v(" "),e.pendingExpirationDate?t("NcActionText",{attrs:{icon:"icon-calendar-dark"}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Expiration date (enforced)"))+"\n\t\t")]):e._e(),e._v(" "),e.pendingExpirationDate?t("NcActionInput",{staticClass:"share-link-expire-date",attrs:{disabled:e.saving,"is-native-picker":!0,"hide-label":!0,value:new Date(e.share.expireDate),type:"date",min:e.dateTomorrow,max:e.dateMaxEnforced},on:{input:e.onExpirationChange}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Enter a date"))+"\n\t\t")]):e._e(),e._v(" "),t("NcActionButton",{attrs:{icon:"icon-checkmark"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Create share"))+"\n\t\t")]),e._v(" "),t("NcActionButton",{attrs:{icon:"icon-close"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onCancel.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Cancel"))+"\n\t\t")])],1):e.loading?t("div",{staticClass:"icon-loading-small sharing-entry__loading"}):t("NcActions",{staticClass:"sharing-entry__actions",attrs:{"aria-label":e.actionsTooltip,"menu-align":"right",open:e.open},on:{"update:open":function(t){e.open=t},close:e.onMenuClose}},[e.share?[e.share.canEdit&&e.canReshare?[t("NcActionInput",{ref:"label",class:{error:e.errors.label},attrs:{disabled:e.saving,label:e.t("files_sharing","Share label"),value:void 0!==e.share.newLabel?e.share.newLabel:e.share.label,icon:"icon-edit",maxlength:"255"},on:{"update:value":e.onLabelChange,submit:e.onLabelSubmit}}),e._v(" "),t("SharePermissionsEditor",{attrs:{"can-reshare":e.canReshare,share:e.share,"file-info":e.fileInfo},on:{"update:share":function(t){e.share=t}}}),e._v(" "),t("NcActionSeparator"),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.share.hideDownload,disabled:e.saving||e.canChangeHideDownload},on:{"update:checked":function(t){return e.$set(e.share,"hideDownload",t)},change:function(t){return e.queueUpdate("hideDownload")}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Hide download"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionCheckbox",{staticClass:"share-link-password-checkbox",attrs:{checked:e.isPasswordProtected,disabled:e.config.enforcePasswordForPublicLink||e.saving},on:{"update:checked":function(t){e.isPasswordProtected=t},uncheck:e.onPasswordDisable}},[e._v("\n\t\t\t\t\t"+e._s(e.config.enforcePasswordForPublicLink?e.t("files_sharing","Password protection (enforced)"):e.t("files_sharing","Password protect"))+"\n\t\t\t\t")]),e._v(" "),e.isPasswordProtected?t("NcActionInput",{ref:"password",staticClass:"share-link-password",class:{error:e.errors.password},attrs:{disabled:e.saving,"show-trailing-button":e.hasUnsavedPassword,required:e.config.enforcePasswordForPublicLink,value:e.hasUnsavedPassword?e.share.newPassword:"***************",icon:"icon-password",autocomplete:"new-password",type:e.hasUnsavedPassword?"text":"password"},on:{"update:value":e.onPasswordChange,submit:e.onPasswordSubmit}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Enter a password"))+"\n\t\t\t\t")]):e._e(),e._v(" "),e.isEmailShareType&&e.passwordExpirationTime?t("NcActionText",{attrs:{icon:"icon-info"}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Password expires {passwordExpirationTime}",{passwordExpirationTime:e.passwordExpirationTime}))+"\n\t\t\t\t")]):e.isEmailShareType&&null!==e.passwordExpirationTime?t("NcActionText",{attrs:{icon:"icon-error"}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Password expired"))+"\n\t\t\t\t")]):e._e(),e._v(" "),e.isPasswordProtectedByTalkAvailable?t("NcActionCheckbox",{staticClass:"share-link-password-talk-checkbox",attrs:{checked:e.isPasswordProtectedByTalk,disabled:!e.canTogglePasswordProtectedByTalkAvailable||e.saving},on:{"update:checked":function(t){e.isPasswordProtectedByTalk=t},change:e.onPasswordProtectedByTalkChange}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Video verification"))+"\n\t\t\t\t")]):e._e(),e._v(" "),t("NcActionCheckbox",{staticClass:"share-link-expire-date-checkbox",attrs:{checked:e.hasExpirationDate,disabled:e.config.isDefaultExpireDateEnforced||e.saving},on:{"update:checked":function(t){e.hasExpirationDate=t},uncheck:e.onExpirationDisable}},[e._v("\n\t\t\t\t\t"+e._s(e.config.isDefaultExpireDateEnforced?e.t("files_sharing","Expiration date (enforced)"):e.t("files_sharing","Set expiration date"))+"\n\t\t\t\t")]),e._v(" "),e.hasExpirationDate?t("NcActionInput",{ref:"expireDate",staticClass:"share-link-expire-date",class:{error:e.errors.expireDate},attrs:{"is-native-picker":!0,"hide-label":!0,disabled:e.saving,value:new Date(e.share.expireDate),type:"date",min:e.dateTomorrow,max:e.dateMaxEnforced},on:{input:e.onExpirationChange}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Enter a date"))+"\n\t\t\t\t")]):e._e(),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.hasNote,disabled:e.saving},on:{"update:checked":function(t){e.hasNote=t},uncheck:function(t){return e.queueUpdate("note")}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Note to recipient"))+"\n\t\t\t\t")]),e._v(" "),e.hasNote?t("NcActionTextEditable",{ref:"note",class:{error:e.errors.note},attrs:{disabled:e.saving,placeholder:e.t("files_sharing","Enter a note for the share recipient"),value:e.share.newNote||e.share.note,icon:"icon-edit"},on:{"update:value":e.onNoteChange,submit:e.onNoteSubmit}}):e._e()]:e._e(),e._v(" "),t("NcActionSeparator"),e._v(" "),e._l(e.externalLinkActions,(function(n){return t("ExternalShareAction",{key:n.id,attrs:{id:n.id,action:n,"file-info":e.fileInfo,share:e.share}})})),e._v(" "),e._l(e.externalLegacyLinkActions,(function(n,r){var i=n.icon,a=n.url,s=n.name;return t("NcActionLink",{key:r,attrs:{href:a(e.shareLink),icon:i,target:"_blank"}},[e._v("\n\t\t\t\t"+e._s(s)+"\n\t\t\t")])})),e._v(" "),e.share.canDelete?t("NcActionButton",{attrs:{icon:"icon-close",disabled:e.saving},on:{click:function(t){return t.preventDefault(),e.onDelete.apply(null,arguments)}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Unshare"))+"\n\t\t\t")]):e._e(),e._v(" "),!e.isEmailShareType&&e.canReshare?t("NcActionButton",{staticClass:"new-share-link",attrs:{icon:"icon-add"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare.apply(null,arguments)}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Add another link"))+"\n\t\t\t")]):e._e()]:e.canReshare?t("NcActionButton",{staticClass:"new-share-link",attrs:{title:e.t("files_sharing","Create a new share link"),"aria-label":e.t("files_sharing","Create a new share link"),icon:e.loading?"icon-loading-small":"icon-add"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare.apply(null,arguments)}}}):e._e()],2)],1)}),[],!1,null,"5bce4e06",null),Tt={name:"SharingLinkList",components:{SharingEntryLink:Dt.exports},mixins:[b],props:{fileInfo:{type:Object,default:function(){},required:!0},shares:{type:Array,default:function(){return[]},required:!0},canReshare:{type:Boolean,required:!0}},data:function(){return{canLinkShare:OC.getCapabilities().files_sharing.public.enabled}},computed:{hasLinkShares:function(){var e=this;return this.shares.filter((function(t){return t.type===e.SHARE_TYPES.SHARE_TYPE_LINK})).length>0},hasShares:function(){return this.shares.length>0}},methods:{addShare:function(e,t){this.shares.unshift(e),this.awaitForShare(e,t)},awaitForShare:function(e,t){var n=this;this.$nextTick((function(){var r=n.$children.find((function(t){return t.share===e}));r&&t(r)}))},removeShare:function(e){var t=this.shares.findIndex((function(t){return t===e}));this.shares.splice(t,1)}}},Rt=(0,W.Z)(Tt,(function(){var e=this,t=e._self._c;return e.canLinkShare?t("ul",{staticClass:"sharing-link-list"},[!e.hasLinkShares&&e.canReshare?t("SharingEntryLink",{attrs:{"can-reshare":e.canReshare,"file-info":e.fileInfo},on:{"add:share":e.addShare}}):e._e(),e._v(" "),e.hasShares?e._l(e.shares,(function(n,r){return t("SharingEntryLink",{key:n.id,attrs:{index:e.shares.length>1?r+1:null,"can-reshare":e.canReshare,share:e.shares[r],"file-info":e.fileInfo},on:{"update:share":[function(t){return e.$set(e.shares,r,t)},function(t){return e.awaitForShare.apply(e,arguments)}],"add:share":function(t){return e.addShare.apply(e,arguments)},"remove:share":e.removeShare}})})):e._e()],2):e._e()}),[],!1,null,null,null),Nt=Rt.exports,Ot=r(25108);function It(e){return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},It(e)}var Lt={name:"SharingEntry",components:{NcActions:x(),NcActionButton:De(),NcActionCheckbox:Xe(),NcActionInput:tt(),NcActionTextEditable:at(),NcAvatar:l()},mixins:[Ue],data:function(){return{permissionsEdit:OC.PERMISSION_UPDATE,permissionsCreate:OC.PERMISSION_CREATE,permissionsDelete:OC.PERMISSION_DELETE,permissionsRead:OC.PERMISSION_READ,permissionsShare:OC.PERMISSION_SHARE}},computed:{title:function(){var e=this.share.shareWithDisplayName;return this.share.type===this.SHARE_TYPES.SHARE_TYPE_GROUP?e+=" (".concat(t("files_sharing","group"),")"):this.share.type===this.SHARE_TYPES.SHARE_TYPE_ROOM?e+=" (".concat(t("files_sharing","conversation"),")"):this.share.type===this.SHARE_TYPES.SHARE_TYPE_REMOTE?e+=" (".concat(t("files_sharing","remote"),")"):this.share.type===this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP?e+=" (".concat(t("files_sharing","remote group"),")"):this.share.type===this.SHARE_TYPES.SHARE_TYPE_GUEST&&(e+=" (".concat(t("files_sharing","guest"),")")),e},tooltip:function(){if(this.share.owner!==this.share.uidFileOwner){var e={user:this.share.shareWithDisplayName,owner:this.share.ownerDisplayName};return this.share.type===this.SHARE_TYPES.SHARE_TYPE_GROUP?t("files_sharing","Shared with the group {user} by {owner}",e):this.share.type===this.SHARE_TYPES.SHARE_TYPE_ROOM?t("files_sharing","Shared with the conversation {user} by {owner}",e):t("files_sharing","Shared with {user} by {owner}",e)}return null},canHaveNote:function(){return!this.isRemote},isRemote:function(){return this.share.type===this.SHARE_TYPES.SHARE_TYPE_REMOTE||this.share.type===this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP},canSetEdit:function(){return this.fileInfo.sharePermissions&OC.PERMISSION_UPDATE||this.canEdit},canSetCreate:function(){return this.fileInfo.sharePermissions&OC.PERMISSION_CREATE||this.canCreate},canSetDelete:function(){return this.fileInfo.sharePermissions&OC.PERMISSION_DELETE||this.canDelete},canSetReshare:function(){return this.fileInfo.sharePermissions&OC.PERMISSION_SHARE||this.canReshare},canSetDownload:function(){return this.fileInfo.canDownload()||this.canDownload},canEdit:{get:function(){return this.share.hasUpdatePermission},set:function(e){this.updatePermissions({isEditChecked:e})}},canCreate:{get:function(){return this.share.hasCreatePermission},set:function(e){this.updatePermissions({isCreateChecked:e})}},canDelete:{get:function(){return this.share.hasDeletePermission},set:function(e){this.updatePermissions({isDeleteChecked:e})}},canReshare:{get:function(){return this.share.hasSharePermission},set:function(e){this.updatePermissions({isReshareChecked:e})}},canDownload:{get:function(){return this.share.hasDownloadPermission},set:function(e){this.updatePermissions({isDownloadChecked:e})}},hasRead:{get:function(){return this.share.hasReadPermission}},isFolder:function(){return"dir"===this.fileInfo.type},hasExpirationDate:{get:function(){return this.config.isDefaultInternalExpireDateEnforced||!!this.share.expireDate},set:function(e){var t=this.config.defaultInternalExpirationDate||new Date((new Date).setDate((new Date).getDate()+1));this.share.expireDate=e?this.formatDateToString(t):"",Ot.debug("Expiration date status",e,this.share.expireDate)}},dateMaxEnforced:function(){return!this.isRemote&&this.config.isDefaultInternalExpireDateEnforced?new Date((new Date).setDate((new Date).getDate()+1+this.config.defaultInternalExpireDate)):this.config.isDefaultRemoteExpireDateEnforced?new Date((new Date).setDate((new Date).getDate()+1+this.config.defaultRemoteExpireDate)):null},hasStatus:function(){return this.share.type===this.SHARE_TYPES.SHARE_TYPE_USER&&"object"===It(this.share.status)&&!Array.isArray(this.share.status)},allowDownloadText:function(){return t("files_sharing","Allow download")},isSetDownloadButtonVisible:function(){return this.isFolder||["application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation"].includes(this.fileInfo.mimetype)}},methods:{updatePermissions:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.isEditChecked,n=void 0===t?this.canEdit:t,r=e.isCreateChecked,i=void 0===r?this.canCreate:r,a=e.isDeleteChecked,s=void 0===a?this.canDelete:a,o=e.isReshareChecked,c=void 0===o?this.canReshare:o,l=e.isDownloadChecked,u=void 0===l?this.canDownload:l,h=0|(this.hasRead?this.permissionsRead:0)|(i?this.permissionsCreate:0)|(s?this.permissionsDelete:0)|(n?this.permissionsEdit:0)|(c?this.permissionsShare:0);this.share.permissions=h,this.share.hasDownloadPermission!==u&&(this.share.hasDownloadPermission=u),this.queueUpdate("permissions","attributes")},onMenuClose:function(){this.onNoteSubmit()}}},Ht=Lt,Yt=r(24196),Ut={};Ut.styleTagTransform=j(),Ut.setAttributes=L(),Ut.insert=O().bind(null,"head"),Ut.domAPI=R(),Ut.insertStyleElement=Y(),D()(Yt.Z,Ut),Yt.Z&&Yt.Z.locals&&Yt.Z.locals;var jt=(0,W.Z)(Ht,(function(){var e=this,t=e._self._c;return t("li",{staticClass:"sharing-entry"},[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{"is-no-user":e.share.type!==e.SHARE_TYPES.SHARE_TYPE_USER,user:e.share.shareWith,"display-name":e.share.shareWithDisplayName,"menu-position":"left",url:e.share.shareWithAvatar}}),e._v(" "),t(e.share.shareWithLink?"a":"div",{tag:"component",staticClass:"sharing-entry__desc",attrs:{title:e.tooltip,"aria-label":e.tooltip,href:e.share.shareWithLink}},[t("span",[e._v(e._s(e.title)),e.isUnique?e._e():t("span",{staticClass:"sharing-entry__desc-unique"},[e._v(" ("+e._s(e.share.shareWithDisplayNameUnique)+")")])]),e._v(" "),e.hasStatus?t("p",[t("span",[e._v(e._s(e.share.status.icon||""))]),e._v(" "),t("span",[e._v(e._s(e.share.status.message||""))])]):e._e()]),e._v(" "),t("NcActions",{staticClass:"sharing-entry__actions",attrs:{"menu-align":"right"},on:{close:e.onMenuClose}},[e.share.canEdit?[t("NcActionCheckbox",{ref:"canEdit",attrs:{checked:e.canEdit,value:e.permissionsEdit,disabled:e.saving||!e.canSetEdit},on:{"update:checked":function(t){e.canEdit=t}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Allow editing"))+"\n\t\t\t")]),e._v(" "),e.isFolder?t("NcActionCheckbox",{ref:"canCreate",attrs:{checked:e.canCreate,value:e.permissionsCreate,disabled:e.saving||!e.canSetCreate},on:{"update:checked":function(t){e.canCreate=t}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Allow creating"))+"\n\t\t\t")]):e._e(),e._v(" "),e.isFolder?t("NcActionCheckbox",{ref:"canDelete",attrs:{checked:e.canDelete,value:e.permissionsDelete,disabled:e.saving||!e.canSetDelete},on:{"update:checked":function(t){e.canDelete=t}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Allow deleting"))+"\n\t\t\t")]):e._e(),e._v(" "),e.config.isResharingAllowed?t("NcActionCheckbox",{ref:"canReshare",attrs:{checked:e.canReshare,value:e.permissionsShare,disabled:e.saving||!e.canSetReshare},on:{"update:checked":function(t){e.canReshare=t}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Allow resharing"))+"\n\t\t\t")]):e._e(),e._v(" "),e.isSetDownloadButtonVisible?t("NcActionCheckbox",{ref:"canDownload",attrs:{checked:e.canDownload,disabled:e.saving||!e.canSetDownload},on:{"update:checked":function(t){e.canDownload=t}}},[e._v("\n\t\t\t\t"+e._s(e.allowDownloadText)+"\n\t\t\t")]):e._e(),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.hasExpirationDate,disabled:e.config.isDefaultInternalExpireDateEnforced||e.saving},on:{"update:checked":function(t){e.hasExpirationDate=t},uncheck:e.onExpirationDisable}},[e._v("\n\t\t\t\t"+e._s(e.config.isDefaultInternalExpireDateEnforced?e.t("files_sharing","Expiration date enforced"):e.t("files_sharing","Set expiration date"))+"\n\t\t\t")]),e._v(" "),e.hasExpirationDate?t("NcActionInput",{ref:"expireDate",class:{error:e.errors.expireDate},attrs:{"is-native-picker":!0,"hide-label":!0,disabled:e.saving,value:new Date(e.share.expireDate),type:"date",min:e.dateTomorrow,max:e.dateMaxEnforced},on:{input:e.onExpirationChange}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Enter a date"))+"\n\t\t\t")]):e._e(),e._v(" "),e.canHaveNote?[t("NcActionCheckbox",{attrs:{checked:e.hasNote,disabled:e.saving},on:{"update:checked":function(t){e.hasNote=t},uncheck:function(t){return e.queueUpdate("note")}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Note to recipient"))+"\n\t\t\t\t")]),e._v(" "),e.hasNote?t("NcActionTextEditable",{ref:"note",class:{error:e.errors.note},attrs:{disabled:e.saving,value:e.share.newNote||e.share.note,icon:"icon-edit"},on:{"update:value":e.onNoteChange,submit:e.onNoteSubmit}}):e._e()]:e._e()]:e._e(),e._v(" "),e.share.canDelete?t("NcActionButton",{attrs:{icon:"icon-close",disabled:e.saving},on:{click:function(t){return t.preventDefault(),e.onDelete.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Unshare"))+"\n\t\t")]):e._e()],2)],1)}),[],!1,null,"13a6a5f0",null);function Mt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0},canReshare:function(){return!!(this.fileInfo.permissions&OC.PERMISSION_SHARE)||!!(this.reshare&&this.reshare.hasSharePermission&&this.config.isResharingAllowed)}},methods:{update:function(e){var t=this;return $t(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t.fileInfo=e,t.resetState(),t.getShares();case 3:case"end":return n.stop()}}),n)})))()},getShares:function(){var e=this;return $t(regeneratorRuntime.mark((function n(){var r,i,a,s,c,l,h,d,f,p,g,m;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,e.loading=!0,r=(0,o.generateOcsUrl)("apps/files_sharing/api/v1/shares"),i="json",a=(e.fileInfo.path+"/"+e.fileInfo.name).replace("//","/"),s=u.default.get(r,{params:{format:i,path:a,reshares:!0}}),c=u.default.get(r,{params:{format:i,path:a,shared_with_me:!0}}),n.next=9,Promise.all([s,c]);case 9:l=n.sent,y=2,h=function(e){if(Array.isArray(e))return e}(v=l)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,s,o=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return o}}(v,y)||function(e,t){if(e){if("string"==typeof e)return qt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qt(e,t):void 0}}(v,y)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),d=h[0],f=h[1],e.loading=!1,e.processSharedWithMe(f),e.processShares(d),n.next=23;break;case 18:n.prev=18,n.t0=n.catch(0),null!==(p=n.t0.response.data)&&void 0!==p&&null!==(g=p.ocs)&&void 0!==g&&null!==(m=g.meta)&&void 0!==m&&m.message?e.error=n.t0.response.data.ocs.meta.message:e.error=t("files_sharing","Unable to load the shares list"),e.loading=!1,Ft.error("Error loading the shares list",n.t0);case 23:case"end":return n.stop()}var v,y}),n,null,[[0,18]])})))()},resetState:function(){clearInterval(this.expirationInterval),this.loading=!0,this.error="",this.sharedWithMe={},this.shares=[],this.linkShares=[]},updateExpirationSubtitle:function(e){var n=moment(e.expireDate).unix();this.$set(this.sharedWithMe,"subtitle",t("files_sharing","Expires {relativetime}",{relativetime:OC.Util.relativeModifiedDate(1e3*n)})),moment().unix()>n&&(clearInterval(this.expirationInterval),this.$set(this.sharedWithMe,"subtitle",t("files_sharing","this share just expired.")))},processShares:function(e){var t=this,n=e.data;if(n.ocs&&n.ocs.data&&n.ocs.data.length>0){var r=n.ocs.data.map((function(e){return new A(e)})).sort((function(e,t){return t.createdTime-e.createdTime}));this.linkShares=r.filter((function(e){return e.type===t.SHARE_TYPES.SHARE_TYPE_LINK||e.type===t.SHARE_TYPES.SHARE_TYPE_EMAIL})),this.shares=r.filter((function(e){return e.type!==t.SHARE_TYPES.SHARE_TYPE_LINK&&e.type!==t.SHARE_TYPES.SHARE_TYPE_EMAIL})),Ft.debug("Processed",this.linkShares.length,"link share(s)"),Ft.debug("Processed",this.shares.length,"share(s)")}},processSharedWithMe:function(e){var n=e.data;if(n.ocs&&n.ocs.data&&n.ocs.data[0]){var r=new A(n),i=function(e){return e.type===g.D.SHARE_TYPE_GROUP?t("files_sharing","Shared with you and the group {group} by {owner}",{group:e.shareWithDisplayName,owner:e.ownerDisplayName},void 0,{escape:!1}):e.type===g.D.SHARE_TYPE_CIRCLE?t("files_sharing","Shared with you and {circle} by {owner}",{circle:e.shareWithDisplayName,owner:e.ownerDisplayName},void 0,{escape:!1}):e.type===g.D.SHARE_TYPE_ROOM?e.shareWithDisplayName?t("files_sharing","Shared with you and the conversation {conversation} by {owner}",{conversation:e.shareWithDisplayName,owner:e.ownerDisplayName},void 0,{escape:!1}):t("files_sharing","Shared with you in a conversation by {owner}",{owner:e.ownerDisplayName},void 0,{escape:!1}):t("files_sharing","Shared with you by {owner}",{owner:e.ownerDisplayName},void 0,{escape:!1})}(r),a=r.ownerDisplayName,s=r.owner;this.sharedWithMe={displayName:a,title:i,user:s},this.reshare=r,r.expireDate&&moment(r.expireDate).unix()>moment().unix()&&(this.updateExpirationSubtitle(r),this.expirationInterval=setInterval(this.updateExpirationSubtitle,1e4,r))}else this.fileInfo&&void 0!==this.fileInfo.shareOwnerId&&this.fileInfo.shareOwnerId!==OC.currentUser&&(this.sharedWithMe={displayName:this.fileInfo.shareOwner,title:t("files_sharing","Shared with you by {owner}",{owner:this.fileInfo.shareOwner},void 0,{escape:!1}),user:this.fileInfo.shareOwnerId})},addShare:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};e.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL?this.linkShares.unshift(e):this.shares.unshift(e),this.awaitForShare(e,t)},awaitForShare:function(e,t){var n=this.$refs.shareList;e.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL&&(n=this.$refs.linkShareList),this.$nextTick((function(){var r=n.$children.find((function(t){return t.share===e}));r&&t(r)}))}}},Vt=Gt,Kt=r(64727),Qt={};Qt.styleTagTransform=j(),Qt.setAttributes=L(),Qt.insert=O().bind(null,"head"),Qt.domAPI=R(),Qt.insertStyleElement=Y(),D()(Kt.Z,Qt),Kt.Z&&Kt.Z.locals&&Kt.Z.locals;var zt=(0,W.Z)(Vt,(function(){var e=this,t=e._self._c;return t("div",{class:{"icon-loading":e.loading}},[e.error?t("div",{staticClass:"emptycontent",class:{emptyContentWithSections:e.sections.length>0}},[t("div",{staticClass:"icon icon-error"}),e._v(" "),t("h2",[e._v(e._s(e.error))])]):t("div",{staticClass:"sharingTab__content"},[e.isSharedWithMe?t("SharingEntrySimple",e._b({staticClass:"sharing-entry__reshare",scopedSlots:e._u([{key:"avatar",fn:function(){return[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{user:e.sharedWithMe.user,"display-name":e.sharedWithMe.displayName}})]},proxy:!0}],null,!1,3197855346)},"SharingEntrySimple",e.sharedWithMe,!1)):e._e(),e._v(" "),e.loading?e._e():t("SharingInput",{attrs:{"can-reshare":e.canReshare,"file-info":e.fileInfo,"link-shares":e.linkShares,reshare:e.reshare,shares:e.shares},on:{"add:share":e.addShare}}),e._v(" "),e.loading?e._e():t("SharingLinkList",{ref:"linkShareList",attrs:{"can-reshare":e.canReshare,"file-info":e.fileInfo,shares:e.linkShares}}),e._v(" "),e.loading?e._e():t("SharingList",{ref:"shareList",attrs:{shares:e.shares,"file-info":e.fileInfo}}),e._v(" "),e.canReshare&&!e.loading?t("SharingInherited",{attrs:{"file-info":e.fileInfo}}):e._e(),e._v(" "),t("SharingEntryInternal",{attrs:{"file-info":e.fileInfo}}),e._v(" "),e.projectsEnabled&&e.fileInfo?t("CollectionList",{attrs:{id:"".concat(e.fileInfo.id),type:"file",name:e.fileInfo.name}}):e._e()],1),e._v(" "),e._l(e.sections,(function(n,r){return t("div",{key:r,ref:"section-"+r,refInFor:!0,staticClass:"sharingTab__additionalContent"},[t(n(e.$refs["section-"+r],e.fileInfo),{tag:"component",attrs:{"file-info":e.fileInfo}})],1)}))],2)}),[],!1,null,"56c61b11",null).exports,Jt=r(25108);function Xt(e){return Xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xt(e)}function en(e,t){for(var n=0;n-1?(ln.error("An action with the same id ".concat(e.id," already exists"),e),!1):(this._state.actions.push(e),!0):(ln.error("Invalid action provided",e),!1)}}])&&hn(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function pn(e){return pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pn(e)}function gn(e,t){for(var n=0;n=a)&&Object.keys(i.O).every((function(e){return i.O[e](n[c])}))?n.splice(c--,1):(o=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[n,r,a]},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},i.j=7870,function(){i.b=document.baseURI||self.location.href;var e={7870:0};i.O.j=function(t){return 0===e[t]};var t=function(t,n){var r,a,s=n[0],o=n[1],c=n[2],l=0;if(s.some((function(t){return 0!==e[t]}))){for(r in o)i.o(o,r)&&(i.m[r]=o[r]);if(c)var u=c(i)}for(t&&t(n);l