files_sharing-files_sharing_tab.js 83 KB

123
  1. /*! For license information please see files_sharing-files_sharing_tab.js.LICENSE.txt */
  2. (()=>{"use strict";var e,s={19258:(e,s,i)=>{var a=i(20144),r=i(31352),n=i(1794),o=i(79753),h=i(75925),l=i.n(h),c=i(4820),d=i(79954);class u{get isPublicUploadEnabled(){return document.getElementsByClassName("files-filestable")[0]&&"yes"===document.getElementsByClassName("files-filestable")[0].dataset.allowPublicUpload}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,s;const i=OC.getCapabilities();return void 0!==(null==i||null===(e=i.files_sharing)||void 0===e?void 0:e.sharebymail)&&!0===(null==i||null===(t=i.files_sharing)||void 0===t||null===(s=t.public)||void 0===s?void 0:s.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!==OC.getCapabilities().files_sharing.sharebymail&&OC.getCapabilities().files_sharing.sharebymail.password.enforced}get shouldAlwaysShowUnique(){var e,t;return!0===(null===(e=OC.getCapabilities().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(){const e=OC.getCapabilities();return e.password_policy?e.password_policy:{}}}var p=i(41922),f=i(25108);class g{constructor(e){var t,s,i,a;if(s=this,a=void 0,(i=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var i=s.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(i="_share"))in s?Object.defineProperty(s,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):s[i]=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)try{e.attributes=JSON.parse(e.attributes)}catch(t){f.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(){return this._share.label}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,s){const i={scope:e,key:t,enabled:s};for(const e in this._share.attributes){const t=this._share.attributes[e];if(t.scope===i.scope&&t.key===i.key)return void(this._share.attributes[e]=i)}this._share.attributes.push(i)}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:p.D})};var m=i(64024),A=i(76212),v=i.n(A),E=i(12945),y=i.n(E);const w={name:"SharingEntrySimple",components:{NcActions:y()},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 S=i(93379),C=i.n(S),b=i(7795),P=i.n(b),x=i(90569),D=i.n(x),k=i(3565),T=i.n(k),R=i(19216),N=i.n(R),I=i(44589),O=i.n(I),L=i(46971),H={};H.styleTagTransform=O(),H.setAttributes=T(),H.insert=D().bind(null,"head"),H.domAPI=P(),H.insertStyleElement=N(),C()(L.Z,H),L.Z&&L.Z.locals&&L.Z.locals;var Y=i(51900);const U=(0,Y.Z)(w,(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,"02e83c36",null).exports;var B=i(25108);const M={name:"SharingEntryInternal",components:{NcActionLink:v(),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,B.error(e)}finally{setTimeout((()=>{this.copySuccess=!1,this.copied=!1}),4e3)}}}};var W=i(2256),F={};F.styleTagTransform=O(),F.setAttributes=T(),F.insert=D().bind(null,"head"),F.domAPI=P(),F.insertStyleElement=N(),C()(W.Z,F),W.Z&&W.Z.locals&&W.Z.locals;const q=(0,Y.Z)(M,(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 j=i(45994),Z=i(78595),$=i(20296),G=i.n($),V=i(36456),K=i.n(V),Q=i(25108);const z=new u;async function J(){if(z.passwordPolicy.api&&z.passwordPolicy.api.generate)try{const e=await c.default.get(z.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){Q.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 s="";for(let t=0;t<e.length;t++)s+="abcdefgijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXYZ23456789".charAt(.20392156862745098*e[t]);return s}i(35449);var X=i(25108);const ee=(0,o.generateOcsUrl)("apps/files_sharing/api/v1/shares"),te={methods:{async createShare(e){let{path:s,permissions:i,shareType:a,shareWith:r,publicUpload:n,password:o,sendPasswordByTalk:h,expireDate:l,label:d,attributes:u}=e;try{var p;const e=await c.default.post(ee,{path:s,permissions:i,shareType:a,shareWith:r,publicUpload:n,password:o,sendPasswordByTalk:h,expireDate:l,label:d,attributes:u});if(null==e||null===(p=e.data)||void 0===p||!p.ocs)throw e;return new g(e.data.ocs.data)}catch(e){var f,_,m,A;X.error("Error while creating share",e);const s=null==e||null===(f=e.response)||void 0===f||null===(_=f.data)||void 0===_||null===(m=_.ocs)||void 0===m||null===(A=m.meta)||void 0===A?void 0:A.message;throw OC.Notification.showTemporary(s?t("files_sharing","Error creating the share: {errorMessage}",{errorMessage:s}):t("files_sharing","Error creating the share"),{type:"error"}),e}},async deleteShare(e){try{var s;const t=await c.default.delete(ee+"/".concat(e));if(null==t||null===(s=t.data)||void 0===s||!s.ocs)throw t;return!0}catch(e){var i,a,r,n;X.error("Error while deleting share",e);const s=null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.ocs)||void 0===r||null===(n=r.meta)||void 0===n?void 0:n.message;throw OC.Notification.showTemporary(s?t("files_sharing","Error deleting the share: {errorMessage}",{errorMessage:s}):t("files_sharing","Error deleting the share"),{type:"error"}),e}},async updateShare(e,s){try{var i;const t=await c.default.put(ee+"/".concat(e),s);if(null!=t&&null!==(i=t.data)&&void 0!==i&&i.ocs)return t.data.ocs.data;throw t}catch(e){if(X.error("Error while updating share",e),400!==e.response.status){var a,r,n,o;const s=null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(n=r.ocs)||void 0===n||null===(o=n.meta)||void 0===o?void 0:o.message;OC.Notification.showTemporary(s?t("files_sharing","Error updating the share: {errorMessage}",{errorMessage:s}):t("files_sharing","Error updating the share"),{type:"error"})}const s=e.response.data.ocs.meta.message;throw new Error(s)}}}};var se=i(25108);const ie={name:"SharingInput",components:{NcSelect:K()},mixins:[_,te],props:{shares:{type:Array,default:()=>[],required:!0},linkShares:{type:Array,default:()=>[],required:!0},fileInfo:{type:Object,default:()=>{},required:!0},reshare:{type:g,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,Z.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 s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.loading=!0,!0===OC.getCapabilities().files_sharing.sharee.query_lookup_default&&(s=!0);const i=[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&&i.push(this.SHARE_TYPES.SHARE_TYPE_EMAIL);let a=null;try{a=await c.default.get((0,o.generateOcsUrl)("apps/files_sharing/api/v1/sharees"),{params:{format:"json",itemType:"dir"===this.fileInfo.type?"folder":"file",search:e,lookup:s,perPage:this.config.maxAutocompleteResults,shareType:i}})}catch(e){return void se.error("Error fetching suggestions",e)}const r=a.data.ocs.data,n=a.data.ocs.data.exact;r.exact=[];const h=Object.values(n).reduce(((e,t)=>e.concat(t)),[]),l=Object.values(r).reduce(((e,t)=>e.concat(t)),[]),d=this.filterOutExistingShares(h).map((e=>this.formatForMultiselect(e))).sort(((e,t)=>e.shareType-t.shareType)),u=this.filterOutExistingShares(l).map((e=>this.formatForMultiselect(e))).sort(((e,t)=>e.shareType-t.shareType)),p=[];r.lookupEnabled&&!s&&p.push({id:"global-lookup",isNoUser:!0,displayName:t("files_sharing","Search globally"),lookup:!0});const f=this.externalResults.filter((e=>!e.condition||e.condition(this))),g=d.concat(u).concat(f).concat(p),_=g.reduce(((e,t)=>t.displayName?(e[t.displayName]||(e[t.displayName]=0),e[t.displayName]++,e):e),{});this.suggestions=g.map((e=>_[e.displayName]>1&&!e.desc?{...e,desc:e.shareWithDisplayNameUnique}:e)),this.loading=!1,se.info("suggestions",this.suggestions)},debounceGetSuggestions:G()((function(){this.getSuggestions(...arguments)}),300),async getRecommendations(){this.loading=!0;let e=null;try{e=await c.default.get((0,o.generateOcsUrl)("apps/files_sharing/api/v1/sharees_recommended"),{params:{format:"json",itemType:this.fileInfo.type}})}catch(e){return void se.error("Error fetching recommendations",e)}const t=this.externalResults.filter((e=>!e.condition||e.condition(this))),s=Object.values(e.data.ocs.data.exact).reduce(((e,t)=>e.concat(t)),[]);this.recommendations=this.filterOutExistingShares(s).map((e=>this.formatForMultiselect(e))).concat(t),this.loading=!1,se.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,j.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 s=this.shares.reduce(((e,t)=>(e[t.shareWith]=t.type,e)),{}),i=t.value.shareWith.trim();if(i in s&&s[i]===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 s;var i;if(e.value.shareType===this.SHARE_TYPES.SHARE_TYPE_USER&&this.config.shouldAlwaysShowUnique)s=null!==(i=e.shareWithDisplayNameUnique)&&void 0!==i?i:"";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)s=e.value.shareWith;else{var a;s=null!==(a=e.shareWithDescription)&&void 0!==a?a:""}else s=t("files_sharing","on {server}",{server:e.value.server});return{id:"".concat(e.value.shareType,"-").concat(e.value.shareWith),shareWith:e.value.shareWith,shareType:e.value.shareType,user:e.uuid||e.value.shareWith,isNoUser:e.value.shareType!==this.SHARE_TYPES.SHARE_TYPE_USER,displayName:e.name||e.label,subtitle:s,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 g(t)),!0}this.loading=!0,se.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 J());const s=(this.fileInfo.path+"/"+this.fileInfo.name).replace("//","/"),i=await this.createShare({path:s,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?(i.newPassword=t,(await new Promise((e=>{this.$emit("add:share",i,e)}))).open=!0):this.$emit("add:share",i),await this.getRecommendations()}catch(t){this.$nextTick((()=>{this.$refs.select.$children[0].open=!0})),this.query=e.shareWith,se.error("Error while adding new share",t)}finally{this.loading=!1}}}};var ae=i(14710),re={};re.styleTagTransform=O(),re.setAttributes=T(),re.insert=D().bind(null,"head"),re.domAPI=P(),re.insertStyleElement=N(),C()(ae.Z,re),ae.Z&&ae.Z.locals&&ae.Z.locals;const ne=(0,Y.Z)(ie,(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.addShare},scopedSlots:e._u([{key:"no-options",fn:function(t){let{search:s}=t;return[e._v("\n\t\t\t"+e._s(s?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 oe=i(45400),he=i.n(oe),le=i(65358),ce=i(1162),de=i.n(ce),ue=i(25746),pe=i(25108);const fe={mixins:[te,_],props:{fileInfo:{type:Object,default:()=>{},required:!0},share:{type:g,default:null},isUnique:{type:Boolean,default:!0}},data(){var e;return{config:new u,errors:{},loading:!1,saving:!1,open:!1,updateQueue:new ue.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"}},isShareOwner(){return this.share&&this.share.owner===(0,j.ts)().uid}},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(e){this.share.expireDate=this.formatDateToString(e),this.queueUpdate("expireDate")},onExpirationDisable(){this.share.expireDate="",this.queueUpdate("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),pe.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,s=new Array(e),i=0;i<e;i++)s[i]=arguments[i];if(0!==s.length){if(this.share.id){const e={};return s.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 i=await this.updateShare(this.share.id,e);s.indexOf("password")>=0&&(this.$delete(this.share,"newPassword"),this.share.passwordExpirationTime=i.password_expiration_time),this.$delete(this.errors,s[0]),(0,m.s$)(t("files_sharing","Share {propertyName} saved",{propertyName:s[0]}))}catch({message:e}){e&&""!==e&&(this.onSyncError(s[0],e),(0,m.x2)(t("files_sharing",e)))}finally{this.saving=!1}}))}pe.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 s=this.$refs[e];if(s){s.$el&&(s=s.$el);const e=s.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)}},ge={name:"SharingEntryInherited",components:{NcActionButton:he(),NcActionLink:v(),NcActionText:de(),NcAvatar:l(),SharingEntrySimple:U},mixins:[fe],props:{share:{type:g,required:!0}},computed:{viaFileTargetUrl(){return(0,o.generateUrl)("/f/{fileid}",{fileid:this.share.viaFileid})},viaFolderName(){return(0,le.EZ)(this.share.viaPath)}}};var _e=i(33668),me={};me.styleTagTransform=O(),me.setAttributes=T(),me.insert=D().bind(null,"head"),me.domAPI=P(),me.insertStyleElement=N(),C()(_e.Z,me),_e.Z&&_e.Z.locals&&_e.Z.locals;const Ae=(0,Y.Z)(ge,(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,"038f97f0",null).exports;var ve=i(25108);const Ee={name:"SharingInherited",components:{NcActionButton:he(),SharingEntryInherited:Ae,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 c.default.get(e);this.shares=t.data.ocs.data.map((e=>new g(e))).sort(((e,t)=>t.createdTime-e.createdTime)),ve.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 ye=i(84772),we={};we.styleTagTransform=O(),we.setAttributes=T(),we.insert=D().bind(null,"head"),we.domAPI=P(),we.insertStyleElement=N(),C()(ye.Z,we),ye.Z&&ye.Z.locals&&ye.Z.locals;const Se=(0,Y.Z)(Ee,(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(s){return t("SharingEntryInherited",{key:s.id,attrs:{"file-info":e.fileInfo,share:s},on:{"remove:share":e.removeShare}})}))],2)}),[],!1,null,"05b67dc8",null).exports;var Ce=i(81807),be=i.n(Ce),Pe=i(79570),xe=i.n(Pe),De=i(875),ke=i.n(De),Te=i(18074),Re=i.n(Te);const Ne={name:"ExternalShareAction",props:{id:{type:String,required:!0},action:{type:Object,default:()=>({})},fileInfo:{type:Object,default:()=>{},required:!0},share:{type:g,default:null}},computed:{data(){return this.action.data(this)}}},Ie=(0,Y.Z)(Ne,(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 Oe=i(30158),Le=i.n(Oe);const He={NONE:0,READ:1,UPDATE:2,CREATE:4,DELETE:8,SHARE:16},Ye={READ_ONLY:He.READ,UPLOAD_AND_UPDATE:He.READ|He.UPDATE|He.CREATE|He.DELETE,FILE_DROP:He.CREATE,ALL:He.UPDATE|He.CREATE|He.READ|He.DELETE|He.SHARE};function Ue(e,t){return e!==He.NONE&&(e&t)===t}function Be(e){return!(!Ue(e,He.READ)&&!Ue(e,He.CREATE)||!Ue(e,He.READ)&&(Ue(e,He.UPDATE)||Ue(e,He.DELETE)))}function Me(e,t){return Ue(e,t)?function(e,t){return e&~t}(e,t):function(e,t){return e|t}(e,t)}var We=i(55976),Fe=i(32964);const qe={name:"SharePermissionsEditor",components:{NcActionButton:he(),NcActionCheckbox:be(),NcActionRadio:Le(),Tune:We.Z,ChevronLeft:Fe.default},mixins:[fe],data:()=>({randomFormName:Math.random().toString(27).substring(2),showCustomPermissionsForm:!1,atomicPermissions:He,bundledPermissions:Ye}),computed:{sharePermissionsSummary(){return Object.values(this.atomicPermissions).filter((e=>this.shareHasPermissions(e))).map((e=>{switch(e){case this.atomicPermissions.CREATE:return this.t("files_sharing","Upload");case this.atomicPermissions.READ:return this.t("files_sharing","Read");case this.atomicPermissions.UPDATE:return this.t("files_sharing","Edit");case this.atomicPermissions.DELETE:return this.t("files_sharing","Delete");default:return null}})).filter((e=>null!==e)).join(", ")},sharePermissionsIsBundle(){return Object.values(Ye).map((e=>this.sharePermissionEqual(e))).filter((e=>e)).length>0},sharePermissionsSetIsValid(){return Be(this.share.permissions)},isFolder(){return"dir"===this.fileInfo.type},fileHasCreatePermission(){return!!(this.fileInfo.permissions&He.CREATE)}},mounted(){this.showCustomPermissionsForm=!this.sharePermissionsIsBundle},methods:{sharePermissionEqual(e){return(this.share.permissions&~He.SHARE)===e},shareHasPermissions(e){return Ue(this.share.permissions,e)},setSharePermissions(e){this.share.permissions=e,this.queueUpdate("permissions")},canToggleSharePermissions(e){return function(e,t){return Be(Me(e,t))}(this.share.permissions,e)},toggleSharePermissions(e){this.share.permissions=Me(this.share.permissions,e),Be(this.share.permissions)&&this.queueUpdate("permissions")}}};var je=i(3163),Ze={};Ze.styleTagTransform=O(),Ze.setAttributes=T(),Ze.insert=D().bind(null,"head"),Ze.domAPI=P(),Ze.insertStyleElement=N(),C()(je.Z,Ze),je.Z&&je.Z.locals&&je.Z.locals;const $e=(0,Y.Z)(qe,(function(){var e=this,t=e._self._c;return t("li",[t("ul",[e.isFolder?e._e():t("NcActionCheckbox",{attrs:{checked:e.shareHasPermissions(e.atomicPermissions.UPDATE),disabled:e.saving},on:{"update:checked":function(t){return e.toggleSharePermissions(e.atomicPermissions.UPDATE)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Allow editing"))+"\n\t\t")]),e._v(" "),e.isFolder&&e.fileHasCreatePermission&&e.config.isPublicUploadEnabled?[e.showCustomPermissionsForm?t("span",{class:{error:!e.sharePermissionsSetIsValid}},[t("NcActionCheckbox",{attrs:{checked:e.shareHasPermissions(e.atomicPermissions.READ),disabled:e.saving||!e.canToggleSharePermissions(e.atomicPermissions.READ)},on:{"update:checked":function(t){return e.toggleSharePermissions(e.atomicPermissions.READ)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Read"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.shareHasPermissions(e.atomicPermissions.CREATE),disabled:e.saving||!e.canToggleSharePermissions(e.atomicPermissions.CREATE)},on:{"update:checked":function(t){return e.toggleSharePermissions(e.atomicPermissions.CREATE)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Upload"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.shareHasPermissions(e.atomicPermissions.UPDATE),disabled:e.saving||!e.canToggleSharePermissions(e.atomicPermissions.UPDATE)},on:{"update:checked":function(t){return e.toggleSharePermissions(e.atomicPermissions.UPDATE)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Edit"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.shareHasPermissions(e.atomicPermissions.DELETE),disabled:e.saving||!e.canToggleSharePermissions(e.atomicPermissions.DELETE)},on:{"update:checked":function(t){return e.toggleSharePermissions(e.atomicPermissions.DELETE)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Delete"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionButton",{on:{click:function(t){e.showCustomPermissionsForm=!1}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("ChevronLeft")]},proxy:!0}],null,!1,1018742195)},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Bundled permissions"))+"\n\t\t\t\t")])],1):[t("NcActionRadio",{attrs:{checked:e.sharePermissionEqual(e.bundledPermissions.READ_ONLY),value:e.bundledPermissions.READ_ONLY,name:e.randomFormName,disabled:e.saving},on:{change:function(t){return e.setSharePermissions(e.bundledPermissions.READ_ONLY)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Read only"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionRadio",{attrs:{checked:e.sharePermissionEqual(e.bundledPermissions.UPLOAD_AND_UPDATE),value:e.bundledPermissions.UPLOAD_AND_UPDATE,disabled:e.saving,name:e.randomFormName},on:{change:function(t){return e.setSharePermissions(e.bundledPermissions.UPLOAD_AND_UPDATE)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Allow upload and editing"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionRadio",{staticClass:"sharing-entry__action--public-upload",attrs:{checked:e.sharePermissionEqual(e.bundledPermissions.FILE_DROP),value:e.bundledPermissions.FILE_DROP,disabled:e.saving,name:e.randomFormName},on:{change:function(t){return e.setSharePermissions(e.bundledPermissions.FILE_DROP)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","File drop (upload only)"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionButton",{attrs:{title:e.t("files_sharing","Custom permissions")},on:{click:function(t){e.showCustomPermissionsForm=!0}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("Tune")]},proxy:!0}],null,!1,961531849)},[e._v("\n\t\t\t\t\t"+e._s(e.sharePermissionsIsBundle?"":e.sharePermissionsSummary)+"\n\t\t\t\t")])]]:e._e()],2)])}),[],!1,null,"7cec8a94",null).exports;var Ge=i(25108);const Ve={name:"SharingEntryLink",components:{NcActions:y(),NcActionButton:he(),NcActionCheckbox:be(),NcActionInput:xe(),NcActionLink:v(),NcActionText:de(),NcActionTextEditable:Re(),NcActionSeparator:ke(),NcAvatar:l(),ExternalShareAction:Ie,SharePermissionsEditor:$e},mixins:[fe],props:{canReshare:{type:Boolean,default:!0},index:{type:Number,default:null}},data:()=>({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},hasExpirationDate:{get(){return this.config.isDefaultExpireDateEnforced||!!this.share.expireDate},set(e){const t=this.config.defaultExpirationDate||new Date((new Date).setDate((new Date).getDate()+1));this.share.expireDate=e?this.formatDateToString(t):"",Ge.debug("Expiration date status",e,this.share.expireDate)}},dateMaxEnforced(){return this.config.isDefaultExpireDateEnforced?new Date((new Date).setDate((new Date).getDate()+this.config.defaultExpireDate)):null},isPasswordProtected:{get(){return this.config.enforcePasswordForPublicLink||!!this.share.password},async set(e){a.default.set(this.share,"password",e?await J():""),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.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(p.D.SHARE_TYPE_LINK)||e.shareType.includes(p.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:p.D.SHARE_TYPE_LINK};if(this.config.isDefaultExpireDateEnforced&&(e.expiration=this.formatDateToString(this.config.defaultExpirationDate)),this.config.enableLinkPasswordByDefault&&(e.password=await J()),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,Ge.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.enforcePasswordForPublicLink&&(e.password=await J());const s=new g(e),i=await new Promise((e=>{this.$emit("add:share",s,e)}));this.open=!1,this.pending=!1,i.open=!0}else{const t=new g(e);await this.pushNewLinkShare(t)}},async pushNewLinkShare(e,s){try{if(this.loading)return!0;this.loading=!0,this.errors={};const i={path:(this.fileInfo.path+"/"+this.fileInfo.name).replace("//","/"),shareType:p.D.SHARE_TYPE_LINK,password:e.password,expireDate:e.expireDate,attributes:JSON.stringify(this.fileInfo.shareAttributes)};Ge.debug("Creating link share with options",i);const a=await this.createShare(i);let r;this.open=!1,Ge.debug("Link share created",a),r=s?await new Promise((e=>{this.$emit("update:share",a,e)})):await new Promise((e=>{this.$emit("add:share",a,e)})),this.config.enforcePasswordForPublicLink||r.copyLink(),(0,m.s$)(t("sharing","Link share created"))}catch(e){var i,a,r,n;const s=null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.ocs)||void 0===r||null===(n=r.meta)||void 0===n?void 0:n.message;if(!s)return(0,m.x2)(t("sharing","Error while creating the share")),void Ge.error(e);throw s.match(/password/i)?this.onSyncError("password",s):s.match(/date/i)?this.onSyncError("expireDate",s):this.onSyncError("pending",s),e}finally{this.loading=!1}},onLabelChange(e){this.$set(this.share,"newLabel",e.trim())},onLabelSubmit(){"string"==typeof this.share.newLabel&&(this.share.label=this.share.newLabel,this.$delete(this.share,"newLabel"),this.queueUpdate("label"))},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,Ge.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)}}},Ke=Ve;var Qe=i(91154),ze={};ze.styleTagTransform=O(),ze.setAttributes=T(),ze.insert=D().bind(null,"head"),ze.domAPI=P(),ze.insertStyleElement=N(),C()(Qe.Z,ze),Qe.Z&&Qe.Z.locals&&Qe.Z.locals;const Je={name:"SharingLinkList",components:{SharingEntryLink:(0,Y.Z)(Ke,(function(){var e=this,t=e._self._c;return t("li",{staticClass:"sharing-entry sharing-entry__link",class:{"sharing-entry--share":e.share}},[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{"is-no-user":!0,"icon-class":e.isEmailShareType?"avatar-link-share icon-mail-white":"avatar-link-share icon-public-white"}}),e._v(" "),t("div",{staticClass:"sharing-entry__desc"},[t("span",{staticClass:"sharing-entry__title",attrs:{title:e.title}},[e._v("\n\t\t\t"+e._s(e.title)+"\n\t\t")]),e._v(" "),e.subtitle?t("p",[e._v("\n\t\t\t"+e._s(e.subtitle)+"\n\t\t")]):e._e()]),e._v(" "),e.share&&!e.isEmailShareType&&e.share.token?t("NcActions",{ref:"copyButton",staticClass:"sharing-entry__copy"},[t("NcActionLink",{attrs:{href:e.shareLink,target:"_blank",title:e.copyLinkTooltip,"aria-label":e.copyLinkTooltip,icon:e.copied&&e.copySuccess?"icon-checkmark-color":"icon-clippy"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.copyLink.apply(null,arguments)}}})],1):e._e(),e._v(" "),e.pending||!e.pendingPassword&&!e.pendingExpirationDate?e.loading?t("div",{staticClass:"icon-loading-small sharing-entry__loading"}):t("NcActions",{staticClass:"sharing-entry__actions",attrs:{"aria-label":e.actionsTooltip,"menu-align":"right",open:e.open},on:{"update:open":function(t){e.open=t},close:e.onMenuClose}},[e.share?[e.share.canEdit&&e.canReshare?[t("NcActionInput",{ref:"label",class:{error:e.errors.label},attrs:{disabled:e.saving,label:e.t("files_sharing","Share label"),value:void 0!==e.share.newLabel?e.share.newLabel:e.share.label,icon:"icon-edit",maxlength:"255"},on:{"update:value":e.onLabelChange,submit:e.onLabelSubmit}}),e._v(" "),t("SharePermissionsEditor",{attrs:{"can-reshare":e.canReshare,share:e.share,"file-info":e.fileInfo},on:{"update:share":function(t){e.share=t}}}),e._v(" "),t("NcActionSeparator"),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.share.hideDownload,disabled:e.saving||e.canChangeHideDownload},on:{"update:checked":function(t){return e.$set(e.share,"hideDownload",t)},change:function(t){return e.queueUpdate("hideDownload")}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Hide download"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionCheckbox",{staticClass:"share-link-password-checkbox",attrs:{checked:e.isPasswordProtected,disabled:e.config.enforcePasswordForPublicLink||e.saving},on:{"update:checked":function(t){e.isPasswordProtected=t},uncheck:e.onPasswordDisable}},[e._v("\n\t\t\t\t\t"+e._s(e.config.enforcePasswordForPublicLink?e.t("files_sharing","Password protection (enforced)"):e.t("files_sharing","Password protect"))+"\n\t\t\t\t")]),e._v(" "),e.isPasswordProtected?t("NcActionInput",{ref:"password",staticClass:"share-link-password",class:{error:e.errors.password},attrs:{disabled:e.saving,"show-trailing-button":e.hasUnsavedPassword,required:e.config.enforcePasswordForPublicLink,value:e.hasUnsavedPassword?e.share.newPassword:"***************",icon:"icon-password",autocomplete:"new-password",type:e.hasUnsavedPassword?"text":"password"},on:{"update:value":e.onPasswordChange,submit:e.onPasswordSubmit}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Enter a password"))+"\n\t\t\t\t")]):e._e(),e._v(" "),e.isEmailShareType&&e.passwordExpirationTime?t("NcActionText",{attrs:{icon:"icon-info"}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Password expires {passwordExpirationTime}",{passwordExpirationTime:e.passwordExpirationTime}))+"\n\t\t\t\t")]):e.isEmailShareType&&null!==e.passwordExpirationTime?t("NcActionText",{attrs:{icon:"icon-error"}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Password expired"))+"\n\t\t\t\t")]):e._e(),e._v(" "),e.isPasswordProtectedByTalkAvailable?t("NcActionCheckbox",{staticClass:"share-link-password-talk-checkbox",attrs:{checked:e.isPasswordProtectedByTalk,disabled:!e.canTogglePasswordProtectedByTalkAvailable||e.saving},on:{"update:checked":function(t){e.isPasswordProtectedByTalk=t},change:e.onPasswordProtectedByTalkChange}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Video verification"))+"\n\t\t\t\t")]):e._e(),e._v(" "),t("NcActionCheckbox",{staticClass:"share-link-expire-date-checkbox",attrs:{checked:e.hasExpirationDate,disabled:e.config.isDefaultExpireDateEnforced||e.saving},on:{"update:checked":function(t){e.hasExpirationDate=t},uncheck:e.onExpirationDisable}},[e._v("\n\t\t\t\t\t"+e._s(e.config.isDefaultExpireDateEnforced?e.t("files_sharing","Expiration date (enforced)"):e.t("files_sharing","Set expiration date"))+"\n\t\t\t\t")]),e._v(" "),e.hasExpirationDate?t("NcActionInput",{ref:"expireDate",staticClass:"share-link-expire-date",class:{error:e.errors.expireDate},attrs:{"is-native-picker":!0,"hide-label":!0,disabled:e.saving,value:new Date(e.share.expireDate),type:"date",min:e.dateTomorrow,max:e.dateMaxEnforced},on:{input:e.onExpirationChange}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Enter a date"))+"\n\t\t\t\t")]):e._e(),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.hasNote,disabled:e.saving},on:{"update:checked":function(t){e.hasNote=t},uncheck:function(t){return e.queueUpdate("note")}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Note to recipient"))+"\n\t\t\t\t")]),e._v(" "),e.hasNote?t("NcActionTextEditable",{ref:"note",class:{error:e.errors.note},attrs:{disabled:e.saving,placeholder:e.t("files_sharing","Enter a note for the share recipient"),value:e.share.newNote||e.share.note,icon:"icon-edit"},on:{"update:value":e.onNoteChange,submit:e.onNoteSubmit}}):e._e()]:e._e(),e._v(" "),t("NcActionSeparator"),e._v(" "),e._l(e.externalLinkActions,(function(s){return t("ExternalShareAction",{key:s.id,attrs:{id:s.id,action:s,"file-info":e.fileInfo,share:e.share}})})),e._v(" "),e._l(e.externalLegacyLinkActions,(function(s,i){let{icon:a,url:r,name:n}=s;return t("NcActionLink",{key:i,attrs:{href:r(e.shareLink),icon:a,target:"_blank"}},[e._v("\n\t\t\t\t"+e._s(n)+"\n\t\t\t")])})),e._v(" "),e.share.canDelete?t("NcActionButton",{attrs:{icon:"icon-close",disabled:e.saving},on:{click:function(t){return t.preventDefault(),e.onDelete.apply(null,arguments)}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Unshare"))+"\n\t\t\t")]):e._e(),e._v(" "),!e.isEmailShareType&&e.canReshare?t("NcActionButton",{staticClass:"new-share-link",attrs:{icon:"icon-add"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare.apply(null,arguments)}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Add another link"))+"\n\t\t\t")]):e._e()]:e.canReshare?t("NcActionButton",{staticClass:"new-share-link",attrs:{title:e.t("files_sharing","Create a new share link"),"aria-label":e.t("files_sharing","Create a new share link"),icon:e.loading?"icon-loading-small":"icon-add"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare.apply(null,arguments)}}}):e._e()],2):t("NcActions",{staticClass:"sharing-entry__actions",attrs:{"aria-label":e.actionsTooltip,"menu-align":"right",open:e.open},on:{"update:open":function(t){e.open=t},close:e.onNewLinkShare}},[e.errors.pending?t("NcActionText",{class:{error:e.errors.pending},attrs:{icon:"icon-error"}},[e._v("\n\t\t\t"+e._s(e.errors.pending)+"\n\t\t")]):t("NcActionText",{attrs:{icon:"icon-info"}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Please enter the following required information before creating the share"))+"\n\t\t")]),e._v(" "),e.pendingPassword?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.config.enableLinkPasswordByDefault?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.pendingPassword||e.share.password?t("NcActionInput",{staticClass:"share-link-password",attrs:{value:e.share.password,disabled:e.saving,required:e.config.enableLinkPasswordByDefault||e.config.enforcePasswordForPublicLink,minlength:e.isPasswordPolicyEnabled&&e.config.passwordPolicy.minLength,icon:"",autocomplete:"new-password"},on:{"update:value":function(t){return e.$set(e.share,"password",t)},submit:e.onNewLinkShare}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Enter a password"))+"\n\t\t")]):e._e(),e._v(" "),e.pendingExpirationDate?t("NcActionText",{attrs:{icon:"icon-calendar-dark"}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Expiration date (enforced)"))+"\n\t\t")]):e._e(),e._v(" "),e.pendingExpirationDate?t("NcActionInput",{staticClass:"share-link-expire-date",attrs:{disabled:e.saving,"is-native-picker":!0,"hide-label":!0,value:new Date(e.share.expireDate),type:"date",min:e.dateTomorrow,max:e.dateMaxEnforced},on:{input:e.onExpirationChange}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Enter a date"))+"\n\t\t")]):e._e(),e._v(" "),t("NcActionButton",{attrs:{icon:"icon-checkmark"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Create share"))+"\n\t\t")]),e._v(" "),t("NcActionButton",{attrs:{icon:"icon-close"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onCancel.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Cancel"))+"\n\t\t")])],1)],1)}),[],!1,null,"2662d6f0",null).exports},mixins:[_],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 s=this.$children.find((t=>t.share===e));s&&t(s)}))},removeShare(e){const t=this.shares.findIndex((t=>t===e));this.shares.splice(t,1)}}},Xe=(0,Y.Z)(Je,(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(s,i){return t("SharingEntryLink",{key:s.id,attrs:{index:e.shares.length>1?i+1:null,"can-reshare":e.canReshare,share:e.shares[i],"file-info":e.fileInfo},on:{"update:share":[function(t){return e.$set(e.shares,i,t)},function(t){return e.awaitForShare(...arguments)}],"add:share":function(t){return e.addShare(...arguments)},"remove:share":e.removeShare}})})):e._e()],2):e._e()}),[],!1,null,null,null).exports;var et=i(25108);const tt={name:"SharingEntry",components:{NcActions:y(),NcActionButton:he(),NcActionCheckbox:be(),NcActionInput:xe(),NcActionTextEditable:Re(),NcAvatar:l()},mixins:[fe],data:()=>({permissionsEdit:OC.PERMISSION_UPDATE,permissionsCreate:OC.PERMISSION_CREATE,permissionsDelete:OC.PERMISSION_DELETE,permissionsRead:OC.PERMISSION_READ,permissionsShare:OC.PERMISSION_SHARE}),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},canHaveNote(){return!this.isRemote},isRemote(){return this.share.type===this.SHARE_TYPES.SHARE_TYPE_REMOTE||this.share.type===this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP},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},canEdit:{get(){return this.share.hasUpdatePermission},set(e){this.updatePermissions({isEditChecked:e})}},canCreate:{get(){return this.share.hasCreatePermission},set(e){this.updatePermissions({isCreateChecked:e})}},canDelete:{get(){return this.share.hasDeletePermission},set(e){this.updatePermissions({isDeleteChecked:e})}},canReshare:{get(){return this.share.hasSharePermission},set(e){this.updatePermissions({isReshareChecked:e})}},canDownload:{get(){return this.share.hasDownloadPermission},set(e){this.updatePermissions({isDownloadChecked:e})}},hasRead:{get(){return this.share.hasReadPermission}},isFolder(){return"dir"===this.fileInfo.type},hasExpirationDate:{get(){return this.config.isDefaultInternalExpireDateEnforced||!!this.share.expireDate},set(e){const t=this.config.defaultInternalExpirationDate||new Date((new Date).setDate((new Date).getDate()+1));this.share.expireDate=e?this.formatDateToString(t):"",et.debug("Expiration date status",e,this.share.expireDate)}},dateMaxEnforced(){return!this.isRemote&&this.config.isDefaultInternalExpireDateEnforced?new Date((new Date).setDate((new Date).getDate()+1+this.config.defaultInternalExpireDate)):this.config.isDefaultRemoteExpireDateEnforced?new Date((new Date).setDate((new Date).getDate()+1+this.config.defaultRemoteExpireDate)):null},hasStatus(){return this.share.type===this.SHARE_TYPES.SHARE_TYPE_USER&&"object"==typeof this.share.status&&!Array.isArray(this.share.status)},allowDownloadText:()=>t("files_sharing","Allow download"),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)}},methods:{updatePermissions(){let{isEditChecked:e=this.canEdit,isCreateChecked:t=this.canCreate,isDeleteChecked:s=this.canDelete,isReshareChecked:i=this.canReshare,isDownloadChecked:a=this.canDownload}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=0|(this.hasRead?this.permissionsRead:0)|(t?this.permissionsCreate:0)|(s?this.permissionsDelete:0)|(e?this.permissionsEdit:0)|(i?this.permissionsShare:0);this.share.permissions=r,this.share.hasDownloadPermission!==a&&(this.share.hasDownloadPermission=a),this.queueUpdate("permissions","attributes")},onMenuClose(){this.onNoteSubmit()}}};var st=i(10915),it={};it.styleTagTransform=O(),it.setAttributes=T(),it.insert=D().bind(null,"head"),it.domAPI=P(),it.insertStyleElement=N(),C()(st.Z,it),st.Z&&st.Z.locals&&st.Z.locals;const at={name:"SharingList",components:{SharingEntry:(0,Y.Z)(tt,(function(){var e=this,t=e._self._c;return t("li",{staticClass:"sharing-entry"},[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{"is-no-user":e.share.type!==e.SHARE_TYPES.SHARE_TYPE_USER,user:e.share.shareWith,"display-name":e.share.shareWithDisplayName,"menu-position":"left",url:e.share.shareWithAvatar}}),e._v(" "),t(e.share.shareWithLink?"a":"div",{tag:"component",staticClass:"sharing-entry__desc",attrs:{title:e.tooltip,"aria-label":e.tooltip,href:e.share.shareWithLink}},[t("span",[e._v(e._s(e.title)),e.isUnique?e._e():t("span",{staticClass:"sharing-entry__desc-unique"},[e._v(" ("+e._s(e.share.shareWithDisplayNameUnique)+")")])]),e._v(" "),e.hasStatus?t("p",[t("span",[e._v(e._s(e.share.status.icon||""))]),e._v(" "),t("span",[e._v(e._s(e.share.status.message||""))])]):e._e()]),e._v(" "),t("NcActions",{staticClass:"sharing-entry__actions",attrs:{"menu-align":"right"},on:{close:e.onMenuClose}},[e.share.canEdit?[t("NcActionCheckbox",{ref:"canEdit",attrs:{checked:e.canEdit,value:e.permissionsEdit,disabled:e.saving||!e.canSetEdit},on:{"update:checked":function(t){e.canEdit=t}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Allow editing"))+"\n\t\t\t")]),e._v(" "),e.isFolder?t("NcActionCheckbox",{ref:"canCreate",attrs:{checked:e.canCreate,value:e.permissionsCreate,disabled:e.saving||!e.canSetCreate},on:{"update:checked":function(t){e.canCreate=t}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Allow creating"))+"\n\t\t\t")]):e._e(),e._v(" "),e.isFolder?t("NcActionCheckbox",{ref:"canDelete",attrs:{checked:e.canDelete,value:e.permissionsDelete,disabled:e.saving||!e.canSetDelete},on:{"update:checked":function(t){e.canDelete=t}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Allow deleting"))+"\n\t\t\t")]):e._e(),e._v(" "),e.config.isResharingAllowed?t("NcActionCheckbox",{ref:"canReshare",attrs:{checked:e.canReshare,value:e.permissionsShare,disabled:e.saving||!e.canSetReshare},on:{"update:checked":function(t){e.canReshare=t}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Allow resharing"))+"\n\t\t\t")]):e._e(),e._v(" "),e.isSetDownloadButtonVisible?t("NcActionCheckbox",{ref:"canDownload",attrs:{checked:e.canDownload,disabled:e.saving||!e.canSetDownload},on:{"update:checked":function(t){e.canDownload=t}}},[e._v("\n\t\t\t\t"+e._s(e.allowDownloadText)+"\n\t\t\t")]):e._e(),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.hasExpirationDate,disabled:e.config.isDefaultInternalExpireDateEnforced||e.saving},on:{"update:checked":function(t){e.hasExpirationDate=t},uncheck:e.onExpirationDisable}},[e._v("\n\t\t\t\t"+e._s(e.config.isDefaultInternalExpireDateEnforced?e.t("files_sharing","Expiration date enforced"):e.t("files_sharing","Set expiration date"))+"\n\t\t\t")]),e._v(" "),e.hasExpirationDate?t("NcActionInput",{ref:"expireDate",class:{error:e.errors.expireDate},attrs:{"is-native-picker":!0,"hide-label":!0,disabled:e.saving,value:new Date(e.share.expireDate),type:"date",min:e.dateTomorrow,max:e.dateMaxEnforced},on:{input:e.onExpirationChange}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Enter a date"))+"\n\t\t\t")]):e._e(),e._v(" "),e.canHaveNote?[t("NcActionCheckbox",{attrs:{checked:e.hasNote,disabled:e.saving},on:{"update:checked":function(t){e.hasNote=t},uncheck:function(t){return e.queueUpdate("note")}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Note to recipient"))+"\n\t\t\t\t")]),e._v(" "),e.hasNote?t("NcActionTextEditable",{ref:"note",class:{error:e.errors.note},attrs:{disabled:e.saving,value:e.share.newNote||e.share.note,icon:"icon-edit"},on:{"update:value":e.onNoteChange,submit:e.onNoteSubmit}}):e._e()]:e._e()]:e._e(),e._v(" "),e.share.canDelete?t("NcActionButton",{attrs:{icon:"icon-close",disabled:e.saving},on:{click:function(t){return t.preventDefault(),e.onDelete.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Unshare"))+"\n\t\t")]):e._e()],2)],1)}),[],!1,null,"325ebcb0",null).exports},mixins:[_],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}},methods:{removeShare(e){const t=this.shares.findIndex((t=>t===e));this.shares.splice(t,1)}}},rt=(0,Y.Z)(at,(function(){var e=this,t=e._self._c;return t("ul",{staticClass:"sharing-sharee-list"},e._l(e.shares,(function(s){return t("SharingEntry",{key:s.id,attrs:{"file-info":e.fileInfo,share:s,"is-unique":e.isUnique(s)},on:{"remove:share":e.removeShare}})})),1)}),[],!1,null,null,null).exports;var nt=i(25108);const ot={name:"SharingTab",components:{NcAvatar:l(),CollectionList:n.G,SharingEntryInternal:q,SharingEntrySimple:U,SharingInherited:Se,SharingInput:ne,SharingLinkList:Xe,SharingList:rt},mixins:[_],data:()=>({config:new u,error:"",expirationInterval:null,loading:!0,fileInfo:null,reshare:null,sharedWithMe:{},shares:[],linkShares:[],sections:OCA.Sharing.ShareTabSections.getSections(),projectsEnabled:(0,d.j)("core","projects_enabled",!1)}),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",s=(this.fileInfo.path+"/"+this.fileInfo.name).replace("//","/"),i=c.default.get(e,{params:{format:t,path:s,reshares:!0}}),a=c.default.get(e,{params:{format:t,path:s,shared_with_me:!0}}),[r,n]=await Promise.all([i,a]);this.loading=!1,this.processSharedWithMe(n),this.processShares(r)}catch(a){var e,s,i;null!==(e=a.response.data)&&void 0!==e&&null!==(s=e.ocs)&&void 0!==s&&null!==(i=s.meta)&&void 0!==i&&i.message?this.error=a.response.data.ocs.meta.message:this.error=t("files_sharing","Unable to load the shares list"),this.loading=!1,nt.error("Error loading the shares list",a)}},resetState(){clearInterval(this.expirationInterval),this.loading=!0,this.error="",this.sharedWithMe={},this.shares=[],this.linkShares=[]},updateExpirationSubtitle(e){const s=moment(e.expireDate).unix();this.$set(this.sharedWithMe,"subtitle",t("files_sharing","Expires {relativetime}",{relativetime:OC.Util.relativeModifiedDate(1e3*s)})),moment().unix()>s&&(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 g(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)),nt.debug("Processed",this.linkShares.length,"link share(s)"),nt.debug("Processed",this.shares.length,"share(s)")}},processSharedWithMe(e){let{data:s}=e;if(s.ocs&&s.ocs.data&&s.ocs.data[0]){const e=new g(s),i=function(e){return e.type===p.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===p.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===p.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,r=e.owner;this.sharedWithMe={displayName:a,title:i,user:r},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)},awaitForShare(e,t){let s=this.$refs.shareList;e.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL&&(s=this.$refs.linkShareList),this.$nextTick((()=>{const i=s.$children.find((t=>t.share===e));i&&t(i)}))}}},ht=ot;var lt=i(27172),ct={};ct.styleTagTransform=O(),ct.setAttributes=T(),ct.insert=D().bind(null,"head"),ct.domAPI=P(),ct.insertStyleElement=N(),C()(lt.Z,ct),lt.Z&&lt.Z.locals&&lt.Z.locals;const dt=(0,Y.Z)(ht,(function(){var e=this,t=e._self._c;return t("div",{class:{"icon-loading":e.loading}},[e.error?t("div",{staticClass:"emptycontent",class:{emptyContentWithSections:e.sections.length>0}},[t("div",{staticClass:"icon icon-error"}),e._v(" "),t("h2",[e._v(e._s(e.error))])]):t("div",{staticClass:"sharingTab__content"},[e.isSharedWithMe?t("SharingEntrySimple",e._b({staticClass:"sharing-entry__reshare",scopedSlots:e._u([{key:"avatar",fn:function(){return[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{user:e.sharedWithMe.user,"display-name":e.sharedWithMe.displayName}})]},proxy:!0}],null,!1,3197855346)},"SharingEntrySimple",e.sharedWithMe,!1)):e._e(),e._v(" "),e.loading?e._e():t("SharingInput",{attrs:{"can-reshare":e.canReshare,"file-info":e.fileInfo,"link-shares":e.linkShares,reshare:e.reshare,shares:e.shares},on:{"add:share":e.addShare}}),e._v(" "),e.loading?e._e():t("SharingLinkList",{ref:"linkShareList",attrs:{"can-reshare":e.canReshare,"file-info":e.fileInfo,shares:e.linkShares}}),e._v(" "),e.loading?e._e():t("SharingList",{ref:"shareList",attrs:{shares:e.shares,"file-info":e.fileInfo}}),e._v(" "),e.canReshare&&!e.loading?t("SharingInherited",{attrs:{"file-info":e.fileInfo}}):e._e(),e._v(" "),t("SharingEntryInternal",{attrs:{"file-info":e.fileInfo}}),e._v(" "),e.projectsEnabled&&e.fileInfo?t("CollectionList",{attrs:{id:"".concat(e.fileInfo.id),type:"file",name:e.fileInfo.name}}):e._e()],1),e._v(" "),e._l(e.sections,(function(s,i){return t("div",{key:i,ref:"section-"+i,refInFor:!0,staticClass:"sharingTab__additionalContent"},[t(s(e.$refs["section-"+i],e.fileInfo),{tag:"component",attrs:{"file-info":e.fileInfo}})],1)}))],2)}),[],!1,null,"085eaa7e",null).exports;var ut=i(25108);var pt=i(25108);var ft=i(25108);var gt=i(44582);window.OCA.Sharing||(window.OCA.Sharing={}),Object.assign(window.OCA.Sharing,{ShareSearch:new class{constructor(){var e,t,s;e=this,s=void 0,(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var i=s.call(e,"string");if("object"!=typeof i)return i;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:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,this._state={},this._state.results=[],ut.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):(ut.error("Invalid search result provided",e),!1)}}}),Object.assign(window.OCA.Sharing,{ExternalLinkActions:new class{constructor(){var e,t,s;e=this,s=void 0,(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var i=s.call(e,"string");if("object"!=typeof i)return i;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:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,this._state={},this._state.actions=[],pt.debug("OCA.Sharing.ExternalLinkActions initialized")}get state(){return this._state}registerAction(e){return pt.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):(pt.error("Invalid action provided",e),!1)}}}),Object.assign(window.OCA.Sharing,{ExternalShareActions:new class{constructor(){var e,t,s;e=this,s=void 0,(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var i=s.call(e,"string");if("object"!=typeof i)return i;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:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,this._state={},this._state.actions=[],ft.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?(ft.error("An action with the same id ".concat(e.id," already exists"),e),!1):(this._state.actions.push(e),!0):(ft.error("Invalid action provided",e),!1)}}}),Object.assign(window.OCA.Sharing,{ShareTabSections:new class{constructor(){var e,t,s;e=this,s=void 0,(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var i=s.call(e,"string");if("object"!=typeof i)return i;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:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,this._sections=[]}registerSection(e){this._sections.push(e)}getSections(){return this._sections}}}),a.default.prototype.t=r.Iu,a.default.prototype.n=r.uN;const _t=a.default.extend(dt);let mt=null;window.addEventListener("DOMContentLoaded",(function(){OCA.Files&&OCA.Files.Sidebar&&OCA.Files.Sidebar.registerTab(new OCA.Files.Sidebar.Tab({id:"sharing",name:(0,r.Iu)("files_sharing","Sharing"),iconSvg:gt,async mount(e,t,s){mt&&mt.$destroy(),mt=new _t({parent:s}),await mt.update(t),mt.$mount(e)},update(e){mt.update(e)},destroy(){mt.$destroy(),mt=null}}))}))},3163:(e,t,s)=>{s.d(t,{Z:()=>o});var i=s(87537),a=s.n(i),r=s(23645),n=s.n(r)()(a());n.push([e.id,".error[data-v-7cec8a94] .action-checkbox__label:before{border:1px solid var(--color-error)}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharePermissionsEditor.vue"],names:[],mappings:"AAEC,uDACC,mCAAA",sourcesContent:["\n.error {\n\t::v-deep .action-checkbox__label:before {\n\t\tborder: 1px solid var(--color-error);\n\t}\n}\n"],sourceRoot:""}]);const o=n},10915:(e,t,s)=>{s.d(t,{Z:()=>o});var i=s(87537),a=s.n(i),r=s(23645),n=s.n(r)()(a());n.push([e.id,".sharing-entry[data-v-325ebcb0]{display:flex;align-items:center;height:44px}.sharing-entry__desc[data-v-325ebcb0]{display:flex;flex-direction:column;justify-content:space-between;padding:8px;line-height:1.2em}.sharing-entry__desc p[data-v-325ebcb0]{color:var(--color-text-maxcontrast)}.sharing-entry__desc-unique[data-v-325ebcb0]{color:var(--color-text-maxcontrast)}.sharing-entry__actions[data-v-325ebcb0]{margin-left:auto}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingEntry.vue"],names:[],mappings:"AACA,gCACC,YAAA,CACA,kBAAA,CACA,WAAA,CACA,sCACC,YAAA,CACA,qBAAA,CACA,6BAAA,CACA,WAAA,CACA,iBAAA,CACA,wCACC,mCAAA,CAED,6CACC,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\tline-height: 1.2em;\n\t\tp {\n\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t}\n\t\t&-unique {\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=n},33668:(e,t,s)=>{s.d(t,{Z:()=>o});var i=s(87537),a=s.n(i),r=s(23645),n=s.n(r)()(a());n.push([e.id,".sharing-entry[data-v-038f97f0]{display:flex;align-items:center;height:44px}.sharing-entry__desc[data-v-038f97f0]{display:flex;flex-direction:column;justify-content:space-between;padding:8px;line-height:1.2em}.sharing-entry__desc p[data-v-038f97f0]{color:var(--color-text-maxcontrast)}.sharing-entry__actions[data-v-038f97f0]{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,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\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=n},2256:(e,t,s)=>{s.d(t,{Z:()=>o});var i=s(87537),a=s.n(i),r=s(23645),n=s.n(r)()(a());n.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=n},91154:(e,t,s)=>{s.d(t,{Z:()=>o});var i=s(87537),a=s.n(i),r=s(23645),n=s.n(r)()(a());n.push([e.id,".sharing-entry[data-v-2662d6f0]{display:flex;align-items:center;min-height:44px}.sharing-entry__desc[data-v-2662d6f0]{display:flex;flex-direction:column;justify-content:space-between;padding:8px;line-height:1.2em;overflow:hidden}.sharing-entry__desc p[data-v-2662d6f0]{color:var(--color-text-maxcontrast)}.sharing-entry__title[data-v-2662d6f0]{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.sharing-entry:not(.sharing-entry--share) .sharing-entry__actions .new-share-link[data-v-2662d6f0]{border-top:1px solid var(--color-border)}.sharing-entry[data-v-2662d6f0] .avatar-link-share{background-color:var(--color-primary)}.sharing-entry .sharing-entry__action--public-upload[data-v-2662d6f0]{border-bottom:1px solid var(--color-border)}.sharing-entry__loading[data-v-2662d6f0]{width:44px;height:44px;margin:0;padding:14px;margin-left:auto}.sharing-entry .action-item[data-v-2662d6f0]{margin-left:auto}.sharing-entry .action-item~.action-item[data-v-2662d6f0],.sharing-entry .action-item~.sharing-entry__loading[data-v-2662d6f0]{margin-left:0}.sharing-entry .icon-checkmark-color[data-v-2662d6f0]{opacity:1}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingEntryLink.vue"],names:[],mappings:"AACA,gCACC,YAAA,CACA,kBAAA,CACA,eAAA,CACA,sCACC,YAAA,CACA,qBAAA,CACA,6BAAA,CACA,WAAA,CACA,iBAAA,CACA,eAAA,CAEA,wCACC,mCAAA,CAGF,uCACC,sBAAA,CACA,eAAA,CACA,kBAAA,CAIA,mGACC,wCAAA,CAIF,mDACC,qCAAA,CAGD,sEACC,2CAAA,CAGD,yCACC,UAAA,CACA,WAAA,CACA,QAAA,CACA,YAAA,CACA,gBAAA,CAKD,6CACC,gBAAA,CACA,+HAEC,aAAA,CAIF,sDACC,SAAA",sourcesContent:["\n.sharing-entry {\n\tdisplay: flex;\n\talign-items: center;\n\tmin-height: 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\tline-height: 1.2em;\n\t\toverflow: hidden;\n\n\t\tp {\n\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t}\n\t}\n\t&__title {\n\t\ttext-overflow: ellipsis;\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\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);\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\t\tmargin-left: auto;\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=n},46971:(e,t,s)=>{s.d(t,{Z:()=>o});var i=s(87537),a=s.n(i),r=s(23645),n=s.n(r)()(a());n.push([e.id,".sharing-entry[data-v-02e83c36]{display:flex;align-items:center;min-height:44px}.sharing-entry__desc[data-v-02e83c36]{padding:8px;line-height:1.2em;position:relative;flex:1 1;min-width:0}.sharing-entry__desc p[data-v-02e83c36]{color:var(--color-text-maxcontrast)}.sharing-entry__title[data-v-02e83c36]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:inherit}.sharing-entry__actions[data-v-02e83c36]{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,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\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=n},14710:(e,t,s)=>{s.d(t,{Z:()=>o});var i=s(87537),a=s.n(i),r=s(23645),n=s.n(r)()(a());n.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=n},84772:(e,t,s)=>{s.d(t,{Z:()=>o});var i=s(87537),a=s.n(i),r=s(23645),n=s.n(r)()(a());n.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=n},27172:(e,t,s)=>{s.d(t,{Z:()=>o});var i=s(87537),a=s.n(i),r=s(23645),n=s.n(r)()(a());n.push([e.id,".emptyContentWithSections[data-v-085eaa7e]{margin:1rem auto}.sharingTab__content[data-v-085eaa7e]{padding:0 6px}.sharingTab__additionalContent[data-v-085eaa7e]{margin:44px 0}","",{version:3,sources:["webpack://./apps/files_sharing/src/views/SharingTab.vue"],names:[],mappings:"AACA,2CACC,gBAAA,CAIA,sCACC,aAAA,CAED,gDACC,aAAA",sourcesContent:["\n.emptyContentWithSections {\n\tmargin: 1rem auto;\n}\n\n.sharingTab {\n\t&__content {\n\t\tpadding: 0 6px;\n\t}\n\t&__additionalContent {\n\t\tmargin: 44px 0;\n\t}\n}\n"],sourceRoot:""}]);const o=n}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={id:e,loaded:!1,exports:{}};return s[e].call(r.exports,r,r.exports,a),r.loaded=!0,r.exports}a.m=s,e=[],a.O=(t,s,i,r)=>{if(!s){var n=1/0;for(c=0;c<e.length;c++){s=e[c][0],i=e[c][1],r=e[c][2];for(var o=!0,h=0;h<s.length;h++)(!1&r||n>=r)&&Object.keys(a.O).every((e=>a.O[e](s[h])))?s.splice(h--,1):(o=!1,r<n&&(n=r));if(o){e.splice(c--,1);var l=i();void 0!==l&&(t=l)}}return t}r=r||0;for(var c=e.length;c>0&&e[c-1][2]>r;c--)e[c]=e[c-1];e[c]=[s,i,r]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var s in t)a.o(t,s)&&!a.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),a.j=7870,(()=>{a.b=document.baseURI||self.location.href;var e={7870:0};a.O.j=t=>0===e[t];var t=(t,s)=>{var i,r,n=s[0],o=s[1],h=s[2],l=0;if(n.some((t=>0!==e[t]))){for(i in o)a.o(o,i)&&(a.m[i]=o[i]);if(h)var c=h(a)}for(t&&t(s);l<n.length;l++)r=n[l],a.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return a.O(c)},s=self.webpackChunknextcloud=self.webpackChunknextcloud||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))})(),a.nc=void 0;var r=a.O(void 0,[7874],(()=>a(19258)));r=a.O(r)})();
  3. //# sourceMappingURL=files_sharing-files_sharing_tab.js.map?v=437b8f5d80940402f0c0