/*! For license information please see 8321-8321.js.LICENSE.txt */ "use strict";(self.webpackChunknextcloud=self.webpackChunknextcloud||[]).push([[8321],{42761:t=>{t.exports="data:image/svg+xml;base64,PCEtLSBUaGlzIGljb24gaXMgcGFydCBvZiBNYXRlcmlhbCBVSSBJY29ucy4gQ29weXJpZ2h0IDIwMjAgR29vZ2xlIEluYy4sIEFwYWNoZS0yLjAgTGljZW5zZSAtLT4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTS00LTRoMjR2MjRILTRWLTR6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTggMEMzLjYgMCAwIDMuNiAwIDhzMy42IDggOCA4IDgtMy42IDgtOC0zLjYtOC04LTh6IiBmaWxsPSIjZWQ0ODRjIi8+PHBhdGggZD0iTTUgNi41aDZjLjggMCAxLjUuNyAxLjUgMS41cy0uNyAxLjUtMS41IDEuNUg1Yy0uOCAwLTEuNS0uNy0xLjUtMS41UzQuMiA2LjUgNSA2LjV6IiBmaWxsPSIjZmRmZmZmIi8+PC9zdmc+Cg=="},87210:t=>{t.exports="data:image/svg+xml;base64,PCEtLSBUaGlzIGljb24gaXMgcGFydCBvZiBNYXRlcmlhbCBVSSBJY29ucy4gQ29weXJpZ2h0IDIwMjAgR29vZ2xlIEluYy4sIEFwYWNoZS0yLjAgTGljZW5zZSAtLT4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTQuOCAxMS4yaDYuNFY0LjhINC44djYuNHpNOCAwQzMuNiAwIDAgMy42IDAgOHMzLjYgOCA4IDggOC0zLjYgOC04LTMuNi04LTgtOHoiIGZpbGw9IiM0OWIzODIiLz48L3N2Zz4K"},94659:t=>{t.exports="data:image/svg+xml;base64,PCEtLSBUaGlzIGljb24gaXMgcGFydCBvZiBNYXRlcmlhbCBVSSBJY29ucy4gQ29weXJpZ2h0IDIwMjAgR29vZ2xlIEluYy4sIEFwYWNoZS0yLjAgTGljZW5zZSAtLT4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTS00LTRoMjR2MjRILTR6Ii8+PHBhdGggZD0iTTYuOS4xQzMgLjYtLjEgNC0uMSA4YzAgNC40IDMuNiA4IDggOCA0IDAgNy40LTMgOC02LjktMS4yIDEuMy0yLjkgMi4xLTQuNyAyLjEtMy41IDAtNi40LTIuOS02LjQtNi40IDAtMS45LjgtMy42IDIuMS00Ljd6IiBmaWxsPSIjZjRhMzMxIi8+PC9zdmc+Cg=="},39896:t=>{t.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0iIzIyMiI+PHBhdGggZD0iTTE1LjQgMTYuNkwxMC44IDEybDQuNi00LjZMMTQgNmwtNiA2IDYgNiAxLjQtMS40eiIvPjwvc3ZnPg=="},76899:t=>{t.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0iIzIyMiI+PHBhdGggZD0iTTE4LjQgNy40TDE3IDZsLTYgNiA2IDYgMS40LTEuNC00LjYtNC42IDQuNi00LjZtLTYgMEwxMSA2bC02IDYgNiA2IDEuNC0xLjRMNy44IDEybDQuNi00LjZ6Ii8+PC9zdmc+"},88931:t=>{t.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0iIzIyMiI+PHBhdGggZD0iTTUuNiA3LjRMNyA2bDYgNi02IDYtMS40LTEuNCA0LjYtNC42LTQuNi00LjZtNiAwTDEzIDZsNiA2LTYgNi0xLjQtMS40IDQuNi00LjYtNC42LTQuNnoiLz48L3N2Zz4="},16556:t=>{t.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0iIzIyMiI+PHBhdGggZD0iTTguNiAxNi42bDQuNi00LjYtNC42LTQuNkwxMCA2bDYgNi02IDYtMS40LTEuNHoiLz48L3N2Zz4="},94542:(t,e,i)=>{i.r(e),i.d(e,{default:()=>z});var n=i(20144),r=i(5656),o=i(31352),s=i(64882),a=i(62520),l=i(43554),c=i(79753);function u(t){return"function"==typeof t?t():(0,n.unref)(t)}function d(t){const e=Object.create(null);return i=>e[i]||(e[i]=t(i))}n.default.util.warn,i(25108),"undefined"!=typeof WorkerGlobalScope&&(globalThis,WorkerGlobalScope),Object.prototype.toString;const p=/\B([A-Z])/g,f=(d((t=>t.replace(p,"-$1").toLowerCase())),/-(\w)/g);d((t=>t.replace(f,((t,e)=>e?e.toUpperCase():""))));var h=i(93664),g=i(35820),m=i(74139),v=i(69183),w=i(25108);function y(t,e,i,n,r,o,s,a){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),s?(l=function(t){!(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)&&typeof __VUE_SSR_CONTEXT__<"u"&&(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},c._ssrRegister=l):r&&(l=a?function(){r.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:r),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(t,e)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,l):[l]}return{exports:t,options:c}}const _=y({name:"FileIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon file-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:"M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null,null).exports,b=()=>{var t,e,i;const r=(0,l.j)("files","config",null),o=(0,n.ref)(null!=(t=null==r?void 0:r.show_hidden)&&t),s=(0,n.ref)(null==(e=null==r?void 0:r.sort_favorites_first)||e),a=(0,n.ref)(null==(i=null==r?void 0:r.crop_image_previews)||i);return(0,n.onMounted)((()=>{h.Z.get((0,c.generateUrl)("/apps/files/api/v1/configs")).then((t=>{var e,i,n,r,l,c,u,d,p;o.value=null!=(n=null==(i=null==(e=t.data)?void 0:e.data)?void 0:i.show_hidden)&&n,s.value=null==(c=null==(l=null==(r=t.data)?void 0:r.data)?void 0:l.sort_favorites_first)||c,a.value=null==(p=null==(d=null==(u=t.data)?void 0:u.data)?void 0:d.crop_image_previews)||p}))})),{showHiddenFiles:o,sortFavoritesFirst:s,cropImagePreviews:a}},x=y({name:"MenuUpIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon menu-up-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:"M7,15L12,10L17,15H7Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null,null).exports,N=y({name:"MenuDownIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon menu-down-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:"M7,10L12,15L17,10H7Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null,null).exports,C={"file-picker__file-icon":"_file-picker__file-icon_1vgv4_5"},I=y((0,n.defineComponent)({__name:"LoadingTableRow",props:{showCheckbox:{type:Boolean}},setup:t=>({__sfc:!0,fileListIconStyles:C})}),(function(){var t=this,e=t._self._c,i=t._self._setupProxy;return e("tr",{staticClass:"file-picker__row loading-row",attrs:{"aria-hidden":"true"}},[t.showCheckbox?e("td",{staticClass:"row-checkbox"},[e("span")]):t._e(),e("td",{staticClass:"row-name"},[e("div",{staticClass:"row-wrapper"},[e("span",{class:i.fileListIconStyles["file-picker__file-icon"]}),e("span")])]),t._m(0),t._m(1)])}),[function(){var t=this._self._c;return this._self._setupProxy,t("td",{staticClass:"row-size"},[t("span")])},function(){var t=this._self._c;return this._self._setupProxy,t("td",{staticClass:"row-modified"},[t("span")])}],!1,null,"6aded0d9",null,null).exports,E=y({name:"FolderIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon folder-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:"M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null,null).exports,S=y((0,n.defineComponent)({name:"FilePreview",props:{node:null,cropImagePreviews:{type:Boolean}},setup(t){const e=t,i=(0,n.ref)(C),o=(0,n.computed)((()=>function(t,e={}){var i;e={size:32,cropPreview:!1,mimeFallback:!0,...e};try{const n=(null==(i=t.attributes)?void 0:i.previewUrl)||(0,c.generateUrl)("/core/preview?fileId={fileid}",{fileid:t.fileid});let r;try{r=new URL(n)}catch{r=new URL(n,window.location.origin)}return r.searchParams.set("x","".concat(e.size)),r.searchParams.set("y","".concat(e.size)),r.searchParams.set("mimeFallback","".concat(e.mimeFallback)),r.searchParams.set("a",!0===e.cropPreview?"0":"1"),r.searchParams.set("c","".concat(t.attributes.etag)),r}catch{return null}}(e.node,{cropPreview:e.cropImagePreviews}))),s=(0,n.computed)((()=>e.node.type===r.Tv.File)),a=(0,n.ref)(!1);return(0,n.watch)(o,(()=>{if(a.value=!1,o.value){const t=document.createElement("img");t.src=o.value.href,t.onerror=()=>t.remove(),t.onload=()=>{a.value=!0,t.remove()},document.body.appendChild(t)}}),{immediate:!0}),{__sfc:!0,fileListIconStyles:i,props:e,previewURL:o,isFile:s,canLoadPreview:a,t:g.t,IconFile:_,IconFolder:E}}}),(function(){var t=this,e=t._self._c,i=t._self._setupProxy;return e("div",{class:i.fileListIconStyles["file-picker__file-icon"],style:i.canLoadPreview?{backgroundImage:"url(".concat(i.previewURL,")")}:void 0,attrs:{"aria-label":i.t("MIME type {mime}",{mime:t.node.mime||i.t("unknown")})}},[i.canLoadPreview?t._e():[i.isFile?e(i.IconFile,{attrs:{size:20}}):e(i.IconFolder,{attrs:{size:20}})]],2)}),[],!1,null,null,null,null).exports,k=y((0,n.defineComponent)({__name:"FileListRow",props:{allowPickDirectory:{type:Boolean},selected:{type:Boolean},showCheckbox:{type:Boolean},canPick:{type:Boolean},node:null,cropImagePreviews:{type:Boolean}},emits:["update:selected","enter-directory"],setup(t,{emit:e}){const i=t,o=(0,n.computed)((()=>{var t;return(null==(t=i.node.attributes)?void 0:t.displayName)||i.node.basename.slice(0,i.node.extension?-i.node.extension.length:void 0)})),a=(0,n.computed)((()=>i.node.extension)),l=(0,n.computed)((()=>i.node.type===r.Tv.Folder)),c=(0,n.computed)((()=>i.canPick&&(i.allowPickDirectory||!l.value)));function u(){e("update:selected",!i.selected)}function d(){l.value?e("enter-directory",i.node):u()}return{__sfc:!0,props:i,emit:e,displayName:o,fileExtension:a,isDirectory:l,isPickable:c,toggleSelected:u,handleClick:d,handleKeyDown:function(t){"Enter"===t.key&&d()},formatFileSize:r.sS,NcCheckboxRadioSwitch:s.rw,NcDateTime:s.Jh,t:g.t,FilePreview:S}}}),(function(){var t=this,e=t._self._c,i=t._self._setupProxy;return e("tr",t._g({class:["file-picker__row",{"file-picker__row--selected":t.selected&&!t.showCheckbox}],attrs:{tabindex:t.showCheckbox&&!i.isDirectory?void 0:0,"aria-selected":i.isPickable?t.selected:void 0,"data-filename":t.node.basename,"data-testid":"file-list-row"},on:{click:i.handleClick}},!t.showCheckbox||i.isDirectory?{keydown:i.handleKeyDown}:{}),[t.showCheckbox?e("td",{staticClass:"row-checkbox"},[e(i.NcCheckboxRadioSwitch,{attrs:{disabled:!i.isPickable,checked:t.selected,"aria-label":i.t("Select the row for {nodename}",{nodename:i.displayName}),"data-testid":"row-checkbox"},on:{click:function(t){t.stopPropagation()},"update:checked":i.toggleSelected}})],1):t._e(),e("td",{staticClass:"row-name"},[e("div",{staticClass:"file-picker__name-container",attrs:{"data-testid":"row-name"}},[e(i.FilePreview,{attrs:{node:t.node,"crop-image-previews":t.cropImagePreviews}}),e("div",{staticClass:"file-picker__file-name",attrs:{title:i.displayName},domProps:{textContent:t._s(i.displayName)}}),e("div",{staticClass:"file-picker__file-extension",domProps:{textContent:t._s(i.fileExtension)}})],1)]),e("td",{staticClass:"row-size"},[t._v(" "+t._s(i.formatFileSize(t.node.size||0))+" ")]),e("td",{staticClass:"row-modified"},[e(i.NcDateTime,{attrs:{timestamp:t.node.mtime,"ignore-seconds":!0}})],1)])}),[],!1,null,"ee6f34b5",null,null).exports,L=y((0,n.defineComponent)({__name:"FileList",props:{currentView:null,multiselect:{type:Boolean},allowPickDirectory:{type:Boolean},loading:{type:Boolean},files:null,selectedFiles:null,path:null},emits:["update:path","update:selectedFiles"],setup(t,{emit:e}){const i=t,d=(0,n.ref)(),{currentConfig:p}=(t=>{var e,i,r,o,s,a,d,p,f,g,m,v;const w=t=>"asc"===t?"ascending":"desc"===t?"descending":"none",y=(0,l.j)("files","viewConfigs",null),_=(0,n.ref)({sortBy:null!=(i=null==(e=null==y?void 0:y.files)?void 0:e.sorting_mode)?i:"basename",order:w(null!=(o=null==(r=null==y?void 0:y.files)?void 0:r.sorting_direction)?o:"asc")}),b=(0,n.ref)({sortBy:null!=(a=null==(s=null==y?void 0:y.recent)?void 0:s.sorting_mode)?a:"basename",order:w(null!=(p=null==(d=null==y?void 0:y.recent)?void 0:d.sorting_direction)?p:"asc")}),x=(0,n.ref)({sortBy:null!=(g=null==(f=null==y?void 0:y.favorites)?void 0:f.sorting_mode)?g:"basename",order:w(null!=(v=null==(m=null==y?void 0:y.favorites)?void 0:m.sorting_direction)?v:"asc")});(0,n.onMounted)((()=>{h.Z.get((0,c.generateUrl)("/apps/files/api/v1/views")).then((t=>{var e,i,n,r,o,s,a,l,c,u,d,p,f,h,g,m,v,y,N,C,I;_.value={sortBy:null!=(r=null==(n=null==(i=null==(e=t.data)?void 0:e.data)?void 0:i.files)?void 0:n.sorting_mode)?r:"basename",order:w(null==(a=null==(s=null==(o=t.data)?void 0:o.data)?void 0:s.files)?void 0:a.sorting_direction)},x.value={sortBy:null!=(d=null==(u=null==(c=null==(l=t.data)?void 0:l.data)?void 0:c.favorites)?void 0:u.sorting_mode)?d:"basename",order:w(null==(h=null==(f=null==(p=t.data)?void 0:p.data)?void 0:f.favorites)?void 0:h.sorting_direction)},b.value={sortBy:null!=(y=null==(v=null==(m=null==(g=t.data)?void 0:g.data)?void 0:m.recent)?void 0:v.sorting_mode)?y:"basename",order:w(null==(I=null==(C=null==(N=t.data)?void 0:N.data)?void 0:C.recent)?void 0:I.sorting_direction)}}))}));const N=(0,n.computed)((()=>"files"===u(t||"files")?_.value:"recent"===u(t)?b.value:x.value)),C=(0,n.computed)((()=>N.value.sortBy)),I=(0,n.computed)((()=>N.value.order));return{filesViewConfig:_,favoritesViewConfig:x,recentViewConfig:b,currentConfig:N,sortBy:C,order:I}})(i.currentView),f=(0,n.computed)((()=>{var t;return null!=(t=d.value)?t:p.value})),m=(0,n.computed)((()=>"basename"===f.value.sortBy?"none"===f.value.order?void 0:f.value.order:void 0)),v=(0,n.computed)((()=>"size"===f.value.sortBy?"none"===f.value.order?void 0:f.value.order:void 0)),w=(0,n.computed)((()=>"mtime"===f.value.sortBy?"none"===f.value.order?void 0:f.value.order:void 0)),{sortFavoritesFirst:y,cropImagePreviews:_}=b(),C=(0,n.computed)((()=>{const t={ascending:(t,e,i)=>i(t,e),descending:(t,e,i)=>i(e,t),none:(t,e,i)=>0},e={basename:(t,e)=>{var i,n;return((null==(i=t.attributes)?void 0:i.displayName)||t.basename).localeCompare((null==(n=e.attributes)?void 0:n.displayName)||e.basename,(0,o.aj)())},size:(t,e)=>(t.size||0)-(e.size||0),mtime:(t,e)=>{var i,n,r,o;return((null==(n=null==(i=e.mtime)?void 0:i.getTime)?void 0:n.call(i))||0)-((null==(o=null==(r=t.mtime)?void 0:r.getTime)?void 0:o.call(r))||0)}};return[...i.files].sort(((i,n)=>(n.type===r.Tv.Folder?1:0)-(i.type===r.Tv.Folder?1:0)||(y?(n.attributes.favorite?1:0)-(i.attributes.favorite?1:0):0)||t[f.value.order](i,n,e[f.value.sortBy])))})),E=(0,n.computed)((()=>i.files.filter((t=>i.allowPickDirectory||t.type!==r.Tv.Folder)))),S=(0,n.computed)((()=>!i.loading&&i.selectedFiles.length>0&&i.selectedFiles.length>=E.value.length)),L=(0,n.ref)(4),P=(0,n.ref)();{const t=()=>(0,n.nextTick)((()=>{var t,e,i,n,r;const o=(null==(e=null==(t=P.value)?void 0:t.parentElement)?void 0:e.children)||[];let s=(null==(n=null==(i=P.value)?void 0:i.parentElement)?void 0:n.clientHeight)||450;for(let t=0;t{window.addEventListener("resize",t),t()})),(0,n.onUnmounted)((()=>{window.removeEventListener("resize",t)}))}return{__sfc:!0,props:i,emit:e,customSortingConfig:d,filesAppSorting:p,sortingConfig:f,sortByName:m,sortBySize:v,sortByModified:w,toggleSorting:t=>{f.value.sortBy===t?"ascending"===f.value.order?d.value={sortBy:f.value.sortBy,order:"descending"}:d.value={sortBy:f.value.sortBy,order:"ascending"}:d.value={sortBy:t,order:"ascending"}},sortFavoritesFirst:y,cropImagePreviews:_,sortedFiles:C,selectableFiles:E,allSelected:S,onSelectAll:function(){i.selectedFiles.lengthe.path!==t.path))):i.multiselect?e("update:selectedFiles",[...i.selectedFiles,t]):e("update:selectedFiles",[t])},onChangeDirectory:function(t){e("update:path",(0,a.join)(i.path,t.basename))},skeletonNumber:L,fileContainer:P,NcButton:s.P2,NcCheckboxRadioSwitch:s.rw,t:g.t,IconSortAscending:x,IconSortDescending:N,LoadingTableRow:I,FileListRow:k}}}),(function(){var t=this,e=t._self._c,i=t._self._setupProxy;return e("div",{ref:"fileContainer",staticClass:"file-picker__files"},[e("table",[e("thead",[e("tr",[t.multiselect?e("th",{staticClass:"row-checkbox"},[e("span",{staticClass:"hidden-visually"},[t._v(" "+t._s(i.t("Select entry"))+" ")]),t.multiselect?e(i.NcCheckboxRadioSwitch,{attrs:{"aria-label":i.t("Select all entries"),checked:i.allSelected,"data-testid":"select-all-checkbox"},on:{"update:checked":i.onSelectAll}}):t._e()],1):t._e(),e("th",{staticClass:"row-name",attrs:{"aria-sort":i.sortByName}},[e("div",{staticClass:"header-wrapper"},[e("span",{staticClass:"file-picker__header-preview"}),e(i.NcButton,{attrs:{wide:!0,type:"tertiary","data-test":"file-picker_sort-name"},on:{click:function(t){return i.toggleSorting("basename")}},scopedSlots:t._u([{key:"icon",fn:function(){return["ascending"===i.sortByName?e(i.IconSortAscending,{attrs:{size:20}}):"descending"===i.sortByName?e(i.IconSortDescending,{attrs:{size:20}}):e("span",{staticStyle:{width:"44px"}})]},proxy:!0}])},[t._v(" "+t._s(i.t("Name"))+" ")])],1)]),e("th",{staticClass:"row-size",attrs:{"aria-sort":i.sortBySize}},[e(i.NcButton,{attrs:{wide:!0,type:"tertiary"},on:{click:function(t){return i.toggleSorting("size")}},scopedSlots:t._u([{key:"icon",fn:function(){return["ascending"===i.sortBySize?e(i.IconSortAscending,{attrs:{size:20}}):"descending"===i.sortBySize?e(i.IconSortDescending,{attrs:{size:20}}):e("span",{staticStyle:{width:"44px"}})]},proxy:!0}])},[t._v(" "+t._s(i.t("Size"))+" ")])],1),e("th",{staticClass:"row-modified",attrs:{"aria-sort":i.sortByModified}},[e(i.NcButton,{attrs:{wide:!0,type:"tertiary"},on:{click:function(t){return i.toggleSorting("mtime")}},scopedSlots:t._u([{key:"icon",fn:function(){return["ascending"===i.sortByModified?e(i.IconSortAscending,{attrs:{size:20}}):"descending"===i.sortByModified?e(i.IconSortDescending,{attrs:{size:20}}):e("span",{staticStyle:{width:"44px"}})]},proxy:!0}])},[t._v(" "+t._s(i.t("Modified"))+" ")])],1)])]),e("tbody",[t.loading?t._l(i.skeletonNumber,(function(n){return e(i.LoadingTableRow,{key:n,attrs:{"show-checkbox":t.multiselect}})})):t._l(i.sortedFiles,(function(n){return e(i.FileListRow,{key:n.fileid||n.path,attrs:{"allow-pick-directory":t.allowPickDirectory,"show-checkbox":t.multiselect,"can-pick":t.multiselect||0===t.selectedFiles.length||t.selectedFiles.includes(n),selected:t.selectedFiles.includes(n),node:n,"crop-image-previews":i.cropImagePreviews},on:{"update:selected":function(t){return i.onNodeSelected(n)},"enter-directory":i.onChangeDirectory}})}))],2)])])}),[],!1,null,"4297db37",null,null).exports,P=y({name:"HomeIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon home-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:"M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null,null).exports,A=y({name:"PlusIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon plus-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:"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null,null).exports,T=y((0,n.defineComponent)({__name:"FilePickerBreadcrumbs",props:{path:null,showMenu:{type:Boolean}},emits:["update:path","create-node"],setup(t,{emit:e}){const i=t,r=(0,n.ref)(""),o=(0,n.ref)();function a(){var t,e,i,n;const s=r.value.trim(),a=null==(e=null==(t=o.value)?void 0:t.$el)?void 0:e.querySelector("input");let l="";return 0===s.length?l=(0,g.t)("Folder name cannot be empty."):s.includes("/")?l=(0,g.t)('"/" is not allowed inside a folder name.'):["..","."].includes(s)?l=(0,g.t)('"{name}" is an invalid folder name.',{name:s}):null!=(i=window.OC.config)&&i.blacklist_files_regex&&s.match(null==(n=window.OC.config)?void 0:n.blacklist_files_regex)&&(l=(0,g.t)('"{name}" is not an allowed folder name',{name:s})),a&&a.setCustomValidity(l),""===l}const l=(0,n.computed)((()=>i.path.split("/").filter((t=>""!==t)).map(((t,e,i)=>({name:t,path:"/"+i.slice(0,e+1).join("/")})))));return{__sfc:!0,props:i,emit:e,newNodeName:r,nameInput:o,validateInput:a,onSubmit:function(){const t=r.value.trim();a()&&(e("create-node",t),r.value="")},pathElements:l,IconFolder:E,IconHome:P,IconPlus:A,NcActions:s.O3,NcActionInput:s.Iw,NcBreadcrumbs:s.fg,NcBreadcrumb:s.$U,t:g.t}}}),(function(){var t=this,e=t._self._c,i=t._self._setupProxy;return e(i.NcBreadcrumbs,{staticClass:"file-picker__breadcrumbs",scopedSlots:t._u([{key:"default",fn:function(){return[e(i.NcBreadcrumb,{attrs:{name:i.t("Home"),title:i.t("Home")},on:{click:function(t){return i.emit("update:path","/")}},scopedSlots:t._u([{key:"icon",fn:function(){return[e(i.IconHome,{attrs:{size:20}})]},proxy:!0}])}),t._l(i.pathElements,(function(t){return e(i.NcBreadcrumb,{key:t.path,attrs:{name:t.name,title:t.path},on:{click:function(e){return i.emit("update:path",t.path)}}})}))]},proxy:!0},t.showMenu?{key:"actions",fn:function(){return[e(i.NcActions,{attrs:{"aria-label":i.t("Create directory"),"force-menu":!0,"force-name":!0,"menu-name":i.t("New"),type:"secondary"},on:{close:function(t){i.newNodeName=""}},scopedSlots:t._u([{key:"icon",fn:function(){return[e(i.IconPlus,{attrs:{size:20}})]},proxy:!0}],null,!1,2971667417)},[e(i.NcActionInput,{ref:"nameInput",attrs:{value:i.newNodeName,label:i.t("New folder"),placeholder:i.t("New folder name")},on:{"update:value":function(t){i.newNodeName=t},submit:i.onSubmit,input:i.validateInput},scopedSlots:t._u([{key:"icon",fn:function(){return[e(i.IconFolder,{attrs:{size:20}})]},proxy:!0}],null,!1,1614167509)})],1)]},proxy:!0}:null],null,!0)})}),[],!1,null,"3bc9efa5",null,null).exports,Z=y({name:"ClockIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon clock-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,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M16.2,16.2L11,13V7H12.5V12.2L17,14.9L16.2,16.2Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null,null).exports,D=y({name:"CloseIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon close-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:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null,null).exports,F=y({name:"MagnifyIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon magnify-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:"M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null,null).exports,M=y({name:"StarIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},(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,null).exports,B=y((0,n.defineComponent)({__name:"FilePickerNavigation",props:{currentView:null,filterString:null,isCollapsed:{type:Boolean}},emits:["update:currentView","update:filterString"],setup(t,{emit:e}){const i=t,r=[{id:"files",label:(0,g.t)("All files"),icon:E},{id:"recent",label:(0,g.t)("Recent"),icon:Z},{id:"favorites",label:(0,g.t)("Favorites"),icon:M}],o=(0,n.computed)((()=>r.filter((t=>t.id===i.currentView))[0]));return{__sfc:!0,allViews:r,props:i,emit:e,currentViewObject:o,updateFilterValue:t=>e("update:filterString",t),IconClose:D,IconMagnify:F,NcButton:s.P2,NcSelect:s.QG,NcTextField:s.h3,t:g.t,Fragment:m.Fragment}}}),(function(){var t=this,e=t._self._c,i=t._self._setupProxy;return e(i.Fragment,[e(i.NcTextField,{staticClass:"file-picker__filter-input",attrs:{value:t.filterString,label:i.t("Filter file list"),"show-trailing-button":!!t.filterString},on:{"update:value":i.updateFilterValue,"trailing-button-click":function(t){return i.updateFilterValue("")}},scopedSlots:t._u([{key:"trailing-button-icon",fn:function(){return[e(i.IconClose,{attrs:{size:16}})]},proxy:!0}])},[e(i.IconMagnify,{attrs:{size:16}})],1),t.isCollapsed?e(i.NcSelect,{attrs:{"aria-label":i.t("Current view selector"),clearable:!1,searchable:!1,options:i.allViews,value:i.currentViewObject},on:{input:t=>i.emit("update:currentView",t.id)}}):e("ul",{staticClass:"file-picker__side",attrs:{role:"tablist","aria-label":i.t("Filepicker sections")}},t._l(i.allViews,(function(n){return e("li",{key:n.id},[e(i.NcButton,{attrs:{"aria-selected":t.currentView===n.id,type:t.currentView===n.id?"primary":"tertiary",wide:!0,role:"tab"},on:{click:function(e){return t.$emit("update:currentView",n.id)}},scopedSlots:t._u([{key:"icon",fn:function(){return[e(n.icon,{tag:"component",attrs:{size:20}})]},proxy:!0}],null,!0)},[t._v(" "+t._s(n.label)+" ")])],1)})),0)],1)}),[],!1,null,"fcfd0f23",null,null).exports,z=y((0,n.defineComponent)({name:"FilePicker",props:{buttons:null,name:null,allowPickDirectory:{type:Boolean,default:!1},container:{default:"body"},filterFn:{default:void 0},mimetypeFilter:{default:()=>[]},multiselect:{type:Boolean,default:!0},path:{default:"/"}},emits:["close"],setup(t,{emit:e}){const i=t,o=(0,n.computed)((()=>({container:i.container,name:i.name,buttons:l.value,size:"large",contentClasses:["file-picker__content"],dialogClasses:["file-picker"],navigationClasses:["file-picker__navigation"]}))),l=(0,n.computed)((()=>("function"==typeof i.buttons?i.buttons(d.value,h.value,c.value):i.buttons).map((t=>({...t,callback:async()=>{const n=0===d.value.length&&i.allowPickDirectory?[await I(h.value)]:d.value;t.callback(n),e("close",n)}}))))),c=(0,n.ref)("files"),u=(0,n.computed)((()=>"favorites"===c.value?(0,g.t)("Favorites"):"recent"===c.value?(0,g.t)("Recent"):"")),d=(0,n.ref)([]),p=(0,n.ref)((null==window?void 0:window.sessionStorage.getItem("NC.FilePicker.LastPath"))||"/"),f=(0,n.ref)(),h=(0,n.computed)({get:()=>"files"===c.value?f.value||i.path||p.value:"/",set:t=>{void 0===i.path&&window.sessionStorage.setItem("NC.FilePicker.LastPath",t),f.value=t,d.value=[]}}),m=(0,n.ref)(""),{isSupportedMimeType:y}=function(t){const e=(0,n.computed)((()=>t.value.map((t=>t.split("/")))));return{isSupportedMimeType:t=>{const i=t.split("/");return e.value.some((([t,e])=>!(i[0]!==t&&"*"!==t||i[1]!==e&&"*"!==e)))}}}((0,n.toRef)(i,"mimetypeFilter")),{files:x,isLoading:N,loadFiles:C,getFile:I,client:E}=function(t,e){const i=(0,r.rp)(),o=(0,n.ref)([]),s=(0,n.ref)(!0);async function a(){if(s.value=!0,"favorites"===t.value)o.value=await(0,r.pC)(i,e.value);else if("recent"===t.value){const t=Math.round(Date.now()/1e3)-1209600,{data:e}=await i.search("/",{details:!0,data:(0,r.tB)(t)});o.value=e.results.map((t=>(0,r.RL)(t)))}else{const t=await i.getDirectoryContents("".concat(r._o).concat(e.value),{details:!0,data:(0,r.h7)()});o.value=t.data.map((t=>(0,r.RL)(t)))}s.value=!1}return(0,n.watch)([t,e],(()=>a())),(0,n.onMounted)((()=>a())),{isLoading:s,files:o,loadFiles:a,getFile:async function(t,e=r._o){const n=await i.stat("".concat(e).concat(t),{details:!0});return(0,r.RL)(n.data)},client:i}}(c,h);(0,n.onMounted)((()=>C()));const{showHiddenFiles:S}=b(),k=(0,n.computed)((()=>{let t=x.value;return S.value||(t=t.filter((t=>!t.basename.startsWith(".")))),i.mimetypeFilter.length>0&&(t=t.filter((t=>"folder"===t.type||t.mime&&y(t.mime)))),m.value&&(t=t.filter((t=>t.basename.toLowerCase().includes(m.value.toLowerCase())))),i.filterFn&&(t=t.filter((t=>i.filterFn(t)))),t})),P=(0,n.computed)((()=>"files"===c.value?(0,g.t)("Upload some content or sync with your devices!"):"recent"===c.value?(0,g.t)("Files and folders you recently modified will show up here."):(0,g.t)("Files and folders you mark as favorite will show up here.")));return{__sfc:!0,props:i,emit:e,dialogProps:o,dialogButtons:l,currentView:c,viewHeadline:u,selectedFiles:d,savedPath:p,navigatedPath:f,currentPath:h,filterString:m,isSupportedMimeType:y,files:x,isLoading:N,loadFiles:C,getFile:I,client:E,showHiddenFiles:S,filteredFiles:k,noFilesDescription:P,onCreateFolder:async t=>{try{await E.createDirectory((0,a.join)(r._o,h.value,t)),await C(),(0,v.j8)("files:node:created",x.value.filter((e=>e.basename===t))[0])}catch(e){w.warn("Could not create new folder",{name:t,error:e}),(0,g.k)((0,g.t)("Could not create the new folder"))}},handleClose:t=>{t||e("close")},IconFile:_,FileList:L,FilePickerBreadcrumbs:T,FilePickerNavigation:B,NcDialog:s.a0,NcEmptyContent:s.SL,t:g.t}}}),(function(){var t=this,e=t._self._c,i=t._self._setupProxy;return e(i.NcDialog,t._b({on:{"update:open":i.handleClose},scopedSlots:t._u([{key:"navigation",fn:function({isCollapsed:t}){return[e(i.FilePickerNavigation,{attrs:{"is-collapsed":t,"current-view":i.currentView,"filter-string":i.filterString},on:{"update:currentView":function(t){i.currentView=t},"update:current-view":function(t){i.currentView=t},"update:filterString":function(t){i.filterString=t},"update:filter-string":function(t){i.filterString=t}}})]}}])},"NcDialog",i.dialogProps,!1),[e("div",{staticClass:"file-picker__main"},["files"===i.currentView?e(i.FilePickerBreadcrumbs,{attrs:{path:i.currentPath,"show-menu":t.allowPickDirectory},on:{"update:path":function(t){i.currentPath=t},"create-node":i.onCreateFolder}}):e("div",{staticClass:"file-picker__view"},[e("h3",[t._v(t._s(i.viewHeadline))])]),i.isLoading||i.filteredFiles.length>0?e(i.FileList,{attrs:{"allow-pick-directory":t.allowPickDirectory,"current-view":i.currentView,files:i.filteredFiles,multiselect:t.multiselect,loading:i.isLoading,path:i.currentPath,"selected-files":i.selectedFiles,name:i.viewHeadline},on:{"update:path":[function(t){i.currentPath=t},function(t){i.currentView="files"}],"update:selectedFiles":function(t){i.selectedFiles=t},"update:selected-files":function(t){i.selectedFiles=t}}}):i.filterString?e(i.NcEmptyContent,{attrs:{name:i.t("No matching files"),description:i.t("No files matching your filter were found.")},scopedSlots:t._u([{key:"icon",fn:function(){return[e(i.IconFile)]},proxy:!0}])}):e(i.NcEmptyContent,{attrs:{name:i.t("No files in here"),description:i.noFilesDescription},scopedSlots:t._u([{key:"icon",fn:function(){return[e(i.IconFile)]},proxy:!0}])})],1)])}),[],!1,null,"86a13079",null,null).exports},5656:(t,e,i)=>{i.d(e,{$B:()=>M,DT:()=>v,De:()=>b,G7:()=>ce,Ir:()=>fe,NB:()=>F,RL:()=>R,Ti:()=>H,Tv:()=>A,Vn:()=>_,_o:()=>z,cd:()=>de,e4:()=>D,gt:()=>B,h7:()=>k,m0:()=>E,oE:()=>pe,p$:()=>w,p4:()=>y,pC:()=>V,qq:()=>I,rp:()=>j,sS:()=>m,sg:()=>G,tB:()=>L,w4:()=>S,y3:()=>x,zu:()=>P});var n=i(77958),r=i(17499),o=i(31352),s=i(62520),a=i(65358),l=i(79753),c=i(14596);const u=null===(d=(0,n.ts)())?(0,r.IY)().setApp("files").build():(0,r.IY)().setApp("files").setUid(d.uid).build();var d;class p{_entries=[];registerEntry(t){this.validateEntry(t),this._entries.push(t)}unregisterEntry(t){const e="string"==typeof t?this.getEntryIndex(t):this.getEntryIndex(t.id);-1!==e?this._entries.splice(e,1):u.warn("Entry not found, nothing removed",{entry:t,entries:this.getEntries()})}getEntries(t){return t?this._entries.filter((e=>"function"!=typeof e.enabled||e.enabled(t))):this._entries}getEntryIndex(t){return this._entries.findIndex((e=>e.id===t))}validateEntry(t){if(!t.id||!t.displayName||!t.iconSvgInline&&!t.iconClass||!t.handler)throw new Error("Invalid entry");if("string"!=typeof t.id||"string"!=typeof t.displayName)throw new Error("Invalid id or displayName property");if(t.iconClass&&"string"!=typeof t.iconClass||t.iconSvgInline&&"string"!=typeof t.iconSvgInline)throw new Error("Invalid icon provided");if(void 0!==t.enabled&&"function"!=typeof t.enabled)throw new Error("Invalid enabled property");if("function"!=typeof t.handler)throw new Error("Invalid handler property");if("order"in t&&"number"!=typeof t.order)throw new Error("Invalid order property");if(-1!==this.getEntryIndex(t.id))throw new Error("Duplicate entry")}}const f=function(){return typeof window._nc_newfilemenu>"u"&&(window._nc_newfilemenu=new p,u.debug("NewFileMenu initialized")),window._nc_newfilemenu},h=["B","KB","MB","GB","TB","PB"],g=["B","KiB","MiB","GiB","TiB","PiB"];function m(t,e=!1,i=!1,n=!1){i=i&&!n,"string"==typeof t&&(t=Number(t));let r=t>0?Math.floor(Math.log(t)/Math.log(n?1e3:1024)):0;r=Math.min((i?g.length:h.length)-1,r);const s=i?g[r]:h[r];let a=(t/Math.pow(n?1e3:1024,r)).toFixed(1);return!0===e&&0===r?("0.0"!==a?"< 1 ":"0 ")+(i?g[1]:h[1]):(a=r<2?parseFloat(a).toFixed(0):parseFloat(a).toLocaleString((0,o.aj)()),a+" "+s)}var v=(t=>(t.DEFAULT="default",t.HIDDEN="hidden",t))(v||{});class w{_action;constructor(t){this.validateAction(t),this._action=t}get id(){return this._action.id}get displayName(){return this._action.displayName}get title(){return this._action.title}get iconSvgInline(){return this._action.iconSvgInline}get enabled(){return this._action.enabled}get exec(){return this._action.exec}get execBatch(){return this._action.execBatch}get order(){return this._action.order}get parent(){return this._action.parent}get default(){return this._action.default}get inline(){return this._action.inline}get renderInline(){return this._action.renderInline}validateAction(t){if(!t.id||"string"!=typeof t.id)throw new Error("Invalid id");if(!t.displayName||"function"!=typeof t.displayName)throw new Error("Invalid displayName function");if("title"in t&&"function"!=typeof t.title)throw new Error("Invalid title function");if(!t.iconSvgInline||"function"!=typeof t.iconSvgInline)throw new Error("Invalid iconSvgInline function");if(!t.exec||"function"!=typeof t.exec)throw new Error("Invalid exec function");if("enabled"in t&&"function"!=typeof t.enabled)throw new Error("Invalid enabled function");if("execBatch"in t&&"function"!=typeof t.execBatch)throw new Error("Invalid execBatch function");if("order"in t&&"number"!=typeof t.order)throw new Error("Invalid order");if("parent"in t&&"string"!=typeof t.parent)throw new Error("Invalid parent");if(t.default&&!Object.values(v).includes(t.default))throw new Error("Invalid default");if("inline"in t&&"function"!=typeof t.inline)throw new Error("Invalid inline function");if("renderInline"in t&&"function"!=typeof t.renderInline)throw new Error("Invalid renderInline function")}}const y=function(t){typeof window._nc_fileactions>"u"&&(window._nc_fileactions=[],u.debug("FileActions initialized")),window._nc_fileactions.find((e=>e.id===t.id))?u.error(`FileAction ${t.id} already registered`,{action:t}):window._nc_fileactions.push(t)},_=function(){return typeof window._nc_fileactions>"u"&&(window._nc_fileactions=[],u.debug("FileActions initialized")),window._nc_fileactions},b=function(){return typeof window._nc_filelistheader>"u"&&(window._nc_filelistheader=[],u.debug("FileListHeaders initialized")),window._nc_filelistheader};var x=(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))(x||{});const N=["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"],C={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"},I=function(t,e={nc:"http://nextcloud.org/ns"}){typeof window._nc_dav_properties>"u"&&(window._nc_dav_properties=[...N],window._nc_dav_namespaces={...C});const i={...window._nc_dav_namespaces,...e};return window._nc_dav_properties.find((e=>e===t))?(u.error(`${t} already registered`,{prop:t}),!1):t.startsWith("<")||2!==t.split(":").length?(u.error(`${t} is not valid. See example: 'oc:fileid'`,{prop:t}),!1):i[t.split(":")[0]]?(window._nc_dav_properties.push(t),window._nc_dav_namespaces=i,!0):(u.error(`${t} namespace unknown`,{prop:t,namespaces:i}),!1)},E=function(){return typeof window._nc_dav_properties>"u"&&(window._nc_dav_properties=[...N]),window._nc_dav_properties.map((t=>`<${t} />`)).join(" ")},S=function(){return typeof window._nc_dav_namespaces>"u"&&(window._nc_dav_namespaces={...C}),Object.keys(window._nc_dav_namespaces).map((t=>`xmlns:${t}="${window._nc_dav_namespaces?.[t]}"`)).join(" ")},k=function(){return`\n\t\t\n\t\t\t\n\t\t\t\t${E()}\n\t\t\t\n\t\t`},L=function(t){return`\n\n\t\n\t\t\n\t\t\t\n\t\t\t\t${E()}\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t/files/${(0,n.ts)()?.uid}/\n\t\t\t\tinfinity\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\thttpd/unix-directory\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t0\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${t}\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t100\n\t\t\t0\n\t\t\n\t\n`},P=function(t=""){let e=x.NONE;return t&&((t.includes("C")||t.includes("K"))&&(e|=x.CREATE),t.includes("G")&&(e|=x.READ),(t.includes("W")||t.includes("N")||t.includes("V"))&&(e|=x.UPDATE),t.includes("D")&&(e|=x.DELETE),t.includes("R")&&(e|=x.SHARE)),e};var A=(t=>(t.Folder="folder",t.File="file",t))(A||{});const T=function(t,e){return null!==t.match(e)},Z=(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>=x.NONE&&t.permissions<=x.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&&T(t.source,e)){const i=t.source.match(e)[0];if(!t.source.includes((0,s.join)(i,t.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(t.status&&!Object.values(D).includes(t.status))throw new Error("Status must be a valid NodeStatus")};var D=(t=>(t.NEW="new",t.FAILED="failed",t.LOADING="loading",t.LOCKED="locked",t))(D||{});class F{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;constructor(t,e){Z(t,e||this._knownDavService),this._data=t;const i={set:(t,e,i)=>(this.updateMtime(),Reflect.set(t,e,i)),deleteProperty:(t,e)=>(this.updateMtime(),Reflect.deleteProperty(t,e))};this._attributes=new Proxy(t.attributes||{},i),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,a.Ec)(this.source.slice(t.length))}get basename(){return(0,s.basename)(this.source)}get extension(){return(0,s.extname)(this.source)}get dirname(){if(this.root){const t=this.source.indexOf(this.root);return(0,s.dirname)(this.source.slice(t+this.root.length)||"/")}const t=new URL(this.source);return(0,s.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:x.NONE:x.READ}get owner(){return this.isDavRessource?this._data.owner:null}get isDavRessource(){return T(this.source,this._knownDavService)}get root(){return this._data.root?this._data.root.replace(/^(.+)\/$/,"$1"):this.isDavRessource&&(0,s.dirname)(this.source).split(this._knownDavService).pop()||null}get path(){if(this.root){const t=this.source.indexOf(this.root);return this.source.slice(t+this.root.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){Z({...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,s.dirname)(this.source)+"/"+t)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}}class M extends F{get type(){return A.File}}class B extends F{constructor(t){super({...t,mime:"httpd/unix-directory"})}get type(){return A.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}}const z=`/files/${(0,n.ts)()?.uid}`,O=(0,l.generateRemoteUrl)("dav"),j=function(t=O){const e=(0,c.eI)(t);function i(t){e.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:t??""})}return(0,n._S)(i),i((0,n.IH)()),(0,c.lD)().patch("fetch",((t,e)=>{const i=e.headers;return i?.method&&(e.method=i.method,delete i.method),fetch(t,e)})),e},V=async(t,e="/",i=z)=>(await t.getDirectoryContents(`${i}${e}`,{details:!0,data:`\n\t\t\n\t\t\t\n\t\t\t\t${E()}\n\t\t\t\n\t\t\t\n\t\t\t\t1\n\t\t\t\n\t\t`,headers:{method:"REPORT"},includeSelf:!0})).data.filter((t=>t.filename!==e)).map((t=>R(t,i))),R=function(t,e=z,i=O){const r=t.props,o=P(r?.permissions),s=(0,n.ts)()?.uid,a={id:r?.fileid||0,source:`${i}${t.filename}`,mtime:new Date(Date.parse(t.lastmod)),mime:t.mime,size:r?.size||Number.parseInt(r.getcontentlength||"0"),permissions:o,owner:s,root:e,attributes:{...t,...r,hasPreview:r?.["has-preview"]}};return delete a.attributes?.props,"file"===t.type?new M(a):new B(a)};class ${_views=[];_currentView=null;register(t){if(this._views.find((e=>e.id===t.id)))throw new Error(`View id ${t.id} is already registered`);this._views.push(t)}remove(t){const e=this._views.findIndex((e=>e.id===t));-1!==e&&this._views.splice(e,1)}get views(){return this._views}setActive(t){this._currentView=t}get active(){return this._currentView}}const H=function(){return typeof window._nc_navigation>"u"&&(window._nc_navigation=new $,u.debug("Navigation service initialized")),window._nc_navigation};class G{_column;constructor(t){U(t),this._column=t}get id(){return this._column.id}get title(){return this._column.title}get render(){return this._column.render}get sort(){return this._column.sort}get summary(){return this._column.summary}}const U=function(t){if(!t.id||"string"!=typeof t.id)throw new Error("A column id is required");if(!t.title||"string"!=typeof t.title)throw new Error("A column title is required");if(!t.render||"function"!=typeof t.render)throw new Error("A render function is required");if(t.sort&&"function"!=typeof t.sort)throw new Error("Column sortFunction must be a function");if(t.summary&&"function"!=typeof t.summary)throw new Error("Column summary must be a function");return!0};var Y={},X={};!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",i="["+e+"]["+e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",n=new RegExp("^"+i+"$");t.isExist=function(t){return typeof t<"u"},t.isEmptyObject=function(t){return 0===Object.keys(t).length},t.merge=function(t,e,i){if(e){const n=Object.keys(e),r=n.length;for(let o=0;o"u")},t.getAllMatches=function(t,e){const i=[];let n=e.exec(t);for(;n;){const r=[];r.startIndex=e.lastIndex-n[0].length;const o=n.length;for(let t=0;t5&&"xml"===n)return st("InvalidXml","XML declaration allowed only at the start of the document.",ct(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}continue}return e}function J(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let i=1;for(e+=8;e"===t[e]&&(i--,0===i))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e"===t[e+2]){e+=2;break}return e}Y.validate=function(t,e){e=Object.assign({},q,e);const i=[];let n=!1,r=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let o=0;o"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)l+=t[o];if(l=l.trim(),"/"===l[l.length-1]&&(l=l.substring(0,l.length-1),o--),!lt(l)){let e;return e=0===l.trim().length?"Invalid space after '<'.":"Tag '"+l+"' is an invalid name.",st("InvalidTag",e,ct(t,o))}const c=it(t,o);if(!1===c)return st("InvalidAttr","Attributes for '"+l+"' have open quote.",ct(t,o));let u=c.value;if(o=c.index,"/"===u[u.length-1]){const i=o-u.length;u=u.substring(0,u.length-1);const r=rt(u,e);if(!0!==r)return st(r.err.code,r.err.msg,ct(t,i+r.err.line));n=!0}else if(a){if(!c.tagClosed)return st("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",ct(t,o));if(u.trim().length>0)return st("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",ct(t,s));{const e=i.pop();if(l!==e.tagName){let i=ct(t,e.tagStartPos);return st("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+i.line+", col "+i.col+") instead of closing tag '"+l+"'.",ct(t,s))}0==i.length&&(r=!0)}}else{const a=rt(u,e);if(!0!==a)return st(a.err.code,a.err.msg,ct(t,o-u.length+a.err.line));if(!0===r)return st("InvalidXml","Multiple possible root nodes found.",ct(t,o));-1!==e.unpairedTags.indexOf(l)||i.push({tagName:l,tagStartPos:s}),n=!0}for(o++;o0)||st("InvalidXml","Invalid '"+JSON.stringify(i.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):st("InvalidXml","Start tag expected.",1)};const tt='"',et="'";function it(t,e){let i="",n="",r=!1;for(;e"===t[e]&&""===n){r=!0;break}i+=t[e]}return""===n&&{value:i,index:e,tagClosed:r}}const nt=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function rt(t,e){const i=W.getAllMatches(t,nt),n={};for(let t=0;t!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,i){return t}};dt.buildOptions=function(t){return Object.assign({},pt,t)},dt.defaultOptions=pt;const ft=X;function ht(t,e){let i="";for(;e0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}},Et=function(t,e){const i={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let n=1,r=!1,o=!1,s="";for(;e"===t[e]){if(o?"-"===t[e-1]&&"-"===t[e-2]&&(o=!1,n--):n--,0===n)break}else"["===t[e]?r=!0:s+=t[e];else{if(r&&mt(t,e))e+=7,[entityName,val,e]=ht(t,e+1),-1===val.indexOf("&")&&(i[_t(entityName)]={regx:RegExp(`&${entityName};`,"g"),val});else if(r&&vt(t,e))e+=8;else if(r&&wt(t,e))e+=8;else if(r&&yt(t,e))e+=9;else{if(!gt)throw new Error("Invalid DOCTYPE");o=!0}n++,s=""}if(0!==n)throw new Error("Unclosed DOCTYPE")}return{entities:i,i:e}},St=function(t,e={}){if(e=Object.assign({},Nt,e),!t||"string"!=typeof t)return t;let i=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(i))return t;if(e.hex&&bt.test(i))return Number.parseInt(i,16);{const n=xt.exec(i);if(n){const r=n[1],o=n[2];let s=function(t){return t&&-1!==t.indexOf(".")&&("."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substr(0,t.length-1))),t}(n[3]);const a=n[4]||n[6];if(!e.leadingZeros&&o.length>0&&r&&"."!==i[2])return t;if(!e.leadingZeros&&o.length>0&&!r&&"."!==i[1])return t;{const n=Number(i),l=""+n;return-1!==l.search(/[eE]/)||a?e.eNotation?n:t:-1!==i.indexOf(".")?"0"===l&&""===s||l===s||r&&l==="-"+s?n:t:o?s===l||r+s===l?n:t:i===l||i===r+l?n:t}}return t}};function kt(t){const e=Object.keys(t);for(let i=0;i0)){s||(t=this.replaceEntitiesValue(t));const n=this.options.tagValueProcessor(e,t,i,r,o);return null==n?t:typeof n!=typeof t||n!==t?n:this.options.trimValues||t.trim()===t?Vt(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function Pt(t){if(this.options.removeNSPrefix){const e=t.split(":"),i="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=i+e[1])}return t}"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,Ct.nameRegexp);const At=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function Tt(t,e,i){if(!this.options.ignoreAttributes&&"string"==typeof t){const i=Ct.getAllMatches(t,At),n=i.length,r={};for(let t=0;t",o,"Closing Tag is not closed.");let s=t.substring(o+2,e).trim();if(this.options.removeNSPrefix){const t=s.indexOf(":");-1!==t&&(s=s.substr(t+1))}this.options.transformTagName&&(s=this.options.transformTagName(s)),i&&(n=this.saveTextToParentTag(n,i,r));const a=r.substring(r.lastIndexOf(".")+1);if(s&&-1!==this.options.unpairedTags.indexOf(s))throw new Error(`Unpaired tag can not be used as closing tag: `);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=r.lastIndexOf("."),r=r.substring(0,l),i=this.tagsNodeStack.pop(),n="",o=e}else if("?"===t[o+1]){let e=Ot(t,o,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(n=this.saveTextToParentTag(n,i,r),!(this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags)){const t=new It(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,r,e.tagName)),this.addChild(i,t,r)}o=e.closeIndex+1}else if("!--"===t.substr(o+1,3)){const e=zt(t,"--\x3e",o+4,"Comment is not closed.");if(this.options.commentPropName){const s=t.substring(o+4,e-2);n=this.saveTextToParentTag(n,i,r),i.add(this.options.commentPropName,[{[this.options.textNodeName]:s}])}o=e}else if("!D"===t.substr(o+1,2)){const e=Et(t,o);this.docTypeEntities=e.entities,o=e.i}else if("!["===t.substr(o+1,2)){const e=zt(t,"]]>",o,"CDATA is not closed.")-2,s=t.substring(o+9,e);if(n=this.saveTextToParentTag(n,i,r),this.options.cdataPropName)i.add(this.options.cdataPropName,[{[this.options.textNodeName]:s}]);else{let t=this.parseTextData(s,i.tagname,r,!0,!1,!0);null==t&&(t=""),i.add(this.options.textNodeName,t)}o=e+2}else{let s=Ot(t,o,this.options.removeNSPrefix),a=s.tagName;const l=s.rawTagName;let c=s.tagExp,u=s.attrExpPresent,d=s.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),i&&n&&"!xml"!==i.tagname&&(n=this.saveTextToParentTag(n,i,r,!1));const p=i;if(p&&-1!==this.options.unpairedTags.indexOf(p.tagname)&&(i=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),a!==e.tagname&&(r+=r?"."+a:a),this.isItStopNode(this.options.stopNodes,r,a)){let e="";if(c.length>0&&c.lastIndexOf("/")===c.length-1)o=s.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))o=s.closeIndex;else{const i=this.readStopNodeData(t,l,d+1);if(!i)throw new Error(`Unexpected end of ${l}`);o=i.i,e=i.tagContent}const n=new It(a);a!==c&&u&&(n[":@"]=this.buildAttributesMap(c,r,a)),e&&(e=this.parseTextData(e,a,r,!0,u,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),n.add(this.options.textNodeName,e),this.addChild(i,n,r)}else{if(c.length>0&&c.lastIndexOf("/")===c.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),c=a):c=c.substr(0,c.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const t=new It(a);a!==c&&u&&(t[":@"]=this.buildAttributesMap(c,r,a)),this.addChild(i,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new It(a);this.tagsNodeStack.push(i),a!==c&&u&&(t[":@"]=this.buildAttributesMap(c,r,a)),this.addChild(i,t,r),i=t}n="",o=d}}else n+=t[o];return e.child};function Dt(t,e,i){const n=this.options.updateTag(e.tagname,i,e[":@"]);!1===n||("string"==typeof n&&(e.tagname=n),t.addChild(e))}const Ft=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const i=this.docTypeEntities[e];t=t.replace(i.regx,i.val)}for(let e in this.lastEntities){const i=this.lastEntities[e];t=t.replace(i.regex,i.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const i=this.htmlEntities[e];t=t.replace(i.regex,i.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function Mt(t,e,i,n){return t&&(void 0===n&&(n=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,i,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,n))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function Bt(t,e,i){const n="*."+i;for(const i in t){const r=t[i];if(n===r||e===r)return!0}return!1}function zt(t,e,i,n){const r=t.indexOf(e,i);if(-1===r)throw new Error(n);return r+e.length-1}function Ot(t,e,i,n=">"){const r=function(t,e,i=">"){let n,r="";for(let o=e;o",i,`${e} is not closed`);if(t.substring(i+2,o).trim()===e&&(r--,0===r))return{tagContent:t.substring(n,i),i:o};i=o}else if("?"===t[i+1])i=zt(t,"?>",i+1,"StopNode is not closed.");else if("!--"===t.substr(i+1,3))i=zt(t,"--\x3e",i+3,"StopNode is not closed.");else if("!["===t.substr(i+1,2))i=zt(t,"]]>",i,"StopNode is not closed.")-2;else{const n=Ot(t,i,">");n&&((n&&n.tagName)===e&&"/"!==n.tagExp[n.tagExp.length-1]&&r++,i=n.closeIndex)}}function Vt(t,e,i){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&St(t,i)}return Ct.isExist(t)?t:""}var Rt={};function $t(t,e,i){let n;const r={};for(let o=0;o0&&(r[e.textNodeName]=n):void 0!==n&&(r[e.textNodeName]=n),r}function Ht(t){const e=Object.keys(t);for(let t=0;t"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=kt,this.parseXml=Zt,this.parseTextData=Lt,this.resolveNameSpace=Pt,this.buildAttributesMap=Tt,this.isItStopNode=Bt,this.replaceEntitiesValue=Ft,this.readStopNodeData=jt,this.saveTextToParentTag=Mt,this.addChild=Dt}},{prettify:Wt}=Rt,qt=Y;function Qt(t,e,i,n){let r="",o=!1;for(let s=0;s`,o=!1;continue}if(l===e.commentPropName){r+=n+`\x3c!--${a[l][0][e.textNodeName]}--\x3e`,o=!0;continue}if("?"===l[0]){const t=Jt(a[":@"],e),i="?xml"===l?"":n;let s=a[l][0][e.textNodeName];s=0!==s.length?" "+s:"",r+=i+`<${l}${s}${t}?>`,o=!0;continue}let u=n;""!==u&&(u+=e.indentBy);const d=n+`<${l}${Jt(a[":@"],e)}`,p=Qt(a[l],e,c,u);-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?r+=d+">":r+=d+"/>":p&&0!==p.length||!e.suppressEmptyNode?p&&p.endsWith(">")?r+=d+`>${p}${n}`:(r+=d+">",p&&""!==n&&(p.includes("/>")||p.includes("`):r+=d+"/>",o=!0}return r}function Kt(t){const e=Object.keys(t);for(let i=0;i0&&e.processEntities)for(let i=0;i0&&(i="\n"),Qt(t,e,"",i)},ne={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:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function re(t){this.options=Object.assign({},ne,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=ae),this.processTextOrObjNode=oe,this.options.format?(this.indentate=se,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function oe(t,e,i){const n=this.j2x(t,i+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,i):this.buildObjectNode(n.val,e,n.attrStr,i)}function se(t){return this.options.indentBy.repeat(t)}function ae(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}re.prototype.build=function(t){return this.options.preserveOrder?ie(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0).val)},re.prototype.j2x=function(t,e){let i="",n="";for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r))if(typeof t[r]>"u")this.isAttribute(r)&&(n+="");else if(null===t[r])this.isAttribute(r)?n+="":"?"===r[0]?n+=this.indentate(e)+"<"+r+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+r+"/"+this.tagEndChar;else if(t[r]instanceof Date)n+=this.buildTextValNode(t[r],r,"",e);else if("object"!=typeof t[r]){const o=this.isAttribute(r);if(o)i+=this.buildAttrPairStr(o,""+t[r]);else if(r===this.options.textNodeName){let e=this.options.tagValueProcessor(r,""+t[r]);n+=this.replaceEntitiesValue(e)}else n+=this.buildTextValNode(t[r],r,"",e)}else if(Array.isArray(t[r])){const i=t[r].length;let o="";for(let s=0;s"u"||(null===i?"?"===r[0]?n+=this.indentate(e)+"<"+r+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+r+"/"+this.tagEndChar:"object"==typeof i?this.options.oneListGroup?o+=this.j2x(i,e+1).val:o+=this.processTextOrObjNode(i,r,e):o+=this.buildTextValNode(i,r,"",e))}this.options.oneListGroup&&(o=this.buildObjectNode(o,r,"",e)),n+=o}else if(this.options.attributesGroupName&&r===this.options.attributesGroupName){const e=Object.keys(t[r]),n=e.length;for(let o=0;o"+t+r}},re.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(n)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(n)+"<"+e+i+"?"+this.tagEndChar;{let r=this.options.tagValueProcessor(e,t);return r=this.replaceEntitiesValue(r),""===r?this.indentate(n)+"<"+e+i+this.closeTag(e)+this.tagEndChar:this.indentate(n)+"<"+e+i+">"+r+"0&&this.options.processEntities)for(let e=0;e0&&(!t.caption||"string"!=typeof t.caption))throw new Error("View caption is required for top-level views and must be a string");if(!t.getContents||"function"!=typeof t.getContents)throw new Error("View getContents is required and must be a function");if(!t.icon||"string"!=typeof t.icon||!function(t){if("string"!=typeof t)throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);if(0===(t=t.trim()).length||!0!==le.XMLValidator.validate(t))return!1;let e;const i=new le.XMLParser;try{e=i.parse(t)}catch{return!1}return!(!e||!("svg"in e))}(t.icon))throw new Error("View icon is required and must be a valid svg string");if(!("order"in t)||"number"!=typeof t.order)throw new Error("View order is required and must be a number");if(t.columns&&t.columns.forEach((t=>{if(!(t instanceof G))throw new Error("View columns must be an array of Column. Invalid column found")})),t.emptyView&&"function"!=typeof t.emptyView)throw new Error("View emptyView must be a function");if(t.parent&&"string"!=typeof t.parent)throw new Error("View parent must be a string");if("sticky"in t&&"boolean"!=typeof t.sticky)throw new Error("View sticky must be a boolean");if("expanded"in t&&"boolean"!=typeof t.expanded)throw new Error("View expanded must be a boolean");if(t.defaultSortKey&&"string"!=typeof t.defaultSortKey)throw new Error("View defaultSortKey must be a string");return!0},de=function(t){return f().registerEntry(t)},pe=function(t){return f().unregisterEntry(t)},fe=function(t){return f().getEntries(t).sort(((t,e)=>void 0!==t.order&&void 0!==e.order&&t.order!==e.order?t.order-e.order:t.displayName.localeCompare(e.displayName,void 0,{numeric:!0,sensitivity:"base"})))}},64882:(t,e,i)=>{i.d(e,{$F:()=>gt.N,$U:()=>A.Z,Iw:()=>a.Z,Jh:()=>j.Z,O3:()=>d.Z,O9:()=>wt.Z,P2:()=>Z.Z,QG:()=>ct.Z,SL:()=>U.Z,a0:()=>$.Z,fg:()=>T.Z,gE:()=>ht.Z,h3:()=>ut.Z,qf:()=>et.Z,rw:()=>D.Z});var n=i(72155),r=i(66236),o=i(75944),s=i(45157),a=i(26053),l=i(41989),c=i(99313),u=i(20090),d=i(55212),p=i(96204),f=i(16894),h=i(94162),g=i(40874),m=i(27657),v=i(2047),w=i(92870),y=i(26022),_=i(89998),b=i(51235),x=i(36065),N=i(96315),C=i(66845),I=i(87875),E=i(33429),S=i(56956),k=i(42899),L=i(98445),P=i(13887),A=i(36402),T=i(49231),Z=i(74628),D=i(34741),F=i(13607),M=i(73743),B=i(59897),z=i(89241),O=i(96226),j=i(97947),V=i(26939),R=i(37008),$=i(74764),H=i(6318),G=i(78573),U=i(22175),Y=i(93428),X=i(93815),W=i(40873),q=i(64865),Q=i(3172),K=i(88175),J=i(20435),tt=i(25475),et=i(6156),it=i(16972),nt=i(34246),rt=i(34854),ot=i(42213),st=i(22663),at=i(98212),lt=i(13372),ct=(i(29612),i(93664),i(79753),i(86884)),ut=(i(60577),i(49368)),dt=(i(69183),i(74911)),pt=i(35380),ft=i(56857),ht=i(67912),gt=i(13199),mt=i(13888),vt=i(34509),wt=i(70653),yt=(i(52299),i(50279),i(93911),i(85302),i(90318)),_t=i(17593),bt=(i(79845),i(84722),i(76692),i(40946),i(73045));n.Z,r.Z,o.Z,s.Z,a.Z,l.Z,c.Z,u.Z,p.Z,f.Z,h.Z,d.Z,g.Z,m.Z,v.Z,w.Z,y.Z,_.Z,b.Z,x.Z,N.Z,C.Z,I.Z,E.Z,S.Z,k.Z,L.Z,at.NcAutoCompleteResult,P.N,A.Z,T.Z,Z.Z,D.Z,F.Z,M.Z,B.Z,z.Z,O.Z,j.Z,V.Z,R.Z,$.Z,H.Z,G.Z,U.Z,Y.Z,X.Z,W.N,q.Z,Q.Z,K.Z,J.Z,st.N,tt.Z,et.Z,it.Z,nt.Z,rt.Z,ot.Z,at.default,lt.N,dt.Z,ct.Z,pt.Z,ft.Z,ht.Z,gt.N,wt.Z,ut.Z,mt.Z,vt.Z,Symbol.toStringTag,yt.X,_t.X,bt.VTooltip,Symbol.toStringTag}}]); //# sourceMappingURL=8321-8321.js.map?v=8442e3d18a58ee1f612a