files-sidebar.js 50 KB

123
  1. /*! For license information please see files-sidebar.js.LICENSE.txt */
  2. (()=>{var e,s,i,n={5119:(t,e,s)=>{"use strict";const{XMLParser:i,XMLValidator:n}=s(16932),r=t=>{if(null==t)return!1;if(0===(t=t.toString().trim()).length)return!1;if(!0!==n.validate(t))return!1;let e;const s=new i;try{e=s.parse(t)}catch(t){return!1}return!!e&&"svg"in e};t.exports=r,t.exports.default=r},49236:(e,s,i)=>{"use strict";var n=i(20144),r=i(31352),o=i(69183),a=i(65358),l=i(5656),d=i(42515),c=i(77958),u=i(41922),h=i(19755),p=i.n(h),f=i(93664),m=i(80351),g=i.n(m);const b={name:"StarIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var y=i(51900);const v=(0,y.Z)(b,(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon star-icon",attrs:{"aria-hidden":!t.title,"aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports,w={name:"StarOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},A=(0,y.Z)(w,(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon star-outline-icon",attrs:{"aria-hidden":!t.title,"aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12,15.39L8.24,17.66L9.23,13.38L5.91,10.5L10.29,10.13L12,6.09L13.71,10.13L18.09,10.5L14.77,13.38L15.76,17.66M22,9.24L14.81,8.63L12,2L9.19,8.63L2,9.24L7.45,13.97L5.82,21L12,17.27L18.18,21L16.54,13.97L22,9.24Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports;var j=i(25090),_=i(96606),x=i(52506);const C={name:"LegacyView",props:{component:{type:Object,required:!0},fileInfo:{type:Object,default:()=>{},required:!0}},watch:{fileInfo(t){this.setFileInfo(t)}},mounted(){this.component.$el.replaceAll(this.$el),this.setFileInfo(this.fileInfo)},methods:{setFileInfo(t){this.component.setFileInfo(new OCA.Files.FileInfoModel(t))}}},N=(0,y.Z)(C,(function(){return(0,this._self._c)("div")}),[],!1,null,null,null).exports,E={name:"SidebarTab",components:{NcAppSidebarTab:i(23806).Z,NcEmptyContent:x.Z},props:{fileInfo:{type:Object,default:()=>{},required:!0},id:{type:String,required:!0},name:{type:String,required:!0},icon:{type:String,required:!1},onMount:{type:Function,required:!0},onUpdate:{type:Function,required:!0},onDestroy:{type:Function,required:!0},onScrollBottomReached:{type:Function,default:()=>{}}},data:()=>({loading:!0}),computed:{activeTab(){return this.$parent.activeTab}},watch:{async fileInfo(t,e){t.id!==e.id&&(this.loading=!0,await this.onUpdate(this.fileInfo),this.loading=!1)}},async mounted(){this.loading=!0,await this.onMount(this.$refs.mount,this.fileInfo,this.$refs.tab),this.loading=!1},async beforeDestroy(){await this.onDestroy()}},T=(0,y.Z)(E,(function(){var t=this,e=t._self._c;return e("NcAppSidebarTab",{ref:"tab",attrs:{id:t.id,name:t.name,icon:t.icon},on:{bottomReached:t.onScrollBottomReached},scopedSlots:t._u([{key:"icon",fn:function(){return[t._t("icon")]},proxy:!0}],null,!0)},[t._v(" "),t.loading?e("NcEmptyContent",{attrs:{icon:"icon-loading"}}):t._e(),t._v(" "),e("div",{ref:"mount"})],1)}),[],!1,null,null,null).exports;var S=i(87604),I=i(35380),O=i(64024),F=i(36906);const k={userVisible:!0,userAssignable:!0,canAssign:!0},L=t=>t.map((t=>{let{props:e}=t;return Object.fromEntries(Object.entries(e).map((t=>{let[e,s]=t;return[(0,F.Z)(e),"displayName"===(0,F.Z)(e)?String(s):s]})))})),P=t=>{const e={...t};return e.name&&!e.displayName||(e.name=e.displayName,delete e.displayName),e};var D=i(79753),$=i(14596);const R=(0,D.generateRemoteUrl)("dav"),z=(0,$.eI)(R,{headers:{requesttoken:(0,c.IH)()??""}}),B=(0,i(17499).IY)().setApp("systemtags").detectUser().build(),M='<?xml version="1.0"?>\n<d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">\n\t<d:prop>\n\t\t<oc:id />\n\t\t<oc:display-name />\n\t\t<oc:user-visible />\n\t\t<oc:user-assignable />\n\t\t<oc:can-assign />\n\t</d:prop>\n</d:propfind>',U=async(e,s)=>{const i="/systemtags-relations/files/"+s+"/"+e.id,n=P(e);try{await z.customRequest(i,{method:"PUT",data:n})}catch(e){throw B.error(t("systemtags","Failed to set tag for file"),{error:e}),new Error(t("systemtags","Failed to set tag for file"))}},q=n.ZP.extend({name:"SystemTags",components:{NcLoadingIcon:S.Z,NcSelectTags:I.Z},props:{fileId:{type:Number,required:!0}},data:()=>({sortedTags:[],selectedTags:[],loadingTags:!1,loading:!1}),async created(){try{const t=await(async()=>{try{const{data:t}=await z.getDirectoryContents("/systemtags",{data:M,details:!0,glob:"/systemtags/*"});return L(t)}catch(t){throw B.error((0,r.Iu)("systemtags","Failed to load tags"),{error:t}),new Error((0,r.Iu)("systemtags","Failed to load tags"))}})(),e=await(async()=>{const t=(0,D.generateUrl)("/apps/systemtags/lastused");try{const{data:e}=await f.Z.get(t);return e.map(Number)}catch(t){throw B.error((0,r.Iu)("systemtags","Failed to load last used tags"),{error:t}),new Error((0,r.Iu)("systemtags","Failed to load last used tags"))}})(),s=[],i=[];for(const n of t)e.includes(n.id)?s.push(n):i.push(n);const n=(t,s)=>e.indexOf(t.id)-e.indexOf(s.id);s.sort(n),this.sortedTags=[...s,...i]}catch(t){(0,O.x2)((0,r.Iu)("systemtags","Failed to load tags"))}},watch:{fileId:{immediate:!0,async handler(){this.loadingTags=!0;try{this.selectedTags=await(async e=>{const s="/systemtags-relations/files/"+this.fileId;try{const{data:t}=await z.getDirectoryContents(s,{data:M,details:!0,glob:"/systemtags-relations/files/*/*"});return L(t)}catch(e){throw B.error(t("systemtags","Failed to load tags for file"),{error:e}),new Error(t("systemtags","Failed to load tags for file"))}})(),this.$emit("has-tags",this.selectedTags.length>0)}catch(t){(0,O.x2)((0,r.Iu)("systemtags","Failed to load selected tags"))}this.loadingTags=!1}}},methods:{t:r.Iu,createOption(t){for(const e of this.sortedTags){const{id:s,displayName:i,...n}=e;if(i===t&&Object.entries(n).every((t=>{let[e,s]=t;return k[e]===s})))return e}return{...k,displayName:t}},handleInput(t){this.selectedTags=t.filter((t=>Boolean(t.id)))},async handleSelect(t){const e=t[t.length-1];if(!e.id)return;const s=e;this.loading=!0;try{await U(s,this.fileId);const t=(t,e)=>t.id===s.id?-1:e.id===s.id?1:0;this.sortedTags.sort(t)}catch(t){(0,O.x2)((0,r.Iu)("systemtags","Failed to select tag"))}this.loading=!1},async handleCreate(t){this.loading=!0;try{const e=await(async(t,e)=>{const s=P(t),i=await(async t=>{const e=P(t);try{const{headers:t}=await z.customRequest("/systemtags",{method:"POST",data:e}),s=t.get("content-location");if(s)return(t=>{const e=t.indexOf("?");e>0&&(t=t.substring(0,e));const s=t.split("/");let i;do{i=s[s.length-1],s.pop()}while(!i&&s.length>0);return Number(i)})(s);throw B.error((0,r.Iu)("systemtags",'Missing "Content-Location" header')),new Error((0,r.Iu)("systemtags",'Missing "Content-Location" header'))}catch(t){throw B.error((0,r.Iu)("systemtags","Failed to create tag"),{error:t}),new Error((0,r.Iu)("systemtags","Failed to create tag"))}})(s),n={...s,id:i};return await U(n,e),n.id})(t,this.fileId),s={...t,id:e};this.sortedTags.unshift(s),this.selectedTags.push(s)}catch(t){(0,O.x2)((0,r.Iu)("systemtags","Failed to create tag"))}this.loading=!1},async handleDeselect(e){this.loading=!0;try{await(async(e,s)=>{const i="/systemtags-relations/files/"+this.fileId+"/"+e.id;try{await z.deleteFile(i)}catch(e){throw B.error(t("systemtags","Failed to delete tag for file"),{error:e}),new Error(t("systemtags","Failed to delete tag for file"))}})(e)}catch(t){(0,O.x2)((0,r.Iu)("systemtags","Failed to delete tag"))}this.loading=!1}}});var V=i(93379),Z=i.n(V),H=i(7795),G=i.n(H),W=i(90569),K=i.n(W),X=i(3565),Y=i.n(X),J=i(19216),Q=i.n(J),tt=i(44589),et=i.n(tt),st=i(32583),it={};it.styleTagTransform=et(),it.setAttributes=Y(),it.insert=K().bind(null,"head"),it.domAPI=G(),it.insertStyleElement=Q(),Z()(st.Z,it),st.Z&&st.Z.locals&&st.Z.locals;const nt=(0,y.Z)(q,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",{staticClass:"system-tags"},[t.loadingTags?e("NcLoadingIcon",{attrs:{name:t.t("systemtags","Loading collaborative tags …"),size:32}}):[e("label",{attrs:{for:"system-tags-input"}},[t._v(t._s(t.t("systemtags","Search or create collaborative tags")))]),t._v(" "),e("NcSelectTags",{staticClass:"system-tags__select",attrs:{"input-id":"system-tags-input",placeholder:t.t("systemtags","Collaborative tags …"),options:t.sortedTags,value:t.selectedTags,"create-option":t.createOption,taggable:!0,passthru:!0,"fetch-tags":!1,loading:t.loading},on:{input:t.handleInput,"option:selected":t.handleSelect,"option:created":t.handleCreate,"option:deselected":t.handleDeselect},scopedSlots:t._u([{key:"no-options",fn:function(){return[t._v("\n\t\t\t\t"+t._s(t.t("systemtags","No tags to select, type to create a new tag"))+"\n\t\t\t")]},proxy:!0}])})]],2)}),[],!1,null,"3ff8ae0b",null).exports;var rt=i(25108);const ot={name:"Sidebar",components:{LegacyView:N,NcActionButton:_.Z,NcAppSidebar:j.N,NcEmptyContent:x.Z,SidebarTab:T,SystemTags:nt,Star:v,StarOutline:A},data:()=>({Sidebar:OCA.Files.Sidebar.state,showTags:!1,showTagsDefault:!0,error:null,loading:!0,fileInfo:null,starLoading:!1,isFullScreen:!1,hasLowHeight:!1}),computed:{file(){return this.Sidebar.file},tabs(){return this.Sidebar.tabs},views(){return this.Sidebar.views},davPath(){const t=OC.getCurrentUser().uid;return OC.linkToRemote(`dav/files/${t}${(0,a.Ec)(this.file)}`)},activeTab(){return this.Sidebar.activeTab},subtitle(){return`${this.fileInfo.isFavourited?"★ ":""} ${this.size}, ${this.time}`},time(){return OC.Util.relativeModifiedDate(this.fileInfo.mtime)},fullTime(){return g()(this.fileInfo.mtime).format("LLL")},size(){return OC.Util.humanFileSize(this.fileInfo.size)},background(){return this.getPreviewIfAny(this.fileInfo)},appSidebar(){return this.fileInfo?{"data-mimetype":this.fileInfo.mimetype,"star-loading":this.starLoading,active:this.activeTab,background:this.background,class:{"app-sidebar--has-preview":this.fileInfo.hasPreview&&!this.isFullScreen,"app-sidebar--full":this.isFullScreen},compact:this.hasLowHeight||!this.fileInfo.hasPreview||this.isFullScreen,loading:this.loading,subname:this.subtitle,subtitle:this.fullTime,name:this.fileInfo.name,title:this.fileInfo.name}:this.error?{key:"error",subname:"",name:"",class:{"app-sidebar--full":this.isFullScreen}}:{loading:this.loading,subname:"",name:"",class:{"app-sidebar--full":this.isFullScreen}}},defaultAction(){return this.fileInfo&&OCA.Files&&OCA.Files.App&&OCA.Files.App.fileList&&OCA.Files.App.fileList.fileActions&&OCA.Files.App.fileList.fileActions.getDefaultFileAction&&OCA.Files.App.fileList.fileActions.getDefaultFileAction(this.fileInfo.mimetype,this.fileInfo.type,OC.PERMISSION_READ)},defaultActionListener(){return this.defaultAction?"figure-click":null},isSystemTagsEnabled:()=>!0===(0,d.F)()?.systemtags?.enabled},created(){window.addEventListener("resize",this.handleWindowResize),this.handleWindowResize()},beforeDestroy(){window.removeEventListener("resize",this.handleWindowResize)},methods:{canDisplay(t){return t.enabled(this.fileInfo)},resetData(){this.error=null,this.fileInfo=null,this.$nextTick((()=>{this.$refs.tabs&&this.$refs.tabs.updateTabs()}))},getPreviewIfAny(t){return t.hasPreview&&!this.isFullScreen?OC.generateUrl(`/core/preview?fileId=${t.id}&x=${screen.width}&y=${screen.height}&a=true`):this.getIconUrl(t)},getIconUrl(t){const e=t.mimetype||"application/octet-stream";return"httpd/unix-directory"===e?"shared"===t.mountType||"shared-root"===t.mountType?OC.MimeType.getIconUrl("dir-shared"):"external-root"===t.mountType?OC.MimeType.getIconUrl("dir-external"):void 0!==t.mountType&&""!==t.mountType?OC.MimeType.getIconUrl("dir-"+t.mountType):t.shareTypes&&(t.shareTypes.indexOf(u.D.SHARE_TYPE_LINK)>-1||t.shareTypes.indexOf(u.D.SHARE_TYPE_EMAIL)>-1)?OC.MimeType.getIconUrl("dir-public"):t.shareTypes&&t.shareTypes.length>0?OC.MimeType.getIconUrl("dir-shared"):OC.MimeType.getIconUrl("dir"):OC.MimeType.getIconUrl(e)},setActiveTab(t){OCA.Files.Sidebar.setActiveTab(t),this.tabs.forEach((e=>{try{e.setIsActive(t===e.id)}catch(t){logger.error("Error while setting tab active state",{error:t,id:e.id,tab:e})}}))},async toggleStarred(e){try{this.starLoading=!0,await(0,f.Z)({method:"PROPPATCH",url:this.davPath,data:`<?xml version="1.0"?>\n\t\t\t\t\t\t<d:propertyupdate xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">\n\t\t\t\t\t\t${e?"<d:set>":"<d:remove>"}\n\t\t\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t\t\t<oc:favorite>1</oc:favorite>\n\t\t\t\t\t\t\t</d:prop>\n\t\t\t\t\t\t${e?"</d:set>":"</d:remove>"}\n\t\t\t\t\t\t</d:propertyupdate>`});const t="dir"===this.fileInfo.type,s=t?l.gt:l.$B;(0,o.j8)(e?"files:favorites:added":"files:favorites:removed",new s({fileid:this.fileInfo.id,source:this.davPath,root:`/files/${(0,c.ts)().uid}`,mime:t?void 0:this.fileInfo.mimetype}))}catch(e){OC.Notification.showTemporary(t("files","Unable to change the favourite state of the file")),rt.error("Unable to change favourite state",e)}this.starLoading=!1},onDefaultAction(){this.defaultAction&&this.defaultAction.action(this.fileInfo.name,{fileInfo:this.fileInfo,dir:this.fileInfo.dir,fileList:OCA.Files.App.fileList,$file:p()("body")})},toggleTags(){this.showTagsDefault=this.showTags=!this.showTags},async open(e){if(!e||""===e.trim())throw new Error(`Invalid path '${e}'`);const s=!!this.Sidebar.file;this.Sidebar.file=e,this.error=null,this.loading=!0;try{this.fileInfo=await async function(t){const e=await(0,f.Z)({method:"PROPFIND",url:t,data:(0,l.h7)()}),s=OC.Files.getClient()._client.parseMultiStatus(e.data),i=OC.Files.getClient()._parseFileInfo(s[0]);return i.get=t=>i[t],i.isDirectory=()=>"httpd/unix-directory"===i.mimetype,i}(this.davPath),this.fileInfo.dir=this.file.split("/").slice(0,-1).join("/"),this.views.forEach((t=>{t.setFileInfo(this.fileInfo)})),await this.$nextTick(),this.setActiveTab(this.Sidebar.activeTab||this.tabs[0].id),this.loading=!1,await this.$nextTick(),s&&this.$refs.sidebar.focusActiveTabContent()}catch(e){throw this.loading=!1,this.error=t("files","Error while loading the file data"),rt.error("Error while loading the file data",e),new Error(e)}},close(){this.Sidebar.file="",this.showTags=!1,this.resetData()},setFullScreenMode(t){this.isFullScreen=t,t?document.querySelector("#content")?.classList.add("with-sidebar--full")||document.querySelector("#content-vue")?.classList.add("with-sidebar--full"):document.querySelector("#content")?.classList.remove("with-sidebar--full")||document.querySelector("#content-vue")?.classList.remove("with-sidebar--full")},setShowTagsDefault(t){this.showTagsDefault=t},handleOpening(){(0,o.j8)("files:sidebar:opening")},handleOpened(){(0,o.j8)("files:sidebar:opened")},handleClosing(){(0,o.j8)("files:sidebar:closing")},handleClosed(){(0,o.j8)("files:sidebar:closed")},handleWindowResize(){this.hasLowHeight=document.documentElement.clientHeight<1024}}};var at=i(67305),lt={};lt.styleTagTransform=et(),lt.setAttributes=Y(),lt.insert=K().bind(null,"head"),lt.domAPI=G(),lt.insertStyleElement=Q(),Z()(at.Z,lt),at.Z&&at.Z.locals&&at.Z.locals;const dt=(0,y.Z)(ot,(function(){var t=this,e=t._self._c;return t.file?e("NcAppSidebar",t._b({ref:"sidebar",attrs:{"force-menu":!0},on:t._d({close:t.close,"update:active":t.setActiveTab,opening:t.handleOpening,opened:t.handleOpened,closing:t.handleClosing,closed:t.handleClosed},[t.defaultActionListener,function(e){return e.stopPropagation(),e.preventDefault(),t.onDefaultAction.apply(null,arguments)}]),scopedSlots:t._u([t.fileInfo?{key:"description",fn:function(){return[e("div",{staticClass:"sidebar__description"},[t.isSystemTagsEnabled&&t.showTagsDefault?e("SystemTags",{directives:[{name:"show",rawName:"v-show",value:t.showTags,expression:"showTags"}],attrs:{"file-id":t.fileInfo.id},on:{"has-tags":e=>t.showTags=e}}):t._e(),t._v(" "),t._l(t.views,(function(s){return e("LegacyView",{key:s.cid,attrs:{component:s,"file-info":t.fileInfo}})}))],2)]},proxy:!0}:null,t.fileInfo?{key:"secondary-actions",fn:function(){return[e("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(e){return t.toggleStarred(!t.fileInfo.isFavourited)}},scopedSlots:t._u([t.fileInfo.isFavourited?{key:"icon",fn:function(){return[e("StarOutline",{attrs:{size:20}})]},proxy:!0}:{key:"icon",fn:function(){return[e("Star",{attrs:{size:20}})]},proxy:!0}],null,!0)},[t._v("\n\t\t\t"+t._s(t.fileInfo.isFavourited?t.t("files","Remove from favorites"):t.t("files","Add to favorites"))+"\n\t\t")]),t._v(" "),t.isSystemTagsEnabled?e("NcActionButton",{attrs:{"close-after-click":!0,icon:"icon-tag"},on:{click:t.toggleTags}},[t._v("\n\t\t\t"+t._s(t.t("files","Tags"))+"\n\t\t")]):t._e()]},proxy:!0}:null],null,!0)},"NcAppSidebar",t.appSidebar,!1),[t._v(" "),t._v(" "),t.error?e("NcEmptyContent",{attrs:{icon:"icon-error"}},[t._v("\n\t\t"+t._s(t.error)+"\n\t")]):t.fileInfo?t._l(t.tabs,(function(s){return[s.enabled(t.fileInfo)?e("SidebarTab",{directives:[{name:"show",rawName:"v-show",value:!t.loading,expression:"!loading"}],key:s.id,attrs:{id:s.id,name:s.name,icon:s.icon,"on-mount":s.mount,"on-update":s.update,"on-destroy":s.destroy,"on-scroll-bottom-reached":s.scrollBottomReached,"file-info":t.fileInfo},scopedSlots:t._u([void 0!==s.iconSvg?{key:"icon",fn:function(){return[e("span",{staticClass:"svg-icon",domProps:{innerHTML:t._s(s.iconSvg)}})]},proxy:!0}:null],null,!0)}):t._e()]})):t._e()],2):t._e()}),[],!1,null,"dc3712f2",null).exports;var ct=i(25108);var ut=i(48764),ht=i(5119),pt=i.n(ht);function ft(t,e,s){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var s=t[Symbol.toPrimitive];if(void 0!==s){var i=s.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}n.ZP.prototype.t=r.Iu,window.OCA.Files||(window.OCA.Files={}),Object.assign(window.OCA.Files,{Sidebar:new class{constructor(){var t,e,s;t=this,s=void 0,(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var s=t[Symbol.toPrimitive];if(void 0!==s){var i=s.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e="_state"))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,this._state={},this._state.tabs=[],this._state.views=[],this._state.file="",this._state.activeTab="",ct.debug("OCA.Files.Sidebar initialized")}get state(){return this._state}registerTab(t){return this._state.tabs.findIndex((e=>e.id===t.id))>-1?(ct.error(`An tab with the same id ${t.id} already exists`,t),!1):(this._state.tabs.push(t),!0)}registerSecondaryView(t){return this._state.views.findIndex((e=>e.id===t.id))>-1?(ct.error("A similar view already exists",t),!1):(this._state.views.push(t),!0)}get file(){return this._state.file}setActiveTab(t){this._state.activeTab=t}}}),Object.assign(window.OCA.Files.Sidebar,{Tab:class{constructor(){let{id:t,name:e,icon:s,iconSvg:i,mount:n,setIsActive:r,update:o,destroy:a,enabled:l,scrollBottomReached:d}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(ft(this,"_id",void 0),ft(this,"_name",void 0),ft(this,"_icon",void 0),ft(this,"_iconSvgSanitized",void 0),ft(this,"_mount",void 0),ft(this,"_setIsActive",void 0),ft(this,"_update",void 0),ft(this,"_destroy",void 0),ft(this,"_enabled",void 0),ft(this,"_scrollBottomReached",void 0),void 0===l&&(l=()=>!0),void 0===d&&(d=()=>{}),"string"!=typeof t||""===t.trim())throw new Error("The id argument is not a valid string");if("string"!=typeof e||""===e.trim())throw new Error("The name argument is not a valid string");if(("string"!=typeof s||""===s.trim())&&"string"!=typeof i)throw new Error("Missing valid string for icon or iconSvg argument");if("function"!=typeof n)throw new Error("The mount argument should be a function");if(void 0!==r&&"function"!=typeof r)throw new Error("The setIsActive argument should be a function");if("function"!=typeof o)throw new Error("The update argument should be a function");if("function"!=typeof a)throw new Error("The destroy argument should be a function");if("function"!=typeof l)throw new Error("The enabled argument should be a function");if("function"!=typeof d)throw new Error("The scrollBottomReached argument should be a function");this._id=t,this._name=e,this._icon=s,this._mount=n,this._setIsActive=r,this._update=o,this._destroy=a,this._enabled=l,this._scrollBottomReached=d,"string"==typeof i&&(async t=>{if(!t)throw new Error("Not an svg");let e="";if(e=ut.Buffer.isBuffer(t)||t instanceof File?await(t=>new Promise((e=>{if(void 0!==t.size){const s=new FileReader;s.onload=()=>{e(s.result)},s.readAsText(t)}else e(t.toString("utf-8"))})))(t):t,!pt()(e))throw new Error("Not an svg");const s=document.createElement("div");s.innerHTML=e;const i=s.firstElementChild,n=!!Array.from(i.attributes).map((({name:t})=>t)).find((t=>t.startsWith("on")));return 0!==i.getElementsByTagName("script").length||n?null:t})(i).then((t=>{this._iconSvgSanitized=t}))}get id(){return this._id}get name(){return this._name}get icon(){return this._icon}get iconSvg(){return this._iconSvgSanitized}get mount(){return this._mount}get setIsActive(){return this._setIsActive||(()=>{})}get update(){return this._update}get destroy(){return this._destroy}get enabled(){return this._enabled}get scrollBottomReached(){return this._scrollBottomReached}}}),window.addEventListener("DOMContentLoaded",(function(){const t=document.querySelector("body > .content")||document.querySelector("body > #content");if(t&&!document.getElementById("app-sidebar")){const e=document.createElement("div");e.id="app-sidebar",t.appendChild(e)}const e=new(n.ZP.extend(dt))({name:"SidebarRoot"});e.$mount("#app-sidebar"),window.OCA.Files.Sidebar.open=e.open,window.OCA.Files.Sidebar.close=e.close,window.OCA.Files.Sidebar.setFullScreenMode=e.setFullScreenMode,window.OCA.Files.Sidebar.setShowTagsDefault=e.setShowTagsDefault}))},67305:(t,e,s)=>{"use strict";s.d(e,{Z:()=>a});var i=s(87537),n=s.n(i),r=s(23645),o=s.n(r)()(n());o.push([t.id,'.app-sidebar--has-preview[data-v-dc3712f2] .app-sidebar-header__figure{background-size:cover}.app-sidebar--has-preview[data-v-dc3712f2][data-mimetype="text/plain"] .app-sidebar-header__figure,.app-sidebar--has-preview[data-v-dc3712f2][data-mimetype="text/markdown"] .app-sidebar-header__figure{background-size:contain}.app-sidebar--full[data-v-dc3712f2]{position:fixed !important;z-index:2025 !important;top:0 !important;height:100% !important}.app-sidebar[data-v-dc3712f2] .app-sidebar-header__description{margin:0 16px 4px 16px !important}.app-sidebar .svg-icon[data-v-dc3712f2] svg{width:20px;height:20px;fill:currentColor}.sidebar__description[data-v-dc3712f2]{display:flex;flex-direction:column;width:100%;gap:8px 0}',"",{version:3,sources:["webpack://./apps/files/src/views/Sidebar.vue"],names:[],mappings:"AAGE,uEACC,qBAAA,CAKA,yMACC,uBAAA,CAKH,oCACC,yBAAA,CACA,uBAAA,CACA,gBAAA,CACA,sBAAA,CAIA,+DACC,iCAAA,CAKD,4CACC,UAAA,CACA,WAAA,CACA,iBAAA,CAKH,uCACC,YAAA,CACA,qBAAA,CACA,UAAA,CACA,SAAA",sourcesContent:['\n.app-sidebar {\n\t&--has-preview:deep {\n\t\t.app-sidebar-header__figure {\n\t\t\tbackground-size: cover;\n\t\t}\n\n\t\t&[data-mimetype="text/plain"],\n\t\t&[data-mimetype="text/markdown"] {\n\t\t\t.app-sidebar-header__figure {\n\t\t\t\tbackground-size: contain;\n\t\t\t}\n\t\t}\n\t}\n\n\t&--full {\n\t\tposition: fixed !important;\n\t\tz-index: 2025 !important;\n\t\ttop: 0 !important;\n\t\theight: 100% !important;\n\t}\n\n\t:deep {\n\t\t.app-sidebar-header__description {\n\t\t\tmargin: 0 16px 4px 16px !important;\n\t\t}\n\t}\n\n\t.svg-icon {\n\t\t::v-deep svg {\n\t\t\twidth: 20px;\n\t\t\theight: 20px;\n\t\t\tfill: currentColor;\n\t\t}\n\t}\n}\n\n.sidebar__description {\n\tdisplay: flex;\n\tflex-direction: column;\n\twidth: 100%;\n\tgap: 8px 0;\n}\n'],sourceRoot:""}]);const a=o},32583:(t,e,s)=>{"use strict";s.d(e,{Z:()=>a});var i=s(87537),n=s.n(i),r=s(23645),o=s.n(r)()(n());o.push([t.id,".system-tags[data-v-3ff8ae0b]{display:flex;flex-direction:column}.system-tags label[for=system-tags-input][data-v-3ff8ae0b]{margin-bottom:2px}.system-tags__select[data-v-3ff8ae0b]{width:100%}.system-tags__select[data-v-3ff8ae0b] .vs__deselect{padding:0}","",{version:3,sources:["webpack://./apps/systemtags/src/components/SystemTags.vue"],names:[],mappings:"AACA,8BACC,YAAA,CACA,qBAAA,CAEA,2DACC,iBAAA,CAGD,sCACC,UAAA,CAEC,oDACC,SAAA",sourcesContent:['\n.system-tags {\n\tdisplay: flex;\n\tflex-direction: column;\n\n\tlabel[for="system-tags-input"] {\n\t\tmargin-bottom: 2px;\n\t}\n\n\t&__select {\n\t\twidth: 100%;\n\t\t:deep {\n\t\t\t.vs__deselect {\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n'],sourceRoot:""}]);const a=o},16932:(t,e,s)=>{"use strict";const i=s(78501),n=s(58844),r=s(41192);t.exports={XMLParser:n,XMLValidator:i,XMLBuilder:r}},46700:(t,e,s)=>{var i={"./af":42786,"./af.js":42786,"./ar":30867,"./ar-dz":14130,"./ar-dz.js":14130,"./ar-kw":96135,"./ar-kw.js":96135,"./ar-ly":56440,"./ar-ly.js":56440,"./ar-ma":47702,"./ar-ma.js":47702,"./ar-ps":20315,"./ar-ps.js":20315,"./ar-sa":16040,"./ar-sa.js":16040,"./ar-tn":37100,"./ar-tn.js":37100,"./ar.js":30867,"./az":31083,"./az.js":31083,"./be":9808,"./be.js":9808,"./bg":68338,"./bg.js":68338,"./bm":67438,"./bm.js":67438,"./bn":8905,"./bn-bd":76225,"./bn-bd.js":76225,"./bn.js":8905,"./bo":11560,"./bo.js":11560,"./br":1278,"./br.js":1278,"./bs":80622,"./bs.js":80622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":50877,"./cv.js":50877,"./cy":47373,"./cy.js":47373,"./da":24780,"./da.js":24780,"./de":59740,"./de-at":60217,"./de-at.js":60217,"./de-ch":60894,"./de-ch.js":60894,"./de.js":59740,"./dv":5300,"./dv.js":5300,"./el":50837,"./el.js":50837,"./en-au":78348,"./en-au.js":78348,"./en-ca":77925,"./en-ca.js":77925,"./en-gb":22243,"./en-gb.js":22243,"./en-ie":46436,"./en-ie.js":46436,"./en-il":47207,"./en-il.js":47207,"./en-in":44175,"./en-in.js":44175,"./en-nz":76319,"./en-nz.js":76319,"./en-sg":31662,"./en-sg.js":31662,"./eo":92915,"./eo.js":92915,"./es":55655,"./es-do":55251,"./es-do.js":55251,"./es-mx":96112,"./es-mx.js":96112,"./es-us":71146,"./es-us.js":71146,"./es.js":55655,"./et":5603,"./et.js":5603,"./eu":77763,"./eu.js":77763,"./fa":76959,"./fa.js":76959,"./fi":11897,"./fi.js":11897,"./fil":42549,"./fil.js":42549,"./fo":94694,"./fo.js":94694,"./fr":94470,"./fr-ca":63049,"./fr-ca.js":63049,"./fr-ch":52330,"./fr-ch.js":52330,"./fr.js":94470,"./fy":5044,"./fy.js":5044,"./ga":29295,"./ga.js":29295,"./gd":2101,"./gd.js":2101,"./gl":38794,"./gl.js":38794,"./gom-deva":27884,"./gom-deva.js":27884,"./gom-latn":23168,"./gom-latn.js":23168,"./gu":95349,"./gu.js":95349,"./he":24206,"./he.js":24206,"./hi":30094,"./hi.js":30094,"./hr":30316,"./hr.js":30316,"./hu":22138,"./hu.js":22138,"./hy-am":11423,"./hy-am.js":11423,"./id":29218,"./id.js":29218,"./is":90135,"./is.js":90135,"./it":90626,"./it-ch":10150,"./it-ch.js":10150,"./it.js":90626,"./ja":39183,"./ja.js":39183,"./jv":24286,"./jv.js":24286,"./ka":12105,"./ka.js":12105,"./kk":47772,"./kk.js":47772,"./km":18758,"./km.js":18758,"./kn":79282,"./kn.js":79282,"./ko":33730,"./ko.js":33730,"./ku":1408,"./ku-kmr":90563,"./ku-kmr.js":90563,"./ku.js":1408,"./ky":33291,"./ky.js":33291,"./lb":36841,"./lb.js":36841,"./lo":55466,"./lo.js":55466,"./lt":57010,"./lt.js":57010,"./lv":37595,"./lv.js":37595,"./me":39861,"./me.js":39861,"./mi":35493,"./mi.js":35493,"./mk":95966,"./mk.js":95966,"./ml":87341,"./ml.js":87341,"./mn":5115,"./mn.js":5115,"./mr":10370,"./mr.js":10370,"./ms":9847,"./ms-my":41237,"./ms-my.js":41237,"./ms.js":9847,"./mt":72126,"./mt.js":72126,"./my":56165,"./my.js":56165,"./nb":64924,"./nb.js":64924,"./ne":16744,"./ne.js":16744,"./nl":93901,"./nl-be":59814,"./nl-be.js":59814,"./nl.js":93901,"./nn":83877,"./nn.js":83877,"./oc-lnc":92135,"./oc-lnc.js":92135,"./pa-in":15858,"./pa-in.js":15858,"./pl":64495,"./pl.js":64495,"./pt":89520,"./pt-br":57971,"./pt-br.js":57971,"./pt.js":89520,"./ro":96459,"./ro.js":96459,"./ru":21793,"./ru.js":21793,"./sd":40950,"./sd.js":40950,"./se":10490,"./se.js":10490,"./si":90124,"./si.js":90124,"./sk":64249,"./sk.js":64249,"./sl":14985,"./sl.js":14985,"./sq":51104,"./sq.js":51104,"./sr":49131,"./sr-cyrl":79915,"./sr-cyrl.js":79915,"./sr.js":49131,"./ss":85893,"./ss.js":85893,"./sv":98760,"./sv.js":98760,"./sw":91172,"./sw.js":91172,"./ta":27333,"./ta.js":27333,"./te":23110,"./te.js":23110,"./tet":52095,"./tet.js":52095,"./tg":27321,"./tg.js":27321,"./th":9041,"./th.js":9041,"./tk":19005,"./tk.js":19005,"./tl-ph":75768,"./tl-ph.js":75768,"./tlh":89444,"./tlh.js":89444,"./tr":72397,"./tr.js":72397,"./tzl":28254,"./tzl.js":28254,"./tzm":51106,"./tzm-latn":30699,"./tzm-latn.js":30699,"./tzm.js":51106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":67691,"./uk.js":67691,"./ur":13795,"./ur.js":13795,"./uz":6791,"./uz-latn":60588,"./uz-latn.js":60588,"./uz.js":6791,"./vi":65666,"./vi.js":65666,"./x-pseudo":14378,"./x-pseudo.js":14378,"./yo":75805,"./yo.js":75805,"./zh-cn":83839,"./zh-cn.js":83839,"./zh-hk":55726,"./zh-hk.js":55726,"./zh-mo":99807,"./zh-mo.js":99807,"./zh-tw":74152,"./zh-tw.js":74152};function n(t){var e=r(t);return s(e)}function r(t){if(!s.o(i,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return i[t]}n.keys=function(){return Object.keys(i)},n.resolve=r,t.exports=n,n.id=46700},5656:(t,e,s)=>{"use strict";s.d(e,{$B:()=>N,RL:()=>F,Tv:()=>A,_o:()=>T,gt:()=>E,h7:()=>v,pC:()=>O,rp:()=>I,sS:()=>p,tB:()=>w});var i,n=s(77958),r=s(17499),o=s(31352),a=s(62520),l=s(65358),d=s(79753),c=s(14596);null===(i=(0,n.ts)())?(0,r.IY)().setApp("files").build():(0,r.IY)().setApp("files").setUid(i.uid).build();const u=["B","KB","MB","GB","TB","PB"],h=["B","KiB","MiB","GiB","TiB","PiB"];function p(t,e=!1,s=!1,i=!1){s=s&&!i,"string"==typeof t&&(t=Number(t));let n=t>0?Math.floor(Math.log(t)/Math.log(i?1e3:1024)):0;n=Math.min((s?h.length:u.length)-1,n);const r=s?h[n]:u[n];let a=(t/Math.pow(i?1e3:1024,n)).toFixed(1);return!0===e&&0===n?("0.0"!==a?"< 1 ":"0 ")+(s?h[1]:u[1]):(a=n<2?parseFloat(a).toFixed(0):parseFloat(a).toLocaleString((0,o.aj)()),a+" "+r)}var f=(t=>(t[t.NONE=0]="NONE",t[t.CREATE=4]="CREATE",t[t.READ=1]="READ",t[t.UPDATE=2]="UPDATE",t[t.DELETE=8]="DELETE",t[t.SHARE=16]="SHARE",t[t.ALL=31]="ALL",t))(f||{});const m=["d:getcontentlength","d:getcontenttype","d:getetag","d:getlastmodified","d:quota-available-bytes","d:resourcetype","nc:has-preview","nc:is-encrypted","nc:mount-type","nc:share-attributes","oc:comments-unread","oc:favorite","oc:fileid","oc:owner-display-name","oc:owner-id","oc:permissions","oc:share-types","oc:size","ocs:share-permissions"],g={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"},b=function(){return typeof window._nc_dav_properties>"u"&&(window._nc_dav_properties=[...m]),window._nc_dav_properties.map((t=>`<${t} />`)).join(" ")},y=function(){return typeof window._nc_dav_namespaces>"u"&&(window._nc_dav_namespaces={...g}),Object.keys(window._nc_dav_namespaces).map((t=>`xmlns:${t}="${window._nc_dav_namespaces?.[t]}"`)).join(" ")},v=function(){return`<?xml version="1.0"?>\n\t\t<d:propfind ${y()}>\n\t\t\t<d:prop>\n\t\t\t\t${b()}\n\t\t\t</d:prop>\n\t\t</d:propfind>`},w=function(t){return`<?xml version="1.0" encoding="UTF-8"?>\n<d:searchrequest ${y()}\n\txmlns:ns="https://github.com/icewind1991/SearchDAV/ns">\n\t<d:basicsearch>\n\t\t<d:select>\n\t\t\t<d:prop>\n\t\t\t\t${b()}\n\t\t\t</d:prop>\n\t\t</d:select>\n\t\t<d:from>\n\t\t\t<d:scope>\n\t\t\t\t<d:href>/files/${(0,n.ts)()?.uid}/</d:href>\n\t\t\t\t<d:depth>infinity</d:depth>\n\t\t\t</d:scope>\n\t\t</d:from>\n\t\t<d:where>\n\t\t\t<d:and>\n\t\t\t\t<d:or>\n\t\t\t\t\t<d:not>\n\t\t\t\t\t\t<d:eq>\n\t\t\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t\t\t<d:getcontenttype/>\n\t\t\t\t\t\t\t</d:prop>\n\t\t\t\t\t\t\t<d:literal>httpd/unix-directory</d:literal>\n\t\t\t\t\t\t</d:eq>\n\t\t\t\t\t</d:not>\n\t\t\t\t\t<d:eq>\n\t\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t\t<oc:size/>\n\t\t\t\t\t\t</d:prop>\n\t\t\t\t\t\t<d:literal>0</d:literal>\n\t\t\t\t\t</d:eq>\n\t\t\t\t</d:or>\n\t\t\t\t<d:gt>\n\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t<d:getlastmodified/>\n\t\t\t\t\t</d:prop>\n\t\t\t\t\t<d:literal>${t}</d:literal>\n\t\t\t\t</d:gt>\n\t\t\t</d:and>\n\t\t</d:where>\n\t\t<d:orderby>\n\t\t\t<d:order>\n\t\t\t\t<d:prop>\n\t\t\t\t\t<d:getlastmodified/>\n\t\t\t\t</d:prop>\n\t\t\t\t<d:descending/>\n\t\t\t</d:order>\n\t\t</d:orderby>\n\t\t<d:limit>\n\t\t\t<d:nresults>100</d:nresults>\n\t\t\t<ns:firstresult>0</ns:firstresult>\n\t\t</d:limit>\n\t</d:basicsearch>\n</d:searchrequest>`};var A=(t=>(t.Folder="folder",t.File="file",t))(A||{});const j=function(t,e){return null!==t.match(e)},_=(t,e)=>{if(t.id&&"number"!=typeof t.id)throw new Error("Invalid id type of value");if(!t.source)throw new Error("Missing mandatory source");try{new URL(t.source)}catch{throw new Error("Invalid source format, source must be a valid URL")}if(!t.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(t.mtime&&!(t.mtime instanceof Date))throw new Error("Invalid mtime type");if(t.crtime&&!(t.crtime instanceof Date))throw new Error("Invalid crtime type");if(!t.mime||"string"!=typeof t.mime||!t.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in t&&"number"!=typeof t.size&&void 0!==t.size)throw new Error("Invalid size type");if("permissions"in t&&void 0!==t.permissions&&!("number"==typeof t.permissions&&t.permissions>=f.NONE&&t.permissions<=f.ALL))throw new Error("Invalid permissions");if(t.owner&&null!==t.owner&&"string"!=typeof t.owner)throw new Error("Invalid owner type");if(t.attributes&&"object"!=typeof t.attributes)throw new Error("Invalid attributes type");if(t.root&&"string"!=typeof t.root)throw new Error("Invalid root type");if(t.root&&!t.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(t.root&&!t.source.includes(t.root))throw new Error("Root must be part of the source");if(t.root&&j(t.source,e)){const s=t.source.match(e)[0];if(!t.source.includes((0,a.join)(s,t.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(t.status&&!Object.values(x).includes(t.status))throw new Error("Status must be a valid NodeStatus")};var x=(t=>(t.NEW="new",t.FAILED="failed",t.LOADING="loading",t.LOCKED="locked",t))(x||{});class C{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;constructor(t,e){_(t,e||this._knownDavService),this._data=t;const s={set:(t,e,s)=>(this.updateMtime(),Reflect.set(t,e,s)),deleteProperty:(t,e)=>(this.updateMtime(),Reflect.deleteProperty(t,e))};this._attributes=new Proxy(t.attributes||{},s),delete this._data.attributes,e&&(this._knownDavService=e)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:t}=new URL(this.source);return t+(0,l.Ec)(this.source.slice(t.length))}get basename(){return(0,a.basename)(this.source)}get extension(){return(0,a.extname)(this.source)}get dirname(){if(this.root){let t=this.source;this.isDavRessource&&(t=t.split(this._knownDavService).pop());const e=t.indexOf(this.root),s=this.root.replace(/\/$/,"");return(0,a.dirname)(t.slice(e+s.length)||"/")}const t=new URL(this.source);return(0,a.dirname)(t.pathname)}get mime(){return this._data.mime}get mtime(){return this._data.mtime}get crtime(){return this._data.crtime}get size(){return this._data.size}get attributes(){return this._attributes}get permissions(){return null!==this.owner||this.isDavRessource?void 0!==this._data.permissions?this._data.permissions:f.NONE:f.READ}get owner(){return this.isDavRessource?this._data.owner:null}get isDavRessource(){return j(this.source,this._knownDavService)}get root(){return this._data.root?this._data.root.replace(/^(.+)\/$/,"$1"):this.isDavRessource&&(0,a.dirname)(this.source).split(this._knownDavService).pop()||null}get path(){if(this.root){let t=this.source;this.isDavRessource&&(t=t.split(this._knownDavService).pop());const e=t.indexOf(this.root),s=this.root.replace(/\/$/,"");return t.slice(e+s.length)||"/"}return(this.dirname+"/"+this.basename).replace(/\/\//g,"/")}get fileid(){return this._data?.id||this.attributes?.fileid}get status(){return this._data?.status}set status(t){this._data.status=t}move(t){_({...this._data,source:t},this._knownDavService),this._data.source=t,this.updateMtime()}rename(t){if(t.includes("/"))throw new Error("Invalid basename");this.move((0,a.dirname)(this.source)+"/"+t)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}}class N extends C{get type(){return A.File}}class E extends C{constructor(t){super({...t,mime:"httpd/unix-directory"})}get type(){return A.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}}const T=`/files/${(0,n.ts)()?.uid}`,S=(0,d.generateRemoteUrl)("dav"),I=function(t=S,e={}){const s=(0,c.eI)(t,{headers:e});function i(t){s.setHeaders({...e,"X-Requested-With":"XMLHttpRequest",requesttoken:t??""})}return(0,n._S)(i),i((0,n.IH)()),(0,c.lD)().patch("fetch",((t,e)=>{const s=e.headers;return s?.method&&(e.method=s.method,delete s.method),fetch(t,e)})),s},O=async(t,e="/",s=T)=>(await t.getDirectoryContents(`${s}${e}`,{details:!0,data:`<?xml version="1.0"?>\n\t\t<oc:filter-files ${y()}>\n\t\t\t<d:prop>\n\t\t\t\t${b()}\n\t\t\t</d:prop>\n\t\t\t<oc:filter-rules>\n\t\t\t\t<oc:favorite>1</oc:favorite>\n\t\t\t</oc:filter-rules>\n\t\t</oc:filter-files>`,headers:{method:"REPORT"},includeSelf:!0})).data.filter((t=>t.filename!==e)).map((t=>F(t,s))),F=function(t,e=T,s=S){const i=t.props,r=function(t=""){let e=f.NONE;return t&&((t.includes("C")||t.includes("K"))&&(e|=f.CREATE),t.includes("G")&&(e|=f.READ),(t.includes("W")||t.includes("N")||t.includes("V"))&&(e|=f.UPDATE),t.includes("D")&&(e|=f.DELETE),t.includes("R")&&(e|=f.SHARE)),e}(i?.permissions),o=i?.["owner-id"]||(0,n.ts)()?.uid,a={id:i?.fileid||0,source:`${s}${t.filename}`,mtime:new Date(Date.parse(t.lastmod)),mime:t.mime,size:i?.size||Number.parseInt(i.getcontentlength||"0"),permissions:r,owner:o,root:e,attributes:{...t,...i,hasPreview:i?.["has-preview"]}};return delete a.attributes?.props,"file"===t.type?new N(a):new E(a)};var k={};!function(t){const e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",s="["+e+"]["+e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",i=new RegExp("^"+s+"$");t.isExist=function(t){return typeof t<"u"},t.isEmptyObject=function(t){return 0===Object.keys(t).length},t.merge=function(t,e,s){if(e){const i=Object.keys(e),n=i.length;for(let r=0;r<n;r++)t[i[r]]="strict"===s?[e[i[r]]]:e[i[r]]}},t.getValue=function(e){return t.isExist(e)?e:""},t.isName=function(t){const e=i.exec(t);return!(null===e||typeof e>"u")},t.getAllMatches=function(t,e){const s=[];let i=e.exec(t);for(;i;){const n=[];n.startIndex=e.lastIndex-i[0].length;const r=i.length;for(let t=0;t<r;t++)n.push(i[t]);s.push(n),i=e.exec(t)}return s},t.nameRegexp=s}(k);new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");var L={};const P={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,s){return t}};L.buildOptions=function(t){return Object.assign({},P,t)},L.defaultOptions=P,!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,k.nameRegexp),new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");var D={};function $(t,e,s){let i;const n={};for(let r=0;r<t.length;r++){const o=t[r],a=R(o);let l="";if(l=void 0===s?a:s+"."+a,a===e.textNodeName)void 0===i?i=o[a]:i+=""+o[a];else{if(void 0===a)continue;if(o[a]){let t=$(o[a],e,l);const s=B(t,e);o[":@"]?z(t,o[":@"],l,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==n[a]&&n.hasOwnProperty(a)?(Array.isArray(n[a])||(n[a]=[n[a]]),n[a].push(t)):e.isArray(a,l,s)?n[a]=[t]:n[a]=t}}}return"string"==typeof i?i.length>0&&(n[e.textNodeName]=i):void 0!==i&&(n[e.textNodeName]=i),n}function R(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const s=e[t];if(":@"!==s)return s}}function z(t,e,s,i){if(e){const n=Object.keys(e),r=n.length;for(let o=0;o<r;o++){const r=n[o];i.isArray(r,s+"."+r,!0,!0)?t[r]=[e[r]]:t[r]=e[r]}}}function B(t,e){const{textNodeName:s}=e,i=Object.keys(t).length;return!(0!==i&&(1!==i||!t[s]&&"boolean"!=typeof t[s]&&0!==t[s]))}D.prettify=function(t,e){return $(t,e)};const{buildOptions:M}=L,{prettify:U}=D;function q(t,e,s,i){let n="",r=!1;for(let o=0;o<t.length;o++){const a=t[o],l=V(a);if(void 0===l)continue;let d="";if(d=0===s.length?l:`${s}.${l}`,l===e.textNodeName){let t=a[l];H(d,e)||(t=e.tagValueProcessor(l,t),t=G(t,e)),r&&(n+=i),n+=t,r=!1;continue}if(l===e.cdataPropName){r&&(n+=i),n+=`<![CDATA[${a[l][0][e.textNodeName]}]]>`,r=!1;continue}if(l===e.commentPropName){n+=i+`\x3c!--${a[l][0][e.textNodeName]}--\x3e`,r=!0;continue}if("?"===l[0]){const t=Z(a[":@"],e),s="?xml"===l?"":i;let o=a[l][0][e.textNodeName];o=0!==o.length?" "+o:"",n+=s+`<${l}${o}${t}?>`,r=!0;continue}let c=i;""!==c&&(c+=e.indentBy);const u=i+`<${l}${Z(a[":@"],e)}`,h=q(a[l],e,d,c);-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?n+=u+">":n+=u+"/>":h&&0!==h.length||!e.suppressEmptyNode?h&&h.endsWith(">")?n+=u+`>${h}${i}</${l}>`:(n+=u+">",h&&""!==i&&(h.includes("/>")||h.includes("</"))?n+=i+e.indentBy+h+i:n+=h,n+=`</${l}>`):n+=u+"/>",r=!0}return n}function V(t){const e=Object.keys(t);for(let s=0;s<e.length;s++){const i=e[s];if(t.hasOwnProperty(i)&&":@"!==i)return i}}function Z(t,e){let s="";if(t&&!e.ignoreAttributes)for(let i in t){if(!t.hasOwnProperty(i))continue;let n=e.attributeValueProcessor(i,t[i]);n=G(n,e),!0===n&&e.suppressBooleanAttributes?s+=` ${i.substr(e.attributeNamePrefix.length)}`:s+=` ${i.substr(e.attributeNamePrefix.length)}="${n}"`}return s}function H(t,e){let s=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let i in e.stopNodes)if(e.stopNodes[i]===t||e.stopNodes[i]==="*."+s)return!0;return!1}function G(t,e){if(t&&t.length>0&&e.processEntities)for(let s=0;s<e.entities.length;s++){const i=e.entities[s];t=t.replace(i.regex,i.val)}return t}const W=function(t,e){let s="";return e.format&&e.indentBy.length>0&&(s="\n"),q(t,e,"",s)},K={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function X(t){this.options=Object.assign({},K,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Q),this.processTextOrObjNode=Y,this.options.format?(this.indentate=J,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function Y(t,e,s){const i=this.j2x(t,s+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,i.attrStr,s):this.buildObjectNode(i.val,e,i.attrStr,s)}function J(t){return this.options.indentBy.repeat(t)}function Q(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}X.prototype.build=function(t){return this.options.preserveOrder?W(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0).val)},X.prototype.j2x=function(t,e){let s="",i="";for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n))if(typeof t[n]>"u")this.isAttribute(n)&&(i+="");else if(null===t[n])this.isAttribute(n)?i+="":"?"===n[0]?i+=this.indentate(e)+"<"+n+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+n+"/"+this.tagEndChar;else if(t[n]instanceof Date)i+=this.buildTextValNode(t[n],n,"",e);else if("object"!=typeof t[n]){const r=this.isAttribute(n);if(r)s+=this.buildAttrPairStr(r,""+t[n]);else if(n===this.options.textNodeName){let e=this.options.tagValueProcessor(n,""+t[n]);i+=this.replaceEntitiesValue(e)}else i+=this.buildTextValNode(t[n],n,"",e)}else if(Array.isArray(t[n])){const s=t[n].length;let r="";for(let o=0;o<s;o++){const s=t[n][o];typeof s>"u"||(null===s?"?"===n[0]?i+=this.indentate(e)+"<"+n+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+n+"/"+this.tagEndChar:"object"==typeof s?this.options.oneListGroup?r+=this.j2x(s,e+1).val:r+=this.processTextOrObjNode(s,n,e):r+=this.buildTextValNode(s,n,"",e))}this.options.oneListGroup&&(r=this.buildObjectNode(r,n,"",e)),i+=r}else if(this.options.attributesGroupName&&n===this.options.attributesGroupName){const e=Object.keys(t[n]),i=e.length;for(let r=0;r<i;r++)s+=this.buildAttrPairStr(e[r],""+t[n][e[r]])}else i+=this.processTextOrObjNode(t[n],n,e);return{attrStr:s,val:i}},X.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},X.prototype.buildObjectNode=function(t,e,s,i){if(""===t)return"?"===e[0]?this.indentate(i)+"<"+e+s+"?"+this.tagEndChar:this.indentate(i)+"<"+e+s+this.closeTag(e)+this.tagEndChar;{let n="</"+e+this.tagEndChar,r="";return"?"===e[0]&&(r="?",n=""),!s&&""!==s||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===r.length?this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(i)+"<"+e+s+r+this.tagEndChar+t+this.indentate(i)+n:this.indentate(i)+"<"+e+s+r+">"+t+n}},X.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},X.prototype.buildTextValNode=function(t,e,s,i){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(i)+`<![CDATA[${t}]]>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+s+"?"+this.tagEndChar;{let n=this.options.tagValueProcessor(e,t);return n=this.replaceEntitiesValue(n),""===n?this.indentate(i)+"<"+e+s+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+s+">"+n+"</"+e+this.tagEndChar}},X.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const s=this.options.entities[e];t=t.replace(s.regex,s.val)}return t}}},r={};function o(t){var e=r[t];if(void 0!==e)return e.exports;var s=r[t]={id:t,loaded:!1,exports:{}};return n[t].call(s.exports,s,s.exports,o),s.loaded=!0,s.exports}o.m=n,e=[],o.O=(t,s,i,n)=>{if(!s){var r=1/0;for(c=0;c<e.length;c++){s=e[c][0],i=e[c][1],n=e[c][2];for(var a=!0,l=0;l<s.length;l++)(!1&n||r>=n)&&Object.keys(o.O).every((t=>o.O[t](s[l])))?s.splice(l--,1):(a=!1,n<r&&(r=n));if(a){e.splice(c--,1);var d=i();void 0!==d&&(t=d)}}return t}n=n||0;for(var c=e.length;c>0&&e[c-1][2]>n;c--)e[c]=e[c-1];e[c]=[s,i,n]},o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var s in e)o.o(e,s)&&!o.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o.f={},o.e=t=>Promise.all(Object.keys(o.f).reduce(((e,s)=>(o.f[s](t,e),e)),[])),o.u=t=>t+"-"+t+".js?v="+{4720:"67ff1816113751e83e78",6512:"4e739934e594e992c605"}[t],o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),s={},i="nextcloud:",o.l=(t,e,n,r)=>{if(s[t])s[t].push(e);else{var a,l;if(void 0!==n)for(var d=document.getElementsByTagName("script"),c=0;c<d.length;c++){var u=d[c];if(u.getAttribute("src")==t||u.getAttribute("data-webpack")==i+n){a=u;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.setAttribute("data-webpack",i+n),a.src=t),s[t]=[e];var h=(e,i)=>{a.onerror=a.onload=null,clearTimeout(p);var n=s[t];if(delete s[t],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((t=>t(i))),e)return e(i)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),l&&document.head.appendChild(a)}},o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),o.j=4092,(()=>{var t;o.g.importScripts&&(t=o.g.location+"");var e=o.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var s=e.getElementsByTagName("script");if(s.length)for(var i=s.length-1;i>-1&&!t;)t=s[i--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=t})(),(()=>{o.b=document.baseURI||self.location.href;var t={4092:0};o.f.j=(e,s)=>{var i=o.o(t,e)?t[e]:void 0;if(0!==i)if(i)s.push(i[2]);else{var n=new Promise(((s,n)=>i=t[e]=[s,n]));s.push(i[2]=n);var r=o.p+o.u(e),a=new Error;o.l(r,(s=>{if(o.o(t,e)&&(0!==(i=t[e])&&(t[e]=void 0),i)){var n=s&&("load"===s.type?"missing":s.type),r=s&&s.target&&s.target.src;a.message="Loading chunk "+e+" failed.\n("+n+": "+r+")",a.name="ChunkLoadError",a.type=n,a.request=r,i[1](a)}}),"chunk-"+e,e)}},o.O.j=e=>0===t[e];var e=(e,s)=>{var i,n,r=s[0],a=s[1],l=s[2],d=0;if(r.some((e=>0!==t[e]))){for(i in a)o.o(a,i)&&(o.m[i]=a[i]);if(l)var c=l(o)}for(e&&e(s);d<r.length;d++)n=r[d],o.o(t,n)&&t[n]&&t[n][0](),t[n]=0;return o.O(c)},s=self.webpackChunknextcloud=self.webpackChunknextcloud||[];s.forEach(e.bind(null,0)),s.push=e.bind(null,s.push.bind(s))})(),o.nc=void 0;var a=o.O(void 0,[7874],(()=>o(49236)));a=o.O(a)})();
  3. //# sourceMappingURL=files-sidebar.js.map?v=856e3fe0a5e35a32f6f5