You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nextcloud/dist/files_sharing-files_sharing...

3 lines
109 KiB
JavaScript

/*! For license information please see files_sharing-files_sharing_tab.js.LICENSE.txt */
(()=>{"use strict";var e,i,s,a={49757:(e,i,s)=>{var a=s(20144),n=s(31352),r=s(1794),o=s(79753),h=s(75925),l=s.n(h),d=s(4820),c=s(79954),p=s(42515);class u{constructor(){this._capabilities=(0,p.getCapabilities)()}get defaultPermissions(){var e;return null===(e=this._capabilities.files_sharing)||void 0===e?void 0:e.default_permissions}get isPublicUploadEnabled(){var e;return null===(e=this._capabilities.files_sharing)||void 0===e?void 0:e.public.upload}get isShareWithLinkAllowed(){return document.getElementById("allowShareWithLink")&&"yes"===document.getElementById("allowShareWithLink").value}get federatedShareDocLink(){return OC.appConfig.core.federatedCloudShareDoc}get defaultExpirationDate(){return this.isDefaultExpireDateEnabled?new Date((new Date).setDate((new Date).getDate()+this.defaultExpireDate)):null}get defaultInternalExpirationDate(){return this.isDefaultInternalExpireDateEnabled?new Date((new Date).setDate((new Date).getDate()+this.defaultInternalExpireDate)):null}get defaultRemoteExpirationDateString(){return this.isDefaultRemoteExpireDateEnabled?new Date((new Date).setDate((new Date).getDate()+this.defaultRemoteExpireDate)):null}get enforcePasswordForPublicLink(){return!0===OC.appConfig.core.enforcePasswordForPublicLink}get enableLinkPasswordByDefault(){return!0===OC.appConfig.core.enableLinkPasswordByDefault}get isDefaultExpireDateEnforced(){return!0===OC.appConfig.core.defaultExpireDateEnforced}get isDefaultExpireDateEnabled(){return!0===OC.appConfig.core.defaultExpireDateEnabled}get isDefaultInternalExpireDateEnforced(){return!0===OC.appConfig.core.defaultInternalExpireDateEnforced}get isDefaultRemoteExpireDateEnforced(){return!0===OC.appConfig.core.defaultRemoteExpireDateEnforced}get isDefaultInternalExpireDateEnabled(){return!0===OC.appConfig.core.defaultInternalExpireDateEnabled}get isDefaultRemoteExpireDateEnabled(){return!0===OC.appConfig.core.defaultRemoteExpireDateEnabled}get isRemoteShareAllowed(){return!0===OC.appConfig.core.remoteShareAllowed}get isMailShareAllowed(){var e,t,i,s,a;return void 0!==(null===(e=this._capabilities)||void 0===e||null===(t=e.files_sharing)||void 0===t?void 0:t.sharebymail)&&!0===(null===(i=this._capabilities)||void 0===i||null===(s=i.files_sharing)||void 0===s||null===(a=s.public)||void 0===a?void 0:a.enabled)}get defaultExpireDate(){return OC.appConfig.core.defaultExpireDate}get defaultInternalExpireDate(){return OC.appConfig.core.defaultInternalExpireDate}get defaultRemoteExpireDate(){return OC.appConfig.core.defaultRemoteExpireDate}get isResharingAllowed(){return!0===OC.appConfig.core.resharingAllowed}get isPasswordForMailSharesRequired(){return void 0!==this._capabilities.files_sharing.sharebymail&&this._capabilities.files_sharing.sharebymail.password.enforced}get shouldAlwaysShowUnique(){var e,t;return!0===(null===(e=this._capabilities.files_sharing)||void 0===e||null===(t=e.sharee)||void 0===t?void 0:t.always_show_unique)}get allowGroupSharing(){return!0===OC.appConfig.core.allowGroupSharing}get maxAutocompleteResults(){return parseInt(OC.config["sharing.maxAutocompleteResults"],10)||25}get minSearchStringLength(){return parseInt(OC.config["sharing.minSearchStringLength"],10)||0}get passwordPolicy(){return this._capabilities.password_policy?this._capabilities.password_policy:{}}}var A=s(41922),g=s(25108);class f{constructor(e){var t,i,s,a;if(i=this,a=void 0,(s=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(s="_share"))in i?Object.defineProperty(i,s,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[s]=a,e.ocs&&e.ocs.data&&e.ocs.data[0]&&(e=e.ocs.data[0]),e.hide_download=!!e.hide_download,e.mail_send=!!e.mail_send,e.attributes&&"string"==typeof e.attributes)try{e.attributes=JSON.parse(e.attributes)}catch(t){g.warn("Could not parse share attributes returned by server",e.attributes)}e.attributes=null!==(t=e.attributes)&&void 0!==t?t:[],this._share=e}get state(){return this._share}get id(){return this._share.id}get type(){return this._share.share_type}get permissions(){return this._share.permissions}get attributes(){return this._share.attributes}set permissions(e){this._share.permissions=e}get owner(){return this._share.uid_owner}get ownerDisplayName(){return this._share.displayname_owner}get shareWith(){return this._share.share_with}get shareWithDisplayName(){return this._share.share_with_displayname||this._share.share_with}get shareWithDisplayNameUnique(){return this._share.share_with_displayname_unique||this._share.share_with}get shareWithLink(){return this._share.share_with_link}get shareWithAvatar(){return this._share.share_with_avatar}get uidFileOwner(){return this._share.uid_file_owner}get displaynameFileOwner(){return this._share.displayname_file_owner||this._share.uid_file_owner}get createdTime(){return this._share.stime}get expireDate(){return this._share.expiration}set expireDate(e){this._share.expiration=e}get token(){return this._share.token}get note(){return this._share.note}set note(e){this._share.note=e}get label(){var e;return null!==(e=this._share.label)&&void 0!==e?e:""}set label(e){this._share.label=e}get mailSend(){return!0===this._share.mail_send}get hideDownload(){return!0===this._share.hide_download}set hideDownload(e){this._share.hide_download=!0===e}get password(){return this._share.password}set password(e){this._share.password=e}get passwordExpirationTime(){return this._share.password_expiration_time}set passwordExpirationTime(e){this._share.password_expiration_time=e}get sendPasswordByTalk(){return this._share.send_password_by_talk}set sendPasswordByTalk(e){this._share.send_password_by_talk=e}get path(){return this._share.path}get itemType(){return this._share.item_type}get mimetype(){return this._share.mimetype}get fileSource(){return this._share.file_source}get fileTarget(){return this._share.file_target}get fileParent(){return this._share.file_parent}get hasReadPermission(){return!!(this.permissions&OC.PERMISSION_READ)}get hasCreatePermission(){return!!(this.permissions&OC.PERMISSION_CREATE)}get hasDeletePermission(){return!!(this.permissions&OC.PERMISSION_DELETE)}get hasUpdatePermission(){return!!(this.permissions&OC.PERMISSION_UPDATE)}get hasSharePermission(){return!!(this.permissions&OC.PERMISSION_SHARE)}get hasDownloadPermission(){for(const e in this._share.attributes){const t=this._share.attributes[e];if("permissions"===t.scope&&"download"===t.key)return t.enabled}return!0}set hasDownloadPermission(e){this.setAttribute("permissions","download",!!e)}setAttribute(e,t,i){const s={scope:e,key:t,enabled:i};for(const e in this._share.attributes){const t=this._share.attributes[e];if(t.scope===s.scope&&t.key===s.key)return void this._share.attributes.splice(e,1,s)}this._share.attributes.push(s)}get canEdit(){return!0===this._share.can_edit}get canDelete(){return!0===this._share.can_delete}get viaFileid(){return this._share.via_fileid}get viaPath(){return this._share.via_path}get parent(){return this._share.parent}get storageId(){return this._share.storage_id}get storage(){return this._share.storage}get itemSource(){return this._share.item_source}get status(){return this._share.status}}const _={data:()=>({SHARE_TYPES:A.D})};var m=s(64024),w=s(76212),E=s.n(w),v=s(12945),C=s.n(v);const S={name:"SharingEntrySimple",components:{NcActions:C()},props:{title:{type:String,default:"",required:!0},subtitle:{type:String,default:""},isUnique:{type:Boolean,default:!0},ariaExpanded:{type:Boolean,default:null}},computed:{ariaExpandedValue(){return null===this.ariaExpanded?this.ariaExpanded:this.ariaExpanded?"true":"false"}}};var y=s(93379),b=s.n(y),x=s(7795),P=s.n(x),T=s(90569),D=s.n(T),k=s(3565),R=s.n(k),I=s(19216),N=s.n(I),O=s(44589),L=s.n(O),Y=s(66452),H={};H.styleTagTransform=L(),H.setAttributes=R(),H.insert=D().bind(null,"head"),H.domAPI=P(),H.insertStyleElement=N(),b()(Y.Z,H),Y.Z&&Y.Z.locals&&Y.Z.locals;var B=s(51900);const U=(0,B.Z)(S,(function(){var e=this,t=e._self._c;return t("li",{staticClass:"sharing-entry"},[e._t("avatar"),e._v(" "),t("div",{staticClass:"sharing-entry__desc"},[t("span",{staticClass:"sharing-entry__title"},[e._v(e._s(e.title))]),e._v(" "),e.subtitle?t("p",[e._v("\n\t\t\t"+e._s(e.subtitle)+"\n\t\t")]):e._e()]),e._v(" "),e.$slots.default?t("NcActions",{ref:"actionsComponent",staticClass:"sharing-entry__actions",attrs:{"menu-align":"right","aria-expanded":e.ariaExpandedValue}},[e._t("default")],2):e._e()],2)}),[],!1,null,"1852ea78",null).exports;var F=s(25108);const q={name:"SharingEntryInternal",components:{NcActionLink:E(),SharingEntrySimple:U},props:{fileInfo:{type:Object,default:()=>{},required:!0}},data:()=>({copied:!1,copySuccess:!1}),computed:{internalLink(){return window.location.protocol+"//"+window.location.host+(0,o.generateUrl)("/f/")+this.fileInfo.id},copyLinkTooltip(){return this.copied?this.copySuccess?"":t("files_sharing","Cannot copy, please copy the link manually"):t("files_sharing","Copy internal link to clipboard")},internalLinkSubtitle(){return"dir"===this.fileInfo.type?t("files_sharing","Only works for users with access to this folder"):t("files_sharing","Only works for users with access to this file")}},methods:{async copyLink(){try{await navigator.clipboard.writeText(this.internalLink),(0,m.s$)(t("files_sharing","Link copied")),this.$refs.shareEntrySimple.$refs.actionsComponent.$el.focus(),this.copySuccess=!0,this.copied=!0}catch(e){this.copySuccess=!1,this.copied=!0,F.error(e)}finally{setTimeout((()=>{this.copySuccess=!1,this.copied=!1}),4e3)}}}};var M=s(2256),W={};W.styleTagTransform=L(),W.setAttributes=R(),W.insert=D().bind(null,"head"),W.domAPI=P(),W.insertStyleElement=N(),b()(M.Z,W),M.Z&&M.Z.locals&&M.Z.locals;const j=(0,B.Z)(q,(function(){var e=this,t=e._self._c;return t("ul",[t("SharingEntrySimple",{ref:"shareEntrySimple",staticClass:"sharing-entry__internal",attrs:{title:e.t("files_sharing","Internal link"),subtitle:e.internalLinkSubtitle},scopedSlots:e._u([{key:"avatar",fn:function(){return[t("div",{staticClass:"avatar-external icon-external-white"})]},proxy:!0}])},[e._v(" "),t("NcActionLink",{attrs:{href:e.internalLink,"aria-label":e.copyLinkTooltip,title:e.copyLinkTooltip,target:"_blank",icon:e.copied&&e.copySuccess?"icon-checkmark-color":"icon-clippy"},on:{click:function(t){return t.preventDefault(),e.copyLink.apply(null,arguments)}}})],1)],1)}),[],!1,null,"71a426be",null).exports;var Z=s(77958),V=s(69183),$=s(20296),G=s.n($),z=s(36456),Q=s.n(z),K=s(25108);const J=new u;async function X(){if(J.passwordPolicy.api&&J.passwordPolicy.api.generate)try{const e=await d.default.get(J.passwordPolicy.api.generate);if(e.data.ocs.data.password)return(0,m.s$)(t("files_sharing","Password created successfully")),e.data.ocs.data.password}catch(e){K.info("Error generating password from password_policy",e),(0,m.x2)(t("files_sharing","Error generating password from password policy"))}const e=new Uint8Array(10);self.crypto.getRandomValues(e);let i="";for(let t=0;t<e.length;t++)i+="abcdefgijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXYZ23456789".charAt(.20392156862745098*e[t]);return i}s(35449);var ee=s(25108);const te=(0,o.generateOcsUrl)("apps/files_sharing/api/v1/shares"),ie={methods:{async createShare(e){let{path:i,permissions:s,shareType:a,shareWith:n,publicUpload:r,password:o,sendPasswordByTalk:h,expireDate:l,label:c,note:p,attributes:u}=e;try{var A;const e=await d.default.post(te,{path:i,permissions:s,shareType:a,shareWith:n,publicUpload:r,password:o,sendPasswordByTalk:h,expireDate:l,label:c,note:p,attributes:u});if(null==e||null===(A=e.data)||void 0===A||!A.ocs)throw e;const t=new f(e.data.ocs.data);return(0,V.j8)("files_sharing:share:created",{share:t}),t}catch(e){var g,_,m,w;ee.error("Error while creating share",e);const i=null==e||null===(g=e.response)||void 0===g||null===(_=g.data)||void 0===_||null===(m=_.ocs)||void 0===m||null===(w=m.meta)||void 0===w?void 0:w.message;throw OC.Notification.showTemporary(i?t("files_sharing","Error creating the share: {errorMessage}",{errorMessage:i}):t("files_sharing","Error creating the share"),{type:"error"}),e}},async deleteShare(e){try{var i;const t=await d.default.delete(te+"/".concat(e));if(null==t||null===(i=t.data)||void 0===i||!i.ocs)throw t;return(0,V.j8)("files_sharing:share:deleted",{id:e}),!0}catch(e){var s,a,n,r;ee.error("Error while deleting share",e);const i=null==e||null===(s=e.response)||void 0===s||null===(a=s.data)||void 0===a||null===(n=a.ocs)||void 0===n||null===(r=n.meta)||void 0===r?void 0:r.message;throw OC.Notification.showTemporary(i?t("files_sharing","Error deleting the share: {errorMessage}",{errorMessage:i}):t("files_sharing","Error deleting the share"),{type:"error"}),e}},async updateShare(e,i){try{var s;const t=await d.default.put(te+"/".concat(e),i);if((0,V.j8)("files_sharing:share:updated",{id:e}),null!=t&&null!==(s=t.data)&&void 0!==s&&s.ocs)return t.data.ocs.data;throw t}catch(e){if(ee.error("Error while updating share",e),400!==e.response.status){var a,n,r,o;const i=null==e||null===(a=e.response)||void 0===a||null===(n=a.data)||void 0===n||null===(r=n.ocs)||void 0===r||null===(o=r.meta)||void 0===o?void 0:o.message;OC.Notification.showTemporary(i?t("files_sharing","Error updating the share: {errorMessage}",{errorMessage:i}):t("files_sharing","Error updating the share"),{type:"error"})}const i=e.response.data.ocs.meta.message;throw new Error(i)}}}},se={methods:{async openSharingDetails(e){let t={};e.handler?(this.suggestions&&(e.suggestions=this.suggestions,e.fileInfo=this.fileInfo,e.query=this.query),t=await e.handler(e),t=new f(t)):t=this.mapShareRequestToShareObject(e);const i={fileInfo:this.fileInfo,share:t};this.$emit("open-sharing-details",i)},openShareDetailsForCustomSettings(e){e.setCustomPermissions=!0,this.openSharingDetails(e)},mapShareRequestToShareObject(e){if(e.id)return e;const t={attributes:[{enabled:!0,key:"download",scope:"permissions"}],share_type:e.shareType,share_with:e.shareWith,is_no_user:e.isNoUser,user:e.shareWith,share_with_displayname:e.displayName,subtitle:e.subtitle,permissions:e.permissions,expiration:""};return new f(t)}}};var ae=s(25108);const ne={name:"SharingInput",components:{NcSelect:Q()},mixins:[_,ie,se],props:{shares:{type:Array,default:()=>[],required:!0},linkShares:{type:Array,default:()=>[],required:!0},fileInfo:{type:Object,default:()=>{},required:!0},reshare:{type:f,default:null},canReshare:{type:Boolean,required:!0}},data:()=>({config:new u,loading:!1,query:"",recommendations:[],ShareSearch:OCA.Sharing.ShareSearch.state,suggestions:[],value:null}),computed:{externalResults(){return this.ShareSearch.results},inputPlaceholder(){const e=this.config.isRemoteShareAllowed;return this.canReshare?e?t("files_sharing","Name, email, or Federated Cloud ID …"):t("files_sharing","Name or email …"):t("files_sharing","Resharing is not allowed")},isValidQuery(){return this.query&&""!==this.query.trim()&&this.query.length>this.config.minSearchStringLength},options(){return this.isValidQuery?this.suggestions:this.recommendations},noResultText(){return this.loading?t("files_sharing","Searching …"):t("files_sharing","No elements found.")}},mounted(){this.getRecommendations()},methods:{handleOpen(){(0,V.j8)("viewer:trapElements:changed",this.$refs.select.$el)},async asyncFind(e){this.query=e.trim(),this.isValidQuery&&(this.loading=!0,await this.debounceGetSuggestions(e))},async getSuggestions(e){let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.loading=!0,!0===OC.getCapabilities().files_sharing.sharee.query_lookup_default&&(i=!0);const s=[this.SHARE_TYPES.SHARE_TYPE_USER,this.SHARE_TYPES.SHARE_TYPE_GROUP,this.SHARE_TYPES.SHARE_TYPE_REMOTE,this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP,this.SHARE_TYPES.SHARE_TYPE_CIRCLE,this.SHARE_TYPES.SHARE_TYPE_ROOM,this.SHARE_TYPES.SHARE_TYPE_GUEST,this.SHARE_TYPES.SHARE_TYPE_DECK,this.SHARE_TYPES.SHARE_TYPE_SCIENCEMESH];!0===OC.getCapabilities().files_sharing.public.enabled&&s.push(this.SHARE_TYPES.SHARE_TYPE_EMAIL);let a=null;try{a=await d.default.get((0,o.generateOcsUrl)("apps/files_sharing/api/v1/sharees"),{params:{format:"json",itemType:"dir"===this.fileInfo.type?"folder":"file",search:e,lookup:i,perPage:this.config.maxAutocompleteResults,shareType:s}})}catch(e){return void ae.error("Error fetching suggestions",e)}const n=a.data.ocs.data,r=a.data.ocs.data.exact;n.exact=[];const h=Object.values(r).reduce(((e,t)=>e.concat(t)),[]),l=Object.values(n).reduce(((e,t)=>e.concat(t)),[]),c=this.filterOutExistingShares(h).map((e=>this.formatForMultiselect(e))).sort(((e,t)=>e.shareType-t.shareType)),p=this.filterOutExistingShares(l).map((e=>this.formatForMultiselect(e))).sort(((e,t)=>e.shareType-t.shareType)),u=[];n.lookupEnabled&&!i&&u.push({id:"global-lookup",isNoUser:!0,displayName:t("files_sharing","Search globally"),lookup:!0});const A=this.externalResults.filter((e=>!e.condition||e.condition(this))),g=c.concat(p).concat(A).concat(u),f=g.reduce(((e,t)=>t.displayName?(e[t.displayName]||(e[t.displayName]=0),e[t.displayName]++,e):e),{});this.suggestions=g.map((e=>f[e.displayName]>1&&!e.desc?{...e,desc:e.shareWithDisplayNameUnique}:e)),this.loading=!1,ae.info("suggestions",this.suggestions)},debounceGetSuggestions:G()((function(){this.getSuggestions(...arguments)}),300),async getRecommendations(){this.loading=!0;let e=null;try{e=await d.default.get((0,o.generateOcsUrl)("apps/files_sharing/api/v1/sharees_recommended"),{params:{format:"json",itemType:this.fileInfo.type}})}catch(e){return void ae.error("Error fetching recommendations",e)}const t=this.externalResults.filter((e=>!e.condition||e.condition(this))),i=Object.values(e.data.ocs.data.exact).reduce(((e,t)=>e.concat(t)),[]);this.recommendations=this.filterOutExistingShares(i).map((e=>this.formatForMultiselect(e))).concat(t),this.loading=!1,ae.info("recommendations",this.recommendations)},filterOutExistingShares(e){return e.reduce(((e,t)=>{if("object"!=typeof t)return e;try{if(t.value.shareType===this.SHARE_TYPES.SHARE_TYPE_USER){if(t.value.shareWith===(0,Z.ts)().uid)return e;if(this.reshare&&t.value.shareWith===this.reshare.owner)return e}if(t.value.shareType===this.SHARE_TYPES.SHARE_TYPE_EMAIL){if(-1!==this.linkShares.map((e=>e.shareWith)).indexOf(t.value.shareWith.trim()))return e}else{const i=this.shares.reduce(((e,t)=>(e[t.shareWith]=t.type,e)),{}),s=t.value.shareWith.trim();if(s in i&&i[s]===t.value.shareType)return e}e.push(t)}catch{return e}return e}),[])},shareTypeToIcon(e){switch(e){case this.SHARE_TYPES.SHARE_TYPE_GUEST:return{icon:"icon-user",iconTitle:t("files_sharing","Guest")};case this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP:case this.SHARE_TYPES.SHARE_TYPE_GROUP:return{icon:"icon-group",iconTitle:t("files_sharing","Group")};case this.SHARE_TYPES.SHARE_TYPE_EMAIL:return{icon:"icon-mail",iconTitle:t("files_sharing","Email")};case this.SHARE_TYPES.SHARE_TYPE_CIRCLE:return{icon:"icon-circle",iconTitle:t("files_sharing","Circle")};case this.SHARE_TYPES.SHARE_TYPE_ROOM:return{icon:"icon-room",iconTitle:t("files_sharing","Talk conversation")};case this.SHARE_TYPES.SHARE_TYPE_DECK:return{icon:"icon-deck",iconTitle:t("files_sharing","Deck board")};case this.SHARE_TYPES.SHARE_TYPE_SCIENCEMESH:return{icon:"icon-sciencemesh",iconTitle:t("files_sharing","ScienceMesh")};default:return{}}},formatForMultiselect(e){let i;var s;if(e.value.shareType===this.SHARE_TYPES.SHARE_TYPE_USER&&this.config.shouldAlwaysShowUnique)i=null!==(s=e.shareWithDisplayNameUnique)&&void 0!==s?s:"";else if(e.value.shareType!==this.SHARE_TYPES.SHARE_TYPE_REMOTE&&e.value.shareType!==this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP||!e.value.server)if(e.value.shareType===this.SHARE_TYPES.SHARE_TYPE_EMAIL)i=e.value.shareWith;else{var a;i=null!==(a=e.shareWithDescription)&&void 0!==a?a:""}else i=t("files_sharing","on {server}",{server:e.value.server});return{shareWith:e.value.shareWith,shareType:e.value.shareType,user:e.uuid||e.value.shareWith,isNoUser:e.value.shareType!==this.SHARE_TYPES.SHARE_TYPE_USER,displayName:e.name||e.label,subtitle:i,shareWithDisplayNameUnique:e.shareWithDisplayNameUnique||"",...this.shareTypeToIcon(e.value.shareType)}},async addShare(e){if(this.value=null,e.lookup)return await this.getSuggestions(this.query,!0),this.$nextTick((()=>{this.$refs.select.$children[0].open=!0})),!0;if(e.handler){const t=await e.handler(this);return this.$emit("add:share",new f(t)),!0}this.loading=!0,ae.debug("Adding a new share from the input for",e);try{let t=null;this.config.enforcePasswordForPublicLink&&e.shareType===this.SHARE_TYPES.SHARE_TYPE_EMAIL&&(t=await X());const i=(this.fileInfo.path+"/"+this.fileInfo.name).replace("//","/"),s=await this.createShare({path:i,shareType:e.shareType,shareWith:e.shareWith,password:t,permissions:this.fileInfo.sharePermissions&OC.getCapabilities().files_sharing.default_permissions,attributes:JSON.stringify(this.fileInfo.shareAttributes)});t?(s.newPassword=t,(await new Promise((e=>{this.$emit("add:share",s,e)}))).open=!0):this.$emit("add:share",s),await this.getRecommendations()}catch(t){this.$nextTick((()=>{this.$refs.select.$children[0].open=!0})),this.query=e.shareWith,ae.error("Error while adding new share",t)}finally{this.loading=!1}}}};var re=s(24764),oe={};oe.styleTagTransform=L(),oe.setAttributes=R(),oe.insert=D().bind(null,"head"),oe.domAPI=P(),oe.insertStyleElement=N(),b()(re.Z,oe),re.Z&&re.Z.locals&&re.Z.locals;const he=(0,B.Z)(ne,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"sharing-search"},[t("label",{attrs:{for:"sharing-search-input"}},[e._v(e._s(e.t("files_sharing","Search for share recipients")))]),e._v(" "),t("NcSelect",{ref:"select",staticClass:"sharing-search__input",attrs:{"input-id":"sharing-search-input",disabled:!e.canReshare,loading:e.loading,filterable:!1,placeholder:e.inputPlaceholder,"clear-search-on-blur":()=>!1,"user-select":!0,options:e.options},on:{open:e.handleOpen,search:e.asyncFind,"option:selected":e.openSharingDetails},scopedSlots:e._u([{key:"no-options",fn:function(t){let{search:i}=t;return[e._v("\n\t\t\t"+e._s(i?e.noResultText:e.t("files_sharing","No recommendations. Start typing."))+"\n\t\t")]}}]),model:{value:e.value,callback:function(t){e.value=t},expression:"value"}})],1)}),[],!1,null,null,null).exports;var le=s(45400),de=s.n(le),ce=s(65358),pe=s(1162),ue=s.n(pe),Ae=s(25746);const ge={NONE:0,READ:1,UPDATE:2,CREATE:4,DELETE:8,SHARE:16},fe={READ_ONLY:ge.READ,UPLOAD_AND_UPDATE:ge.READ|ge.UPDATE|ge.CREATE|ge.DELETE,FILE_DROP:ge.CREATE,ALL:ge.UPDATE|ge.CREATE|ge.READ|ge.DELETE|ge.SHARE,ALL_FILE:ge.UPDATE|ge.READ|ge.SHARE};var _e=s(25108);const me={mixins:[ie,_],props:{fileInfo:{type:Object,default:()=>{},required:!0},share:{type:f,default:null},isUnique:{type:Boolean,default:!0}},data(){var e;return{config:new u,errors:{},loading:!1,saving:!1,open:!1,updateQueue:new Ae.Z({concurrency:1}),reactiveState:null===(e=this.share)||void 0===e?void 0:e.state}},computed:{hasNote:{get(){return""!==this.share.note},set(e){this.share.note=e?null:""}},dateTomorrow:()=>new Date((new Date).setDate((new Date).getDate()+1)),lang(){const e=window.dayNamesShort?window.dayNamesShort:["Sun.","Mon.","Tue.","Wed.","Thu.","Fri.","Sat."],t=window.monthNamesShort?window.monthNamesShort:["Jan.","Feb.","Mar.","Apr.","May.","Jun.","Jul.","Aug.","Sep.","Oct.","Nov.","Dec."];return{formatLocale:{firstDayOfWeek:window.firstDay?window.firstDay:0,monthsShort:t,weekdaysMin:e,weekdaysShort:e},monthFormat:"MMM"}},isFolder(){return"dir"===this.fileInfo.type},isPublicShare(){var e;const t=null!==(e=this.share.shareType)&&void 0!==e?e:this.share.type;return[this.SHARE_TYPES.SHARE_TYPE_LINK,this.SHARE_TYPES.SHARE_TYPE_EMAIL].includes(t)},isRemoteShare(){return this.share.type===this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP||this.share.type===this.SHARE_TYPES.SHARE_TYPE_REMOTE},isShareOwner(){return this.share&&this.share.owner===(0,Z.ts)().uid},isExpiryDateEnforced(){return this.isPublicShare?this.config.isDefaultExpireDateEnforced:this.isRemoteShare?this.config.isDefaultRemoteExpireDateEnforced:this.config.isDefaultInternalExpireDateEnforced},hasCustomPermissions(){return![fe.ALL,fe.READ_ONLY,fe.FILE_DROP].includes(this.share.permissions)},maxExpirationDateEnforced(){return this.isExpiryDateEnforced?this.isPublicShare?this.config.defaultExpirationDate:this.isRemoteShare?this.config.defaultRemoteExpirationDateString:this.config.defaultInternalExpirationDate:null}},methods:{checkShare:e=>(!e.password||"string"==typeof e.password&&""!==e.password.trim())&&!(e.expirationDate&&!e.expirationDate.isValid()),parseDateString(e){var t;if(e)return new Date(null===(t=e.match(/([0-9]{4}-[0-9]{2}-[0-9]{2})/i))||void 0===t?void 0:t.pop())},formatDateToString:e=>new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())).toISOString().split("T")[0],onExpirationChange:G()((function(e){this.share.expireDate=this.formatDateToString(new Date(e))}),500),onExpirationDisable(){this.share.expireDate=""},onNoteChange(e){this.$set(this.share,"newNote",e.trim())},onNoteSubmit(){this.share.newNote&&(this.share.note=this.share.newNote,this.$delete(this.share,"newNote"),this.queueUpdate("note"))},async onDelete(){try{this.loading=!0,this.open=!1,await this.deleteShare(this.share.id),_e.debug("Share deleted",this.share.id);const e="file"===this.share.itemType?t("files_sharing",'File "{path}" has been unshared',{path:this.share.path}):t("files_sharing",'Folder "{path}" has been unshared',{path:this.share.path});(0,m.s$)(e),this.$emit("remove:share",this.share)}catch(e){this.open=!0}finally{this.loading=!1}},queueUpdate(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];if(0!==i.length){if(this.share.id){const e={};return i.forEach((t=>{"object"==typeof this.share[t]?e[t]=JSON.stringify(this.share[t]):e[t]=this.share[t].toString()})),void this.updateQueue.add((async()=>{this.saving=!0,this.errors={};try{const s=await this.updateShare(this.share.id,e);i.indexOf("password")>=0&&(this.$delete(this.share,"newPassword"),this.share.passwordExpirationTime=s.password_expiration_time),this.$delete(this.errors,i[0]),(0,m.s$)(t("files_sharing","Share {propertyName} saved",{propertyName:i[0]}))}catch({message:e}){e&&""!==e&&(this.onSyncError(i[0],e),(0,m.x2)(t("files_sharing",e)))}finally{this.saving=!1}}))}_e.debug("Updated local share",this.share)}},onSyncError(e,t){switch(this.open=!0,e){case"password":case"pending":case"expireDate":case"label":case"note":{this.$set(this.errors,e,t);let i=this.$refs[e];if(i){i.$el&&(i=i.$el);const e=i.querySelector(".focusable");e&&e.focus()}break}case"sendPasswordByTalk":this.$set(this.errors,e,t),this.share.sendPasswordByTalk=!this.share.sendPasswordByTalk}},debounceQueueUpdate:G()((function(e){this.queueUpdate(e)}),500)}},we={name:"SharingEntryInherited",components:{NcActionButton:de(),NcActionLink:E(),NcActionText:ue(),NcAvatar:l(),SharingEntrySimple:U},mixins:[me],props:{share:{type:f,required:!0}},computed:{viaFileTargetUrl(){return(0,o.generateUrl)("/f/{fileid}",{fileid:this.share.viaFileid})},viaFolderName(){return(0,ce.EZ)(this.share.viaPath)}}};var Ee=s(72021),ve={};ve.styleTagTransform=L(),ve.setAttributes=R(),ve.insert=D().bind(null,"head"),ve.domAPI=P(),ve.insertStyleElement=N(),b()(Ee.Z,ve),Ee.Z&&Ee.Z.locals&&Ee.Z.locals;const Ce=(0,B.Z)(we,(function(){var e=this,t=e._self._c;return t("SharingEntrySimple",{key:e.share.id,staticClass:"sharing-entry__inherited",attrs:{title:e.share.shareWithDisplayName},scopedSlots:e._u([{key:"avatar",fn:function(){return[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{user:e.share.shareWith,"display-name":e.share.shareWithDisplayName}})]},proxy:!0}])},[e._v(" "),t("NcActionText",{attrs:{icon:"icon-user"}},[e._v("\n\t\t"+e._s(e.t("files_sharing","Added by {initiator}",{initiator:e.share.ownerDisplayName}))+"\n\t")]),e._v(" "),e.share.viaPath&&e.share.viaFileid?t("NcActionLink",{attrs:{icon:"icon-folder",href:e.viaFileTargetUrl}},[e._v("\n\t\t"+e._s(e.t("files_sharing","Via “{folder}”",{folder:e.viaFolderName}))+"\n\t")]):e._e(),e._v(" "),e.share.canDelete?t("NcActionButton",{attrs:{icon:"icon-close"},on:{click:function(t){return t.preventDefault(),e.onDelete.apply(null,arguments)}}},[e._v("\n\t\t"+e._s(e.t("files_sharing","Unshare"))+"\n\t")]):e._e()],1)}),[],!1,null,"283ca89e",null).exports;var Se=s(25108);const ye={name:"SharingInherited",components:{NcActionButton:de(),SharingEntryInherited:Ce,SharingEntrySimple:U},props:{fileInfo:{type:Object,default:()=>{},required:!0}},data:()=>({loaded:!1,loading:!1,showInheritedShares:!1,shares:[]}),computed:{showInheritedSharesIcon(){return this.loading?"icon-loading-small":this.showInheritedShares?"icon-triangle-n":"icon-triangle-s"},mainTitle:()=>t("files_sharing","Others with access"),subTitle(){return this.showInheritedShares&&0===this.shares.length?t("files_sharing","No other users with access found"):""},toggleTooltip(){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(){return"".concat(this.fileInfo.path,"/").concat(this.fileInfo.name).replace("//","/")}},watch:{fileInfo(){this.resetState()}},methods:{toggleInheritedShares(){this.showInheritedShares=!this.showInheritedShares,this.showInheritedShares?this.fetchInheritedShares():this.resetState()},async fetchInheritedShares(){this.loading=!0;try{const e=(0,o.generateOcsUrl)("apps/files_sharing/api/v1/shares/inherited?format=json&path={path}",{path:this.fullPath}),t=await d.default.get(e);this.shares=t.data.ocs.data.map((e=>new f(e))).sort(((e,t)=>t.createdTime-e.createdTime)),Se.info(this.shares),this.loaded=!0}catch(e){OC.Notification.showTemporary(t("files_sharing","Unable to fetch inherited shares"),{type:"error"})}finally{this.loading=!1}},resetState(){this.loaded=!1,this.loading=!1,this.showInheritedShares=!1,this.shares=[]},removeShare(e){const t=this.shares.findIndex((t=>t===e));this.shares.splice(t,1)}}};var be=s(84772),xe={};xe.styleTagTransform=L(),xe.setAttributes=R(),xe.insert=D().bind(null,"head"),xe.domAPI=P(),xe.insertStyleElement=N(),b()(be.Z,xe),be.Z&&be.Z.locals&&be.Z.locals;const Pe=(0,B.Z)(ye,(function(){var e=this,t=e._self._c;return t("ul",{attrs:{id:"sharing-inherited-shares"}},[t("SharingEntrySimple",{staticClass:"sharing-entry__inherited",attrs:{title:e.mainTitle,subtitle:e.subTitle,"aria-expanded":e.showInheritedShares},scopedSlots:e._u([{key:"avatar",fn:function(){return[t("div",{staticClass:"avatar-shared icon-more-white"})]},proxy:!0}])},[e._v(" "),t("NcActionButton",{attrs:{icon:e.showInheritedSharesIcon,"aria-label":e.toggleTooltip,title:e.toggleTooltip},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.toggleInheritedShares.apply(null,arguments)}}})],1),e._v(" "),e._l(e.shares,(function(i){return t("SharingEntryInherited",{key:i.id,attrs:{"file-info":e.fileInfo,share:i},on:{"remove:share":e.removeShare}})}))],2)}),[],!1,null,"05b67dc8",null).exports;var Te=s(79570),De=s.n(Te),ke=s(875),Re=s.n(ke),Ie=s(55976),Ne=s(3641),Oe=s(15303);const Le={components:{DropdownIcon:Ne.Z},mixins:[me,se,_],props:{share:{type:Object,required:!0},toggle:{type:Boolean,default:!1}},data(){return{selectedOption:"",showDropdown:this.toggle,focusTrap:null}},computed:{canViewText:()=>t("files_sharing","View only"),canEditText:()=>t("files_sharing","Can edit"),fileDropText:()=>t("files_sharing","File drop"),customPermissionsText:()=>t("files_sharing","Custom permissions"),preSelectedOption(){return(this.share.permissions&~ge.SHARE)===fe.READ_ONLY?this.canViewText:this.share.permissions===fe.ALL||this.share.permissions===fe.ALL_FILE?this.canEditText:(this.share.permissions&~ge.SHARE)===fe.FILE_DROP?this.fileDropText:this.customPermissionsText},options(){const e=[this.canViewText,this.canEditText];return this.supportsFileDrop&&e.push(this.fileDropText),e.push(this.customPermissionsText),e},supportsFileDrop(){if(this.isFolder&&this.config.isPublicUploadEnabled){var e;const t=null!==(e=this.share.type)&&void 0!==e?e:this.share.shareType;return[this.SHARE_TYPES.SHARE_TYPE_LINK,this.SHARE_TYPES.SHARE_TYPE_EMAIL].includes(t)}return!1},dropDownPermissionValue(){switch(this.selectedOption){case this.canEditText:return this.isFolder?fe.ALL:fe.ALL_FILE;case this.fileDropText:return fe.FILE_DROP;case this.customPermissionsText:return"custom";case this.canViewText:default:return fe.READ_ONLY}},dropdownId:()=>"dropdown-".concat(Math.random().toString(36).substr(2,9))},watch:{toggle(e){this.showDropdown=e}},mounted(){this.initializeComponent(),window.addEventListener("click",this.handleClickOutside)},beforeDestroy(){window.removeEventListener("click",this.handleClickOutside)},methods:{toggleDropdown(){this.showDropdown=!this.showDropdown,this.showDropdown?this.$nextTick((()=>{this.useFocusTrap()})):this.clearFocusTrap()},closeDropdown(){this.clearFocusTrap(),this.showDropdown=!1},selectOption(e){this.selectedOption=e,e===this.customPermissionsText?this.$emit("open-sharing-details"):(this.share.permissions=this.dropDownPermissionValue,this.queueUpdate("permissions")),this.showDropdown=!1},initializeComponent(){this.selectedOption=this.preSelectedOption},handleClickOutside(e){const t=this.$refs.quickShareDropdownContainer;t&&!t.contains(e.target)&&(this.showDropdown=!1)},useFocusTrap(){Object.assign(window,{_nc_focus_trap:window._nc_focus_trap||[]});const e=this.$refs.quickShareDropdown;this.focusTrap=(0,Oe.createFocusTrap)(e,{allowOutsideClick:!0,trapStack:window._nc_focus_trap}),this.focusTrap.activate()},clearFocusTrap(){var e;null===(e=this.focusTrap)||void 0===e||e.deactivate(),this.focusTrap=null},shiftFocusForward(){let e=document.activeElement.nextElementSibling;e||(e=this.$refs.quickShareDropdown.firstElementChild),e.focus()},shiftFocusBackward(){let e=document.activeElement.previousElementSibling;e||(e=this.$refs.quickShareDropdown.lastElementChild),e.focus()},handleArrowUp(){this.shiftFocusBackward()},handleArrowDown(){this.shiftFocusForward()}}},Ye=Le;var He=s(96021),Be={};Be.styleTagTransform=L(),Be.setAttributes=R(),Be.insert=D().bind(null,"head"),Be.domAPI=P(),Be.insertStyleElement=N(),b()(He.Z,Be),He.Z&&He.Z.locals&&He.Z.locals;const Ue=(0,B.Z)(Ye,(function(){var e=this,t=e._self._c;return t("div",{ref:"quickShareDropdownContainer",class:{active:e.showDropdown,"share-select":!0}},[t("span",{staticClass:"trigger-text",attrs:{id:e.dropdownId,"aria-expanded":e.showDropdown,"aria-haspopup":!0,"aria-label":"Quick share options dropdown"},on:{click:e.toggleDropdown}},[e._v("\n\t\t"+e._s(e.selectedOption)+"\n\t\t"),t("DropdownIcon",{attrs:{size:15}})],1),e._v(" "),e.showDropdown?t("div",{ref:"quickShareDropdown",staticClass:"share-select-dropdown",attrs:{"aria-labelledby":e.dropdownId,tabindex:"0"},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:e.handleArrowDown.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:e.handleArrowUp.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:e.closeDropdown.apply(null,arguments)}]}},e._l(e.options,(function(i){return t("button",{key:i,class:{"dropdown-item":!0,selected:i===e.selectedOption},attrs:{"aria-selected":i===e.selectedOption},on:{click:function(t){return e.selectOption(i)}}},[e._v("\n\t\t\t"+e._s(i)+"\n\t\t")])})),0):e._e()])}),[],!1,null,"d960cabe",null).exports,Fe={name:"ExternalShareAction",props:{id:{type:String,required:!0},action:{type:Object,default:()=>({})},fileInfo:{type:Object,default:()=>{},required:!0},share:{type:f,default:null}},computed:{data(){return this.action.data(this)}}},qe=(0,B.Z)(Fe,(function(){var e=this;return(0,e._self._c)(e.data.is,e._g(e._b({tag:"Component"},"Component",e.data,!1),e.action.handlers),[e._v("\n\t"+e._s(e.data.text)+"\n")])}),[],!1,null,null,null).exports;var Me=s(25108);const We={name:"SharingEntryLink",components:{ExternalShareAction:qe,NcActions:C(),NcActionButton:de(),NcActionInput:De(),NcActionLink:E(),NcActionText:ue(),NcActionSeparator:Re(),NcAvatar:l(),Tune:Ie.Z,QuickShareSelect:Ue},mixins:[me,se],props:{canReshare:{type:Boolean,default:!0},index:{type:Number,default:null}},data:()=>({showDropdown:!1,copySuccess:!0,copied:!1,pending:!1,ExternalLegacyLinkActions:OCA.Sharing.ExternalLinkActions.state,ExternalShareActions:OCA.Sharing.ExternalShareActions.state}),computed:{title(){if(this.share&&this.share.id){if(!this.isShareOwner&&this.share.ownerDisplayName)return this.isEmailShareType?t("files_sharing","{shareWith} by {initiator}",{shareWith:this.share.shareWith,initiator:this.share.ownerDisplayName}):t("files_sharing","Shared via link by {initiator}",{initiator:this.share.ownerDisplayName});if(this.share.label&&""!==this.share.label.trim())return this.isEmailShareType?t("files_sharing","Mail share ({label})",{label:this.share.label.trim()}):t("files_sharing","Share link ({label})",{label:this.share.label.trim()});if(this.isEmailShareType)return this.share.shareWith}return this.index>1?t("files_sharing","Share link ({index})",{index:this.index}):t("files_sharing","Share link")},subtitle(){return this.isEmailShareType&&this.title!==this.share.shareWith?this.share.shareWith:null},isPasswordProtected:{get(){return this.config.enforcePasswordForPublicLink||!!this.share.password},async set(e){a.default.set(this.share,"password",e?await X():""),a.default.set(this.share,"newPassword",this.share.password)}},passwordExpirationTime(){if(null===this.share.passwordExpirationTime)return null;const e=moment(this.share.passwordExpirationTime);return!(e.diff(moment())<0)&&e.fromNow()},isTalkEnabled:()=>void 0!==OC.appswebroots.spreed,isPasswordProtectedByTalkAvailable(){return this.isPasswordProtected&&this.isTalkEnabled},isPasswordProtectedByTalk:{get(){return this.share.sendPasswordByTalk},async set(e){this.share.sendPasswordByTalk=e}},isEmailShareType(){return!!this.share&&this.share.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL},canTogglePasswordProtectedByTalkAvailable(){return!(!this.isPasswordProtected||this.isEmailShareType&&!this.hasUnsavedPassword)},pendingPassword(){return this.config.enableLinkPasswordByDefault&&this.share&&!this.share.id},pendingEnforcedPassword(){return this.config.enforcePasswordForPublicLink&&this.share&&!this.share.id},pendingExpirationDate(){return this.config.isDefaultExpireDateEnforced&&this.share&&!this.share.id},hasUnsavedPassword(){return void 0!==this.share.newPassword},shareLink(){return window.location.protocol+"//"+window.location.host+(0,o.generateUrl)("/s/")+this.share.token},actionsTooltip(){return t("files_sharing",'Actions for "{title}"',{title:this.title})},copyLinkTooltip(){return this.copied?this.copySuccess?"":t("files_sharing","Cannot copy, please copy the link manually"):t("files_sharing",'Copy public link of "{title}" to clipboard',{title:this.title})},externalLegacyLinkActions(){return this.ExternalLegacyLinkActions.actions},externalLinkActions(){return this.ExternalShareActions.actions.filter((e=>e.shareType.includes(A.D.SHARE_TYPE_LINK)||e.shareType.includes(A.D.SHARE_TYPE_EMAIL)))},isPasswordPolicyEnabled(){return"object"==typeof this.config.passwordPolicy},canChangeHideDownload(){return this.fileInfo.shareAttributes.some((e=>"download"===e.key&&"permissions"===e.scope&&!1===e.enabled))}},methods:{async onNewLinkShare(){if(this.loading)return;const e={share_type:A.D.SHARE_TYPE_LINK};if(this.config.isDefaultExpireDateEnforced&&(e.expiration=this.formatDateToString(this.config.defaultExpirationDate)),this.config.enableLinkPasswordByDefault||this.config.enforcePasswordForPublicLink||this.config.isDefaultExpireDateEnforced){if(this.pending=!0,this.share&&!this.share.id){if(this.checkShare(this.share)){try{await this.pushNewLinkShare(this.share,!0)}catch(e){return this.pending=!1,Me.error(e),!1}return!0}return this.open=!0,OC.Notification.showTemporary(t("files_sharing","Error, please enter proper password and/or expiration date")),!1}(this.config.enableLinkPasswordByDefault||this.config.enforcePasswordForPublicLink)&&(e.password=await X());const i=new f(e),s=await new Promise((e=>{this.$emit("add:share",i,e)}));this.open=!1,this.pending=!1,s.open=!0}else{const t=new f(e);await this.pushNewLinkShare(t)}},async pushNewLinkShare(e,i){try{if(this.loading)return!0;this.loading=!0,this.errors={};const s={path:(this.fileInfo.path+"/"+this.fileInfo.name).replace("//","/"),shareType:A.D.SHARE_TYPE_LINK,password:e.password,expireDate:e.expireDate,attributes:JSON.stringify(this.fileInfo.shareAttributes)};Me.debug("Creating link share with options",s);const a=await this.createShare(s);let n;this.open=!1,Me.debug("Link share created",a),n=i?await new Promise((e=>{this.$emit("update:share",a,e)})):await new Promise((e=>{this.$emit("add:share",a,e)})),this.config.enforcePasswordForPublicLink||n.copyLink(),(0,m.s$)(t("files_sharing","Link share created"))}catch(e){var s,a,n,r;const i=null==e||null===(s=e.response)||void 0===s||null===(a=s.data)||void 0===a||null===(n=a.ocs)||void 0===n||null===(r=n.meta)||void 0===r?void 0:r.message;if(!i)return(0,m.x2)(t("files_sharing","Error while creating the share")),void Me.error(e);throw i.match(/password/i)?this.onSyncError("password",i):i.match(/date/i)?this.onSyncError("expireDate",i):this.onSyncError("pending",i),e}finally{this.loading=!1}},async copyLink(){try{await navigator.clipboard.writeText(this.shareLink),(0,m.s$)(t("files_sharing","Link copied")),this.$refs.copyButton.$el.focus(),this.copySuccess=!0,this.copied=!0}catch(e){this.copySuccess=!1,this.copied=!0,Me.error(e)}finally{setTimeout((()=>{this.copySuccess=!1,this.copied=!1}),4e3)}},onPasswordChange(e){this.$set(this.share,"newPassword",e)},onPasswordDisable(){this.share.password="",this.$delete(this.share,"newPassword"),this.share.id&&this.queueUpdate("password")},onPasswordSubmit(){this.hasUnsavedPassword&&(this.share.password=this.share.newPassword.trim(),this.queueUpdate("password"))},onPasswordProtectedByTalkChange(){this.hasUnsavedPassword&&(this.share.password=this.share.newPassword.trim()),this.queueUpdate("sendPasswordByTalk","password")},onMenuClose(){this.onPasswordSubmit(),this.onNoteSubmit()},onCancel(){this.$emit("remove:share",this.share)},toggleQuickShareSelect(){this.showDropdown=!this.showDropdown}}},je=We;var Ze=s(33864),Ve={};Ve.styleTagTransform=L(),Ve.setAttributes=R(),Ve.insert=D().bind(null,"head"),Ve.domAPI=P(),Ve.insertStyleElement=N(),b()(Ze.Z,Ve),Ze.Z&&Ze.Z.locals&&Ze.Z.locals;const $e={name:"SharingLinkList",components:{SharingEntryLink:(0,B.Z)(je,(function(){var e=this,t=e._self._c;return t("li",{staticClass:"sharing-entry sharing-entry__link",class:{"sharing-entry--share":e.share}},[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{"is-no-user":!0,"icon-class":e.isEmailShareType?"avatar-link-share icon-mail-white":"avatar-link-share icon-public-white"}}),e._v(" "),t("div",{staticClass:"sharing-entry__summary"},[t("div",{staticClass:"sharing-entry__desc",on:{click:function(t){return t.preventDefault(),e.toggleQuickShareSelect.apply(null,arguments)}}},[t("span",{staticClass:"sharing-entry__title",attrs:{title:e.title}},[e._v("\n\t\t\t\t"+e._s(e.title)+"\n\t\t\t")]),e._v(" "),e.subtitle?t("p",[e._v("\n\t\t\t\t"+e._s(e.subtitle)+"\n\t\t\t")]):e._e(),e._v(" "),e.share&&void 0!==e.share.permissions?t("QuickShareSelect",{attrs:{share:e.share,"file-info":e.fileInfo,toggle:e.showDropdown},on:{"open-sharing-details":function(t){return e.openShareDetailsForCustomSettings(e.share)}}}):e._e()],1),e._v(" "),e.share&&!e.isEmailShareType&&e.share.token?t("NcActions",{ref:"copyButton",staticClass:"sharing-entry__copy"},[t("NcActionLink",{attrs:{href:e.shareLink,target:"_blank",title:e.copyLinkTooltip,"aria-label":e.copyLinkTooltip,icon:e.copied&&e.copySuccess?"icon-checkmark-color":"icon-clippy"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.copyLink.apply(null,arguments)}}})],1):e._e()],1),e._v(" "),!e.pending&&(e.pendingPassword||e.pendingEnforcedPassword||e.pendingExpirationDate)?t("NcActions",{staticClass:"sharing-entry__actions",attrs:{"aria-label":e.actionsTooltip,"menu-align":"right",open:e.open},on:{"update:open":function(t){e.open=t},close:e.onCancel}},[e.errors.pending?t("NcActionText",{class:{error:e.errors.pending},attrs:{icon:"icon-error"}},[e._v("\n\t\t\t"+e._s(e.errors.pending)+"\n\t\t")]):t("NcActionText",{attrs:{icon:"icon-info"}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Please enter the following required information before creating the share"))+"\n\t\t")]),e._v(" "),e.pendingEnforcedPassword?t("NcActionText",{attrs:{icon:"icon-password"}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Password protection (enforced)"))+"\n\t\t")]):e.pendingPassword?t("NcActionCheckbox",{staticClass:"share-link-password-checkbox",attrs:{checked:e.isPasswordProtected,disabled:e.config.enforcePasswordForPublicLink||e.saving},on:{"update:checked":function(t){e.isPasswordProtected=t},uncheck:e.onPasswordDisable}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Password protection"))+"\n\t\t")]):e._e(),e._v(" "),e.pendingEnforcedPassword||e.share.password?t("NcActionInput",{staticClass:"share-link-password",attrs:{value:e.share.password,disabled:e.saving,required:e.config.enableLinkPasswordByDefault||e.config.enforcePasswordForPublicLink,minlength:e.isPasswordPolicyEnabled&&e.config.passwordPolicy.minLength,icon:"",autocomplete:"new-password"},on:{"update:value":function(t){return e.$set(e.share,"password",t)},submit:e.onNewLinkShare}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Enter a password"))+"\n\t\t")]):e._e(),e._v(" "),e.pendingExpirationDate?t("NcActionText",{attrs:{icon:"icon-calendar-dark"}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Expiration date (enforced)"))+"\n\t\t")]):e._e(),e._v(" "),e.pendingExpirationDate?t("NcActionInput",{staticClass:"share-link-expire-date",attrs:{disabled:e.saving,"is-native-picker":!0,"hide-label":!0,value:new Date(e.share.expireDate),type:"date",min:e.dateTomorrow,max:e.maxExpirationDateEnforced},on:{input:e.onExpirationChange}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Enter a date"))+"\n\t\t")]):e._e(),e._v(" "),t("NcActionButton",{attrs:{icon:"icon-checkmark"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Create share"))+"\n\t\t")]),e._v(" "),t("NcActionButton",{attrs:{icon:"icon-close"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onCancel.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Cancel"))+"\n\t\t")])],1):e.loading?t("div",{staticClass:"icon-loading-small sharing-entry__loading"}):t("NcActions",{staticClass:"sharing-entry__actions",attrs:{"aria-label":e.actionsTooltip,"menu-align":"right",open:e.open},on:{"update:open":function(t){e.open=t},close:e.onMenuClose}},[e.share?[e.share.canEdit&&e.canReshare?[t("NcActionButton",{attrs:{disabled:e.saving},on:{click:function(t){return t.preventDefault(),e.openSharingDetails.apply(null,arguments)}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("Tune")]},proxy:!0}],null,!1,961531849)},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Customize link"))+"\n\t\t\t\t")])]:e._e(),e._v(" "),t("NcActionSeparator"),e._v(" "),e._l(e.externalLinkActions,(function(i){return t("ExternalShareAction",{key:i.id,attrs:{id:i.id,action:i,"file-info":e.fileInfo,share:e.share}})})),e._v(" "),e._l(e.externalLegacyLinkActions,(function(i,s){let{icon:a,url:n,name:r}=i;return t("NcActionLink",{key:s,attrs:{href:n(e.shareLink),icon:a,target:"_blank"}},[e._v("\n\t\t\t\t"+e._s(r)+"\n\t\t\t")])})),e._v(" "),!e.isEmailShareType&&e.canReshare?t("NcActionButton",{staticClass:"new-share-link",attrs:{icon:"icon-add"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare.apply(null,arguments)}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Add another link"))+"\n\t\t\t")]):e._e(),e._v(" "),e.share.canDelete?t("NcActionButton",{attrs:{icon:"icon-close",disabled:e.saving},on:{click:function(t){return t.preventDefault(),e.onDelete.apply(null,arguments)}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Unshare"))+"\n\t\t\t")]):e._e()]:e.canReshare?t("NcActionButton",{staticClass:"new-share-link",attrs:{title:e.t("files_sharing","Create a new share link"),"aria-label":e.t("files_sharing","Create a new share link"),icon:e.loading?"icon-loading-small":"icon-add"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare.apply(null,arguments)}}}):e._e()],2)],1)}),[],!1,null,"d952affa",null).exports},mixins:[_,se],props:{fileInfo:{type:Object,default:()=>{},required:!0},shares:{type:Array,default:()=>[],required:!0},canReshare:{type:Boolean,required:!0}},data:()=>({canLinkShare:OC.getCapabilities().files_sharing.public.enabled}),computed:{hasLinkShares(){return this.shares.filter((e=>e.type===this.SHARE_TYPES.SHARE_TYPE_LINK)).length>0},hasShares(){return this.shares.length>0}},methods:{addShare(e,t){this.shares.unshift(e),this.awaitForShare(e,t)},awaitForShare(e,t){this.$nextTick((()=>{const i=this.$children.find((t=>t.share===e));i&&t(i)}))},removeShare(e){const t=this.shares.findIndex((t=>t===e));this.shares.splice(t,1)}}},Ge=(0,B.Z)($e,(function(){var e=this,t=e._self._c;return e.canLinkShare?t("ul",{staticClass:"sharing-link-list"},[!e.hasLinkShares&&e.canReshare?t("SharingEntryLink",{attrs:{"can-reshare":e.canReshare,"file-info":e.fileInfo},on:{"add:share":e.addShare}}):e._e(),e._v(" "),e.hasShares?e._l(e.shares,(function(i,s){return t("SharingEntryLink",{key:i.id,attrs:{index:e.shares.length>1?s+1:null,"can-reshare":e.canReshare,share:e.shares[s],"file-info":e.fileInfo},on:{"update:share":[function(t){return e.$set(e.shares,s,t)},function(t){return e.awaitForShare(...arguments)}],"add:share":function(t){return e.addShare(...arguments)},"remove:share":e.removeShare,"open-sharing-details":function(t){return e.openSharingDetails(i)}}})})):e._e()],2):e._e()}),[],!1,null,null,null).exports;var ze=s(10861),Qe=s.n(ze),Ke=s(89115);const Je={name:"SharingEntry",components:{NcButton:Qe(),NcAvatar:l(),DotsHorizontalIcon:Ke.default,NcSelect:Q(),QuickShareSelect:Ue},mixins:[me,se],data:()=>({showDropdown:!1}),computed:{title(){let 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(){if(this.share.owner!==this.share.uidFileOwner){const e={user:this.share.shareWithDisplayName,owner:this.share.ownerDisplayName};return this.share.type===this.SHARE_TYPES.SHARE_TYPE_GROUP?t("files_sharing","Shared with the group {user} by {owner}",e):this.share.type===this.SHARE_TYPES.SHARE_TYPE_ROOM?t("files_sharing","Shared with the conversation {user} by {owner}",e):t("files_sharing","Shared with {user} by {owner}",e)}return null},hasStatus(){return this.share.type===this.SHARE_TYPES.SHARE_TYPE_USER&&"object"==typeof this.share.status&&!Array.isArray(this.share.status)}},methods:{onMenuClose(){this.onNoteSubmit()},toggleQuickShareSelect(){this.showDropdown=!this.showDropdown}}};var Xe=s(38879),et={};et.styleTagTransform=L(),et.setAttributes=R(),et.insert=D().bind(null,"head"),et.domAPI=P(),et.insertStyleElement=N(),b()(Xe.Z,et),Xe.Z&&Xe.Z.locals&&Xe.Z.locals;const tt={name:"SharingList",components:{SharingEntry:(0,B.Z)(Je,(function(){var e=this,t=e._self._c;return t("li",{staticClass:"sharing-entry"},[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{"is-no-user":e.share.type!==e.SHARE_TYPES.SHARE_TYPE_USER,user:e.share.shareWith,"display-name":e.share.shareWithDisplayName,"menu-position":"left",url:e.share.shareWithAvatar}}),e._v(" "),t("div",{staticClass:"sharing-entry__summary",on:{click:function(t){return t.preventDefault(),e.toggleQuickShareSelect.apply(null,arguments)}}},[t(e.share.shareWithLink?"a":"div",{tag:"component",staticClass:"sharing-entry__summary__desc",attrs:{title:e.tooltip,"aria-label":e.tooltip,href:e.share.shareWithLink}},[t("span",[e._v(e._s(e.title)+"\n\t\t\t\t"),e.isUnique?e._e():t("span",{staticClass:"sharing-entry__summary__desc-unique"},[e._v(" ("+e._s(e.share.shareWithDisplayNameUnique)+")")]),e._v(" "),e.hasStatus&&e.share.status.message?t("small",[e._v("("+e._s(e.share.status.message)+")")]):e._e()])]),e._v(" "),t("QuickShareSelect",{attrs:{share:e.share,"file-info":e.fileInfo,toggle:e.showDropdown},on:{"open-sharing-details":function(t){return e.openShareDetailsForCustomSettings(e.share)}}})],1),e._v(" "),t("NcButton",{staticClass:"sharing-entry__action",attrs:{"aria-label":e.t("files_sharing","Open Sharing Details"),type:"tertiary-no-background"},on:{click:function(t){return e.openSharingDetails(e.share)}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("DotsHorizontalIcon",{attrs:{size:20}})]},proxy:!0}])})],1)}),[],!1,null,"7bfd2f06",null).exports},mixins:[_,se],props:{fileInfo:{type:Object,default:()=>{},required:!0},shares:{type:Array,default:()=>[],required:!0}},computed:{hasShares(){return 0===this.shares.length},isUnique(){return e=>[...this.shares].filter((t=>e.type===this.SHARE_TYPES.SHARE_TYPE_USER&&e.shareWithDisplayName===t.shareWithDisplayName)).length<=1}}},it=(0,B.Z)(tt,(function(){var e=this,t=e._self._c;return t("ul",{staticClass:"sharing-sharee-list"},e._l(e.shares,(function(i){return t("SharingEntry",{key:i.id,attrs:{"file-info":e.fileInfo,share:i,"is-unique":e.isUnique(i)},on:{"open-sharing-details":function(t){return e.openSharingDetails(i)}}})})),1)}),[],!1,null,null,null).exports;var st=s(36029),at=s.n(st),nt=s(36767),rt=s.n(nt),ot=s(19286),ht=s.n(ot),lt=s(20571),dt=s.n(lt),ct=s(10549),pt=s(82675),ut=s(73229),At=s(41447),gt=s(19695),ft=s(50413),_t=s(42055),mt=s(76205),wt=s(82640),Et=s(75762),vt=s(20404),Ct=s(25108);const St={name:"SharingDetailsTab",components:{NcAvatar:l(),NcButton:Qe(),NcInputField:at(),NcDatetimePicker:rt(),NcDateTimePickerNative:ht(),NcCheckboxRadioSwitch:dt(),CloseIcon:pt.default,CircleIcon:ct.Z,EditIcon:ut.default,LinkIcon:gt.Z,GroupIcon:ft.Z,ShareIcon:_t.Z,UserIcon:mt.Z,UploadIcon:Et.Z,ViewIcon:wt.default,MenuDownIcon:vt.Z,DotsHorizontalIcon:Ke.default},mixins:[_,ie,me],props:{shareRequestValue:{type:Object,required:!1},fileInfo:{type:Object,required:!0},share:{type:Object,required:!0}},data:()=>({writeNoteToRecipientIsChecked:!1,sharingPermission:fe.ALL.toString(),revertSharingPermission:fe.ALL.toString(),setCustomPermissions:!1,passwordError:!1,advancedSectionAccordionExpanded:!1,bundledPermissions:fe,isFirstComponentLoad:!0,test:!1}),computed:{title(){let e=t("files_sharing","Share with ");return this.share.type===this.SHARE_TYPES.SHARE_TYPE_USER?e+=this.share.shareWithDisplayName:this.share.type===this.SHARE_TYPES.SHARE_TYPE_LINK?e=t("files_sharing","Share link"):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},canEdit:{get(){return this.share.hasUpdatePermission},set(e){this.updateAtomicPermissions({isEditChecked:e})}},canCreate:{get(){return this.share.hasCreatePermission},set(e){this.updateAtomicPermissions({isCreateChecked:e})}},canDelete:{get(){return this.share.hasDeletePermission},set(e){this.updateAtomicPermissions({isDeleteChecked:e})}},canReshare:{get(){return this.share.hasSharePermission},set(e){this.updateAtomicPermissions({isReshareChecked:e})}},canDownload:{get(){var e;return(null===(e=this.share.attributes.find((e=>"download"===e.key)))||void 0===e?void 0:e.enabled)||!1},set(e){const t=this.share.attributes.find((e=>"download"===e.key));t&&(t.enabled=e)}},hasRead:{get(){return this.share.hasReadPermission},set(e){this.updateAtomicPermissions({isReadChecked:e})}},hasExpirationDate:{get(){return this.isValidShareAttribute(this.share.expireDate)},set(e){this.share.expireDate=e?this.formatDateToString(this.defaultExpiryDate):""}},isPasswordProtected:{get(){return this.config.enforcePasswordForPublicLink||!!this.share.password},async set(e){e?(this.share.password=await X(),this.$set(this.share,"newPassword",this.share.password)):(this.share.password="",this.$delete(this.share,"newPassword"))}},isFolder(){return"dir"===this.fileInfo.type},isSetDownloadButtonVisible(){return this.isFolder||["application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation"].includes(this.fileInfo.mimetype)},isPasswordEnforced(){return this.isPublicShare&&this.config.enforcePasswordForPublicLink},defaultExpiryDate(){return(this.isGroupShare||this.isUserShare)&&this.config.isDefaultInternalExpireDateEnabled?new Date(this.config.defaultInternalExpirationDate):this.isRemoteShare&&this.config.isDefaultRemoteExpireDateEnabled?new Date(this.config.defaultRemoteExpireDateEnabled):this.isPublicShare&&this.config.isDefaultExpireDateEnabled?new Date(this.config.defaultExpirationDate):new Date((new Date).setDate((new Date).getDate()+1))},isUserShare(){return this.share.type===this.SHARE_TYPES.SHARE_TYPE_USER},isGroupShare(){return this.share.type===this.SHARE_TYPES.SHARE_TYPE_GROUP},isNewShare(){return!this.share.id},allowsFileDrop(){return!(!this.isFolder||!this.config.isPublicUploadEnabled||this.share.type!==this.SHARE_TYPES.SHARE_TYPE_LINK&&this.share.type!==this.SHARE_TYPES.SHARE_TYPE_EMAIL)},hasFileDropPermissions(){return this.share.permissions===this.bundledPermissions.FILE_DROP},shareButtonText(){return this.isNewShare?t("files_sharing","Save share"):t("files_sharing","Update share")},canSetEdit(){return this.fileInfo.sharePermissions&OC.PERMISSION_UPDATE||this.canEdit},canSetCreate(){return this.fileInfo.sharePermissions&OC.PERMISSION_CREATE||this.canCreate},canSetDelete(){return this.fileInfo.sharePermissions&OC.PERMISSION_DELETE||this.canDelete},canSetReshare(){return this.fileInfo.sharePermissions&OC.PERMISSION_SHARE||this.canReshare},canSetDownload(){return this.fileInfo.canDownload()||this.canDownload},hasUnsavedPassword(){return void 0!==this.share.newPassword},passwordExpirationTime(){if(!this.isValidShareAttribute(this.share.passwordExpirationTime))return null;const e=moment(this.share.passwordExpirationTime);return!(e.diff(moment())<0)&&e.fromNow()},isTalkEnabled:()=>void 0!==OC.appswebroots.spreed,isPasswordProtectedByTalkAvailable(){return this.isPasswordProtected&&this.isTalkEnabled},isPasswordProtectedByTalk:{get(){return this.share.sendPasswordByTalk},async set(e){this.share.sendPasswordByTalk=e}},isEmailShareType(){return!!this.share&&this.share.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL},canTogglePasswordProtectedByTalkAvailable(){return!(!this.isPublicShare||!this.isPasswordProtected||this.isEmailShareType&&!this.hasUnsavedPassword||void 0===OC.appswebroots.spreed)},canChangeHideDownload(){return this.fileInfo.shareAttributes.some((e=>"download"===e.key&&"permissions"===e.scope&&!1===e.enabled))},customPermissionsList(){const e={[ge.READ]:this.t("files_sharing","Read"),[ge.CREATE]:this.t("files_sharing","Create"),[ge.UPDATE]:this.t("files_sharing","Edit"),[ge.SHARE]:this.t("files_sharing","Share"),[ge.DELETE]:this.t("files_sharing","Delete")};return[ge.READ,ge.CREATE,ge.UPDATE,ge.SHARE,ge.DELETE].filter((e=>{return t=this.share.permissions,i=e,t!==ge.NONE&&(t&i)===i;var t,i})).map(((t,i)=>0===i?e[t]:e[t].toLocaleLowerCase((0,n.G3)()))).join(", ")},advancedControlExpandedValue(){return this.advancedSectionAccordionExpanded?"true":"false"}},watch:{setCustomPermissions(e){this.sharingPermission=e?"custom":this.revertSharingPermission}},beforeMount(){this.initializePermissions(),this.initializeAttributes(),Ct.debug("shareSentIn",this.share),Ct.debug("config",this.config)},mounted(){var e,t;null===(e=this.$refs.quickPermissions)||void 0===e||null===(t=e.querySelector("input:checked"))||void 0===t||t.focus()},methods:{updateAtomicPermissions(){let{isReadChecked:e=this.hasRead,isEditChecked:t=this.canEdit,isCreateChecked:i=this.canCreate,isDeleteChecked:s=this.canDelete,isReshareChecked:a=this.canReshare}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=0|(e?ge.READ:0)|(i?ge.CREATE:0)|(s?ge.DELETE:0)|(t?ge.UPDATE:0)|(a?ge.SHARE:0);this.share.permissions=n},expandCustomPermissions(){this.advancedSectionAccordionExpanded||(this.advancedSectionAccordionExpanded=!0),this.toggleCustomPermissions()},toggleCustomPermissions(e){const t="custom"===this.sharingPermission;this.revertSharingPermission=t?"custom":e,this.setCustomPermissions=t},async initializeAttributes(){if(this.isNewShare)return this.isPasswordEnforced&&this.isPublicShare&&(this.$set(this.share,"newPassword",await X()),this.advancedSectionAccordionExpanded=!0),this.isPublicShare&&this.config.isDefaultExpireDateEnabled?this.share.expireDate=this.config.defaultExpirationDate.toDateString():this.isRemoteShare&&this.config.isDefaultRemoteExpireDateEnabled?this.share.expireDate=this.config.defaultRemoteExpirationDateString.toDateString():this.config.isDefaultInternalExpireDateEnabled&&(this.share.expireDate=this.config.defaultInternalExpirationDate.toDateString()),void(this.isValidShareAttribute(this.share.expireDate)&&(this.advancedSectionAccordionExpanded=!0));!this.isValidShareAttribute(this.share.expireDate)&&this.isExpiryDateEnforced&&(this.hasExpirationDate=!0),(this.isValidShareAttribute(this.share.password)||this.isValidShareAttribute(this.share.expireDate)||this.isValidShareAttribute(this.share.label))&&(this.advancedSectionAccordionExpanded=!0)},handleShareType(){"shareType"in this.share?this.share.type=this.share.shareType:this.share.share_type&&(this.share.type=this.share.share_type)},handleDefaultPermissions(){if(this.isNewShare){const e=this.config.defaultPermissions;e===fe.READ_ONLY||e===fe.ALL?this.sharingPermission=e.toString():(this.sharingPermission="custom",this.share.permissions=e,this.advancedSectionAccordionExpanded=!0,this.setCustomPermissions=!0)}},handleCustomPermissions(){this.isNewShare||!this.hasCustomPermissions&&!this.share.setCustomPermissions?this.share.permissions&&(this.sharingPermission=this.share.permissions.toString()):(this.sharingPermission="custom",this.advancedSectionAccordionExpanded=!0,this.setCustomPermissions=!0)},initializePermissions(){this.handleShareType(),this.handleDefaultPermissions(),this.handleCustomPermissions()},async saveShare(){const e=["permissions","attributes","note","expireDate"];this.isPublicShare&&e.push("label","password","hideDownload");const t=parseInt(this.sharingPermission);if(this.setCustomPermissions?this.updateAtomicPermissions():this.share.permissions=t,this.isFolder||this.share.permissions!==fe.ALL||(this.share.permissions=fe.ALL_FILE),this.writeNoteToRecipientIsChecked||(this.share.note=""),this.isPasswordProtected?this.hasUnsavedPassword&&this.isValidShareAttribute(this.share.newPassword)?(this.share.password=this.share.newPassword,this.$delete(this.share,"newPassword")):this.isPasswordEnforced&&!this.isValidShareAttribute(this.share.password)&&(this.passwordError=!0):this.share.password="",this.hasExpirationDate||(this.share.expireDate=""),this.isNewShare){const e={permissions:this.share.permissions,shareType:this.share.type,shareWith:this.share.shareWith,attributes:this.share.attributes,note:this.share.note,fileInfo:this.fileInfo};e.expireDate=this.hasExpirationDate?this.share.expireDate:"",this.isPasswordProtected&&(e.password=this.share.password);const t=await this.addShare(e,this.fileInfo);this.share=t,this.$emit("add:share",this.share)}else this.queueUpdate(...e);this.$emit("close-sharing-details")},async addShare(e,t){Ct.debug("Adding a new share from the input for",e);try{const i=(t.path+"/"+t.name).replace("//","/");return await this.createShare({path:i,shareType:e.shareType,shareWith:e.shareWith,permissions:e.permissions,expireDate:e.expireDate,attributes:JSON.stringify(e.attributes),...e.note?{note:e.note}:{},...e.password?{password:e.password}:{}})}catch(e){Ct.error("Error while adding new share",e)}},async removeShare(){await this.onDelete(),this.$emit("close-sharing-details")},onPasswordChange(e){this.passwordError=!this.isValidShareAttribute(e),this.$set(this.share,"newPassword",e)},onPasswordProtectedByTalkChange(){this.hasUnsavedPassword&&(this.share.password=this.share.newPassword.trim()),this.queueUpdate("sendPasswordByTalk","password")},isValidShareAttribute:e=>![null,void 0].includes(e)&&e.trim().length>0,getShareTypeIcon(e){switch(e){case this.SHARE_TYPES.SHARE_TYPE_LINK:return gt.Z;case this.SHARE_TYPES.SHARE_TYPE_GUEST:return mt.Z;case this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP:case this.SHARE_TYPES.SHARE_TYPE_GROUP:return ft.Z;case this.SHARE_TYPES.SHARE_TYPE_EMAIL:return At.Z;case this.SHARE_TYPES.SHARE_TYPE_CIRCLE:return ct.Z;case this.SHARE_TYPES.SHARE_TYPE_ROOM:case this.SHARE_TYPES.SHARE_TYPE_DECK:case this.SHARE_TYPES.SHARE_TYPE_SCIENCEMESH:return _t.Z;default:return null}}}};var yt=s(80337),bt={};bt.styleTagTransform=L(),bt.setAttributes=R(),bt.insert=D().bind(null,"head"),bt.domAPI=P(),bt.insertStyleElement=N(),b()(yt.Z,bt),yt.Z&&yt.Z.locals&&yt.Z.locals;const xt=(0,B.Z)(St,(function(){var e,t=this,i=t._self._c;return i("div",{staticClass:"sharingTabDetailsView"},[i("div",{staticClass:"sharingTabDetailsView__header"},[i("span",[t.isUserShare?i("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{"is-no-user":t.share.shareType!==t.SHARE_TYPES.SHARE_TYPE_USER,user:t.share.shareWith,"display-name":t.share.shareWithDisplayName,"menu-position":"left",url:t.share.shareWithAvatar}}):t._e(),t._v(" "),i(t.getShareTypeIcon(t.share.type),{tag:"component",attrs:{size:32}})],1),t._v(" "),i("span",[i("h1",[t._v(t._s(t.title))])])]),t._v(" "),i("div",{staticClass:"sharingTabDetailsView__wrapper"},[i("div",{ref:"quickPermissions",staticClass:"sharingTabDetailsView__quick-permissions"},[i("div",[i("NcCheckboxRadioSwitch",{attrs:{"button-variant":!0,checked:t.sharingPermission,value:t.bundledPermissions.READ_ONLY.toString(),name:"sharing_permission_radio",type:"radio","button-variant-grouped":"vertical"},on:{"update:checked":[function(e){t.sharingPermission=e},t.toggleCustomPermissions]}},[i("ViewIcon",{attrs:{size:20}}),t._v(" "),i("span",[t._v(t._s(t.t("files_sharing","View only")))])],1),t._v(" "),i("NcCheckboxRadioSwitch",{attrs:{"button-variant":!0,checked:t.sharingPermission,value:t.bundledPermissions.ALL.toString(),name:"sharing_permission_radio",type:"radio","button-variant-grouped":"vertical"},on:{"update:checked":[function(e){t.sharingPermission=e},t.toggleCustomPermissions]}},[i("EditIcon",{attrs:{size:20}}),t._v(" "),t.allowsFileDrop?[i("span",[t._v(t._s(t.t("files_sharing","Allow upload and editing")))])]:[i("span",[t._v(t._s(t.t("files_sharing","Allow editing")))])]],2),t._v(" "),t.allowsFileDrop?i("NcCheckboxRadioSwitch",{attrs:{"button-variant":!0,checked:t.sharingPermission,value:t.bundledPermissions.FILE_DROP.toString(),name:"sharing_permission_radio",type:"radio","button-variant-grouped":"vertical"},on:{"update:checked":[function(e){t.sharingPermission=e},t.toggleCustomPermissions]}},[i("UploadIcon",{attrs:{size:20}}),t._v(" "),i("span",[t._v(t._s(t.t("files_sharing","File drop")))]),t._v(" "),i("small",[t._v(t._s(t.t("files_sharing","Upload only")))])],1):t._e(),t._v(" "),i("NcCheckboxRadioSwitch",{attrs:{"button-variant":!0,checked:t.sharingPermission,value:"custom",name:"sharing_permission_radio",type:"radio","button-variant-grouped":"vertical"},on:{"update:checked":[function(e){t.sharingPermission=e},t.expandCustomPermissions]}},[i("DotsHorizontalIcon",{attrs:{size:20}}),t._v(" "),i("span",[t._v(t._s(t.t("files_sharing","Custom permissions")))]),t._v(" "),i("small",[t._v(t._s(t.customPermissionsList))])],1)],1)]),t._v(" "),i("div",{staticClass:"sharingTabDetailsView__advanced-control"},[i("NcButton",{attrs:{id:"advancedSectionAccordionAdvancedControl",type:"tertiary",alignment:"end-reverse"},on:{click:function(e){t.advancedSectionAccordionExpanded=!t.advancedSectionAccordionExpanded}},scopedSlots:t._u([{key:"icon",fn:function(){return[i("MenuDownIcon")]},proxy:!0}])},[t._v("\n\t\t\t\t"+t._s(t.t("files_sharing","Advanced settings"))+"\n\t\t\t\t")])],1),t._v(" "),t.advancedSectionAccordionExpanded?i("div",{staticClass:"sharingTabDetailsView__advanced",attrs:{id:"advancedSectionAccordionAdvanced","aria-labelledby":"advancedSectionAccordionAdvancedControl",role:"region"}},[i("section",[t.isPublicShare?i("NcInputField",{attrs:{value:t.share.label,type:"text",label:t.t("files_sharing","Share label")},on:{"update:value":function(e){return t.$set(t.share,"label",e)}}}):t._e(),t._v(" "),t.isPublicShare?[i("NcCheckboxRadioSwitch",{attrs:{checked:t.isPasswordProtected,disabled:t.isPasswordEnforced},on:{"update:checked":function(e){t.isPasswordProtected=e}}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("files_sharing","Set password"))+"\n\t\t\t\t\t")]),t._v(" "),t.isPasswordProtected?i("NcInputField",{attrs:{type:t.hasUnsavedPassword?"text":"password",value:t.hasUnsavedPassword?t.share.newPassword:"***************",error:t.passwordError,required:t.isPasswordEnforced,label:t.t("files_sharing","Password")},on:{"update:value":t.onPasswordChange}}):t._e(),t._v(" "),t.isEmailShareType&&t.passwordExpirationTime?i("span",{attrs:{icon:"icon-info"}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("files_sharing","Password expires {passwordExpirationTime}",{passwordExpirationTime:t.passwordExpirationTime}))+"\n\t\t\t\t\t")]):t.isEmailShareType&&null!==t.passwordExpirationTime?i("span",{attrs:{icon:"icon-error"}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("files_sharing","Password expired"))+"\n\t\t\t\t\t")]):t._e()]:t._e(),t._v(" "),t.canTogglePasswordProtectedByTalkAvailable?i("NcCheckboxRadioSwitch",{attrs:{checked:t.isPasswordProtectedByTalk},on:{"update:checked":[function(e){t.isPasswordProtectedByTalk=e},t.onPasswordProtectedByTalkChange]}},[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(" "),i("NcCheckboxRadioSwitch",{attrs:{checked:t.hasExpirationDate,disabled:t.isExpiryDateEnforced},on:{"update:checked":function(e){t.hasExpirationDate=e}}},[t._v("\n\t\t\t\t\t"+t._s(t.isExpiryDateEnforced?t.t("files_sharing","Expiration date (enforced)"):t.t("files_sharing","Set expiration date"))+"\n\t\t\t\t")]),t._v(" "),t.hasExpirationDate?i("NcDateTimePickerNative",{attrs:{id:"share-date-picker",value:new Date(null!==(e=t.share.expireDate)&&void 0!==e?e:t.dateTomorrow),min:t.dateTomorrow,max:t.maxExpirationDateEnforced,"hide-label":!0,placeholder:t.t("files_sharing","Expiration date"),type:"date"},on:{input:t.onExpirationChange}}):t._e(),t._v(" "),t.isPublicShare?i("NcCheckboxRadioSwitch",{attrs:{disabled:t.canChangeHideDownload,checked:t.share.hideDownload},on:{"update:checked":[function(e){return t.$set(t.share,"hideDownload",e)},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._e(),t._v(" "),t.isPublicShare?t._e():i("NcCheckboxRadioSwitch",{attrs:{disabled:!t.canSetDownload,checked:t.canDownload},on:{"update:checked":function(e){t.canDownload=e}}},[t._v("\n\t\t\t\t\t"+t._s(t.t("files_sharing","Allow download"))+"\n\t\t\t\t")]),t._v(" "),i("NcCheckboxRadioSwitch",{attrs:{checked:t.writeNoteToRecipientIsChecked},on:{"update:checked":function(e){t.writeNoteToRecipientIsChecked=e}}},[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.writeNoteToRecipientIsChecked?[i("label",{attrs:{for:"share-note-textarea"}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("files_sharing","Enter a note for the share recipient"))+"\n\t\t\t\t\t")]),t._v(" "),i("textarea",{attrs:{id:"share-note-textarea"},domProps:{value:t.share.note},on:{input:function(e){t.share.note=e.target.value}}})]:t._e(),t._v(" "),i("NcCheckboxRadioSwitch",{attrs:{checked:t.setCustomPermissions},on:{"update:checked":function(e){t.setCustomPermissions=e}}},[t._v("\n\t\t\t\t\t"+t._s(t.t("files_sharing","Custom permissions"))+"\n\t\t\t\t")]),t._v(" "),t.setCustomPermissions?i("section",{staticClass:"custom-permissions-group"},[i("NcCheckboxRadioSwitch",{attrs:{disabled:!t.allowsFileDrop&&t.share.type===t.SHARE_TYPES.SHARE_TYPE_LINK,checked:t.hasRead},on:{"update:checked":function(e){t.hasRead=e}}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("files_sharing","Read"))+"\n\t\t\t\t\t")]),t._v(" "),t.isFolder?i("NcCheckboxRadioSwitch",{attrs:{disabled:!t.canSetCreate,checked:t.canCreate},on:{"update:checked":function(e){t.canCreate=e}}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("files_sharing","Create"))+"\n\t\t\t\t\t")]):t._e(),t._v(" "),i("NcCheckboxRadioSwitch",{attrs:{disabled:!t.canSetEdit,checked:t.canEdit},on:{"update:checked":function(e){t.canEdit=e}}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("files_sharing","Update"))+"\n\t\t\t\t\t")]),t._v(" "),t.config.isResharingAllowed&&t.share.type!==t.SHARE_TYPES.SHARE_TYPE_LINK?i("NcCheckboxRadioSwitch",{attrs:{disabled:!t.canSetReshare,checked:t.canReshare},on:{"update:checked":function(e){t.canReshare=e}}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("files_sharing","Share"))+"\n\t\t\t\t\t")]):t._e(),t._v(" "),i("NcCheckboxRadioSwitch",{attrs:{disabled:!t.canSetDelete,checked:t.canDelete},on:{"update:checked":function(e){t.canDelete=e}}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("files_sharing","Delete"))+"\n\t\t\t\t\t")])],1):t._e()],2)]):t._e()]),t._v(" "),i("div",{staticClass:"sharingTabDetailsView__footer"},[i("div",{staticClass:"sharingTabDetailsView__delete"},[t.isNewShare?t._e():i("NcButton",{attrs:{"aria-label":t.t("files_sharing","Delete share"),disabled:!1,readonly:!1,type:"tertiary"},on:{click:function(e){return e.preventDefault(),t.removeShare.apply(null,arguments)}},scopedSlots:t._u([{key:"icon",fn:function(){return[i("CloseIcon",{attrs:{size:16}})]},proxy:!0}],null,!1,2746485232)},[t._v("\n\t\t\t\t"+t._s(t.t("files_sharing","Delete share"))+"\n\t\t\t")])],1),t._v(" "),i("div",{staticClass:"button-group"},[i("NcButton",{on:{click:function(e){return t.$emit("close-sharing-details")}}},[t._v("\n\t\t\t\t"+t._s(t.t("files_sharing","Cancel"))+"\n\t\t\t")]),t._v(" "),i("NcButton",{attrs:{type:"primary"},on:{click:t.saveShare}},[t._v("\n\t\t\t\t"+t._s(t.shareButtonText)+"\n\t\t\t")])],1)])])}),[],!1,null,"6e01349d",null).exports;var Pt=s(25108);const Tt={name:"SharingTab",components:{NcAvatar:l(),CollectionList:r.G,SharingEntryInternal:j,SharingEntrySimple:U,SharingInherited:Pe,SharingInput:he,SharingLinkList:Ge,SharingList:it,SharingDetailsTab:xt},mixins:[_],data:()=>({config:new u,deleteEvent:null,error:"",expirationInterval:null,loading:!0,fileInfo:null,reshare:null,sharedWithMe:{},shares:[],linkShares:[],sections:OCA.Sharing.ShareTabSections.getSections(),projectsEnabled:(0,c.j)("core","projects_enabled",!1),showSharingDetailsView:!1,shareDetailsData:{}}),computed:{isSharedWithMe(){return Object.keys(this.sharedWithMe).length>0},canReshare(){return!!(this.fileInfo.permissions&OC.PERMISSION_SHARE)||!!(this.reshare&&this.reshare.hasSharePermission&&this.config.isResharingAllowed)}},methods:{async update(e){this.fileInfo=e,this.resetState(),this.getShares()},async getShares(){try{this.loading=!0;const e=(0,o.generateOcsUrl)("apps/files_sharing/api/v1/shares"),t="json",i=(this.fileInfo.path+"/"+this.fileInfo.name).replace("//","/"),s=d.default.get(e,{params:{format:t,path:i,reshares:!0}}),a=d.default.get(e,{params:{format:t,path:i,shared_with_me:!0}}),[n,r]=await Promise.all([s,a]);this.loading=!1,this.processSharedWithMe(r),this.processShares(n)}catch(a){var e,i,s;null!==(e=a.response.data)&&void 0!==e&&null!==(i=e.ocs)&&void 0!==i&&null!==(s=i.meta)&&void 0!==s&&s.message?this.error=a.response.data.ocs.meta.message:this.error=t("files_sharing","Unable to load the shares list"),this.loading=!1,Pt.error("Error loading the shares list",a)}},resetState(){clearInterval(this.expirationInterval),this.loading=!0,this.error="",this.sharedWithMe={},this.shares=[],this.linkShares=[],this.showSharingDetailsView=!1,this.shareDetailsData={}},updateExpirationSubtitle(e){const i=moment(e.expireDate).unix();this.$set(this.sharedWithMe,"subtitle",t("files_sharing","Expires {relativetime}",{relativetime:OC.Util.relativeModifiedDate(1e3*i)})),moment().unix()>i&&(clearInterval(this.expirationInterval),this.$set(this.sharedWithMe,"subtitle",t("files_sharing","this share just expired.")))},processShares(e){let{data:t}=e;if(t.ocs&&t.ocs.data&&t.ocs.data.length>0){const e=t.ocs.data.map((e=>new f(e))).sort(((e,t)=>t.createdTime-e.createdTime));this.linkShares=e.filter((e=>e.type===this.SHARE_TYPES.SHARE_TYPE_LINK||e.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL)),this.shares=e.filter((e=>e.type!==this.SHARE_TYPES.SHARE_TYPE_LINK&&e.type!==this.SHARE_TYPES.SHARE_TYPE_EMAIL)),Pt.debug("Processed",this.linkShares.length,"link share(s)"),Pt.debug("Processed",this.shares.length,"share(s)")}},processSharedWithMe(e){let{data:i}=e;if(i.ocs&&i.ocs.data&&i.ocs.data[0]){const e=new f(i),s=function(e){return e.type===A.D.SHARE_TYPE_GROUP?t("files_sharing","Shared with you and the group {group} by {owner}",{group:e.shareWithDisplayName,owner:e.ownerDisplayName},void 0,{escape:!1}):e.type===A.D.SHARE_TYPE_CIRCLE?t("files_sharing","Shared with you and {circle} by {owner}",{circle:e.shareWithDisplayName,owner:e.ownerDisplayName},void 0,{escape:!1}):e.type===A.D.SHARE_TYPE_ROOM?e.shareWithDisplayName?t("files_sharing","Shared with you and the conversation {conversation} by {owner}",{conversation:e.shareWithDisplayName,owner:e.ownerDisplayName},void 0,{escape:!1}):t("files_sharing","Shared with you in a conversation by {owner}",{owner:e.ownerDisplayName},void 0,{escape:!1}):t("files_sharing","Shared with you by {owner}",{owner:e.ownerDisplayName},void 0,{escape:!1})}(e),a=e.ownerDisplayName,n=e.owner;this.sharedWithMe={displayName:a,title:s,user:n},this.reshare=e,e.expireDate&&moment(e.expireDate).unix()>moment().unix()&&(this.updateExpirationSubtitle(e),this.expirationInterval=setInterval(this.updateExpirationSubtitle,1e4,e))}else this.fileInfo&&void 0!==this.fileInfo.shareOwnerId&&this.fileInfo.shareOwnerId!==OC.currentUser&&(this.sharedWithMe={displayName:this.fileInfo.shareOwner,title:t("files_sharing","Shared with you by {owner}",{owner:this.fileInfo.shareOwner},void 0,{escape:!1}),user:this.fileInfo.shareOwnerId})},addShare(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};e.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL?this.linkShares.unshift(e):this.shares.unshift(e),this.awaitForShare(e,t)},removeShare(e){const t=e.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL||e.type===this.SHARE_TYPES.SHARE_TYPE_LINK?this.linkShares:this.shares,i=t.findIndex((t=>t.id===e.id));-1!==i&&t.splice(i,1)},awaitForShare(e,t){this.$nextTick((()=>{let i=this.$refs.shareList;e.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL&&(i=this.$refs.linkShareList);const s=i.$children.find((t=>t.share===e));s&&t(s)}))},toggleShareDetailsView(e){e&&(this.shareDetailsData=e),this.showSharingDetailsView=!this.showSharingDetailsView}}},Dt=Tt;var kt=s(57711),Rt={};Rt.styleTagTransform=L(),Rt.setAttributes=R(),Rt.insert=D().bind(null,"head"),Rt.domAPI=P(),Rt.insertStyleElement=N(),b()(kt.Z,Rt),kt.Z&&kt.Z.locals&&kt.Z.locals;const It=(0,B.Z)(Dt,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"sharingTab",class:{"icon-loading":e.loading}},[e.error?t("div",{staticClass:"emptycontent",class:{emptyContentWithSections:e.sections.length>0}},[t("div",{staticClass:"icon icon-error"}),e._v(" "),t("h2",[e._v(e._s(e.error))])]):e._e(),e._v(" "),e.showSharingDetailsView?t("SharingDetailsTab",{attrs:{"file-info":e.shareDetailsData.fileInfo,share:e.shareDetailsData.share},on:{"close-sharing-details":e.toggleShareDetailsView,"add:share":e.addShare,"remove:share":e.removeShare}}):[t("div",{staticClass:"sharingTab__content"},[e.isSharedWithMe?t("SharingEntrySimple",e._b({staticClass:"sharing-entry__reshare",scopedSlots:e._u([{key:"avatar",fn:function(){return[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{user:e.sharedWithMe.user,"display-name":e.sharedWithMe.displayName}})]},proxy:!0}],null,!1,3197855346)},"SharingEntrySimple",e.sharedWithMe,!1)):e._e(),e._v(" "),e.loading?e._e():t("SharingInput",{attrs:{"can-reshare":e.canReshare,"file-info":e.fileInfo,"link-shares":e.linkShares,reshare:e.reshare,shares:e.shares},on:{"open-sharing-details":e.toggleShareDetailsView}}),e._v(" "),e.loading?e._e():t("SharingLinkList",{ref:"linkShareList",attrs:{"can-reshare":e.canReshare,"file-info":e.fileInfo,shares:e.linkShares},on:{"open-sharing-details":e.toggleShareDetailsView}}),e._v(" "),e.loading?e._e():t("SharingList",{ref:"shareList",attrs:{shares:e.shares,"file-info":e.fileInfo},on:{"open-sharing-details":e.toggleShareDetailsView}}),e._v(" "),e.canReshare&&!e.loading?t("SharingInherited",{attrs:{"file-info":e.fileInfo}}):e._e(),e._v(" "),t("SharingEntryInternal",{attrs:{"file-info":e.fileInfo}}),e._v(" "),e.projectsEnabled&&e.fileInfo?t("CollectionList",{attrs:{id:"".concat(e.fileInfo.id),type:"file",name:e.fileInfo.name}}):e._e()],1),e._v(" "),e._l(e.sections,(function(i,s){return t("div",{key:s,ref:"section-"+s,refInFor:!0,staticClass:"sharingTab__additionalContent"},[t(i(e.$refs["section-"+s],e.fileInfo),{tag:"component",attrs:{"file-info":e.fileInfo}})],1)}))]],2)}),[],!1,null,"7e41779f",null).exports;var Nt=s(25108);var Ot=s(25108);var Lt=s(25108);var Yt=s(44582);window.OCA.Sharing||(window.OCA.Sharing={}),Object.assign(window.OCA.Sharing,{ShareSearch:new class{constructor(){var e,t,i;e=this,i=void 0,(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t="_state"))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,this._state={},this._state.results=[],Nt.debug("OCA.Sharing.ShareSearch initialized")}get state(){return this._state}addNewResult(e){return""!==e.displayName.trim()&&"function"==typeof e.handler?(this._state.results.push(e),!0):(Nt.error("Invalid search result provided",e),!1)}}}),Object.assign(window.OCA.Sharing,{ExternalLinkActions:new class{constructor(){var e,t,i;e=this,i=void 0,(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t="_state"))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,this._state={},this._state.actions=[],Ot.debug("OCA.Sharing.ExternalLinkActions initialized")}get state(){return this._state}registerAction(e){return OC.debug&&Ot.warn("OCA.Sharing.ExternalLinkActions is deprecated, use OCA.Sharing.ExternalShareAction instead"),"object"==typeof e&&e.icon&&e.name&&e.url?(this._state.actions.push(e),!0):(Ot.error("Invalid action provided",e),!1)}}}),Object.assign(window.OCA.Sharing,{ExternalShareActions:new class{constructor(){var e,t,i;e=this,i=void 0,(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t="_state"))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,this._state={},this._state.actions=[],Lt.debug("OCA.Sharing.ExternalShareActions initialized")}get state(){return this._state}registerAction(e){return"object"==typeof e&&"string"==typeof e.id&&"function"==typeof e.data&&Array.isArray(e.shareType)&&"object"==typeof e.handlers&&Object.values(e.handlers).every((e=>"function"==typeof e))?this._state.actions.findIndex((t=>t.id===e.id))>-1?(Lt.error("An action with the same id ".concat(e.id," already exists"),e),!1):(this._state.actions.push(e),!0):(Lt.error("Invalid action provided",e),!1)}}}),Object.assign(window.OCA.Sharing,{ShareTabSections:new class{constructor(){var e,t,i;e=this,i=void 0,(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t="_sections"))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,this._sections=[]}registerSection(e){this._sections.push(e)}getSections(){return this._sections}}}),a.default.prototype.t=n.Iu,a.default.prototype.n=n.uN;const Ht=a.default.extend(It);let Bt=null;window.addEventListener("DOMContentLoaded",(function(){OCA.Files&&OCA.Files.Sidebar&&OCA.Files.Sidebar.registerTab(new OCA.Files.Sidebar.Tab({id:"sharing",name:(0,n.Iu)("files_sharing","Sharing"),iconSvg:Yt,async mount(e,t,i){Bt&&Bt.$destroy(),Bt=new Ht({parent:i}),await Bt.update(t),Bt.$mount(e)},update(e){Bt.update(e)},destroy(){Bt.$destroy(),Bt=null}}))}))},38879:(e,t,i)=>{i.d(t,{Z:()=>o});var s=i(87537),a=i.n(s),n=i(23645),r=i.n(n)()(a());r.push([e.id,".sharing-entry[data-v-7bfd2f06]{display:flex;align-items:center;height:44px}.sharing-entry__summary[data-v-7bfd2f06]{padding:8px;display:flex;flex-direction:column;justify-content:center;width:80%;min-width:80%}.sharing-entry__summary__desc[data-v-7bfd2f06]{display:inline-block;padding-bottom:0;line-height:1.2em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sharing-entry__summary__desc p[data-v-7bfd2f06],.sharing-entry__summary__desc small[data-v-7bfd2f06]{color:var(--color-text-maxcontrast)}.sharing-entry__summary__desc-unique[data-v-7bfd2f06]{color:var(--color-text-maxcontrast)}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingEntry.vue"],names:[],mappings:"AACA,gCACC,YAAA,CACA,kBAAA,CACA,WAAA,CAEA,yCACC,WAAA,CACA,YAAA,CACA,qBAAA,CACA,sBAAA,CACA,SAAA,CACA,aAAA,CAEA,+CACC,oBAAA,CACA,gBAAA,CACA,iBAAA,CACA,kBAAA,CACA,eAAA,CACA,sBAAA,CAEA,sGAEC,mCAAA,CAGD,sDACC,mCAAA",sourcesContent:["\n.sharing-entry {\n\tdisplay: flex;\n\talign-items: center;\n\theight: 44px;\n\n\t&__summary {\n\t\tpadding: 8px;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tjustify-content: center;\n\t\twidth: 80%;\n\t\tmin-width: 80%;\n\n\t\t&__desc {\n\t\t\tdisplay: inline-block;\n\t\t\tpadding-bottom: 0;\n\t\t\tline-height: 1.2em;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\n\t\t\tp,\n\t\t\tsmall {\n\t\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t\t}\n\n\t\t\t&-unique {\n\t\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t\t}\n\t\t}\n\t}\n\n}\n"],sourceRoot:""}]);const o=r},72021:(e,t,i)=>{i.d(t,{Z:()=>o});var s=i(87537),a=i.n(s),n=i(23645),r=i.n(n)()(a());r.push([e.id,".sharing-entry[data-v-283ca89e]{display:flex;align-items:center;height:44px}.sharing-entry__desc[data-v-283ca89e]{display:flex;flex-direction:column;justify-content:space-between;padding:8px;padding-left:10px;line-height:1.2em}.sharing-entry__desc p[data-v-283ca89e]{color:var(--color-text-maxcontrast)}.sharing-entry__actions[data-v-283ca89e]{margin-left:auto}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingEntryInherited.vue"],names:[],mappings:"AACA,gCACC,YAAA,CACA,kBAAA,CACA,WAAA,CACA,sCACC,YAAA,CACA,qBAAA,CACA,6BAAA,CACA,WAAA,CACA,iBAAA,CACA,iBAAA,CACA,wCACC,mCAAA,CAGF,yCACC,gBAAA",sourcesContent:["\n.sharing-entry {\n\tdisplay: flex;\n\talign-items: center;\n\theight: 44px;\n\t&__desc {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tjustify-content: space-between;\n\t\tpadding: 8px;\n\t\tpadding-left: 10px;\n\t\tline-height: 1.2em;\n\t\tp {\n\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t}\n\t}\n\t&__actions {\n\t\tmargin-left: auto;\n\t}\n}\n"],sourceRoot:""}]);const o=r},2256:(e,t,i)=>{i.d(t,{Z:()=>o});var s=i(87537),a=i.n(s),n=i(23645),r=i.n(n)()(a());r.push([e.id,".sharing-entry__internal .avatar-external[data-v-71a426be]{width:32px;height:32px;line-height:32px;font-size:18px;background-color:var(--color-text-maxcontrast);border-radius:50%;flex-shrink:0}.sharing-entry__internal .icon-checkmark-color[data-v-71a426be]{opacity:1}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingEntryInternal.vue"],names:[],mappings:"AAEC,2DACC,UAAA,CACA,WAAA,CACA,gBAAA,CACA,cAAA,CACA,8CAAA,CACA,iBAAA,CACA,aAAA,CAED,gEACC,SAAA",sourcesContent:["\n.sharing-entry__internal {\n\t.avatar-external {\n\t\twidth: 32px;\n\t\theight: 32px;\n\t\tline-height: 32px;\n\t\tfont-size: 18px;\n\t\tbackground-color: var(--color-text-maxcontrast);\n\t\tborder-radius: 50%;\n\t\tflex-shrink: 0;\n\t}\n\t.icon-checkmark-color {\n\t\topacity: 1;\n\t}\n}\n"],sourceRoot:""}]);const o=r},33864:(e,t,i)=>{i.d(t,{Z:()=>o});var s=i(87537),a=i.n(s),n=i(23645),r=i.n(n)()(a());r.push([e.id,".sharing-entry[data-v-d952affa]{display:flex;align-items:center;min-height:44px}.sharing-entry__summary[data-v-d952affa]{padding:8px;padding-left:10px;display:flex;justify-content:space-between;width:80%;min-width:80%}.sharing-entry__summary__desc[data-v-d952affa]{display:flex;flex-direction:column;line-height:1.2em}.sharing-entry__summary__desc p[data-v-d952affa]{color:var(--color-text-maxcontrast)}.sharing-entry__summary__desc__title[data-v-d952affa]{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.sharing-entry:not(.sharing-entry--share) .sharing-entry__actions .new-share-link[data-v-d952affa]{border-top:1px solid var(--color-border)}.sharing-entry[data-v-d952affa] .avatar-link-share{background-color:var(--color-primary-element)}.sharing-entry .sharing-entry__action--public-upload[data-v-d952affa]{border-bottom:1px solid var(--color-border)}.sharing-entry__loading[data-v-d952affa]{width:44px;height:44px;margin:0;padding:14px;margin-left:auto}.sharing-entry .action-item~.action-item[data-v-d952affa],.sharing-entry .action-item~.sharing-entry__loading[data-v-d952affa]{margin-left:0}.sharing-entry .icon-checkmark-color[data-v-d952affa]{opacity:1}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingEntryLink.vue"],names:[],mappings:"AACA,gCACC,YAAA,CACA,kBAAA,CACA,eAAA,CAEA,yCACC,WAAA,CACA,iBAAA,CACA,YAAA,CACA,6BAAA,CACA,SAAA,CACA,aAAA,CAED,+CACC,YAAA,CACA,qBAAA,CACA,iBAAA,CAEA,iDACC,mCAAA,CAGD,sDACC,sBAAA,CACA,eAAA,CACA,kBAAA,CAUD,mGACC,wCAAA,CAIF,mDACC,6CAAA,CAGD,sEACC,2CAAA,CAGD,yCACC,UAAA,CACA,WAAA,CACA,QAAA,CACA,YAAA,CACA,gBAAA,CAOA,+HAEC,aAAA,CAIF,sDACC,SAAA",sourcesContent:["\n.sharing-entry {\n\tdisplay: flex;\n\talign-items: center;\n\tmin-height: 44px;\n\n\t&__summary {\n\t\tpadding: 8px;\n\t\tpadding-left: 10px;\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\twidth: 80%;\n\t\tmin-width: 80%;\n\n\t&__desc {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tline-height: 1.2em;\n\n\t\tp {\n\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t}\n\n\t\t&__title {\n\t\t\ttext-overflow: ellipsis;\n\t\t\toverflow: hidden;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t }\n\n\t &__copy {\n\n\t }\n\t}\n\n\t&:not(.sharing-entry--share) &__actions {\n\t\t.new-share-link {\n\t\t\tborder-top: 1px solid var(--color-border);\n\t\t}\n\t}\n\n\t::v-deep .avatar-link-share {\n\t\tbackground-color: var(--color-primary-element);\n\t}\n\n\t.sharing-entry__action--public-upload {\n\t\tborder-bottom: 1px solid var(--color-border);\n\t}\n\n\t&__loading {\n\t\twidth: 44px;\n\t\theight: 44px;\n\t\tmargin: 0;\n\t\tpadding: 14px;\n\t\tmargin-left: auto;\n\t}\n\n\t// put menus to the left\n\t// but only the first one\n\t.action-item {\n\n\t\t~.action-item,\n\t\t~.sharing-entry__loading {\n\t\t\tmargin-left: 0;\n\t\t}\n\t}\n\n\t.icon-checkmark-color {\n\t\topacity: 1;\n\t}\n}\n"],sourceRoot:""}]);const o=r},96021:(e,t,i)=>{i.d(t,{Z:()=>o});var s=i(87537),a=i.n(s),n=i(23645),r=i.n(n)()(a());r.push([e.id,".share-select[data-v-d960cabe]{position:relative;cursor:pointer}.share-select .trigger-text[data-v-d960cabe]{display:flex;flex-direction:row;align-items:center;font-size:12.5px;gap:2px;color:var(--color-primary-element)}.share-select .share-select-dropdown[data-v-d960cabe]{position:absolute;display:flex;flex-direction:column;top:100%;left:0;background-color:var(--color-main-background);border-radius:8px;box-shadow:0 2px 4px rgba(0,0,0,.2);border:1px solid var(--color-border);padding:4px 0;z-index:1}.share-select .share-select-dropdown .dropdown-item[data-v-d960cabe]{padding:8px;font-size:12px;background:none;border:none;border-radius:0;font:inherit;cursor:pointer;color:inherit;outline:none;width:100%;white-space:nowrap;text-align:left}.share-select .share-select-dropdown .dropdown-item[data-v-d960cabe]:hover{background-color:var(--color-background-dark)}.share-select .share-select-dropdown .dropdown-item.selected[data-v-d960cabe]{background-color:var(--color-background-dark)}.share-select .share-select-dropdown[data-v-d960cabe]{max-height:0;overflow:hidden;transition:max-height .3s ease}.share-select.active .share-select-dropdown[data-v-d960cabe]{max-height:200px}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingEntryQuickShareSelect.vue"],names:[],mappings:"AACA,+BACC,iBAAA,CACA,cAAA,CAEA,6CACC,YAAA,CACA,kBAAA,CACA,kBAAA,CACA,gBAAA,CACA,OAAA,CACA,kCAAA,CAGD,sDACC,iBAAA,CACA,YAAA,CACA,qBAAA,CACA,QAAA,CACA,MAAA,CACA,6CAAA,CACA,iBAAA,CACA,mCAAA,CACA,oCAAA,CACA,aAAA,CACA,SAAA,CAEA,qEACC,WAAA,CACA,cAAA,CACA,eAAA,CACA,WAAA,CACA,eAAA,CACA,YAAA,CACA,cAAA,CACA,aAAA,CACA,YAAA,CACA,UAAA,CACA,kBAAA,CACA,eAAA,CAEA,2EACC,6CAAA,CAGD,8EACC,6CAAA,CAMH,sDACC,YAAA,CACA,eAAA,CACA,8BAAA,CAGD,6DACC,gBAAA",sourcesContent:["\n.share-select {\n\tposition: relative;\n\tcursor: pointer;\n\n\t.trigger-text {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\tfont-size: 12.5px;\n\t\tgap: 2px;\n\t\tcolor: var(--color-primary-element);\n\t}\n\n\t.share-select-dropdown {\n\t\tposition: absolute;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\ttop: 100%;\n\t\tleft: 0;\n\t\tbackground-color: var(--color-main-background);\n\t\tborder-radius: 8px;\n\t\tbox-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n\t\tborder: 1px solid var(--color-border);\n\t\tpadding: 4px 0;\n\t\tz-index: 1;\n\n\t\t.dropdown-item {\n\t\t\tpadding: 8px;\n\t\t\tfont-size: 12px;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tborder-radius: 0;\n\t\t\tfont: inherit;\n\t\t\tcursor: pointer;\n\t\t\tcolor: inherit;\n\t\t\toutline: none;\n\t\t\twidth: 100%;\n\t\t\twhite-space: nowrap;\n\t\t\ttext-align: left;\n\n\t\t\t&:hover {\n\t\t\t\tbackground-color: var(--color-background-dark);\n\t\t\t}\n\n\t\t\t&.selected {\n\t\t\t\tbackground-color: var(--color-background-dark);\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Optional: Add a transition effect for smoother dropdown animation */\n\t.share-select-dropdown {\n\t\tmax-height: 0;\n\t\toverflow: hidden;\n\t\ttransition: max-height 0.3s ease;\n\t}\n\n\t&.active .share-select-dropdown {\n\t\tmax-height: 200px;\n\t\t/* Adjust the value to your desired height */\n\t}\n}\n"],sourceRoot:""}]);const o=r},66452:(e,t,i)=>{i.d(t,{Z:()=>o});var s=i(87537),a=i.n(s),n=i(23645),r=i.n(n)()(a());r.push([e.id,".sharing-entry[data-v-1852ea78]{display:flex;align-items:center;min-height:44px}.sharing-entry__desc[data-v-1852ea78]{padding:8px;padding-left:10px;line-height:1.2em;position:relative;flex:1 1;min-width:0}.sharing-entry__desc p[data-v-1852ea78]{color:var(--color-text-maxcontrast)}.sharing-entry__title[data-v-1852ea78]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:inherit}.sharing-entry__actions[data-v-1852ea78]{margin-left:auto !important}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingEntrySimple.vue"],names:[],mappings:"AACA,gCACC,YAAA,CACA,kBAAA,CACA,eAAA,CACA,sCACC,WAAA,CACA,iBAAA,CACA,iBAAA,CACA,iBAAA,CACA,QAAA,CACA,WAAA,CACA,wCACC,mCAAA,CAGF,uCACC,kBAAA,CACA,sBAAA,CACA,eAAA,CACA,iBAAA,CAED,yCACC,2BAAA",sourcesContent:["\n.sharing-entry {\n\tdisplay: flex;\n\talign-items: center;\n\tmin-height: 44px;\n\t&__desc {\n\t\tpadding: 8px;\n\t\tpadding-left: 10px;\n\t\tline-height: 1.2em;\n\t\tposition: relative;\n\t\tflex: 1 1;\n\t\tmin-width: 0;\n\t\tp {\n\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t}\n\t}\n\t&__title {\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\toverflow: hidden;\n\t\tmax-width: inherit;\n\t}\n\t&__actions {\n\t\tmargin-left: auto !important;\n\t}\n}\n"],sourceRoot:""}]);const o=r},24764:(e,t,i)=>{i.d(t,{Z:()=>o});var s=i(87537),a=i.n(s),n=i(23645),r=i.n(n)()(a());r.push([e.id,".sharing-search{display:flex;flex-direction:column;margin-bottom:4px}.sharing-search label[for=sharing-search-input]{margin-bottom:2px}.sharing-search__input{width:100%;margin:10px 0}.vs__dropdown-menu span[lookup] .avatardiv{background-image:var(--icon-search-white);background-repeat:no-repeat;background-position:center;background-color:var(--color-text-maxcontrast) !important}.vs__dropdown-menu span[lookup] .avatardiv div{display:none}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingInput.vue"],names:[],mappings:"AACA,gBACC,YAAA,CACA,qBAAA,CACA,iBAAA,CAEA,gDACC,iBAAA,CAGD,uBACC,UAAA,CACA,aAAA,CAOA,2CACC,yCAAA,CACA,2BAAA,CACA,0BAAA,CACA,yDAAA,CACA,+CACC,YAAA",sourcesContent:['\n.sharing-search {\n\tdisplay: flex;\n\tflex-direction: column;\n\tmargin-bottom: 4px;\n\n\tlabel[for="sharing-search-input"] {\n\t\tmargin-bottom: 2px;\n\t}\n\n\t&__input {\n\t\twidth: 100%;\n\t\tmargin: 10px 0;\n\t}\n}\n\n.vs__dropdown-menu {\n\t// properly style the lookup entry\n\tspan[lookup] {\n\t\t.avatardiv {\n\t\t\tbackground-image: var(--icon-search-white);\n\t\t\tbackground-repeat: no-repeat;\n\t\t\tbackground-position: center;\n\t\t\tbackground-color: var(--color-text-maxcontrast) !important;\n\t\t\tdiv {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t}\n\t}\n}\n'],sourceRoot:""}]);const o=r},80337:(e,t,i)=>{i.d(t,{Z:()=>o});var s=i(87537),a=i.n(s),n=i(23645),r=i.n(n)()(a());r.push([e.id,".sharingTabDetailsView[data-v-6e01349d]{display:flex;flex-direction:column;width:100%;margin:0 auto;position:relative;height:100%;overflow:hidden}.sharingTabDetailsView__header[data-v-6e01349d]{display:flex;align-items:center;box-sizing:border-box;margin:.2em}.sharingTabDetailsView__header span[data-v-6e01349d]{display:flex;align-items:center}.sharingTabDetailsView__header span h1[data-v-6e01349d]{font-size:15px;padding-left:.3em}.sharingTabDetailsView__wrapper[data-v-6e01349d]{overflow:scroll;flex-shrink:1;padding:4px;padding-right:12px}.sharingTabDetailsView__quick-permissions[data-v-6e01349d]{display:flex;justify-content:center;width:100%;margin:0 auto;border-radius:0}.sharingTabDetailsView__quick-permissions div[data-v-6e01349d]{width:100%}.sharingTabDetailsView__quick-permissions div span[data-v-6e01349d]{width:100%}.sharingTabDetailsView__quick-permissions div span span[data-v-6e01349d]:nth-child(1){align-items:center;justify-content:center;color:var(--color-primary-element);padding:.1em}.sharingTabDetailsView__quick-permissions div span[data-v-6e01349d] label{display:flex;flex-wrap:wrap}.sharingTabDetailsView__quick-permissions div span[data-v-6e01349d] label span{display:flex}.sharingTabDetailsView__quick-permissions div span[data-v-6e01349d] label span:first-of-type{flex:10%}.sharingTabDetailsView__quick-permissions div span[data-v-6e01349d] label span:last-of-type{flex:90%}.sharingTabDetailsView__quick-permissions div span[data-v-6e01349d] label small{padding-left:10%;flex-basis:100% !important}.sharingTabDetailsView__advanced-control[data-v-6e01349d]{width:100%}.sharingTabDetailsView__advanced-control button[data-v-6e01349d]{margin-top:.5em}.sharingTabDetailsView__advanced[data-v-6e01349d]{width:100%;margin-bottom:.5em;text-align:left;padding-left:0}.sharingTabDetailsView__advanced section textarea[data-v-6e01349d],.sharingTabDetailsView__advanced section div.mx-datepicker[data-v-6e01349d]{width:100%}.sharingTabDetailsView__advanced section textarea[data-v-6e01349d]{height:80px;margin:0}.sharingTabDetailsView__advanced section span[data-v-6e01349d] label{background-color:initial !important;border:none !important}.sharingTabDetailsView__advanced section section.custom-permissions-group[data-v-6e01349d]{padding-left:1.5em}.sharingTabDetailsView__footer[data-v-6e01349d]{width:100%;display:flex;position:sticky;bottom:0;flex-direction:column;justify-content:space-between;align-items:flex-start;background:linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--color-main-background))}.sharingTabDetailsView__footer>button[data-v-6e01349d]:first-child{color:#df0707;background-color:#f5f5f5}.sharingTabDetailsView__footer .button-group[data-v-6e01349d]{display:flex;justify-content:space-between;width:100%;margin-top:16px}.sharingTabDetailsView__footer .button-group button[data-v-6e01349d]{margin-left:16px}.sharingTabDetailsView__footer .button-group button[data-v-6e01349d]:first-child{margin-left:0}","",{version:3,sources:["webpack://./apps/files_sharing/src/views/SharingDetailsTab.vue"],names:[],mappings:"AACA,wCACC,YAAA,CACA,qBAAA,CACA,UAAA,CACA,aAAA,CACA,iBAAA,CACA,WAAA,CACA,eAAA,CAEA,gDACC,YAAA,CACA,kBAAA,CACA,qBAAA,CACA,WAAA,CAEA,qDACC,YAAA,CACA,kBAAA,CAEA,wDACC,cAAA,CACA,iBAAA,CAMH,iDACC,eAAA,CACA,aAAA,CACA,WAAA,CACA,kBAAA,CAGD,2DACC,YAAA,CACA,sBAAA,CACA,UAAA,CACA,aAAA,CACA,eAAA,CAEA,+DACC,UAAA,CAEA,oEACC,UAAA,CAEA,sFACC,kBAAA,CACA,sBAAA,CACA,kCAAA,CACA,YAAA,CAGD,0EACC,YAAA,CACA,cAAA,CAEA,+EACC,YAAA,CAEA,6FACC,QAAA,CAGD,4FACC,QAAA,CAIF,gFACC,gBAAA,CACA,0BAAA,CASL,0DACC,UAAA,CAEA,iEACC,eAAA,CAKF,kDACC,UAAA,CACA,kBAAA,CACA,eAAA,CACA,cAAA,CAIC,+IAEC,UAAA,CAGD,mEACC,WAAA,CACA,QAAA,CAaA,qEACC,mCAAA,CACA,sBAAA,CAIF,2FACC,kBAAA,CAKH,gDACC,UAAA,CACA,YAAA,CACA,eAAA,CACA,QAAA,CACA,qBAAA,CACA,6BAAA,CACA,sBAAA,CACA,2FAAA,CAEA,mEACC,aAAA,CACA,wBAAA,CAGD,8DACC,YAAA,CACA,6BAAA,CACA,UAAA,CACA,eAAA,CAEA,qEACC,gBAAA,CAEA,iFACC,aAAA",sourcesContent:["\n.sharingTabDetailsView {\n\tdisplay: flex;\n\tflex-direction: column;\n\twidth: 100%;\n\tmargin: 0 auto;\n\tposition: relative;\n\theight: 100%;\n\toverflow: hidden;\n\n\t&__header {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tbox-sizing: border-box;\n\t\tmargin: 0.2em;\n\n\t\tspan {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\n\t\t\th1 {\n\t\t\t\tfont-size: 15px;\n\t\t\t\tpadding-left: 0.3em;\n\t\t\t}\n\n\t\t}\n\t}\n\n\t&__wrapper {\n\t\toverflow: scroll;\n\t\tflex-shrink: 1;\n\t\tpadding: 4px;\n\t\tpadding-right: 12px;\n\t}\n\n\t&__quick-permissions {\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\twidth: 100%;\n\t\tmargin: 0 auto;\n\t\tborder-radius: 0;\n\n\t\tdiv {\n\t\t\twidth: 100%;\n\n\t\t\tspan {\n\t\t\t\twidth: 100%;\n\n\t\t\t\tspan:nth-child(1) {\n\t\t\t\t\talign-items: center;\n\t\t\t\t\tjustify-content: center;\n\t\t\t\t\tcolor: var(--color-primary-element);\n\t\t\t\t\tpadding: 0.1em;\n\t\t\t\t}\n\n\t\t\t\t::v-deep label {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-wrap: wrap;\n\n\t\t\t\t\tspan {\n\t\t\t\t\t\tdisplay: flex;\n\n\t\t\t\t\t\t&:first-of-type {\n\t\t\t\t\t\t\tflex: 10%;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t&:last-of-type {\n\t\t\t\t\t\t\tflex: 90%\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tsmall {\n\t\t\t\t\t\tpadding-left: 10%;\n\t\t\t\t\t\tflex-basis: 100% !important;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n\n\t&__advanced-control {\n\t\twidth: 100%;\n\n\t\tbutton {\n\t\t\tmargin-top: 0.5em;\n\t\t}\n\n\t}\n\n\t&__advanced {\n\t\twidth: 100%;\n\t\tmargin-bottom: 0.5em;\n\t\ttext-align: left;\n\t\tpadding-left: 0;\n\n\t\tsection {\n\n\t\t\ttextarea,\n\t\t\tdiv.mx-datepicker {\n\t\t\t\twidth: 100%;\n\t\t\t}\n\n\t\t\ttextarea {\n\t\t\t\theight: 80px;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t/*\n The following style is applied out of the component's scope\n to remove padding from the label.checkbox-radio-switch__label,\n which is used to group radio checkbox items. The use of ::v-deep\n ensures that the padding is modified without being affected by\n the component's scoping.\n Without this achieving left alignment for the checkboxes would not\n be possible.\n */\n\t\t\tspan {\n\t\t\t\t::v-deep label {\n\t\t\t\t\tbackground-color: initial !important;\n\t\t\t\t\tborder: none !important;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsection.custom-permissions-group {\n\t\t\t\tpadding-left: 1.5em;\n\t\t\t}\n\t\t}\n\t}\n\n\t&__footer {\n\t\twidth: 100%;\n\t\tdisplay: flex;\n\t\tposition: sticky;\n\t\tbottom: 0;\n\t\tflex-direction: column;\n\t\tjustify-content: space-between;\n\t\talign-items: flex-start;\n\t\tbackground: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--color-main-background));\n\n\t\t>button:first-child {\n\t\t\tcolor: rgb(223, 7, 7);\n\t\t\tbackground-color: #f5f5f5;\n\t\t}\n\n\t\t.button-group {\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: space-between;\n\t\t\twidth: 100%;\n\t\t\tmargin-top: 16px;\n\n\t\t\tbutton {\n\t\t\t\tmargin-left: 16px;\n\n\t\t\t\t&:first-child {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);const o=r},84772:(e,t,i)=>{i.d(t,{Z:()=>o});var s=i(87537),a=i.n(s),n=i(23645),r=i.n(n)()(a());r.push([e.id,".sharing-entry__inherited .avatar-shared[data-v-05b67dc8]{width:32px;height:32px;line-height:32px;font-size:18px;background-color:var(--color-text-maxcontrast);border-radius:50%;flex-shrink:0}","",{version:3,sources:["webpack://./apps/files_sharing/src/views/SharingInherited.vue"],names:[],mappings:"AAEC,0DACC,UAAA,CACA,WAAA,CACA,gBAAA,CACA,cAAA,CACA,8CAAA,CACA,iBAAA,CACA,aAAA",sourcesContent:["\n.sharing-entry__inherited {\n\t.avatar-shared {\n\t\twidth: 32px;\n\t\theight: 32px;\n\t\tline-height: 32px;\n\t\tfont-size: 18px;\n\t\tbackground-color: var(--color-text-maxcontrast);\n\t\tborder-radius: 50%;\n\t\tflex-shrink: 0;\n\t}\n}\n"],sourceRoot:""}]);const o=r},57711:(e,t,i)=>{i.d(t,{Z:()=>o});var s=i(87537),a=i.n(s),n=i(23645),r=i.n(n)()(a());r.push([e.id,".emptyContentWithSections[data-v-7e41779f]{margin:1rem auto}.sharingTab[data-v-7e41779f]{position:relative;height:100%}.sharingTab__content[data-v-7e41779f]{padding:0 6px}.sharingTab__additionalContent[data-v-7e41779f]{margin:44px 0}","",{version:3,sources:["webpack://./apps/files_sharing/src/views/SharingTab.vue"],names:[],mappings:"AACA,2CACC,gBAAA,CAGD,6BACC,iBAAA,CACA,WAAA,CAEA,sCACC,aAAA,CAGD,gDACC,aAAA",sourcesContent:["\n.emptyContentWithSections {\n\tmargin: 1rem auto;\n}\n\n.sharingTab {\n\tposition: relative;\n\theight: 100%;\n\n\t&__content {\n\t\tpadding: 0 6px;\n\t}\n\n\t&__additionalContent {\n\t\tmargin: 44px 0;\n\t}\n}\n"],sourceRoot:""}]);const o=r}},n={};function r(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={id:e,loaded:!1,exports:{}};return a[e].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.m=a,e=[],r.O=(t,i,s,a)=>{if(!i){var n=1/0;for(d=0;d<e.length;d++){i=e[d][0],s=e[d][1],a=e[d][2];for(var o=!0,h=0;h<i.length;h++)(!1&a||n>=a)&&Object.keys(r.O).every((e=>r.O[e](i[h])))?i.splice(h--,1):(o=!1,a<n&&(n=a));if(o){e.splice(d--,1);var l=s();void 0!==l&&(t=l)}}return t}a=a||0;for(var d=e.length;d>0&&e[d-1][2]>a;d--)e[d]=e[d-1];e[d]=[i,s,a]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,i)=>(r.f[i](e,t),t)),[])),r.u=e=>e+"-"+e+".js?v=00434e4baa0d8e7b79f1",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},s="nextcloud:",r.l=(e,t,a,n)=>{if(i[e])i[e].push(t);else{var o,h;if(void 0!==a)for(var l=document.getElementsByTagName("script"),d=0;d<l.length;d++){var c=l[d];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")==s+a){o=c;break}}o||(h=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,r.nc&&o.setAttribute("nonce",r.nc),o.setAttribute("data-webpack",s+a),o.src=e),i[e]=[t];var p=(t,s)=>{o.onerror=o.onload=null,clearTimeout(u);var a=i[e];if(delete i[e],o.parentNode&&o.parentNode.removeChild(o),a&&a.forEach((e=>e(s))),t)return t(s)},u=setTimeout(p.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=p.bind(null,o.onerror),o.onload=p.bind(null,o.onload),h&&document.head.appendChild(o)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.j=7870,(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var i=t.getElementsByTagName("script");i.length&&(e=i[i.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{r.b=document.baseURI||self.location.href;var e={7870:0};r.f.j=(t,i)=>{var s=r.o(e,t)?e[t]:void 0;if(0!==s)if(s)i.push(s[2]);else{var a=new Promise(((i,a)=>s=e[t]=[i,a]));i.push(s[2]=a);var n=r.p+r.u(t),o=new Error;r.l(n,(i=>{if(r.o(e,t)&&(0!==(s=e[t])&&(e[t]=void 0),s)){var a=i&&("load"===i.type?"missing":i.type),n=i&&i.target&&i.target.src;o.message="Loading chunk "+t+" failed.\n("+a+": "+n+")",o.name="ChunkLoadError",o.type=a,o.request=n,s[1](o)}}),"chunk-"+t,t)}},r.O.j=t=>0===e[t];var t=(t,i)=>{var s,a,n=i[0],o=i[1],h=i[2],l=0;if(n.some((t=>0!==e[t]))){for(s in o)r.o(o,s)&&(r.m[s]=o[s]);if(h)var d=h(r)}for(t&&t(i);l<n.length;l++)a=n[l],r.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return r.O(d)},i=self.webpackChunknextcloud=self.webpackChunknextcloud||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})(),r.nc=void 0;var o=r.O(void 0,[7874],(()=>r(49757)));o=r.O(o)})();
//# sourceMappingURL=files_sharing-files_sharing_tab.js.map?v=ea1456c4169d09cbc09f