summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js/dist/files_sharing_tab.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/js/dist/files_sharing_tab.js')
-rw-r--r--apps/files_sharing/js/dist/files_sharing_tab.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/files_sharing/js/dist/files_sharing_tab.js b/apps/files_sharing/js/dist/files_sharing_tab.js
index 462a32bd636..c9d71d7eb13 100644
--- a/apps/files_sharing/js/dist/files_sharing_tab.js
+++ b/apps/files_sharing/js/dist/files_sharing_tab.js
@@ -783,7 +783,7 @@ var R=function(){function t(){!function(t,e){if(!(t instanceof e))throw new Type
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- */var nt={mixins:[Y,g],props:{fileInfo:{type:Object,default:function(){},required:!0},share:{type:h,default:null}},data:function(){return{config:new R,errors:{},loading:!1,saving:!1,open:!1,updateQueue:new K.a({concurrency:1}),reactiveState:this.share&&this.share.state,SHARE_TYPES:{SHARE_TYPE_USER:OC.Share.SHARE_TYPE_USER,SHARE_TYPE_GROUP:OC.Share.SHARE_TYPE_GROUP,SHARE_TYPE_LINK:OC.Share.SHARE_TYPE_LINK,SHARE_TYPE_EMAIL:OC.Share.SHARE_TYPE_EMAIL,SHARE_TYPE_REMOTE:OC.Share.SHARE_TYPE_REMOTE,SHARE_TYPE_CIRCLE:OC.Share.SHARE_TYPE_CIRCLE,SHARE_TYPE_GUEST:OC.Share.SHARE_TYPE_GUEST,SHARE_TYPE_REMOTE_GROUP:OC.Share.SHARE_TYPE_REMOTE_GROUP,SHARE_TYPE_ROOM:OC.Share.SHARE_TYPE_ROOM}}},computed:{hasNote:{get:function(){return""!==this.share.note},set:function(t){this.share.note=t?null:""}},dateTomorrow:function(){return moment().add(1,"days")},firstDay:function(){return window.firstDay?window.firstDay:0},lang:function(){return{days:window.dayNamesShort?window.dayNamesShort:["Sun.","Mon.","Tue.","Wed.","Thu.","Fri.","Sat."],months:window.monthNamesShort?window.monthNamesShort:["Jan.","Feb.","Mar.","Apr.","May.","Jun.","Jul.","Aug.","Sep.","Oct.","Nov.","Dec."],placeholder:{date:"Select Date"}}},isShareOwner:function(){return this.share&&this.share.owner===Object(S.getCurrentUser)().uid}},methods:{checkShare:function(t){if(t.password&&("string"!=typeof t.password||""===t.password.trim()))return!1;if(t.expirationDate&&!moment(t.expirationDate).isValid())return!1;return!0},onExpirationChange:function(t){var e=moment(t).format("YYYY-MM-DD");this.share.expireDate=e,this.queueUpdate("expireDate")},onExpirationDisable:function(){this.share.expireDate="",this.queueUpdate("expireDate")},onNoteChange:function(t){this.$set(this.share,"newNote",t.trim())},onNoteSubmit:function(){this.share.newNote&&(this.share.note=this.share.newNote,this.$delete(this.share,"newNote"),this.queueUpdate("note"))},onDelete:function(){var t=this;return et(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.loading=!0,t.open=!1,e.next=5,t.deleteShare(t.share.id);case 5:console.debug("Share deleted",t.share.id),t.$emit("remove:share",t.share),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),t.open=!0;case 12:return e.prev=12,t.loading=!1,e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[0,9,12,15]])})))()},queueUpdate:function(t){var e=this;if(this.share.id){var n=this.share[t].toString();this.updateQueue.add(et(regeneratorRuntime.mark((function r(){var i,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e.saving=!0,e.errors={},r.prev=2,r.next=5,e.updateShare(e.share.id,{property:t,value:n});case 5:e.$delete(e.errors,t),e.$delete(e.share,"newPassword"),r.next=14;break;case 9:r.prev=9,r.t0=r.catch(2),i=r.t0.property,o=r.t0.message,e.onSyncError(i,o);case 14:return r.prev=14,e.saving=!1,r.finish(14);case 17:case"end":return r.stop()}}),r,null,[[2,9,14,17]])}))))}else console.error("Cannot update share.",this.share,"No valid id")},onSyncError:function(t,e){switch(this.open=!0,t){case"password":case"pending":case"expireDate":case"note":this.$set(this.errors,t,e);var n=this.$refs[t];if(n){n.$el&&(n=n.$el);var r=n.querySelector(".focusable");r&&r.focus()}}},debounceQueueUpdate:O()((function(t){this.queueUpdate(t)}),500)}},rt={name:"SharingEntryInherited",components:{ActionButton:V.a,ActionLink:b.a,ActionText:J.a,Avatar:s.a,SharingEntrySimple:_},mixins:[nt],props:{share:{type:h,required:!0}},computed:{fileTargetUrl:function(){return Object(o.generateUrl)("/f/{fileid}",{fileid:this.share.fileSource})}}},it=(r(542),Object(C.a)(rt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("SharingEntrySimple",{key:t.share.id,staticClass:"sharing-entry__inherited",attrs:{title:t.share.shareWithDisplayName},scopedSlots:t._u([{key:"avatar",fn:function(){return[n("Avatar",{staticClass:"sharing-entry__avatar",attrs:{user:t.share.shareWith,"display-name":t.share.shareWithDisplayName,"tooltip-message":""}})]},proxy:!0}])},[t._v(" "),n("ActionText",{attrs:{icon:"icon-user"}},[t._v("\n\t\t"+t._s(t.t("files_sharing","Added by {initiator}",{initiator:t.share.ownerDisplayName}))+"\n\t")]),t._v(" "),t.share.canDelete&&t.share.fileSource?n("ActionLink",{attrs:{icon:"icon-folder",href:t.fileTargetUrl}},[t._v("\n\t\t"+t._s(t.t("files_sharing","Via folder"))+"\n\t")]):t._e(),t._v(" "),t.share.canDelete?n("ActionButton",{attrs:{icon:"icon-close"},on:{click:function(e){return e.preventDefault(),t.onDelete(e)}}},[t._v("\n\t\t"+t._s(t.t("files_sharing","Unshare"))+"\n\t")]):t._e()],1)}),[],!1,null,"fc85e95a",null).exports);function ot(t,e,n,r,i,o,a){try{var s=t[o](a),A=s.value}catch(t){return void n(t)}s.done?e(A):Promise.resolve(A).then(r,i)}var at={name:"SharingInherited",components:{ActionButton:V.a,SharingEntryInherited:it,SharingEntrySimple:_},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=Object(o.generateOcsUrl)("apps/files_sharing/api/v1/shares/inherited?format=json&path=".concat(n.fullPath),2),e.next=5,c.a.get(r.replace(/\/$/,""));case 5:i=e.sent,n.shares=i.data.ocs.data.map((function(t){return new h(t)})).sort((function(t,e){return e.createdTime-t.createdTime})),console.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 o=e.apply(t,n);function a(t){ot(o,r,i,a,s,"next",t)}function s(t){ot(o,r,i,a,s,"throw",t)}a(void 0)}))})()},resetState:function(){this.loaded=!1,this.loading=!1,this.showInheritedShares=!1,this.shares=[]}}},st=(r(544),Object(C.a)(at,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",{attrs:{id:"sharing-inherited-shares"}},[n("SharingEntrySimple",{staticClass:"sharing-entry__inherited",attrs:{title:t.mainTitle,subtitle:t.subTitle},scopedSlots:t._u([{key:"avatar",fn:function(){return[n("div",{staticClass:"avatar-shared icon-more-white"})]},proxy:!0}])},[t._v(" "),n("ActionButton",{attrs:{icon:t.showInheritedSharesIcon},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.toggleInheritedShares(e)}}},[t._v("\n\t\t\t"+t._s(t.toggleTooltip)+"\n\t\t")])],1),t._v(" "),t._l(t.shares,(function(t){return n("SharingEntryInherited",{key:t.id,attrs:{share:t}})}))],2)}),[],!1,null,"d7cf4f50",null).exports),At=r(18),ct=r(247),ut=r.n(ct),lt=r(485),ft=r.n(lt),dt=r(248),pt=r.n(dt),ht=r(249),vt=r.n(ht);function gt(t){return(gt="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})(t)}function mt(t,e,n,r,i,o,a){try{var s=t[o](a),A=s.value}catch(t){return void n(t)}s.done?e(A):Promise.resolve(A).then(r,i)}function bt(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){mt(o,r,i,a,s,"next",t)}function s(t){mt(o,r,i,a,s,"throw",t)}a(void 0)}))}}var yt,xt,wt="abcdefgijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXYZ23456789",Et={name:"SharingEntryLink",components:{Actions:x.a,ActionButton:V.a,ActionCheckbox:ut.a,ActionRadio:ft.a,ActionInput:pt.a,ActionLink:b.a,ActionText:J.a,ActionTextEditable:vt.a,Avatar:s.a},directives:{Tooltip:E.a},mixins:[nt],props:{canReshare:{type:Boolean,default:!0}},data:function(){return{copySuccess:!0,copied:!1,publicUploadRWValue:OC.PERMISSION_UPDATE|OC.PERMISSION_CREATE|OC.PERMISSION_READ|OC.PERMISSION_DELETE,publicUploadRValue:OC.PERMISSION_READ,publicUploadWValue:OC.PERMISSION_CREATE,ExternalLinkActions:OCA.Sharing.ExternalLinkActions.state}},computed:{randomId:function(){return Math.random().toString(27).substr(2)},title:function(){if(this.share&&this.share.id){if(!this.isShareOwner&&this.share.ownerDisplayName)return t("files_sharing","Shared via link by {initiator}",{initiator:this.share.ownerDisplayName});if(this.share.label&&""!==this.share.label.trim())return this.share.label;if(this.isEmailShareType)return this.share.shareWith}return t("files_sharing","Share link")},hasExpirationDate:{get:function(){return this.config.isDefaultExpireDateEnforced||!!this.share.expireDate},set:function(t){this.share.expireDate=t?""!==this.config.defaultExpirationDateString?this.config.defaultExpirationDateString:moment().format("YYYY-MM-DD"):""}},dateMaxEnforced:function(){return this.config.isDefaultExpireDateEnforced&&moment().add(1+this.config.defaultExpireDate,"days")},isPasswordProtected:{get:function(){return this.config.enforcePasswordForPublicLink||!!this.share.password},set:(xt=bt(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=At.default,t.t1=this.share,!e){t.next=8;break}return t.next=5,this.generatePassword();case 5:t.t2=t.sent,t.next=9;break;case 8:t.t2="";case 9:t.t3=t.t2,t.t0.set.call(t.t0,t.t1,"password",t.t3),At.default.set(this.share,"newPassword",this.share.password);case 12:case"end":return t.stop()}}),t,this)}))),function(t){return xt.apply(this,arguments)})},isTalkEnabled:function(){return void 0!==OC.appswebroots.spreed},isPasswordProtectedByTalkAvailable:function(){return this.isPasswordProtected&&this.isTalkEnabled},isPasswordProtectedByTalk:{get:function(){return this.share.sendPasswordByTalk},set:(yt=bt(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.share.sendPasswordByTalk=e;case 1:case"end":return t.stop()}}),t,this)}))),function(t){return yt.apply(this,arguments)})},isEmailShareType:function(){return!!this.share&&this.share.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL},pendingPassword:function(){return this.config.enforcePasswordForPublicLink&&this.share&&!this.share.id},pendingExpirationDate:function(){return this.config.isDefaultExpireDateEnforced&&this.share&&!this.share.id},canUpdate:{get:function(){return this.share.hasUpdatePermission},set:function(t){this.share.permissions=t?OC.PERMISSION_READ|OC.PERMISSION_UPDATE:OC.PERMISSION_READ}},hasUnsavedPassword:function(){return void 0!==this.share.newPassword},isFolder:function(){return"dir"===this.fileInfo.type},fileHasCreatePermission:function(){return!!(this.fileInfo.permissions&OC.PERMISSION_CREATE)},shareLink:function(){return window.location.protocol+"//"+window.location.host+Object(o.generateUrl)("/s/")+this.share.token},clipboardTooltip:function(){return this.copied?this.copySuccess?t("files_sharing","Link copied"):t("files_sharing","Cannot copy, please copy the link manually"):t("files_sharing","Copy to clipboard")},externalActions:function(){return this.ExternalLinkActions.actions},isPasswordPolicyEnabled:function(){return"object"===gt(this.config.passwordPolicy)}},methods:{onNewLinkShare:function(){var e=this;return bt(regeneratorRuntime.mark((function n(){var r,i,o,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r={share_type:OC.Share.SHARE_TYPE_LINK},e.config.isDefaultExpireDateEnforced&&(r.expiration=e.config.defaultExpirationDateString),!e.config.enableLinkPasswordByDefault){n.next=6;break}return n.next=5,e.generatePassword();case 5:r.password=n.sent;case 6:if(!e.config.enforcePasswordForPublicLink&&!e.config.isDefaultExpireDateEnforced){n.next=31;break}if(e.loading=!0,!e.share||e.share.id){n.next=18;break}if(!e.checkShare(e.share)){n.next=15;break}return n.next=12,e.pushNewLinkShare(e.share,!0);case 12:return n.abrupt("return",!0);case 15:return e.open=!0,OC.Notification.showTemporary(t("files_sharing","Error, please enter proper password and/or expiration date")),n.abrupt("return",!1);case 18:if(!e.config.enforcePasswordForPublicLink){n.next=22;break}return n.next=21,e.generatePassword();case 21:r.password=n.sent;case 22:return i=new h(r),n.next=25,new Promise((function(t){e.$emit("add:share",i,t)}));case 25:o=n.sent,e.open=!1,e.loading=!1,o.open=!0,n.next=34;break;case 31:return a=new h(r),n.next=34,e.pushNewLinkShare(a);case 34:case"end":return n.stop()}}),n)})))()},pushNewLinkShare:function(t,e){var n=this;return bt(regeneratorRuntime.mark((function r(){var i,o,a,s,A;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,n.loading=!0,n.errors={},i=(n.fileInfo.path+"/"+n.fileInfo.name).replace("//","/"),r.next=6,n.createShare({path:i,shareType:OC.Share.SHARE_TYPE_LINK,password:t.password,expireDate:t.expireDate});case 6:if(o=r.sent,n.open=!1,console.debug("Link share created",o),!e){r.next=15;break}return r.next=12,new Promise((function(t){n.$emit("update:share",o,t)}));case 12:a=r.sent,r.next=18;break;case 15:return r.next=17,new Promise((function(t){n.$emit("add:share",o,t)}));case 17:a=r.sent;case 18:a.copyLink(),r.next=26;break;case 21:r.prev=21,r.t0=r.catch(0),s=r.t0.response,(A=s.data.ocs.meta.message).match(/password/i)?n.onSyncError("password",A):A.match(/date/i)?n.onSyncError("expireDate",A):n.onSyncError("pending",A);case 26:return r.prev=26,n.loading=!1,r.finish(26);case 29:case"end":return r.stop()}}),r,null,[[0,21,26,29]])})))()},togglePermissions:function(t){var e=parseInt(t.target.value,10);this.share.permissions=e,this.queueUpdate("permissions")},generatePassword:function(){var t=this;return bt(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.config.passwordPolicy.api||!t.config.passwordPolicy.api.generate){e.next=12;break}return e.prev=1,e.next=4,c.a.get(t.config.passwordPolicy.api.generate);case 4:if(!(n=e.sent).data.ocs.data.password){e.next=7;break}return e.abrupt("return",n.data.ocs.data.password);case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),console.info("Error generating password from password_policy",e.t0);case 12:return e.abrupt("return",Array(10).fill(0).reduce((function(t,e){return t+=wt.charAt(Math.floor(Math.random()*wt.length))}),""));case 13:case"end":return e.stop()}}),e,null,[[1,9]])})))()},copyLink:function(){var t=this;return bt(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.$copyText(t.shareLink);case 3:t.$refs.copyButton.$el.focus(),t.copySuccess=!0,t.copied=!0,e.next=13;break;case 8:e.prev=8,e.t0=e.catch(0),t.copySuccess=!1,t.copied=!0,console.error(e.t0);case 13:return e.prev=13,setTimeout((function(){t.copySuccess=!1,t.copied=!1}),4e3),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[0,8,13,16]])})))()},onPasswordChange:function(t){this.$set(this.share,"newPassword",t)},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"))},onMenuClose:function(){this.onPasswordSubmit(),this.onNoteSubmit()},onCancel:function(){this.$emit("remove:share",this.share)}}},It=(r(547),{name:"SharingLinkList",components:{SharingEntryLink:Object(C.a)(Et,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("li",{staticClass:"sharing-entry sharing-entry__link",class:{"sharing-entry--share":t.share}},[n("Avatar",{staticClass:"sharing-entry__avatar",class:t.isEmailShareType?"icon-mail-white":"icon-public-white",attrs:{"is-no-user":!0}}),t._v(" "),n("div",{staticClass:"sharing-entry__desc"},[n("h5",[t._v(t._s(t.title))])]),t._v(" "),t.share&&!t.isEmailShareType&&t.share.token?n("Actions",{ref:"copyButton",staticClass:"sharing-entry__copy"},[n("ActionLink",{attrs:{href:t.shareLink,target:"_blank",icon:t.copied&&t.copySuccess?"icon-checkmark-color":"icon-clippy"},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.copyLink(e)}}},[t._v("\n\t\t\t"+t._s(t.clipboardTooltip)+"\n\t\t")])],1):t._e(),t._v(" "),t.loading||!t.pendingPassword&&!t.pendingExpirationDate?t.loading?n("div",{staticClass:"icon-loading-small sharing-entry__loading"}):n("Actions",{staticClass:"sharing-entry__actions",attrs:{"menu-align":"right",open:t.open},on:{"update:open":function(e){t.open=e},close:t.onMenuClose}},[t.share?[t.share.canEdit?[t.isFolder&&t.fileHasCreatePermission&&t.config.isPublicUploadEnabled?[n("ActionRadio",{attrs:{checked:t.share.permissions===t.publicUploadRValue,value:t.publicUploadRValue,name:t.randomId,disabled:t.saving},on:{change:t.togglePermissions}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("files_sharing","Read only"))+"\n\t\t\t\t\t")]),t._v(" "),n("ActionRadio",{attrs:{checked:t.share.permissions===t.publicUploadRWValue,value:t.publicUploadRWValue,disabled:t.saving,name:t.randomId},on:{change:t.togglePermissions}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("files_sharing","Allow upload and editing"))+"\n\t\t\t\t\t")]),t._v(" "),n("ActionRadio",{staticClass:"sharing-entry__action--public-upload",attrs:{checked:t.share.permissions===t.publicUploadWValue,value:t.publicUploadWValue,disabled:t.saving,name:t.randomId},on:{change:t.togglePermissions}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("files_sharing","File drop (upload only)"))+"\n\t\t\t\t\t")])]:n("ActionCheckbox",{attrs:{checked:t.canUpdate,disabled:t.saving},on:{"update:checked":function(e){t.canUpdate=e},change:function(e){return t.queueUpdate("permissions")}}},[t._v("\n\t\t\t\t\t"+t._s(t.t("files_sharing","Allow editing"))+"\n\t\t\t\t")]),t._v(" "),n("ActionCheckbox",{attrs:{checked:t.share.hideDownload,disabled:t.saving},on:{"update:checked":function(e){return t.$set(t.share,"hideDownload",e)},change:function(e){return t.queueUpdate("hideDownload")}}},[t._v("\n\t\t\t\t\t"+t._s(t.t("files_sharing","Hide download"))+"\n\t\t\t\t")]),t._v(" "),n("ActionCheckbox",{staticClass:"share-link-password-checkbox",attrs:{checked:t.isPasswordProtected,disabled:t.config.enforcePasswordForPublicLink||t.saving},on:{"update:checked":function(e){t.isPasswordProtected=e},uncheck:t.onPasswordDisable}},[t._v("\n\t\t\t\t\t"+t._s(t.config.enforcePasswordForPublicLink?t.t("files_sharing","Password protection (enforced)"):t.t("files_sharing","Password protect"))+"\n\t\t\t\t")]),t._v(" "),t.isPasswordProtected?n("ActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:t.errors.password,show:t.errors.password,trigger:"manual",defaultContainer:"#app-sidebar"},expression:"{\n\t\t\t\t\t\tcontent: errors.password,\n\t\t\t\t\t\tshow: errors.password,\n\t\t\t\t\t\ttrigger: 'manual',\n\t\t\t\t\t\tdefaultContainer: '#app-sidebar'\n\t\t\t\t\t}",modifiers:{auto:!0}}],ref:"password",staticClass:"share-link-password",class:{error:t.errors.password},attrs:{disabled:t.saving,required:t.config.enforcePasswordForPublicLink,value:t.hasUnsavedPassword?t.share.newPassword:"***************",icon:"icon-password",autocomplete:"new-password",type:t.hasUnsavedPassword?"text":"password"},on:{"update:value":t.onPasswordChange,submit:t.onPasswordSubmit}},[t._v("\n\t\t\t\t\t"+t._s(t.t("files_sharing","Enter a password"))+"\n\t\t\t\t")]):t._e(),t._v(" "),t.isPasswordProtectedByTalkAvailable?n("ActionCheckbox",{staticClass:"share-link-password-talk-checkbox",attrs:{checked:t.isPasswordProtectedByTalk,disabled:t.saving},on:{"update:checked":function(e){t.isPasswordProtectedByTalk=e},change:function(e){return t.queueUpdate("sendPasswordByTalk")}}},[t._v("\n\t\t\t\t\t"+t._s(t.t("files_sharing","Video verification"))+"\n\t\t\t\t")]):t._e(),t._v(" "),n("ActionCheckbox",{staticClass:"share-link-expire-date-checkbox",attrs:{checked:t.hasExpirationDate,disabled:t.config.isDefaultExpireDateEnforced||t.saving},on:{"update:checked":function(e){t.hasExpirationDate=e},uncheck:t.onExpirationDisable}},[t._v("\n\t\t\t\t\t"+t._s(t.config.isDefaultExpireDateEnforced?t.t("files_sharing","Expiration date (enforced)"):t.t("files_sharing","Set expiration date"))+"\n\t\t\t\t")]),t._v(" "),t.hasExpirationDate?n("ActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:t.errors.expireDate,show:t.errors.expireDate,trigger:"manual",defaultContainer:"#app-sidebar"},expression:"{\n\t\t\t\t\t\tcontent: errors.expireDate,\n\t\t\t\t\t\tshow: errors.expireDate,\n\t\t\t\t\t\ttrigger: 'manual',\n\t\t\t\t\t\tdefaultContainer: '#app-sidebar'\n\t\t\t\t\t}",modifiers:{auto:!0}}],ref:"expireDate",staticClass:"share-link-expire-date",class:{error:t.errors.expireDate},attrs:{disabled:t.saving,"first-day-of-week":t.firstDay,lang:t.lang,value:t.share.expireDate,icon:"icon-calendar-dark",type:"date","not-before":t.dateTomorrow,"not-after":t.dateMaxEnforced},on:{"update:value":t.onExpirationChange}},[t._v("\n\t\t\t\t\t"+t._s(t.t("files_sharing","Enter a date"))+"\n\t\t\t\t")]):t._e(),t._v(" "),n("ActionCheckbox",{attrs:{checked:t.hasNote,disabled:t.saving},on:{"update:checked":function(e){t.hasNote=e},uncheck:function(e){return t.queueUpdate("note")}}},[t._v("\n\t\t\t\t\t"+t._s(t.t("files_sharing","Note to recipient"))+"\n\t\t\t\t")]),t._v(" "),t.hasNote?n("ActionTextEditable",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:t.errors.note,show:t.errors.note,trigger:"manual",defaultContainer:"#app-sidebar"},expression:"{\n\t\t\t\t\t\tcontent: errors.note,\n\t\t\t\t\t\tshow: errors.note,\n\t\t\t\t\t\ttrigger: 'manual',\n\t\t\t\t\t\tdefaultContainer: '#app-sidebar'\n\t\t\t\t\t}",modifiers:{auto:!0}}],ref:"note",class:{error:t.errors.note},attrs:{disabled:t.saving,placeholder:t.t("files_sharing","Enter a note for the share recipient"),value:t.share.newNote||t.share.note,icon:"icon-edit"},on:{"update:value":t.onNoteChange,submit:t.onNoteSubmit}}):t._e()]:t._e(),t._v(" "),t._l(t.externalActions,(function(e,r){var i=e.icon,o=e.url,a=e.name;return n("ActionLink",{key:r,attrs:{href:o(t.shareLink),icon:i,target:"_blank"}},[t._v("\n\t\t\t\t"+t._s(a)+"\n\t\t\t")])})),t._v(" "),t.share.canDelete?n("ActionButton",{attrs:{icon:"icon-close",disabled:t.saving},on:{click:function(e){return e.preventDefault(),t.onDelete(e)}}},[t._v("\n\t\t\t\t"+t._s(t.t("files_sharing","Unshare"))+"\n\t\t\t")]):t._e(),t._v(" "),!t.isEmailShareType&&t.canReshare?n("ActionButton",{staticClass:"new-share-link",attrs:{icon:"icon-add"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.onNewLinkShare(e)}}},[t._v("\n\t\t\t\t"+t._s(t.t("files_sharing","Add another link"))+"\n\t\t\t")]):t._e()]:t.canReshare?n("ActionButton",{staticClass:"new-share-link",attrs:{icon:"icon-add"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.onNewLinkShare(e)}}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Create a new share link"))+"\n\t\t")]):t._e()],2):n("Actions",{staticClass:"sharing-entry__actions",attrs:{"menu-align":"right",open:t.open},on:{"update:open":function(e){t.open=e},close:t.onNewLinkShare}},[t.errors.pending?n("ActionText",{class:{error:t.errors.pending},attrs:{icon:"icon-error"}},[t._v("\n\t\t\t"+t._s(t.errors.pending)+"\n\t\t")]):n("ActionText",{attrs:{icon:"icon-info"}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Please enter the following required information before creating the share"))+"\n\t\t")]),t._v(" "),t.pendingPassword?n("ActionText",{attrs:{icon:"icon-password"}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Password protection (enforced)"))+"\n\t\t")]):t.config.enableLinkPasswordByDefault?n("ActionCheckbox",{staticClass:"share-link-password-checkbox",attrs:{checked:t.isPasswordProtected,disabled:t.config.enforcePasswordForPublicLink||t.saving},on:{"update:checked":function(e){t.isPasswordProtected=e},uncheck:t.onPasswordDisable}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Password protection"))+"\n\t\t")]):t._e(),t._v(" "),t.pendingPassword||t.share.password?n("ActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:t.errors.password,show:t.errors.password,trigger:"manual",defaultContainer:"#app-sidebar"},expression:"{\n\t\t\t\tcontent: errors.password,\n\t\t\t\tshow: errors.password,\n\t\t\t\ttrigger: 'manual',\n\t\t\t\tdefaultContainer: '#app-sidebar'\n\t\t\t}",modifiers:{auto:!0}}],staticClass:"share-link-password",attrs:{value:t.share.password,disabled:t.saving,required:t.config.enableLinkPasswordByDefault||t.config.enforcePasswordForPublicLink,minlength:t.isPasswordPolicyEnabled&&t.config.passwordPolicy.minLength,icon:"",autocomplete:"new-password"},on:{"update:value":function(e){return t.$set(t.share,"password",e)},submit:t.onNewLinkShare}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Enter a password"))+"\n\t\t")]):t._e(),t._v(" "),t.pendingExpirationDate?n("ActionText",{attrs:{icon:"icon-calendar-dark"}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Expiration date (enforced)"))+"\n\t\t")]):t._e(),t._v(" "),t.pendingExpirationDate?n("ActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:t.errors.expireDate,show:t.errors.expireDate,trigger:"manual",defaultContainer:"#app-sidebar"},expression:"{\n\t\t\t\tcontent: errors.expireDate,\n\t\t\t\tshow: errors.expireDate,\n\t\t\t\ttrigger: 'manual',\n\t\t\t\tdefaultContainer: '#app-sidebar'\n\t\t\t}",modifiers:{auto:!0}}],staticClass:"share-link-expire-date",attrs:{disabled:t.saving,"first-day-of-week":t.firstDay,lang:t.lang,icon:"",type:"date","not-before":t.dateTomorrow,"not-after":t.dateMaxEnforced},model:{value:t.share.expireDate,callback:function(e){t.$set(t.share,"expireDate",e)},expression:"share.expireDate"}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Enter a date"))+"\n\t\t")]):t._e(),t._v(" "),n("ActionButton",{attrs:{icon:"icon-close"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.onCancel(e)}}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Cancel"))+"\n\t\t")])],1)],1)}),[],!1,null,"c6afd62a",null).exports},mixins:[g],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 t=this;return this.shares.filter((function(e){return e.type===t.SHARE_TYPES.SHARE_TYPE_LINK})).length>0},hasShares:function(){return this.shares.length>0}},methods:{addShare:function(t,e){this.shares.unshift(t),this.awaitForShare(t,e)},awaitForShare:function(t,e){var n=this;this.$nextTick((function(){var r=n.$children.find((function(e){return e.share===t}));r&&e(r)}))},removeShare:function(t){var e=this.shares.findIndex((function(e){return e===t}));this.shares.splice(e,1)}}}),Ct=Object(C.a)(It,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.canLinkShare?n("ul",{staticClass:"sharing-link-list"},[!t.hasLinkShares&&t.canReshare?n("SharingEntryLink",{attrs:{"can-reshare":t.canReshare,"file-info":t.fileInfo},on:{"add:share":t.addShare}}):t._e(),t._v(" "),t.hasShares?t._l(t.shares,(function(e,r){return n("SharingEntryLink",{key:e.id,attrs:{"can-reshare":t.canReshare,share:t.shares[r],"file-info":t.fileInfo},on:{"update:share":[function(e){return t.$set(t.shares,r,e)},function(e){return t.awaitForShare.apply(void 0,arguments)}],"add:share":function(e){return t.addShare.apply(void 0,arguments)},"remove:share":t.removeShare}})})):t._e()],2):t._e()}),[],!1,null,null,null).exports,_t={name:"SharingEntry",components:{Actions:x.a,ActionButton:V.a,ActionCheckbox:ut.a,ActionInput:pt.a,ActionTextEditable:vt.a,Avatar:s.a},directives:{Tooltip:E.a},mixins:[nt],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.owner};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.share.type!==this.SHARE_TYPES.SHARE_TYPE_REMOTE&&this.share.type!==this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP},canEdit:{get:function(){return this.share.hasUpdatePermission},set:function(t){this.updatePermissions({isEditChecked:t})}},canCreate:{get:function(){return this.share.hasCreatePermission},set:function(t){this.updatePermissions({isCreateChecked:t})}},canDelete:{get:function(){return this.share.hasDeletePermission},set:function(t){this.updatePermissions({isDeleteChecked:t})}},canReshare:{get:function(){return this.share.hasSharePermission},set:function(t){this.updatePermissions({isReshareChecked:t})}},isFolder:function(){return"dir"===this.fileInfo.type},hasExpirationDate:{get:function(){return this.config.isDefaultInternalExpireDateEnforced||!!this.share.expireDate},set:function(t){this.share.expireDate=t?""!==this.config.defaultInternalExpirationDateString?this.config.defaultInternalExpirationDateString:moment().format("YYYY-MM-DD"):""}},dateMaxEnforced:function(){return this.config.isDefaultInternalExpireDateEnforced&&moment().add(1+this.config.defaultInternalExpireDate,"days")}},methods:{updatePermissions:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.isEditChecked,n=void 0===e?this.canEdit:e,r=t.isCreateChecked,i=void 0===r?this.canCreate:r,o=t.isDeleteChecked,a=void 0===o?this.canDelete:o,s=t.isReshareChecked,A=void 0===s?this.canReshare:s,c=this.permissionsRead|(i?this.permissionsCreate:0)|(a?this.permissionsDelete:0)|(n?this.permissionsEdit:0)|(A?this.permissionsShare:0);this.share.permissions=c,this.queueUpdate("permissions")},onMenuClose:function(){this.onNoteSubmit()}}},Mt=(r(549),{name:"SharingList",components:{SharingEntry:Object(C.a)(_t,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("li",{staticClass:"sharing-entry"},[n("Avatar",{staticClass:"sharing-entry__avatar",attrs:{user:t.share.shareWith,"display-name":t.share.shareWithDisplayName,url:t.share.shareWithAvatar}}),t._v(" "),n("div",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.tooltip,expression:"tooltip",modifiers:{auto:!0}}],staticClass:"sharing-entry__desc"},[n("h5",[t._v(t._s(t.title))])]),t._v(" "),n("Actions",{staticClass:"sharing-entry__actions",attrs:{"menu-align":"right"},on:{close:t.onMenuClose}},[t.share.canEdit?[n("ActionCheckbox",{ref:"canEdit",attrs:{checked:t.canEdit,value:t.permissionsEdit,disabled:t.saving},on:{"update:checked":function(e){t.canEdit=e}}},[t._v("\n\t\t\t\t"+t._s(t.t("files_sharing","Allow editing"))+"\n\t\t\t")]),t._v(" "),t.isFolder?n("ActionCheckbox",{ref:"canCreate",attrs:{checked:t.canCreate,value:t.permissionsCreate,disabled:t.saving},on:{"update:checked":function(e){t.canCreate=e}}},[t._v("\n\t\t\t\t"+t._s(t.t("files_sharing","Allow creating"))+"\n\t\t\t")]):t._e(),t._v(" "),t.isFolder?n("ActionCheckbox",{ref:"canDelete",attrs:{checked:t.canDelete,value:t.permissionsDelete,disabled:t.saving},on:{"update:checked":function(e){t.canDelete=e}}},[t._v("\n\t\t\t\t"+t._s(t.t("files_sharing","Allow deleting"))+"\n\t\t\t")]):t._e(),t._v(" "),n("ActionCheckbox",{ref:"canReshare",attrs:{checked:t.canReshare,value:t.permissionsShare,disabled:t.saving},on:{"update:checked":function(e){t.canReshare=e}}},[t._v("\n\t\t\t\t"+t._s(t.t("files_sharing","Allow resharing"))+"\n\t\t\t")]),t._v(" "),n("ActionCheckbox",{attrs:{checked:t.hasExpirationDate,disabled:t.config.isDefaultExpireDateEnforced||t.saving},on:{"update:checked":function(e){t.hasExpirationDate=e},uncheck:t.onExpirationDisable}},[t._v("\n\t\t\t\t"+t._s(t.config.isDefaultExpireDateEnforced?t.t("files_sharing","Expiration date enforced"):t.t("files_sharing","Set expiration date"))+"\n\t\t\t")]),t._v(" "),t.hasExpirationDate?n("ActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:t.errors.expireDate,show:t.errors.expireDate,trigger:"manual"},expression:"{\n\t\t\t\t\tcontent: errors.expireDate,\n\t\t\t\t\tshow: errors.expireDate,\n\t\t\t\t\ttrigger: 'manual'\n\t\t\t\t}",modifiers:{auto:!0}}],ref:"expireDate",class:{error:t.errors.expireDate},attrs:{disabled:t.saving,"first-day-of-week":t.firstDay,lang:t.lang,value:t.share.expireDate,icon:"icon-calendar-dark",type:"date","not-before":t.dateTomorrow,"not-after":t.dateMaxEnforced},on:{"update:value":t.onExpirationChange}},[t._v("\n\t\t\t\t"+t._s(t.t("files_sharing","Enter a date"))+"\n\t\t\t")]):t._e(),t._v(" "),t.canHaveNote?[n("ActionCheckbox",{attrs:{checked:t.hasNote,disabled:t.saving},on:{"update:checked":function(e){t.hasNote=e},uncheck:function(e){return t.queueUpdate("note")}}},[t._v("\n\t\t\t\t\t"+t._s(t.t("files_sharing","Note to recipient"))+"\n\t\t\t\t")]),t._v(" "),t.hasNote?n("ActionTextEditable",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:t.errors.note,show:t.errors.note,trigger:"manual"},expression:"{\n\t\t\t\t\t\tcontent: errors.note,\n\t\t\t\t\t\tshow: errors.note,\n\t\t\t\t\t\ttrigger: 'manual'\n\t\t\t\t\t}",modifiers:{auto:!0}}],ref:"note",class:{error:t.errors.note},attrs:{disabled:t.saving,value:t.share.newNote||t.share.note,icon:"icon-edit"},on:{"update:value":t.onNoteChange,submit:t.onNoteSubmit}}):t._e()]:t._e()]:t._e(),t._v(" "),t.share.canDelete?n("ActionButton",{attrs:{icon:"icon-close",disabled:t.saving},on:{click:function(e){return e.preventDefault(),t.onDelete(e)}}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Unshare"))+"\n\t\t")]):t._e()],2)],1)}),[],!1,null,"2255c654",null).exports},props:{fileInfo:{type:Object,default:function(){},required:!0},shares:{type:Array,default:function(){return[]},required:!0}},computed:{hasShares:function(){return 0===this.shares.length}},methods:{removeShare:function(t){var e=this.shares.findIndex((function(e){return e===t}));this.shares.splice(e,1)}}}),Tt=Object(C.a)(Mt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",{staticClass:"sharing-sharee-list"},t._l(t.shares,(function(e){return n("SharingEntry",{key:e.id,attrs:{"file-info":t.fileInfo,share:e},on:{"remove:share":t.removeShare}})})),1)}),[],!1,null,null,null).exports;function Bt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function St(t,e,n,r,i,o,a){try{var s=t[o](a),A=s.value}catch(t){return void n(t)}s.done?e(A):Promise.resolve(A).then(r,i)}var Dt={name:"SharingTab",components:{Avatar:s.a,CollectionList:i.a,SharingEntryInternal:B,SharingEntrySimple:_,SharingInherited:st,SharingInput:W,SharingLinkList:Ct,SharingList:Tt,Tab:l.a},mixins:[g],props:{fileInfo:{type:Object,default:function(){},required:!0}},data:function(){return{error:"",expirationInterval:null,icon:"icon-share",loading:!0,name:t("files_sharing","Sharing"),reshare:null,sharedWithMe:{},shares:[],linkShares:[],sections:OCA.Sharing.ShareTabSections.getSections()}},computed:{id:function(){return"sharing"},activeTab:function(){return this.$parent.activeTab},isSharedWithMe:function(){return Object.keys(this.sharedWithMe).length>0},canReshare:function(){return!!(this.fileInfo.permissions&OC.PERMISSION_SHARE)||!(!this.reshare||!this.reshare.hasSharePermission)}},watch:{fileInfo:function(){this.resetState(),this.getShares()}},beforeMount:function(){this.getShares()},methods:{getShares:function(){var e,n=this;return(e=regeneratorRuntime.mark((function e(){var r,i,a,s,A,u,l,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n.loading=!0,r=Object(o.generateOcsUrl)("apps/files_sharing/api/v1",2)+"shares",i=(n.fileInfo.path+"/"+n.fileInfo.name).replace("//","/"),a=c.a.get(r,{params:{format:"json",path:i,reshares:!0}}),s=c.a.get(r,{params:{format:"json",path:i,shared_with_me:!0}}),e.next=9,Promise.all([a,s]);case 9:A=e.sent,u=Bt(A,2),l=u[0],f=u[1],n.loading=!1,n.processSharedWithMe(f),n.processShares(l),e.next=23;break;case 18:e.prev=18,e.t0=e.catch(0),n.error=t("files_sharing","Unable to load the shares list"),n.loading=!1,console.error("Error loading the shares list",e.t0);case 23:case"end":return e.stop()}}),e,null,[[0,18]])})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(t){St(o,r,i,a,s,"next",t)}function s(t){St(o,r,i,a,s,"throw",t)}a(void 0)}))})()},resetState:function(){clearInterval(this.expirationInterval),this.loading=!0,this.error="",this.sharedWithMe={},this.shares=[]},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(t){var e=this,n=t.data;if(n.ocs&&n.ocs.data&&n.ocs.data.length>0){var r=n.ocs.data.map((function(t){return new h(t)})).sort((function(t,e){return e.createdTime-t.createdTime}));this.linkShares=r.filter((function(t){return t.type===e.SHARE_TYPES.SHARE_TYPE_LINK||t.type===e.SHARE_TYPES.SHARE_TYPE_EMAIL})),this.shares=r.filter((function(t){return t.type!==e.SHARE_TYPES.SHARE_TYPE_LINK&&t.type!==e.SHARE_TYPES.SHARE_TYPE_EMAIL}))}},processSharedWithMe:function(e){var n=e.data;if(n.ocs&&n.ocs.data&&n.ocs.data[0]){var r=new h(n),i=function(e){return e.type===OC.Share.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===OC.Share.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===OC.Share.SHARE_TYPE_ROOM?this.model.get("reshare").share_with_displayname?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),o=r.ownerDisplayName,a=r.owner;this.sharedWithMe={displayName:o,title:i,user:a},this.reshare=r,r.expireDate&&moment(r.expireDate).unix()>moment().unix()&&(this.updateExpirationSubtitle(r),this.expirationInterval=setInterval(this.updateExpirationSubtitle,1e4,r))}},addShare:function(t){t.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL?this.linkShares.unshift(t):this.shares.unshift(t)}}},Ot=Object(C.a)(Dt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Tab",{class:{"icon-loading":t.loading},attrs:{id:t.id,icon:t.icon,name:t.name}},[t.error?n("div",{staticClass:"emptycontent"},[n("div",{staticClass:"icon icon-error"}),t._v(" "),n("h2",[t._v(t._s(t.error))])]):[t.isSharedWithMe?n("SharingEntrySimple",t._b({staticClass:"sharing-entry__reshare",scopedSlots:t._u([{key:"avatar",fn:function(){return[n("Avatar",{staticClass:"sharing-entry__avatar",attrs:{user:t.sharedWithMe.user,"display-name":t.sharedWithMe.displayName,"tooltip-message":""}})]},proxy:!0}],null,!1,1643724538)},"SharingEntrySimple",t.sharedWithMe,!1)):t._e(),t._v(" "),t.loading?t._e():n("SharingInput",{attrs:{"can-reshare":t.canReshare,"file-info":t.fileInfo,"link-shares":t.linkShares,reshare:t.reshare,shares:t.shares},on:{"add:share":t.addShare}}),t._v(" "),t.loading?t._e():n("SharingLinkList",{attrs:{"can-reshare":t.canReshare,"file-info":t.fileInfo,shares:t.linkShares}}),t._v(" "),t.loading?t._e():n("SharingList",{attrs:{shares:t.shares,"file-info":t.fileInfo}}),t._v(" "),t.canReshare&&!t.loading?n("SharingInherited",{attrs:{"file-info":t.fileInfo}}):t._e(),t._v(" "),n("SharingEntryInternal",{attrs:{"file-info":t.fileInfo}}),t._v(" "),t.fileInfo?n("CollectionList",{attrs:{id:""+t.fileInfo.id,type:"file",name:t.fileInfo.name}}):t._e(),t._v(" "),t._l(t.sections,(function(e,r){return n("div",{key:r,ref:"section-"+r,refInFor:!0,staticClass:"sharingTab__additionalContent"},[n(e(t.$refs["section-"+r],t.fileInfo),{tag:"component",attrs:{"file-info":t.fileInfo}})],1)}))]],2)}),[],!1,null,"21c3cddd",null).exports;function Nt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Lt(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var kt=0;
+ */var nt={mixins:[Y,g],props:{fileInfo:{type:Object,default:function(){},required:!0},share:{type:h,default:null}},data:function(){return{config:new R,errors:{},loading:!1,saving:!1,open:!1,updateQueue:new K.a({concurrency:1}),reactiveState:this.share&&this.share.state,SHARE_TYPES:{SHARE_TYPE_USER:OC.Share.SHARE_TYPE_USER,SHARE_TYPE_GROUP:OC.Share.SHARE_TYPE_GROUP,SHARE_TYPE_LINK:OC.Share.SHARE_TYPE_LINK,SHARE_TYPE_EMAIL:OC.Share.SHARE_TYPE_EMAIL,SHARE_TYPE_REMOTE:OC.Share.SHARE_TYPE_REMOTE,SHARE_TYPE_CIRCLE:OC.Share.SHARE_TYPE_CIRCLE,SHARE_TYPE_GUEST:OC.Share.SHARE_TYPE_GUEST,SHARE_TYPE_REMOTE_GROUP:OC.Share.SHARE_TYPE_REMOTE_GROUP,SHARE_TYPE_ROOM:OC.Share.SHARE_TYPE_ROOM}}},computed:{hasNote:{get:function(){return""!==this.share.note},set:function(t){this.share.note=t?null:""}},dateTomorrow:function(){return moment().add(1,"days")},firstDay:function(){return window.firstDay?window.firstDay:0},lang:function(){return{days:window.dayNamesShort?window.dayNamesShort:["Sun.","Mon.","Tue.","Wed.","Thu.","Fri.","Sat."],months:window.monthNamesShort?window.monthNamesShort:["Jan.","Feb.","Mar.","Apr.","May.","Jun.","Jul.","Aug.","Sep.","Oct.","Nov.","Dec."],placeholder:{date:"Select Date"}}},isShareOwner:function(){return this.share&&this.share.owner===Object(S.getCurrentUser)().uid}},methods:{checkShare:function(t){if(t.password&&("string"!=typeof t.password||""===t.password.trim()))return!1;if(t.expirationDate&&!moment(t.expirationDate).isValid())return!1;return!0},onExpirationChange:function(t){var e=moment(t).format("YYYY-MM-DD");this.share.expireDate=e,this.queueUpdate("expireDate")},onExpirationDisable:function(){this.share.expireDate="",this.queueUpdate("expireDate")},onNoteChange:function(t){this.$set(this.share,"newNote",t.trim())},onNoteSubmit:function(){this.share.newNote&&(this.share.note=this.share.newNote,this.$delete(this.share,"newNote"),this.queueUpdate("note"))},onDelete:function(){var t=this;return et(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.loading=!0,t.open=!1,e.next=5,t.deleteShare(t.share.id);case 5:console.debug("Share deleted",t.share.id),t.$emit("remove:share",t.share),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),t.open=!0;case 12:return e.prev=12,t.loading=!1,e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[0,9,12,15]])})))()},queueUpdate:function(t){var e=this;if(this.share.id){var n=this.share[t].toString();this.updateQueue.add(et(regeneratorRuntime.mark((function r(){var i,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e.saving=!0,e.errors={},r.prev=2,r.next=5,e.updateShare(e.share.id,{property:t,value:n});case 5:e.$delete(e.errors,t),e.$delete(e.share,"newPassword"),r.next=14;break;case 9:r.prev=9,r.t0=r.catch(2),i=r.t0.property,o=r.t0.message,e.onSyncError(i,o);case 14:return r.prev=14,e.saving=!1,r.finish(14);case 17:case"end":return r.stop()}}),r,null,[[2,9,14,17]])}))))}else console.error("Cannot update share.",this.share,"No valid id")},onSyncError:function(t,e){switch(this.open=!0,t){case"password":case"pending":case"expireDate":case"note":this.$set(this.errors,t,e);var n=this.$refs[t];if(n){n.$el&&(n=n.$el);var r=n.querySelector(".focusable");r&&r.focus()}}},debounceQueueUpdate:O()((function(t){this.queueUpdate(t)}),500)}},rt={name:"SharingEntryInherited",components:{ActionButton:V.a,ActionLink:b.a,ActionText:J.a,Avatar:s.a,SharingEntrySimple:_},mixins:[nt],props:{share:{type:h,required:!0}},computed:{fileTargetUrl:function(){return Object(o.generateUrl)("/f/{fileid}",{fileid:this.share.fileSource})}}},it=(r(542),Object(C.a)(rt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("SharingEntrySimple",{key:t.share.id,staticClass:"sharing-entry__inherited",attrs:{title:t.share.shareWithDisplayName},scopedSlots:t._u([{key:"avatar",fn:function(){return[n("Avatar",{staticClass:"sharing-entry__avatar",attrs:{user:t.share.shareWith,"display-name":t.share.shareWithDisplayName,"tooltip-message":""}})]},proxy:!0}])},[t._v(" "),n("ActionText",{attrs:{icon:"icon-user"}},[t._v("\n\t\t"+t._s(t.t("files_sharing","Added by {initiator}",{initiator:t.share.ownerDisplayName}))+"\n\t")]),t._v(" "),t.share.canDelete&&t.share.fileSource?n("ActionLink",{attrs:{icon:"icon-folder",href:t.fileTargetUrl}},[t._v("\n\t\t"+t._s(t.t("files_sharing","Via folder"))+"\n\t")]):t._e(),t._v(" "),t.share.canDelete?n("ActionButton",{attrs:{icon:"icon-close"},on:{click:function(e){return e.preventDefault(),t.onDelete(e)}}},[t._v("\n\t\t"+t._s(t.t("files_sharing","Unshare"))+"\n\t")]):t._e()],1)}),[],!1,null,"fc85e95a",null).exports);function ot(t,e,n,r,i,o,a){try{var s=t[o](a),A=s.value}catch(t){return void n(t)}s.done?e(A):Promise.resolve(A).then(r,i)}var at={name:"SharingInherited",components:{ActionButton:V.a,SharingEntryInherited:it,SharingEntrySimple:_},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=Object(o.generateOcsUrl)("apps/files_sharing/api/v1/shares/inherited?format=json&path=".concat(n.fullPath),2),e.next=5,c.a.get(r.replace(/\/$/,""));case 5:i=e.sent,n.shares=i.data.ocs.data.map((function(t){return new h(t)})).sort((function(t,e){return e.createdTime-t.createdTime})),console.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 o=e.apply(t,n);function a(t){ot(o,r,i,a,s,"next",t)}function s(t){ot(o,r,i,a,s,"throw",t)}a(void 0)}))})()},resetState:function(){this.loaded=!1,this.loading=!1,this.showInheritedShares=!1,this.shares=[]}}},st=(r(544),Object(C.a)(at,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",{attrs:{id:"sharing-inherited-shares"}},[n("SharingEntrySimple",{staticClass:"sharing-entry__inherited",attrs:{title:t.mainTitle,subtitle:t.subTitle},scopedSlots:t._u([{key:"avatar",fn:function(){return[n("div",{staticClass:"avatar-shared icon-more-white"})]},proxy:!0}])},[t._v(" "),n("ActionButton",{attrs:{icon:t.showInheritedSharesIcon},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.toggleInheritedShares(e)}}},[t._v("\n\t\t\t"+t._s(t.toggleTooltip)+"\n\t\t")])],1),t._v(" "),t._l(t.shares,(function(t){return n("SharingEntryInherited",{key:t.id,attrs:{share:t}})}))],2)}),[],!1,null,"d7cf4f50",null).exports),At=r(18),ct=r(247),ut=r.n(ct),lt=r(485),ft=r.n(lt),dt=r(248),pt=r.n(dt),ht=r(249),vt=r.n(ht);function gt(t){return(gt="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})(t)}function mt(t,e,n,r,i,o,a){try{var s=t[o](a),A=s.value}catch(t){return void n(t)}s.done?e(A):Promise.resolve(A).then(r,i)}function bt(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){mt(o,r,i,a,s,"next",t)}function s(t){mt(o,r,i,a,s,"throw",t)}a(void 0)}))}}var yt,xt,wt="abcdefgijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXYZ23456789",Et={name:"SharingEntryLink",components:{Actions:x.a,ActionButton:V.a,ActionCheckbox:ut.a,ActionRadio:ft.a,ActionInput:pt.a,ActionLink:b.a,ActionText:J.a,ActionTextEditable:vt.a,Avatar:s.a},directives:{Tooltip:E.a},mixins:[nt],props:{canReshare:{type:Boolean,default:!0}},data:function(){return{copySuccess:!0,copied:!1,publicUploadRWValue:OC.PERMISSION_UPDATE|OC.PERMISSION_CREATE|OC.PERMISSION_READ|OC.PERMISSION_DELETE,publicUploadRValue:OC.PERMISSION_READ,publicUploadWValue:OC.PERMISSION_CREATE,ExternalLinkActions:OCA.Sharing.ExternalLinkActions.state}},computed:{randomId:function(){return Math.random().toString(27).substr(2)},title:function(){if(this.share&&this.share.id){if(!this.isShareOwner&&this.share.ownerDisplayName)return t("files_sharing","Shared via link by {initiator}",{initiator:this.share.ownerDisplayName});if(this.share.label&&""!==this.share.label.trim())return this.share.label;if(this.isEmailShareType)return this.share.shareWith}return t("files_sharing","Share link")},hasExpirationDate:{get:function(){return this.config.isDefaultExpireDateEnforced||!!this.share.expireDate},set:function(t){this.share.expireDate=t?""!==this.config.defaultExpirationDateString?this.config.defaultExpirationDateString:moment().format("YYYY-MM-DD"):""}},dateMaxEnforced:function(){return this.config.isDefaultExpireDateEnforced&&moment().add(1+this.config.defaultExpireDate,"days")},isPasswordProtected:{get:function(){return this.config.enforcePasswordForPublicLink||!!this.share.password},set:(xt=bt(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=At.default,t.t1=this.share,!e){t.next=8;break}return t.next=5,this.generatePassword();case 5:t.t2=t.sent,t.next=9;break;case 8:t.t2="";case 9:t.t3=t.t2,t.t0.set.call(t.t0,t.t1,"password",t.t3),At.default.set(this.share,"newPassword",this.share.password);case 12:case"end":return t.stop()}}),t,this)}))),function(t){return xt.apply(this,arguments)})},isTalkEnabled:function(){return void 0!==OC.appswebroots.spreed},isPasswordProtectedByTalkAvailable:function(){return this.isPasswordProtected&&this.isTalkEnabled},isPasswordProtectedByTalk:{get:function(){return this.share.sendPasswordByTalk},set:(yt=bt(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.share.sendPasswordByTalk=e;case 1:case"end":return t.stop()}}),t,this)}))),function(t){return yt.apply(this,arguments)})},isEmailShareType:function(){return!!this.share&&this.share.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL},pendingPassword:function(){return this.config.enforcePasswordForPublicLink&&this.share&&!this.share.id},pendingExpirationDate:function(){return this.config.isDefaultExpireDateEnforced&&this.share&&!this.share.id},canUpdate:{get:function(){return this.share.hasUpdatePermission},set:function(t){this.share.permissions=t?OC.PERMISSION_READ|OC.PERMISSION_UPDATE:OC.PERMISSION_READ}},hasUnsavedPassword:function(){return void 0!==this.share.newPassword},isFolder:function(){return"dir"===this.fileInfo.type},fileHasCreatePermission:function(){return!!(this.fileInfo.permissions&OC.PERMISSION_CREATE)},shareLink:function(){return window.location.protocol+"//"+window.location.host+Object(o.generateUrl)("/s/")+this.share.token},clipboardTooltip:function(){return this.copied?this.copySuccess?t("files_sharing","Link copied"):t("files_sharing","Cannot copy, please copy the link manually"):t("files_sharing","Copy to clipboard")},externalActions:function(){return this.ExternalLinkActions.actions},isPasswordPolicyEnabled:function(){return"object"===gt(this.config.passwordPolicy)}},methods:{onNewLinkShare:function(){var e=this;return bt(regeneratorRuntime.mark((function n(){var r,i,o,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r={share_type:OC.Share.SHARE_TYPE_LINK},e.config.isDefaultExpireDateEnforced&&(r.expiration=e.config.defaultExpirationDateString),!e.config.enableLinkPasswordByDefault){n.next=6;break}return n.next=5,e.generatePassword();case 5:r.password=n.sent;case 6:if(!e.config.enforcePasswordForPublicLink&&!e.config.isDefaultExpireDateEnforced){n.next=31;break}if(e.loading=!0,!e.share||e.share.id){n.next=18;break}if(!e.checkShare(e.share)){n.next=15;break}return n.next=12,e.pushNewLinkShare(e.share,!0);case 12:return n.abrupt("return",!0);case 15:return e.open=!0,OC.Notification.showTemporary(t("files_sharing","Error, please enter proper password and/or expiration date")),n.abrupt("return",!1);case 18:if(!e.config.enforcePasswordForPublicLink){n.next=22;break}return n.next=21,e.generatePassword();case 21:r.password=n.sent;case 22:return i=new h(r),n.next=25,new Promise((function(t){e.$emit("add:share",i,t)}));case 25:o=n.sent,e.open=!1,e.loading=!1,o.open=!0,n.next=34;break;case 31:return a=new h(r),n.next=34,e.pushNewLinkShare(a);case 34:case"end":return n.stop()}}),n)})))()},pushNewLinkShare:function(t,e){var n=this;return bt(regeneratorRuntime.mark((function r(){var i,o,a,s,A;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,n.loading=!0,n.errors={},i=(n.fileInfo.path+"/"+n.fileInfo.name).replace("//","/"),r.next=6,n.createShare({path:i,shareType:OC.Share.SHARE_TYPE_LINK,password:t.password,expireDate:t.expireDate});case 6:if(o=r.sent,n.open=!1,console.debug("Link share created",o),!e){r.next=15;break}return r.next=12,new Promise((function(t){n.$emit("update:share",o,t)}));case 12:a=r.sent,r.next=18;break;case 15:return r.next=17,new Promise((function(t){n.$emit("add:share",o,t)}));case 17:a=r.sent;case 18:a.copyLink(),r.next=26;break;case 21:r.prev=21,r.t0=r.catch(0),s=r.t0.response,(A=s.data.ocs.meta.message).match(/password/i)?n.onSyncError("password",A):A.match(/date/i)?n.onSyncError("expireDate",A):n.onSyncError("pending",A);case 26:return r.prev=26,n.loading=!1,r.finish(26);case 29:case"end":return r.stop()}}),r,null,[[0,21,26,29]])})))()},togglePermissions:function(t){var e=parseInt(t.target.value,10);this.share.permissions=e,this.queueUpdate("permissions")},generatePassword:function(){var t=this;return bt(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.config.passwordPolicy.api||!t.config.passwordPolicy.api.generate){e.next=12;break}return e.prev=1,e.next=4,c.a.get(t.config.passwordPolicy.api.generate);case 4:if(!(n=e.sent).data.ocs.data.password){e.next=7;break}return e.abrupt("return",n.data.ocs.data.password);case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),console.info("Error generating password from password_policy",e.t0);case 12:return e.abrupt("return",Array(10).fill(0).reduce((function(t,e){return t+=wt.charAt(Math.floor(Math.random()*wt.length))}),""));case 13:case"end":return e.stop()}}),e,null,[[1,9]])})))()},copyLink:function(){var t=this;return bt(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.$copyText(t.shareLink);case 3:t.$refs.copyButton.$el.focus(),t.copySuccess=!0,t.copied=!0,e.next=13;break;case 8:e.prev=8,e.t0=e.catch(0),t.copySuccess=!1,t.copied=!0,console.error(e.t0);case 13:return e.prev=13,setTimeout((function(){t.copySuccess=!1,t.copied=!1}),4e3),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[0,8,13,16]])})))()},onPasswordChange:function(t){this.$set(this.share,"newPassword",t)},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"))},onMenuClose:function(){this.onPasswordSubmit(),this.onNoteSubmit()},onCancel:function(){this.$emit("remove:share",this.share)}}},It=(r(547),{name:"SharingLinkList",components:{SharingEntryLink:Object(C.a)(Et,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("li",{staticClass:"sharing-entry sharing-entry__link",class:{"sharing-entry--share":t.share}},[n("Avatar",{staticClass:"sharing-entry__avatar",class:t.isEmailShareType?"icon-mail-white":"icon-public-white",attrs:{"is-no-user":!0}}),t._v(" "),n("div",{staticClass:"sharing-entry__desc"},[n("h5",[t._v(t._s(t.title))])]),t._v(" "),t.share&&!t.isEmailShareType&&t.share.token?n("Actions",{ref:"copyButton",staticClass:"sharing-entry__copy"},[n("ActionLink",{attrs:{href:t.shareLink,target:"_blank",icon:t.copied&&t.copySuccess?"icon-checkmark-color":"icon-clippy"},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.copyLink(e)}}},[t._v("\n\t\t\t"+t._s(t.clipboardTooltip)+"\n\t\t")])],1):t._e(),t._v(" "),t.loading||!t.pendingPassword&&!t.pendingExpirationDate?t.loading?n("div",{staticClass:"icon-loading-small sharing-entry__loading"}):n("Actions",{staticClass:"sharing-entry__actions",attrs:{"menu-align":"right",open:t.open},on:{"update:open":function(e){t.open=e},close:t.onMenuClose}},[t.share?[t.share.canEdit?[t.isFolder&&t.fileHasCreatePermission&&t.config.isPublicUploadEnabled?[n("ActionRadio",{attrs:{checked:t.share.permissions===t.publicUploadRValue,value:t.publicUploadRValue,name:t.randomId,disabled:t.saving},on:{change:t.togglePermissions}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("files_sharing","Read only"))+"\n\t\t\t\t\t")]),t._v(" "),n("ActionRadio",{attrs:{checked:t.share.permissions===t.publicUploadRWValue,value:t.publicUploadRWValue,disabled:t.saving,name:t.randomId},on:{change:t.togglePermissions}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("files_sharing","Allow upload and editing"))+"\n\t\t\t\t\t")]),t._v(" "),n("ActionRadio",{staticClass:"sharing-entry__action--public-upload",attrs:{checked:t.share.permissions===t.publicUploadWValue,value:t.publicUploadWValue,disabled:t.saving,name:t.randomId},on:{change:t.togglePermissions}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("files_sharing","File drop (upload only)"))+"\n\t\t\t\t\t")])]:n("ActionCheckbox",{attrs:{checked:t.canUpdate,disabled:t.saving},on:{"update:checked":function(e){t.canUpdate=e},change:function(e){return t.queueUpdate("permissions")}}},[t._v("\n\t\t\t\t\t"+t._s(t.t("files_sharing","Allow editing"))+"\n\t\t\t\t")]),t._v(" "),n("ActionCheckbox",{attrs:{checked:t.share.hideDownload,disabled:t.saving},on:{"update:checked":function(e){return t.$set(t.share,"hideDownload",e)},change:function(e){return t.queueUpdate("hideDownload")}}},[t._v("\n\t\t\t\t\t"+t._s(t.t("files_sharing","Hide download"))+"\n\t\t\t\t")]),t._v(" "),n("ActionCheckbox",{staticClass:"share-link-password-checkbox",attrs:{checked:t.isPasswordProtected,disabled:t.config.enforcePasswordForPublicLink||t.saving},on:{"update:checked":function(e){t.isPasswordProtected=e},uncheck:t.onPasswordDisable}},[t._v("\n\t\t\t\t\t"+t._s(t.config.enforcePasswordForPublicLink?t.t("files_sharing","Password protection (enforced)"):t.t("files_sharing","Password protect"))+"\n\t\t\t\t")]),t._v(" "),t.isPasswordProtected?n("ActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:t.errors.password,show:t.errors.password,trigger:"manual",defaultContainer:"#app-sidebar"},expression:"{\n\t\t\t\t\t\tcontent: errors.password,\n\t\t\t\t\t\tshow: errors.password,\n\t\t\t\t\t\ttrigger: 'manual',\n\t\t\t\t\t\tdefaultContainer: '#app-sidebar'\n\t\t\t\t\t}",modifiers:{auto:!0}}],ref:"password",staticClass:"share-link-password",class:{error:t.errors.password},attrs:{disabled:t.saving,required:t.config.enforcePasswordForPublicLink,value:t.hasUnsavedPassword?t.share.newPassword:"***************",icon:"icon-password",autocomplete:"new-password",type:t.hasUnsavedPassword?"text":"password"},on:{"update:value":t.onPasswordChange,submit:t.onPasswordSubmit}},[t._v("\n\t\t\t\t\t"+t._s(t.t("files_sharing","Enter a password"))+"\n\t\t\t\t")]):t._e(),t._v(" "),t.isPasswordProtectedByTalkAvailable?n("ActionCheckbox",{staticClass:"share-link-password-talk-checkbox",attrs:{checked:t.isPasswordProtectedByTalk,disabled:t.saving},on:{"update:checked":function(e){t.isPasswordProtectedByTalk=e},change:function(e){return t.queueUpdate("sendPasswordByTalk")}}},[t._v("\n\t\t\t\t\t"+t._s(t.t("files_sharing","Video verification"))+"\n\t\t\t\t")]):t._e(),t._v(" "),n("ActionCheckbox",{staticClass:"share-link-expire-date-checkbox",attrs:{checked:t.hasExpirationDate,disabled:t.config.isDefaultExpireDateEnforced||t.saving},on:{"update:checked":function(e){t.hasExpirationDate=e},uncheck:t.onExpirationDisable}},[t._v("\n\t\t\t\t\t"+t._s(t.config.isDefaultExpireDateEnforced?t.t("files_sharing","Expiration date (enforced)"):t.t("files_sharing","Set expiration date"))+"\n\t\t\t\t")]),t._v(" "),t.hasExpirationDate?n("ActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:t.errors.expireDate,show:t.errors.expireDate,trigger:"manual",defaultContainer:"#app-sidebar"},expression:"{\n\t\t\t\t\t\tcontent: errors.expireDate,\n\t\t\t\t\t\tshow: errors.expireDate,\n\t\t\t\t\t\ttrigger: 'manual',\n\t\t\t\t\t\tdefaultContainer: '#app-sidebar'\n\t\t\t\t\t}",modifiers:{auto:!0}}],ref:"expireDate",staticClass:"share-link-expire-date",class:{error:t.errors.expireDate},attrs:{disabled:t.saving,"first-day-of-week":t.firstDay,lang:t.lang,value:t.share.expireDate,icon:"icon-calendar-dark",type:"date","not-before":t.dateTomorrow,"not-after":t.dateMaxEnforced},on:{"update:value":t.onExpirationChange}},[t._v("\n\t\t\t\t\t"+t._s(t.t("files_sharing","Enter a date"))+"\n\t\t\t\t")]):t._e(),t._v(" "),n("ActionCheckbox",{attrs:{checked:t.hasNote,disabled:t.saving},on:{"update:checked":function(e){t.hasNote=e},uncheck:function(e){return t.queueUpdate("note")}}},[t._v("\n\t\t\t\t\t"+t._s(t.t("files_sharing","Note to recipient"))+"\n\t\t\t\t")]),t._v(" "),t.hasNote?n("ActionTextEditable",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:t.errors.note,show:t.errors.note,trigger:"manual",defaultContainer:"#app-sidebar"},expression:"{\n\t\t\t\t\t\tcontent: errors.note,\n\t\t\t\t\t\tshow: errors.note,\n\t\t\t\t\t\ttrigger: 'manual',\n\t\t\t\t\t\tdefaultContainer: '#app-sidebar'\n\t\t\t\t\t}",modifiers:{auto:!0}}],ref:"note",class:{error:t.errors.note},attrs:{disabled:t.saving,placeholder:t.t("files_sharing","Enter a note for the share recipient"),value:t.share.newNote||t.share.note,icon:"icon-edit"},on:{"update:value":t.onNoteChange,submit:t.onNoteSubmit}}):t._e()]:t._e(),t._v(" "),t._l(t.externalActions,(function(e,r){var i=e.icon,o=e.url,a=e.name;return n("ActionLink",{key:r,attrs:{href:o(t.shareLink),icon:i,target:"_blank"}},[t._v("\n\t\t\t\t"+t._s(a)+"\n\t\t\t")])})),t._v(" "),t.share.canDelete?n("ActionButton",{attrs:{icon:"icon-close",disabled:t.saving},on:{click:function(e){return e.preventDefault(),t.onDelete(e)}}},[t._v("\n\t\t\t\t"+t._s(t.t("files_sharing","Unshare"))+"\n\t\t\t")]):t._e(),t._v(" "),!t.isEmailShareType&&t.canReshare?n("ActionButton",{staticClass:"new-share-link",attrs:{icon:"icon-add"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.onNewLinkShare(e)}}},[t._v("\n\t\t\t\t"+t._s(t.t("files_sharing","Add another link"))+"\n\t\t\t")]):t._e()]:t.canReshare?n("ActionButton",{staticClass:"new-share-link",attrs:{icon:"icon-add"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.onNewLinkShare(e)}}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Create a new share link"))+"\n\t\t")]):t._e()],2):n("Actions",{staticClass:"sharing-entry__actions",attrs:{"menu-align":"right",open:t.open},on:{"update:open":function(e){t.open=e},close:t.onNewLinkShare}},[t.errors.pending?n("ActionText",{class:{error:t.errors.pending},attrs:{icon:"icon-error"}},[t._v("\n\t\t\t"+t._s(t.errors.pending)+"\n\t\t")]):n("ActionText",{attrs:{icon:"icon-info"}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Please enter the following required information before creating the share"))+"\n\t\t")]),t._v(" "),t.pendingPassword?n("ActionText",{attrs:{icon:"icon-password"}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Password protection (enforced)"))+"\n\t\t")]):t.config.enableLinkPasswordByDefault?n("ActionCheckbox",{staticClass:"share-link-password-checkbox",attrs:{checked:t.isPasswordProtected,disabled:t.config.enforcePasswordForPublicLink||t.saving},on:{"update:checked":function(e){t.isPasswordProtected=e},uncheck:t.onPasswordDisable}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Password protection"))+"\n\t\t")]):t._e(),t._v(" "),t.pendingPassword||t.share.password?n("ActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:t.errors.password,show:t.errors.password,trigger:"manual",defaultContainer:"#app-sidebar"},expression:"{\n\t\t\t\tcontent: errors.password,\n\t\t\t\tshow: errors.password,\n\t\t\t\ttrigger: 'manual',\n\t\t\t\tdefaultContainer: '#app-sidebar'\n\t\t\t}",modifiers:{auto:!0}}],staticClass:"share-link-password",attrs:{value:t.share.password,disabled:t.saving,required:t.config.enableLinkPasswordByDefault||t.config.enforcePasswordForPublicLink,minlength:t.isPasswordPolicyEnabled&&t.config.passwordPolicy.minLength,icon:"",autocomplete:"new-password"},on:{"update:value":function(e){return t.$set(t.share,"password",e)},submit:t.onNewLinkShare}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Enter a password"))+"\n\t\t")]):t._e(),t._v(" "),t.pendingExpirationDate?n("ActionText",{attrs:{icon:"icon-calendar-dark"}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Expiration date (enforced)"))+"\n\t\t")]):t._e(),t._v(" "),t.pendingExpirationDate?n("ActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:t.errors.expireDate,show:t.errors.expireDate,trigger:"manual",defaultContainer:"#app-sidebar"},expression:"{\n\t\t\t\tcontent: errors.expireDate,\n\t\t\t\tshow: errors.expireDate,\n\t\t\t\ttrigger: 'manual',\n\t\t\t\tdefaultContainer: '#app-sidebar'\n\t\t\t}",modifiers:{auto:!0}}],staticClass:"share-link-expire-date",attrs:{disabled:t.saving,"first-day-of-week":t.firstDay,lang:t.lang,icon:"",type:"date","not-before":t.dateTomorrow,"not-after":t.dateMaxEnforced},model:{value:t.share.expireDate,callback:function(e){t.$set(t.share,"expireDate",e)},expression:"share.expireDate"}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Enter a date"))+"\n\t\t")]):t._e(),t._v(" "),n("ActionButton",{attrs:{icon:"icon-close"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.onCancel(e)}}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Cancel"))+"\n\t\t")])],1)],1)}),[],!1,null,"c6afd62a",null).exports},mixins:[g],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 t=this;return this.shares.filter((function(e){return e.type===t.SHARE_TYPES.SHARE_TYPE_LINK})).length>0},hasShares:function(){return this.shares.length>0}},methods:{addShare:function(t,e){this.shares.unshift(t),this.awaitForShare(t,e)},awaitForShare:function(t,e){var n=this;this.$nextTick((function(){var r=n.$children.find((function(e){return e.share===t}));r&&e(r)}))},removeShare:function(t){var e=this.shares.findIndex((function(e){return e===t}));this.shares.splice(e,1)}}}),Ct=Object(C.a)(It,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.canLinkShare?n("ul",{staticClass:"sharing-link-list"},[!t.hasLinkShares&&t.canReshare?n("SharingEntryLink",{attrs:{"can-reshare":t.canReshare,"file-info":t.fileInfo},on:{"add:share":t.addShare}}):t._e(),t._v(" "),t.hasShares?t._l(t.shares,(function(e,r){return n("SharingEntryLink",{key:e.id,attrs:{"can-reshare":t.canReshare,share:t.shares[r],"file-info":t.fileInfo},on:{"update:share":[function(e){return t.$set(t.shares,r,e)},function(e){return t.awaitForShare.apply(void 0,arguments)}],"add:share":function(e){return t.addShare.apply(void 0,arguments)},"remove:share":t.removeShare}})})):t._e()],2):t._e()}),[],!1,null,null,null).exports,_t={name:"SharingEntry",components:{Actions:x.a,ActionButton:V.a,ActionCheckbox:ut.a,ActionInput:pt.a,ActionTextEditable:vt.a,Avatar:s.a},directives:{Tooltip:E.a},mixins:[nt],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.owner};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.share.type!==this.SHARE_TYPES.SHARE_TYPE_REMOTE&&this.share.type!==this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP},canEdit:{get:function(){return this.share.hasUpdatePermission},set:function(t){this.updatePermissions({isEditChecked:t})}},canCreate:{get:function(){return this.share.hasCreatePermission},set:function(t){this.updatePermissions({isCreateChecked:t})}},canDelete:{get:function(){return this.share.hasDeletePermission},set:function(t){this.updatePermissions({isDeleteChecked:t})}},canReshare:{get:function(){return this.share.hasSharePermission},set:function(t){this.updatePermissions({isReshareChecked:t})}},isFolder:function(){return"dir"===this.fileInfo.type},hasExpirationDate:{get:function(){return this.config.isDefaultInternalExpireDateEnforced||!!this.share.expireDate},set:function(t){this.share.expireDate=t?""!==this.config.defaultInternalExpirationDateString?this.config.defaultInternalExpirationDateString:moment().format("YYYY-MM-DD"):""}},dateMaxEnforced:function(){return this.config.isDefaultInternalExpireDateEnforced&&moment().add(1+this.config.defaultInternalExpireDate,"days")}},methods:{updatePermissions:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.isEditChecked,n=void 0===e?this.canEdit:e,r=t.isCreateChecked,i=void 0===r?this.canCreate:r,o=t.isDeleteChecked,a=void 0===o?this.canDelete:o,s=t.isReshareChecked,A=void 0===s?this.canReshare:s,c=this.permissionsRead|(i?this.permissionsCreate:0)|(a?this.permissionsDelete:0)|(n?this.permissionsEdit:0)|(A?this.permissionsShare:0);this.share.permissions=c,this.queueUpdate("permissions")},onMenuClose:function(){this.onNoteSubmit()}}},Mt=(r(549),{name:"SharingList",components:{SharingEntry:Object(C.a)(_t,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("li",{staticClass:"sharing-entry"},[n("Avatar",{staticClass:"sharing-entry__avatar",attrs:{user:t.share.shareWith,"display-name":t.share.shareWithDisplayName,url:t.share.shareWithAvatar}}),t._v(" "),n("div",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.tooltip,expression:"tooltip",modifiers:{auto:!0}}],staticClass:"sharing-entry__desc"},[n("h5",[t._v(t._s(t.title))])]),t._v(" "),n("Actions",{staticClass:"sharing-entry__actions",attrs:{"menu-align":"right"},on:{close:t.onMenuClose}},[t.share.canEdit?[n("ActionCheckbox",{ref:"canEdit",attrs:{checked:t.canEdit,value:t.permissionsEdit,disabled:t.saving},on:{"update:checked":function(e){t.canEdit=e}}},[t._v("\n\t\t\t\t"+t._s(t.t("files_sharing","Allow editing"))+"\n\t\t\t")]),t._v(" "),t.isFolder?n("ActionCheckbox",{ref:"canCreate",attrs:{checked:t.canCreate,value:t.permissionsCreate,disabled:t.saving},on:{"update:checked":function(e){t.canCreate=e}}},[t._v("\n\t\t\t\t"+t._s(t.t("files_sharing","Allow creating"))+"\n\t\t\t")]):t._e(),t._v(" "),t.isFolder?n("ActionCheckbox",{ref:"canDelete",attrs:{checked:t.canDelete,value:t.permissionsDelete,disabled:t.saving},on:{"update:checked":function(e){t.canDelete=e}}},[t._v("\n\t\t\t\t"+t._s(t.t("files_sharing","Allow deleting"))+"\n\t\t\t")]):t._e(),t._v(" "),n("ActionCheckbox",{ref:"canReshare",attrs:{checked:t.canReshare,value:t.permissionsShare,disabled:t.saving},on:{"update:checked":function(e){t.canReshare=e}}},[t._v("\n\t\t\t\t"+t._s(t.t("files_sharing","Allow resharing"))+"\n\t\t\t")]),t._v(" "),n("ActionCheckbox",{attrs:{checked:t.hasExpirationDate,disabled:t.config.isDefaultExpireDateEnforced||t.saving},on:{"update:checked":function(e){t.hasExpirationDate=e},uncheck:t.onExpirationDisable}},[t._v("\n\t\t\t\t"+t._s(t.config.isDefaultExpireDateEnforced?t.t("files_sharing","Expiration date enforced"):t.t("files_sharing","Set expiration date"))+"\n\t\t\t")]),t._v(" "),t.hasExpirationDate?n("ActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:t.errors.expireDate,show:t.errors.expireDate,trigger:"manual"},expression:"{\n\t\t\t\t\tcontent: errors.expireDate,\n\t\t\t\t\tshow: errors.expireDate,\n\t\t\t\t\ttrigger: 'manual'\n\t\t\t\t}",modifiers:{auto:!0}}],ref:"expireDate",class:{error:t.errors.expireDate},attrs:{disabled:t.saving,"first-day-of-week":t.firstDay,lang:t.lang,value:t.share.expireDate,icon:"icon-calendar-dark",type:"date","not-before":t.dateTomorrow,"not-after":t.dateMaxEnforced},on:{"update:value":t.onExpirationChange}},[t._v("\n\t\t\t\t"+t._s(t.t("files_sharing","Enter a date"))+"\n\t\t\t")]):t._e(),t._v(" "),t.canHaveNote?[n("ActionCheckbox",{attrs:{checked:t.hasNote,disabled:t.saving},on:{"update:checked":function(e){t.hasNote=e},uncheck:function(e){return t.queueUpdate("note")}}},[t._v("\n\t\t\t\t\t"+t._s(t.t("files_sharing","Note to recipient"))+"\n\t\t\t\t")]),t._v(" "),t.hasNote?n("ActionTextEditable",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:t.errors.note,show:t.errors.note,trigger:"manual"},expression:"{\n\t\t\t\t\t\tcontent: errors.note,\n\t\t\t\t\t\tshow: errors.note,\n\t\t\t\t\t\ttrigger: 'manual'\n\t\t\t\t\t}",modifiers:{auto:!0}}],ref:"note",class:{error:t.errors.note},attrs:{disabled:t.saving,value:t.share.newNote||t.share.note,icon:"icon-edit"},on:{"update:value":t.onNoteChange,submit:t.onNoteSubmit}}):t._e()]:t._e()]:t._e(),t._v(" "),t.share.canDelete?n("ActionButton",{attrs:{icon:"icon-close",disabled:t.saving},on:{click:function(e){return e.preventDefault(),t.onDelete(e)}}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Unshare"))+"\n\t\t")]):t._e()],2)],1)}),[],!1,null,"2255c654",null).exports},props:{fileInfo:{type:Object,default:function(){},required:!0},shares:{type:Array,default:function(){return[]},required:!0}},computed:{hasShares:function(){return 0===this.shares.length}},methods:{removeShare:function(t){var e=this.shares.findIndex((function(e){return e===t}));this.shares.splice(e,1)}}}),Tt=Object(C.a)(Mt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",{staticClass:"sharing-sharee-list"},t._l(t.shares,(function(e){return n("SharingEntry",{key:e.id,attrs:{"file-info":t.fileInfo,share:e},on:{"remove:share":t.removeShare}})})),1)}),[],!1,null,null,null).exports;function Bt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function St(t,e,n,r,i,o,a){try{var s=t[o](a),A=s.value}catch(t){return void n(t)}s.done?e(A):Promise.resolve(A).then(r,i)}var Dt={name:"SharingTab",components:{Avatar:s.a,CollectionList:i.a,SharingEntryInternal:B,SharingEntrySimple:_,SharingInherited:st,SharingInput:W,SharingLinkList:Ct,SharingList:Tt,Tab:l.a},mixins:[g],props:{fileInfo:{type:Object,default:function(){},required:!0}},data:function(){return{error:"",expirationInterval:null,icon:"icon-share",loading:!0,name:t("files_sharing","Sharing"),reshare:null,sharedWithMe:{},shares:[],linkShares:[],sections:OCA.Sharing.ShareTabSections.getSections()}},computed:{id:function(){return"sharing"},activeTab:function(){return this.$parent.activeTab},isSharedWithMe:function(){return Object.keys(this.sharedWithMe).length>0},canReshare:function(){return!!(this.fileInfo.permissions&OC.PERMISSION_SHARE)||!(!this.reshare||!this.reshare.hasSharePermission)}},watch:{fileInfo:function(){this.resetState(),this.getShares()}},beforeMount:function(){this.getShares()},methods:{getShares:function(){var e,n=this;return(e=regeneratorRuntime.mark((function e(){var r,i,a,s,A,u,l,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n.loading=!0,r=Object(o.generateOcsUrl)("apps/files_sharing/api/v1",2)+"shares",i=(n.fileInfo.path+"/"+n.fileInfo.name).replace("//","/"),a=c.a.get(r,{params:{format:"json",path:i,reshares:!0}}),s=c.a.get(r,{params:{format:"json",path:i,shared_with_me:!0}}),e.next=9,Promise.all([a,s]);case 9:A=e.sent,u=Bt(A,2),l=u[0],f=u[1],n.loading=!1,n.processSharedWithMe(f),n.processShares(l),e.next=23;break;case 18:e.prev=18,e.t0=e.catch(0),n.error=t("files_sharing","Unable to load the shares list"),n.loading=!1,console.error("Error loading the shares list",e.t0);case 23:case"end":return e.stop()}}),e,null,[[0,18]])})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(t){St(o,r,i,a,s,"next",t)}function s(t){St(o,r,i,a,s,"throw",t)}a(void 0)}))})()},resetState:function(){clearInterval(this.expirationInterval),this.loading=!0,this.error="",this.sharedWithMe={},this.shares=[]},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(t){var e=this,n=t.data;if(n.ocs&&n.ocs.data&&n.ocs.data.length>0){var r=n.ocs.data.map((function(t){return new h(t)})).sort((function(t,e){return e.createdTime-t.createdTime}));this.linkShares=r.filter((function(t){return t.type===e.SHARE_TYPES.SHARE_TYPE_LINK||t.type===e.SHARE_TYPES.SHARE_TYPE_EMAIL})),this.shares=r.filter((function(t){return t.type!==e.SHARE_TYPES.SHARE_TYPE_LINK&&t.type!==e.SHARE_TYPES.SHARE_TYPE_EMAIL}))}},processSharedWithMe:function(e){var n=e.data;if(n.ocs&&n.ocs.data&&n.ocs.data[0]){var r=new h(n),i=function(e){return e.type===OC.Share.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===OC.Share.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===OC.Share.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),o=r.ownerDisplayName,a=r.owner;this.sharedWithMe={displayName:o,title:i,user:a},this.reshare=r,r.expireDate&&moment(r.expireDate).unix()>moment().unix()&&(this.updateExpirationSubtitle(r),this.expirationInterval=setInterval(this.updateExpirationSubtitle,1e4,r))}},addShare:function(t){t.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL?this.linkShares.unshift(t):this.shares.unshift(t)}}},Ot=Object(C.a)(Dt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Tab",{class:{"icon-loading":t.loading},attrs:{id:t.id,icon:t.icon,name:t.name}},[t.error?n("div",{staticClass:"emptycontent"},[n("div",{staticClass:"icon icon-error"}),t._v(" "),n("h2",[t._v(t._s(t.error))])]):[t.isSharedWithMe?n("SharingEntrySimple",t._b({staticClass:"sharing-entry__reshare",scopedSlots:t._u([{key:"avatar",fn:function(){return[n("Avatar",{staticClass:"sharing-entry__avatar",attrs:{user:t.sharedWithMe.user,"display-name":t.sharedWithMe.displayName,"tooltip-message":""}})]},proxy:!0}],null,!1,1643724538)},"SharingEntrySimple",t.sharedWithMe,!1)):t._e(),t._v(" "),t.loading?t._e():n("SharingInput",{attrs:{"can-reshare":t.canReshare,"file-info":t.fileInfo,"link-shares":t.linkShares,reshare:t.reshare,shares:t.shares},on:{"add:share":t.addShare}}),t._v(" "),t.loading?t._e():n("SharingLinkList",{attrs:{"can-reshare":t.canReshare,"file-info":t.fileInfo,shares:t.linkShares}}),t._v(" "),t.loading?t._e():n("SharingList",{attrs:{shares:t.shares,"file-info":t.fileInfo}}),t._v(" "),t.canReshare&&!t.loading?n("SharingInherited",{attrs:{"file-info":t.fileInfo}}):t._e(),t._v(" "),n("SharingEntryInternal",{attrs:{"file-info":t.fileInfo}}),t._v(" "),t.fileInfo?n("CollectionList",{attrs:{id:""+t.fileInfo.id,type:"file",name:t.fileInfo.name}}):t._e(),t._v(" "),t._l(t.sections,(function(e,r){return n("div",{key:r,ref:"section-"+r,refInFor:!0,staticClass:"sharingTab__additionalContent"},[n(e(t.$refs["section-"+r],t.fileInfo),{tag:"component",attrs:{"file-info":t.fileInfo}})],1)}))]],2)}),[],!1,null,"21c3cddd",null).exports;function Nt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Lt(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var kt=0;
/**
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
*