aboutsummaryrefslogtreecommitdiffstats
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 7523fa2513d..42b9ae3eb58 100644
--- a/apps/files_sharing/js/dist/files_sharing_tab.js
+++ b/apps/files_sharing/js/dist/files_sharing_tab.js
@@ -729,7 +729,7 @@ var P=function(){function e(){!function(e,t){if(!(e instanceof t))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 ne={mixins:[G,g],props:{fileInfo:{type:Object,default:function(){},required:!0},share:{type:m,default:null}},data:function(){var e;return{config:new P,errors:{},loading:!1,saving:!1,open:!1,updateQueue:new q.a({concurrency:1}),reactiveState:null===(e=this.share)||void 0===e?void 0:e.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(e){this.share.note=e?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(B.getCurrentUser)().uid}},methods:{checkShare:function(e){if(e.password&&("string"!=typeof e.password||""===e.password.trim()))return!1;if(e.expirationDate&&!moment(e.expirationDate).isValid())return!1;return!0},onExpirationChange:function(e){var t=moment(e).format("YYYY-MM-DD");this.share.expireDate=t,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 te(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.loading=!0,e.open=!1,t.next=5,e.deleteShare(e.share.id);case 5:console.debug("Share deleted",e.share.id),e.$emit("remove:share",e.share),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),e.open=!0;case 12:return t.prev=12,e.loading=!1,t.finish(12);case 15:case"end":return t.stop()}}),t,null,[[0,9,12,15]])})))()},queueUpdate:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(0!==n.length)if(this.share.id){var o={};n.map((function(t){return o[t]=e.share[t].toString()})),this.updateQueue.add(te(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.saving=!0,e.errors={},t.prev=2,t.next=5,e.updateShare(e.share.id,o);case 5:e.$delete(e.errors,n[0]),e.$delete(e.share,"newPassword"),t.next=13;break;case 9:t.prev=9,t.t0=t.catch(2),(r=t.t0.message)&&""!==r&&e.onSyncError(n[0],r);case 13:return t.prev=13,e.saving=!1,t.finish(13);case 16:case"end":return t.stop()}}),t,null,[[2,9,13,16]])}))))}else console.error("Cannot update share.",this.share,"No valid id")},onSyncError:function(e,t){switch(this.open=!0,e){case"password":case"pending":case"expireDate":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()}}},debounceQueueUpdate:k()((function(e){this.queueUpdate(e)}),500),disabledDate:function(e){var t=moment(e);return this.dateTomorrow&&t.isBefore(this.dateTomorrow,"day")||this.dateMaxEnforced&&t.isSameOrAfter(this.dateMaxEnforced,"day")}}},re={name:"SharingEntryInherited",components:{ActionButton:V.a,ActionLink:y.a,ActionText:$.a,Avatar:s.a,SharingEntrySimple:C},mixins:[ne],props:{share:{type:m,required:!0}},computed:{viaFileTargetUrl:function(){return Object(i.generateUrl)("/f/{fileid}",{fileid:this.share.viaFileid})},viaFolderName:function(){return Object(J.basename)(this.share.viaPath)}}},oe=(r(368),Object(E.a)(re,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("SharingEntrySimple",{key:e.share.id,staticClass:"sharing-entry__inherited",attrs:{title:e.share.shareWithDisplayName},scopedSlots:e._u([{key:"avatar",fn:function(){return[n("Avatar",{staticClass:"sharing-entry__avatar",attrs:{user:e.share.shareWith,"display-name":e.share.shareWithDisplayName,"tooltip-message":""}})]},proxy:!0}])},[e._v(" "),n("ActionText",{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?n("ActionLink",{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?n("ActionButton",{attrs:{icon:"icon-close"},on:{click:function(t){return t.preventDefault(),e.onDelete(t)}}},[e._v("\n\t\t"+e._s(e.t("files_sharing","Unshare"))+"\n\t")]):e._e()],1)}),[],!1,null,"c58e421a",null).exports);function ie(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}var ae={name:"SharingInherited",components:{ActionButton:V.a,SharingEntryInherited:oe,SharingEntrySimple:C},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,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.loading=!0,e.prev=1,r=Object(i.generateOcsUrl)("apps/files_sharing/api/v1/shares/inherited?format=json&path=".concat(n.fullPath),2),e.next=5,l.a.get(r.replace(/\/$/,""));case 5:o=e.sent,n.shares=o.data.ocs.data.map((function(e){return new m(e)})).sort((function(e,t){return t.createdTime-e.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,o){var i=e.apply(t,n);function a(e){ie(i,r,o,a,s,"next",e)}function s(e){ie(i,r,o,a,s,"throw",e)}a(void 0)}))})()},resetState:function(){this.loaded=!1,this.loading=!1,this.showInheritedShares=!1,this.shares=[]}}},se=(r(370),Object(E.a)(ae,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ul",{attrs:{id:"sharing-inherited-shares"}},[n("SharingEntrySimple",{staticClass:"sharing-entry__inherited",attrs:{title:e.mainTitle,subtitle:e.subTitle},scopedSlots:e._u([{key:"avatar",fn:function(){return[n("div",{staticClass:"avatar-shared icon-more-white"})]},proxy:!0}])},[e._v(" "),n("ActionButton",{attrs:{icon:e.showInheritedSharesIcon},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.toggleInheritedShares(t)}}},[e._v("\n\t\t\t"+e._s(e.toggleTooltip)+"\n\t\t")])],1),e._v(" "),e._l(e.shares,(function(t){return n("SharingEntryInherited",{key:t.id,attrs:{"file-info":e.fileInfo,share:t}})}))],2)}),[],!1,null,"639a00a9",null).exports),ce=r(14),le=r(198),Ae=r.n(le),ue=r(319),de=r.n(ue),pe=r(199),fe=r.n(pe),me=r(200),he=r.n(me);function ge(e){return(ge="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})(e)}function ve(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function ye(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ve(i,r,o,a,s,"next",e)}function s(e){ve(i,r,o,a,s,"throw",e)}a(void 0)}))}}var be,xe="abcdefgijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXYZ23456789",we={name:"SharingEntryLink",components:{Actions:x.a,ActionButton:V.a,ActionCheckbox:Ae.a,ActionRadio:de.a,ActionInput:fe.a,ActionLink:y.a,ActionText:$.a,ActionTextEditable:he.a,Avatar:s.a},directives:{Tooltip:M.a},mixins:[ne],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:{sharePermissions:function(){return this.share.permissions&~OC.PERMISSION_SHARE},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(e){var t=moment(this.config.defaultExpirationDateString);t.isValid()||(t=moment()),this.share.state.expiration=e?t.format("YYYY-MM-DD"):"",console.debug("Expiration date status",e,this.share.expireDate)}},dateMaxEnforced:function(){return this.config.isDefaultExpireDateEnforced&&moment().add(1+this.config.defaultExpireDate,"days")},isPasswordProtected:{get:function(){return this.config.enforcePasswordForPublicLink||!!this.share.password},set:function(e){var t=this;return ye(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.t0=ce.default,n.t1=t.share,!e){n.next=8;break}return n.next=5,t.generatePassword();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),ce.default.set(t.share,"newPassword",t.share.password);case 12:case"end":return n.stop()}}),n)})))()}},isTalkEnabled:function(){return void 0!==OC.appswebroots.spreed},isPasswordProtectedByTalkAvailable:function(){return this.isPasswordProtected&&this.isTalkEnabled},isPasswordProtectedByTalk:{get:function(){return this.share.sendPasswordByTalk},set:(be=ye(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.share.sendPasswordByTalk=t;case 1:case"end":return e.stop()}}),e,this)}))),function(e){return be.apply(this,arguments)})},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.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(e){this.share.permissions=e?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(i.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"===ge(this.config.passwordPolicy)}},methods:{onNewLinkShare:function(){var e=this;return ye(regeneratorRuntime.mark((function n(){var r,o,i,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 o=new m(r),n.next=25,new Promise((function(t){e.$emit("add:share",o,t)}));case 25:i=n.sent,e.open=!1,e.loading=!1,i.open=!0,n.next=34;break;case 31:return a=new m(r),n.next=34,e.pushNewLinkShare(a);case 34:case"end":return n.stop()}}),n)})))()},pushNewLinkShare:function(e,t){var n=this;return ye(regeneratorRuntime.mark((function r(){var o,i,a,s,c;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,n.loading=!0,n.errors={},o=(n.fileInfo.path+"/"+n.fileInfo.name).replace("//","/"),r.next=6,n.createShare({path:o,shareType:OC.Share.SHARE_TYPE_LINK,password:e.password,expireDate:e.expireDate});case 6:if(i=r.sent,n.open=!1,console.debug("Link share created",i),!t){r.next=15;break}return r.next=12,new Promise((function(e){n.$emit("update:share",i,e)}));case 12:a=r.sent,r.next=18;break;case 15:return r.next=17,new Promise((function(e){n.$emit("add:share",i,e)}));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,(c=s.data.ocs.meta.message).match(/password/i)?n.onSyncError("password",c):c.match(/date/i)?n.onSyncError("expireDate",c):n.onSyncError("pending",c);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(e){var t=parseInt(e.target.value,10);this.share.permissions=t,this.queueUpdate("permissions")},generatePassword:function(){var e=this;return ye(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.config.passwordPolicy.api||!e.config.passwordPolicy.api.generate){t.next=12;break}return t.prev=1,t.next=4,l.a.get(e.config.passwordPolicy.api.generate);case 4:if(!(n=t.sent).data.ocs.data.password){t.next=7;break}return t.abrupt("return",n.data.ocs.data.password);case 7:t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),console.info("Error generating password from password_policy",t.t0);case 12:return t.abrupt("return",Array(10).fill(0).reduce((function(e,t){return e+=xe.charAt(Math.floor(Math.random()*xe.length))}),""));case 13:case"end":return t.stop()}}),t,null,[[1,9]])})))()},copyLink:function(){var e=this;return ye(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.$copyText(e.shareLink);case 3:e.$refs.copyButton.$el.focus(),e.copySuccess=!0,e.copied=!0,t.next=13;break;case 8:t.prev=8,t.t0=t.catch(0),e.copySuccess=!1,e.copied=!0,console.error(t.t0);case 13:return t.prev=13,setTimeout((function(){e.copySuccess=!1,e.copied=!1}),4e3),t.finish(13);case 16:case"end":return t.stop()}}),t,null,[[0,8,13,16]])})))()},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)}}},Me=(r(372),{name:"SharingLinkList",components:{SharingEntryLink:Object(E.a)(we,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("li",{staticClass:"sharing-entry sharing-entry__link",class:{"sharing-entry--share":e.share}},[n("Avatar",{staticClass:"sharing-entry__avatar",class:e.isEmailShareType?"icon-mail-white":"icon-public-white",attrs:{"is-no-user":!0}}),e._v(" "),n("div",{staticClass:"sharing-entry__desc"},[n("h5",[e._v(e._s(e.title))])]),e._v(" "),e.share&&!e.isEmailShareType&&e.share.token?n("Actions",{ref:"copyButton",staticClass:"sharing-entry__copy"},[n("ActionLink",{attrs:{href:e.shareLink,target:"_blank",icon:e.copied&&e.copySuccess?"icon-checkmark-color":"icon-clippy"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.copyLink(t)}}},[e._v("\n\t\t\t"+e._s(e.clipboardTooltip)+"\n\t\t")])],1):e._e(),e._v(" "),e.loading||!e.pendingPassword&&!e.pendingExpirationDate?e.loading?n("div",{staticClass:"icon-loading-small sharing-entry__loading"}):n("Actions",{staticClass:"sharing-entry__actions",attrs:{"menu-align":"right",open:e.open},on:{"update:open":function(t){e.open=t},close:e.onMenuClose}},[e.share?[e.share.canEdit?[e.isFolder&&e.fileHasCreatePermission&&e.config.isPublicUploadEnabled?[n("ActionRadio",{attrs:{checked:e.sharePermissions===e.publicUploadRValue,value:e.publicUploadRValue,name:e.randomId,disabled:e.saving},on:{change:e.togglePermissions}},[e._v("\n\t\t\t\t\t\t"+e._s(e.t("files_sharing","Read only"))+"\n\t\t\t\t\t")]),e._v(" "),n("ActionRadio",{attrs:{checked:e.sharePermissions===e.publicUploadRWValue,value:e.publicUploadRWValue,disabled:e.saving,name:e.randomId},on:{change:e.togglePermissions}},[e._v("\n\t\t\t\t\t\t"+e._s(e.t("files_sharing","Allow upload and editing"))+"\n\t\t\t\t\t")]),e._v(" "),n("ActionRadio",{staticClass:"sharing-entry__action--public-upload",attrs:{checked:e.sharePermissions===e.publicUploadWValue,value:e.publicUploadWValue,disabled:e.saving,name:e.randomId},on:{change:e.togglePermissions}},[e._v("\n\t\t\t\t\t\t"+e._s(e.t("files_sharing","File drop (upload only)"))+"\n\t\t\t\t\t")])]:n("ActionCheckbox",{attrs:{checked:e.canUpdate,disabled:e.saving},on:{"update:checked":function(t){e.canUpdate=t},change:function(t){return e.queueUpdate("permissions")}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Allow editing"))+"\n\t\t\t\t")]),e._v(" "),n("ActionCheckbox",{attrs:{checked:e.share.hideDownload,disabled:e.saving},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(" "),n("ActionCheckbox",{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?n("ActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.password,show:e.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:e.errors.password},attrs:{disabled:e.saving,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.isPasswordProtectedByTalkAvailable?n("ActionCheckbox",{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(" "),n("ActionCheckbox",{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?n("ActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.expireDate,show:e.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:e.errors.expireDate},attrs:{disabled:e.saving,"first-day-of-week":e.firstDay,lang:e.lang,value:e.share.expireDate,"value-type":"format",icon:"icon-calendar-dark",type:"date","disabled-date":e.disabledDate},on:{"update:value":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(" "),n("ActionCheckbox",{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?n("ActionTextEditable",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.note,show:e.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: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(" "),e._l(e.externalActions,(function(t,r){var o=t.icon,i=t.url,a=t.name;return n("ActionLink",{key:r,attrs:{href:i(e.shareLink),icon:o,target:"_blank"}},[e._v("\n\t\t\t\t"+e._s(a)+"\n\t\t\t")])})),e._v(" "),e.share.canDelete?n("ActionButton",{attrs:{icon:"icon-close",disabled:e.saving},on:{click:function(t){return t.preventDefault(),e.onDelete(t)}}},[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?n("ActionButton",{staticClass:"new-share-link",attrs:{icon:"icon-add"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare(t)}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Add another link"))+"\n\t\t\t")]):e._e()]:e.canReshare?n("ActionButton",{staticClass:"new-share-link",attrs:{icon:"icon-add"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare(t)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Create a new share link"))+"\n\t\t")]):e._e()],2):n("Actions",{staticClass:"sharing-entry__actions",attrs:{"menu-align":"right",open:e.open},on:{"update:open":function(t){e.open=t},close:e.onNewLinkShare}},[e.errors.pending?n("ActionText",{class:{error:e.errors.pending},attrs:{icon:"icon-error"}},[e._v("\n\t\t\t"+e._s(e.errors.pending)+"\n\t\t")]):n("ActionText",{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.pendingPassword?n("ActionText",{attrs:{icon:"icon-password"}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Password protection (enforced)"))+"\n\t\t")]):e.config.enableLinkPasswordByDefault?n("ActionCheckbox",{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.pendingPassword||e.share.password?n("ActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.password,show:e.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: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?n("ActionText",{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?n("ActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.expireDate,show:e.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:e.saving,"first-day-of-week":e.firstDay,lang:e.lang,icon:"",type:"date","value-type":"format","disabled-date":e.disabledDate},model:{value:e.share.expireDate,callback:function(t){e.$set(e.share,"expireDate",t)},expression:"share.expireDate"}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Enter a date"))+"\n\t\t")]):e._e(),e._v(" "),n("ActionButton",{attrs:{icon:"icon-close"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onCancel(t)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Cancel"))+"\n\t\t")])],1)],1)}),[],!1,null,"2edd90d7",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 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)}}}),Te=Object(E.a)(Me,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.canLinkShare?n("ul",{staticClass:"sharing-link-list"},[!e.hasLinkShares&&e.canReshare?n("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(t,r){return n("SharingEntryLink",{key:t.id,attrs:{"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(void 0,arguments)}],"add:share":function(t){return e.addShare.apply(void 0,arguments)},"remove:share":e.removeShare}})})):e._e()],2):e._e()}),[],!1,null,null,null).exports,Ee={name:"SharingEntry",components:{Actions:x.a,ActionButton:V.a,ActionCheckbox:Ae.a,ActionInput:fe.a,ActionTextEditable:he.a,Avatar:s.a},directives:{Tooltip:M.a},mixins:[ne],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(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})}},isFolder:function(){return"dir"===this.fileInfo.type},hasExpirationDate:{get:function(){return this.config.isDefaultInternalExpireDateEnforced||!!this.share.expireDate},set:function(e){this.share.expireDate=e?""!==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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.isEditChecked,n=void 0===t?this.canEdit:t,r=e.isCreateChecked,o=void 0===r?this.canCreate:r,i=e.isDeleteChecked,a=void 0===i?this.canDelete:i,s=e.isReshareChecked,c=void 0===s?this.canReshare:s,l=this.permissionsRead|(o?this.permissionsCreate:0)|(a?this.permissionsDelete:0)|(n?this.permissionsEdit:0)|(c?this.permissionsShare:0);this.share.permissions=l,this.queueUpdate("permissions")},onMenuClose:function(){this.onNoteSubmit()}}},Ce=(r(374),{name:"SharingList",components:{SharingEntry:Object(E.a)(Ee,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("li",{staticClass:"sharing-entry"},[n("Avatar",{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,url:e.share.shareWithAvatar}}),e._v(" "),n("div",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:e.tooltip,expression:"tooltip",modifiers:{auto:!0}}],staticClass:"sharing-entry__desc"},[n("h5",[e._v(e._s(e.title))])]),e._v(" "),n("Actions",{staticClass:"sharing-entry__actions",attrs:{"menu-align":"right"},on:{close:e.onMenuClose}},[e.share.canEdit?[n("ActionCheckbox",{ref:"canEdit",attrs:{checked:e.canEdit,value:e.permissionsEdit,disabled:e.saving},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?n("ActionCheckbox",{ref:"canCreate",attrs:{checked:e.canCreate,value:e.permissionsCreate,disabled:e.saving},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?n("ActionCheckbox",{ref:"canDelete",attrs:{checked:e.canDelete,value:e.permissionsDelete,disabled:e.saving},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(" "),n("ActionCheckbox",{ref:"canReshare",attrs:{checked:e.canReshare,value:e.permissionsShare,disabled:e.saving},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._v(" "),n("ActionCheckbox",{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"+e._s(e.config.isDefaultExpireDateEnforced?e.t("files_sharing","Expiration date enforced"):e.t("files_sharing","Set expiration date"))+"\n\t\t\t")]),e._v(" "),e.hasExpirationDate?n("ActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.expireDate,show:e.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:e.errors.expireDate},attrs:{disabled:e.saving,"first-day-of-week":e.firstDay,lang:e.lang,value:e.share.expireDate,"value-type":"format",icon:"icon-calendar-dark",type:"date","disabled-date":e.disabledDate},on:{"update:value":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?[n("ActionCheckbox",{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?n("ActionTextEditable",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.note,show:e.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: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?n("ActionButton",{attrs:{icon:"icon-close",disabled:e.saving},on:{click:function(t){return t.preventDefault(),e.onDelete(t)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Unshare"))+"\n\t\t")]):e._e()],2)],1)}),[],!1,null,"54ef6c7d",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(e){var t=this.shares.findIndex((function(t){return t===e}));this.shares.splice(t,1)}}}),Ie=Object(E.a)(Ce,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ul",{staticClass:"sharing-sharee-list"},e._l(e.shares,(function(t){return n("SharingEntry",{key:t.id,attrs:{"file-info":e.fileInfo,share:t},on:{"remove:share":e.removeShare}})})),1)}),[],!1,null,null,null).exports;function Se(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _e(e,t)}(e,t)||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.")}()}function _e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Be(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}var Ne={name:"SharingTab",components:{Avatar:s.a,CollectionList:o.a,SharingEntryInternal:_,SharingEntrySimple:C,SharingInherited:se,SharingInput:Z,SharingLinkList:Te,SharingList:Ie,Tab:u.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(e,t){e.id!==t.id&&(this.resetState(),this.getShares())}},beforeMount:function(){this.getShares()},methods:{getShares:function(){var e,n=this;return(e=regeneratorRuntime.mark((function e(){var r,o,a,s,c,A,u,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n.loading=!0,r=Object(i.generateOcsUrl)("apps/files_sharing/api/v1",2)+"shares",o=(n.fileInfo.path+"/"+n.fileInfo.name).replace("//","/"),a=l.a.get(r,{params:{format:"json",path:o,reshares:!0}}),s=l.a.get(r,{params:{format:"json",path:o,shared_with_me:!0}}),e.next=9,Promise.all([a,s]);case 9:c=e.sent,A=Se(c,2),u=A[0],d=A[1],n.loading=!1,n.processSharedWithMe(d),n.processShares(u),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,o){var i=e.apply(t,n);function a(e){Be(i,r,o,a,s,"next",e)}function s(e){Be(i,r,o,a,s,"throw",e)}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(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 m(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})),console.debug("Processed",this.linkShares.length,"link share(s)"),console.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 m(n),o=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),i=r.ownerDisplayName,a=r.owner;this.sharedWithMe={displayName:i,title:o,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(e){e.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL?this.linkShares.unshift(e):this.shares.unshift(e)}}},ke=Object(E.a)(Ne,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("Tab",{class:{"icon-loading":e.loading},attrs:{id:e.id,icon:e.icon,name:e.name}},[e.error?n("div",{staticClass:"emptycontent"},[n("div",{staticClass:"icon icon-error"}),e._v(" "),n("h2",[e._v(e._s(e.error))])]):[e.isSharedWithMe?n("SharingEntrySimple",e._b({staticClass:"sharing-entry__reshare",scopedSlots:e._u([{key:"avatar",fn:function(){return[n("Avatar",{staticClass:"sharing-entry__avatar",attrs:{user:e.sharedWithMe.user,"display-name":e.sharedWithMe.displayName,"tooltip-message":""}})]},proxy:!0}],null,!1,1643724538)},"SharingEntrySimple",e.sharedWithMe,!1)):e._e(),e._v(" "),e.loading?e._e():n("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():n("SharingLinkList",{attrs:{"can-reshare":e.canReshare,"file-info":e.fileInfo,shares:e.linkShares}}),e._v(" "),e.loading?e._e():n("SharingList",{attrs:{shares:e.shares,"file-info":e.fileInfo}}),e._v(" "),e.canReshare&&!e.loading?n("SharingInherited",{attrs:{"file-info":e.fileInfo}}):e._e(),e._v(" "),n("SharingEntryInternal",{attrs:{"file-info":e.fileInfo}}),e._v(" "),e.fileInfo?n("CollectionList",{attrs:{id:""+e.fileInfo.id,type:"file",name:e.fileInfo.name}}):e._e(),e._v(" "),e._l(e.sections,(function(t,r){return n("div",{key:r,ref:"section-"+r,refInFor:!0,staticClass:"sharingTab__additionalContent"},[n(t(e.$refs["section-"+r],e.fileInfo),{tag:"component",attrs:{"file-info":e.fileInfo}})],1)}))]],2)}),[],!1,null,"06860d18",null).exports;function De(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Le(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var Oe=0;
+ */var ne={mixins:[G,g],props:{fileInfo:{type:Object,default:function(){},required:!0},share:{type:m,default:null}},data:function(){var e;return{config:new P,errors:{},loading:!1,saving:!1,open:!1,updateQueue:new q.a({concurrency:1}),reactiveState:null===(e=this.share)||void 0===e?void 0:e.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(e){this.share.note=e?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(B.getCurrentUser)().uid}},methods:{checkShare:function(e){if(e.password&&("string"!=typeof e.password||""===e.password.trim()))return!1;if(e.expirationDate&&!moment(e.expirationDate).isValid())return!1;return!0},onExpirationChange:function(e){var t=moment(e).format("YYYY-MM-DD");this.share.expireDate=t,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 te(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.loading=!0,e.open=!1,t.next=5,e.deleteShare(e.share.id);case 5:console.debug("Share deleted",e.share.id),e.$emit("remove:share",e.share),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),e.open=!0;case 12:return t.prev=12,e.loading=!1,t.finish(12);case 15:case"end":return t.stop()}}),t,null,[[0,9,12,15]])})))()},queueUpdate:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(0!==n.length)if(this.share.id){var o={};n.map((function(t){return o[t]=e.share[t].toString()})),this.updateQueue.add(te(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.saving=!0,e.errors={},t.prev=2,t.next=5,e.updateShare(e.share.id,o);case 5:e.$delete(e.errors,n[0]),e.$delete(e.share,"newPassword"),t.next=13;break;case 9:t.prev=9,t.t0=t.catch(2),(r=t.t0.message)&&""!==r&&e.onSyncError(n[0],r);case 13:return t.prev=13,e.saving=!1,t.finish(13);case 16:case"end":return t.stop()}}),t,null,[[2,9,13,16]])}))))}else console.error("Cannot update share.",this.share,"No valid id")},onSyncError:function(e,t){switch(this.open=!0,e){case"password":case"pending":case"expireDate":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:k()((function(e){this.queueUpdate(e)}),500),disabledDate:function(e){var t=moment(e);return this.dateTomorrow&&t.isBefore(this.dateTomorrow,"day")||this.dateMaxEnforced&&t.isSameOrAfter(this.dateMaxEnforced,"day")}}},re={name:"SharingEntryInherited",components:{ActionButton:V.a,ActionLink:y.a,ActionText:$.a,Avatar:s.a,SharingEntrySimple:C},mixins:[ne],props:{share:{type:m,required:!0}},computed:{viaFileTargetUrl:function(){return Object(i.generateUrl)("/f/{fileid}",{fileid:this.share.viaFileid})},viaFolderName:function(){return Object(J.basename)(this.share.viaPath)}}},oe=(r(368),Object(E.a)(re,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("SharingEntrySimple",{key:e.share.id,staticClass:"sharing-entry__inherited",attrs:{title:e.share.shareWithDisplayName},scopedSlots:e._u([{key:"avatar",fn:function(){return[n("Avatar",{staticClass:"sharing-entry__avatar",attrs:{user:e.share.shareWith,"display-name":e.share.shareWithDisplayName,"tooltip-message":""}})]},proxy:!0}])},[e._v(" "),n("ActionText",{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?n("ActionLink",{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?n("ActionButton",{attrs:{icon:"icon-close"},on:{click:function(t){return t.preventDefault(),e.onDelete(t)}}},[e._v("\n\t\t"+e._s(e.t("files_sharing","Unshare"))+"\n\t")]):e._e()],1)}),[],!1,null,"c58e421a",null).exports);function ie(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}var ae={name:"SharingInherited",components:{ActionButton:V.a,SharingEntryInherited:oe,SharingEntrySimple:C},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,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.loading=!0,e.prev=1,r=Object(i.generateOcsUrl)("apps/files_sharing/api/v1/shares/inherited?format=json&path=".concat(n.fullPath),2),e.next=5,l.a.get(r.replace(/\/$/,""));case 5:o=e.sent,n.shares=o.data.ocs.data.map((function(e){return new m(e)})).sort((function(e,t){return t.createdTime-e.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,o){var i=e.apply(t,n);function a(e){ie(i,r,o,a,s,"next",e)}function s(e){ie(i,r,o,a,s,"throw",e)}a(void 0)}))})()},resetState:function(){this.loaded=!1,this.loading=!1,this.showInheritedShares=!1,this.shares=[]}}},se=(r(370),Object(E.a)(ae,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ul",{attrs:{id:"sharing-inherited-shares"}},[n("SharingEntrySimple",{staticClass:"sharing-entry__inherited",attrs:{title:e.mainTitle,subtitle:e.subTitle},scopedSlots:e._u([{key:"avatar",fn:function(){return[n("div",{staticClass:"avatar-shared icon-more-white"})]},proxy:!0}])},[e._v(" "),n("ActionButton",{attrs:{icon:e.showInheritedSharesIcon},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.toggleInheritedShares(t)}}},[e._v("\n\t\t\t"+e._s(e.toggleTooltip)+"\n\t\t")])],1),e._v(" "),e._l(e.shares,(function(t){return n("SharingEntryInherited",{key:t.id,attrs:{"file-info":e.fileInfo,share:t}})}))],2)}),[],!1,null,"639a00a9",null).exports),ce=r(14),le=r(198),Ae=r.n(le),ue=r(319),de=r.n(ue),pe=r(199),fe=r.n(pe),me=r(200),he=r.n(me);function ge(e){return(ge="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})(e)}function ve(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function ye(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ve(i,r,o,a,s,"next",e)}function s(e){ve(i,r,o,a,s,"throw",e)}a(void 0)}))}}var be,xe="abcdefgijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXYZ23456789",we={name:"SharingEntryLink",components:{Actions:x.a,ActionButton:V.a,ActionCheckbox:Ae.a,ActionRadio:de.a,ActionInput:fe.a,ActionLink:y.a,ActionText:$.a,ActionTextEditable:he.a,Avatar:s.a},directives:{Tooltip:M.a},mixins:[ne],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:{sharePermissions:function(){return this.share.permissions&~OC.PERMISSION_SHARE},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(e){var t=moment(this.config.defaultExpirationDateString);t.isValid()||(t=moment()),this.share.state.expiration=e?t.format("YYYY-MM-DD"):"",console.debug("Expiration date status",e,this.share.expireDate)}},dateMaxEnforced:function(){return this.config.isDefaultExpireDateEnforced&&moment().add(1+this.config.defaultExpireDate,"days")},isPasswordProtected:{get:function(){return this.config.enforcePasswordForPublicLink||!!this.share.password},set:function(e){var t=this;return ye(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.t0=ce.default,n.t1=t.share,!e){n.next=8;break}return n.next=5,t.generatePassword();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),ce.default.set(t.share,"newPassword",t.share.password);case 12:case"end":return n.stop()}}),n)})))()}},isTalkEnabled:function(){return void 0!==OC.appswebroots.spreed},isPasswordProtectedByTalkAvailable:function(){return this.isPasswordProtected&&this.isTalkEnabled},isPasswordProtectedByTalk:{get:function(){return this.share.sendPasswordByTalk},set:(be=ye(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.share.sendPasswordByTalk=t;case 1:case"end":return e.stop()}}),e,this)}))),function(e){return be.apply(this,arguments)})},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.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(e){this.share.permissions=e?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(i.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"===ge(this.config.passwordPolicy)}},methods:{onNewLinkShare:function(){var e=this;return ye(regeneratorRuntime.mark((function n(){var r,o,i,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 o=new m(r),n.next=25,new Promise((function(t){e.$emit("add:share",o,t)}));case 25:i=n.sent,e.open=!1,e.loading=!1,i.open=!0,n.next=34;break;case 31:return a=new m(r),n.next=34,e.pushNewLinkShare(a);case 34:case"end":return n.stop()}}),n)})))()},pushNewLinkShare:function(e,t){var n=this;return ye(regeneratorRuntime.mark((function r(){var o,i,a,s,c;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,n.loading=!0,n.errors={},o=(n.fileInfo.path+"/"+n.fileInfo.name).replace("//","/"),r.next=6,n.createShare({path:o,shareType:OC.Share.SHARE_TYPE_LINK,password:e.password,expireDate:e.expireDate});case 6:if(i=r.sent,n.open=!1,console.debug("Link share created",i),!t){r.next=15;break}return r.next=12,new Promise((function(e){n.$emit("update:share",i,e)}));case 12:a=r.sent,r.next=18;break;case 15:return r.next=17,new Promise((function(e){n.$emit("add:share",i,e)}));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,(c=s.data.ocs.meta.message).match(/password/i)?n.onSyncError("password",c):c.match(/date/i)?n.onSyncError("expireDate",c):n.onSyncError("pending",c);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(e){var t=parseInt(e.target.value,10);this.share.permissions=t,this.queueUpdate("permissions")},generatePassword:function(){var e=this;return ye(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.config.passwordPolicy.api||!e.config.passwordPolicy.api.generate){t.next=12;break}return t.prev=1,t.next=4,l.a.get(e.config.passwordPolicy.api.generate);case 4:if(!(n=t.sent).data.ocs.data.password){t.next=7;break}return t.abrupt("return",n.data.ocs.data.password);case 7:t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),console.info("Error generating password from password_policy",t.t0);case 12:return t.abrupt("return",Array(10).fill(0).reduce((function(e,t){return e+=xe.charAt(Math.floor(Math.random()*xe.length))}),""));case 13:case"end":return t.stop()}}),t,null,[[1,9]])})))()},copyLink:function(){var e=this;return ye(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.$copyText(e.shareLink);case 3:e.$refs.copyButton.$el.focus(),e.copySuccess=!0,e.copied=!0,t.next=13;break;case 8:t.prev=8,t.t0=t.catch(0),e.copySuccess=!1,e.copied=!0,console.error(t.t0);case 13:return t.prev=13,setTimeout((function(){e.copySuccess=!1,e.copied=!1}),4e3),t.finish(13);case 16:case"end":return t.stop()}}),t,null,[[0,8,13,16]])})))()},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)}}},Me=(r(372),{name:"SharingLinkList",components:{SharingEntryLink:Object(E.a)(we,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("li",{staticClass:"sharing-entry sharing-entry__link",class:{"sharing-entry--share":e.share}},[n("Avatar",{staticClass:"sharing-entry__avatar",class:e.isEmailShareType?"icon-mail-white":"icon-public-white",attrs:{"is-no-user":!0}}),e._v(" "),n("div",{staticClass:"sharing-entry__desc"},[n("h5",[e._v(e._s(e.title))])]),e._v(" "),e.share&&!e.isEmailShareType&&e.share.token?n("Actions",{ref:"copyButton",staticClass:"sharing-entry__copy"},[n("ActionLink",{attrs:{href:e.shareLink,target:"_blank",icon:e.copied&&e.copySuccess?"icon-checkmark-color":"icon-clippy"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.copyLink(t)}}},[e._v("\n\t\t\t"+e._s(e.clipboardTooltip)+"\n\t\t")])],1):e._e(),e._v(" "),e.loading||!e.pendingPassword&&!e.pendingExpirationDate?e.loading?n("div",{staticClass:"icon-loading-small sharing-entry__loading"}):n("Actions",{staticClass:"sharing-entry__actions",attrs:{"menu-align":"right",open:e.open},on:{"update:open":function(t){e.open=t},close:e.onMenuClose}},[e.share?[e.share.canEdit?[e.isFolder&&e.fileHasCreatePermission&&e.config.isPublicUploadEnabled?[n("ActionRadio",{attrs:{checked:e.sharePermissions===e.publicUploadRValue,value:e.publicUploadRValue,name:e.randomId,disabled:e.saving},on:{change:e.togglePermissions}},[e._v("\n\t\t\t\t\t\t"+e._s(e.t("files_sharing","Read only"))+"\n\t\t\t\t\t")]),e._v(" "),n("ActionRadio",{attrs:{checked:e.sharePermissions===e.publicUploadRWValue,value:e.publicUploadRWValue,disabled:e.saving,name:e.randomId},on:{change:e.togglePermissions}},[e._v("\n\t\t\t\t\t\t"+e._s(e.t("files_sharing","Allow upload and editing"))+"\n\t\t\t\t\t")]),e._v(" "),n("ActionRadio",{staticClass:"sharing-entry__action--public-upload",attrs:{checked:e.sharePermissions===e.publicUploadWValue,value:e.publicUploadWValue,disabled:e.saving,name:e.randomId},on:{change:e.togglePermissions}},[e._v("\n\t\t\t\t\t\t"+e._s(e.t("files_sharing","File drop (upload only)"))+"\n\t\t\t\t\t")])]:n("ActionCheckbox",{attrs:{checked:e.canUpdate,disabled:e.saving},on:{"update:checked":function(t){e.canUpdate=t},change:function(t){return e.queueUpdate("permissions")}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Allow editing"))+"\n\t\t\t\t")]),e._v(" "),n("ActionCheckbox",{attrs:{checked:e.share.hideDownload,disabled:e.saving},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(" "),n("ActionCheckbox",{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?n("ActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.password,show:e.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:e.errors.password},attrs:{disabled:e.saving,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.isPasswordProtectedByTalkAvailable?n("ActionCheckbox",{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(" "),n("ActionCheckbox",{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?n("ActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.expireDate,show:e.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:e.errors.expireDate},attrs:{disabled:e.saving,"first-day-of-week":e.firstDay,lang:e.lang,value:e.share.expireDate,"value-type":"format",icon:"icon-calendar-dark",type:"date","disabled-date":e.disabledDate},on:{"update:value":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(" "),n("ActionCheckbox",{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?n("ActionTextEditable",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.note,show:e.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: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(" "),e._l(e.externalActions,(function(t,r){var o=t.icon,i=t.url,a=t.name;return n("ActionLink",{key:r,attrs:{href:i(e.shareLink),icon:o,target:"_blank"}},[e._v("\n\t\t\t\t"+e._s(a)+"\n\t\t\t")])})),e._v(" "),e.share.canDelete?n("ActionButton",{attrs:{icon:"icon-close",disabled:e.saving},on:{click:function(t){return t.preventDefault(),e.onDelete(t)}}},[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?n("ActionButton",{staticClass:"new-share-link",attrs:{icon:"icon-add"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare(t)}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Add another link"))+"\n\t\t\t")]):e._e()]:e.canReshare?n("ActionButton",{staticClass:"new-share-link",attrs:{icon:"icon-add"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare(t)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Create a new share link"))+"\n\t\t")]):e._e()],2):n("Actions",{staticClass:"sharing-entry__actions",attrs:{"menu-align":"right",open:e.open},on:{"update:open":function(t){e.open=t},close:e.onNewLinkShare}},[e.errors.pending?n("ActionText",{class:{error:e.errors.pending},attrs:{icon:"icon-error"}},[e._v("\n\t\t\t"+e._s(e.errors.pending)+"\n\t\t")]):n("ActionText",{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.pendingPassword?n("ActionText",{attrs:{icon:"icon-password"}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Password protection (enforced)"))+"\n\t\t")]):e.config.enableLinkPasswordByDefault?n("ActionCheckbox",{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.pendingPassword||e.share.password?n("ActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.password,show:e.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: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?n("ActionText",{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?n("ActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.expireDate,show:e.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:e.saving,"first-day-of-week":e.firstDay,lang:e.lang,icon:"",type:"date","value-type":"format","disabled-date":e.disabledDate},model:{value:e.share.expireDate,callback:function(t){e.$set(e.share,"expireDate",t)},expression:"share.expireDate"}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Enter a date"))+"\n\t\t")]):e._e(),e._v(" "),n("ActionButton",{attrs:{icon:"icon-close"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onCancel(t)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Cancel"))+"\n\t\t")])],1)],1)}),[],!1,null,"2edd90d7",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 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)}}}),Te=Object(E.a)(Me,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.canLinkShare?n("ul",{staticClass:"sharing-link-list"},[!e.hasLinkShares&&e.canReshare?n("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(t,r){return n("SharingEntryLink",{key:t.id,attrs:{"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(void 0,arguments)}],"add:share":function(t){return e.addShare.apply(void 0,arguments)},"remove:share":e.removeShare}})})):e._e()],2):e._e()}),[],!1,null,null,null).exports,Ee={name:"SharingEntry",components:{Actions:x.a,ActionButton:V.a,ActionCheckbox:Ae.a,ActionInput:fe.a,ActionTextEditable:he.a,Avatar:s.a},directives:{Tooltip:M.a},mixins:[ne],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(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})}},isFolder:function(){return"dir"===this.fileInfo.type},hasExpirationDate:{get:function(){return this.config.isDefaultInternalExpireDateEnforced||!!this.share.expireDate},set:function(e){this.share.expireDate=e?""!==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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.isEditChecked,n=void 0===t?this.canEdit:t,r=e.isCreateChecked,o=void 0===r?this.canCreate:r,i=e.isDeleteChecked,a=void 0===i?this.canDelete:i,s=e.isReshareChecked,c=void 0===s?this.canReshare:s,l=this.permissionsRead|(o?this.permissionsCreate:0)|(a?this.permissionsDelete:0)|(n?this.permissionsEdit:0)|(c?this.permissionsShare:0);this.share.permissions=l,this.queueUpdate("permissions")},onMenuClose:function(){this.onNoteSubmit()}}},Ce=(r(374),{name:"SharingList",components:{SharingEntry:Object(E.a)(Ee,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("li",{staticClass:"sharing-entry"},[n("Avatar",{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,url:e.share.shareWithAvatar}}),e._v(" "),n("div",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:e.tooltip,expression:"tooltip",modifiers:{auto:!0}}],staticClass:"sharing-entry__desc"},[n("h5",[e._v(e._s(e.title))])]),e._v(" "),n("Actions",{staticClass:"sharing-entry__actions",attrs:{"menu-align":"right"},on:{close:e.onMenuClose}},[e.share.canEdit?[n("ActionCheckbox",{ref:"canEdit",attrs:{checked:e.canEdit,value:e.permissionsEdit,disabled:e.saving},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?n("ActionCheckbox",{ref:"canCreate",attrs:{checked:e.canCreate,value:e.permissionsCreate,disabled:e.saving},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?n("ActionCheckbox",{ref:"canDelete",attrs:{checked:e.canDelete,value:e.permissionsDelete,disabled:e.saving},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(" "),n("ActionCheckbox",{ref:"canReshare",attrs:{checked:e.canReshare,value:e.permissionsShare,disabled:e.saving},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._v(" "),n("ActionCheckbox",{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"+e._s(e.config.isDefaultExpireDateEnforced?e.t("files_sharing","Expiration date enforced"):e.t("files_sharing","Set expiration date"))+"\n\t\t\t")]),e._v(" "),e.hasExpirationDate?n("ActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.expireDate,show:e.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:e.errors.expireDate},attrs:{disabled:e.saving,"first-day-of-week":e.firstDay,lang:e.lang,value:e.share.expireDate,"value-type":"format",icon:"icon-calendar-dark",type:"date","disabled-date":e.disabledDate},on:{"update:value":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?[n("ActionCheckbox",{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?n("ActionTextEditable",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.note,show:e.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: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?n("ActionButton",{attrs:{icon:"icon-close",disabled:e.saving},on:{click:function(t){return t.preventDefault(),e.onDelete(t)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Unshare"))+"\n\t\t")]):e._e()],2)],1)}),[],!1,null,"54ef6c7d",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(e){var t=this.shares.findIndex((function(t){return t===e}));this.shares.splice(t,1)}}}),Ie=Object(E.a)(Ce,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ul",{staticClass:"sharing-sharee-list"},e._l(e.shares,(function(t){return n("SharingEntry",{key:t.id,attrs:{"file-info":e.fileInfo,share:t},on:{"remove:share":e.removeShare}})})),1)}),[],!1,null,null,null).exports;function Se(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _e(e,t)}(e,t)||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.")}()}function _e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Be(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}var Ne={name:"SharingTab",components:{Avatar:s.a,CollectionList:o.a,SharingEntryInternal:_,SharingEntrySimple:C,SharingInherited:se,SharingInput:Z,SharingLinkList:Te,SharingList:Ie,Tab:u.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(e,t){e.id!==t.id&&(this.resetState(),this.getShares())}},beforeMount:function(){this.getShares()},methods:{getShares:function(){var e,n=this;return(e=regeneratorRuntime.mark((function e(){var r,o,a,s,c,A,u,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n.loading=!0,r=Object(i.generateOcsUrl)("apps/files_sharing/api/v1",2)+"shares",o=(n.fileInfo.path+"/"+n.fileInfo.name).replace("//","/"),a=l.a.get(r,{params:{format:"json",path:o,reshares:!0}}),s=l.a.get(r,{params:{format:"json",path:o,shared_with_me:!0}}),e.next=9,Promise.all([a,s]);case 9:c=e.sent,A=Se(c,2),u=A[0],d=A[1],n.loading=!1,n.processSharedWithMe(d),n.processShares(u),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,o){var i=e.apply(t,n);function a(e){Be(i,r,o,a,s,"next",e)}function s(e){Be(i,r,o,a,s,"throw",e)}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(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 m(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})),console.debug("Processed",this.linkShares.length,"link share(s)"),console.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 m(n),o=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),i=r.ownerDisplayName,a=r.owner;this.sharedWithMe={displayName:i,title:o,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(e){e.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL?this.linkShares.unshift(e):this.shares.unshift(e)}}},ke=Object(E.a)(Ne,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("Tab",{class:{"icon-loading":e.loading},attrs:{id:e.id,icon:e.icon,name:e.name}},[e.error?n("div",{staticClass:"emptycontent"},[n("div",{staticClass:"icon icon-error"}),e._v(" "),n("h2",[e._v(e._s(e.error))])]):[e.isSharedWithMe?n("SharingEntrySimple",e._b({staticClass:"sharing-entry__reshare",scopedSlots:e._u([{key:"avatar",fn:function(){return[n("Avatar",{staticClass:"sharing-entry__avatar",attrs:{user:e.sharedWithMe.user,"display-name":e.sharedWithMe.displayName,"tooltip-message":""}})]},proxy:!0}],null,!1,1643724538)},"SharingEntrySimple",e.sharedWithMe,!1)):e._e(),e._v(" "),e.loading?e._e():n("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():n("SharingLinkList",{attrs:{"can-reshare":e.canReshare,"file-info":e.fileInfo,shares:e.linkShares}}),e._v(" "),e.loading?e._e():n("SharingList",{attrs:{shares:e.shares,"file-info":e.fileInfo}}),e._v(" "),e.canReshare&&!e.loading?n("SharingInherited",{attrs:{"file-info":e.fileInfo}}):e._e(),e._v(" "),n("SharingEntryInternal",{attrs:{"file-info":e.fileInfo}}),e._v(" "),e.fileInfo?n("CollectionList",{attrs:{id:""+e.fileInfo.id,type:"file",name:e.fileInfo.name}}):e._e(),e._v(" "),e._l(e.sections,(function(t,r){return n("div",{key:r,ref:"section-"+r,refInFor:!0,staticClass:"sharingTab__additionalContent"},[n(t(e.$refs["section-"+r],e.fileInfo),{tag:"component",attrs:{"file-info":e.fileInfo}})],1)}))]],2)}),[],!1,null,"06860d18",null).exports;function De(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Le(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var Oe=0;
/**
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
*