@opencloud-eu/web-pkg 5.1.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/{TextEditor-CXSedGM4.js → TextEditor-D-HQDUkm.js} +3 -5
  2. package/dist/assets/{worker-22sDKzz_.js → worker-CVwKToFD.js} +18 -18
  3. package/dist/assets/{worker-BSCY2vwA.js → worker-DJbU-qfq.js} +18 -18
  4. package/dist/assets/{worker-DH8D29Kr.js → worker-DyU7W9CZ.js} +18 -18
  5. package/dist/{index-CEJcEmbf.js → index-OU30YA6H.js} +10663 -11050
  6. package/dist/src/apps/types.d.ts +0 -3
  7. package/dist/src/components/AppBar/AppBar.vue.d.ts +1 -0
  8. package/dist/src/components/AppBar/index.d.ts +0 -1
  9. package/dist/src/components/AppTemplates/AppWrapper.vue.d.ts +1 -1
  10. package/dist/src/components/AppTopBar.vue.d.ts +1 -1
  11. package/dist/src/components/ContextActions/ContextMenuQuickAction.vue.d.ts +409 -11
  12. package/dist/src/components/CreateShortcutModal.vue.d.ts +222 -0
  13. package/dist/src/components/CustomComponentTarget.vue.d.ts +4 -14
  14. package/dist/src/components/Filters/DateFilter.vue.d.ts +500 -0
  15. package/dist/src/components/Navigation/index.d.ts +1 -0
  16. package/dist/src/components/NoContentMessage.vue.d.ts +3 -2
  17. package/dist/src/components/SideBar/FileSideBar.vue.d.ts +2 -1
  18. package/dist/src/components/index.d.ts +1 -1
  19. package/dist/src/composables/actions/spaces/index.d.ts +1 -0
  20. package/dist/src/composables/actions/spaces/useSpaceActionsCreate.d.ts +7 -0
  21. package/dist/src/composables/index.d.ts +1 -1
  22. package/dist/src/composables/navItems/index.d.ts +1 -0
  23. package/dist/src/composables/navItems/useNavItems.d.ts +13 -0
  24. package/dist/src/composables/piniaStores/auth.d.ts +8 -2
  25. package/dist/src/composables/piniaStores/extensionRegistry/types.d.ts +14 -1
  26. package/dist/src/composables/piniaStores/sideBar.d.ts +1 -15
  27. package/dist/src/composables/resources/useResourceViewContextMenu.d.ts +4 -3
  28. package/dist/src/composables/resources/useResourceViewHelpers.d.ts +2 -2
  29. package/dist/src/composables/spaces/useCreateSpace.d.ts +1 -0
  30. package/dist/src/constants.d.ts +0 -6
  31. package/dist/src/extensionPoints.d.ts +3 -0
  32. package/dist/src/helpers/filesize.d.ts +0 -7
  33. package/dist/src/helpers/index.d.ts +1 -2
  34. package/dist/src/helpers/versions.d.ts +5 -0
  35. package/dist/src/index.d.ts +1 -0
  36. package/dist/web-pkg.js +329 -331
  37. package/dist/web-pkg.umd.cjs +14 -34
  38. package/package.json +4 -5
  39. package/src/index.ts +1 -0
  40. package/dist/src/components/AppBar/CreateSpace.vue.d.ts +0 -18
  41. package/dist/src/components/TextEditor/TextEditor.vue.d.ts +0 -165
  42. package/dist/src/components/TextEditor/index.d.ts +0 -161
  43. package/dist/src/composables/portalTarget/eventTopics.d.ts +0 -3
  44. package/dist/src/composables/portalTarget/index.d.ts +0 -2
  45. package/dist/src/composables/portalTarget/usePortalTarget.d.ts +0 -4
  46. package/dist/src/helpers/contextMenuDropdown.d.ts +0 -7
  47. package/dist/src/helpers/statusIndicators.d.ts +0 -12
  48. package/dist/src/services/passwordPolicy/rules.d.ts +0 -69
  49. /package/dist/src/components/{PortalTarget.vue.d.ts → Navigation/MobileNav.vue.d.ts} +0 -0
@@ -1,36 +1,16 @@
1
- (function(x,z){typeof exports=="object"&&typeof module<"u"?z(exports,require("@opencloud-eu/web-client"),require("@casl/vue"),require("vue3-gettext"),require("fuse.js"),require("lodash-es"),require("axios"),require("uuid"),require("@microsoft/fetch-event-source"),require("vue-concurrency"),require("luxon"),require("filesize"),require("qs"),require("password-sheriff"),require("@uppy/core"),require("@uppy/tus"),require("@uppy/xhr-upload"),require("@uppy/utils"),require("pinia"),require("oidc-client-ts"),require("@vueuse/core"),require("deepmerge"),require("portal-vue"),require("dompurify"),require("mark.js"),require("p-queue"),require("cropperjs"),require("vue-router"),require("@vue/shared"),require("md-editor-v3"),require("zod"),require("@sentry/vue"),require("screenfull"),require("@codemirror/view")):typeof define=="function"&&define.amd?define(["exports","@opencloud-eu/web-client","@casl/vue","vue3-gettext","fuse.js","lodash-es","axios","uuid","@microsoft/fetch-event-source","vue-concurrency","luxon","filesize","qs","password-sheriff","@uppy/core","@uppy/tus","@uppy/xhr-upload","@uppy/utils","pinia","oidc-client-ts","@vueuse/core","deepmerge","portal-vue","dompurify","mark.js","p-queue","cropperjs","vue-router","@vue/shared","md-editor-v3","zod","@sentry/vue","screenfull","@codemirror/view"],z):(x=typeof globalThis<"u"?globalThis:x||self,z(x["web-pkg"]={},x.webClient,x.vue,x.vue3Gettext,x.Fuse,x.lodashEs,x.globalAxios,x.uuid,x.fetchEventSource,x.vueConcurrency,x.luxon,x.filesize,x.qs,x.passwordSheriff,x.Uppy,x.Tus,x.XHRUpload,x.utils,x.pinia,x.oidcClientTs,x.core,x.merge$1,x.portalVue,x.DOMPurify,x.Mark,x.PQueue,x.Cropper,x.vueRouter,x.shared,x.mdEditorV3,x.zod,x.vue$1,x.screenfull,x.view))})(this,(function(x,z,Pg,me,Nc,rt,Es,Ct,Ig,$t,vt,Fg,$g,Og,Bc,Lg,_g,jc,we,Mg,Rn,zc,Rs,Uc,Vc,ur,ca,Ds,R,Ro,K,Ng,Bg,jg){"use strict";const zg=e=>e;function qc(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Ug(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hc={exports:{}},ht=Hc.exports={},Dn,Pn;function ua(){throw new Error("setTimeout has not been defined")}function da(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Dn=setTimeout:Dn=ua}catch{Dn=ua}try{typeof clearTimeout=="function"?Pn=clearTimeout:Pn=da}catch{Pn=da}})();function Wc(e){if(Dn===setTimeout)return setTimeout(e,0);if((Dn===ua||!Dn)&&setTimeout)return Dn=setTimeout,setTimeout(e,0);try{return Dn(e,0)}catch{try{return Dn.call(null,e,0)}catch{return Dn.call(this,e,0)}}}function Vg(e){if(Pn===clearTimeout)return clearTimeout(e);if((Pn===da||!Pn)&&clearTimeout)return Pn=clearTimeout,clearTimeout(e);try{return Pn(e)}catch{try{return Pn.call(null,e)}catch{return Pn.call(this,e)}}}var Hn=[],Kr=!1,xr,Ps=-1;function qg(){!Kr||!xr||(Kr=!1,xr.length?Hn=xr.concat(Hn):Ps=-1,Hn.length&&Qc())}function Qc(){if(!Kr){var e=Wc(qg);Kr=!0;for(var t=Hn.length;t;){for(xr=Hn,Hn=[];++Ps<t;)xr&&xr[Ps].run();Ps=-1,t=Hn.length}xr=null,Kr=!1,Vg(e)}}ht.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Hn.push(new Kc(e,t)),Hn.length===1&&!Kr&&Wc(Qc)};function Kc(e,t){this.fun=e,this.array=t}Kc.prototype.run=function(){this.fun.apply(null,this.array)},ht.title="browser",ht.browser=!0,ht.env={},ht.argv=[],ht.version="",ht.versions={};function Wn(){}ht.on=Wn,ht.addListener=Wn,ht.once=Wn,ht.off=Wn,ht.removeListener=Wn,ht.removeAllListeners=Wn,ht.emit=Wn,ht.prependListener=Wn,ht.prependOnceListener=Wn,ht.listeners=function(e){return[]},ht.binding=function(e){throw new Error("process.binding is not supported")},ht.cwd=function(){return"/"},ht.chdir=function(e){throw new Error("process.chdir is not supported")},ht.umask=function(){return 0};var Hg=Hc.exports;const ce=Ug(Hg);function In(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let Qe;const fa=new WeakSet;class Wg{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,fa.has(this)&&(fa.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Jc(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,tu(this),Xc(this);const t=Qe,n=gn;Qe=this,gn=!0;try{return this.fn()}finally{ce.env.NODE_ENV!=="production"&&Qe!==this&&In("Active effect was not restored correctly - this is likely a Vue internal bug."),Yc(this),Qe=t,gn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)ga(t);this.deps=this.depsTail=void 0,tu(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?fa.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ma(this)&&this.run()}get dirty(){return ma(this)}}let Gc=0,Do,Po;function Jc(e,t=!1){if(e.flags|=8,t){e.next=Po,Po=e;return}e.next=Do,Do=e}function pa(){Gc++}function ha(){if(--Gc>0)return;if(Po){let t=Po;for(Po=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Do;){let t=Do;for(Do=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function Xc(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Yc(e){let t,n=e.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),ga(r),Qg(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function ma(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Zc(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Zc(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Io)||(e.globalVersion=Io,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ma(e))))return;e.flags|=2;const t=e.dep,n=Qe,r=gn;Qe=e,gn=!0;try{Xc(e);const o=e.fn(e._value);(t.version===0||R.hasChanged(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Qe=n,gn=r,Yc(e),e.flags&=-3}}function ga(e,t=!1){const{dep:n,prevSub:r,nextSub:o}=e;if(r&&(r.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=r,e.nextSub=void 0),ce.env.NODE_ENV!=="production"&&n.subsHead===e&&(n.subsHead=o),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)ga(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Qg(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let gn=!0;const eu=[];function Gr(){eu.push(gn),gn=!1}function Jr(){const e=eu.pop();gn=e===void 0?!0:e}function tu(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Qe;Qe=void 0;try{t()}finally{Qe=n}}}let Io=0;class Kg{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Is{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,ce.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){if(!Qe||!gn||Qe===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Qe)n=this.activeLink=new Kg(Qe,this),Qe.deps?(n.prevDep=Qe.depsTail,Qe.depsTail.nextDep=n,Qe.depsTail=n):Qe.deps=Qe.depsTail=n,nu(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=Qe.depsTail,n.nextDep=void 0,Qe.depsTail.nextDep=n,Qe.depsTail=n,Qe.deps===n&&(Qe.deps=r)}return ce.env.NODE_ENV!=="production"&&Qe.onTrack&&Qe.onTrack(R.extend({effect:Qe},t)),n}trigger(t){this.version++,Io++,this.notify(t)}notify(t){pa();try{if(ce.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(R.extend({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ha()}}}function nu(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)nu(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),ce.env.NODE_ENV!=="production"&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}const Fs=new WeakMap,Ar=Symbol(ce.env.NODE_ENV!=="production"?"Object iterate":""),va=Symbol(ce.env.NODE_ENV!=="production"?"Map keys iterate":""),Fo=Symbol(ce.env.NODE_ENV!=="production"?"Array iterate":"");function Et(e,t,n){if(gn&&Qe){let r=Fs.get(e);r||Fs.set(e,r=new Map);let o=r.get(n);o||(r.set(n,o=new Is),o.map=r,o.key=n),ce.env.NODE_ENV!=="production"?o.track({target:e,type:t,key:n}):o.track()}}function dr(e,t,n,r,o,s){const i=Fs.get(e);if(!i){Io++;return}const l=u=>{u&&(ce.env.NODE_ENV!=="production"?u.trigger({target:e,type:t,key:n,newValue:r,oldValue:o,oldTarget:s}):u.trigger())};if(pa(),t==="clear")i.forEach(l);else{const u=R.isArray(e),d=u&&R.isIntegerKey(n);if(u&&n==="length"){const c=Number(r);i.forEach((p,f)=>{(f==="length"||f===Fo||!R.isSymbol(f)&&f>=c)&&l(p)})}else switch((n!==void 0||i.has(void 0))&&l(i.get(n)),d&&l(i.get(Fo)),t){case"add":u?d&&l(i.get("length")):(l(i.get(Ar)),R.isMap(e)&&l(i.get(va)));break;case"delete":u||(l(i.get(Ar)),R.isMap(e)&&l(i.get(va)));break;case"set":R.isMap(e)&&l(i.get(Ar));break}}ha()}function Gg(e,t){const n=Fs.get(e);return n&&n.get(t)}function Xr(e){const t=Be(e);return t===e?t:(Et(t,"iterate",Fo),Ot(e)?t:t.map(yn))}function $s(e){return Et(e=Be(e),"iterate",Fo),e}function fr(e,t){return vn(e)?Yr(hr(e)?yn(t):t):yn(t)}const Jg={__proto__:null,[Symbol.iterator](){return ya(this,Symbol.iterator,e=>fr(this,e))},concat(...e){return Xr(this).concat(...e.map(t=>R.isArray(t)?Xr(t):t))},entries(){return ya(this,"entries",e=>(e[1]=fr(this,e[1]),e))},every(e,t){return Qn(this,"every",e,t,void 0,arguments)},filter(e,t){return Qn(this,"filter",e,t,n=>n.map(r=>fr(this,r)),arguments)},find(e,t){return Qn(this,"find",e,t,n=>fr(this,n),arguments)},findIndex(e,t){return Qn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Qn(this,"findLast",e,t,n=>fr(this,n),arguments)},findLastIndex(e,t){return Qn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Qn(this,"forEach",e,t,void 0,arguments)},includes(...e){return ba(this,"includes",e)},indexOf(...e){return ba(this,"indexOf",e)},join(e){return Xr(this).join(e)},lastIndexOf(...e){return ba(this,"lastIndexOf",e)},map(e,t){return Qn(this,"map",e,t,void 0,arguments)},pop(){return $o(this,"pop")},push(...e){return $o(this,"push",e)},reduce(e,...t){return ru(this,"reduce",e,t)},reduceRight(e,...t){return ru(this,"reduceRight",e,t)},shift(){return $o(this,"shift")},some(e,t){return Qn(this,"some",e,t,void 0,arguments)},splice(...e){return $o(this,"splice",e)},toReversed(){return Xr(this).toReversed()},toSorted(e){return Xr(this).toSorted(e)},toSpliced(...e){return Xr(this).toSpliced(...e)},unshift(...e){return $o(this,"unshift",e)},values(){return ya(this,"values",e=>fr(this,e))}};function ya(e,t,n){const r=$s(e),o=r[t]();return r!==e&&!Ot(e)&&(o._next=o.next,o.next=()=>{const s=o._next();return s.done||(s.value=n(s.value)),s}),o}const Xg=Array.prototype;function Qn(e,t,n,r,o,s){const i=$s(e),l=i!==e&&!Ot(e),u=i[t];if(u!==Xg[t]){const p=u.apply(e,s);return l?yn(p):p}let d=n;i!==e&&(l?d=function(p,f){return n.call(this,fr(e,p),f,e)}:n.length>2&&(d=function(p,f){return n.call(this,p,f,e)}));const c=u.call(i,d,r);return l&&o?o(c):c}function ru(e,t,n,r){const o=$s(e);let s=n;return o!==e&&(Ot(e)?n.length>3&&(s=function(i,l,u){return n.call(this,i,l,u,e)}):s=function(i,l,u){return n.call(this,i,fr(e,l),u,e)}),o[t](s,...r)}function ba(e,t,n){const r=Be(e);Et(r,"iterate",Fo);const o=r[t](...n);return(o===-1||o===!1)&&Oo(n[0])?(n[0]=Be(n[0]),r[t](...n)):o}function $o(e,t,n=[]){Gr(),pa();const r=Be(e)[t].apply(e,n);return ha(),Jr(),r}const Yg=R.makeMap("__proto__,__v_isRef,__isVue"),ou=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(R.isSymbol));function Zg(e){R.isSymbol(e)||(e=String(e));const t=Be(this);return Et(t,"has",e),t.hasOwnProperty(e)}class su{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return s;if(n==="__v_raw")return r===(o?s?uu:cu:s?cv:lu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=R.isArray(t);if(!o){let u;if(i&&(u=Jg[n]))return u;if(n==="hasOwnProperty")return Zg}const l=Reflect.get(t,n,ft(t)?t:r);if((R.isSymbol(n)?ou.has(n):Yg(n))||(o||Et(t,"get",n),s))return l;if(ft(l)){const u=i&&R.isIntegerKey(n)?l:l.value;return o&&R.isObject(u)?pr(u):u}return R.isObject(l)?o?pr(l):Ta(l):l}}class ev extends su{constructor(t=!1){super(!1,t)}set(t,n,r,o){let s=t[n];const i=R.isArray(t)&&R.isIntegerKey(n);if(!this._isShallow){const d=vn(s);if(!Ot(r)&&!vn(r)&&(s=Be(s),r=Be(r)),!i&&ft(s)&&!ft(r))return d?(ce.env.NODE_ENV!=="production"&&In(`Set operation on key "${String(n)}" failed: target is readonly.`,t[n]),!0):(s.value=r,!0)}const l=i?Number(n)<t.length:R.hasOwn(t,n),u=Reflect.set(t,n,r,ft(t)?t:o);return t===Be(o)&&(l?R.hasChanged(r,s)&&dr(t,"set",n,r,s):dr(t,"add",n,r)),u}deleteProperty(t,n){const r=R.hasOwn(t,n),o=t[n],s=Reflect.deleteProperty(t,n);return s&&r&&dr(t,"delete",n,void 0,o),s}has(t,n){const r=Reflect.has(t,n);return(!R.isSymbol(n)||!ou.has(n))&&Et(t,"has",n),r}ownKeys(t){return Et(t,"iterate",R.isArray(t)?"length":Ar),Reflect.ownKeys(t)}}class iu extends su{constructor(t=!1){super(!0,t)}set(t,n){return ce.env.NODE_ENV!=="production"&&In(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return ce.env.NODE_ENV!=="production"&&In(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const tv=new ev,nv=new iu,rv=new iu(!0),wa=e=>e,Os=e=>Reflect.getPrototypeOf(e);function ov(e,t,n){return function(...r){const o=this.__v_raw,s=Be(o),i=R.isMap(s),l=e==="entries"||e===Symbol.iterator&&i,u=e==="keys"&&i,d=o[e](...r),c=n?wa:t?Yr:yn;return!t&&Et(s,"iterate",u?va:Ar),R.extend(Object.create(d),{next(){const{value:p,done:f}=d.next();return f?{value:p,done:f}:{value:l?[c(p[0]),c(p[1])]:c(p),done:f}}})}}function Ls(e){return function(...t){if(ce.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";In(`${R.capitalize(e)} operation ${n}failed: target is readonly.`,Be(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function sv(e,t){const n={get(o){const s=this.__v_raw,i=Be(s),l=Be(o);e||(R.hasChanged(o,l)&&Et(i,"get",o),Et(i,"get",l));const{has:u}=Os(i),d=t?wa:e?Yr:yn;if(u.call(i,o))return d(s.get(o));if(u.call(i,l))return d(s.get(l));s!==i&&s.get(o)},get size(){const o=this.__v_raw;return!e&&Et(Be(o),"iterate",Ar),o.size},has(o){const s=this.__v_raw,i=Be(s),l=Be(o);return e||(R.hasChanged(o,l)&&Et(i,"has",o),Et(i,"has",l)),o===l?s.has(o):s.has(o)||s.has(l)},forEach(o,s){const i=this,l=i.__v_raw,u=Be(l),d=t?wa:e?Yr:yn;return!e&&Et(u,"iterate",Ar),l.forEach((c,p)=>o.call(s,d(c),d(p),i))}};return R.extend(n,e?{add:Ls("add"),set:Ls("set"),delete:Ls("delete"),clear:Ls("clear")}:{add(o){!t&&!Ot(o)&&!vn(o)&&(o=Be(o));const s=Be(this);return Os(s).has.call(s,o)||(s.add(o),dr(s,"add",o,o)),this},set(o,s){!t&&!Ot(s)&&!vn(s)&&(s=Be(s));const i=Be(this),{has:l,get:u}=Os(i);let d=l.call(i,o);d?ce.env.NODE_ENV!=="production"&&au(i,l,o):(o=Be(o),d=l.call(i,o));const c=u.call(i,o);return i.set(o,s),d?R.hasChanged(s,c)&&dr(i,"set",o,s,c):dr(i,"add",o,s),this},delete(o){const s=Be(this),{has:i,get:l}=Os(s);let u=i.call(s,o);u?ce.env.NODE_ENV!=="production"&&au(s,i,o):(o=Be(o),u=i.call(s,o));const d=l?l.call(s,o):void 0,c=s.delete(o);return u&&dr(s,"delete",o,void 0,d),c},clear(){const o=Be(this),s=o.size!==0,i=ce.env.NODE_ENV!=="production"?R.isMap(o)?new Map(o):new Set(o):void 0,l=o.clear();return s&&dr(o,"clear",void 0,void 0,i),l}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=ov(o,e,t)}),n}function Sa(e,t){const n=sv(e,t);return(r,o,s)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?r:Reflect.get(R.hasOwn(n,o)&&o in r?n:r,o,s)}const iv={get:Sa(!1,!1)},av={get:Sa(!0,!1)},lv={get:Sa(!0,!0)};function au(e,t,n){const r=Be(n);if(r!==n&&t.call(e,r)){const o=R.toRawType(e);In(`Reactive ${o} contains both the raw and reactive versions of the same object${o==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const lu=new WeakMap,cv=new WeakMap,cu=new WeakMap,uu=new WeakMap;function uv(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function dv(e){return e.__v_skip||!Object.isExtensible(e)?0:uv(R.toRawType(e))}function Ta(e){return vn(e)?e:ka(e,!1,tv,iv,lu)}function pr(e){return ka(e,!0,nv,av,cu)}function _s(e){return ka(e,!0,rv,lv,uu)}function ka(e,t,n,r,o){if(!R.isObject(e))return ce.env.NODE_ENV!=="production"&&In(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=dv(e);if(s===0)return e;const i=o.get(e);if(i)return i;const l=new Proxy(e,s===2?r:n);return o.set(e,l),l}function hr(e){return vn(e)?hr(e.__v_raw):!!(e&&e.__v_isReactive)}function vn(e){return!!(e&&e.__v_isReadonly)}function Ot(e){return!!(e&&e.__v_isShallow)}function Oo(e){return e?!!e.__v_raw:!1}function Be(e){const t=e&&e.__v_raw;return t?Be(t):e}function du(e){return!R.hasOwn(e,"__v_skip")&&Object.isExtensible(e)&&R.def(e,"__v_skip",!0),e}const yn=e=>R.isObject(e)?Ta(e):e,Yr=e=>R.isObject(e)?pr(e):e;function ft(e){return e?e.__v_isRef===!0:!1}function W(e){return fu(e,!1)}function fv(e){return fu(e,!0)}function fu(e,t){return ft(e)?e:new pv(e,t)}class pv{constructor(t,n){this.dep=new Is,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Be(t),this._value=n?t:yn(t),this.__v_isShallow=n}get value(){return ce.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Ot(t)||vn(t);t=r?t:Be(t),R.hasChanged(t,n)&&(this._rawValue=t,this._value=r?t:yn(t),ce.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:n}):this.dep.trigger())}}function a(e){return ft(e)?e.value:e}const hv={get:(e,t,n)=>t==="__v_raw"?e:a(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return ft(o)&&!ft(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function mv(e){return hr(e)?e:new Proxy(e,hv)}class gv{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Is,{get:r,set:o}=t(n.track.bind(n),n.trigger.bind(n));this._get=r,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function vv(e){return new gv(e)}class yv{constructor(t,n,r){this._object=t,this._key=n,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0,this._raw=Be(t);let o=!0,s=t;if(!R.isArray(t)||!R.isIntegerKey(String(n)))do o=!Oo(s)||Ot(s);while(o&&(s=s.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=a(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&ft(this._raw[this._key])){const n=this._object[this._key];if(ft(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return Gg(this._raw,this._key)}}class bv{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function wv(e,t,n){return ft(e)?e:R.isFunction(e)?new bv(e):R.isObject(e)&&arguments.length>1?Sv(e,t,n):W(e)}function Sv(e,t,n){return new yv(e,t,n)}class Tv{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Is(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Io-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Qe!==this)return Jc(this,!0),!0;ce.env.NODE_ENV}get value(){const t=ce.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return Zc(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter?this.setter(t):ce.env.NODE_ENV!=="production"&&In("Write operation failed: computed value is readonly")}}function kv(e,t,n=!1){let r,o;R.isFunction(e)?r=e:(r=e.get,o=e.set);const s=new Tv(r,o,n);return ce.env.NODE_ENV,s}const Ms={},Ns=new WeakMap;let Er;function Cv(e,t=!1,n=Er){if(n){let r=Ns.get(n);r||Ns.set(n,r=[]),r.push(e)}else ce.env.NODE_ENV!=="production"&&!t&&In("onWatcherCleanup() was called when there was no active watcher to associate with.")}function xv(e,t,n=R.EMPTY_OBJ){const{immediate:r,deep:o,once:s,scheduler:i,augmentJob:l,call:u}=n,d=y=>{(n.onWarn||In)("Invalid watch source: ",y,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},c=y=>o?y:Ot(y)||o===!1||o===0?Kn(y,1):Kn(y);let p,f,h,g,m=!1,w=!1;if(ft(e)?(f=()=>e.value,m=Ot(e)):hr(e)?(f=()=>c(e),m=!0):R.isArray(e)?(w=!0,m=e.some(y=>hr(y)||Ot(y)),f=()=>e.map(y=>{if(ft(y))return y.value;if(hr(y))return c(y);if(R.isFunction(y))return u?u(y,2):y();ce.env.NODE_ENV!=="production"&&d(y)})):R.isFunction(e)?t?f=u?()=>u(e,2):e:f=()=>{if(h){Gr();try{h()}finally{Jr()}}const y=Er;Er=p;try{return u?u(e,3,[g]):e(g)}finally{Er=y}}:(f=R.NOOP,ce.env.NODE_ENV!=="production"&&d(e)),t&&o){const y=f,E=o===!0?1/0:o;f=()=>Kn(y(),E)}const T=()=>{p.stop()};if(s&&t){const y=t;t=(...E)=>{y(...E),T()}}let k=w?new Array(e.length).fill(Ms):Ms;const S=y=>{if(!(!(p.flags&1)||!p.dirty&&!y))if(t){const E=p.run();if(o||m||(w?E.some((D,$)=>R.hasChanged(D,k[$])):R.hasChanged(E,k))){h&&h();const D=Er;Er=p;try{const $=[E,k===Ms?void 0:w&&k[0]===Ms?[]:k,g];k=E,u?u(t,3,$):t(...$)}finally{Er=D}}}else p.run()};return l&&l(S),p=new Wg(f),p.scheduler=i?()=>i(S,!1):S,g=y=>Cv(y,!1,p),h=p.onStop=()=>{const y=Ns.get(p);if(y){if(u)u(y,4);else for(const E of y)E();Ns.delete(p)}},ce.env.NODE_ENV!=="production"&&(p.onTrack=n.onTrack,p.onTrigger=n.onTrigger),t?r?S(!0):k=p.run():i?i(S.bind(null,!0),!0):p.run(),T.pause=p.pause.bind(p),T.resume=p.resume.bind(p),T.stop=T,T}function Kn(e,t=1/0,n){if(t<=0||!R.isObject(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ft(e))Kn(e.value,t,n);else if(R.isArray(e))for(let r=0;r<e.length;r++)Kn(e[r],t,n);else if(R.isSet(e)||R.isMap(e))e.forEach(r=>{Kn(r,t,n)});else if(R.isPlainObject(e)){for(const r in e)Kn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Kn(e[r],t,n)}return e}const Rr=[];function Av(e){Rr.push(e)}function Ev(){Rr.pop()}let Ca=!1;function _e(e,...t){if(Ca)return;Ca=!0,Gr();const n=Rr.length?Rr[Rr.length-1].component:null,r=n&&n.appContext.config.warnHandler,o=Rv();if(r)Bs(r,n,11,[e+t.map(s=>{var i,l;return(l=(i=s.toString)==null?void 0:i.call(s))!=null?l:JSON.stringify(s)}).join(""),n&&n.proxy,o.map(({vnode:s})=>`at <${Yu(n,s.type)}>`).join(`
2
- `),o]);else{const s=[`[Vue warn]: ${e}`,...t];o.length&&s.push(`
3
- `,...Dv(o)),console.warn(...s)}Jr(),Ca=!1}function Rv(){let e=Rr[Rr.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const r=e.component&&e.component.parent;e=r&&r.vnode}return t}function Dv(e){const t=[];return e.forEach((n,r)=>{t.push(...r===0?[]:[`
4
- `],...Pv(n))}),t}function Pv({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",r=e.component?e.component.parent==null:!1,o=` at <${Yu(e.component,e.type,r)}`,s=">"+n;return e.props?[o,...Iv(e.props),s]:[o+s]}function Iv(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(r=>{t.push(...pu(r,e[r]))}),n.length>3&&t.push(" ..."),t}function pu(e,t,n){return R.isString(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:ft(t)?(t=pu(e,Be(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):R.isFunction(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=Be(t),n?t:[`${e}=`,t])}const xa={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Bs(e,t,n,r){try{return r?e(...r):e()}catch(o){js(o,t,n)}}function Aa(e,t,n,r){if(R.isFunction(e)){const o=Bs(e,t,n,r);return o&&R.isPromise(o)&&o.catch(s=>{js(s,t,n)}),o}if(R.isArray(e)){const o=[];for(let s=0;s<e.length;s++)o.push(Aa(e[s],t,n,r));return o}else ce.env.NODE_ENV!=="production"&&_e(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function js(e,t,n,r=!0){const o=t?t.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||R.EMPTY_OBJ;if(t){let l=t.parent;const u=t.proxy,d=ce.env.NODE_ENV!=="production"?xa[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const c=l.ec;if(c){for(let p=0;p<c.length;p++)if(c[p](e,u,d)===!1)return}l=l.parent}if(s){Gr(),Bs(s,null,10,[e,u,d]),Jr();return}}Fv(e,n,o,r,i)}function Fv(e,t,n,r=!0,o=!1){if(ce.env.NODE_ENV!=="production"){const s=xa[t];if(n&&Av(n),_e(`Unhandled error${s?` during execution of ${s}`:""}`),n&&Ev(),r)throw e;console.error(e)}else{if(o)throw e;console.error(e)}}const tn=[];let Gn=-1;const Zr=[];let mr=null,eo=0;const hu=Promise.resolve();let zs=null;const $v=100;function xt(e){const t=zs||hu;return e?t.then(this?e.bind(this):e):t}function Ov(e){let t=Gn+1,n=tn.length;for(;t<n;){const r=t+n>>>1,o=tn[r],s=Lo(o);s<e||s===e&&o.flags&2?t=r+1:n=r}return t}function Ea(e){if(!(e.flags&1)){const t=Lo(e),n=tn[tn.length-1];!n||!(e.flags&2)&&t>=Lo(n)?tn.push(e):tn.splice(Ov(t),0,e),e.flags|=1,mu()}}function mu(){zs||(zs=hu.then(vu))}function gu(e){R.isArray(e)?Zr.push(...e):mr&&e.id===-1?mr.splice(eo+1,0,e):e.flags&1||(Zr.push(e),e.flags|=1),mu()}function Lv(e){if(Zr.length){const t=[...new Set(Zr)].sort((n,r)=>Lo(n)-Lo(r));if(Zr.length=0,mr){mr.push(...t);return}for(mr=t,ce.env.NODE_ENV!=="production"&&(e=e||new Map),eo=0;eo<mr.length;eo++){const n=mr[eo];ce.env.NODE_ENV!=="production"&&yu(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}mr=null,eo=0}}const Lo=e=>e.id==null?e.flags&2?-1:1/0:e.id;function vu(e){ce.env.NODE_ENV!=="production"&&(e=e||new Map);const t=ce.env.NODE_ENV!=="production"?n=>yu(e,n):R.NOOP;try{for(Gn=0;Gn<tn.length;Gn++){const n=tn[Gn];if(n&&!(n.flags&8)){if(ce.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),Bs(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;Gn<tn.length;Gn++){const n=tn[Gn];n&&(n.flags&=-2)}Gn=-1,tn.length=0,Lv(e),zs=null,(tn.length||Zr.length)&&vu(e)}}function yu(e,t){const n=e.get(t)||0;if(n>$v){const r=t.i,o=r&&ri(r.type);return js(`Maximum recursive updates exceeded${o?` in component <${o}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,n+1),!1}let _o=!1;const Ra=new Map;ce.env.NODE_ENV!=="production"&&(R.getGlobalThis().__VUE_HMR_RUNTIME__={createRecord:Da(_v),rerender:Da(Mv),reload:Da(Nv)});const Us=new Map;function _v(e,t){return Us.has(e)?!1:(Us.set(e,{initialDef:Vs(t),instances:new Set}),!0)}function Vs(e){return Zu(e)?e.__vccOpts:e}function Mv(e,t){const n=Us.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(r=>{t&&(r.render=t,Vs(r.type).render=t),r.renderCache=[],_o=!0,r.job.flags&8||r.update(),_o=!1}))}function Nv(e,t){const n=Us.get(e);if(!n)return;t=Vs(t),bu(n.initialDef,t);const r=[...n.instances];for(let o=0;o<r.length;o++){const s=r[o],i=Vs(s.type);let l=Ra.get(i);l||(i!==n.initialDef&&bu(i,t),Ra.set(i,l=new Set)),l.add(s),s.appContext.propsCache.delete(s.type),s.appContext.emitsCache.delete(s.type),s.appContext.optionsCache.delete(s.type),s.ceReload?(l.add(s),s.ceReload(t.styles),l.delete(s)):s.parent?Ea(()=>{s.job.flags&8||(_o=!0,s.parent.update(),_o=!1,l.delete(s))}):s.appContext.reload?s.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),s.root.ce&&s!==s.root&&s.root.ce._removeChildStyle(i)}gu(()=>{Ra.clear()})}function bu(e,t){R.extend(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function Da(e){return(t,n)=>{try{return e(t,n)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let gr,Mo=[],Pa=!1;function Bv(e,...t){gr?gr.emit(e,...t):Pa||Mo.push({event:e,args:t})}function wu(e,t){var n,r;gr=e,gr?(gr.enabled=!0,Mo.forEach(({event:o,args:s})=>gr.emit(o,...s)),Mo=[]):typeof window<"u"&&window.HTMLElement&&!((r=(n=window.navigator)==null?void 0:n.userAgent)!=null&&r.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(s=>{wu(s,t)}),setTimeout(()=>{gr||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Pa=!0,Mo=[])},3e3)):(Pa=!0,Mo=[])}const jv=zv("component:updated");function zv(e){return t=>{Bv(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let Rt=null,Su=null;function Tu(e){const t=Rt;return Rt=e,Su=e&&e.type.__scopeId||null,t}function Z(e,t=Rt,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&Zs(-1);const s=Tu(t);let i;try{i=e(...o)}finally{Tu(s),r._d&&Zs(1)}return ce.env.NODE_ENV!=="production"&&jv(t),i};return r._n=!0,r._c=!0,r._d=!0,r}function je(e,t){if(Rt===null)return ce.env.NODE_ENV!=="production"&&_e("withDirectives can only be used inside render functions."),e;const n=Xu(Rt),r=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[s,i,l,u=R.EMPTY_OBJ]=t[o];s&&(R.isFunction(s)&&(s={mounted:s,updated:s}),s.deep&&Kn(i),r.push({dir:s,instance:n,value:i,oldValue:void 0,arg:l,modifiers:u}))}return e}function Dr(e,t){if(ce.env.NODE_ENV!=="production"&&(!Nt||Nt.isMounted)&&_e("provide() can only be used inside setup()."),Nt){let n=Nt.provides;const r=Nt.parent&&Nt.parent.provides;r===n&&(n=Nt.provides=Object.create(r)),n[e]=t}}function Jn(e,t,n=!1){const r=ni();if(r||cy){let o=r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&R.isFunction(t)?t.call(r&&r.proxy):t;ce.env.NODE_ENV!=="production"&&_e(`injection "${String(e)}" not found.`)}else ce.env.NODE_ENV!=="production"&&_e("inject() can only be used inside setup() or functional components.")}const Uv=Symbol.for("v-scx"),Vv=()=>{{const e=Jn(Uv);return e||ce.env.NODE_ENV!=="production"&&_e("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function Ue(e,t,n){return ce.env.NODE_ENV!=="production"&&!R.isFunction(t)&&_e("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),ku(e,t,n)}function ku(e,t,n=R.EMPTY_OBJ){const{immediate:r,deep:o,flush:s,once:i}=n;ce.env.NODE_ENV!=="production"&&!t&&(r!==void 0&&_e('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&_e('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&_e('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const l=R.extend({},n);ce.env.NODE_ENV!=="production"&&(l.onWarn=_e);const u=t&&r||!t&&s!=="post";let d;if(ro){if(s==="sync"){const h=Vv();d=h.__watcherHandles||(h.__watcherHandles=[])}else if(!u){const h=()=>{};return h.stop=R.NOOP,h.resume=R.NOOP,h.pause=R.NOOP,h}}const c=Nt;l.call=(h,g,m)=>Aa(h,c,g,m);let p=!1;s==="post"?l.scheduler=h=>{Na(h,c&&c.suspense)}:s!=="sync"&&(p=!0,l.scheduler=(h,g)=>{g?h():Ea(h)}),l.augmentJob=h=>{t&&(h.flags|=4),p&&(h.flags|=2,c&&(h.id=c.uid,h.i=c))};const f=xv(e,t,l);return ro&&(d?d.push(f):u&&f()),f}function qv(e,t,n){const r=this.proxy,o=R.isString(e)?e.includes(".")?Hv(r,e):()=>r[e]:e.bind(r,r);let s;R.isFunction(t)?s=t:(s=t.handler,n=t);const i=Gu(this),l=ku(o,s.bind(r),n);return i(),l}function Hv(e,t){const n=t.split(".");return()=>{let r=e;for(let o=0;o<n.length&&r;o++)r=r[n[o]];return r}}const Wv=Symbol("_vte"),Qv=e=>e.__isTeleport,Pr=e=>e&&(e.disabled||e.disabled===""),Cu=e=>e&&(e.defer||e.defer===""),xu=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Au=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ia=(e,t)=>{const n=e&&e.to;if(R.isString(n))if(t){const r=t(n);return ce.env.NODE_ENV!=="production"&&!r&&!Pr(e)&&_e(`Failed to locate Teleport target with selector "${n}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`),r}else return ce.env.NODE_ENV!=="production"&&_e("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"),null;else return ce.env.NODE_ENV!=="production"&&!n&&!Pr(e)&&_e(`Invalid Teleport target: ${n}`),n},Eu={name:"Teleport",__isTeleport:!0,process(e,t,n,r,o,s,i,l,u,d){const{mc:c,pc:p,pbc:f,o:{insert:h,querySelector:g,createText:m,createComment:w}}=d,T=Pr(t.props);let{shapeFlag:k,children:S,dynamicChildren:y}=t;if(ce.env.NODE_ENV!=="production"&&_o&&(u=!1,y=null),e==null){const E=t.el=ce.env.NODE_ENV!=="production"?w("teleport start"):m(""),D=t.anchor=ce.env.NODE_ENV!=="production"?w("teleport end"):m("");h(E,n,r),h(D,n,r);const $=(L,V)=>{k&16&&c(S,L,V,o,s,i,l,u)},_=()=>{const L=t.target=Ia(t.props,g),V=$a(L,t,m,h);L?(i!=="svg"&&xu(L)?i="svg":i!=="mathml"&&Au(L)&&(i="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(L),T||($(L,V),Hs(t,!1))):ce.env.NODE_ENV!=="production"&&!T&&_e("Invalid Teleport target on mount:",L,`(${typeof L})`)};T&&($(n,D),Hs(t,!0)),Cu(t.props)?(t.el.__isMounted=!1,Na(()=>{_(),delete t.el.__isMounted},s)):_()}else{if(Cu(t.props)&&e.el.__isMounted===!1){Na(()=>{Eu.process(e,t,n,r,o,s,i,l,u,d)},s);return}t.el=e.el,t.targetStart=e.targetStart;const E=t.anchor=e.anchor,D=t.target=e.target,$=t.targetAnchor=e.targetAnchor,_=Pr(e.props),L=_?n:D,V=_?E:$;if(i==="svg"||xu(D)?i="svg":(i==="mathml"||Au(D))&&(i="mathml"),y?(f(e.dynamicChildren,y,L,o,s,i,l),zu(e,t,ce.env.NODE_ENV==="production")):u||p(e,t,L,V,o,s,i,l,!1),T)_?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):qs(t,n,E,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const te=t.target=Ia(t.props,g);te?qs(t,te,null,d,0):ce.env.NODE_ENV!=="production"&&_e("Invalid Teleport target on update:",D,`(${typeof D})`)}else _&&qs(t,D,$,d,1);Hs(t,T)}},remove(e,t,n,{um:r,o:{remove:o}},s){const{shapeFlag:i,children:l,anchor:u,targetStart:d,targetAnchor:c,target:p,props:f}=e;if(p&&(o(d),o(c)),s&&o(u),i&16){const h=s||!Pr(f);for(let g=0;g<l.length;g++){const m=l[g];r(m,t,n,h,!!m.dynamicChildren)}}},move:qs,hydrate:Kv};function qs(e,t,n,{o:{insert:r},m:o},s=2){s===0&&r(e.targetAnchor,t,n);const{el:i,anchor:l,shapeFlag:u,children:d,props:c}=e,p=s===2;if(p&&r(i,t,n),(!p||Pr(c))&&u&16)for(let f=0;f<d.length;f++)o(d[f],t,n,2);p&&r(l,t,n)}function Kv(e,t,n,r,o,s,{o:{nextSibling:i,parentNode:l,querySelector:u,insert:d,createText:c}},p){function f(w,T){let k=T;for(;k;){if(k&&k.nodeType===8){if(k.data==="teleport start anchor")t.targetStart=k;else if(k.data==="teleport anchor"){t.targetAnchor=k,w._lpa=t.targetAnchor&&i(t.targetAnchor);break}}k=i(k)}}function h(w,T){T.anchor=p(i(w),T,l(w),n,r,o,s)}const g=t.target=Ia(t.props,u),m=Pr(t.props);if(g){const w=g._lpa||g.firstChild;t.shapeFlag&16&&(m?(h(e,t),f(g,w),t.targetAnchor||$a(g,t,c,d,l(e)===g?e:null)):(t.anchor=i(e),f(g,w),t.targetAnchor||$a(g,t,c,d),p(w&&i(w),t,g,n,r,o,s))),Hs(t,m)}else m&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Fa=Eu;function Hs(e,t){const n=e.ctx;if(n&&n.ut){let r,o;for(t?(r=e.el,o=e.anchor):(r=e.targetStart,o=e.targetAnchor);r&&r!==o;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function $a(e,t,n,r,o=null){const s=t.targetStart=n(""),i=t.targetAnchor=n("");return s[Wv]=i,e&&(r(s,e,o),r(i,e,o)),i}function Ru(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Ru(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ge(e,t){return R.isFunction(e)?R.extend({name:e.name},t,{setup:e}):e}function Gv(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const Jv=new WeakSet;function nn(e){const t=ni(),n=fv(null);if(t){const o=t.refs===R.EMPTY_OBJ?t.refs={}:t.refs;ce.env.NODE_ENV!=="production"&&Xv(o,e)?_e(`useTemplateRef('${e}') already exists.`):Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:s=>n.value=s})}else ce.env.NODE_ENV!=="production"&&_e("useTemplateRef() is called when there is no active component instance to be associated with.");const r=ce.env.NODE_ENV!=="production"?pr(n):n;return ce.env.NODE_ENV!=="production"&&Jv.add(r),r}function Xv(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Du=e=>e.nodeType===8;R.getGlobalThis().requestIdleCallback,R.getGlobalThis().cancelIdleCallback;function Yv(e,t){if(Du(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(Du(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const Zv=e=>!!e.type.__asyncLoader;function ey(e){R.isFunction(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:o=200,hydrate:s,timeout:i,suspensible:l=!0,onError:u}=e;let d=null,c,p=0;const f=()=>(p++,d=null,h()),h=()=>{let g;return d||(g=d=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),u)return new Promise((w,T)=>{u(m,()=>w(f()),()=>T(m),p+1)});throw m}).then(m=>{if(g!==d&&d)return d;if(ce.env.NODE_ENV!=="production"&&!m&&_e("Async component loader resolved to undefined. If you are using retry(), make sure to return its return value."),m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),ce.env.NODE_ENV!=="production"&&m&&!R.isObject(m)&&!R.isFunction(m))throw new Error(`Invalid async component load result: ${m}`);return c=m,m}))};return ge({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(g,m,w){let T=!1;(m.bu||(m.bu=[])).push(()=>T=!0);const k=()=>{if(T){ce.env.NODE_ENV!=="production"&&_e(`Skipping lazy hydration for component '${ri(c)||c.__file}': it was updated before lazy hydration performed.`);return}w()},S=s?()=>{const y=s(k,E=>Yv(g,E));y&&(m.bum||(m.bum=[])).push(y)}:k;c?S():h().then(()=>!m.isUnmounted&&S())},get __asyncResolved(){return c},setup(){const g=Nt;if(Gv(g),c)return()=>Ws(c,g);const m=S=>{d=null,js(S,g,13,!r)};if(l&&g.suspense||ro)return h().then(S=>()=>Ws(S,g)).catch(S=>(m(S),()=>r?J(r,{error:S}):null));const w=W(!1),T=W(),k=W(!!o);return o&&setTimeout(()=>{k.value=!1},o),i!=null&&setTimeout(()=>{if(!w.value&&!T.value){const S=new Error(`Async component timed out after ${i}ms.`);m(S),T.value=S}},i),h().then(()=>{w.value=!0,g.parent&&ty(g.parent.vnode)&&g.parent.update()}).catch(S=>{m(S),T.value=S}),()=>{if(w.value&&c)return Ws(c,g);if(T.value&&r)return J(r,{error:T.value});if(n&&!k.value)return Ws(n,g)}}})}function Ws(e,t){const{ref:n,props:r,children:o,ce:s}=t.vnode,i=J(e,r,o);return i.ref=n,i.ce=s,delete t.vnode.ce,i}const ty=e=>e.type.__isKeepAlive;function ny(e,t,n=Nt,r=!1){if(n){const o=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...i)=>{Gr();const l=Gu(n),u=Aa(t,n,e,i);return l(),Jr(),u});return r?o.unshift(s):o.push(s),s}else if(ce.env.NODE_ENV!=="production"){const o=R.toHandlerKey(xa[e].replace(/ hook$/,""));_e(`${o} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const Oa=e=>(t,n=Nt)=>{(!ro||e==="sp")&&ny(e,(...r)=>t(...r),n)},yt=Oa("m"),bn=Oa("bum"),Qs=Oa("um"),Ks="components",ry="directives";function oe(e,t){return La(Ks,e,!0,t)||e}const Pu=Symbol.for("v-ndc");function rn(e){return R.isString(e)?La(Ks,e,!1)||e:e||Pu}function Lt(e){return La(ry,e)}function La(e,t,n=!0,r=!1){const o=Rt||Nt;if(o){const s=o.type;if(e===Ks){const l=ri(s,!1);if(l&&(l===t||l===R.camelize(t)||l===R.capitalize(R.camelize(t))))return s}const i=Iu(o[e]||s[e],t)||Iu(o.appContext[e],t);if(!i&&r)return s;if(ce.env.NODE_ENV!=="production"&&n&&!i){const l=e===Ks?`
5
- If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`:"";_e(`Failed to resolve ${e.slice(0,-1)}: ${t}${l}`)}return i}else ce.env.NODE_ENV!=="production"&&_e(`resolve${R.capitalize(e.slice(0,-1))} can only be used in render() or setup().`)}function Iu(e,t){return e&&(e[t]||e[R.camelize(t)]||e[R.capitalize(R.camelize(t))])}function Ye(e,t,n,r){let o;const s=n,i=R.isArray(e);if(i||R.isString(e)){const l=i&&hr(e);let u=!1,d=!1;l&&(u=!Ot(e),d=vn(e),e=$s(e)),o=new Array(e.length);for(let c=0,p=e.length;c<p;c++)o[c]=t(u?d?Yr(yn(e[c])):yn(e[c]):e[c],c,void 0,s)}else if(typeof e=="number"){ce.env.NODE_ENV!=="production"&&!Number.isInteger(e)&&_e(`The v-for range expect an integer value but got ${e}.`),o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,s)}else if(R.isObject(e))if(e[Symbol.iterator])o=Array.from(e,(l,u)=>t(l,u,void 0,s));else{const l=Object.keys(e);o=new Array(l.length);for(let u=0,d=l.length;u<d;u++){const c=l[u];o[u]=t(e[c],c,u,s)}}else o=[];return o}function Fu(e,t){for(let n=0;n<t.length;n++){const r=t[n];if(R.isArray(r))for(let o=0;o<r.length;o++)e[r[o].name]=r[o].fn;else r&&(e[r.name]=r.key?(...o)=>{const s=r.fn(...o);return s&&(s.key=r.key),s}:r.fn)}return e}function Ce(e,t,n={},r,o){if(Rt.ce||Rt.parent&&Zv(Rt.parent)&&Rt.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),I(),re(Ae,null,[J("slot",n,r&&r())],d?-2:64)}let s=e[t];ce.env.NODE_ENV!=="production"&&s&&s.length>1&&(_e("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template."),s=()=>[]),s&&s._c&&(s._d=!1),I();const i=s&&$u(s(n)),l=n.key||i&&i.key,u=re(Ae,{key:(l&&!R.isSymbol(l)?l:`_${t}`)+(!i&&r?"_fb":"")},i||(r?r():[]),i&&e._===1?64:-2);return!o&&u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),s&&s._c&&(s._d=!0),u}function $u(e){return e.some(t=>ei(t)?!(t.type===to||t.type===Ae&&!$u(t.children)):!0)?e:null}function Gs(e,t){const n={};if(ce.env.NODE_ENV!=="production"&&!R.isObject(e))return _e("v-on with no argument expects an object value."),n;for(const r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:R.toHandlerKey(r)]=e[r];return n}const _a=e=>e?my(e)?Xu(e):_a(e.parent):null,Ma=R.extend(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>ce.env.NODE_ENV!=="production"?_s(e.props):e.props,$attrs:e=>ce.env.NODE_ENV!=="production"?_s(e.attrs):e.attrs,$slots:e=>ce.env.NODE_ENV!=="production"?_s(e.slots):e.slots,$refs:e=>ce.env.NODE_ENV!=="production"?_s(e.refs):e.refs,$parent:e=>_a(e.parent),$root:e=>_a(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>sy(e),$forceUpdate:e=>e.f||(e.f=()=>{Ea(e.update)}),$nextTick:e=>e.n||(e.n=xt.bind(e.proxy)),$watch:e=>qv.bind(e)}),oy={};ce.env.NODE_ENV!=="production"&&(oy.ownKeys=e=>(_e("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));function Ou(){return Lu("useSlots").slots}function Js(){return Lu("useAttrs").attrs}function Lu(e){const t=ni();return ce.env.NODE_ENV!=="production"&&!t&&_e(`${e}() called without active instance.`),t.setupContext||(t.setupContext=vy(t))}function _u(e){return R.isArray(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function sy(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:s,config:{optionMergeStrategies:i}}=e.appContext,l=s.get(t);let u;return l?u=l:!o.length&&!n&&!r?u=t:(u={},o.length&&o.forEach(d=>Xs(u,d,i,!0)),Xs(u,t,i)),R.isObject(t)&&s.set(t,u),u}function Xs(e,t,n,r=!1){const{mixins:o,extends:s}=t;s&&Xs(e,s,n,!0),o&&o.forEach(i=>Xs(e,i,n,!0));for(const i in t)if(r&&i==="expose")ce.env.NODE_ENV!=="production"&&_e('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const l=iy[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const iy={data:Mu,props:Bu,emits:Bu,methods:No,computed:No,beforeCreate:Mt,created:Mt,beforeMount:Mt,mounted:Mt,beforeUpdate:Mt,updated:Mt,beforeDestroy:Mt,beforeUnmount:Mt,destroyed:Mt,unmounted:Mt,activated:Mt,deactivated:Mt,errorCaptured:Mt,serverPrefetch:Mt,components:No,directives:No,watch:ly,provide:Mu,inject:ay};function Mu(e,t){return t?e?function(){return R.extend(R.isFunction(e)?e.call(this,this):e,R.isFunction(t)?t.call(this,this):t)}:t:e}function ay(e,t){return No(Nu(e),Nu(t))}function Nu(e){if(R.isArray(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Mt(e,t){return e?[...new Set([].concat(e,t))]:t}function No(e,t){return e?R.extend(Object.create(null),e,t):t}function Bu(e,t){return e?R.isArray(e)&&R.isArray(t)?[...new Set([...e,...t])]:R.extend(Object.create(null),_u(e),_u(t??{})):t}function ly(e,t){if(!e)return t;if(!t)return e;const n=R.extend(Object.create(null),e);for(const r in t)n[r]=Mt(e[r],t[r]);return n}let cy=null;const uy={},ju=e=>Object.getPrototypeOf(e)===uy,Na=fy;function zu(e,t,n=!1){const r=e.children,o=t.children;if(R.isArray(r)&&R.isArray(o))for(let s=0;s<r.length;s++){const i=r[s];let l=o[s];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[s]=Ku(o[s]),l.el=i.el),!n&&l.patchFlag!==-2&&zu(i,l)),l.type===Uu&&(l.patchFlag===-1&&(l=o[s]=Ku(l)),l.el=i.el),l.type===to&&!l.el&&(l.el=i.el),ce.env.NODE_ENV!=="production"&&l.el&&(l.el.__vnode=l)}}const dy=e=>e.__isSuspense;function fy(e,t){t&&t.pendingBranch?R.isArray(e)?t.effects.push(...e):t.effects.push(e):gu(e)}const Ae=Symbol.for("v-fgt"),Uu=Symbol.for("v-txt"),to=Symbol.for("v-cmt"),Ys=[];let Yt=null;function I(e=!1){Ys.push(Yt=e?null:[])}function py(){Ys.pop(),Yt=Ys[Ys.length-1]||null}let Bo=1;function Zs(e,t=!1){Bo+=e,e<0&&Yt&&t&&(Yt.hasOnce=!0)}function Vu(e){return e.dynamicChildren=Bo>0?Yt||R.EMPTY_ARR:null,py(),Bo>0&&Yt&&Yt.push(e),e}function G(e,t,n,r,o,s){return Vu(Q(e,t,n,r,o,s,!0))}function re(e,t,n,r,o){return Vu(J(e,t,n,r,o,!0))}function ei(e){return e?e.__v_isVNode===!0:!1}const hy=(...e)=>Hu(...e),qu=({key:e})=>e??null,ti=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?R.isString(e)||ft(e)||R.isFunction(e)?{i:Rt,r:e,k:t,f:!!n}:e:null);function Q(e,t=null,n=null,r=0,o=null,s=e===Ae?0:1,i=!1,l=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&qu(t),ref:t&&ti(t),scopeId:Su,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Rt};return l?(Ba(u,n),s&128&&e.normalize(u)):n&&(u.shapeFlag|=R.isString(n)?8:16),ce.env.NODE_ENV!=="production"&&u.key!==u.key&&_e("VNode created with invalid key (NaN). VNode type:",u.type),Bo>0&&!i&&Yt&&(u.patchFlag>0||s&6)&&u.patchFlag!==32&&Yt.push(u),u}const J=ce.env.NODE_ENV!=="production"?hy:Hu;function Hu(e,t=null,n=null,r=0,o=null,s=!1){if((!e||e===Pu)&&(ce.env.NODE_ENV!=="production"&&!e&&_e(`Invalid vnode type when creating vnode: ${e}.`),e=to),ei(e)){const l=no(e,t,!0);return n&&Ba(l,n),Bo>0&&!s&&Yt&&(l.shapeFlag&6?Yt[Yt.indexOf(e)]=l:Yt.push(l)),l.patchFlag=-2,l}if(Zu(e)&&(e=e.__vccOpts),t){t=Wu(t);let{class:l,style:u}=t;l&&!R.isString(l)&&(t.class=R.normalizeClass(l)),R.isObject(u)&&(Oo(u)&&!R.isArray(u)&&(u=R.extend({},u)),t.style=R.normalizeStyle(u))}const i=R.isString(e)?1:dy(e)?128:Qv(e)?64:R.isObject(e)?4:R.isFunction(e)?2:0;return ce.env.NODE_ENV!=="production"&&i&4&&Oo(e)&&(e=Be(e),_e("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
6
- Component that was made reactive: `,e)),Q(e,t,n,r,o,i,s,!0)}function Wu(e){return e?Oo(e)||ju(e)?R.extend({},e):e:null}function no(e,t,n=!1,r=!1){const{props:o,ref:s,patchFlag:i,children:l,transition:u}=e,d=t?pt(o||{},t):o,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&qu(d),ref:t&&t.ref?n&&s?R.isArray(s)?s.concat(ti(t)):[s,ti(t)]:ti(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:ce.env.NODE_ENV!=="production"&&i===-1&&R.isArray(l)?l.map(Qu):l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ae?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&no(e.ssContent),ssFallback:e.ssFallback&&no(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&r&&Ru(c,u.clone(c)),c}function Qu(e){const t=no(e);return R.isArray(e.children)&&(t.children=e.children.map(Qu)),t}function ct(e=" ",t=0){return J(Uu,null,e,t)}function le(e="",t=!1){return t?(I(),re(to,null,e)):J(to,null,e)}function Ku(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:no(e)}function Ba(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(R.isArray(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),Ba(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!ju(t)?t._ctx=Rt:o===3&&Rt&&(Rt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else R.isFunction(t)?(t={default:t,_ctx:Rt},n=32):(t=String(t),r&64?(n=16,t=[ct(t)]):n=8);e.children=t,e.shapeFlag|=n}function pt(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const o in r)if(o==="class")t.class!==r.class&&(t.class=R.normalizeClass([t.class,r.class]));else if(o==="style")t.style=R.normalizeStyle([t.style,r.style]);else if(R.isOn(o)){const s=t[o],i=r[o];i&&s!==i&&!(R.isArray(s)&&s.includes(i))&&(t[o]=s?[].concat(s,i):i)}else o!==""&&(t[o]=r[o])}return t}let Nt=null;const ni=()=>Nt||Rt;let ja;{const e=R.getGlobalThis(),t=(n,r)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(r),s=>{o.length>1?o.forEach(i=>i(s)):o[0](s)}};ja=t("__VUE_INSTANCE_SETTERS__",n=>Nt=n),t("__VUE_SSR_SETTERS__",n=>ro=n)}const Gu=e=>{const t=Nt;return ja(e),e.scope.on(),()=>{e.scope.off(),ja(t)}};function my(e){return e.vnode.shapeFlag&4}let ro=!1;const Ju=ce.env.NODE_ENV!=="production"?{get(e,t){return Et(e,"get",""),e[t]},set(){return _e("setupContext.attrs is readonly."),!1},deleteProperty(){return _e("setupContext.attrs is readonly."),!1}}:{get(e,t){return Et(e,"get",""),e[t]}};function gy(e){return new Proxy(e.slots,{get(t,n){return Et(e,"get","$slots"),t[n]}})}function vy(e){const t=n=>{if(ce.env.NODE_ENV!=="production"&&(e.exposed&&_e("expose() should be called only once per setup()."),n!=null)){let r=typeof n;r==="object"&&(R.isArray(n)?r="array":ft(n)&&(r="ref")),r!=="object"&&_e(`expose() should be passed a plain object, received ${r}.`)}e.exposed=n||{}};if(ce.env.NODE_ENV!=="production"){let n,r;return Object.freeze({get attrs(){return n||(n=new Proxy(e.attrs,Ju))},get slots(){return r||(r=gy(e))},get emit(){return(o,...s)=>e.emit(o,...s)},expose:t})}else return{attrs:new Proxy(e.attrs,Ju),slots:e.slots,emit:e.emit,expose:t}}function Xu(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(mv(du(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ma)return Ma[n](e)},has(t,n){return n in t||n in Ma}})):e.proxy}const yy=/(?:^|[-_])\w/g,by=e=>e.replace(yy,t=>t.toUpperCase()).replace(/[-_]/g,"");function ri(e,t=!0){return R.isFunction(e)?e.displayName||e.name:e.name||t&&e.__name}function Yu(e,t,n=!1){let r=ri(t);if(!r&&t.__file){const o=t.__file.match(/([^/\\]+)\.\w+$/);o&&(r=o[1])}if(!r&&e){const o=s=>{for(const i in s)if(s[i]===t)return i};r=o(e.components)||e.parent&&o(e.parent.type.components)||o(e.appContext.components)}return r?by(r):n?"App":"Anonymous"}function Zu(e){return R.isFunction(e)&&"__vccOpts"in e}const A=(e,t)=>{const n=kv(e,t,ro);if(ce.env.NODE_ENV!=="production"){const r=ni();r&&r.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function za(e,t,n){try{Zs(-1);const r=arguments.length;return r===2?R.isObject(t)&&!R.isArray(t)?ei(t)?J(e,null,[t]):J(e,t):J(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ei(n)&&(n=[n]),J(e,t,n))}finally{Zs(1)}}function wy(){if(ce.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},n={style:"color:#f5222d"},r={style:"color:#eb2f96"},o={__vue_custom_formatter:!0,header(p){if(!R.isObject(p))return null;if(p.__isVue)return["div",e,"VueInstance"];if(ft(p)){Gr();const f=p.value;return Jr(),["div",{},["span",e,c(p)],"<",l(f),">"]}else{if(hr(p))return["div",{},["span",e,Ot(p)?"ShallowReactive":"Reactive"],"<",l(p),`>${vn(p)?" (readonly)":""}`];if(vn(p))return["div",{},["span",e,Ot(p)?"ShallowReadonly":"Readonly"],"<",l(p),">"]}return null},hasBody(p){return p&&p.__isVue},body(p){if(p&&p.__isVue)return["div",{},...s(p.$)]}};function s(p){const f=[];p.type.props&&p.props&&f.push(i("props",Be(p.props))),p.setupState!==R.EMPTY_OBJ&&f.push(i("setup",p.setupState)),p.data!==R.EMPTY_OBJ&&f.push(i("data",Be(p.data)));const h=u(p,"computed");h&&f.push(i("computed",h));const g=u(p,"inject");return g&&f.push(i("injected",g)),f.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:p}]]),f}function i(p,f){return f=R.extend({},f),Object.keys(f).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},p],["div",{style:"padding-left:1.25em"},...Object.keys(f).map(h=>["div",{},["span",r,h+": "],l(f[h],!1)])]]:["span",{}]}function l(p,f=!0){return typeof p=="number"?["span",t,p]:typeof p=="string"?["span",n,JSON.stringify(p)]:typeof p=="boolean"?["span",r,p]:R.isObject(p)?["object",{object:f?Be(p):p}]:["span",n,String(p)]}function u(p,f){const h=p.type;if(R.isFunction(h))return;const g={};for(const m in p.ctx)d(h,m,f)&&(g[m]=p.ctx[m]);return g}function d(p,f,h){const g=p[h];if(R.isArray(g)&&g.includes(f)||R.isObject(g)&&f in g||p.extends&&d(p.extends,f,h)||p.mixins&&p.mixins.some(m=>d(m,f,h)))return!0}function c(p){return Ot(p)?"ShallowRef":p.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(o):window.devtoolsFormatters=[o]}const ed=ce.env.NODE_ENV!=="production"?_e:R.NOOP;ce.env.NODE_ENV,ce.env.NODE_ENV;let Sy;const td=typeof window<"u"&&window.trustedTypes;if(td)try{Sy=td.createPolicy("vue",{createHTML:e=>e})}catch(e){ce.env.NODE_ENV!=="production"&&ed(`Error creating trusted types policy: ${e}`)}const nd=Symbol("_vod"),Ty=Symbol("_vsh"),rd={name:"show",beforeMount(e,{value:t},{transition:n}){e[nd]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):jo(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),jo(e,!0),r.enter(e)):r.leave(e,()=>{jo(e,!1)}):jo(e,t))},beforeUnmount(e,{value:t}){jo(e,t)}};function jo(e,t){e.style.display=t?e[nd]:"none",e[Ty]=!t}ce.env.NODE_ENV;function vr(e,t,n,r){e.addEventListener(t,n,r)}const yr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return R.isArray(t)?n=>R.invokeArrayFns(t,n):t};function ky(e){e.target.composing=!0}function od(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const on=Symbol("_assign");function sd(e,t,n){return t&&(e=e.trim()),n&&(e=R.looseToNumber(e)),e}const Ua={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e[on]=yr(o);const s=r||o.props&&o.props.type==="number";vr(e,t?"change":"input",i=>{i.target.composing||e[on](sd(e.value,n,s))}),(n||s)&&vr(e,"change",()=>{e.value=sd(e.value,n,s)}),t||(vr(e,"compositionstart",ky),vr(e,"compositionend",od),vr(e,"change",od))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:o,number:s}},i){if(e[on]=yr(i),e.composing)return;const l=(s||e.type==="number")&&!/^0\d/.test(e.value)?R.looseToNumber(e.value):e.value,u=t??"";l!==u&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||o&&e.value.trim()===u)||(e.value=u))}},Cy={deep:!0,created(e,t,n){e[on]=yr(n),vr(e,"change",()=>{const r=e._modelValue,o=oo(e),s=e.checked,i=e[on];if(R.isArray(r)){const l=R.looseIndexOf(r,o),u=l!==-1;if(s&&!u)i(r.concat(o));else if(!s&&u){const d=[...r];d.splice(l,1),i(d)}}else if(R.isSet(r)){const l=new Set(r);s?l.add(o):l.delete(o),i(l)}else i(ld(e,s))})},mounted:id,beforeUpdate(e,t,n){e[on]=yr(n),id(e,t,n)}};function id(e,{value:t,oldValue:n},r){e._modelValue=t;let o;if(R.isArray(t))o=R.looseIndexOf(t,r.props.value)>-1;else if(R.isSet(t))o=t.has(r.props.value);else{if(t===n)return;o=R.looseEqual(t,ld(e,!0))}e.checked!==o&&(e.checked=o)}const xy={created(e,{value:t},n){e.checked=R.looseEqual(t,n.props.value),e[on]=yr(n),vr(e,"change",()=>{e[on](oo(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[on]=yr(r),t!==n&&(e.checked=R.looseEqual(t,r.props.value))}},Ay={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const o=R.isSet(t);vr(e,"change",()=>{const s=Array.prototype.filter.call(e.options,i=>i.selected).map(i=>n?R.looseToNumber(oo(i)):oo(i));e[on](e.multiple?o?new Set(s):s:s[0]),e._assigning=!0,xt(()=>{e._assigning=!1})}),e[on]=yr(r)},mounted(e,{value:t}){ad(e,t)},beforeUpdate(e,t,n){e[on]=yr(n)},updated(e,{value:t}){e._assigning||ad(e,t)}};function ad(e,t){const n=e.multiple,r=R.isArray(t);if(n&&!r&&!R.isSet(t)){ce.env.NODE_ENV!=="production"&&ed(`<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(t).slice(8,-1)}.`);return}for(let o=0,s=e.options.length;o<s;o++){const i=e.options[o],l=oo(i);if(n)if(r){const u=typeof l;u==="string"||u==="number"?i.selected=t.some(d=>String(d)===String(l)):i.selected=R.looseIndexOf(t,l)>-1}else i.selected=t.has(l);else if(R.looseEqual(oo(i),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}function oo(e){return"_value"in e?e._value:e.value}function ld(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Ey={created(e,t,n){oi(e,t,n,null,"created")},mounted(e,t,n){oi(e,t,n,null,"mounted")},beforeUpdate(e,t,n,r){oi(e,t,n,r,"beforeUpdate")},updated(e,t,n,r){oi(e,t,n,r,"updated")}};function Ry(e,t){switch(e){case"SELECT":return Ay;case"TEXTAREA":return Ua;default:switch(t){case"checkbox":return Cy;case"radio":return xy;default:return Ua}}}function oi(e,t,n,r,o){const i=Ry(e.tagName,n.props&&n.props.type)[o];i&&i(e,t,n,r)}const Dy=["ctrl","shift","alt","meta"],Py={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Dy.some(n=>e[`${n}Key`]&&!t.includes(n))},wt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((o,...s)=>{for(let i=0;i<t.length;i++){const l=Py[t[i]];if(l&&l(o,t))return}return e(o,...s)}))},Iy={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},zo=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(o=>{if(!("key"in o))return;const s=R.hyphenate(o.key);if(t.some(i=>i===s||Iy[i]===s))return e(o)}))};function Fy(){wy()}ce.env.NODE_ENV!=="production"&&Fy();const Bt=()=>Pg.useAbility();function cd(e){if(e===void 0)throw new Error('cloneStateObject: cannot clone "undefined"');return JSON.parse(JSON.stringify(e))}const Uo=(e,t)=>!e||!t?!1:e.id===t.id;function $y(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Va,ud;function Oy(){if(ud)return Va;ud=1;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,s){for(var i="",l=0,u=-1,d=0,c,p=0;p<=o.length;++p){if(p<o.length)c=o.charCodeAt(p);else{if(c===47)break;c=47}if(c===47){if(!(u===p-1||d===1))if(u!==p-1&&d===2){if(i.length<2||l!==2||i.charCodeAt(i.length-1)!==46||i.charCodeAt(i.length-2)!==46){if(i.length>2){var f=i.lastIndexOf("/");if(f!==i.length-1){f===-1?(i="",l=0):(i=i.slice(0,f),l=i.length-1-i.lastIndexOf("/")),u=p,d=0;continue}}else if(i.length===2||i.length===1){i="",l=0,u=p,d=0;continue}}s&&(i.length>0?i+="/..":i="..",l=2)}else i.length>0?i+="/"+o.slice(u+1,p):i=o.slice(u+1,p),l=p-u-1;u=p,d=0}else c===46&&d!==-1?++d:d=-1}return i}function n(o,s){var i=s.dir||s.root,l=s.base||(s.name||"")+(s.ext||"");return i?i===s.root?i+l:i+o+l:l}var r={resolve:function(){for(var s="",i=!1,l,u=arguments.length-1;u>=-1&&!i;u--){var d;u>=0?d=arguments[u]:(l===void 0&&(l=ce.cwd()),d=l),e(d),d.length!==0&&(s=d+"/"+s,i=d.charCodeAt(0)===47)}return s=t(s,!i),i?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return".";var i=s.charCodeAt(0)===47,l=s.charCodeAt(s.length-1)===47;return s=t(s,!i),s.length===0&&!i&&(s="."),s.length>0&&l&&(s+="/"),i?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,i=0;i<arguments.length;++i){var l=arguments[i];e(l),l.length>0&&(s===void 0?s=l:s+="/"+l)}return s===void 0?".":r.normalize(s)},relative:function(s,i){if(e(s),e(i),s===i||(s=r.resolve(s),i=r.resolve(i),s===i))return"";for(var l=1;l<s.length&&s.charCodeAt(l)===47;++l);for(var u=s.length,d=u-l,c=1;c<i.length&&i.charCodeAt(c)===47;++c);for(var p=i.length,f=p-c,h=d<f?d:f,g=-1,m=0;m<=h;++m){if(m===h){if(f>h){if(i.charCodeAt(c+m)===47)return i.slice(c+m+1);if(m===0)return i.slice(c+m)}else d>h&&(s.charCodeAt(l+m)===47?g=m:m===0&&(g=0));break}var w=s.charCodeAt(l+m),T=i.charCodeAt(c+m);if(w!==T)break;w===47&&(g=m)}var k="";for(m=l+g+1;m<=u;++m)(m===u||s.charCodeAt(m)===47)&&(k.length===0?k+="..":k+="/..");return k.length>0?k+i.slice(c+g):(c+=g,i.charCodeAt(c)===47&&++c,i.slice(c))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return".";for(var i=s.charCodeAt(0),l=i===47,u=-1,d=!0,c=s.length-1;c>=1;--c)if(i=s.charCodeAt(c),i===47){if(!d){u=c;break}}else d=!1;return u===-1?l?"/":".":l&&u===1?"//":s.slice(0,u)},basename:function(s,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');e(s);var l=0,u=-1,d=!0,c;if(i!==void 0&&i.length>0&&i.length<=s.length){if(i.length===s.length&&i===s)return"";var p=i.length-1,f=-1;for(c=s.length-1;c>=0;--c){var h=s.charCodeAt(c);if(h===47){if(!d){l=c+1;break}}else f===-1&&(d=!1,f=c+1),p>=0&&(h===i.charCodeAt(p)?--p===-1&&(u=c):(p=-1,u=f))}return l===u?u=f:u===-1&&(u=s.length),s.slice(l,u)}else{for(c=s.length-1;c>=0;--c)if(s.charCodeAt(c)===47){if(!d){l=c+1;break}}else u===-1&&(d=!1,u=c+1);return u===-1?"":s.slice(l,u)}},extname:function(s){e(s);for(var i=-1,l=0,u=-1,d=!0,c=0,p=s.length-1;p>=0;--p){var f=s.charCodeAt(p);if(f===47){if(!d){l=p+1;break}continue}u===-1&&(d=!1,u=p+1),f===46?i===-1?i=p:c!==1&&(c=1):i!==-1&&(c=-1)}return i===-1||u===-1||c===0||c===1&&i===u-1&&i===l+1?"":s.slice(i,u)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return n("/",s)},parse:function(s){e(s);var i={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return i;var l=s.charCodeAt(0),u=l===47,d;u?(i.root="/",d=1):d=0;for(var c=-1,p=0,f=-1,h=!0,g=s.length-1,m=0;g>=d;--g){if(l=s.charCodeAt(g),l===47){if(!h){p=g+1;break}continue}f===-1&&(h=!1,f=g+1),l===46?c===-1?c=g:m!==1&&(m=1):c!==-1&&(m=-1)}return c===-1||f===-1||m===0||m===1&&c===f-1&&c===p+1?f!==-1&&(p===0&&u?i.base=i.name=s.slice(1,f):i.base=i.name=s.slice(p,f)):(p===0&&u?(i.name=s.slice(1,c),i.base=s.slice(1,f)):(i.name=s.slice(p,c),i.base=s.slice(p,f)),i.ext=s.slice(c,f)),p>0?i.dir=s.slice(0,p-1):u&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};return r.posix=r,Va=r,Va}var Ke=Oy();const qa=$y(Ke),Ly=ge({name:"SpaceMoveInfoModal",props:{modal:{type:Object,required:!0}}}),Le=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},_y=["textContent"],My=["textContent"];function Ny(e,t,n,r,o,s){return I(),G(Ae,null,[Q("p",{class:"mt-0",textContent:R.toDisplayString(e.$gettext("Moving files from one space to another is not possible. Do you want to copy instead?"))},null,8,_y),Q("p",{class:"mb-0",textContent:R.toDisplayString(e.$gettext("Note: Links and shares of the original file are not copied."))},null,8,My)],64)}const dd=Le(Ly,[["render",Ny]]),By=ge({name:"ResourceConflictModal",props:{modal:{type:Object,required:!0},resource:{type:Object,required:!0},conflictCount:{type:Number,required:!0},callbackFn:{type:Function,required:!0},suggestMerge:{type:Boolean,default:!0},separateSkipHandling:{type:Boolean,default:!1},confirmSecondaryTextOverwrite:{type:String,default:null}},setup(e){const{removeModal:t}=Je(),{$gettext:n}=me.useGettext(),r=W(!1),o=A(()=>e.conflictCount<2?"":e.separateSkipHandling?e.resource.isFolder?n("Apply to all %{count} folders",{count:e.conflictCount.toString()},!0):n("Apply to all %{count} files",{count:e.conflictCount.toString()},!0):n("Apply to all %{count} conflicts",{count:e.conflictCount.toString()},!0)),s=A(()=>e.resource.isFolder?n("Folder with name »%{name}« already exists.",{name:e.resource.name},!0):n("File with name »%{name}« already exists.",{name:e.resource.name},!0)),i=A(()=>e.confirmSecondaryTextOverwrite||n("Replace"));return{message:s,checkboxValue:r,checkboxLabel:o,confirmSecondaryText:i,onConfirm:()=>{t(e.modal.id),e.callbackFn({strategy:Sn.KEEP_BOTH,doForAllConflicts:a(r)})},onConfirmSecondary:()=>{t(e.modal.id);const c=e.suggestMerge?Sn.MERGE:Sn.REPLACE;e.callbackFn({strategy:c,doForAllConflicts:a(r)})},onCancel:()=>{t(e.modal.id),e.callbackFn({strategy:Sn.SKIP,doForAllConflicts:a(r)})}}}}),jy=["textContent"],zy={class:"my-4"},Uy={class:"flex justify-end items-center mt-4"},Vy={class:"oc-modal-body-actions-grid"};function qy(e,t,n,r,o,s){const i=oe("oc-checkbox"),l=oe("oc-button");return I(),G(Ae,null,[Q("span",{class:"inline-block mb-4",textContent:R.toDisplayString(e.message)},null,8,jy),Q("div",zy,[e.conflictCount>1?(I(),re(i,{key:0,modelValue:e.checkboxValue,"onUpdate:modelValue":t[0]||(t[0]=u=>e.checkboxValue=u),size:"medium",label:e.checkboxLabel,"aria-label":e.checkboxLabel},null,8,["modelValue","label","aria-label"])):le("",!0)]),Q("div",Uy,[Q("div",Vy,[J(l,{class:"oc-modal-body-actions-cancel ml-2",onClick:e.onCancel},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Skip")),1)]),_:1},8,["onClick"]),J(l,{class:"oc-modal-body-actions-secondary ml-2",onClick:e.onConfirmSecondary},{default:Z(()=>[ct(R.toDisplayString(e.confirmSecondaryText),1)]),_:1},8,["onClick"]),J(l,{class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:e.onConfirm},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Keep both")),1)]),_:1},8,["onClick"])])])],64)}const fd=Le(By,[["render",qy]]);class Ha{constructor(t,n){this.$gettext=t,this.$ngettext=n}async resolveAllConflicts(t,n,r){const o=[];for(const d of t){const c=Ke.join(n.path,d.name);r.some(f=>f.path===c)&&o.push({resource:d,strategy:null})}let s=0,i=!1,l=null;const u=[];for(const d of o){if(i){d.strategy=l,u.push(d);continue}const c=o.length-s,p=await this.resolveFileExists(d.resource,c);d.strategy=p.strategy,u.push(d),s+=1,p.doForAllConflicts&&(i=!0,l=p.strategy)}return u}resolveFileExists(t,n,r=!1,o=!1){const{dispatchModal:s}=Je();return new Promise(i=>{s({title:t.isFolder?this.$gettext("Folder already exists"):this.$gettext("File already exists"),hideActions:!0,customComponent:fd,customComponentAttrs:()=>({resource:t,conflictCount:n,suggestMerge:r,separateSkipHandling:o,callbackFn:l=>{i(l)}})})})}resolveDoCopyInsteadOfMoveForSpaces(){const{dispatchModal:t}=Je();return new Promise(n=>{t({title:this.$gettext("Copy here?"),customComponent:dd,confirmText:this.$gettext("Copy here"),onCancel:()=>{n(!1)},onConfirm:()=>Promise.resolve(n(!0))})})}}const wn=(e,t,n,r=1)=>{let o;return t?o=`${z.extractNameWithoutExtension({name:e,extension:t})} (${r}).${t}`:o=`${e} (${r})`,n.some(i=>i.name===o)?wn(e,t,n,r+1):o},pd=(e,t,n,r)=>e.id===n.id&&Ke.dirname(t.path)===r.path;var Sn=(e=>(e[e.SKIP=0]="SKIP",e[e.REPLACE=1]="REPLACE",e[e.KEEP_BOTH=2]="KEEP_BOTH",e[e.MERGE=3]="MERGE",e))(Sn||{}),Xn=(e=>(e[e.COPY=0]="COPY",e[e.MOVE=1]="MOVE",e))(Xn||{});class hd extends Ha{constructor(t,n,r,o,s,i,l,u){super(l,u),this.sourceSpace=t,this.resourcesToMove=n,this.targetSpace=r,this.targetFolder=o,this.currentFolder=s,this.clientService=i}hasRecursion(){return this.sourceSpace.id!==this.targetSpace.id?!1:this.resourcesToMove.some(t=>this.targetFolder.path===t.path)}showRecursionErrorMessage(){const t=this.resourcesToMove.length,n=this.$ngettext("You can't paste the selected file at this location because you can't paste an item into itself.","You can't paste the selected files at this location because you can't paste an item into itself.",t);Me().showErrorMessage({title:n})}showResultMessage(t,n,r){if(t.length===0){const l=n.length;if(l===0)return;const u=r===Xn.COPY?this.$ngettext("%{count} item was copied successfully","%{count} items were copied successfully",l,{count:l.toString()},!0):this.$ngettext("%{count} item was moved successfully","%{count} items were moved successfully",l,{count:l.toString()},!0);Me().showMessage({title:u,status:"success"});return}let o=r===Xn.COPY?this.$gettext("Failed to copy %{count} resources",{count:t.length.toString()},!0):this.$gettext("Failed to move %{count} resources",{count:t.length.toString()},!0);t.length===1&&(o=r===Xn.COPY?this.$gettext("Failed to copy »%{name}«",{name:t[0]?.resourceName},!0):this.$gettext("Failed to move »%{name}«",{name:t[0]?.resourceName},!0));let s="";t.some(({error:l})=>l instanceof z.HttpError&&l.statusCode===507)&&(s=this.$gettext("Insufficient quota")),Me().showErrorMessage({title:o,...s&&{desc:s},errors:t.map(({error:l})=>l)})}async getTransferData(t){if(this.hasRecursion())return this.showRecursionErrorMessage(),[];if(this.sourceSpace.id!==this.targetSpace.id&&t===Xn.MOVE){if(!await this.resolveDoCopyInsteadOfMoveForSpaces())return[];t=Xn.COPY}const n=(await this.clientService.webdav.listFiles(this.targetSpace,this.targetFolder)).children,r=await this.resolveAllConflicts(this.resourcesToMove,this.targetFolder,n),o=[];for(const s of this.resourcesToMove){const i={...s},{id:l,name:u,extension:d}=i,c=r.some(h=>h.resource.id===l);let p=u,f=!1;if(c){const h=r.find(g=>g.resource.id===l)?.strategy;if(h===Sn.SKIP)continue;if(h===Sn.REPLACE){if(this.isOverwritingParentFolder(i,this.targetFolder,n)){const g=new Error;this.showResultMessage([{error:g,resourceName:u}],[],t);continue}f=!0}h===Sn.KEEP_BOTH&&(p=wn(u,d,n),i.name=p)}pd(this.sourceSpace,i,this.targetSpace,this.targetFolder)&&f||o.push({resource:i,sourceSpace:this.sourceSpace,targetSpace:this.targetSpace,targetFolder:this.targetFolder,path:Ke.join(this.targetFolder.path,p),overwrite:f,transferType:t})}return o}isOverwritingParentFolder(t,n,r){if(t.type!=="folder")return!1;const o=a(this.currentFolder)?.path;if(!o||n.path===o)return!1;const s=Ke.basename(t.path),i=Ke.join(n.path,s);return o.split("/").length<i.split("/").length?!1:r.some(l=>l.path===i)}}const Wa={ignoreLocation:!0,threshold:0,useExtendedSearch:!0},Hy=(e,t,n)=>new Nc(e,{...Wa,keys:["name","type","icon","extension","tags"]}).search(t,{limit:n}).map(o=>o.item),md="oc-resource-icon-mapping",Wy={archive:{icon:{name:"resource-type-archive",color:"var(--oc-color-icon-archive)"},extensions:["7z","apk","bz2","deb","gz","gzip","rar","tar","tar.bz2","tar.gz","tar.xz","tbz2","tgz","zip"]},audio:{icon:{name:"resource-type-audio",color:"var(--oc-color-icon-audio)"},extensions:["3gp","8svx","aa","aac","aax","act","aiff","alac","amr","ape","au","awb","cda","dss","dvf","flac","gsm","iklax","ivs","m4a","m4b","m4p","mmf","mogg","movpkg","mp3","mpc","msv","nmf","oga","ogga","opus","ra","raw","rf64","rm","sln","tta","voc","vox","wav","wma","wv"]},code:{icon:{name:"resource-type-code",color:"var(--oc-role-on-surface)"},extensions:["bash","c++","c","cc","cpp","css","feature","go","h","hh","hpp","htm","html","java","js","json","php","pl","py","scss","sh","sh-lib","sql","ts","xml","yaml","yml"]},default:{icon:{name:"resource-type-file",color:"var(--oc-role-on-surface)"},extensions:["accdb","rss","swf"]},drawio:{icon:{name:"resource-type-drawio",color:"var(--oc-color-icon-drawio)"},extensions:["drawio"]},document:{icon:{name:"resource-type-document",color:"var(--oc-color-icon-document)"},extensions:["doc","docm","docx","dot","dotx","lwp","odt","one","vsd","wpd"]},ifc:{icon:{name:"resource-type-ifc",color:"var(--oc-color-icon-ifc)"},extensions:["ifc"]},ipynb:{icon:{name:"resource-type-jupyter",color:"var(--oc-color-icon-jupyter)"},extensions:["ipynb"]},image:{icon:{name:"resource-type-image",color:"var(--oc-color-icon-image)"},extensions:["ai","cdr","eot","eps","gif","jpeg","jpg","otf","pfb","png","ps","psd","svg","ttf","webp","woff","xcf"]},form:{icon:{name:"resource-type-form",color:"var(--oc-color-icon-form)"},extensions:["docf","docxf","oform"]},markdown:{icon:{name:"resource-type-markdown",color:"var(--oc-color-icon-markdown)"},extensions:["md","markdown"]},odg:{icon:{name:"resource-type-graphic",color:"var(--oc-color-icon-graphic)"},extensions:["odg"]},pdf:{icon:{name:"resource-type-pdf",color:"var(--oc-color-icon-pdf)"},extensions:["pdf"]},presentation:{icon:{name:"resource-type-presentation",color:"var(--oc-color-icon-presentation)"},extensions:["odp","otp","pot","potm","potx","ppa","ppam","pps","ppsm","ppsx","ppt","pptm","pptx"]},root:{icon:{name:"resource-type-root",color:"var(--oc-color-icon-root)"},extensions:["root"]},spreadsheet:{icon:{name:"resource-type-spreadsheet",color:"var(--oc-color-icon-spreadsheet)"},extensions:["csv","ods","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx"]},text:{icon:{name:"resource-type-text",color:"var(--oc-role-on-surface)"},extensions:["cb7","cba","cbr","cbt","cbtc","cbz","cvbdl","eml","mdb","tex","txt"]},url:{icon:{name:"resource-type-url",color:"var(--oc-role-on-surface)"},extensions:["url"]},video:{icon:{name:"resource-type-video",color:"var(--oc-color-icon-video)"},extensions:["mov","mp4","webm","wmv"]},epub:{icon:{name:"resource-type-book",color:"var(--oc-color-icon-epub)"},extensions:["epub"]},board:{icon:{name:"resource-type-board"},extensions:["ggs"]},notes:{icon:{name:"resource-type-sticky-note",color:"var(--oc-color-icon-notes)"},extensions:["ocnb"]}};function gd(){const e={};return Object.values(Wy).forEach(t=>{t.extensions.forEach(n=>{e[n]=t.icon})}),e}const vd=({resourcesStore:e,parentFolderId:t})=>{const n=e.currentFolder;if(!n||!n.id)return!1;if(z.extractNodeId(n.id)){if(n.id!==t)return!1}else{const r=n.id.split("$")[1];if(`${n.id}!${r}`!==t)return!1}return!0};function Qa(e,t,n){return t.name=Ke.basename(n),t.path=n,t.webDavPath=Ke.join(e.webDavPath,n),t.extension=z.extractExtensionFromFile(t),t}function Qy(){this.__data__=[],this.size=0}function Vo(e,t){return e===t||e!==e&&t!==t}function si(e,t){for(var n=e.length;n--;)if(Vo(e[n][0],t))return n;return-1}var Ky=Array.prototype,Gy=Ky.splice;function Jy(e){var t=this.__data__,n=si(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Gy.call(t,n,1),--this.size,!0}function Xy(e){var t=this.__data__,n=si(t,e);return n<0?void 0:t[n][1]}function Yy(e){return si(this.__data__,e)>-1}function Zy(e,t){var n=this.__data__,r=si(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Yn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Yn.prototype.clear=Qy,Yn.prototype.delete=Jy,Yn.prototype.get=Xy,Yn.prototype.has=Yy,Yn.prototype.set=Zy;function eb(){this.__data__=new Yn,this.size=0}function tb(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function nb(e){return this.__data__.get(e)}function rb(e){return this.__data__.has(e)}const br=globalThis||void 0||self;var yd=typeof br=="object"&&br&&br.Object===Object&&br,ob=typeof self=="object"&&self&&self.Object===Object&&self,Fn=yd||ob||Function("return this")(),sn=Fn.Symbol,bd=Object.prototype,sb=bd.hasOwnProperty,ib=bd.toString,qo=sn?sn.toStringTag:void 0;function ab(e){var t=sb.call(e,qo),n=e[qo];try{e[qo]=void 0;var r=!0}catch{}var o=ib.call(e);return r&&(t?e[qo]=n:delete e[qo]),o}var lb=Object.prototype,cb=lb.toString;function ub(e){return cb.call(e)}var db="[object Null]",fb="[object Undefined]",wd=sn?sn.toStringTag:void 0;function Ir(e){return e==null?e===void 0?fb:db:wd&&wd in Object(e)?ab(e):ub(e)}function $n(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var pb="[object AsyncFunction]",hb="[object Function]",mb="[object GeneratorFunction]",gb="[object Proxy]";function Ka(e){if(!$n(e))return!1;var t=Ir(e);return t==hb||t==mb||t==pb||t==gb}var Ga=Fn["__core-js_shared__"],Sd=(function(){var e=/[^.]+$/.exec(Ga&&Ga.keys&&Ga.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function vb(e){return!!Sd&&Sd in e}var yb=Function.prototype,bb=yb.toString;function Fr(e){if(e!=null){try{return bb.call(e)}catch{}try{return e+""}catch{}}return""}var wb=/[\\^$.*+?()[\]{}|]/g,Sb=/^\[object .+?Constructor\]$/,Tb=Function.prototype,kb=Object.prototype,Cb=Tb.toString,xb=kb.hasOwnProperty,Ab=RegExp("^"+Cb.call(xb).replace(wb,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Eb(e){if(!$n(e)||vb(e))return!1;var t=Ka(e)?Ab:Sb;return t.test(Fr(e))}function Rb(e,t){return e?.[t]}function $r(e,t){var n=Rb(e,t);return Eb(n)?n:void 0}var Ho=$r(Fn,"Map"),Wo=$r(Object,"create");function Db(){this.__data__=Wo?Wo(null):{},this.size=0}function Pb(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ib="__lodash_hash_undefined__",Fb=Object.prototype,$b=Fb.hasOwnProperty;function Ob(e){var t=this.__data__;if(Wo){var n=t[e];return n===Ib?void 0:n}return $b.call(t,e)?t[e]:void 0}var Lb=Object.prototype,_b=Lb.hasOwnProperty;function Mb(e){var t=this.__data__;return Wo?t[e]!==void 0:_b.call(t,e)}var Nb="__lodash_hash_undefined__";function Bb(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Wo&&t===void 0?Nb:t,this}function Or(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Or.prototype.clear=Db,Or.prototype.delete=Pb,Or.prototype.get=Ob,Or.prototype.has=Mb,Or.prototype.set=Bb;function jb(){this.size=0,this.__data__={hash:new Or,map:new(Ho||Yn),string:new Or}}function zb(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ii(e,t){var n=e.__data__;return zb(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Ub(e){var t=ii(this,e).delete(e);return this.size-=t?1:0,t}function Vb(e){return ii(this,e).get(e)}function qb(e){return ii(this,e).has(e)}function Hb(e,t){var n=ii(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Zn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Zn.prototype.clear=jb,Zn.prototype.delete=Ub,Zn.prototype.get=Vb,Zn.prototype.has=qb,Zn.prototype.set=Hb;var Wb=200;function Qb(e,t){var n=this.__data__;if(n instanceof Yn){var r=n.__data__;if(!Ho||r.length<Wb-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Zn(r)}return n.set(e,t),this.size=n.size,this}function On(e){var t=this.__data__=new Yn(e);this.size=t.size}On.prototype.clear=eb,On.prototype.delete=tb,On.prototype.get=nb,On.prototype.has=rb,On.prototype.set=Qb;var ai=(function(){try{var e=$r(Object,"defineProperty");return e({},"",{}),e}catch{}})();function Ja(e,t,n){t=="__proto__"&&ai?ai(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Xa(e,t,n){(n!==void 0&&!Vo(e[t],n)||n===void 0&&!(t in e))&&Ja(e,t,n)}function Kb(e){return function(t,n,r){for(var o=-1,s=Object(t),i=r(t),l=i.length;l--;){var u=i[++o];if(n(s[u],u,s)===!1)break}return t}}var Gb=Kb(),Td=typeof x=="object"&&x&&!x.nodeType&&x,kd=Td&&typeof module=="object"&&module&&!module.nodeType&&module,Jb=kd&&kd.exports===Td,Cd=Jb?Fn.Buffer:void 0,xd=Cd?Cd.allocUnsafe:void 0;function Ad(e,t){if(t)return e.slice();var n=e.length,r=xd?xd(n):new e.constructor(n);return e.copy(r),r}var li=Fn.Uint8Array;function Ya(e){var t=new e.constructor(e.byteLength);return new li(t).set(new li(e)),t}function Ed(e,t){var n=t?Ya(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Xb(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Rd=Object.create,Yb=(function(){function e(){}return function(t){if(!$n(t))return{};if(Rd)return Rd(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function Dd(e,t){return function(n){return e(t(n))}}var Za=Dd(Object.getPrototypeOf,Object),Zb=Object.prototype;function el(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Zb;return e===n}function ew(e){return typeof e.constructor=="function"&&!el(e)?Yb(Za(e)):{}}function Ln(e){return e!=null&&typeof e=="object"}var tw="[object Arguments]";function Pd(e){return Ln(e)&&Ir(e)==tw}var Id=Object.prototype,nw=Id.hasOwnProperty,rw=Id.propertyIsEnumerable,ci=Pd((function(){return arguments})())?Pd:function(e){return Ln(e)&&nw.call(e,"callee")&&!rw.call(e,"callee")},Tn=Array.isArray,ow=9007199254740991;function Fd(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ow}function ui(e){return e!=null&&Fd(e.length)&&!Ka(e)}function sw(e){return Ln(e)&&ui(e)}function iw(){return!1}var $d=typeof x=="object"&&x&&!x.nodeType&&x,Od=$d&&typeof module=="object"&&module&&!module.nodeType&&module,aw=Od&&Od.exports===$d,Ld=aw?Fn.Buffer:void 0,lw=Ld?Ld.isBuffer:void 0,Qo=lw||iw,cw="[object Object]",uw=Function.prototype,dw=Object.prototype,_d=uw.toString,fw=dw.hasOwnProperty,pw=_d.call(Object);function tl(e){if(!Ln(e)||Ir(e)!=cw)return!1;var t=Za(e);if(t===null)return!0;var n=fw.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&_d.call(n)==pw}var hw="[object Arguments]",mw="[object Array]",gw="[object Boolean]",vw="[object Date]",yw="[object Error]",bw="[object Function]",ww="[object Map]",Sw="[object Number]",Tw="[object Object]",kw="[object RegExp]",Cw="[object Set]",xw="[object String]",Aw="[object WeakMap]",Ew="[object ArrayBuffer]",Rw="[object DataView]",Dw="[object Float32Array]",Pw="[object Float64Array]",Iw="[object Int8Array]",Fw="[object Int16Array]",$w="[object Int32Array]",Ow="[object Uint8Array]",Lw="[object Uint8ClampedArray]",_w="[object Uint16Array]",Mw="[object Uint32Array]",ot={};ot[Dw]=ot[Pw]=ot[Iw]=ot[Fw]=ot[$w]=ot[Ow]=ot[Lw]=ot[_w]=ot[Mw]=!0,ot[hw]=ot[mw]=ot[Ew]=ot[gw]=ot[Rw]=ot[vw]=ot[yw]=ot[bw]=ot[ww]=ot[Sw]=ot[Tw]=ot[kw]=ot[Cw]=ot[xw]=ot[Aw]=!1;function Nw(e){return Ln(e)&&Fd(e.length)&&!!ot[Ir(e)]}function nl(e){return function(t){return e(t)}}var Md=typeof x=="object"&&x&&!x.nodeType&&x,Ko=Md&&typeof module=="object"&&module&&!module.nodeType&&module,Bw=Ko&&Ko.exports===Md,rl=Bw&&yd.process,so=(function(){try{var e=Ko&&Ko.require&&Ko.require("util").types;return e||rl&&rl.binding&&rl.binding("util")}catch{}})(),Nd=so&&so.isTypedArray,ol=Nd?nl(Nd):Nw;function sl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var jw=Object.prototype,zw=jw.hasOwnProperty;function Bd(e,t,n){var r=e[t];(!(zw.call(e,t)&&Vo(r,n))||n===void 0&&!(t in e))&&Ja(e,t,n)}function jd(e,t,n,r){var o=!n;n||(n={});for(var s=-1,i=t.length;++s<i;){var l=t[s],u=void 0;u===void 0&&(u=e[l]),o?Ja(n,l,u):Bd(n,l,u)}return n}function Uw(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Vw=9007199254740991,qw=/^(?:0|[1-9]\d*)$/;function zd(e,t){var n=typeof e;return t=t??Vw,!!t&&(n=="number"||n!="symbol"&&qw.test(e))&&e>-1&&e%1==0&&e<t}var Hw=Object.prototype,Ww=Hw.hasOwnProperty;function Ud(e,t){var n=Tn(e),r=!n&&ci(e),o=!n&&!r&&Qo(e),s=!n&&!r&&!o&&ol(e),i=n||r||o||s,l=i?Uw(e.length,String):[],u=l.length;for(var d in e)(t||Ww.call(e,d))&&!(i&&(d=="length"||o&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||zd(d,u)))&&l.push(d);return l}function Qw(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Kw=Object.prototype,Gw=Kw.hasOwnProperty;function Jw(e){if(!$n(e))return Qw(e);var t=el(e),n=[];for(var r in e)r=="constructor"&&(t||!Gw.call(e,r))||n.push(r);return n}function il(e){return ui(e)?Ud(e,!0):Jw(e)}function Xw(e){return jd(e,il(e))}function Yw(e,t,n,r,o,s,i){var l=sl(e,n),u=sl(t,n),d=i.get(u);if(d){Xa(e,n,d);return}var c=s?s(l,u,n+"",e,t,i):void 0,p=c===void 0;if(p){var f=Tn(u),h=!f&&Qo(u),g=!f&&!h&&ol(u);c=u,f||h||g?Tn(l)?c=l:sw(l)?c=Xb(l):h?(p=!1,c=Ad(u,!0)):g?(p=!1,c=Ed(u,!0)):c=[]:tl(u)||ci(u)?(c=l,ci(l)?c=Xw(l):(!$n(l)||Ka(l))&&(c=ew(u))):p=!1}p&&(i.set(u,c),o(c,u,r,s,i),i.delete(u)),Xa(e,n,c)}function Vd(e,t,n,r,o){e!==t&&Gb(t,function(s,i){if(o||(o=new On),$n(s))Yw(e,t,i,n,Vd,r,o);else{var l=r?r(sl(e,i),s,i+"",e,t,o):void 0;l===void 0&&(l=s),Xa(e,i,l)}},il)}function qd(e){return e}function Zw(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Hd=Math.max;function Wd(e,t,n){return t=Hd(t===void 0?e.length-1:t,0),function(){for(var r=arguments,o=-1,s=Hd(r.length-t,0),i=Array(s);++o<s;)i[o]=r[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=r[o];return l[t]=n(i),Zw(e,this,l)}}function eS(e){return function(){return e}}var tS=ai?function(e,t){return ai(e,"toString",{configurable:!0,enumerable:!1,value:eS(t),writable:!0})}:qd,nS=800,rS=16,oS=Date.now;function sS(e){var t=0,n=0;return function(){var r=oS(),o=rS-(r-n);if(n=r,o>0){if(++t>=nS)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Qd=sS(tS);function iS(e,t){return Qd(Wd(e,t,qd),e+"")}function aS(e,t,n){if(!$n(n))return!1;var r=typeof t;return(r=="number"?ui(n)&&zd(t,n.length):r=="string"&&t in n)?Vo(n[t],e):!1}function lS(e){return iS(function(t,n){var r=-1,o=n.length,s=o>1?n[o-1]:void 0,i=o>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(o--,s):void 0,i&&aS(n[0],n[1],i)&&(s=o<3?void 0:s,o=1),t=Object(t);++r<o;){var l=n[r];l&&e(t,l,r,s)}return t})}var Go=lS(function(e,t,n){Vd(e,t,n)});const al=(e,...t)=>{const{href:n}=e.resolve(a(e.currentRoute));return t.map(r=>{const{href:o}=e.resolve({...r});return o==="/"||o==="#/"?!1:n.startsWith(o)}).some(Boolean)},io=(...e)=>(t,...n)=>{if(!n.length)return al(t,...e);const[r,...o]=n.map(s=>{const i=e.find(l=>l.name===s);if(!i)throw new Error(`unknown comparative '${s}'`);return i});return al(t,r,...o)};function PO(e){return e}const ao=(e,...t)=>Go({},{name:e},...t.map(n=>({...n.params&&{params:n.params},...n.query&&{query:n.query}}))),lo=(e,t={})=>ao(e,t),Kd=lo("files-common-favorites"),Gd=lo("files-common-search"),bt=io(Kd,Gd),cS=e=>[{path:"/search",component:e.App,children:[{name:Gd.name,path:"list/:page?",component:e.SearchResults,meta:{authContext:"user",title:"Search results",contextQueryItems:["term","provider","q_tags","q_lastModified","q_titleOnly","q_mediaType","scope","useScope","sort-by","sort-dir"]}}]},{path:"/favorites",component:e.App,children:[{name:Kd.name,path:"",component:e.Favorites,meta:{authContext:"user",title:"Favorite files"}}]}],kn=(e,t={})=>ao(e,t),Jd=kn("files-spaces-projects"),ll=kn("files-spaces-generic"),st=io(Jd,ll),uS=e=>[{path:"/spaces",component:e.App,children:[{path:"projects",name:Jd.name,component:e.Spaces.Projects,meta:{authContext:"user",title:"Spaces"}},{path:":driveAliasAndItem(.*)?",name:ll.name,component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0,contextQueryItems:["sort-by","sort-dir"]}}]}],an=(e,t={})=>ao(e,t),dS=an("files-shares"),di=an("files-shares-with-me"),cl=an("files-shares-with-others"),ul=an("files-shares-via-link"),mt=io(di,cl,ul),fS=e=>[{name:dS.name,path:"/shares",component:e.App,redirect:di,children:[{name:di.name,path:"with-me",component:e.Shares.SharedWithMe,meta:{authContext:"user",title:"Files shared with me"}},{name:cl.name,path:"with-others",component:e.Shares.SharedWithOthers,meta:{authContext:"user",title:"Files shared with others"}},{name:ul.name,path:"via-link",component:e.Shares.SharedViaLink,meta:{authContext:"user",title:"Files shared via link"}}]}],co=(e,t={})=>ao(e,t),dl=co("files-public-link"),fl=co("files-public-upload"),ln=io(dl,fl),pS=e=>[{path:"/link",component:e.App,meta:{auth:!1},children:[{name:dl.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"publicLink",patchCleanPath:!0}}]},{path:"/upload",component:e.App,meta:{auth:!1},children:[{name:fl.name,path:":token?",component:e.FilesDrop,meta:{authContext:"publicLink",title:"Public file upload"}}]}],wr=(e,t={})=>ao(e,t),Xd=wr("files-trash-generic"),Yd=wr("files-trash-overview"),qt=io(Xd,Yd),hS=e=>[{path:"/trash",component:e.App,children:[{path:"overview",name:Yd.name,component:e.Trash.Overview,meta:{authContext:"user",title:"Trash overview"}},{name:Xd.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0}}]}];function Zd(e){return{applicationConfig:A(()=>e.appsStore.externalAppConfig[e.applicationId]||{})}}const mS=["anonymous","user","idp","publicLink","hybrid"],er=e=>Jn(e),Re=()=>er("$router"),St=()=>Re().currentRoute,pl=e=>e.path.split("/")[1],gS=()=>{const e=St();return A(()=>pl(a(e)))},_n=(e,t={},n)=>{const r=n?.configStore||Ge();return{params:{driveAliasAndItem:e.getDriveAliasAndItem({path:t.path||""})},query:{...z.isShareSpaceResource(e)&&{shareId:e.id},...r?.options?.routing?.idBased&&!rt.isUndefined(t.fileId)&&{fileId:`${t.fileId}`}}}},vS=(e,t)=>{const n=document.querySelector("base"),r=!!n,o=new URL(window.location.href.split("#")[0]);return o.search="",r?o.pathname=new URL(n.href).pathname:o.pathname.endsWith("/index.html")&&(o.pathname=o.pathname.split("/").slice(0,-1).filter(Boolean).join("/")),/\.(html?)$/i.test(t)?o.pathname=[...o.pathname.split("/"),...t.split("/")].filter(Boolean).join("/"):o[r?"pathname":"hash"]=e.resolve(t).href,o.href},Mn=we.defineStore("apps",()=>{const e=W({}),t=W({}),n=W([]),r=A(()=>Object.keys(a(e))),o=(u,d)=>{u.id&&(u.extensions&&u.extensions.forEach(c=>{s({appId:u.id,data:c})}),a(e)[u.id]={defaultExtension:u.defaultExtension||"",icon:"check_box_outline_blank",name:u.name||u.id,translations:d,...u})},s=({appId:u,data:d})=>{a(n).push({...d,app:u,hasPriority:d.hasPriority||a(t)?.[u]?.priorityExtensions?.includes(d.extension)||!1,secureView:d.secureView||!1})};return{apps:e,externalAppConfig:t,appIds:r,fileExtensions:n,registerApp:o,registerFileExtension:s,loadExternalAppConfig:({appId:u,config:d})=>{t.value={...a(t),[u]:d}},isAppEnabled:u=>a(r).includes(u)}}),Lr=we.defineStore("auth",()=>{const e=W(),t=W(!1),n=W(!1),r=W(),o=W(),s=W(),i=W(!1),l=h=>{e.value=h},u=h=>{t.value=h},d=h=>{n.value=h},c=h=>{r.value=h.publicLinkToken,o.value=h.publicLinkPassword,s.value=h.publicLinkType,i.value=h.publicLinkContextReady};return{accessToken:e,idpContextReady:t,userContextReady:n,publicLinkToken:r,publicLinkPassword:o,publicLinkType:s,publicLinkContextReady:i,setAccessToken:l,setIdpContextReady:u,setUserContextReady:d,setPublicLinkContext:c,clearUserContext:()=>{l(null),u(null),d(null)},clearPublicLinkContext:()=>{c({publicLinkToken:null,publicLinkPassword:null,publicLinkType:null,publicLinkContextReady:!1})}}}),ef={cernFeatures:!1,concurrentRequests:{resourceBatchActions:4,shares:{create:4,list:2},sse:4,avatars:4},contextHelpers:!0,contextHelpersReadMore:!0,defaultAppId:"files",disabledExtensions:[],disableFeedbackLink:!1,editor:{autosaveEnabled:!0,autosaveInterval:120},embed:{enabled:!1,target:"resources"},ocm:{openRemotely:!1},routing:{idBased:!0,fullShareOwnerPaths:!1},runningOnEos:!1,tokenStorageLocal:!0,userListRequiresFilter:!1,hideLogo:!1},Ge=we.defineStore("config",()=>{const e=Mn(),t=W(""),n=W(""),r=W({...ef}),o=W([]),s=W([]),i=W([]),l=W(),u=W(),d=W(),c=W([]),p=W([]),f=A(()=>z.urlJoin(a(t)||window.location.origin,{trailingSlash:!0})),h=A(()=>z.urlJoin(a(f),"groupware",{trailingSlash:!0})),g=A(()=>!!a(l)),m=A(()=>!!a(u));return{options:r,oAuth2:l,openIdConnect:u,isOAuth2:g,isOIDC:m,customTranslations:i,apps:o,externalApps:s,sentry:d,theme:n,scripts:c,styles:p,serverUrl:f,groupwareUrl:h,loadConfig:T=>{T.server&&(t.value=T.server?.endsWith("/")?T.server:T.server+"/"),o.value=T.apps||[],i.value=T.customTranslations||[],l.value=T.auth,u.value=T.openIdConnect,d.value=T.sentry,c.value=T.scripts||[],p.value=T.styles||[],n.value=T.theme,T.options&&(r.value=Go({...ef},T.options),a(r).ocm.openRemotely=a(r).cernFeatures,a(r).routing.idBased=!a(r).cernFeatures,a(r).routing.fullShareOwnerPaths=a(r).cernFeatures),T.external_apps&&(s.value=T.external_apps,T.external_apps.filter(Boolean).forEach(k=>{e.loadExternalAppConfig({appId:k.id,config:k.config})}))}}}),yS=K.z.object({url:K.z.string()}),bS=K.z.object({apiUrl:K.z.string().optional(),authUrl:K.z.string().optional(),clientId:K.z.string().optional(),clientSecret:K.z.string().optional(),logoutUrl:K.z.string().optional(),metaDataUrl:K.z.string().optional(),url:K.z.string().optional()}),wS=K.z.object({authority:K.z.string().optional(),client_id:K.z.string().optional(),client_secret:K.z.string().optional(),dynamic:K.z.string().optional(),metadata_url:K.z.string().optional(),post_logout_redirect_uri:K.z.string().optional(),response_type:K.z.string().optional(),scope:K.z.string().optional()}).passthrough(),SS=K.z.record(K.z.any(),K.z.any()),TS=K.z.object({href:K.z.string().optional()}),kS=K.z.object({async:K.z.boolean().optional(),src:K.z.string().optional()}),CS=K.z.object({cernFeatures:K.z.boolean().optional(),concurrentRequests:K.z.object({resourceBatchActions:K.z.number().optional(),sse:K.z.number().optional(),shares:K.z.object({create:K.z.number().optional(),list:K.z.number().optional()}).optional(),avatars:K.z.number().optional()}).optional(),contextHelpers:K.z.boolean().optional(),contextHelpersReadMore:K.z.boolean().optional(),defaultAppId:K.z.string().optional(),disabledExtensions:K.z.array(K.z.string()).optional(),disableFeedbackLink:K.z.boolean().optional(),accountEditLink:K.z.object({href:K.z.string().optional()}).optional(),editor:K.z.object({autosaveEnabled:K.z.boolean().optional(),autosaveInterval:K.z.number().optional(),openAsPreview:K.z.union([K.z.boolean(),K.z.array(K.z.string())]).optional()}).optional(),embed:K.z.object({enabled:K.z.boolean().optional(),target:K.z.string().optional(),messagesOrigin:K.z.string().optional(),delegateAuthentication:K.z.boolean().optional(),delegateAuthenticationOrigin:K.z.string().optional(),fileTypes:K.z.array(K.z.string()).optional(),chooseFileName:K.z.boolean().optional(),chooseFileNameSuggestion:K.z.string().optional()}).optional(),feedbackLink:K.z.object({ariaLabel:K.z.string().optional(),description:K.z.string().optional(),href:K.z.string().optional()}).optional(),isRunningOnEos:K.z.boolean().optional(),loginUrl:K.z.string().optional(),logoutUrl:K.z.string().optional(),ocm:K.z.object({openRemotely:K.z.boolean().optional()}).optional(),routing:K.z.object({fullShareOwnerPaths:K.z.boolean().optional(),idBased:K.z.boolean().optional()}).optional(),runningOnEos:K.z.boolean().optional(),tokenStorageLocal:K.z.boolean().optional(),upload:K.z.object({companionUrl:K.z.string().optional()}).optional(),userListRequiresFilter:K.z.boolean().optional(),hideLogo:K.z.boolean().optional()}),xS=K.z.object({id:K.z.string(),path:K.z.string(),config:K.z.record(K.z.string(),K.z.unknown()).optional()}),AS=K.z.object({server:K.z.string(),theme:K.z.string(),options:CS,apps:K.z.array(K.z.string()).optional(),external_apps:K.z.array(xS).optional(),customTranslations:K.z.array(yS).optional(),auth:bS.optional(),openIdConnect:wS.optional(),sentry:SS.optional(),scripts:K.z.array(kS).optional(),styles:K.z.array(TS).optional()}),fi=we.defineStore("avatars",()=>{const e=Ge(),t=W({}),n=du(new ur({concurrency:e.options.concurrentRequests.avatars}));return{avatarMap:t,getAvatar:u=>a(t)[u],addAvatar:(u,d)=>{t.value[u]=d},removeAvatar:u=>{t.value[u]=null},reset:()=>{t.value={}},avatarsQueue:n,pendingAvatarsRequests:new Map}}),tf={core:{"support-sse":!1},dav:{},files:{app_providers:[],favorites:!1,permanent_deletion:!0,tags:!1,privateLinks:!1,tus_support:{extension:"",http_method_override:!1,max_chunk_size:0}},files_sharing:{allow_custom:!0,api_enabled:!0,can_rename:!0,deny_access:!1,public:{alias:!1,can_contribute:!0,can_edit:!1,default_permissions:z.SharePermissionBit.Read,enabled:!0,password:{enforced_for:{read_only:!1,upload_only:!1,read_write:!1}}}},graph:{"personal-data-export":!1,users:{change_password_self_disabled:!0,create_disabled:!1,delete_disabled:!1,read_only_attributes:[],edit_login_allowed_disabled:!1}},notifications:{"ocs-endpoints":[]},password_policy:{},search:{property:{mediatype:{},mtime:{}}},spaces:{enabled:!1,max_quota:0,projects:!1}},Dt=we.defineStore("capabilities",()=>{const e=W(!1),t=W(tf),n=xe=>{t.value=Go({...tf},xe.capabilities),e.value=!0},r=A(()=>a(t).core["support-sse"]),o=A(()=>a(t).core["support-radicale"]),s=A(()=>a(t).graph["personal-data-export"]),i=A(()=>a(t).core.status),l=A(()=>a(t).dav.reports),u=A(()=>a(t).dav.trashbin),d=A(()=>a(t).spaces.max_quota),c=A(()=>a(t).spaces.projects),p=A(()=>a(t).graph.users.create_disabled),f=A(()=>a(t).graph.users.delete_disabled),h=A(()=>a(t).graph.users.change_password_self_disabled),g=A(()=>a(t).graph.users.read_only_attributes),m=A(()=>a(t).graph.users.edit_login_allowed_disabled),w=A(()=>a(t).files.app_providers),T=A(()=>a(t).files.favorites),k=A(()=>a(t).files.archivers),S=A(()=>a(t).files.privateLinks),y=A(()=>a(t).files.permanent_deletion),E=A(()=>a(t).files.tags),D=A(()=>a(t).files.undelete),$=A(()=>a(t).files_sharing.api_enabled),_=A(()=>a(t).files_sharing.can_rename),L=A(()=>a(t).files_sharing.allow_custom),V=A(()=>a(t).files_sharing.public?.enabled),te=A(()=>a(t).files_sharing.public?.can_edit),B=A(()=>a(t).files_sharing.public?.can_contribute),O=A(()=>a(t).files_sharing.public?.alias),M=A(()=>a(t).files_sharing.public?.default_permissions),N=A(()=>a(t).files_sharing.public?.password.enforced_for),q=A(()=>a(t).files_sharing.search_min_length),j=A(()=>a(t).files_sharing.user?.profile_picture),H=A(()=>a(t).files.tus_support?.max_chunk_size),se=A(()=>a(t).files.tus_support?.extension),Y=A(()=>a(t).files.tus_support?.http_method_override),ae=A(()=>a(t).notifications["ocs-endpoints"]),ne=A(()=>a(t).password_policy),pe=A(()=>a(t).search.property?.mtime),fe=A(()=>a(t).search.property?.mediatype),be=A(()=>a(t).search.property?.content);return{isInitialized:e,capabilities:t,setCapabilities:n,status:i,supportSSE:r,supportRadicale:o,personalDataExport:s,davReports:l,davTrashbin:u,spacesMaxQuota:d,spacesProjects:c,graphUsersCreateDisabled:p,graphUsersDeleteDisabled:f,graphUsersChangeSelfPasswordDisabled:h,graphUsersEditLoginAllowedDisabled:m,graphUsersReadOnlyAttributes:g,filesAppProviders:w,filesFavorites:T,filesArchivers:k,filesPrivateLinks:S,filesPermanentDeletion:y,filesTags:E,filesUndelete:D,sharingApiEnabled:$,sharingCanRename:_,sharingAllowCustom:L,sharingPublicEnabled:V,sharingPublicCanEdit:te,sharingPublicCanContribute:B,sharingPublicAlias:O,sharingPublicDefaultPermissions:M,sharingPublicPasswordEnforcedFor:N,sharingSearchMinLength:q,sharingUserProfilePicture:j,tusMaxChunkSize:H,tusExtension:se,tusHttpMethodOverride:Y,notificationsOcsEndpoints:ae,passwordPolicy:ne,searchLastMofifiedDate:pe,searchMediaType:fe,searchContent:be}});class ES{value;expires;constructor(t,n){this.value=t,this.expires=n?new Date().getTime()+n:0}get expired(){return this.expires>0&&this.expires<new Date().getTime()}}class nf{map;ttl;capacity;constructor(t){this.ttl=t.ttl||0,this.capacity=t.capacity||0,this.map=new Map}set(t,n,r){return this.evict(),this.map.set(t,new ES(n,isNaN(r)?this.ttl:r)),n}get(t){this.evict();const n=this.map.get(t);if(n)return n.value}delete(t){return this.map.delete(t)}clear(){return this.map.clear()}entries(){return this.evict(),[...this.map.entries()].map(t=>[t[0],t[1].value])}keys(){return this.evict(),[...this.map.keys()]}has(t){return this.evict(),this.map.has(t)}values(){return this.evict(),[...this.map.values()].map(t=>t.value)}evict(){if(this.map.forEach((t,n)=>{t.expired&&this.delete(n)}),!!this.capacity)for(const[t]of[...this.map.entries()]){if(this.map.size<=this.capacity)break;this.delete(t)}}}const pi=async({graphClient:e,spacesStore:t,space:n,signal:r})=>{const o=await t.getMountPointForSpace({graphClient:e,space:n,signal:r});if(!o)return null;const{id:s}=o;return e.driveItems.getDriveItem(s.split("!")[0],s)},RS=({sharedAncestor:e,matchingSpace:t})=>t?kn("files-spaces-generic",_n(t,{path:e.path,fileId:e.id})):{},rf=({sharesStore:e,spacesStore:t,space:n,sharedDriveItem:r})=>{const o=r?.remoteItem?.permissions||[];if(!o.length)return;const s=[];o.forEach(i=>{if(i["@libre.graph.permissions.actions"]){s.push(...i["@libre.graph.permissions.actions"]);return}const l=e.graphRoles[i.roles[0]];if(!l)return;const u=l.rolePermissions.flatMap(d=>d.allowedResourceActions);s.push(...u)}),t.updateSpaceField({id:n.id,field:"graphPermissions",value:[...new Set(s)]})},DS=e=>{const t=document.querySelectorAll(`[data-item-id="${e}"] input[type=checkbox]`)?.[0];t&&t.focus()},hi=(e,t)=>{t!==void 0&&document.querySelector(":root").style.setProperty("--oc-"+e,t)},PS="thead-clicked",IS="highlight",FS="rowMounted",$S="contextmenuClicked",of="itemDropped",OS="itemDragged";let LS="";const _S=()=>LS,MS=e=>({"gap-0":e==="none","gap-0.5":e==="xsmall","gap-1":e==="small","gap-2":e==="medium","gap-4":e==="large","gap-5":e==="xlarge","gap-6":e==="xxlarge","gap-7":e==="xxxlarge"}),NS=e=>({"justify-start":e==="left","justify-center":e==="center","justify-end":e==="right","justify-around":e==="space-around","justify-between":e==="space-between","justify-evenly":e==="space-evenly"}),BS=e=>({"p-0":e==="remove","p-1":e==="xsmall","p-2":e==="small","p-4":e==="medium","p-6":e==="large","p-12":e==="xlarge","p-24":e==="xxlarge"});var Xe=(e=>(e.Desc="desc",e.Asc="asc",e))(Xe||{});let sf=0;const _r=(e="")=>(e=e||"",sf+=1,e+sf),af=e=>e?[{name:"name",sortable:!0,sortDir:Xe.Asc},{name:"size",sortable:!0,sortDir:Xe.Desc},{name:"sharedWith",sortable:t=>t.length>0?t.sort((n,r)=>n.shareType!==r.shareType?n.shareType<r.shareType?-1:1:n.displayName<r.displayName?-1:1).map(n=>n.displayName).join():!1,sortDir:Xe.Asc},{name:"owner",sortable:"displayName",sortDir:Xe.Asc},{name:"mdate",sortable:t=>new Date(t).valueOf(),sortDir:Xe.Desc},{name:"sdate",sortable:t=>new Date(t).valueOf(),sortDir:Xe.Desc},{name:"ddate",sortable:t=>new Date(t).valueOf(),sortDir:Xe.Desc}].filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[];function IO(e){return e}const lf=[{label:"A-Z",name:"name",sortable:!0,sortDir:Xe.Asc},{label:"Z-A",name:"name",sortable:!0,sortDir:Xe.Desc},{label:"Newest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Xe.Desc},{label:"Oldest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Xe.Asc},{label:"Largest",name:"size",sortable:!0,sortDir:Xe.Desc},{label:"Smallest",name:"size",sortable:!0,sortDir:Xe.Asc},{label:"Remaining quota",name:"remainingQuota",prop:"spaceQuota.remaining",sortable:!0,sortDir:Xe.Desc},{label:"Total quota",name:"totalQuota",prop:"spaceQuota.total",sortable:!0,sortDir:Xe.Desc},{label:"Used quota",name:"usedQuota",prop:"spaceQuota.used",sortable:!0,sortDir:Xe.Desc}],jS=e=>e?lf.filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[],zS=(e,{$gettext:t})=>e.map(n=>({...n,label:t(n.label)})),US=K.z.object({icon:K.z.string(),name:K.z.string(),secure_view:K.z.boolean().optional().default(!1),target_ext:K.z.string().optional()}),VS=K.z.object({allow_creation:K.z.boolean().optional(),app_providers:K.z.array(US),default_application:K.z.string().optional(),description:K.z.string().optional(),ext:K.z.string().optional(),mime_type:K.z.string(),name:K.z.string().optional()}),cf=K.z.object({"mime-types":K.z.array(VS)});class qS{_mimeTypes=W([]);serverUrl;clientService;constructor(t,n){this.serverUrl=t,this.clientService=n}async loadData(){const t=z.urlJoin(this.serverUrl,"app","list"),{data:{"mime-types":n}}=await this.clientService.httpUnAuthenticated.get(t,{schema:cf});this._mimeTypes.value=n}set mimeTypes(t){this._mimeTypes.value=t}get mimeTypes(){return a(this._mimeTypes)}get templateMimeTypes(){return a(this._mimeTypes).filter(t=>!!t.app_providers.some(n=>!!n.target_ext))}get appNames(){return[...new Set(a(this._mimeTypes).flatMap(t=>t.app_providers.map(n=>n.name)))]}getMimeTypesByAppName(t){return a(this._mimeTypes).filter(n=>n.app_providers.some(r=>r.name===t))}}var uf={},mi={};mi.byteLength=QS,mi.toByteArray=GS,mi.fromByteArray=YS;for(var Nn=[],cn=[],HS=typeof Uint8Array<"u"?Uint8Array:Array,hl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",uo=0,WS=hl.length;uo<WS;++uo)Nn[uo]=hl[uo],cn[hl.charCodeAt(uo)]=uo;cn[45]=62,cn[95]=63;function df(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function QS(e){var t=df(e),n=t[0],r=t[1];return(n+r)*3/4-r}function KS(e,t,n){return(t+n)*3/4-n}function GS(e){var t,n=df(e),r=n[0],o=n[1],s=new HS(KS(e,r,o)),i=0,l=o>0?r-4:r,u;for(u=0;u<l;u+=4)t=cn[e.charCodeAt(u)]<<18|cn[e.charCodeAt(u+1)]<<12|cn[e.charCodeAt(u+2)]<<6|cn[e.charCodeAt(u+3)],s[i++]=t>>16&255,s[i++]=t>>8&255,s[i++]=t&255;return o===2&&(t=cn[e.charCodeAt(u)]<<2|cn[e.charCodeAt(u+1)]>>4,s[i++]=t&255),o===1&&(t=cn[e.charCodeAt(u)]<<10|cn[e.charCodeAt(u+1)]<<4|cn[e.charCodeAt(u+2)]>>2,s[i++]=t>>8&255,s[i++]=t&255),s}function JS(e){return Nn[e>>18&63]+Nn[e>>12&63]+Nn[e>>6&63]+Nn[e&63]}function XS(e,t,n){for(var r,o=[],s=t;s<n;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),o.push(JS(r));return o.join("")}function YS(e){for(var t,n=e.length,r=n%3,o=[],s=16383,i=0,l=n-r;i<l;i+=s)o.push(XS(e,i,i+s>l?l:i+s));return r===1?(t=e[n-1],o.push(Nn[t>>2]+Nn[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(Nn[t>>10]+Nn[t>>4&63]+Nn[t<<2&63]+"=")),o.join("")}var ml={};ml.read=function(e,t,n,r,o){var s,i,l=o*8-r-1,u=(1<<l)-1,d=u>>1,c=-7,p=n?o-1:0,f=n?-1:1,h=e[t+p];for(p+=f,s=h&(1<<-c)-1,h>>=-c,c+=l;c>0;s=s*256+e[t+p],p+=f,c-=8);for(i=s&(1<<-c)-1,s>>=-c,c+=r;c>0;i=i*256+e[t+p],p+=f,c-=8);if(s===0)s=1-d;else{if(s===u)return i?NaN:(h?-1:1)*(1/0);i=i+Math.pow(2,r),s=s-d}return(h?-1:1)*i*Math.pow(2,s-r)},ml.write=function(e,t,n,r,o,s){var i,l,u,d=s*8-o-1,c=(1<<d)-1,p=c>>1,f=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:s-1,g=r?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,i=c):(i=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-i))<1&&(i--,u*=2),i+p>=1?t+=f/u:t+=f*Math.pow(2,1-p),t*u>=2&&(i++,u/=2),i+p>=c?(l=0,i=c):i+p>=1?(l=(t*u-1)*Math.pow(2,o),i=i+p):(l=t*Math.pow(2,p-1)*Math.pow(2,o),i=0));o>=8;e[n+h]=l&255,h+=g,l/=256,o-=8);for(i=i<<o|l,d+=o;d>0;e[n+h]=i&255,h+=g,i/=256,d-=8);e[n+h-g]|=m*128};(function(e){const t=mi,n=ml,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=E,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o;const{Uint8Array:s,ArrayBuffer:i,SharedArrayBuffer:l}=globalThis;c.TYPED_ARRAY_SUPPORT=u(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function u(){try{const C=new s(1),v={foo:function(){return 42}};return Object.setPrototypeOf(v,s.prototype),Object.setPrototypeOf(C,v),C.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function d(C){if(C>o)throw new RangeError('The value "'+C+'" is invalid for option "size"');const v=new s(C);return Object.setPrototypeOf(v,c.prototype),v}function c(C,v,b){if(typeof C=="number"){if(typeof v=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(C)}return p(C,v,b)}c.poolSize=8192;function p(C,v,b){if(typeof C=="string")return m(C,v);if(i.isView(C))return T(C);if(C==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof C);if(dt(C,i)||C&&dt(C.buffer,i)||typeof l<"u"&&(dt(C,l)||C&&dt(C.buffer,l)))return k(C,v,b);if(typeof C=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const F=C.valueOf&&C.valueOf();if(F!=null&&F!==C)return c.from(F,v,b);const P=S(C);if(P)return P;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof C[Symbol.toPrimitive]=="function")return c.from(C[Symbol.toPrimitive]("string"),v,b);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof C)}c.from=function(C,v,b){return p(C,v,b)},Object.setPrototypeOf(c.prototype,s.prototype),Object.setPrototypeOf(c,s);function f(C){if(typeof C!="number")throw new TypeError('"size" argument must be of type number');if(C<0)throw new RangeError('The value "'+C+'" is invalid for option "size"')}function h(C,v,b){return f(C),C<=0?d(C):v!==void 0?typeof b=="string"?d(C).fill(v,b):d(C).fill(v):d(C)}c.alloc=function(C,v,b){return h(C,v,b)};function g(C){return f(C),d(C<0?0:y(C)|0)}c.allocUnsafe=function(C){return g(C)},c.allocUnsafeSlow=function(C){return g(C)};function m(C,v){if((typeof v!="string"||v==="")&&(v="utf8"),!c.isEncoding(v))throw new TypeError("Unknown encoding: "+v);const b=D(C,v)|0;let F=d(b);const P=F.write(C,v);return P!==b&&(F=F.slice(0,P)),F}function w(C){const v=C.length<0?0:y(C.length)|0,b=d(v);for(let F=0;F<v;F+=1)b[F]=C[F]&255;return b}function T(C){if(dt(C,s)){const v=new s(C);return k(v.buffer,v.byteOffset,v.byteLength)}return w(C)}function k(C,v,b){if(v<0||C.byteLength<v)throw new RangeError('"offset" is outside of buffer bounds');if(C.byteLength<v+(b||0))throw new RangeError('"length" is outside of buffer bounds');let F;return v===void 0&&b===void 0?F=new s(C):b===void 0?F=new s(C,v):F=new s(C,v,b),Object.setPrototypeOf(F,c.prototype),F}function S(C){if(c.isBuffer(C)){const v=y(C.length)|0,b=d(v);return b.length===0||C.copy(b,0,0,v),b}if(C.length!==void 0)return typeof C.length!="number"||mn(C.length)?d(0):w(C);if(C.type==="Buffer"&&Array.isArray(C.data))return w(C.data)}function y(C){if(C>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return C|0}function E(C){return+C!=C&&(C=0),c.alloc(+C)}c.isBuffer=function(v){return v!=null&&v._isBuffer===!0&&v!==c.prototype},c.compare=function(v,b){if(dt(v,s)&&(v=c.from(v,v.offset,v.byteLength)),dt(b,s)&&(b=c.from(b,b.offset,b.byteLength)),!c.isBuffer(v)||!c.isBuffer(b))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(v===b)return 0;let F=v.length,P=b.length;for(let U=0,X=Math.min(F,P);U<X;++U)if(v[U]!==b[U]){F=v[U],P=b[U];break}return F<P?-1:P<F?1:0},c.isEncoding=function(v){switch(String(v).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(v,b){if(!Array.isArray(v))throw new TypeError('"list" argument must be an Array of Buffers');if(v.length===0)return c.alloc(0);let F;if(b===void 0)for(b=0,F=0;F<v.length;++F)b+=v[F].length;const P=c.allocUnsafe(b);let U=0;for(F=0;F<v.length;++F){let X=v[F];if(dt(X,s))U+X.length>P.length?(c.isBuffer(X)||(X=c.from(X)),X.copy(P,U)):s.prototype.set.call(P,X,U);else if(c.isBuffer(X))X.copy(P,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=X.length}return P};function D(C,v){if(c.isBuffer(C))return C.length;if(i.isView(C)||dt(C,i))return C.byteLength;if(typeof C!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof C);const b=C.length,F=arguments.length>2&&arguments[2]===!0;if(!F&&b===0)return 0;let P=!1;for(;;)switch(v){case"ascii":case"latin1":case"binary":return b;case"utf8":case"utf-8":return qe(C).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b*2;case"hex":return b>>>1;case"base64":return Xt(C).length;default:if(P)return F?-1:qe(C).length;v=(""+v).toLowerCase(),P=!0}}c.byteLength=D;function $(C,v,b){let F=!1;if((v===void 0||v<0)&&(v=0),v>this.length||((b===void 0||b>this.length)&&(b=this.length),b<=0)||(b>>>=0,v>>>=0,b<=v))return"";for(C||(C="utf8");;)switch(C){case"hex":return ne(this,v,b);case"utf8":case"utf-8":return j(this,v,b);case"ascii":return Y(this,v,b);case"latin1":case"binary":return ae(this,v,b);case"base64":return q(this,v,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,v,b);default:if(F)throw new TypeError("Unknown encoding: "+C);C=(C+"").toLowerCase(),F=!0}}c.prototype._isBuffer=!0;function _(C,v,b){const F=C[v];C[v]=C[b],C[b]=F}c.prototype.swap16=function(){const v=this.length;if(v%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let b=0;b<v;b+=2)_(this,b,b+1);return this},c.prototype.swap32=function(){const v=this.length;if(v%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let b=0;b<v;b+=4)_(this,b,b+3),_(this,b+1,b+2);return this},c.prototype.swap64=function(){const v=this.length;if(v%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let b=0;b<v;b+=8)_(this,b,b+7),_(this,b+1,b+6),_(this,b+2,b+5),_(this,b+3,b+4);return this},c.prototype.toString=function(){const v=this.length;return v===0?"":arguments.length===0?j(this,0,v):$.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(v){if(!c.isBuffer(v))throw new TypeError("Argument must be a Buffer");return this===v?!0:c.compare(this,v)===0},c.prototype.inspect=function(){let v="";const b=e.INSPECT_MAX_BYTES;return v=this.toString("hex",0,b).replace(/(.{2})/g,"$1 ").trim(),this.length>b&&(v+=" ... "),"<Buffer "+v+">"},r&&(c.prototype[r]=c.prototype.inspect),c.prototype.compare=function(v,b,F,P,U){if(dt(v,s)&&(v=c.from(v,v.offset,v.byteLength)),!c.isBuffer(v))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof v);if(b===void 0&&(b=0),F===void 0&&(F=v?v.length:0),P===void 0&&(P=0),U===void 0&&(U=this.length),b<0||F>v.length||P<0||U>this.length)throw new RangeError("out of range index");if(P>=U&&b>=F)return 0;if(P>=U)return-1;if(b>=F)return 1;if(b>>>=0,F>>>=0,P>>>=0,U>>>=0,this===v)return 0;let X=U-P,ee=F-b;const ye=Math.min(X,ee),Ie=this.slice(P,U),Fe=v.slice(b,F);for(let Ne=0;Ne<ye;++Ne)if(Ie[Ne]!==Fe[Ne]){X=Ie[Ne],ee=Fe[Ne];break}return X<ee?-1:ee<X?1:0};function L(C,v,b,F,P){if(C.length===0)return-1;if(typeof b=="string"?(F=b,b=0):b>2147483647?b=2147483647:b<-2147483648&&(b=-2147483648),b=+b,mn(b)&&(b=P?0:C.length-1),b<0&&(b=C.length+b),b>=C.length){if(P)return-1;b=C.length-1}else if(b<0)if(P)b=0;else return-1;if(typeof v=="string"&&(v=c.from(v,F)),c.isBuffer(v))return v.length===0?-1:V(C,v,b,F,P);if(typeof v=="number")return v=v&255,typeof s.prototype.indexOf=="function"?P?s.prototype.indexOf.call(C,v,b):s.prototype.lastIndexOf.call(C,v,b):V(C,[v],b,F,P);throw new TypeError("val must be string, number or Buffer")}function V(C,v,b,F,P){let U=1,X=C.length,ee=v.length;if(F!==void 0&&(F=String(F).toLowerCase(),F==="ucs2"||F==="ucs-2"||F==="utf16le"||F==="utf-16le")){if(C.length<2||v.length<2)return-1;U=2,X/=2,ee/=2,b/=2}function ye(Fe,Ne){return U===1?Fe[Ne]:Fe.readUInt16BE(Ne*U)}let Ie;if(P){let Fe=-1;for(Ie=b;Ie<X;Ie++)if(ye(C,Ie)===ye(v,Fe===-1?0:Ie-Fe)){if(Fe===-1&&(Fe=Ie),Ie-Fe+1===ee)return Fe*U}else Fe!==-1&&(Ie-=Ie-Fe),Fe=-1}else for(b+ee>X&&(b=X-ee),Ie=b;Ie>=0;Ie--){let Fe=!0;for(let Ne=0;Ne<ee;Ne++)if(ye(C,Ie+Ne)!==ye(v,Ne)){Fe=!1;break}if(Fe)return Ie}return-1}c.prototype.includes=function(v,b,F){return this.indexOf(v,b,F)!==-1},c.prototype.indexOf=function(v,b,F){return L(this,v,b,F,!0)},c.prototype.lastIndexOf=function(v,b,F){return L(this,v,b,F,!1)};function te(C,v,b,F){b=Number(b)||0;const P=C.length-b;F?(F=Number(F),F>P&&(F=P)):F=P;const U=v.length;F>U/2&&(F=U/2);let X;for(X=0;X<F;++X){const ee=parseInt(v.substr(X*2,2),16);if(mn(ee))return X;C[b+X]=ee}return X}function B(C,v,b,F){return kt(qe(v,C.length-b),C,b,F)}function O(C,v,b,F){return kt(We(v),C,b,F)}function M(C,v,b,F){return kt(Xt(v),C,b,F)}function N(C,v,b,F){return kt(Jt(v,C.length-b),C,b,F)}c.prototype.write=function(v,b,F,P){if(b===void 0)P="utf8",F=this.length,b=0;else if(F===void 0&&typeof b=="string")P=b,F=this.length,b=0;else if(isFinite(b))b=b>>>0,isFinite(F)?(F=F>>>0,P===void 0&&(P="utf8")):(P=F,F=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const U=this.length-b;if((F===void 0||F>U)&&(F=U),v.length>0&&(F<0||b<0)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");P||(P="utf8");let X=!1;for(;;)switch(P){case"hex":return te(this,v,b,F);case"utf8":case"utf-8":return B(this,v,b,F);case"ascii":case"latin1":case"binary":return O(this,v,b,F);case"base64":return M(this,v,b,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,v,b,F);default:if(X)throw new TypeError("Unknown encoding: "+P);P=(""+P).toLowerCase(),X=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function q(C,v,b){return v===0&&b===C.length?t.fromByteArray(C):t.fromByteArray(C.slice(v,b))}function j(C,v,b){b=Math.min(C.length,b);const F=[];let P=v;for(;P<b;){const U=C[P];let X=null,ee=U>239?4:U>223?3:U>191?2:1;if(P+ee<=b){let ye,Ie,Fe,Ne;switch(ee){case 1:U<128&&(X=U);break;case 2:ye=C[P+1],(ye&192)===128&&(Ne=(U&31)<<6|ye&63,Ne>127&&(X=Ne));break;case 3:ye=C[P+1],Ie=C[P+2],(ye&192)===128&&(Ie&192)===128&&(Ne=(U&15)<<12|(ye&63)<<6|Ie&63,Ne>2047&&(Ne<55296||Ne>57343)&&(X=Ne));break;case 4:ye=C[P+1],Ie=C[P+2],Fe=C[P+3],(ye&192)===128&&(Ie&192)===128&&(Fe&192)===128&&(Ne=(U&15)<<18|(ye&63)<<12|(Ie&63)<<6|Fe&63,Ne>65535&&Ne<1114112&&(X=Ne))}}X===null?(X=65533,ee=1):X>65535&&(X-=65536,F.push(X>>>10&1023|55296),X=56320|X&1023),F.push(X),P+=ee}return se(F)}const H=4096;function se(C){const v=C.length;if(v<=H)return String.fromCharCode.apply(String,C);let b="",F=0;for(;F<v;)b+=String.fromCharCode.apply(String,C.slice(F,F+=H));return b}function Y(C,v,b){let F="";b=Math.min(C.length,b);for(let P=v;P<b;++P)F+=String.fromCharCode(C[P]&127);return F}function ae(C,v,b){let F="";b=Math.min(C.length,b);for(let P=v;P<b;++P)F+=String.fromCharCode(C[P]);return F}function ne(C,v,b){const F=C.length;(!v||v<0)&&(v=0),(!b||b<0||b>F)&&(b=F);let P="";for(let U=v;U<b;++U)P+=qn[C[U]];return P}function pe(C,v,b){const F=C.slice(v,b);let P="";for(let U=0;U<F.length-1;U+=2)P+=String.fromCharCode(F[U]+F[U+1]*256);return P}c.prototype.slice=function(v,b){const F=this.length;v=~~v,b=b===void 0?F:~~b,v<0?(v+=F,v<0&&(v=0)):v>F&&(v=F),b<0?(b+=F,b<0&&(b=0)):b>F&&(b=F),b<v&&(b=v);const P=this.subarray(v,b);return Object.setPrototypeOf(P,c.prototype),P};function fe(C,v,b){if(C%1!==0||C<0)throw new RangeError("offset is not uint");if(C+v>b)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(v,b,F){v=v>>>0,b=b>>>0,F||fe(v,b,this.length);let P=this[v],U=1,X=0;for(;++X<b&&(U*=256);)P+=this[v+X]*U;return P},c.prototype.readUintBE=c.prototype.readUIntBE=function(v,b,F){v=v>>>0,b=b>>>0,F||fe(v,b,this.length);let P=this[v+--b],U=1;for(;b>0&&(U*=256);)P+=this[v+--b]*U;return P},c.prototype.readUint8=c.prototype.readUInt8=function(v,b){return v=v>>>0,b||fe(v,1,this.length),this[v]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(v,b){return v=v>>>0,b||fe(v,2,this.length),this[v]|this[v+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(v,b){return v=v>>>0,b||fe(v,2,this.length),this[v]<<8|this[v+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(v,b){return v=v>>>0,b||fe(v,4,this.length),(this[v]|this[v+1]<<8|this[v+2]<<16)+this[v+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(v,b){return v=v>>>0,b||fe(v,4,this.length),this[v]*16777216+(this[v+1]<<16|this[v+2]<<8|this[v+3])},c.prototype.readBigUInt64LE=At(function(v){v=v>>>0,ut(v,"offset");const b=this[v],F=this[v+7];(b===void 0||F===void 0)&&gt(v,this.length-8);const P=b+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24,U=this[++v]+this[++v]*2**8+this[++v]*2**16+F*2**24;return BigInt(P)+(BigInt(U)<<BigInt(32))}),c.prototype.readBigUInt64BE=At(function(v){v=v>>>0,ut(v,"offset");const b=this[v],F=this[v+7];(b===void 0||F===void 0)&&gt(v,this.length-8);const P=b*2**24+this[++v]*2**16+this[++v]*2**8+this[++v],U=this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+F;return(BigInt(P)<<BigInt(32))+BigInt(U)}),c.prototype.readIntLE=function(v,b,F){v=v>>>0,b=b>>>0,F||fe(v,b,this.length);let P=this[v],U=1,X=0;for(;++X<b&&(U*=256);)P+=this[v+X]*U;return U*=128,P>=U&&(P-=Math.pow(2,8*b)),P},c.prototype.readIntBE=function(v,b,F){v=v>>>0,b=b>>>0,F||fe(v,b,this.length);let P=b,U=1,X=this[v+--P];for(;P>0&&(U*=256);)X+=this[v+--P]*U;return U*=128,X>=U&&(X-=Math.pow(2,8*b)),X},c.prototype.readInt8=function(v,b){return v=v>>>0,b||fe(v,1,this.length),this[v]&128?(255-this[v]+1)*-1:this[v]},c.prototype.readInt16LE=function(v,b){v=v>>>0,b||fe(v,2,this.length);const F=this[v]|this[v+1]<<8;return F&32768?F|4294901760:F},c.prototype.readInt16BE=function(v,b){v=v>>>0,b||fe(v,2,this.length);const F=this[v+1]|this[v]<<8;return F&32768?F|4294901760:F},c.prototype.readInt32LE=function(v,b){return v=v>>>0,b||fe(v,4,this.length),this[v]|this[v+1]<<8|this[v+2]<<16|this[v+3]<<24},c.prototype.readInt32BE=function(v,b){return v=v>>>0,b||fe(v,4,this.length),this[v]<<24|this[v+1]<<16|this[v+2]<<8|this[v+3]},c.prototype.readBigInt64LE=At(function(v){v=v>>>0,ut(v,"offset");const b=this[v],F=this[v+7];(b===void 0||F===void 0)&&gt(v,this.length-8);const P=this[v+4]+this[v+5]*2**8+this[v+6]*2**16+(F<<24);return(BigInt(P)<<BigInt(32))+BigInt(b+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24)}),c.prototype.readBigInt64BE=At(function(v){v=v>>>0,ut(v,"offset");const b=this[v],F=this[v+7];(b===void 0||F===void 0)&&gt(v,this.length-8);const P=(b<<24)+this[++v]*2**16+this[++v]*2**8+this[++v];return(BigInt(P)<<BigInt(32))+BigInt(this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+F)}),c.prototype.readFloatLE=function(v,b){return v=v>>>0,b||fe(v,4,this.length),n.read(this,v,!0,23,4)},c.prototype.readFloatBE=function(v,b){return v=v>>>0,b||fe(v,4,this.length),n.read(this,v,!1,23,4)},c.prototype.readDoubleLE=function(v,b){return v=v>>>0,b||fe(v,8,this.length),n.read(this,v,!0,52,8)},c.prototype.readDoubleBE=function(v,b){return v=v>>>0,b||fe(v,8,this.length),n.read(this,v,!1,52,8)};function be(C,v,b,F,P,U){if(!c.isBuffer(C))throw new TypeError('"buffer" argument must be a Buffer instance');if(v>P||v<U)throw new RangeError('"value" argument is out of bounds');if(b+F>C.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(v,b,F,P){if(v=+v,b=b>>>0,F=F>>>0,!P){const ee=Math.pow(2,8*F)-1;be(this,v,b,F,ee,0)}let U=1,X=0;for(this[b]=v&255;++X<F&&(U*=256);)this[b+X]=v/U&255;return b+F},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(v,b,F,P){if(v=+v,b=b>>>0,F=F>>>0,!P){const ee=Math.pow(2,8*F)-1;be(this,v,b,F,ee,0)}let U=F-1,X=1;for(this[b+U]=v&255;--U>=0&&(X*=256);)this[b+U]=v/X&255;return b+F},c.prototype.writeUint8=c.prototype.writeUInt8=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,1,255,0),this[b]=v&255,b+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,2,65535,0),this[b]=v&255,this[b+1]=v>>>8,b+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,2,65535,0),this[b]=v>>>8,this[b+1]=v&255,b+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,4,4294967295,0),this[b+3]=v>>>24,this[b+2]=v>>>16,this[b+1]=v>>>8,this[b]=v&255,b+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,4,4294967295,0),this[b]=v>>>24,this[b+1]=v>>>16,this[b+2]=v>>>8,this[b+3]=v&255,b+4};function xe(C,v,b,F,P){Tt(v,F,P,C,b,7);let U=Number(v&BigInt(4294967295));C[b++]=U,U=U>>8,C[b++]=U,U=U>>8,C[b++]=U,U=U>>8,C[b++]=U;let X=Number(v>>BigInt(32)&BigInt(4294967295));return C[b++]=X,X=X>>8,C[b++]=X,X=X>>8,C[b++]=X,X=X>>8,C[b++]=X,b}function he(C,v,b,F,P){Tt(v,F,P,C,b,7);let U=Number(v&BigInt(4294967295));C[b+7]=U,U=U>>8,C[b+6]=U,U=U>>8,C[b+5]=U,U=U>>8,C[b+4]=U;let X=Number(v>>BigInt(32)&BigInt(4294967295));return C[b+3]=X,X=X>>8,C[b+2]=X,X=X>>8,C[b+1]=X,X=X>>8,C[b]=X,b+8}c.prototype.writeBigUInt64LE=At(function(v,b=0){return xe(this,v,b,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=At(function(v,b=0){return he(this,v,b,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(v,b,F,P){if(v=+v,b=b>>>0,!P){const ye=Math.pow(2,8*F-1);be(this,v,b,F,ye-1,-ye)}let U=0,X=1,ee=0;for(this[b]=v&255;++U<F&&(X*=256);)v<0&&ee===0&&this[b+U-1]!==0&&(ee=1),this[b+U]=(v/X>>0)-ee&255;return b+F},c.prototype.writeIntBE=function(v,b,F,P){if(v=+v,b=b>>>0,!P){const ye=Math.pow(2,8*F-1);be(this,v,b,F,ye-1,-ye)}let U=F-1,X=1,ee=0;for(this[b+U]=v&255;--U>=0&&(X*=256);)v<0&&ee===0&&this[b+U+1]!==0&&(ee=1),this[b+U]=(v/X>>0)-ee&255;return b+F},c.prototype.writeInt8=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,1,127,-128),v<0&&(v=255+v+1),this[b]=v&255,b+1},c.prototype.writeInt16LE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,2,32767,-32768),this[b]=v&255,this[b+1]=v>>>8,b+2},c.prototype.writeInt16BE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,2,32767,-32768),this[b]=v>>>8,this[b+1]=v&255,b+2},c.prototype.writeInt32LE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,4,2147483647,-2147483648),this[b]=v&255,this[b+1]=v>>>8,this[b+2]=v>>>16,this[b+3]=v>>>24,b+4},c.prototype.writeInt32BE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,4,2147483647,-2147483648),v<0&&(v=4294967295+v+1),this[b]=v>>>24,this[b+1]=v>>>16,this[b+2]=v>>>8,this[b+3]=v&255,b+4},c.prototype.writeBigInt64LE=At(function(v,b=0){return xe(this,v,b,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=At(function(v,b=0){return he(this,v,b,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ie(C,v,b,F,P,U){if(b+F>C.length)throw new RangeError("Index out of range");if(b<0)throw new RangeError("Index out of range")}function de(C,v,b,F,P){return v=+v,b=b>>>0,P||ie(C,v,b,4),n.write(C,v,b,F,23,4),b+4}c.prototype.writeFloatLE=function(v,b,F){return de(this,v,b,!0,F)},c.prototype.writeFloatBE=function(v,b,F){return de(this,v,b,!1,F)};function ue(C,v,b,F,P){return v=+v,b=b>>>0,P||ie(C,v,b,8),n.write(C,v,b,F,52,8),b+8}c.prototype.writeDoubleLE=function(v,b,F){return ue(this,v,b,!0,F)},c.prototype.writeDoubleBE=function(v,b,F){return ue(this,v,b,!1,F)},c.prototype.copy=function(v,b,F,P){if(!c.isBuffer(v))throw new TypeError("argument should be a Buffer");if(F||(F=0),!P&&P!==0&&(P=this.length),b>=v.length&&(b=v.length),b||(b=0),P>0&&P<F&&(P=F),P===F||v.length===0||this.length===0)return 0;if(b<0)throw new RangeError("targetStart out of bounds");if(F<0||F>=this.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("sourceEnd out of bounds");P>this.length&&(P=this.length),v.length-b<P-F&&(P=v.length-b+F);const U=P-F;return this===v&&typeof s.prototype.copyWithin=="function"?this.copyWithin(b,F,P):s.prototype.set.call(v,this.subarray(F,P),b),U},c.prototype.fill=function(v,b,F,P){if(typeof v=="string"){if(typeof b=="string"?(P=b,b=0,F=this.length):typeof F=="string"&&(P=F,F=this.length),P!==void 0&&typeof P!="string")throw new TypeError("encoding must be a string");if(typeof P=="string"&&!c.isEncoding(P))throw new TypeError("Unknown encoding: "+P);if(v.length===1){const X=v.charCodeAt(0);(P==="utf8"&&X<128||P==="latin1")&&(v=X)}}else typeof v=="number"?v=v&255:typeof v=="boolean"&&(v=Number(v));if(b<0||this.length<b||this.length<F)throw new RangeError("Out of range index");if(F<=b)return this;b=b>>>0,F=F===void 0?this.length:F>>>0,v||(v=0);let U;if(typeof v=="number")for(U=b;U<F;++U)this[U]=v;else{const X=c.isBuffer(v)?v:c.from(v,P),ee=X.length;if(ee===0)throw new TypeError('The value "'+v+'" is invalid for argument "value"');for(U=0;U<F-b;++U)this[U+b]=X[U%ee]}return this};const Se={};function $e(C,v,b){Se[C]=class extends b{constructor(){super(),Object.defineProperty(this,"message",{value:v.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${C}]`,this.stack,delete this.name}get code(){return C}set code(P){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:P,writable:!0})}toString(){return`${this.name} [${C}]: ${this.message}`}}}$e("ERR_BUFFER_OUT_OF_BOUNDS",function(C){return C?`${C} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),$e("ERR_INVALID_ARG_TYPE",function(C,v){return`The "${C}" argument must be of type number. Received type ${typeof v}`},TypeError),$e("ERR_OUT_OF_RANGE",function(C,v,b){let F=`The value of "${C}" is out of range.`,P=b;return Number.isInteger(b)&&Math.abs(b)>2**32?P=Ve(String(b)):typeof b=="bigint"&&(P=String(b),(b>BigInt(2)**BigInt(32)||b<-(BigInt(2)**BigInt(32)))&&(P=Ve(P)),P+="n"),F+=` It must be ${v}. Received ${P}`,F},RangeError);function Ve(C){let v="",b=C.length;const F=C[0]==="-"?1:0;for(;b>=F+4;b-=3)v=`_${C.slice(b-3,b)}${v}`;return`${C.slice(0,b)}${v}`}function lt(C,v,b){ut(v,"offset"),(C[v]===void 0||C[v+b]===void 0)&&gt(v,C.length-(b+1))}function Tt(C,v,b,F,P,U){if(C>b||C<v){const X=typeof v=="bigint"?"n":"";let ee;throw v===0||v===BigInt(0)?ee=`>= 0${X} and < 2${X} ** ${(U+1)*8}${X}`:ee=`>= -(2${X} ** ${(U+1)*8-1}${X}) and < 2 ** ${(U+1)*8-1}${X}`,new Se.ERR_OUT_OF_RANGE("value",ee,C)}lt(F,P,U)}function ut(C,v){if(typeof C!="number")throw new Se.ERR_INVALID_ARG_TYPE(v,"number",C)}function gt(C,v,b){throw Math.floor(C)!==C?(ut(C,b),new Se.ERR_OUT_OF_RANGE("offset","an integer",C)):v<0?new Se.ERR_BUFFER_OUT_OF_BOUNDS:new Se.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${v}`,C)}const ve=/[^+/0-9A-Za-z-_]/g;function ke(C){if(C=C.split("=")[0],C=C.trim().replace(ve,""),C.length<2)return"";for(;C.length%4!==0;)C=C+"=";return C}function qe(C,v){v=v||1/0;let b;const F=C.length;let P=null;const U=[];for(let X=0;X<F;++X){if(b=C.charCodeAt(X),b>55295&&b<57344){if(!P){if(b>56319){(v-=3)>-1&&U.push(239,191,189);continue}else if(X+1===F){(v-=3)>-1&&U.push(239,191,189);continue}P=b;continue}if(b<56320){(v-=3)>-1&&U.push(239,191,189),P=b;continue}b=(P-55296<<10|b-56320)+65536}else P&&(v-=3)>-1&&U.push(239,191,189);if(P=null,b<128){if((v-=1)<0)break;U.push(b)}else if(b<2048){if((v-=2)<0)break;U.push(b>>6|192,b&63|128)}else if(b<65536){if((v-=3)<0)break;U.push(b>>12|224,b>>6&63|128,b&63|128)}else if(b<1114112){if((v-=4)<0)break;U.push(b>>18|240,b>>12&63|128,b>>6&63|128,b&63|128)}else throw new Error("Invalid code point")}return U}function We(C){const v=[];for(let b=0;b<C.length;++b)v.push(C.charCodeAt(b)&255);return v}function Jt(C,v){let b,F,P;const U=[];for(let X=0;X<C.length&&!((v-=2)<0);++X)b=C.charCodeAt(X),F=b>>8,P=b%256,U.push(P),U.push(F);return U}function Xt(C){return t.toByteArray(ke(C))}function kt(C,v,b,F){let P;for(P=0;P<F&&!(P+b>=v.length||P>=C.length);++P)v[P+b]=C[P];return P}function dt(C,v){return C instanceof v||C!=null&&C.constructor!=null&&C.constructor.name!=null&&C.constructor.name===v.name}function mn(C){return C!==C}const qn=(function(){const C="0123456789abcdef",v=new Array(256);for(let b=0;b<16;++b){const F=b*16;for(let P=0;P<16;++P)v[F+P]=C[b]+C[P]}return v})();function At(C){return typeof BigInt>"u"?En:C}function En(){throw new Error("BigInt not supported")}})(uf);const gi=uf.Buffer;class fo extends Error{name="RuntimeError";constructor(t,...n){super([t,...n].filter(Boolean).join(", ")),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class ZS extends fo{name="ApiError"}const gl=(e,t="")=>{const n=document.createElement("a");n.style.display="none",document.body.appendChild(n),n.href=e,n.setAttribute("download",t),n.click(),document.body.removeChild(n)},vl=(e="")=>e.split("/").map(encodeURIComponent).join("/"),e0=e=>{const t=[],n=(r,o="")=>Object.keys(r).forEach(s=>{tl(r[s])?n(r[s],`${o}${s}.`):t.push(`${o}${s}`)});return n(e),t},yl=e=>{const t=e.startsWith("v")?e.slice(1):e,[n,r]=t.split("-"),[o,s,i]=n.split(".").map(Number);return{major:o,minor:s,patch:i,pre:r}},bl=(e,t)=>{const n=yl(e),r=yl(t);return n.major!==r.major?n.major-r.major:n.minor!==r.minor?n.minor-r.minor:n.patch!==r.patch?n.patch-r.patch:n.pre&&!r.pre?-1:!n.pre&&r.pre?1:n.pre&&r.pre?n.pre.localeCompare(r.pre):0};class t0{clientService;userStore;serverUrl;capability;available;constructor(t,n,r,o=W([])){this.clientService=t,this.userStore=n,this.serverUrl=r,this.capability=A(()=>{const s=a(o).filter(i=>i.enabled).sort((i,l)=>bl(l.version,i.version));return s.length?s[0]:null}),this.available=A(()=>!!a(this.capability)?.version)}async triggerDownload(t){if(!a(this.available))throw new fo("no archiver available");if((t.fileIds?.length||0)+(t.files?.length||0)===0)throw new fo("requested archive with empty list of resources");const n=this.buildDownloadUrl({...t});if(!n)throw new fo("download url could not be built");let r=t.publicToken?n:await this.clientService.ocs.signUrl(n,this.userStore.user?.onPremisesSamAccountName),o;if(t.publicLinkPassword)try{const s=await fetch(r,{headers:{...this.clientService.getRequestHeaders({useAuth:!1}),Authorization:"Basic "+gi.from(["public",t.publicLinkPassword].join(":")).toString("base64")}});if(!s.ok)throw new z.HttpError("",s);const i=await s.blob();r=URL.createObjectURL(i),o=decodeURI(s.headers.get("content-disposition")?.split('"')[1])}catch{throw new Error("archive could not be fetched")}return gl(r,o),r}buildDownloadUrl(t){const n=[];return t.publicToken&&n.push(`public-token=${t.publicToken}`),n.push(...t.fileIds.map(r=>`id=${r}`)),this.url+"?"+n.join("&")}get url(){if(!this.available)throw new fo("no archiver available");const t=a(this.capability);return/^https?:\/\//i.test(t.archiver_url)?t.archiver_url:z.urlJoin(this.serverUrl,t.archiver_url)}}const n0=new nf({ttl:10*1e3,capacity:250});class r0{get filePreview(){return n0}}const wl=new r0;class Sl{accessToken;publicLinkToken;publicLinkPassword;constructor(t={}){this.accessToken=t.accessToken,this.publicLinkToken=t.publicLinkToken,this.publicLinkPassword=t.publicLinkPassword}getHeaders(){return{...this.publicLinkToken&&{"public-token":this.publicLinkToken},...this.publicLinkPassword&&{Authorization:"Basic "+gi.from(["public",this.publicLinkPassword].join(":")).toString("base64")},...this.accessToken&&!this.publicLinkPassword&&!this.publicLinkToken&&{Authorization:"Bearer "+this.accessToken}}}}class Tl{instance;cancelToken;constructor(t,n){this.cancelToken=Es.CancelToken.source(),this.instance=Es.create(t),n&&this.instance.interceptors.request.use(n)}cancel(t){this.cancelToken.cancel(t)}async delete(t,n,r){return await this.internalRequestWithData("delete",t,n,r)}get(t,n){return this.internalRequest("get",t,n)}head(t,n){return this.internalRequest("head",t,n)}options(t,n){return this.internalRequest("options",t,n)}patch(t,n,r){return this.internalRequestWithData("patch",t,n,r)}post(t,n,r){return this.internalRequestWithData("post",t,n,r)}put(t,n,r){return this.internalRequestWithData("put",t,n,r)}async request(t){const n=await this.instance.request(this.obtainConfig(t));return this.processResponse(n,t)}obtainConfig(t){return Go({cancelToken:this.cancelToken.token},t)}processResponse(t,n){if(n?.schema){const r=n.schema.parse(t.data);return{...t,data:r}}return t}async internalRequest(t,n,r){const o=await this.instance[t](n,this.obtainConfig(r));return this.processResponse(o,r)}async internalRequestWithData(t,n,r,o){const s=await this.instance[t](n,r,this.obtainConfig(o));return this.processResponse(s,o)}}class o0 extends Error{name="RetriableError"}const s0=15e3;class i0{url;fetchOptions;abortController;eventListenerMap;readyState;withCredentials;CONNECTING;OPEN;CLOSED;onerror;onmessage;onopen;constructor(t,n){this.url=t,this.fetchOptions=n,this.abortController=new AbortController,this.eventListenerMap={},this.readyState=this.CONNECTING,this.connect()}connect(){return Ig.fetchEventSource(this.url,{openWhenHidden:!0,signal:this.abortController.signal,fetch:this.fetchProvider.bind(this),onopen:async()=>{const t=new Event("open");this.onopen?.bind(this)(t),this.readyState=this.OPEN},onmessage:t=>{const n=new MessageEvent("message",{data:t.data});this.onmessage?.bind(this)(n);const r=t.event;this.eventListenerMap[r]?.forEach(s=>s(n))},onclose:()=>{throw this.readyState=this.CLOSED,new o0},onerror:t=>{console.error(t);const n=new CustomEvent("error",{detail:t});return this.onerror?.bind(this)(n),3e4+Math.floor(Math.random()*s0)}})}fetchProvider(...t){const[n,r]=t,o={...r,...this.fetchOptions};return window.fetch(n,o)}close(){this.abortController.abort("closed")}addEventListener(t,n){this.eventListenerMap[t]=this.eventListenerMap[t]||[],this.eventListenerMap[t].push(n)}removeEventListener(t,n){this.eventListenerMap[t]=this.eventListenerMap[t]?.filter(r=>r!==n)}dispatchEvent(){throw new Error("Method not implemented.")}updateAccessToken(t){this.fetchOptions.headers.Authorization=`Bearer ${t}`}updateLanguage(t){this.fetchOptions.headers["Accept-Language"]=t,this.close(),this.connect()}}let kl=null;const a0=(e,t)=>(kl||(kl=new i0(new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse",e).href,t)),kl),l0=(e,t)=>({headers:{Authorization:`Bearer ${e.accessToken}`,"Accept-Language":t,"X-Request-ID":Ct.v4(),"X-Requested-With":"XMLHttpRequest"}});class c0{configStore;language;authStore;httpAuthenticatedClient;httpUnAuthenticatedClient;graphClient;ocsClient;webDavClient;initiatorId=Ct.v4();staticHeaders={"Initiator-ID":this.initiatorId,"X-Requested-With":"XMLHttpRequest"};constructor(t){this.configStore=t.configStore,this.language=t.language,this.authStore=t.authStore,this.initGraphClient(),this.initOcsClient(),this.initWebDavClient(),this.httpAuthenticatedClient=new Tl({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.httpUnAuthenticatedClient=new Tl({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders({useAuth:!1})),n))}get httpAuthenticated(){return this.httpAuthenticatedClient}get httpUnAuthenticated(){return this.httpUnAuthenticatedClient}get graphAuthenticated(){return this.graphClient}get sseAuthenticated(){return a0(this.configStore.serverUrl,l0({accessToken:this.authStore.accessToken},this.currentLanguage))}get ocs(){return this.ocsClient}get webdav(){return this.webDavClient}get currentLanguage(){return this.language.current}getRequestHeaders=({useAuth:t=!0}={})=>({...this.staticHeaders,...this.getDynamicHeaders({useAuth:t})});initGraphClient(){const t=Es.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.graphClient=z.graph(this.configStore.serverUrl,t)}initOcsClient(){const t=Es.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.ocsClient=z.ocs(this.configStore.serverUrl,t)}initWebDavClient(){this.webDavClient=z.webdav(this.configStore.serverUrl,()=>{const t={...this.staticHeaders,...this.getDynamicHeaders()};return this.authStore.publicLinkToken&&(t["public-token"]=this.authStore.publicLinkToken),this.authStore.publicLinkPassword&&(t.Authorization="Basic "+gi.from(["public",this.authStore.publicLinkPassword].join(":")).toString("base64")),t})}getDynamicHeaders({useAuth:t=!0}={}){return{"Accept-Language":this.currentLanguage,"X-Request-ID":Ct.v4(),...t&&{Authorization:"Bearer "+this.authStore.accessToken}}}}class ff{topics;constructor(){this.topics=new Map}subscribe(t,n){const r={token:Ct.v4(),callback:n},o=[r,...this.topics.get(t)||[]];return this.topics.set(t,o),r.token}publish(t,n){(this.topics.get(t)||[]).forEach(o=>o.callback(n))}unsubscribe(t,n){this.topics.has(t)&&this.topics.set(t,this.topics.get(t).filter(r=>r.token!==n))}}const ze=new ff;class pf{static Shared="S";static Shareable="R";static Mounted="M";static Deletable="D";static Renameable="N";static Moveable="V";static Updateable="NV";static FileUpdateable="W";static FolderCreateable="CK";static Deny="Z";static SecureView="X"}const vi=e=>({value:e,type:null}),u0=e=>vi(e),Ze=e=>vi(e),yi=e=>vi(e),d0=e=>vi(e),f0={Permissions:Ze("permissions"),IsFavorite:yi("favorite"),FileId:Ze("fileid"),FileParent:Ze("file-parent"),Name:Ze("name"),OwnerId:Ze("owner-id"),OwnerDisplayName:Ze("owner-display-name"),PrivateLink:Ze("privatelink"),ContentLength:yi("getcontentlength"),ContentSize:yi("size"),LastModifiedDate:Ze("getlastmodified"),Tags:u0("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:Ze("getetag"),MimeType:Ze("getcontenttype"),ResourceType:d0("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:Ze("owner"),LockTime:Ze("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:Ze("downloadURL"),Highlights:Ze("highlights"),MetaPathForUser:Ze("meta-path-for-user"),RemoteItemId:Ze("remote-item-id"),HasPreview:yi("has-preview"),ShareId:Ze("shareid"),ShareRoot:Ze("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:Ze("share-permissions"),TrashbinOriginalFilename:Ze("trashbin-original-filename"),TrashbinOriginalLocation:Ze("trashbin-original-location"),TrashbinDeletedDate:Ze("trashbin-delete-datetime"),PublicLinkItemType:Ze("public-link-item-type"),PublicLinkPermission:Ze("public-link-permission"),PublicLinkExpiration:Ze("public-link-expiration"),PublicLinkShareDate:Ze("public-link-share-datetime"),PublicLinkShareOwner:Ze("public-link-share-owner")},Ee=Object.fromEntries(Object.entries(f0).map(([e,t])=>[e,t.value]));class Jo{static Default=[Ee.Permissions,Ee.IsFavorite,Ee.FileId,Ee.FileParent,Ee.Name,Ee.LockDiscovery,Ee.ActiveLock,Ee.OwnerId,Ee.OwnerDisplayName,Ee.RemoteItemId,Ee.ShareRoot,Ee.ShareTypes,Ee.PrivateLink,Ee.ContentLength,Ee.ContentSize,Ee.LastModifiedDate,Ee.ETag,Ee.MimeType,Ee.ResourceType,Ee.Tags,Ee.Audio,Ee.Location,Ee.Image,Ee.Photo,Ee.HasPreview];static PublicLink=Jo.Default.concat([Ee.PublicLinkItemType,Ee.PublicLinkPermission,Ee.PublicLinkExpiration,Ee.PublicLinkShareDate,Ee.PublicLinkShareOwner]);static Trashbin=[Ee.ContentLength,Ee.ResourceType,Ee.TrashbinOriginalLocation,Ee.TrashbinOriginalFilename,Ee.TrashbinDeletedDate,Ee.Permissions,Ee.FileParent];static DavNamespace=[Ee.ContentLength,Ee.LastModifiedDate,Ee.ETag,Ee.MimeType,Ee.ResourceType,Ee.LockDiscovery,Ee.ActiveLock]}var p0="[object Symbol]";function bi(e){return typeof e=="symbol"||Ln(e)&&Ir(e)==p0}var h0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,m0=/^\w*$/;function g0(e,t){if(Tn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||bi(e)?!0:m0.test(e)||!h0.test(e)||t!=null&&e in Object(t)}var v0="Expected a function";function Cl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(v0);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],s=n.cache;if(s.has(o))return s.get(o);var i=e.apply(this,r);return n.cache=s.set(o,i)||s,i};return n.cache=new(Cl.Cache||Zn),n}Cl.Cache=Zn;var y0=500;function b0(e){var t=Cl(e,function(r){return n.size===y0&&n.clear(),r}),n=t.cache;return t}var w0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,S0=/\\(\\)?/g,T0=b0(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(w0,function(n,r,o,s){t.push(o?s.replace(S0,"$1"):r||n)}),t});function hf(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var mf=sn?sn.prototype:void 0,gf=mf?mf.toString:void 0;function vf(e){if(typeof e=="string")return e;if(Tn(e))return hf(e,vf)+"";if(bi(e))return gf?gf.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function xl(e){return e==null?"":vf(e)}function Al(e,t){return Tn(e)?e:g0(e,t)?[e]:T0(xl(e))}function yf(e){if(typeof e=="string"||bi(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function bf(e,t){t=Al(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[yf(t[n++])];return n&&n==r?e:void 0}function El(e,t,n){var r=e==null?void 0:bf(e,t);return r===void 0?n:r}var k0={2:e=>{function t(o,s,i){o instanceof RegExp&&(o=n(o,i)),s instanceof RegExp&&(s=n(s,i));var l=r(o,s,i);return l&&{start:l[0],end:l[1],pre:i.slice(0,l[0]),body:i.slice(l[0]+o.length,l[1]),post:i.slice(l[1]+s.length)}}function n(o,s){var i=s.match(o);return i?i[0]:null}function r(o,s,i){var l,u,d,c,p,f=i.indexOf(o),h=i.indexOf(s,f+1),g=f;if(f>=0&&h>0){for(l=[],d=i.length;g>=0&&!p;)g==f?(l.push(g),f=i.indexOf(o,g+1)):l.length==1?p=[l.pop(),h]:((u=l.pop())<d&&(d=u,c=h),h=i.indexOf(s,g+1)),g=f<h&&f>=0?f:h;l.length&&(p=[d,c])}return p}e.exports=t,t.range=r},47:(e,t,n)=>{var r=n(410),o=function(d){return typeof d=="string"};function s(d,c){for(var p=[],f=0;f<d.length;f++){var h=d[f];h&&h!=="."&&(h===".."?p.length&&p[p.length-1]!==".."?p.pop():c&&p.push(".."):p.push(h))}return p}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,l={};function u(d){return i.exec(d).slice(1)}l.resolve=function(){for(var d="",c=!1,p=arguments.length-1;p>=-1&&!c;p--){var f=p>=0?arguments[p]:ce.cwd();if(!o(f))throw new TypeError("Arguments to path.resolve must be strings");f&&(d=f+"/"+d,c=f.charAt(0)==="/")}return(c?"/":"")+(d=s(d.split("/"),!c).join("/"))||"."},l.normalize=function(d){var c=l.isAbsolute(d),p=d.substr(-1)==="/";return(d=s(d.split("/"),!c).join("/"))||c||(d="."),d&&p&&(d+="/"),(c?"/":"")+d},l.isAbsolute=function(d){return d.charAt(0)==="/"},l.join=function(){for(var d="",c=0;c<arguments.length;c++){var p=arguments[c];if(!o(p))throw new TypeError("Arguments to path.join must be strings");p&&(d+=d?"/"+p:p)}return l.normalize(d)},l.relative=function(d,c){function p(k){for(var S=0;S<k.length&&k[S]==="";S++);for(var y=k.length-1;y>=0&&k[y]==="";y--);return S>y?[]:k.slice(S,y+1)}d=l.resolve(d).substr(1),c=l.resolve(c).substr(1);for(var f=p(d.split("/")),h=p(c.split("/")),g=Math.min(f.length,h.length),m=g,w=0;w<g;w++)if(f[w]!==h[w]){m=w;break}var T=[];for(w=m;w<f.length;w++)T.push("..");return(T=T.concat(h.slice(m))).join("/")},l._makeLong=function(d){return d},l.dirname=function(d){var c=u(d),p=c[0],f=c[1];return p||f?(f&&(f=f.substr(0,f.length-1)),p+f):"."},l.basename=function(d,c){var p=u(d)[2];return c&&p.substr(-1*c.length)===c&&(p=p.substr(0,p.length-c.length)),p},l.extname=function(d){return u(d)[3]},l.format=function(d){if(!r.isObject(d))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof d);var c=d.root||"";if(!o(c))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof d.root);return(d.dir?d.dir+l.sep:"")+(d.base||"")},l.parse=function(d){if(!o(d))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof d);var c=u(d);if(!c||c.length!==4)throw new TypeError("Invalid path '"+d+"'");return c[1]=c[1]||"",c[2]=c[2]||"",c[3]=c[3]||"",{root:c[0],dir:c[0]+c[1].slice(0,c[1].length-1),base:c[2],ext:c[3],name:c[2].slice(0,c[2].length-c[3].length)}},l.sep="/",l.delimiter=":",e.exports=l},101:function(e,t,n){var r;e=n.nmd(e),(function(){var o=(e&&e.exports,typeof br=="object"&&br);o.global!==o&&o.window;var s=function(c){this.message=c};(s.prototype=new Error).name="InvalidCharacterError";var i=function(c){throw new s(c)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,d={encode:function(c){c=String(c),/[^\0-\xFF]/.test(c)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var p,f,h,g,m=c.length%3,w="",T=-1,k=c.length-m;++T<k;)p=c.charCodeAt(T)<<16,f=c.charCodeAt(++T)<<8,h=c.charCodeAt(++T),w+=l.charAt((g=p+f+h)>>18&63)+l.charAt(g>>12&63)+l.charAt(g>>6&63)+l.charAt(63&g);return m==2?(p=c.charCodeAt(T)<<8,f=c.charCodeAt(++T),w+=l.charAt((g=p+f)>>10)+l.charAt(g>>4&63)+l.charAt(g<<2&63)+"="):m==1&&(g=c.charCodeAt(T),w+=l.charAt(g>>2)+l.charAt(g<<4&63)+"=="),w},decode:function(c){var p=(c=String(c).replace(u,"")).length;p%4==0&&(p=(c=c.replace(/==?$/,"")).length),(p%4==1||/[^+a-zA-Z0-9/]/.test(c))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var f,h,g=0,m="",w=-1;++w<p;)h=l.indexOf(c.charAt(w)),f=g%4?64*f+h:h,g++%4&&(m+=String.fromCharCode(255&f>>(-2*g&6)));return m},version:"1.0.0"};(r=(function(){return d}).call(t,n,t,e))===void 0||(e.exports=r)})()},135:e=>{function t(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}e.exports=function(n){return n!=null&&(t(n)||(function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&t(r.slice(0,0))})(n)||!!n._isBuffer)}},172:(e,t)=>{t.d=function(n){if(!n)return 0;for(var r=(n=n.toString()).length,o=n.length;o--;){var s=n.charCodeAt(o);56320<=s&&s<=57343&&o--,127<s&&s<=2047?r++:2047<s&&s<=65535&&(r+=2)}return r}},285:(e,t,n)=>{var r=n(2);e.exports=function(T){return T?(T.substr(0,2)==="{}"&&(T="\\{\\}"+T.substr(2)),w((function(k){return k.split("\\\\").join(o).split("\\{").join(s).split("\\}").join(i).split("\\,").join(l).split("\\.").join(u)})(T),!0).map(c)):[]};var o="\0SLASH"+Math.random()+"\0",s="\0OPEN"+Math.random()+"\0",i="\0CLOSE"+Math.random()+"\0",l="\0COMMA"+Math.random()+"\0",u="\0PERIOD"+Math.random()+"\0";function d(T){return parseInt(T,10)==T?parseInt(T,10):T.charCodeAt(0)}function c(T){return T.split(o).join("\\").split(s).join("{").split(i).join("}").split(l).join(",").split(u).join(".")}function p(T){if(!T)return[""];var k=[],S=r("{","}",T);if(!S)return T.split(",");var y=S.pre,E=S.body,D=S.post,$=y.split(",");$[$.length-1]+="{"+E+"}";var _=p(D);return D.length&&($[$.length-1]+=_.shift(),$.push.apply($,_)),k.push.apply(k,$),k}function f(T){return"{"+T+"}"}function h(T){return/^-?0\d/.test(T)}function g(T,k){return T<=k}function m(T,k){return T>=k}function w(T,k){var S=[],y=r("{","}",T);if(!y)return[T];var E=y.pre,D=y.post.length?w(y.post,!1):[""];if(/\$$/.test(y.pre))for(var $=0;$<D.length;$++){var _=E+"{"+y.body+"}"+D[$];S.push(_)}else{var L,V,te=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(y.body),B=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(y.body),O=te||B,M=y.body.indexOf(",")>=0;if(!O&&!M)return y.post.match(/,(?!,).*\}/)?w(T=y.pre+"{"+y.body+i+y.post):[T];if(O)L=y.body.split(/\.\./);else if((L=p(y.body)).length===1&&(L=w(L[0],!1).map(f)).length===1)return D.map((function(xe){return y.pre+L[0]+xe}));if(O){var N=d(L[0]),q=d(L[1]),j=Math.max(L[0].length,L[1].length),H=L.length==3?Math.abs(d(L[2])):1,se=g;q<N&&(H*=-1,se=m);var Y=L.some(h);V=[];for(var ae=N;se(ae,q);ae+=H){var ne;if(B)(ne=String.fromCharCode(ae))==="\\"&&(ne="");else if(ne=String(ae),Y){var pe=j-ne.length;if(pe>0){var fe=new Array(pe+1).join("0");ne=ae<0?"-"+fe+ne.slice(1):fe+ne}}V.push(ne)}}else{V=[];for(var be=0;be<L.length;be++)V.push.apply(V,w(L[be],!1))}for(be=0;be<V.length;be++)for($=0;$<D.length;$++)_=E+V[be]+D[$],(!k||O||_)&&S.push(_)}return S}},298:e=>{var t,n;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(r,o){return r<<o|r>>>32-o},rotr:function(r,o){return r<<32-o|r>>>o},endian:function(r){if(r.constructor==Number)return 16711935&n.rotl(r,8)|4278255360&n.rotl(r,24);for(var o=0;o<r.length;o++)r[o]=n.endian(r[o]);return r},randomBytes:function(r){for(var o=[];r>0;r--)o.push(Math.floor(256*Math.random()));return o},bytesToWords:function(r){for(var o=[],s=0,i=0;s<r.length;s++,i+=8)o[i>>>5]|=r[s]<<24-i%32;return o},wordsToBytes:function(r){for(var o=[],s=0;s<32*r.length;s+=8)o.push(r[s>>>5]>>>24-s%32&255);return o},bytesToHex:function(r){for(var o=[],s=0;s<r.length;s++)o.push((r[s]>>>4).toString(16)),o.push((15&r[s]).toString(16));return o.join("")},hexToBytes:function(r){for(var o=[],s=0;s<r.length;s+=2)o.push(parseInt(r.substr(s,2),16));return o},bytesToBase64:function(r){for(var o=[],s=0;s<r.length;s+=3)for(var i=r[s]<<16|r[s+1]<<8|r[s+2],l=0;l<4;l++)8*s+6*l<=8*r.length?o.push(t.charAt(i>>>6*(3-l)&63)):o.push("=");return o.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/gi,"");for(var o=[],s=0,i=0;s<r.length;i=++s%4)i!=0&&o.push((t.indexOf(r.charAt(s-1))&Math.pow(2,-2*i+8)-1)<<2*i|t.indexOf(r.charAt(s))>>>6-2*i);return o}},e.exports=n},345:()=>{},388:()=>{},410:()=>{},526:e=>{var t={utf8:{stringToBytes:function(n){return t.bin.stringToBytes(unescape(encodeURIComponent(n)))},bytesToString:function(n){return decodeURIComponent(escape(t.bin.bytesToString(n)))}},bin:{stringToBytes:function(n){for(var r=[],o=0;o<n.length;o++)r.push(255&n.charCodeAt(o));return r},bytesToString:function(n){for(var r=[],o=0;o<n.length;o++)r.push(String.fromCharCode(n[o]));return r.join("")}}};e.exports=t},542:(e,t,n)=>{(function(){var r=n(298),o=n(526).utf8,s=n(135),i=n(526).bin,l=function(u,d){u.constructor==String?u=d&&d.encoding==="binary"?i.stringToBytes(u):o.stringToBytes(u):s(u)?u=Array.prototype.slice.call(u,0):Array.isArray(u)||u.constructor===Uint8Array||(u=u.toString());for(var c=r.bytesToWords(u),p=8*u.length,f=1732584193,h=-271733879,g=-1732584194,m=271733878,w=0;w<c.length;w++)c[w]=16711935&(c[w]<<8|c[w]>>>24)|4278255360&(c[w]<<24|c[w]>>>8);c[p>>>5]|=128<<p%32,c[14+(p+64>>>9<<4)]=p;var T=l._ff,k=l._gg,S=l._hh,y=l._ii;for(w=0;w<c.length;w+=16){var E=f,D=h,$=g,_=m;f=T(f,h,g,m,c[w+0],7,-680876936),m=T(m,f,h,g,c[w+1],12,-389564586),g=T(g,m,f,h,c[w+2],17,606105819),h=T(h,g,m,f,c[w+3],22,-1044525330),f=T(f,h,g,m,c[w+4],7,-176418897),m=T(m,f,h,g,c[w+5],12,1200080426),g=T(g,m,f,h,c[w+6],17,-1473231341),h=T(h,g,m,f,c[w+7],22,-45705983),f=T(f,h,g,m,c[w+8],7,1770035416),m=T(m,f,h,g,c[w+9],12,-1958414417),g=T(g,m,f,h,c[w+10],17,-42063),h=T(h,g,m,f,c[w+11],22,-1990404162),f=T(f,h,g,m,c[w+12],7,1804603682),m=T(m,f,h,g,c[w+13],12,-40341101),g=T(g,m,f,h,c[w+14],17,-1502002290),f=k(f,h=T(h,g,m,f,c[w+15],22,1236535329),g,m,c[w+1],5,-165796510),m=k(m,f,h,g,c[w+6],9,-1069501632),g=k(g,m,f,h,c[w+11],14,643717713),h=k(h,g,m,f,c[w+0],20,-373897302),f=k(f,h,g,m,c[w+5],5,-701558691),m=k(m,f,h,g,c[w+10],9,38016083),g=k(g,m,f,h,c[w+15],14,-660478335),h=k(h,g,m,f,c[w+4],20,-405537848),f=k(f,h,g,m,c[w+9],5,568446438),m=k(m,f,h,g,c[w+14],9,-1019803690),g=k(g,m,f,h,c[w+3],14,-187363961),h=k(h,g,m,f,c[w+8],20,1163531501),f=k(f,h,g,m,c[w+13],5,-1444681467),m=k(m,f,h,g,c[w+2],9,-51403784),g=k(g,m,f,h,c[w+7],14,1735328473),f=S(f,h=k(h,g,m,f,c[w+12],20,-1926607734),g,m,c[w+5],4,-378558),m=S(m,f,h,g,c[w+8],11,-2022574463),g=S(g,m,f,h,c[w+11],16,1839030562),h=S(h,g,m,f,c[w+14],23,-35309556),f=S(f,h,g,m,c[w+1],4,-1530992060),m=S(m,f,h,g,c[w+4],11,1272893353),g=S(g,m,f,h,c[w+7],16,-155497632),h=S(h,g,m,f,c[w+10],23,-1094730640),f=S(f,h,g,m,c[w+13],4,681279174),m=S(m,f,h,g,c[w+0],11,-358537222),g=S(g,m,f,h,c[w+3],16,-722521979),h=S(h,g,m,f,c[w+6],23,76029189),f=S(f,h,g,m,c[w+9],4,-640364487),m=S(m,f,h,g,c[w+12],11,-421815835),g=S(g,m,f,h,c[w+15],16,530742520),f=y(f,h=S(h,g,m,f,c[w+2],23,-995338651),g,m,c[w+0],6,-198630844),m=y(m,f,h,g,c[w+7],10,1126891415),g=y(g,m,f,h,c[w+14],15,-1416354905),h=y(h,g,m,f,c[w+5],21,-57434055),f=y(f,h,g,m,c[w+12],6,1700485571),m=y(m,f,h,g,c[w+3],10,-1894986606),g=y(g,m,f,h,c[w+10],15,-1051523),h=y(h,g,m,f,c[w+1],21,-2054922799),f=y(f,h,g,m,c[w+8],6,1873313359),m=y(m,f,h,g,c[w+15],10,-30611744),g=y(g,m,f,h,c[w+6],15,-1560198380),h=y(h,g,m,f,c[w+13],21,1309151649),f=y(f,h,g,m,c[w+4],6,-145523070),m=y(m,f,h,g,c[w+11],10,-1120210379),g=y(g,m,f,h,c[w+2],15,718787259),h=y(h,g,m,f,c[w+9],21,-343485551),f=f+E>>>0,h=h+D>>>0,g=g+$>>>0,m=m+_>>>0}return r.endian([f,h,g,m])};l._ff=function(u,d,c,p,f,h,g){var m=u+(d&c|~d&p)+(f>>>0)+g;return(m<<h|m>>>32-h)+d},l._gg=function(u,d,c,p,f,h,g){var m=u+(d&p|c&~p)+(f>>>0)+g;return(m<<h|m>>>32-h)+d},l._hh=function(u,d,c,p,f,h,g){var m=u+(d^c^p)+(f>>>0)+g;return(m<<h|m>>>32-h)+d},l._ii=function(u,d,c,p,f,h,g){var m=u+(c^(d|~p))+(f>>>0)+g;return(m<<h|m>>>32-h)+d},l._blocksize=16,l._digestsize=16,e.exports=function(u,d){if(u==null)throw new Error("Illegal argument "+u);var c=r.wordsToBytes(l(u,d));return d&&d.asBytes?c:d&&d.asString?i.bytesToString(c):r.bytesToHex(c)}})()},647:(e,t)=>{var n=Object.prototype.hasOwnProperty;function r(s){try{return decodeURIComponent(s.replace(/\+/g," "))}catch{return null}}function o(s){try{return encodeURIComponent(s)}catch{return null}}t.stringify=function(s,i){i=i||"";var l,u,d=[];for(u in typeof i!="string"&&(i="?"),s)if(n.call(s,u)){if((l=s[u])||l!=null&&!isNaN(l)||(l=""),u=o(u),l=o(l),u===null||l===null)continue;d.push(u+"="+l)}return d.length?i+d.join("&"):""},t.parse=function(s){for(var i,l=/([^=?#&]+)=?([^&]*)/g,u={};i=l.exec(s);){var d=r(i[1]),c=r(i[2]);d===null||c===null||d in u||(u[d]=c)}return u}},670:e=>{e.exports=function(t,n){if(n=n.split(":")[0],!(t=+t))return!1;switch(n){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0}},737:(e,t,n)=>{var r=n(670),o=n(647),s=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i=/[\n\r\t]/g,l=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,u=/:\d+$/,d=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,c=/^[a-zA-Z]:/;function p(k){return(k||"").toString().replace(s,"")}var f=[["#","hash"],["?","query"],function(k,S){return m(S.protocol)?k.replace(/\\/g,"/"):k},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function g(k){var S,y=(typeof window<"u"?window:typeof br<"u"?br:typeof self<"u"?self:{}).location||{},E={},D=typeof(k=k||y);if(k.protocol==="blob:")E=new T(unescape(k.pathname),{});else if(D==="string")for(S in E=new T(k,{}),h)delete E[S];else if(D==="object"){for(S in k)S in h||(E[S]=k[S]);E.slashes===void 0&&(E.slashes=l.test(k.href))}return E}function m(k){return k==="file:"||k==="ftp:"||k==="http:"||k==="https:"||k==="ws:"||k==="wss:"}function w(k,S){k=(k=p(k)).replace(i,""),S=S||{};var y,E=d.exec(k),D=E[1]?E[1].toLowerCase():"",$=!!E[2],_=!!E[3],L=0;return $?_?(y=E[2]+E[3]+E[4],L=E[2].length+E[3].length):(y=E[2]+E[4],L=E[2].length):_?(y=E[3]+E[4],L=E[3].length):y=E[4],D==="file:"?L>=2&&(y=y.slice(2)):m(D)?y=E[4]:D?$&&(y=y.slice(2)):L>=2&&m(S.protocol)&&(y=E[4]),{protocol:D,slashes:$||m(D),slashesCount:L,rest:y}}function T(k,S,y){if(k=(k=p(k)).replace(i,""),!(this instanceof T))return new T(k,S,y);var E,D,$,_,L,V,te=f.slice(),B=typeof S,O=this,M=0;for(B!=="object"&&B!=="string"&&(y=S,S=null),y&&typeof y!="function"&&(y=o.parse),E=!(D=w(k||"",S=g(S))).protocol&&!D.slashes,O.slashes=D.slashes||E&&S.slashes,O.protocol=D.protocol||S.protocol||"",k=D.rest,(D.protocol==="file:"&&(D.slashesCount!==2||c.test(k))||!D.slashes&&(D.protocol||D.slashesCount<2||!m(O.protocol)))&&(te[3]=[/(.*)/,"pathname"]);M<te.length;M++)typeof(_=te[M])!="function"?($=_[0],V=_[1],$!=$?O[V]=k:typeof $=="string"?~(L=$==="@"?k.lastIndexOf($):k.indexOf($))&&(typeof _[2]=="number"?(O[V]=k.slice(0,L),k=k.slice(L+_[2])):(O[V]=k.slice(L),k=k.slice(0,L))):(L=$.exec(k))&&(O[V]=L[1],k=k.slice(0,L.index)),O[V]=O[V]||E&&_[3]&&S[V]||"",_[4]&&(O[V]=O[V].toLowerCase())):k=_(k,O);y&&(O.query=y(O.query)),E&&S.slashes&&O.pathname.charAt(0)!=="/"&&(O.pathname!==""||S.pathname!=="")&&(O.pathname=(function(N,q){if(N==="")return q;for(var j=(q||"/").split("/").slice(0,-1).concat(N.split("/")),H=j.length,se=j[H-1],Y=!1,ae=0;H--;)j[H]==="."?j.splice(H,1):j[H]===".."?(j.splice(H,1),ae++):ae&&(H===0&&(Y=!0),j.splice(H,1),ae--);return Y&&j.unshift(""),se!=="."&&se!==".."||j.push(""),j.join("/")})(O.pathname,S.pathname)),O.pathname.charAt(0)!=="/"&&m(O.protocol)&&(O.pathname="/"+O.pathname),r(O.port,O.protocol)||(O.host=O.hostname,O.port=""),O.username=O.password="",O.auth&&(~(L=O.auth.indexOf(":"))?(O.username=O.auth.slice(0,L),O.username=encodeURIComponent(decodeURIComponent(O.username)),O.password=O.auth.slice(L+1),O.password=encodeURIComponent(decodeURIComponent(O.password))):O.username=encodeURIComponent(decodeURIComponent(O.auth)),O.auth=O.password?O.username+":"+O.password:O.username),O.origin=O.protocol!=="file:"&&m(O.protocol)&&O.host?O.protocol+"//"+O.host:"null",O.href=O.toString()}T.prototype={set:function(k,S,y){var E=this;switch(k){case"query":typeof S=="string"&&S.length&&(S=(y||o.parse)(S)),E[k]=S;break;case"port":E[k]=S,r(S,E.protocol)?S&&(E.host=E.hostname+":"+S):(E.host=E.hostname,E[k]="");break;case"hostname":E[k]=S,E.port&&(S+=":"+E.port),E.host=S;break;case"host":E[k]=S,u.test(S)?(S=S.split(":"),E.port=S.pop(),E.hostname=S.join(":")):(E.hostname=S,E.port="");break;case"protocol":E.protocol=S.toLowerCase(),E.slashes=!y;break;case"pathname":case"hash":if(S){var D=k==="pathname"?"/":"#";E[k]=S.charAt(0)!==D?D+S:S}else E[k]=S;break;case"username":case"password":E[k]=encodeURIComponent(S);break;case"auth":var $=S.indexOf(":");~$?(E.username=S.slice(0,$),E.username=encodeURIComponent(decodeURIComponent(E.username)),E.password=S.slice($+1),E.password=encodeURIComponent(decodeURIComponent(E.password))):E.username=encodeURIComponent(decodeURIComponent(S))}for(var _=0;_<f.length;_++){var L=f[_];L[4]&&(E[L[1]]=E[L[1]].toLowerCase())}return E.auth=E.password?E.username+":"+E.password:E.username,E.origin=E.protocol!=="file:"&&m(E.protocol)&&E.host?E.protocol+"//"+E.host:"null",E.href=E.toString(),E},toString:function(k){k&&typeof k=="function"||(k=o.stringify);var S,y=this,E=y.host,D=y.protocol;D&&D.charAt(D.length-1)!==":"&&(D+=":");var $=D+(y.protocol&&y.slashes||m(y.protocol)?"//":"");return y.username?($+=y.username,y.password&&($+=":"+y.password),$+="@"):y.password?($+=":"+y.password,$+="@"):y.protocol!=="file:"&&m(y.protocol)&&!E&&y.pathname!=="/"&&($+="@"),(E[E.length-1]===":"||u.test(y.hostname)&&!y.port)&&(E+=":"),$+=E+y.pathname,(S=typeof y.query=="object"?k(y.query):y.query)&&($+=S.charAt(0)!=="?"?"?"+S:S),y.hash&&($+=y.hash),$}},T.extractProtocol=w,T.location=g,T.trimLeft=p,T.qs=o,e.exports=T},800:()=>{},805:()=>{},829:e=>{function t(d){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},t(d)}function n(d){var c=typeof Map=="function"?new Map:void 0;return n=function(p){if(p===null||(f=p,Function.toString.call(f).indexOf("[native code]")===-1))return p;var f;if(typeof p!="function")throw new TypeError("Super expression must either be null or a function");if(c!==void 0){if(c.has(p))return c.get(p);c.set(p,h)}function h(){return r(p,arguments,s(this).constructor)}return h.prototype=Object.create(p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),o(h,p)},n(d)}function r(d,c,p){return r=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch{return!1}})()?Reflect.construct:function(f,h,g){var m=[null];m.push.apply(m,h);var w=new(Function.bind.apply(f,m));return g&&o(w,g.prototype),w},r.apply(null,arguments)}function o(d,c){return o=Object.setPrototypeOf||function(p,f){return p.__proto__=f,p},o(d,c)}function s(d){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(c){return c.__proto__||Object.getPrototypeOf(c)},s(d)}var i=(function(d){function c(p){var f;return(function(h,g){if(!(h instanceof g))throw new TypeError("Cannot call a class as a function")})(this,c),(f=(function(h,g){return!g||t(g)!=="object"&&typeof g!="function"?(function(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m})(h):g})(this,s(c).call(this,p))).name="ObjectPrototypeMutationError",f}return(function(p,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(f&&f.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),f&&o(p,f)})(c,d),c})(n(Error));function l(d,c){for(var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},f=c.split("."),h=f.length,g=function(T){var k=f[T];if(!d)return{v:void 0};if(k==="+"){if(Array.isArray(d))return{v:d.map((function(y,E){var D=f.slice(T+1);return D.length>0?l(y,D.join("."),p):p(d,E,f,T)}))};var S=f.slice(0,T).join(".");throw new Error("Object at wildcard (".concat(S,") is not an array"))}d=p(d,k,f,T)},m=0;m<h;m++){var w=g(m);if(t(w)==="object")return w.v}return d}function u(d,c){return d.length===c+1}e.exports={set:function(d,c,p){if(t(d)!="object"||d===null||c===void 0)return d;if(typeof c=="number")return d[c]=p,d[c];try{return l(d,c,(function(f,h,g,m){if(f===Reflect.getPrototypeOf({}))throw new i("Attempting to mutate Object.prototype");if(!f[h]){var w=Number.isInteger(Number(g[m+1])),T=g[m+1]==="+";f[h]=w||T?[]:{}}return u(g,m)&&(f[h]=p),f[h]}))}catch(f){if(f instanceof i)throw f;return d}},get:function(d,c){if(t(d)!="object"||d===null||c===void 0)return d;if(typeof c=="number")return d[c];try{return l(d,c,(function(p,f){return p[f]}))}catch{return d}},has:function(d,c){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t(d)!="object"||d===null||c===void 0)return!1;if(typeof c=="number")return c in d;try{var f=!1;return l(d,c,(function(h,g,m,w){if(!u(m,w))return h&&h[g];f=p.own?h.hasOwnProperty(g):g in h})),f}catch{return!1}},hasOwn:function(d,c,p){return this.has(d,c,p||{own:!0})},isIn:function(d,c,p){var f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(d)!="object"||d===null||c===void 0)return!1;try{var h=!1,g=!1;return l(d,c,(function(m,w,T,k){return h=h||m===p||!!m&&m[w]===p,g=u(T,k)&&t(m)==="object"&&w in m,m&&m[w]})),f.validPath?h&&g:h}catch{return!1}},ObjectPrototypeMutationError:i}}},wf={};function it(e){var t=wf[e];if(t!==void 0)return t.exports;var n=wf[e]={id:e,loaded:!1,exports:{}};return k0[e].call(n.exports,n,n.exports,it),n.loaded=!0,n.exports}it.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return it.d(t,{a:t}),t},it.d=(e,t)=>{for(var n in t)it.o(t,n)&&!it.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},it.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),it.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var C0=it(737);it.n(C0);var x0=it(47);it.n(x0);var A0=it(542);it.n(A0);var E0=it(101);it.n(E0);const Sf=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis;Sf.fetch.bind(Sf),(function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e})({}),(function(e){return e.DataTypeNoLength="data-type-no-length",e.InvalidAuthType="invalid-auth-type",e.InvalidOutputFormat="invalid-output-format",e.LinkUnsupportedAuthType="link-unsupported-auth",e.InvalidUpdateRange="invalid-update-range",e.NotSupported="not-supported",e})({}),it(345),it(800),it(805);var R0=it(285);const wi=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},D0={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Xo=e=>e.replace(/[[\]\\-]/g,"\\$&"),Tf=e=>e.join(""),P0=(e,t)=>{const n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");const r=[],o=[];let s=n+1,i=!1,l=!1,u=!1,d=!1,c=n,p="";e:for(;s<e.length;){const m=e.charAt(s);if(m!=="!"&&m!=="^"||s!==n+1){if(m==="]"&&i&&!u){c=s+1;break}if(i=!0,m!=="\\"||u){if(m==="["&&!u){for(const[w,[T,k,S]]of Object.entries(D0))if(e.startsWith(w,s)){if(p)return["$.",!1,e.length-n,!0];s+=w.length,S?o.push(T):r.push(T),l=l||k;continue e}}u=!1,p?(m>p?r.push(Xo(p)+"-"+Xo(m)):m===p&&r.push(Xo(m)),p="",s++):e.startsWith("-]",s+1)?(r.push(Xo(m+"-")),s+=2):e.startsWith("-",s+1)?(p=m,s+=2):(r.push(Xo(m)),s++)}else u=!0,s++}else d=!0,s++}if(c<s)return["",!1,0,!1];if(!r.length&&!o.length)return["$.",!1,e.length-n,!0];if(o.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!d)return[(f=r[0].length===2?r[0].slice(-1):r[0],f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,c-n,!1];var f;const h="["+(d?"^":"")+Tf(r)+"]",g="["+(d?"":"^")+Tf(o)+"]";return[r.length&&o.length?"("+h+"|"+g+")":r.length?h:g,l,c-n,!0]},Yo=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")},I0=new Set(["!","?","+","*","@"]),kf=e=>I0.has(e),Rl="(?!\\.)",F0=new Set(["[","."]),$0=new Set(["..","."]),O0=new Set("().*{}+?[]^$\\!"),Dl="[^/]",Cf=Dl+"*?",xf=Dl+"+?";class jt{type;#n;#r;#s=!1;#e=[];#t;#i;#l;#a=!1;#o;#c;#d=!1;constructor(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&(this.#r=!0),this.#t=n,this.#n=this.#t?this.#t.#n:this,this.#o=this.#n===this?r:this.#n.#o,this.#l=this.#n===this?[]:this.#n.#l,t!=="!"||this.#n.#a||this.#l.push(this),this.#i=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(const t of this.#e)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#e.map((t=>String(t))).join("|")+")":this.#c=this.#e.map((t=>String(t))).join("")}#p(){if(this!==this.#n)throw new Error("should only call on root");if(this.#a)return this;let t;for(this.toString(),this.#a=!0;t=this.#l.pop();){if(t.type!=="!")continue;let n=t,r=n.#t;for(;r;){for(let o=n.#i+1;!r.type&&o<r.#e.length;o++)for(const s of t.#e){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#e[o])}n=r,r=n.#t}}return this}push(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(const o of n)if(o!==""){if(typeof o!="string"&&!(o instanceof jt&&o.#t===this))throw new Error("invalid part: "+o);this.#e.push(o)}}toJSON(){const t=this.type===null?this.#e.slice().map((n=>typeof n=="string"?n:n.toJSON())):[this.type,...this.#e.map((n=>n.toJSON()))];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#a&&this.#t?.type==="!")&&t.push({}),t}isStart(){if(this.#n===this)return!0;if(!this.#t?.isStart())return!1;if(this.#i===0)return!0;const t=this.#t;for(let n=0;n<this.#i;n++){const r=t.#e[n];if(!(r instanceof jt&&r.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#t?.type==="!")return!0;if(!this.#t?.isEnd())return!1;if(!this.type)return this.#t?.isEnd();const t=this.#t?this.#t.#e.length:0;return this.#i===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const n=new jt(this.type,t);for(const r of this.#e)n.copyIn(r);return n}static#u(t,n,r,o){let s=!1,i=!1,l=-1,u=!1;if(n.type===null){let h=r,g="";for(;h<t.length;){const m=t.charAt(h++);if(s||m==="\\")s=!s,g+=m;else if(i)h===l+1?m!=="^"&&m!=="!"||(u=!0):m!=="]"||h===l+2&&u||(i=!1),g+=m;else if(m!=="[")if(o.noext||!kf(m)||t.charAt(h)!=="(")g+=m;else{n.push(g),g="";const w=new jt(m,n);h=jt.#u(t,w,h,o),n.push(w)}else i=!0,l=h,u=!1,g+=m}return n.push(g),h}let d=r+1,c=new jt(null,n);const p=[];let f="";for(;d<t.length;){const h=t.charAt(d++);if(s||h==="\\")s=!s,f+=h;else if(i)d===l+1?h!=="^"&&h!=="!"||(u=!0):h!=="]"||d===l+2&&u||(i=!1),f+=h;else if(h!=="[")if(kf(h)&&t.charAt(d)==="("){c.push(f),f="";const g=new jt(h,c);c.push(g),d=jt.#u(t,g,d,o)}else if(h!=="|"){if(h===")")return f===""&&n.#e.length===0&&(n.#d=!0),c.push(f),f="",n.push(...p,c),d;f+=h}else c.push(f),f="",p.push(c),c=new jt(null,n);else i=!0,l=d,u=!1,f+=h}return n.type=null,n.#r=void 0,n.#e=[t.substring(r-1)],d}static fromGlob(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=new jt(null,void 0,n);return jt.#u(t,r,0,n),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();const t=this.toString(),[n,r,o,s]=this.toRegExpSource();if(!(o||this.#r||this.#o.nocase&&!this.#o.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;const i=(this.#o.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,i),{_src:n,_glob:t})}get options(){return this.#o}toRegExpSource(t){const n=t??!!this.#o.dot;if(this.#n===this&&this.#p(),!this.type){const u=this.isStart()&&this.isEnd(),d=this.#e.map((f=>{const[h,g,m,w]=typeof f=="string"?jt.#h(f,this.#r,u):f.toRegExpSource(t);return this.#r=this.#r||m,this.#s=this.#s||w,h})).join("");let c="";if(this.isStart()&&typeof this.#e[0]=="string"&&(this.#e.length!==1||!$0.has(this.#e[0]))){const f=F0,h=n&&f.has(d.charAt(0))||d.startsWith("\\.")&&f.has(d.charAt(2))||d.startsWith("\\.\\.")&&f.has(d.charAt(4)),g=!n&&!t&&f.has(d.charAt(0));c=h?"(?!(?:^|/)\\.\\.?(?:$|/))":g?Rl:""}let p="";return this.isEnd()&&this.#n.#a&&this.#t?.type==="!"&&(p="(?:$|\\/)"),[c+d+p,Yo(d),this.#r=!!this.#r,this.#s]}const r=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:";let s=this.#f(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){const u=this.toString();return this.#e=[u],this.type=null,this.#r=void 0,[u,Yo(this.toString()),!1,!1]}let i=!r||t||n?"":this.#f(!0);i===s&&(i=""),i&&(s=`(?:${s})(?:${i})*?`);let l="";return l=this.type==="!"&&this.#d?(this.isStart()&&!n?Rl:"")+xf:o+s+(this.type==="!"?"))"+(!this.isStart()||n||t?"":Rl)+Cf+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&i?")":this.type==="*"&&i?")?":`)${this.type}`),[l,Yo(s),this.#r=!!this.#r,this.#s]}#f(t){return this.#e.map((n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");const[r,o,s,i]=n.toRegExpSource(t);return this.#s=this.#s||i,r})).filter((n=>!(this.isStart()&&this.isEnd()&&!n))).join("|")}static#h(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=!1,s="",i=!1;for(let l=0;l<t.length;l++){const u=t.charAt(l);if(o)o=!1,s+=(O0.has(u)?"\\":"")+u;else if(u!=="\\"){if(u==="["){const[d,c,p,f]=P0(t,l);if(p){s+=d,i=i||c,l+=p-1,n=n||f;continue}}u!=="*"?u!=="?"?s+=u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(s+=Dl,n=!0):(s+=r&&t==="*"?xf:Cf,n=!0)}else l===t.length-1?s+="\\\\":o=!0}return[s,Yo(t),!!n,i]}}const zt=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return wi(t),!(!n.nocomment&&t.charAt(0)==="#")&&new Si(t,n).match(e)},L0=/^\*+([^+@!?\*\[\(]*)$/,_0=e=>t=>!t.startsWith(".")&&t.endsWith(e),M0=e=>t=>t.endsWith(e),N0=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),B0=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),j0=/^\*+\.\*+$/,z0=e=>!e.startsWith(".")&&e.includes("."),U0=e=>e!=="."&&e!==".."&&e.includes("."),V0=/^\.\*+$/,q0=e=>e!=="."&&e!==".."&&e.startsWith("."),H0=/^\*+$/,W0=e=>e.length!==0&&!e.startsWith("."),Q0=e=>e.length!==0&&e!=="."&&e!=="..",K0=/^\?+([^+@!?\*\[\(]*)?$/,G0=e=>{let[t,n=""]=e;const r=Af([t]);return n?(n=n.toLowerCase(),o=>r(o)&&o.toLowerCase().endsWith(n)):r},J0=e=>{let[t,n=""]=e;const r=Ef([t]);return n?(n=n.toLowerCase(),o=>r(o)&&o.toLowerCase().endsWith(n)):r},X0=e=>{let[t,n=""]=e;const r=Ef([t]);return n?o=>r(o)&&o.endsWith(n):r},Y0=e=>{let[t,n=""]=e;const r=Af([t]);return n?o=>r(o)&&o.endsWith(n):r},Af=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&!r.startsWith(".")},Ef=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&r!=="."&&r!==".."},Rf=typeof ce=="object"&&ce?typeof ce.env=="object"&&ce.env&&ce.env.__MINIMATCH_TESTING_PLATFORM__||ce.platform:"posix";zt.sep=Rf==="win32"?"\\":"/";const un=Symbol("globstar **");zt.GLOBSTAR=un,zt.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>zt(n,e,t)};const dn=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};zt.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return zt;const t=zt;return Object.assign((function(n,r){return t(n,r,dn(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}),{Minimatch:class extends t.Minimatch{constructor(n){super(n,dn(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(n){return t.defaults(dn(e,n)).Minimatch}},AST:class extends t.AST{constructor(n,r){super(n,r,dn(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}static fromGlob(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.AST.fromGlob(n,dn(e,r))}},unescape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(n,dn(e,r))},escape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(n,dn(e,r))},filter:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(n,dn(e,r))},defaults:n=>t.defaults(dn(e,n)),makeRe:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(n,dn(e,r))},braceExpand:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(n,dn(e,r))},match:function(n,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(n,r,dn(e,o))},sep:t.sep,GLOBSTAR:un})};const Df=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return wi(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:R0(e)};zt.braceExpand=Df,zt.makeRe=function(e){return new Si(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},zt.match=function(e,t){const n=new Si(t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{});return e=e.filter((r=>n.match(r))),n.options.nonull&&!e.length&&e.push(t),e};const Pf=/[?*]|[+@!]\(.*?\)|\[|\]/;class Si{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};wi(t),n=n||{},this.options=n,this.pattern=t,this.platform=n.platform||Rf,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const n of t)if(typeof n!="string")return!0;return!1}debug(){}make(){const t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#")return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=function(){return console.error(...arguments)}),this.debug(this.pattern,this.globSet);const r=this.globSet.map((s=>this.slashSplit(s)));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let o=this.globParts.map(((s,i,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){const u=!(s[0]!==""||s[1]!==""||s[2]!=="?"&&Pf.test(s[2])||Pf.test(s[3])),d=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map((c=>this.parse(c)))];if(d)return[s[0],...s.slice(1).map((c=>this.parse(c)))]}return s.map((u=>this.parse(u)))}));if(this.debug(this.pattern,o),this.set=o.filter((s=>s.indexOf(!1)===-1)),this.isWindows)for(let s=0;s<this.set.length;s++){const i=this.set[s];i[0]===""&&i[1]===""&&this.globParts[s][2]==="?"&&typeof i[3]=="string"&&/^[a-z]:$/i.test(i[3])&&(i[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let r=0;r<t.length;r++)for(let o=0;o<t[r].length;o++)t[r][o]==="**"&&(t[r][o]="*");const{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=n>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map((n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let o=r;for(;n[o+1]==="**";)o++;o!==r&&n.splice(r,o-r)}return n}))}levelOneOptimize(t){return t.map((n=>(n=n.reduce(((r,o)=>{const s=r[r.length-1];return o==="**"&&s==="**"?r:o===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(o),r)}),[])).length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let o=1;o<t.length-1;o++){const s=t[o];o===1&&s===""&&t[0]===""||s!=="."&&s!==""||(n=!0,t.splice(o,1),o--)}t[0]!=="."||t.length!==2||t[1]!=="."&&t[1]!==""||(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){const o=t[r-1];o&&o!=="."&&o!==".."&&o!=="**"&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let o=-1;for(;(o=r.indexOf("**",o+1))!==-1;){let i=o;for(;r[i+1]==="**";)i++;i>o&&r.splice(o+1,i-o);let l=r[o+1];const u=r[o+2],d=r[o+3];if(l!==".."||!u||u==="."||u===".."||!d||d==="."||d==="..")continue;n=!0,r.splice(o,1);const c=r.slice(0);c[o]="**",t.push(c),o--}if(!this.preserveMultipleSlashes){for(let i=1;i<r.length-1;i++){const l=r[i];i===1&&l===""&&r[0]===""||l!=="."&&l!==""||(n=!0,r.splice(i,1),i--)}r[0]!=="."||r.length!==2||r[1]!=="."&&r[1]!==""||(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){const i=r[s-1];if(i&&i!=="."&&i!==".."&&i!=="**"){n=!0;const l=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...l),r.length===0&&r.push(""),s-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){const o=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(o){t[n]=[],t[r]=o;break}}return t.filter((n=>n.length))}partsMatch(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=0,s=0,i=[],l="";for(;o<t.length&&s<n.length;)if(t[o]===n[s])i.push(l==="b"?n[s]:t[o]),o++,s++;else if(r&&t[o]==="**"&&n[s]===t[o+1])i.push(t[o]),o++;else if(r&&n[s]==="**"&&t[o]===n[s+1])i.push(n[s]),s++;else if(t[o]!=="*"||!n[s]||!this.options.dot&&n[s].startsWith(".")||n[s]==="**"){if(n[s]!=="*"||!t[o]||!this.options.dot&&t[o].startsWith(".")||t[o]==="**"||l==="a")return!1;l="b",i.push(n[s]),o++,s++}else{if(l==="b")return!1;l="a",i.push(t[o]),o++,s++}return t.length===n.length&&i}parseNegate(){if(this.nonegate)return;const t=this.pattern;let n=!1,r=0;for(let o=0;o<t.length&&t.charAt(o)==="!";o++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const o=this.options;if(this.isWindows){const m=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),w=!m&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),T=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),k=w?3:m?0:void 0,S=!T&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])?3:T?0:void 0;if(typeof k=="number"&&typeof S=="number"){const[y,E]=[t[k],n[S]];y.toLowerCase()===E.toLowerCase()&&(n[S]=y,S>k?n=n.slice(S):k>S&&(t=t.slice(k)))}}const{optimizationLevel:s=1}=this.options;s>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:n}),this.debug("matchOne",t.length,n.length);for(var i=0,l=0,u=t.length,d=n.length;i<u&&l<d;i++,l++){this.debug("matchOne loop");var c=n[l],p=t[i];if(this.debug(n,c,p),c===!1)return!1;if(c===un){this.debug("GLOBSTAR",[n,c,p]);var f=i,h=l+1;if(h===d){for(this.debug("** at the end");i<u;i++)if(t[i]==="."||t[i]===".."||!o.dot&&t[i].charAt(0)===".")return!1;return!0}for(;f<u;){var g=t[f];if(this.debug(`
7
- globstar while`,t,f,n,h,g),this.matchOne(t.slice(f),n.slice(h),r))return this.debug("globstar found match!",f,u,g),!0;if(g==="."||g===".."||!o.dot&&g.charAt(0)==="."){this.debug("dot detected!",t,f,n,h);break}this.debug("globstar swallow a segment, and continue"),f++}return!(!r||(this.debug(`
8
- >>> no match, partial?`,t,f,n,h),f!==u))}let m;if(typeof c=="string"?(m=p===c,this.debug("string match",c,p,m)):(m=c.test(p),this.debug("pattern match",c,p,m)),!m)return!1}if(i===u&&l===d)return!0;if(i===u)return r;if(l===d)return i===u-1&&t[i]==="";throw new Error("wtf?")}braceExpand(){return Df(this.pattern,this.options)}parse(t){wi(t);const n=this.options;if(t==="**")return un;if(t==="")return"";let r,o=null;(r=t.match(H0))?o=n.dot?Q0:W0:(r=t.match(L0))?o=(n.nocase?n.dot?B0:N0:n.dot?M0:_0)(r[1]):(r=t.match(K0))?o=(n.nocase?n.dot?J0:G0:n.dot?X0:Y0)(r):(r=t.match(j0))?o=n.dot?U0:z0:(r=t.match(V0))&&(o=q0);const s=jt.fromGlob(t,this.options).toMMPattern();return o&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:o}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const n=this.options,r=n.noglobstar?"[^/]*?":n.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",o=new Set(n.nocase?["i"]:[]);let s=t.map((u=>{const d=u.map((c=>{if(c instanceof RegExp)for(const p of c.flags.split(""))o.add(p);return typeof c=="string"?c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):c===un?un:c._src}));return d.forEach(((c,p)=>{const f=d[p+1],h=d[p-1];c===un&&h!==un&&(h===void 0?f!==void 0&&f!==un?d[p+1]="(?:\\/|"+r+"\\/)?"+f:d[p]=r:f===void 0?d[p-1]=h+"(?:\\/|"+r+")?":f!==un&&(d[p-1]=h+"(?:\\/|\\/"+r+"\\/)"+f,d[p+1]=un))})),d.filter((c=>c!==un)).join("/")})).join("|");const[i,l]=t.length>1?["(?:",")"]:["",""];s="^"+i+s+l+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.partial;if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;const r=this.options;this.isWindows&&(t=t.split("\\").join("/"));const o=this.slashSplit(t);this.debug(this.pattern,"split",o);const s=this.set;this.debug(this.pattern,"set",s);let i=o[o.length-1];if(!i)for(let l=o.length-2;!i&&l>=0;l--)i=o[l];for(let l=0;l<s.length;l++){const u=s[l];let d=o;if(r.matchBase&&u.length===1&&(d=[i]),this.matchOne(d,u,n))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate}static defaults(t){return zt.defaults(t).Minimatch}}zt.AST=jt,zt.Minimatch=Si,zt.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},zt.unescape=Yo;var Z0=it(829);it.n(Z0);var e1=(function(e){return e.Array="array",e.Object="object",e.Original="original",e})(e1||{});typeof Symbol<"u"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")));var t1=it(388);it.n(t1),it(172);class If{isEnabled(){return!0}isActive(t){return st(t,"files-spaces-projects")?!1:st(t,"files-spaces-generic")||ln(t,"files-public-link")}getTask(t){const{router:n,clientService:r,resourcesStore:o,authService:s,spacesStore:i,sharesStore:l,configStore:u}=t,{webdav:d,graphAuthenticated:c}=r,{replaceInvalidFileRoute:p}=Ri({router:n});return $t.useTask(function*(f,h,g,m=null,w=null,T={}){try{o.clearResourceList();const k=Jo.Default;z.isPublicSpaceResource(g)&&k.push(Ee.DownloadURL);let{resource:S,children:y}=yield*z.call(d.listFiles(g,{path:m,fileId:w},{signal:f,davProperties:k}));S.id&&p({space:g,resource:S,path:m,fileId:w});let E;m==="/"&&(z.isShareSpaceResource(g)?(E=yield*z.call(pi({graphClient:c,spacesStore:i,space:g,signal:f})),E&&(S=z.buildIncomingShareResource({graphRoles:l.graphRoles,driveItem:E,serverUrl:u.serverUrl}))):!z.isPersonalSpaceResource(g)&&!z.isPublicSpaceResource(g)&&(S=g)),yield o.loadAncestorMetaData({folder:S,space:g,client:d,signal:f}),z.isProjectSpaceResource(g)&&(yield i.loadGraphPermissions({ids:[g.id],graphClient:c})),z.isShareSpaceResource(g)&&(y.forEach(D=>D.remoteItemId=g.id),g.graphPermissions===void 0&&(E||(E=yield*z.call(pi({graphClient:c,spacesStore:i,space:g,signal:f}))),rf({sharesStore:l,spacesStore:i,space:g,sharedDriveItem:E}))),o.initResourceList({currentFolder:S,resources:y})}catch(k){if(o.setCurrentFolder(null),console.error(k),k.statusCode===401)return s.handleAuthError(a(n.currentRoute))}}).restartable()}}class Ff{isEnabled(){return!0}isActive(t){const n=a(t.currentRoute);return bt(t,"files-common-favorites")||n?.query?.contextRouteName==="files-common-favorites"}getTask(t){const{resourcesStore:n,clientService:r,userStore:o}=t;return $t.useTask(function*(s,i){n.clearResourceList(),n.setAncestorMetaData({});let l=yield r.webdav.listFavoriteFiles({username:o.user?.onPremisesSamAccountName,signal:s});l=l.map(z.buildResource),n.initResourceList({currentFolder:null,resources:l})})}}class $f{isEnabled(){return!0}isActive(t){const n=a(t.currentRoute);return mt(t,"files-shares-via-link")||n?.query?.contextRouteName==="files-shares-via-link"}getTask(t){const{userStore:n,spacesStore:r,clientService:o,configStore:s,resourcesStore:i}=t;return $t.useTask(function*(l,u){i.clearResourceList(),i.setAncestorMetaData({}),s.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:o.graphAuthenticated,signal:l}));const c=(yield*z.call(o.graphAuthenticated.driveItems.listSharedByMe({expand:new Set(["thumbnails"])},{signal:l}))).filter(p=>p.permissions.some(({link:f})=>!!f)).map(p=>z.buildOutgoingShareResource({driveItem:p,user:n.user,serverUrl:s.serverUrl}));i.initResourceList({currentFolder:null,resources:c})})}}class Of{isEnabled(){return!0}isActive(t){const n=a(t.currentRoute);return mt(t,"files-shares-with-me")||n?.query?.contextRouteName==="files-shares-with-me"}getTask(t){const{spacesStore:n,clientService:r,configStore:o,resourcesStore:s,sharesStore:i}=t;return $t.useTask(function*(l,u){s.clearResourceList(),s.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:r.graphAuthenticated,signal:l}));const c=(yield*z.call(r.graphAuthenticated.driveItems.listSharedWithMe({expand:new Set(["thumbnails"])},{signal:l}))).map(p=>z.buildIncomingShareResource({driveItem:p,graphRoles:i.graphRoles,serverUrl:o.serverUrl}));s.initResourceList({currentFolder:null,resources:c})})}}class Lf{isEnabled(){return!0}isActive(t){const n=a(t.currentRoute);return mt(t,"files-shares-with-others")||n?.query?.contextRouteName==="files-shares-with-others"}getTask(t){const{userStore:n,spacesStore:r,clientService:o,configStore:s,resourcesStore:i}=t;return $t.useTask(function*(l,u){i.clearResourceList(),i.setAncestorMetaData({}),s.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:o.graphAuthenticated,signal:l}));const c=(yield*z.call(o.graphAuthenticated.driveItems.listSharedByMe({expand:new Set(["thumbnails"])},{signal:l}))).filter(p=>p.permissions.some(({link:f})=>!f)).map(p=>z.buildOutgoingShareResource({driveItem:p,user:n.user,serverUrl:s.serverUrl}));i.initResourceList({currentFolder:null,resources:c})})}}class _f{isEnabled(){return!0}isActive(t){return qt(t,"files-trash-generic")}getTask(t){const{resourcesStore:n,spacesStore:r,clientService:{webdav:o,graphAuthenticated:s}}=t;return $t.useTask(function*(i,l,u){n.clearResourceList(),n.setAncestorMetaData({});const{resource:d,children:c}=yield o.listFiles(u,{},{depth:1,davProperties:Jo.Trashbin,isTrash:!0,signal:i});z.isProjectSpaceResource(u)&&(yield r.loadGraphPermissions({ids:[u.id],graphClient:s})),n.initResourceList({currentFolder:d,resources:c})})}}class Mf{loaders;constructor(){this.loaders=[new If,new Ff,new $f,new Of,new Lf,new _f]}getTask(){const t=et(),n=He(),r=Dt(),o=Re(),s=Pe(),i=Ge(),l=De(),u=tr(),d=ql(),c=this.loaders.find(p=>p.isEnabled()&&p.isActive(a(o)));if(!c){console.debug("No folder loader found for route");return}return $t.useTask(function*(...p){const f={clientService:s,configStore:i,userStore:t,spacesStore:n,capabilityStore:r,resourcesStore:l,sharesStore:u,router:o,authService:d};try{yield c.getTask(f).perform(...p)}catch(h){console.error(h)}})}}const Nf=new Mf;var Sr=(e=>(e.add="loading-service.add",e.remove="loading-service.remove",e.setProgress="loading-service.set-progress",e))(Sr||{});const n1=200;class r1{tasks=[];get isLoading(){return this.tasks.some(t=>t.active)}get currentProgress(){if(this.tasks.some(r=>!r.state&&r.active))return null;const t=this.tasks.filter(r=>!!r.state&&r.active);if(!t.length)return null;const n=t.reduce((r,o)=>(r+=o.state.current/o.state.total,r),0);return Math.round(n/t.length*100)}addTask(t,{debounceTime:n=n1,indeterminate:r=!0}={}){const o={id:Ct.v4(),active:!1,...!r&&{state:{total:0,current:0}}};return this.tasks.length||window.addEventListener("beforeunload",this.onBeforeUnload),this.tasks.push(o),rt.debounce(()=>{o.active=!0,ze.publish("loading-service.add")},n)(),t({setProgress:({total:l,current:u})=>{r||this.setProgress({task:o,total:l,current:u})}}).finally(()=>{this.removeTask(o.id)})}removeTask(t){this.tasks=this.tasks.filter(n=>n.id!==t),this.tasks.length||window.removeEventListener("beforeunload",this.onBeforeUnload),ze.publish("loading-service.remove")}setProgress({task:t,total:n,current:r}){t.state||(t.state={total:0,current:0}),t.state.total=n,t.state.current=r,ze.publish("loading-service.set-progress")}onBeforeUnload(t){t.preventDefault()}}var o1="__lodash_hash_undefined__";function s1(e){return this.__data__.set(e,o1),this}function i1(e){return this.__data__.has(e)}function Ti(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Zn;++t<n;)this.add(e[t])}Ti.prototype.add=Ti.prototype.push=s1,Ti.prototype.has=i1;function a1(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function l1(e,t){return e.has(t)}var c1=1,u1=2;function Bf(e,t,n,r,o,s){var i=n&c1,l=e.length,u=t.length;if(l!=u&&!(i&&u>l))return!1;var d=s.get(e),c=s.get(t);if(d&&c)return d==t&&c==e;var p=-1,f=!0,h=n&u1?new Ti:void 0;for(s.set(e,t),s.set(t,e);++p<l;){var g=e[p],m=t[p];if(r)var w=i?r(m,g,p,t,e,s):r(g,m,p,e,t,s);if(w!==void 0){if(w)continue;f=!1;break}if(h){if(!a1(t,function(T,k){if(!l1(h,k)&&(g===T||o(g,T,n,r,s)))return h.push(k)})){f=!1;break}}else if(!(g===m||o(g,m,n,r,s))){f=!1;break}}return s.delete(e),s.delete(t),f}function d1(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}function f1(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var p1=1,h1=2,m1="[object Boolean]",g1="[object Date]",v1="[object Error]",y1="[object Map]",b1="[object Number]",w1="[object RegExp]",S1="[object Set]",T1="[object String]",k1="[object Symbol]",C1="[object ArrayBuffer]",x1="[object DataView]",jf=sn?sn.prototype:void 0,Pl=jf?jf.valueOf:void 0;function A1(e,t,n,r,o,s,i){switch(n){case x1:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case C1:return!(e.byteLength!=t.byteLength||!s(new li(e),new li(t)));case m1:case g1:case b1:return Vo(+e,+t);case v1:return e.name==t.name&&e.message==t.message;case w1:case T1:return e==t+"";case y1:var l=d1;case S1:var u=r&p1;if(l||(l=f1),e.size!=t.size&&!u)return!1;var d=i.get(e);if(d)return d==t;r|=h1,i.set(e,t);var c=Bf(l(e),l(t),r,o,s,i);return i.delete(e),c;case k1:if(Pl)return Pl.call(e)==Pl.call(t)}return!1}function Il(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function zf(e,t,n){var r=t(e);return Tn(e)?r:Il(r,n(e))}function E1(e,t){for(var n=-1,r=e==null?0:e.length,o=0,s=[];++n<r;){var i=e[n];t(i,n,e)&&(s[o++]=i)}return s}function Uf(){return[]}var R1=Object.prototype,D1=R1.propertyIsEnumerable,Vf=Object.getOwnPropertySymbols,qf=Vf?function(e){return e==null?[]:(e=Object(e),E1(Vf(e),function(t){return D1.call(e,t)}))}:Uf,P1=Dd(Object.keys,Object),I1=Object.prototype,F1=I1.hasOwnProperty;function $1(e){if(!el(e))return P1(e);var t=[];for(var n in Object(e))F1.call(e,n)&&n!="constructor"&&t.push(n);return t}function O1(e){return ui(e)?Ud(e):$1(e)}function Hf(e){return zf(e,O1,qf)}var L1=1,_1=Object.prototype,M1=_1.hasOwnProperty;function N1(e,t,n,r,o,s){var i=n&L1,l=Hf(e),u=l.length,d=Hf(t),c=d.length;if(u!=c&&!i)return!1;for(var p=u;p--;){var f=l[p];if(!(i?f in t:M1.call(t,f)))return!1}var h=s.get(e),g=s.get(t);if(h&&g)return h==t&&g==e;var m=!0;s.set(e,t),s.set(t,e);for(var w=i;++p<u;){f=l[p];var T=e[f],k=t[f];if(r)var S=i?r(k,T,f,t,e,s):r(T,k,f,e,t,s);if(!(S===void 0?T===k||o(T,k,n,r,s):S)){m=!1;break}w||(w=f=="constructor")}if(m&&!w){var y=e.constructor,E=t.constructor;y!=E&&"constructor"in e&&"constructor"in t&&!(typeof y=="function"&&y instanceof y&&typeof E=="function"&&E instanceof E)&&(m=!1)}return s.delete(e),s.delete(t),m}var Fl=$r(Fn,"DataView"),$l=$r(Fn,"Promise"),Ol=$r(Fn,"Set"),Ll=$r(Fn,"WeakMap"),Wf="[object Map]",B1="[object Object]",Qf="[object Promise]",Kf="[object Set]",Gf="[object WeakMap]",Jf="[object DataView]",j1=Fr(Fl),z1=Fr(Ho),U1=Fr($l),V1=Fr(Ol),q1=Fr(Ll),Cn=Ir;(Fl&&Cn(new Fl(new ArrayBuffer(1)))!=Jf||Ho&&Cn(new Ho)!=Wf||$l&&Cn($l.resolve())!=Qf||Ol&&Cn(new Ol)!=Kf||Ll&&Cn(new Ll)!=Gf)&&(Cn=function(e){var t=Ir(e),n=t==B1?e.constructor:void 0,r=n?Fr(n):"";if(r)switch(r){case j1:return Jf;case z1:return Wf;case U1:return Qf;case V1:return Kf;case q1:return Gf}return t});var H1=1,Xf="[object Arguments]",Yf="[object Array]",ki="[object Object]",W1=Object.prototype,Zf=W1.hasOwnProperty;function Q1(e,t,n,r,o,s){var i=Tn(e),l=Tn(t),u=i?Yf:Cn(e),d=l?Yf:Cn(t);u=u==Xf?ki:u,d=d==Xf?ki:d;var c=u==ki,p=d==ki,f=u==d;if(f&&Qo(e)){if(!Qo(t))return!1;i=!0,c=!1}if(f&&!c)return s||(s=new On),i||ol(e)?Bf(e,t,n,r,o,s):A1(e,t,u,n,r,o,s);if(!(n&H1)){var h=c&&Zf.call(e,"__wrapped__"),g=p&&Zf.call(t,"__wrapped__");if(h||g){var m=h?e.value():e,w=g?t.value():t;return s||(s=new On),o(m,w,n,r,s)}}return f?(s||(s=new On),N1(e,t,n,r,o,s)):!1}function ep(e,t,n,r,o){return e===t?!0:e==null||t==null||!Ln(e)&&!Ln(t)?e!==e&&t!==t:Q1(e,t,n,r,ep,o)}function tp(e,t){return ep(e,t)}class K1{clientService;configStore;userStore;authStore;constructor({clientService:t,userStore:n,authStore:r,configStore:o}){this.clientService=t,this.userStore=n,this.authStore=r,this.configStore=o}get user(){return this.userStore.user}async loadPreview(t,n=!1,r=!0,o){const{space:s,resource:i}=t;if(!i.canDownload()||!i.hasPreview?.())return;const l=z.isPublicSpaceResource(s);if(!(!l&&(!this.configStore.serverUrl||!this.user.onPremisesSamAccountName||!this.authStore.accessToken))){if(l)return this.publicPreviewUrl(t,o);try{return await this.privatePreviewBlob(t,n,r,o)}catch(u){if(r)return;throw u}}}async cacheFactory(t,n,r){const{resource:o,dimensions:s}=t,i=wl.filePreview.get(o.id.toString());if(i&&i.etag===o.etag&&tp(s,i.dimensions))return i.src;try{const l=await this.privatePreviewBlob(t,!1,!0,r);return wl.filePreview.set(o.id.toString(),{src:l,etag:o.etag,dimensions:s},0).src}catch(l){if(n)return;throw l}}buildQueryString(t){return $g.stringify({scalingup:t.scalingup||0,preview:Object.hasOwnProperty.call(t,"preview")?t.preview:1,a:Object.hasOwnProperty.call(t,"a")?t.a:1,...t.processor&&{processor:t.processor},...t.etag&&{c:t.etag.replaceAll('"',"")},...t.dimensions&&t.dimensions[0]&&{x:t.dimensions[0]},...t.dimensions&&t.dimensions[1]&&{y:t.dimensions[1]}})}async privatePreviewBlob(t,n=!1,r=!0,o){const{resource:s,dimensions:i,processor:l}=t;if(n)return this.cacheFactory(t,r,o);const u=[this.configStore.serverUrl,"remote.php/dav",vl(s.webDavPath),"?",this.buildQueryString({etag:s.etag,dimensions:i,processor:l})].join("");try{const{data:d}=await this.clientService.httpAuthenticated.get(u,{responseType:"blob",signal:o});return window.URL.createObjectURL(d)}catch(d){if([425,429].includes(d.status)){const c=d.response?.headers?.["retry-after"]||5;return await new Promise(p=>setTimeout(p,c*1e3)),this.privatePreviewBlob(t,n,r,o)}throw d}}async publicPreviewUrl(t,n){const{space:r,resource:o,dimensions:s,processor:i}=t;let{downloadURL:l}=o;if(!l){const{downloadURL:f}=await this.clientService.webdav.getFileInfo(r,o,{davProperties:[Ee.DownloadURL]});l=f}const[u,d]=l.split("?"),c=[this.buildQueryString({etag:o.etag,dimensions:s,processor:i}),d].filter(Boolean).join("&"),p=[u,c].filter(Boolean).join("?");try{const{status:f}=await this.clientService.httpUnAuthenticated.head(p,{signal:n});if(f!==404)return p}catch(f){if([425,429].includes(f.status)){const h=f.response?.headers?.["retry-after"]||5;return await new Promise(g=>setTimeout(g,h*1e3)),this.publicPreviewUrl(t,n)}throw f}}}const Ci=K.z.enum(["fit","resize","fill","thumbnail"]);class G1{$gettext;constructor({$gettext:t}){this.$gettext=t}explain(t,n){return{code:"mustNotBeEmpty",message:this.$gettext("Must not be empty"),format:[],...rt.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>0}validate(){return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class J1{$gettext;constructor({$gettext:t}){this.$gettext=t}explain(t,n){return{code:"mustContain",helperMessage:this.$gettext("Valid special characters: %{characters}",{characters:t.characters},!0),message:this.$gettext("%{param1}+ special characters"),format:[t.minLength],...rt.isBoolean(n)&&{verified:n}}}assert(t,n){return Array.from(n).filter(o=>t.characters.includes(o)).length>=t.minLength}validate(t){if(!rt.isObject(t))throw new Error("options should be an object");if(!rt.isNumber(t.minLength)||rt.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");if(!rt.isString(t.characters))throw new Error("characters should be a character sequence");return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class xi{$gettext;constructor({$gettext:t}){this.$gettext=t}assert(t,n){throw new Error("Method not implemented.")}explain(t,n){throw new Error("Method not implemented.")}validate(t){if(!rt.isObject(t))throw new Error("options should be an object");if(!rt.isNumber(t.minLength)||rt.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class X1 extends xi{constructor(t){super(t)}explain(t,n){return{code:"atLeastCharacters",message:this.$gettext("%{param1}+ letters"),format:[t.minLength],...rt.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>=t.minLength}}class Y1 extends xi{constructor(t){super(t)}explain(t,n){return{code:"atLeastUppercaseCharacters",message:this.$gettext("%{param1}+ uppercase letters"),format:[t.minLength],...rt.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/[A-Z\xC0-\xD6\xD8-\xDE]/g)?.length>=t.minLength}}class Z1 extends xi{constructor(t){super(t)}explain(t,n){return{code:"atLeastLowercaseCharacters",message:this.$gettext("%{param1}+ lowercase letters"),format:[t.minLength],...rt.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/[a-z\xDF-\xF6\xF8-\xFF]/g)?.length>=t.minLength}}class eT extends xi{constructor(t){super(t)}explain(t,n){return{code:"atLeastDigits",message:this.$gettext("%{param1}+ numbers"),format:[t.minLength],...rt.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/\d/g)?.length>=t.minLength}}class tT{language;capability;policy;generatePasswordRules;constructor({language:t}){this.language=t}initialize(t){this.capability=t.passwordPolicy,this.buildGeneratePasswordRules()}hasRules(){return!!this.capability.min_characters||!!this.capability.min_lowercase_characters||!!this.capability.min_uppercase_characters||!!this.capability.min_digits||!!this.capability.min_special_characters}buildGeneratePasswordRules(){this.generatePasswordRules={length:Math.max(this.capability.min_characters||0,(this.capability.min_lowercase_characters||0)+(this.capability.min_uppercase_characters||0)+(this.capability.min_digits||0)+(this.capability.min_special_characters||0),12),minLowercaseCharacters:Math.max(this.capability.min_lowercase_characters||0,2),minUppercaseCharacters:Math.max(this.capability.min_uppercase_characters||0,2),minSpecialCharacters:Math.max(this.capability.min_special_characters||0,2),minDigits:Math.max(this.capability.min_digits||0,2)}}buildPolicy({enforcePassword:t=!1}={}){const n={atLeastCharacters:new X1({...this.language}),mustNotBeEmpty:new G1({...this.language}),atLeastUppercaseCharacters:new Y1({...this.language}),atLeastLowercaseCharacters:new Z1({...this.language}),atLeastDigits:new eT({...this.language}),mustContain:new J1({...this.language})},r={};t&&!this.hasRules()&&(r.mustNotBeEmpty={}),this.capability.min_characters&&(r.atLeastCharacters={minLength:this.capability.min_characters}),this.capability.min_uppercase_characters&&(r.atLeastUppercaseCharacters={minLength:this.capability.min_uppercase_characters}),this.capability.min_lowercase_characters&&(r.atLeastLowercaseCharacters={minLength:this.capability.min_lowercase_characters}),this.capability.min_digits&&(r.atLeastDigits={minLength:this.capability.min_digits}),this.capability.min_special_characters&&(r.mustContain={minLength:this.capability.min_special_characters,characters:' "!#\\$%&\'()*+,-./:;<=>?@[\\]^_`{|}~"'}),this.policy=new Og.PasswordPolicy(r,n)}getPolicy({enforcePassword:t=!1}={}){return this.buildPolicy({enforcePassword:t}),this.policy}generatePassword(){const t="abcdefghijklmnopqrstuvwxyz",n="ABCDEFGHIJKLMNOPQRSTUVWXYZ",r="\"!#$%&'()*+,-./:;<=>?@[]^_`{|}~",o="0123456789",s=(h,g)=>{const m=256-256%h.length;let w="",T;for(let k=0;k<g;k++){do T=window.crypto.getRandomValues(new Uint8Array(1))[0];while(T>=m);w+=h[T%h.length]}return w},{minLowercaseCharacters:i,minUppercaseCharacters:l,minDigits:u,minSpecialCharacters:d,length:c}=this.generatePasswordRules;let p="";if(p+=s(t,i),p+=s(n,l),p+=s(o,u),p+=s(r,d),p.length<c){const h=c-p.length,g=t+n+r+o;p+=s(g,h)}return(h=>{const g=h.split(""),m=new Uint32Array(g.length);window.crypto.getRandomValues(m);for(let w=g.length-1;w>0;w--){const T=m[w]%(w+1);[g[w],g[T]]=[g[T],g[w]]}return g.join("")})(p)}}const np=e=>({name:Ke.basename(e),type:"directory",relativePath:e}),rp=(e,t)=>t.map(n=>({source:e,name:n.name,type:n.type,data:n,meta:{relativePath:n.relativePath||null}})),op=async e=>{const t=await new Promise((r,o)=>e.file(r,o));return e.fullPath===z.urlJoin(e.name,{leadingSlash:!0})||(t.relativePath=e.fullPath),t},nT=e=>typeof e.getAsEntry=="function"?e.getAsEntry():e.webkitGetAsEntry();async function*rT(e){const t=e.createReader(),n=()=>new Promise((o,s)=>{t.readEntries(o,s)});let r;do{r=await n();for(const o of r)yield o}while(r.length>0)}async function*sp(e,t){if(e.isDirectory){let n=!1;for await(const r of rT(e))if(r.isDirectory)yield*sp(r,t);else if(r.isFile)try{n=!0,yield op(r)}catch(o){console.error(o),t?.(o)}n||(yield np(e.fullPath||e.name))}else try{yield op(e)}catch(n){console.error(n),t?.(n)}}const oT=async(e,t)=>{try{const n=[],r=await Promise.all(Array.from(e.items,o=>nT(o)));for(let o=0;o<r.length;o++)for await(const s of sp(r[o],t))n.push(s);return n}catch(n){console.error(n);const r=Array.from(e.files);return Promise.resolve(r)}},sT={target:null,uppyService:null};class iT extends Bc.BasePlugin{nodes;uppyService;constructor(t,n){super(t,{...sT,...n}),this.type="acquirer",this.id=this.opts.id||"DropTarget"}handleDrop=async t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(s=>{s.type==="acquirer"&&s.handleRootDrop?.(t)});let n=!1;const r=s=>{this.uppy.log(s,"error"),n||(this.uppy.info(s.message,"error"),n=!0)},o=await oT(t.dataTransfer,r);if(o.length>0){this.uppy.log("[DropTarget] Files were dropped");try{const s=rp("DropTarget",o);this.uppyService.addFiles(s)}catch(s){this.uppy.log(s)}}this.opts.onDrop?.(t),this.uppyService?.publish("drop",t)};handleDragOver=t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver?.(t),this.uppyService?.publish("drag-over",t)};handleDragLeave=t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave?.(t),this.uppyService?.publish("drag-out",t)};addListeners=()=>{const{target:t,uppyService:n}=this.opts;if(this.uppyService=n,t instanceof Element?this.nodes=[t]:typeof t=="string"&&(this.nodes=jc.toArray(document.querySelectorAll(t))),!this.nodes||this.nodes.length===0)throw new Error(`"${t}" does not match any HTML elements`);this.nodes.forEach(r=>{r.addEventListener("dragover",this.handleDragOver,!1),r.addEventListener("dragleave",this.handleDragLeave,!1),r.addEventListener("drop",this.handleDrop,!1)})};removeListeners=()=>{this.nodes&&this.nodes.forEach(t=>{t.removeEventListener("dragover",this.handleDragOver,!1),t.removeEventListener("dragleave",this.handleDragLeave,!1),t.removeEventListener("drop",this.handleDrop,!1)})};install(){this.setPluginState({isDraggingOver:!1}),this.addListeners()}uninstall(){this.removeListeners()}}class aT{uppy;uploadInputs=[];uploadFolderMap={};constructor({language:t}){const{$gettext:n}=t;this.uppy=new Bc({autoProceed:!1,onBeforeFileAdded:(r,o)=>r.id in o&&!o[r.id].error?!1:(r.name=r.name.normalize("NFC"),r.meta.relativePath=this.getRelativeFilePath(r)?.normalize("NFC"),r.id=this.generateUploadId(r),r)}),this.uppy.setOptions({locale:{strings:{addedNumFiles:n("Added %{numFiles} file(s)"),authenticate:n("Connect"),authenticateWith:n("Connect to %{pluginName}"),authenticateWithTitle:n("Please authenticate with %{pluginName} to select files"),cancel:n("Cancel"),companionError:n("Connection with Companion failed"),loadedXFiles:n("Loaded %{numFiles} files"),loading:n("Loading..."),logOut:n("Log out"),pluginWebdavInputLabel:n("Public link without password protection"),selectX:{0:n("Select %{smart_count}"),1:n("Select %{smart_count}")},signInWithGoogle:n("Sign in with Google")}}}),this.setUpEvents()}getRelativeFilePath=t=>{const n=t.data.relativePath||t.data.webkitRelativePath;return n?z.urlJoin(n):void 0};addPlugin(t,...n){this.uppy.use(t,...n)}removePlugin(t){this.uppy.removePlugin(t)}getPlugin(t){return this.uppy.getPlugin(t)}useTus({chunkSize:t,overridePatchMethod:n,uploadDataDuringCreation:r,onBeforeRequest:o,headers:s}){const i={chunkSize:t,removeFingerprintOnSuccess:!0,overridePatchMethod:n,retryDelays:[0,500,1e3],uploadDataDuringCreation:r,limit:5,headers:s,onBeforeRequest:o,onShouldRetry:(d,c,p,f)=>d?.originalResponse?.getStatus()>=500?!1:d?.originalResponse?.getStatus()===401?!0:f(d)},l=this.uppy.getPlugin("XHRUpload");l&&this.uppy.removePlugin(l);const u=this.uppy.getPlugin("Tus");if(u){u.setOptions(i);return}this.uppy.use(Lg,i)}useXhr({headers:t,timeout:n,endpoint:r}){const o={endpoint:r,method:"put",headers:t,formData:!1,timeout:n,getResponseData(){return{}}},s=this.uppy.getPlugin("Tus");s&&this.uppy.removePlugin(s);const i=this.uppy.getPlugin("XHRUpload");if(i){i.setOptions(o);return}this.uppy.use(_g,o)}tusActive(){return!!this.uppy.getPlugin("Tus")}useDropTarget({targetSelector:t}){this.uppy.getPlugin("DropTarget")||this.uppy.use(iT,{target:t,uppyService:this})}removeDropTarget(){const t=this.uppy.getPlugin("DropTarget");t&&this.uppy.removePlugin(t)}subscribe(t,n){return ze.subscribe(t,n)}unsubscribe(t,n){ze.unsubscribe(t,n)}publish(t,n){ze.publish(t,n)}setUpEvents(){this.uppy.on("progress",t=>{this.publish("progress",t)}),this.uppy.on("upload-progress",(t,n)=>{this.publish("upload-progress",{file:t,progress:n})}),this.uppy.on("cancel-all",()=>{this.publish("uploadCancelled"),this.clearInputs()}),this.uppy.on("complete",t=>{if(!(!t||!t.successful.length&&!t.failed.length)){this.publish("uploadCompleted",t);for(let n=0;n<t.successful.length;n++)this.uppy.removeFile(t.successful[n].id);this.clearInputs()}}),this.uppy.on("upload-success",t=>{this.publish("uploadSuccess",t)}),this.uppy.on("upload-error",(t,n)=>{this.publish("uploadError",{file:t,error:n})})}registerUploadInput(t){t.getAttribute("listener")!=="true"&&(t.setAttribute("listener","true"),t.addEventListener("change",r=>{const o=r.target,s=Array.from(o.files);this.addFiles(s)}),this.uploadInputs.push(t))}removeUploadInput(t){this.uploadInputs=this.uploadInputs.filter(n=>n!==t)}generateUploadId(t){return jc.generateFileID(t,this.uppy.getID())}log(t,n){this.uppy.log(t,n)}addFiles(t){this.uppy.addFiles(t)}uploadFiles(){return this.uppy.upload()}retryAllUploads(){return this.uppy.retryAll()}pauseAllUploads(){return this.uppy.pauseAll()}resumeAllUploads(){return this.uppy.resumeAll()}cancelAllUploads(){return this.uppy.cancelAll()}removeFailedFiles(){const{files:t}=this.uppy.getState(),n=Object.values(t).filter(r=>r.error);n.length&&this.uppy.removeFiles(n.map(({id:r})=>r))}getCurrentUploads(){return this.uppy.getState().currentUploads}isRemoteUploadInProgress(){return this.uppy.getFiles().some(t=>t.isRemote&&!t.error)}clearInputs(){this.uploadInputs.forEach(t=>{t.value=null})}setUploadFolder(t,n){this.uploadFolderMap[t]=n}removeUploadFolder(t){this.uploadFolderMap[t]&&delete this.uploadFolderMap[t]}}function lT(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var cT=Object.getOwnPropertySymbols,uT=cT?function(e){for(var t=[];e;)Il(t,qf(e)),e=Za(e);return t}:Uf;function ip(e){return zf(e,il,uT)}var dT=Object.prototype,fT=dT.hasOwnProperty;function pT(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&fT.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function hT(e,t){var n=Ya(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var mT=/\w*$/;function gT(e){var t=new e.constructor(e.source,mT.exec(e));return t.lastIndex=e.lastIndex,t}var ap=sn?sn.prototype:void 0,lp=ap?ap.valueOf:void 0;function vT(e){return lp?Object(lp.call(e)):{}}var yT="[object Boolean]",bT="[object Date]",wT="[object Map]",ST="[object Number]",TT="[object RegExp]",kT="[object Set]",CT="[object String]",xT="[object Symbol]",AT="[object ArrayBuffer]",ET="[object DataView]",RT="[object Float32Array]",DT="[object Float64Array]",PT="[object Int8Array]",IT="[object Int16Array]",FT="[object Int32Array]",$T="[object Uint8Array]",OT="[object Uint8ClampedArray]",LT="[object Uint16Array]",_T="[object Uint32Array]";function MT(e,t,n){var r=e.constructor;switch(t){case AT:return Ya(e);case yT:case bT:return new r(+e);case ET:return hT(e);case RT:case DT:case PT:case IT:case FT:case $T:case OT:case LT:case _T:return Ed(e,n);case wT:return new r;case ST:case CT:return new r(e);case TT:return gT(e);case kT:return new r;case xT:return vT(e)}}var NT="[object Map]";function BT(e){return Ln(e)&&Cn(e)==NT}var cp=so&&so.isMap,jT=cp?nl(cp):BT,zT="[object Set]";function UT(e){return Ln(e)&&Cn(e)==zT}var up=so&&so.isSet,VT=up?nl(up):UT,qT=1,dp="[object Arguments]",HT="[object Array]",WT="[object Boolean]",QT="[object Date]",KT="[object Error]",fp="[object Function]",GT="[object GeneratorFunction]",JT="[object Map]",XT="[object Number]",pp="[object Object]",YT="[object RegExp]",ZT="[object Set]",ek="[object String]",tk="[object Symbol]",nk="[object WeakMap]",rk="[object ArrayBuffer]",ok="[object DataView]",sk="[object Float32Array]",ik="[object Float64Array]",ak="[object Int8Array]",lk="[object Int16Array]",ck="[object Int32Array]",uk="[object Uint8Array]",dk="[object Uint8ClampedArray]",fk="[object Uint16Array]",pk="[object Uint32Array]",nt={};nt[dp]=nt[HT]=nt[rk]=nt[ok]=nt[WT]=nt[QT]=nt[sk]=nt[ik]=nt[ak]=nt[lk]=nt[ck]=nt[JT]=nt[XT]=nt[pp]=nt[YT]=nt[ZT]=nt[ek]=nt[tk]=nt[uk]=nt[dk]=nt[fk]=nt[pk]=!0,nt[KT]=nt[fp]=nt[nk]=!1;function Ai(e,t,n,r,o,s){var i,l=t&qT;if(n&&(i=o?n(e,r,o,s):n(e)),i!==void 0)return i;if(!$n(e))return e;var u=Tn(e);if(u)i=pT(e);else{var d=Cn(e),c=d==fp||d==GT;if(Qo(e))return Ad(e,l);if(d==pp||d==dp||c&&!o)i={};else{if(!nt[d])return o?e:{};i=MT(e,d,l)}}s||(s=new On);var p=s.get(e);if(p)return p;s.set(e,i),VT(e)?e.forEach(function(g){i.add(Ai(g,t,n,g,e,s))}):jT(e)&&e.forEach(function(g,m){i.set(m,Ai(g,t,n,m,e,s))});var f=ip,h=u?void 0:f(e);return lT(h||e,function(g,m){h&&(m=g,g=e[m]),Bd(i,m,Ai(g,t,n,m,e,s))}),i}function hk(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(o);++r<o;)s[r]=e[r+t];return s}function mk(e,t){return t.length<2?e:bf(e,hk(t,0,-1))}var gk=Object.prototype,vk=gk.hasOwnProperty;function yk(e,t){t=Al(t,e);var n=-1,r=t.length;if(!r)return!0;for(var o=e==null||typeof e!="object"&&typeof e!="function";++n<r;){var s=t[n];if(typeof s=="string"){if(s==="__proto__"&&!vk.call(e,"__proto__"))return!1;if(s==="constructor"&&n+1<r&&typeof t[n+1]=="string"&&t[n+1]==="prototype"){if(o&&n===0)continue;return!1}}}var i=mk(e,t);return i==null||delete i[yf(qc(t))]}function bk(e){return tl(e)?void 0:e}var hp=sn?sn.isConcatSpreadable:void 0;function wk(e){return Tn(e)||ci(e)||!!(hp&&e&&e[hp])}function Sk(e,t,n,r,o){var s=-1,i=e.length;for(n||(n=wk),o||(o=[]);++s<i;){var l=e[s];n(l)?Il(o,l):o[o.length]=l}return o}function Tk(e){var t=e==null?0:e.length;return t?Sk(e):[]}function kk(e){return Qd(Wd(e,void 0,Tk),e+"")}var Ck=1,xk=2,Ak=4,po=kk(function(e,t){var n={};if(e==null)return n;var r=!1;t=hf(t,function(s){return s=Al(s,e),r||(r=s.length>1),s}),jd(e,ip(e),n),r&&(n=Ai(n,Ck|xk|Ak,bk));for(var o=t.length;o--;)yk(n,t[o]);return n});const Ek=(e,t)=>{const n=(s="")=>s.split("/").filter(Boolean),r=n(e.path),o=n(t);return o.map((s,i)=>({id:Ct.v4(),allowContextActions:!0,text:s,to:{path:"/"+[...r].splice(0,r.length-o.length+i+1).join("/"),query:po(e.query,"fileId","page")},isStaticNav:!1}))},Rk=(...e)=>{const t=e.pop();return[...e,{id:Ct.v4(),allowContextActions:t.allowContextActions,text:t.text,onClick:()=>ze.publish("app.files.list.load"),isTruncationPlaceholder:t.isTruncationPlaceholder,isStaticNav:t.isStaticNav}]};class Zo{static Cut="cut";static Copy="copy"}const _l=e=>e.clientY===0,Ml=(e,t,n)=>{if(!e)return;let r=n;r.$el&&(r=n.$el);const o=r.getBoundingClientRect(),s=_l(t)?t.target?.getBoundingClientRect().top||0:t.clientY;e.setProps({getReferenceClientRect:()=>({width:0,height:0,top:s,bottom:s,left:t.type==="contextmenu"&&!_l(t)?t.clientX:o.x,right:t.type==="contextmenu"&&!_l(t)?t.clientX:o.x})}),e.show()},Ei=e=>(e||"").split("_")[0],Mr=(e,t,n=vt.DateTime.DATETIME_MED)=>e.setLocale(Ei(t)).toLocaleString(n),mp=(e,t,n=vt.DateTime.DATETIME_MED)=>Mr(vt.DateTime.fromJSDate(e),t,n),Dk=(e,t,n=vt.DateTime.DATETIME_MED)=>Mr(vt.DateTime.fromHTTP(e),t,n),gp=(e,t,n=vt.DateTime.DATETIME_MED)=>Mr(vt.DateTime.fromISO(e),t,n),Pk=(e,t,n=vt.DateTime.DATETIME_MED)=>Mr(vt.DateTime.fromRFC2822(e),t,n),es=(e,t)=>e.setLocale(Ei(t)).toRelative(),vp=(e,t)=>es(vt.DateTime.fromJSDate(e),t),Ik=(e,t)=>es(vt.DateTime.fromHTTP(e),t),Fk=(e,t)=>es(vt.DateTime.fromISO(e),t),$k=(e,t)=>es(vt.DateTime.fromRFC2822(e),t),Ok=1048576,Ht=(e,t)=>{const n=typeof e=="string"?parseInt(e):e;return n<0?"--":isNaN(n)?"?":Fg.filesize(n,{round:n<Ok?0:1,locale:Ei(t),base:10,output:"string"})};function yp(e="",t=!1){const n=z.urlJoin(e,{leadingSlash:!0});if(n==="/")return[];const r=[],o=n.split("/");for(t&&r.push(n),o.pop();o.length>0;){if(!o.join("/")){o.pop();continue}r.push(o.join("/")),o.pop()}return r}const Lk=({space:e,resource:t})=>{const{getIndicators:n}=Dc();return n({space:e,resource:t})},bp=e=>new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=o=>n(o),r.readAsArrayBuffer(e)}),wp=e=>new Promise(t=>e.toBlob(t)),ts=()=>window.navigator.platform.match("Mac");function Nr(e){return e.status==="fulfilled"}function Br(e){return e.status==="rejected"}const Nl=e=>new TextEncoder().encode(e).length,Me=we.defineStore("messages",()=>{const e=W([]),t=s=>{const i={...s,id:Ct.v4()};return e.value.push(i),i},n=s=>{const i=l=>l.response?.headers?.get("x-request-id");return s.map(l=>i(l)).filter(Boolean).map(l=>`X-Request-Id: ${l}`).join(`\r
9
- `)};return{messages:e,showMessage:t,showErrorMessage:s=>{const i={id:Ct.v4(),status:"danger",timeout:0,...s.errors&&{errorLogContent:n(s.errors)},...s};return e.value.push(i),i},removeMessage:s=>{e.value=a(e).filter(({id:i})=>s.id!==i)}}}),ns=we.defineStore("clipboard",()=>{const{$gettext:e}=me.useGettext(),{showMessage:t}=Me(),n=W(),r=W([]);return{action:n,resources:r,copyResources:l=>{l[0]?.canDownload()&&(n.value=Zo.Copy,r.value=l,t({title:e("Copied to clipboard!"),status:"success"}))},cutResources:l=>{l[0]?.canDownload()&&(n.value=Zo.Cut,r.value=l,t({title:e("Cut to clipboard!"),status:"success"}))},clearClipboard:()=>{n.value=void 0,r.value=[]}}}),Sp=we.defineStore("extensionPreferences",()=>{const e=Rn.useLocalStorage("extensionPreferences",{});return{extensionPreferences:e,extractDefaultExtensionIds:(o,s)=>o.multiple?s.map(i=>i.id):o.defaultExtensionId?[o.defaultExtensionId]:[],getExtensionPreference:(o,s)=>{const i=e.value[o];return i||{extensionPointId:o,selectedExtensionIds:s}},setSelectedExtensionIds:(o,s)=>{if(!Object.hasOwn(a(e),o)){e.value[o]={extensionPointId:o,selectedExtensionIds:s};return}e.value[o].selectedExtensionIds=s}}}),ho=we.defineStore("extensionRegistry",()=>{const e=Ge(),t=W([]),n=d=>{t.value.push(d)},r=d=>{t.value=a(t).map(c=>W(a(c).filter(({id:p})=>!d.includes(p)))).filter(c=>a(c).length)},o=d=>{if(!d.id||!d.extensionType)throw new Error("ExtensionPoint must have an id and an extensionType");return a(t).flatMap(c=>a(c).filter(p=>p.type===d.extensionType&&!e.options.disabledExtensions.includes(p.id)&&(!p.extensionPointIds||p.extensionPointIds?.includes(d.id))))},s=W([]);return{extensions:t,registerExtensions:n,unregisterExtensions:r,requestExtensions:o,extensionPoints:s,registerExtensionPoints:d=>{s.value.push(d)},unregisterExtensionPoints:d=>{s.value=a(s).map(c=>W(a(c).filter(({id:p})=>!d.includes(p)))).filter(c=>a(c).length)},getExtensionPoints:(d={})=>a(s).flatMap(c=>a(c).filter(p=>!(Object.hasOwn(d,"extensionType")&&p.extensionType!==d.extensionType)))}}),_k=we.defineStore("groupwareConfig",()=>{const e=W(""),t=W([]),n=W(),r=W([]),o=W({});return{version:e,capabilities:t,limits:n,accounts:r,primaryAccounts:o,loadGroupwareConfig:i=>{e.value=i.version,t.value=i.capabilities||[],n.value=i.limits,r.value=i.accounts||[],o.value=i.primaryAccounts||{}}}}),Tp=K.z.object({maxMailboxDepth:K.z.number(),maxSizeMailboxName:K.z.number(),maxMailboxesPerEmail:K.z.number(),maxSizeAttachmentsPerEmail:K.z.number(),mayCreateTopLevelMailbox:K.z.boolean(),maxDelayedSend:K.z.number()}),kp=K.z.object({maxSizeScriptName:K.z.number(),maxSizeScript:K.z.number(),maxNumberScripts:K.z.number(),maxNumberRedirects:K.z.number()}),Cp=K.z.object({mail:Tp.optional(),sieve:kp.optional()}),xp=K.z.object({id:K.z.string(),name:K.z.string(),email:K.z.string().email(),mayDelete:K.z.boolean()}),Ap=K.z.object({accountId:K.z.string(),name:K.z.string(),isPersonal:K.z.boolean(),isReadOnly:K.z.boolean(),capabilities:Cp,identities:K.z.array(xp)}),Ep=K.z.object({maxSizeUpload:K.z.number(),maxConcurrentUpload:K.z.number(),maxSizeRequest:K.z.number(),maxConcurrentRequests:K.z.number()}),Rp=K.z.array(Ap),Dp=K.z.record(K.z.string(),K.z.string()),Mk=K.z.object({version:K.z.string(),capabilities:K.z.array(K.z.string()),limits:Ep,accounts:Rp,primaryAccounts:Dp}),Je=we.defineStore("modals",()=>{const e=W([]),t=A(()=>a(e).at(-1)),n=u=>a(e).find(d=>d.id===u);return{modals:e,activeModal:t,dispatchModal:u=>{const d={...u,id:Ct.v4()};return e.value.push(d),d},updateModal:(u,d,c)=>{const p=n(u);p[d]=c},removeModal:u=>{e.value=a(e).filter(d=>d.id!==u)},removeAllModals:()=>{e.value=[]},setModalActive:u=>{const d=a(e).findIndex(p=>p.id===u);if(d<0)return;const c=n(u);a(e).splice(d,1),e.value.push(c)}}}),et=we.defineStore("user",()=>{const e=W();return{user:e,setUser:r=>{e.value=r,Ng.setUser({username:r.onPremisesSamAccountName})},reset:()=>{e.value=null}}});function Nk(e,t,n,r){for(var o=-1,s=e==null?0:e.length;++o<s;)n=t(n,e[o],o,e);return n}function Bk(e){return function(t){return e?.[t]}}var jk={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},zk=Bk(jk),Uk=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Vk="\\u0300-\\u036f",qk="\\ufe20-\\ufe2f",Hk="\\u20d0-\\u20ff",Wk=Vk+qk+Hk,Qk="["+Wk+"]",Kk=RegExp(Qk,"g");function Gk(e){return e=xl(e),e&&e.replace(Uk,zk).replace(Kk,"")}var Jk=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Xk(e){return e.match(Jk)||[]}var Yk=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Zk(e){return Yk.test(e)}var Pp="\\ud800-\\udfff",eC="\\u0300-\\u036f",tC="\\ufe20-\\ufe2f",nC="\\u20d0-\\u20ff",rC=eC+tC+nC,Ip="\\u2700-\\u27bf",Fp="a-z\\xdf-\\xf6\\xf8-\\xff",oC="\\xac\\xb1\\xd7\\xf7",sC="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",iC="\\u2000-\\u206f",aC=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",$p="A-Z\\xc0-\\xd6\\xd8-\\xde",lC="\\ufe0e\\ufe0f",Op=oC+sC+iC+aC,Lp="['’]",_p="["+Op+"]",cC="["+rC+"]",Mp="\\d+",uC="["+Ip+"]",Np="["+Fp+"]",Bp="[^"+Pp+Op+Mp+Ip+Fp+$p+"]",dC="\\ud83c[\\udffb-\\udfff]",fC="(?:"+cC+"|"+dC+")",pC="[^"+Pp+"]",jp="(?:\\ud83c[\\udde6-\\uddff]){2}",zp="[\\ud800-\\udbff][\\udc00-\\udfff]",mo="["+$p+"]",hC="\\u200d",Up="(?:"+Np+"|"+Bp+")",mC="(?:"+mo+"|"+Bp+")",Vp="(?:"+Lp+"(?:d|ll|m|re|s|t|ve))?",qp="(?:"+Lp+"(?:D|LL|M|RE|S|T|VE))?",Hp=fC+"?",Wp="["+lC+"]?",gC="(?:"+hC+"(?:"+[pC,jp,zp].join("|")+")"+Wp+Hp+")*",vC="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yC="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",bC=Wp+Hp+gC,wC="(?:"+[uC,jp,zp].join("|")+")"+bC,SC=RegExp([mo+"?"+Np+"+"+Vp+"(?="+[_p,mo,"$"].join("|")+")",mC+"+"+qp+"(?="+[_p,mo+Up,"$"].join("|")+")",mo+"?"+Up+"+"+Vp,mo+"+"+qp,yC,vC,Mp,wC].join("|"),"g");function TC(e){return e.match(SC)||[]}function kC(e,t,n){return e=xl(e),t=t,t===void 0?Zk(e)?TC(e):Xk(e):e.match(t)||[]}var CC="['’]",xC=RegExp(CC,"g");function AC(e){return function(t){return Nk(kC(Gk(t).replace(xC,"")),e,"")}}var Qp=AC(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Kp=K.z.object({name:K.z.string().optional(),slogan:K.z.string().optional(),logo:K.z.string().optional(),logoMobile:K.z.string().optional(),urls:K.z.object({accessDeniedHelp:K.z.string().optional(),imprint:K.z.string().optional(),privacy:K.z.string().optional(),accessibility:K.z.string().optional()}).optional(),shareRoles:K.z.record(K.z.string(),K.z.object({iconName:K.z.string()})).optional()}),EC=K.z.object({roles:K.z.record(K.z.string(),K.z.string()).optional(),colorPalette:K.z.record(K.z.string(),K.z.string()).optional(),fontFamily:K.z.string().optional()}),Gp=Kp.extend({designTokens:EC.optional(),favicon:K.z.string().optional(),background:K.z.string().optional()}),RC=Gp.extend({isDark:K.z.boolean(),label:K.z.string()}),Jp=K.z.object({defaults:Gp,themes:K.z.array(RC)}),DC=K.z.object({common:Kp.optional(),clients:K.z.object({web:Jp})}),PC="oc_currentThemeName",IC=e=>{let t=document.querySelector("link[rel~='icon']");t||(t=document.createElement("link"),t.rel="icon",document.head.appendChild(t)),t.href=e},Bn=we.defineStore("theme",()=>{const e=Rn.useLocalStorage(PC,null),t=Rn.usePreferredDark(),n=W(),r=W([]),o=c=>{const p=c.common,f=c.clients.web.defaults,h=zc(p,f);r.value=c.clients.web.themes.map(g=>zc(h,g)),s()},s=()=>{const c=a(r).find(f=>!f.isDark),p=a(r).find(f=>f.isDark);u(a(r).find(f=>f.label===a(e))||(a(t)?p:c)||a(r)[0],!1)},i=()=>{e.value=null,s()},l=A(()=>e.value===null),u=(c,p=!0)=>{n.value=c,p&&(e.value=a(n).label);const f=[{name:"roles",prefix:"role"},{name:"colorPalette",prefix:"color"}];hi("font-family",a(n).designTokens.fontFamily),f.forEach(h=>{for(const g in a(n).designTokens[h.name])hi(`${h.prefix}-${Qp(g)}`,a(n).designTokens[h.name][g])}),a(n).designTokens?.roles?.chrome||(hi("role-chrome",a(n).designTokens?.roles?.surfaceContainer),hi("role-on-chrome",a(n).designTokens?.roles?.onSurface)),a(n).favicon&&IC(a(n).favicon)};return{availableThemes:r,currentTheme:n,initializeThemes:o,setAndApplyTheme:u,setAutoSystemTheme:i,isCurrentThemeAutoSystem:l,getRoleIcon:c=>a(n).shareRoles[c.id]?.iconName||"user"}}),tr=we.defineStore("shares",()=>{const e=De(),{getRoleIcon:t}=Bn(),n=W(!1),r=W([]),o=W([]),s=W({}),i=_=>{s.value=_.reduce((L,V)=>(L[V.id]={...V,icon:t(V)},L),{})},l=_=>{const L=a(r).find(({id:V})=>V===_.id);if(L){Object.assign(L,_);return}a(r).push(_)},u=_=>{r.value=_},d=_=>{a(r).push(..._)},c=_=>{r.value=a(r).filter(({id:L})=>L!==_.id)},p=()=>{r.value=[],o.value=[],n.value=void 0},f=()=>{const _=Object.values(e.ancestorMetaData).map(({id:L})=>L);if(!_.length){r.value=[],o.value=[];return}a(r).forEach(L=>{_.includes(L.resourceId)||c(L)}),a(o).forEach(L=>{_.includes(L.resourceId)||m(L)})},h=_=>{o.value=_},g=_=>{const L=a(o).find(({id:V})=>V===_.id);if(L){Object.assign(L,_);return}a(o).push(_)},m=_=>{o.value=a(o).filter(({id:L})=>L!==_.id)},w=_=>{n.value=_},T=_=>{const L=O=>{const M=new Set;return O.forEach(N=>{M.add(N.shareType)}),Array.from(M)},V=[...e.resources,e.currentFolder].find(O=>O?.id===_);if(!V||z.isProjectSpaceResource(V))return;const te=[...a(r),...a(o)];e.updateResourceField({id:V.id,field:"shareTypes",value:L(te.filter(O=>!O.indirect))});const B=e.getAncestorById(_);B&&e.updateAncestorField({path:B.path,field:"shareTypes",value:L(te.filter(O=>!O.indirect))})};return{loading:n,collaboratorShares:r,linkShares:o,graphRoles:s,setGraphRoles:i,setLoading:w,setCollaboratorShares:u,setLinkShares:h,removeOrphanedShares:f,pruneShares:p,addShare:async({clientService:_,space:L,resource:V,options:te})=>{const O=await _.graphAuthenticated.permissions.createInvite(L.id,V.id,te,a(s));return d([O]),T(V.id),O},updateShare:async({clientService:_,space:L,resource:V,collaboratorShare:te,options:B})=>{const O=_.graphAuthenticated.permissions,M={roles:B.roles,expirationDateTime:B.expirationDateTime},N=await O.updatePermission(L.id,V.id,te.id,M,a(s));return l(N),N},deleteShare:async({clientService:_,space:L,resource:V,collaboratorShare:te})=>{await _.graphAuthenticated.permissions.deletePermission(L.id,V.id,te.id),c(te),T(V.id)},addLink:async({clientService:_,space:L,resource:V,options:te})=>{const O=await _.graphAuthenticated.permissions.createLink(L.id,V.id,te),M=e.selectedResources,N=M.some(({fileId:q})=>q===V.fileId)||M.length===0&&e.currentFolder.fileId===V.fileId;if(g(O),T(V.id),!N){const q=e.ancestorMetaData[V.path]??null;if(q){const{shareTypes:j}=q;j.includes(z.ShareTypes.link.value)||e.updateAncestorField({path:q.path,field:"shareTypes",value:[...j,z.ShareTypes.link.value]})}}return O},updateLink:async({clientService:_,space:L,resource:V,linkShare:te,options:B})=>{const O=_.graphAuthenticated.permissions;let M;if(Object.hasOwn(B,"password"))M=await O.setPermissionPassword(L.id,V.id,te.id,{password:B.password}),te.hasPassword=!!B.password;else{const N={link:{...B.type&&{type:B.type},...B.displayName&&{"@libre.graph.displayName":B.displayName}},...Object.hasOwn(B,"expirationDateTime")&&{expirationDateTime:B.expirationDateTime}};M=await O.updatePermission(L.id,V.id,te.id,N)}return g(M),M},deleteLink:async({clientService:_,space:L,resource:V,linkShare:te})=>{await _.graphAuthenticated.permissions.deletePermission(L.id,V.id,te.id),m(te),T(V.id)}}}),Wt={View:"view",Upload:"upload",Edit:"edit",CreateOnly:"createOnly"},Xp={LibreGraphPermissionsActionsAllowedValues:"@libre.graph.permissions.actions.allowedValues",LibreGraphPermissionsRolesAllowedValues:"@libre.graph.permissions.roles.allowedValues"},Yp=e=>e.sort((t,n)=>n.permissions.length-t.permissions.length),rs=async({graphClient:e,driveType:t,configStore:n,signal:r})=>{const o=await e.drives.listMyDrives({orderBy:"name asc",filter:`driveType eq ${t}`},{signal:r});if(!o.length)return[];if(t!=="mountpoint"||!n.options.routing?.fullShareOwnerPaths)return o;const s={};o.forEach(l=>{const{rootId:u,driveAlias:d}=l.root.remoteItem;s[u]=d});const i=Object.entries(s).map(([l,u])=>z.buildSpace({id:z.extractStorageId(l),name:u,driveType:u.split("/")[0],driveAlias:u,path:"/",serverUrl:n.serverUrl}));return[...o,...i]},He=we.defineStore("spaces",()=>{const e=et(),t=Ge(),n=tr(),r=W([]),o=W(),s=W(!1),i=W(!1),l=W(!1),u=W(null),d=W([]),c=W([]),p=A(()=>a(r).find(Y=>z.isPersonalSpaceResource(Y)&&Y.isOwner(e.user))),f=Y=>{s.value=Y},h=Y=>{i.value=Y},g=Y=>{l.value=Y},m=Y=>{o.value=Y},w=Y=>{u.value=Y},T=Y=>{if(!z.isProjectSpaceResource(Y))return[];const ae=n.collaboratorShares.filter(ne=>ne.resourceId===Y.id);return Yp(ae)},k=Y=>{a(r).push(...Y)},S=Y=>{r.value=a(r).filter(({id:ae})=>ae!==Y.id)},y=Y=>a(r).find(ae=>Y==ae.id),E=async({graphClient:Y,space:ae,signal:ne})=>(await V({graphClient:Y,signal:ne}),a(r).find(pe=>z.isMountPointSpaceResource(pe)&&pe.root?.remoteItem?.id===ae.id)),D=({driveAliasPrefix:Y,id:ae,shareName:ne})=>{const pe=z.buildShareSpaceResource({driveAliasPrefix:Y,id:ae,shareName:ne,serverUrl:t.serverUrl});return k([pe]),pe},$=Y=>{const ae=a(r).find(({id:ne})=>ne===Y.id);if(ae){Object.assign(ae,Y);return}k([Y])},_=({id:Y,field:ae,value:ne})=>{const pe=a(r).find(fe=>Y===fe.id);pe&&(pe[ae]=ne)},L=async({graphClient:Y})=>{l.value=!0;try{const[ae,ne]=await Promise.all([rs({graphClient:Y,driveType:"personal",configStore:t}),rs({graphClient:Y,driveType:"project",configStore:t})]);k([...ae,...ne])}finally{l.value=!1}},V=async({graphClient:Y,signal:ae})=>{if(!a(i))try{const ne=await rs({graphClient:Y,driveType:"mountpoint",configStore:t,signal:ae});k(ne)}finally{i.value=!0}},te=async({graphClient:Y,signal:ae})=>{const ne=await rs({graphClient:Y,driveType:"project",configStore:t,signal:ae});r.value=a(r).filter(pe=>!z.isProjectSpaceResource(pe)),k(ne)},B=Y=>{a(d).includes(Y)||a(d).push(Y)},O=Y=>{d.value=a(d).filter(ae=>ae!==Y)},M=()=>{d.value=[]},N=Y=>{a(c).includes(Y)||a(c).push(Y)},q=Y=>{c.value=a(c).filter(ae=>ae!==Y)},j=()=>{c.value=[]},H=W({});return{spaces:r,spacesInitialized:s,mountPointsInitialized:i,spacesLoading:l,currentSpace:o,personalSpace:p,defaultSpaceImageBlobURL:u,imagesLoading:d,readmesLoading:c,getSpace:y,createShareSpace:D,setSpacesInitialized:f,setMountPointsInitialized:h,setSpacesLoading:g,setCurrentSpace:m,setDefaultSpaceImageBlobURL:w,getSpaceMembers:T,getMountPointForSpace:E,addSpaces:k,removeSpace:S,upsertSpace:$,updateSpaceField:_,loadSpaces:L,loadMountPoints:V,reloadProjectSpaces:te,addToImagesLoading:B,removeFromImagesLoading:O,purgeImagesLoading:M,addToReadmesLoading:N,removeFromReadmesLoading:q,purgeReadmesLoading:j,loadGraphPermissions:async({ids:Y,graphClient:ae,useCache:ne=!0})=>{const pe=a(r).filter(fe=>Y.includes(fe.id)&&(fe.graphPermissions===void 0||!ne));if(pe.length){for(const{id:fe,disabled:be}of pe){if(be){_({id:fe,field:"graphPermissions",value:[]});continue}a(H)[fe]||(H.value[fe]=ae.permissions.listPermissions(fe,fe,n.graphRoles,{select:[Xp.LibreGraphPermissionsActionsAllowedValues]}).then(({allowedActions:xe})=>{_({id:fe,field:"graphPermissions",value:xe}),delete H.value[fe]}))}await Promise.all(Object.values(a(H)))}}}}),De=we.defineStore("resources",()=>{const e=Ge(),t=He(),n=et(),r=W([]),o=W(),s=W({}),i=W([]),l=A(()=>{let ie=a(r);return a(B)||(ie=ie.filter(de=>!de.name.startsWith("."))),ie}),u=A(()=>{const ie=a(r).filter(({type:Ve})=>Ve==="file").length,de=a(r).filter(({type:Ve,name:lt})=>Ve==="file"&&lt.startsWith(".")).length,ue=a(r).filter(({type:Ve})=>Ve==="folder").length,Se=a(r).filter(({type:Ve,name:lt})=>Ve==="folder"&&lt.startsWith(".")).length,$e=a(r).filter(z.isProjectSpaceResource).length;return{files:ie,hiddenFiles:de,folders:ue,hiddenFolders:Se,spaces:$e}}),d=ie=>{r.value=ie},c=ie=>{r.value=a(r).filter(de=>!ie.find(({id:ue})=>ue===de.id))},p=()=>{r.value=[]},f=ie=>{const de=a(r).find(({id:ue})=>ue===ie.id);if(de){Object.assign(de,ie);return}a(r).push(ie)},h=ie=>{const de=a(r).filter(ue=>!ie.some(Se=>Se.path===ue.path));r.value=[...de,...ie]},g=({id:ie,field:de,value:ue})=>{const Se=a(r).find($e=>ie===$e.id);Se&&(Se[de]=ue)},m=ie=>{o.value=ie},w=()=>{o.value=void 0},T=ie=>{r.value=ie.resources,o.value=ie.currentFolder},k=()=>{r.value=[],o.value=void 0,S.value=[]},S=W([]),y=W(null),E=A(()=>a(r).filter(ie=>a(S).includes(ie.id))),D=ie=>{const de=ie.find(ue=>!a(S).includes(ue));de&&(y.value=de),S.value=ie},$=ie=>{y.value=ie,a(S).includes(ie)||a(S).push(ie)},_=ie=>{y.value=ie,a(S).includes(ie)&&(S.value=a(S).filter(de=>de!==ie))},L=ie=>{a(S).includes(ie)?_(ie):$(ie)},V=()=>{S.value=[]},te=ie=>{y.value=ie},B=W(!0),O=W(!0),M=W(!1),N=W(!0),q=W(!0),j=ie=>{B.value=ie,window.localStorage.setItem("oc_hiddenFilesShown",ie.toString())},H=ie=>{O.value=ie,window.localStorage.setItem("oc_fileExtensionsShown",ie.toString())},se=ie=>{M.value=ie,window.localStorage.setItem("oc_webDavDetailsShown",ie.toString())},Y=ie=>{N.value=ie,window.localStorage.setItem("oc_disabledSpacesShown",ie.toString())},ae=ie=>{q.value=ie,window.localStorage.setItem("oc_emptyTrashesShown",ie.toString())},ne=ie=>{s.value=ie};return{resources:r,currentFolder:o,activeResources:l,totalResourcesCount:u,setResources:d,removeResources:c,clearResources:p,upsertResource:f,upsertResources:h,updateResourceField:g,setCurrentFolder:m,clearCurrentFolder:w,initResourceList:T,clearResourceList:k,selectedIds:S,latestSelectedId:y,selectedResources:E,setSelection:D,addSelection:$,removeSelection:_,toggleSelection:L,resetSelection:V,setLastSelectedId:te,areHiddenFilesShown:B,areFileExtensionsShown:O,areWebDavDetailsShown:M,areDisabledSpacesShown:N,areEmptyTrashesShown:q,setAreHiddenFilesShown:j,setAreFileExtensionsShown:H,setAreWebDavDetailsShown:se,setAreDisabledSpacesShown:Y,setAreEmptyTrashesShown:ae,ancestorMetaData:s,setAncestorMetaData:ne,updateAncestorField:({path:ie,field:de,value:ue})=>{const Se=a(s)[ie]??null;Se&&(Se[de]=ue)},loadAncestorMetaData:({folder:ie,space:de,client:ue,signal:Se})=>{const $e={[ie.path]:{id:ie.fileId,shareTypes:ie.shareTypes,parentFolderId:ie.parentFolderId,spaceId:de.id,path:ie.path}},Ve=[],lt=[Ee.FileId,Ee.ShareTypes,Ee.FileParent],Tt=yp(ie.path),ut=t.spaces,gt=()=>ut.filter(ke=>z.isMountPointSpaceResource(ke)&&z.extractStorageId(ke.root.remoteItem.rootId)===de.id);let ve=!0;if(e.options.routing.fullShareOwnerPaths){const ke=ut.some(qe=>z.isProjectSpaceResource(qe)&&qe.id===de.id);ve=de.isOwner(n.user)||ke}for(const ke of Tt){const qe=a(s)[ke]??null;if(qe?.spaceId===de.id){$e[ke]=qe;continue}if(!ve&&!gt().find(We=>ke.startsWith(We.root.remoteItem.path)))break;Ve.push(ue.listFiles(de,{path:ke},{depth:0,davProperties:lt,signal:Se}).then(({resource:We})=>{$e[ke]={id:We.fileId,shareTypes:We.shareTypes,parentFolderId:We.parentFolderId,spaceId:de.id,path:ke}}))}return Promise.all(Ve).then(()=>{if(!Object.keys($e).includes("/")){const ke=a(s)["/"];if(ke?.spaceId===de.id)$e["/"]=ke;else{const{parentFolderId:qe}=Object.values($e)[0],We=t.spaces.find(({id:Jt})=>qe.startsWith(Jt));We&&($e["/"]={id:We.id,shareTypes:We.shareTypes,parentFolderId:We.id,spaceId:We.id,path:"/"})}}ne($e)})},getAncestorById:ie=>Object.values(a(s)).find(de=>ie===de.id),deleteQueue:i,addResourcesIntoDeleteQueue:ie=>{i.value=i.value.concat(ie.filter(de=>!a(i).includes(de)))},removeResourcesFromDeleteQueue:ie=>{i.value=i.value.filter(de=>!ie.includes(de))}}}),Bl=(e,t=void 0)=>{const n=window.localStorage.getItem(e),r=W(t);if(n)try{r.value=JSON.parse(n)}catch{r.value=n}return Ue(()=>a(r),(o,s)=>{o!==s&&(o!==void 0?window.localStorage.setItem(e,typeof o=="string"?o:JSON.stringify(o)):window.localStorage.removeItem(e))},{deep:!0}),r},Tr=()=>{const e=Ge(),t=A(()=>e.options.embed?.enabled),n=A(()=>e.options.embed?.target==="location"),r=A(()=>e.options.embed?.chooseFileName),o=A(()=>e.options.embed?.chooseFileNameSuggestion),s=A(()=>e.options.embed?.target==="file"),i=A(()=>e.options.embed?.fileTypes),l=A(()=>e.options.embed?.messagesOrigin),u=A(()=>a(t)&&e.options.embed?.delegateAuthentication),d=A(()=>e.options.embed?.delegateAuthenticationOrigin);return{isEnabled:t,isLocationPicker:n,chooseFileName:r,chooseFileNameSuggestion:o,isFilePicker:s,messagesTargetOrigin:l,isDelegatingAuthentication:u,fileTypes:i,postMessage:(f,h)=>{const g={};a(l)&&(g.targetOrigin=a(l)),window.parent.postMessage({name:f,data:h},g)},verifyDelegatedAuthenticationOrigin:f=>a(d)?a(d)===f:!0}},Zp=({target:e,mode:t="show",rootMargin:n="100px",onVisibleCallback:r})=>{if(!(window&&"IntersectionObserver"in window))return{isVisible:W(!0)};const s=W(!1),i=new IntersectionObserver(l=>{const u=l.at(-1).isIntersecting;s.value=u,a(s)&&r&&r(),t!=="showHide"&&s.value&&i.unobserve(e.value)},{rootMargin:n});return Ue(e,()=>{i.observe(e.value)}),bn(()=>i.disconnect()),{isVisible:s}},os=()=>{const{width:e}=Rn.useWindowSize();return{isMobile:A(()=>e.value<640)}},FC=we.defineStore("bottomDrawers",()=>{const e=W([]),t=A(()=>a(e).length?a(e)[a(e).length-1]:null);return{drawers:e,currentDrawer:t,showDrawer:()=>{const s={id:_r()};return e.value.push(s),s},closeDrawer:s=>{e.value=a(e).filter(i=>i.id!==s)},closeAllDrawers:()=>{e.value=[]}}});var eh=(e=>(e.open="sidebar.open",e.close="sidebar.close",e.toggle="sidebar.toggle",e.openWithPanel="sidebar.openWithPanel",e.setActivePanel="sidebar.setActivePanel",e))(eh||{});const _t=we.defineStore("sideBar",()=>{const{isEnabled:e}=Tr(),t=Bl("oc_sideBarOpen",!1),{isMobile:n}=os(),r=W(!1),o=W(null),s=A({get(){return a(e)?a(r):a(t)},set(g){if(a(e)){r.value=g;return}t.value=g}}),i=async()=>{await xt();const g=document.getElementById("app-sidebar");g&&g.focus()},l=()=>{s.value=!a(s),a(s)&&i()},u=()=>{s.value=!1,o.value=null},d=()=>{s.value=!0,o.value=null,i()},c=g=>{s.value=!0,o.value=g,i()},p=g=>{o.value=g};return ze.subscribe("sidebar.toggle",l),ze.subscribe("sidebar.close",u),ze.subscribe("sidebar.open",d),ze.subscribe("sidebar.openWithPanel",c),ze.subscribe("sidebar.setActivePanel",p),{isSideBarOpen:s,sideBarActivePanel:o,focusSidebar:i,onInitialLoad:()=>{a(n)&&(s.value=!1)},toggleSideBar:l,closeSideBar:u,openSideBar:d,openSideBarPanel:c,setActiveSideBarPanel:p,onPanelActive:(g,m)=>{ze.subscribe("sidebar.setActivePanel",w=>{g===w&&setTimeout(()=>{m(w)},100)})}}}),th=we.defineStore("updates",()=>{const e=W(!0),t=W(!1),n=W();return{updates:n,isLoading:e,hasError:t,setUpdates:i=>{n.value=i},setHasError:i=>{t.value=i},setIsLoading:i=>{e.value=i}}}),ss=we.defineStore("webWorkers",()=>{const e=W([]);return{createWorker:(s,{needsTokenRenewal:i=!1}={})=>{const l=Ct.v4(),u=Rn.useWebWorker(s,{type:"module",name:l}),d={id:l,needsTokenRenewal:i,...u};return a(e).push(d),d},terminateWorker:s=>{const i=a(e).find(l=>s===l.id);i&&(i.terminate(),e.value=a(e).filter(l=>s!==l.id))},terminateAllWorkers:()=>{a(e).forEach(({terminate:s})=>{s()}),e.value=[]},updateAccessTokens:s=>{a(e).filter(({needsTokenRenewal:i})=>i).forEach(({post:i})=>{i(JSON.stringify({topic:"tokenUpdate",data:{accessToken:`Bearer ${s}`}}))})}}}),Ri=(e={})=>{const t=e.router||Re(),n=e.configStore||Ge();return{replaceInvalidFileRoute:({space:o,resource:s,path:i,fileId:l})=>{if(!n.options.routing?.idBased||i===s.path&&l===s.fileId)return!1;const u=_n(o,s,{configStore:n});return t.replace(u),!0}}},jl=()=>{const e=St();return A(()=>a(e).name)},nh=(e,t)=>{const n=St();return A(()=>a(n).meta[e]||t)},Di=(e,t)=>{const n=Re();return A({get(){return at(a(n.currentRoute).params[e])||t},async set(r){a(n.currentRoute).params[e]!==r&&await n.replace({params:{...a(n.currentRoute).params,[e]:r}})}})};let rh=Promise.resolve();const Pt=(e,t)=>{const n=Re();return A({get(){return a(n.currentRoute).query[e]||t},set(r){if(a(n.currentRoute).query[e]===r)return;rh=rh.then(async()=>{try{await n.replace({path:a(n.currentRoute).path,query:{...a(n.currentRoute).query,[e]:r}})}catch{}})}})},nr=e=>{const t=Pt(e.name),n=Bl($C(e));return Ue(()=>a(t)?{value:a(t),source:"route"}:a(n)?{value:a(n),source:"storage"}:{value:e.defaultValue,source:"default"},r=>{["route","default"].includes(r.source)&&(n.value=r.value===e.defaultValue?void 0:at(r.value)),["storage","default"].includes(r.source)&&(t.value=r.value)},{immediate:!0}),t},$C=e=>["oc-options",e.storagePrefix,e.name].filter(Boolean).join("_"),xn=(e,...t)=>{const n=W(!1),r=Re(),o=St();return Ue(o,()=>{n.value=e(r,...t)},{immediate:!0}),n},Pi="contextRouteName",zl="contextRouteParams",Ul="contextRouteQuery",Ii=e=>{const{params:t,query:n}=e,r={},o=["fileId","shareId","q_share-visibility","page"].concat(e.meta?.contextQueryItems||[]);for(const s of o)r[s]=n[s];return{[Pi]:e.name,[zl]:t,[Ul]:r}},oh=e=>({routeName:at(e[Pi]),routeParams:e[zl],routeQuery:e[Ul]}),at=e=>Array.isArray(e)?e[0].toString():e?.toString();function sh({router:e,currentFileContext:t}){const n=l=>{const{fileName:u,routeName:d,routeParams:c,routeQuery:p}=a(l);return a(d)?e.push({name:a(d),params:a(c),query:{...a(p),scrollTo:a(u)}}):e.push({path:"/"})},{replaceInvalidFileRoute:r}=Ri({router:e}),o=(l,u)=>{const d=a(l);return r({space:a(d.space),resource:u,path:a(d.item),fileId:a(d.itemId)})},s=W(!1);return{replaceInvalidFileRoute:o,closeApp:()=>(s.value=!0,n(t)),closed:s}}const Pe=()=>er("$clientService");function Vl({clientService:e}){e=e||Pe();const t=et();return{getUrlForResource:(l,u,d)=>e.webdav.getFileUrl(l,u,{username:t.user?.onPremisesSamAccountName,...d}),revokeUrl:l=>e.webdav.revokeUrl(l),getFileContents:(l,u)=>e.webdav.getFileContents(a(a(l).space),{path:a(a(l).item)},{...u}),getFileInfo:(l,u={})=>e.webdav.getFileInfo(a(a(l).space),{path:a(a(l).item),fileId:a(a(l).itemId)},u),putFileContents:(l,u)=>e.webdav.putFileContents(a(a(l).space),{path:a(a(l).item),...u})}}const ql=()=>er("$authService");class jr{static allFiles="all-files";static currentFolder="current-folder"}const Hl=()=>{const e=Ge(),t=Pe(),n=He(),r=De(),o=Dt(),s=A(()=>o.searchContent?.enabled),i=A(()=>r.areHiddenFilesShown),l=A(()=>n.spaces.filter(z.isProjectSpaceResource)),u=f=>a(l).find(h=>h.id===f),d=$t.useTask(function*(f,h,g=null){if(e.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:t.graphAuthenticated,signal:f})),!h)return{totalResults:null,values:[]};const{resources:m,totalResults:w}=yield*z.call(t.webdav.search(h,{searchLimit:g,davProperties:Jo.Default,signal:f}));return{totalResults:w,values:m.map(T=>{const k=u(T.parentFolderId),S=k||T;return e.options.routing.fullShareOwnerPaths&&S.remoteItemPath&&(S.path=z.urlJoin(S.remoteItemPath,S.path)),{id:S.id,data:S}}).filter(({data:T})=>!T.name.startsWith(".")||a(i))}}).restartable();return{search:async(f,h=null)=>await d.perform(f,h),buildSearchTerm:({term:f,isTitleOnlySearch:h,tags:g,lastModified:m,mediaType:w,scope:T,useScope:k})=>{const S=[],y=f,E=a(s)&&!h;if(y){let D=`name:"*${y}*"`;E&&(D=`(name:"*${y}*" OR content:"${y}")`),S.push(D)}if(k&&T&&S.push(`scope:${T}`),g){const D=g.split("+").map($=>`"${$}"`);S.push(`tag:(${D.join(" OR ")})`)}if(m&&S.push(`mtime:${m}`),w){const D=w.split("+").map($=>`"${$}"`);S.push(`mediatype:(${D.join(" OR ")})`)}return S.sort((D,$)=>Number(D.startsWith("scope:"))-Number($.startsWith("scope:"))).join(" AND ")}}};function ih({currentRoute:e,clientService:t}){const n=W(!1),{webdav:r}=t,{replaceInvalidFileRoute:o}=Ri(),{getFileInfo:s}=Vl({clientService:t}),i=ql(),l=He(),{buildSearchTerm:u,search:d}=Hl(),c=Pt("contextRouteQuery"),p=De(),{activeResources:f}=we.storeToRefs(p);return{isFolderLoading:n,loadFolderForFileContext:async g=>{n.value=!0;try{if(g=a(g),a(c)?.term){const D=u({term:a(c)?.term}),{values:$}=await d(D,200),_=$.filter(({data:L})=>z.isSearchResource(L)).map(L=>L.data);p.initResourceList({currentFolder:null,resources:_}),n.value=!1;return}if(["files-shares-with-me","files-shares-with-others","files-shares-via-link","files-common-favorites"].includes(a(g.routeName))){await Nf.getTask().perform(),n.value=!1;return}p.clearResourceList();const w=a(g.space),T=await s(g,{davProperties:[Ee.FileId]});if(o({space:w,resource:T,path:a(g.item),fileId:a(g.itemId)}),l.spaces.some(D=>z.isMountPointSpaceResource(D)&&D.root.remoteItem?.id===T.id)){const D=await s(g);p.initResourceList({currentFolder:D,resources:[D]}),n.value=!1;return}const S=Ke.dirname(T.path),{resource:y,children:E}=await r.listFiles(w,{path:S});y.type==="file"?p.initResourceList({currentFolder:y,resources:[y]}):p.initResourceList({currentFolder:y,resources:E})}catch(m){if(m.statusCode===401)return i.handleAuthError(a(e));p.setCurrentFolder(null),console.error(m)}n.value=!1},activeFiles:f}}function Wl({appsStore:e,applicationId:t}){return{applicationMeta:A(()=>{const r=e.apps[t];if(!r)throw new Error(`useAppConfig: could not find config for applicationId: ${t}`);return r||{}})}}const rr=()=>ze;function ah({titleSegments:e,eventBus:t}){const n=Bn(),{currentTheme:r}=we.storeToRefs(n);t=t||rr(),Ue(e,o=>{const s=a(o),i=" - ",l={shortDocumentTitle:s.join(i),fullDocumentTitle:[...s,a(r).name].join(i)};t.publish("runtime.documentTitle.changed",l)},{immediate:!0,deep:!0})}function OC({appsStore:e,applicationId:t,applicationName:n,currentFileContext:r,currentRoute:o}){const s=Wl({applicationId:t,appsStore:e}),{$gettext:i}=me.useGettext(),l=A(()=>{const u=Ke.basename(a(a(r)?.fileName))||i(a(o)?.meta?.title||""),d=a(a(s).applicationMeta);return[u,a(n)||d.name||d.id].filter(Boolean)});ah({titleSegments:l})}function lh(e={}){const t=e.clientService??Pe(),n=e.authStore??Lr();return{makeRequest:(o,s,i={})=>{const l=!n.accessToken||n.publicLinkContextReady?t.httpUnAuthenticated:t.httpAuthenticated,u=new Sl({accessToken:n.accessToken,publicLinkToken:n.publicLinkToken,publicLinkPassword:n.publicLinkPassword});return i.method=o,i.url=s,i.headers={...u.getHeaders(),...i?.headers||{}},l.request(i)}}}const ch=()=>{const e=He();return{areSpacesLoading:A(()=>!e.spacesInitialized||e.spacesLoading)}},uh=(e={})=>{const t=He(),{areSpacesLoading:n}=ch(),r=Pt("shareId"),o=Pt("fileId"),s=A(()=>at(a(o))),i=Ge(),l=Pe(),u=A(()=>t.spaces),d=W(null),c=W(null),p=W(!1),f=h=>{const g=h.split("/");return a(u).find(m=>{if(!h.startsWith(m.driveAlias))return!1;const w=m.driveAlias.split("/");return g.length<w.length||g.slice(0,w.length).join("/")!==m.driveAlias?!1:m})};return Qs(()=>{const h=a(e.driveAliasAndItem);!h?.startsWith("personal/")&&!h?.startsWith("project/")&&t.setCurrentSpace(null)}),Ue([e.driveAliasAndItem,n],async([h,g],[m,w])=>{if(h===m&&g===w)return;if(!h||h.startsWith("virtual/")){d.value=null,c.value=null;return}if(a(d)&&h.startsWith(a(d).driveAlias)){c.value=z.urlJoin(h.slice(a(d).driveAlias.length),{leadingSlash:!0});return}let k=null,S=null;if(h.startsWith("public/")||h.startsWith("ocm/")){const[y,...E]=h.split("/").slice(1);k=a(u).find(D=>D.id===y),S=E.join("/")}else if(h.startsWith("share/")||h.startsWith("ocm-share/")){const[y,...E]=h.split("/").slice(1),D=h.startsWith("ocm-share/")?"ocm-share":"share";let $=at(a(r));$?.includes(":")&&($=[z.SHARE_JAIL_ID,$].join("!")),k=t.getSpace($)||t.createShareSpace({driveAliasPrefix:D,id:$,shareName:a(y)}),S=E.join("/")}else a(s)?k=a(u).find(y=>a(s).startsWith(`${y.fileId}`)):k=f(h),k||(!t.mountPointsInitialized&&i.options.routing.fullShareOwnerPaths&&(p.value=!0,await t.loadMountPoints({graphClient:l.graphAuthenticated})),k=f(h)),k&&(S=h.slice(k.driveAlias.length));d.value=k,c.value=z.urlJoin(S,{leadingSlash:!0}),p.value=!1},{immediate:!0,deep:!0}),Ue(d,h=>{t.setCurrentSpace(h)},{immediate:!0}),{space:d,item:c,itemId:s,loading:p}};function dh(e){const t=Re(),n=Mn(),r=St(),o=e.clientService??Pe(),s=e.applicationId,i=Lr(),{publicLinkContextReady:l}=we.storeToRefs(i),u=Di("driveAliasAndItem"),{space:d,item:c,itemId:p,loading:f}=uh({driveAliasAndItem:u}),h=A(()=>{if(a(f))return null;let g;return a(d)?g=z.urlJoin(a(d).webDavPath,a(c)):g=z.urlJoin(at(a(r).params.filePath)),{path:g,driveAliasAndItem:a(u),space:a(d),item:a(c),itemId:a(p),fileName:Ke.basename(g),routeName:at(a(r).query[Pi]),...oh(a(r).query)}});return OC({appsStore:n,applicationId:s,applicationName:e.applicationName,currentFileContext:h,currentRoute:r}),{isPublicLinkContext:l,currentFileContext:h,...Zd({appsStore:n,...e}),...sh({router:t,currentFileContext:h}),...Vl({clientService:o}),...ih({clientService:o,currentRoute:r}),...lh({clientService:o,currentRoute:a(r)})}}const LC=e=>({meta:{...e.meta,authContext:"anonymous"},path:e.path,redirect:t=>{const n=e.redirect(t);return console.warn(`route "${e.path}" is deprecated, use "${String(n.path)||String(n.name)}" instead.`),n}}),_C=()=>[{path:"/list",redirect:e=>kn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:"personal/home"}})},{path:"/list/all/:item(.*)",redirect:e=>kn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:z.urlJoin("personal/home",at(e.params.item),{leadingSlash:!1})}})},{path:"/list/favorites",redirect:e=>lo("files-common-favorites",e)},{path:"/list/shared-with-me",redirect:e=>an("files-shares-with-me",e)},{path:"/list/shared-with-others",redirect:e=>an("files-shares-with-others",e)},{path:"/list/shared-via-link",redirect:e=>an("files-shares-via-link",e)},{path:"/trash-bin",redirect:e=>wr("files-trash-generic",e)},{path:"/public/list/:item(.*)",redirect:e=>co("files-public-link",e)},{path:"/private-link/:fileId",redirect:e=>({name:"resolvePrivateLink",params:{fileId:e.params.fileId}})},{path:"/public-link/:token",redirect:e=>({name:"resolvePublicLink",params:{token:e.params.token}})}].map(LC),MC=(e,...t)=>{const[n,...r]=t.map(o=>{const s={"files-personal":kn("files-spaces-generic").name,"files-favorites":lo("files-common-favorites").name,"files-shared-with-others":an("files-shares-with-others").name,"files-shared-with-me":an("files-shares-with-me").name,"files-trashbin ":wr("files-trash-generic").name,"files-public-list":co("files-public-link").name}[o.name.toString()];return s&&console.warn(`route name "${name}" is deprecated, use "${s.toString()}" instead.`),{...o,...!!s&&{name:s}}});return al(e,n,...r)},NC={name:"root",path:"/",redirect:e=>kn("files-spaces-generic",e)},BC=e=>[NC,...cS(e),...fS(e),...pS(e),...uS(e),...hS(e),..._C()],Fi=()=>{const e=Pe();return{getDefaultMetaFolder:async n=>{const{children:r}=await e.webdav.listFiles(n);return r.find(({name:o})=>o===".space")}}},It=e=>{const t=et(),n=He(),r=Ge(),o=A(()=>n.spaces),s=Di("driveAliasAndItem"),i=p=>a(e?.space)||a(o).find(f=>f.id===p),l=p=>{let f=p.storageId;(a(s)?.startsWith("public/")||a(s)?.startsWith("ocm/"))&&(f=a(s).split("/")[1]);const h=i(f);if(h&&!z.isMountPointSpaceResource(h))return h;const g=z.isShareResource(p)&&p.shareTypes.includes(z.ShareTypes.remote.value)||p?.id?.toString().startsWith(z.OCM_PROVIDER_ID)?"ocm-share":"share";let m;return p.remoteItemPath?m=Ke.basename(p.remoteItemPath):a(s)?.startsWith("share/")||a(s)?.startsWith("ocm-share/")?m=a(s).split("/")[1]:m=p.name,n.getSpace(p.remoteItemId)||n.createShareSpace({driveAliasPrefix:g,id:p.remoteItemId,shareName:m})},u=p=>a(o).filter(f=>z.isMountPointSpaceResource(f)&&z.extractStorageId(f.root.remoteItem.rootId)===p.id);return{getInternalSpace:i,getMatchingSpace:l,isPersonalSpaceRoot:p=>p?.storageId&&p?.storageId===n.personalSpace?.storageId&&p?.path==="/"&&!z.isIncomingShareResource(p),isResourceAccessible:({space:p,path:f})=>{if(!r.options.routing.fullShareOwnerPaths)return!0;const h=a(o).some(m=>z.isProjectSpaceResource(m)&&m.id===p.id);return p.isOwner(t.user)||h||u(p).some(m=>f.startsWith(m.root.remoteItem.path))}}},go=()=>{const e=Pe(),t=De();return{createSpace:o=>{const{graphAuthenticated:s}=e;return s.drives.createDrive({name:o},{params:{template:"default"}})},createDefaultMetaFolder:async o=>{const s=await e.webdav.createFolder(o,{path:".space"});return z.extractStorageId(s.parentFolderId)===t.currentFolder?.id&&t.upsertResource(s),s}}},Ut=()=>er("$loadingService"),$i=()=>{const e=Lr(),t=Pe(),n=me.useGettext();return{headers:A(()=>{const o=new Sl({accessToken:e.accessToken,publicLinkToken:e.publicLinkToken,publicLinkPassword:e.publicLinkPassword});return{"Accept-Language":n.current,"Initiator-ID":t.initiatorId,"X-Request-ID":Ct.v4(),...o.getHeaders()}})}};function jC(e){return new Worker("/assets/worker-BSCY2vwA.js",{name:e?.name})}const fh=({concurrentRequests:e=4}={})=>{const t=Ge(),n=Ut(),{headers:r}=$i(),{createWorker:o,terminateWorker:s}=ss(),i=({topic:u,space:d,resources:c},p)=>{const f=o(jC,{needsTokenRenewal:!0});let h;a(f.worker).onmessage=g=>{s(f.id),h?.(!0);const{successful:m,failed:w}=JSON.parse(g.data),T=w.map(({resource:k,...S})=>({resource:k,error:z.createHttpError(S)}));p({successful:m,failed:T})},n.addTask(()=>new Promise(g=>{h=g})),f.post(l({topic:u,space:d,resources:c}))},l=({topic:u,space:d,resources:c})=>JSON.stringify({topic:u,data:{space:d,resources:c,concurrentRequests:e,baseUrl:t.serverUrl,headers:{...a(r),"X-Request-ID":void 0}}});return{startWorker:i}};function zC(e){return new Worker("/assets/worker-DH8D29Kr.js",{name:e?.name})}const ph=()=>{const e=Ge(),t=Ut(),{headers:n}=$i(),{createWorker:r,terminateWorker:o}=ss(),s=(l,u)=>{const d=r(zC,{needsTokenRenewal:!0});let c;a(d.worker).onmessage=p=>{o(d.id),c?.(!0);const{successful:f,failed:h}=JSON.parse(p.data),g=h.map(({resourceName:m,...w})=>({resourceName:m,error:z.createHttpError(w)}));u({successful:f,failed:g})},t.addTask(()=>new Promise(p=>{c=p})),d.post(i(l))},i=l=>JSON.stringify({topic:"startProcess",data:{transferData:l,baseUrl:e.serverUrl,headers:{...a(n),"X-Request-ID":void 0}}});return{startWorker:s}};function UC(e){return new Worker("/assets/worker-22sDKzz_.js",{name:e?.name})}const hh=()=>{const e=Ge(),t=Ut(),{headers:n}=$i(),{createWorker:r,terminateWorker:o}=ss(),s=({space:l,resources:u,missingFolderPaths:d},c)=>{const p=r(UC,{needsTokenRenewal:!0});let f;a(p.worker).onmessage=h=>{o(p.id),f?.(!0);const{successful:g,failed:m}=JSON.parse(h.data),w=m.map(({resource:T,...k})=>({resource:T,error:z.createHttpError(k)}));c({successful:g,failed:w})},t.addTask(()=>new Promise(h=>{f=h})),p.post(i({space:l,resources:u,missingFolderPaths:d}))},i=({space:l,resources:u,missingFolderPaths:d})=>JSON.stringify({topic:"startProcess",data:{space:l,resources:u,missingFolderPaths:d,baseUrl:e.serverUrl,headers:{...a(n),"X-Request-ID":void 0}}});return{startWorker:s}};function VC(e){return new Worker("/assets/worker-BBQqm_-D.js",{name:e?.name})}const qC=({authService:e})=>{const{createWorker:t}=ss(),n=W();return{startWorker:()=>{n.value=t(VC),a(a(n).worker).onmessage=()=>{e.signinSilent().catch(async i=>{if(i instanceof Mg.ErrorTimeout){console.warn("token renewal timed out, retrying in 5 seconds..."),a(n).post(JSON.stringify({topic:"set",expiry:5,expiryThreshold:0}));return}if(console.error("token renewal error:",i),!await e.getRefreshToken())return e.logoutUser()})}},setTokenTimer:({expiry:i,expiryThreshold:l})=>{if(!a(n)){console.error("token timer worker is not running");return}a(n).post(JSON.stringify({topic:"set",expiry:i,expiryThreshold:l}))},resetTokenTimer:()=>{if(!a(n)){console.error("token timer worker is not running");return}a(n).post(JSON.stringify({topic:"reset"}))}}};function HC(e){return e==null}const An=()=>{const e=Mn(),t=Re(),n=oa(),{isEnabled:r}=Tr(),{requestExtensions:o}=ho(),s=lr(),{openUrl:i}=eg(),l=Ge(),{options:u}=we.storeToRefs(l),{actions:d}=ea(),{actions:c}=ra(),{actions:p}=Oi(),{actions:f}=Ts(),{actions:h}=Yi(),{actions:g}=Zi(),{actions:m}=xo(),{actions:w}=Um(),{actions:T}=Tc(),{actions:k}=ta(),{actions:S}=Dm(),{actions:y}=na(),{actions:E}=ks(),{actions:D}=wc(),$=A(()=>[...a(g),...a(m),...a(f),...a(k),...a(p),...a(y),...a(D),...a(E),...a(d),...a(c),...a(h),...a(T)]),_=A(()=>(o({id:"global.files.context-actions",extensionType:"action"})||[]).map(q=>q.action).filter(q=>HC(q.category)||q.category==="context"||q.category==="actions")),L=A(()=>a(r)?[]:e.fileExtensions.map(q=>{const j=e.apps[q.app];return{name:`editor-${q.app}`,label:()=>q.label?typeof q.label=="function"?q.label():q.label:j.name,icon:q.icon||j.icon,...j.iconFillType&&{iconFillType:j.iconFillType},img:j.img,route:({space:H,resources:se})=>V({appFileExtension:q,space:H,resource:se[0]}),handler:H=>B(q,H.space,H.resources[0]),isVisible:({resources:H})=>!a(s)||H.length!==1||!H[0].canDownload()&&!q.secureView||!a(n)&&qt(t,"files-trash-generic")?!1:H[0].extension&&q.extension?H[0].extension.toLowerCase()===q.extension.toLowerCase():H[0].mimeType&&q.mimeType?H[0].mimeType.toLowerCase()===q.mimeType.toLowerCase()||H[0].mimeType.split("/")[0].toLowerCase()===q.mimeType.toLowerCase():!1,hasPriority:q.hasPriority,class:`oc-files-actions-${Qp(j.name).toLowerCase()}-trigger`}}).sort((q,j)=>j.hasPriority!==q.hasPriority&&j.hasPriority?1:0)),V=({appFileExtension:q,space:j,resource:H})=>{const se=z.isShareSpaceResource(j)?j.id:void 0,Y=q.routeName||q.app,ae=te(Y,j,H,se);return t.resolve(ae)},te=(q,j,H,se,Y)=>({name:q,params:{driveAliasAndItem:j?.getDriveAliasAndItem(H)},query:{...se&&{shareId:se},...H.fileId&&a(u).routing.idBased&&{fileId:H.fileId},...Y&&{templateId:Y},...Ii(a(t.currentRoute))}}),B=(q,j,H)=>{const se=z.isShareSpaceResource(j)?j.id:void 0,Y=q.routeName||q.app,ae=te(Y,j,H,se);if(a(u).cernFeatures){const ne=t.resolve(ae).href,pe=`${q.routeName}-${H.path}`;i(ne,pe,!0);return}t.push(ae)},O=q=>{const j=M(q);j&&j.handler({...q})},M=q=>{const j=N(q);if(j.length)return j[0].name===a(m)[0].name?a(w)[0]:j[0]},N=q=>{const j=Y=>Y.isVisible(q),H=[...a(_),...a(L),...a(S)].filter(j).sort((Y,ae)=>Number(ae.hasPriority)-Number(Y.hasPriority)),se=q.omitSystemActions?[]:a($).filter(j);return[...H,...se]};return{getDefaultAction:M,getAllOpenWithActions:N,getEditorRouteOpts:te,openEditor:B,triggerDefaultAction:O}},Oi=()=>{const e=Ge(),t=Re(),{copyResources:n}=ns(),r=me.useGettext(),{$gettext:o}=r,s=De(),{currentFolder:i}=we.storeToRefs(s),l=A(()=>ts()?o("⌘ + C"):o("Ctrl + C")),u=({resources:c})=>{bt(t,"files-common-search")&&(c=c.filter(p=>!z.isProjectSpaceResource(p))),n(c)};return{actions:A(()=>[{name:"copy",icon:"file-copy-2",handler:u,shortcut:a(l),label:()=>o("Copy"),isVisible:({resources:c})=>{if(!st(t,"files-spaces-generic")&&!ln(t,"files-public-link")&&!bt(t,"files-common-favorites")&&!bt(t,"files-common-search")||st(t,"files-spaces-projects")||c.length===0)return!1;if(ln(t,"files-public-link"))return a(i)?.canCreate();if(bt(t,"files-common-search")&&c.every(p=>z.isProjectSpaceResource(p)))return!1;if(a(e.options.runningOnEos)){const p=c[0].path?.split("/").filter(Boolean)||[];if(st(t,"files-spaces-generic")&&p.length<5)return!1}return!!a(c)[0].canDownload()},class:"oc-files-actions-copy-trigger"}])}};var jn=(e=>(e.C="c",e.V="v",e.X="x",e.A="a",e.S="s",e.Z="z",e.Plus="+",e.Minus="-",e.Space=" ",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.Esc="Escape",e.Backspace="Backspace",e.Delete="Delete",e))(jn||{}),Li=(e=>(e.Ctrl="Control",e.Shift="Shift",e))(Li||{});const WC=()=>{const e=document.activeElement.tagName,t=document.activeElement.getAttribute("type");if(["textarea","input","select"].includes(e.toLowerCase())&&t!=="checkbox")return!0;const n=document.activeElement;if(!n)return!1;let r;try{r=n?.closest("[data-custom-key-bindings-disabled='true']")}catch{r=n?.parentElement.closest("[data-custom-key-bindings-disabled='true']")}return r?!0:window.getSelection().type==="Range"},_i=e=>{const t=W([]),n=W(0),r=l=>{if(!e?.skipDisabledKeyBindingsCheck&&WC())return;const{key:u,ctrlKey:d,metaKey:c,shiftKey:p}=l;let f=null;const h=[];c||d?(f="Control",h.push("altKey","shiftKey")):p&&(f="Shift",h.push("altKey","ctrlKey","metaKey")),!((m,w)=>w.some(T=>m[T]))(l,h)&&a(t).filter(m=>m.primary===u&&m.modifier===f).forEach(m=>{m.preventDefault&&l.preventDefault(),m.callback(l)})},o=(l,u,{preventDefault:d=!0}={})=>{const c=Ct.v4();return t.value.push({id:c,...l,modifier:l.modifier??null,preventDefault:d,callback:u}),c},s=l=>{t.value=t.value.filter(u=>u.id!==l)},i=()=>{n.value=0};return Rn.useEventListener(document,"keydown",r),{actions:t,bindKeyAction:o,removeKeyAction:s,selectionCursor:n,resetSelectionCursor:i}};function zr(){return{interceptModifierClick:(t,n)=>{if(!t||!n)return!1;const r=t.shiftKey,o=t.ctrlKey||t.metaKey;return!r&&!o?!1:(t.stopPropagation?.(),t.stopImmediatePropagation?.(),r&&ze.publish("app.files.list.clicked.shift",{resource:n,skipTargetSelection:!1}),o&&ze.publish("app.files.list.clicked.meta",n),!0)}}}const Ql=()=>{const e=_i(),t=10,n=.1;return{setCropperInstance:o=>{e.bindKeyAction({primary:jn.ArrowRight},()=>a(o)?.move(-t,0)),e.bindKeyAction({primary:jn.ArrowLeft},()=>a(o)?.move(t,0)),e.bindKeyAction({primary:jn.ArrowDown},()=>a(o)?.move(0,-t)),e.bindKeyAction({primary:jn.ArrowUp},()=>a(o)?.move(0,t)),e.bindKeyAction({primary:jn.Plus},()=>a(o)?.zoom(n)),e.bindKeyAction({primary:jn.Minus},()=>a(o)?.zoom(-n))}}},Kl=()=>{const{showMessage:e,showErrorMessage:t}=Me(),{$gettext:n}=me.useGettext(),{copy:r}=Rn.useClipboard(),{interceptModifierClick:o}=zr(),s=async l=>{try{await r(l),e({title:n("The link has been copied to your clipboard.")})}catch(u){t({title:n("Copy link failed"),errors:[u]})}};return{actions:A(()=>[{name:"copy-permanent-link",icon:"link",label:()=>n("Copy permanent link"),handler:l=>{const{resources:u,event:d}=l,c=u[0];if(!(d&&o(d,c)))return s(c.privateLink)},isVisible:({space:l,resources:u})=>!(u.length!==1||z.isPublicSpaceResource(l)||z.isTrashResource(u[0])),class:"oc-files-actions-copy-permanent-link-trigger"}])}},is={};function QC(e){return e.getIsPending!==void 0}function KC(e){if(QC(e))return e;let t=!0,n=e.then(r=>(t=!1,r),r=>{throw t=!1,r});return n.getIsPending=function(){return t},n}function GC(e){let t={};const n=e.attributes;if(!n)return t;for(let r=n.length-1;r>=0;r--)t[n[r].name]=n[r].value;return t}function JC(e){return Object.keys(e).reduce((t,n)=>(e[n]!==!1&&e[n]!==null&&e[n]!==void 0&&(t[n]=e[n]),t),{})}function XC(e,t){const{class:n,style:r,...o}=GC(e),{class:s,style:i,...l}=JC(t);return{class:[n,s],style:[r,i],...o,...l}}const mh=ge({inheritAttrs:!1,__name:"InlineSvg",props:{src:{},title:{default:void 0},transformSource:{type:Function,default:e=>e},keepDuringLoading:{type:Boolean,default:!0},uniqueIds:{type:[Boolean,String],default:!1},uniqueIdsBase:{default:""}},emits:["loaded","unloaded","error"],setup(e,{expose:t,emit:n}){const r=e,o=n,s=Js(),i=W(),l=W(),u=W(),d=Math.random().toString(36).substring(2);t({svgElSource:i,request:u}),Ue(()=>r.src,w=>{p(w)}),p(r.src);function c(w){if(w=w.cloneNode(!0),r.uniqueIds){const T=typeof r.uniqueIds=="string"?r.uniqueIds:d;w=m(w,T,r.uniqueIdsBase)}return w=r.transformSource(w),r.title&&g(w,r.title),w.innerHTML}function p(w){is[w]||(is[w]=f(w)),i.value&&is[w].getIsPending()&&!r.keepDuringLoading&&(i.value=null,o("unloaded")),is[w].then(T=>{i.value=T,xt(()=>{o("loaded",l.value)})}).catch(T=>{i.value&&(i.value=void 0,o("unloaded")),delete is[w],o("error",T)})}function f(w){return KC(new Promise((T,k)=>{const S=new XMLHttpRequest;S.open("GET",w,!0),u.value=S,S.onload=()=>{if(S.status>=200&&S.status<400)try{let y=new DOMParser().parseFromString(S.responseText,"text/xml").getElementsByTagName("svg")[0];y?T(y):k(new Error('Loaded file is not valid SVG"'))}catch(y){k(y)}else k(new Error("Error loading SVG"))},S.onerror=k,S.send()}))}const h=()=>i.value?za("svg",{...XC(i.value,s),innerHTML:c(i.value),ref:l}):null;function g(w,T){const k=w.getElementsByTagName("title");if(k.length)k[0].textContent=T;else{const S=document.createElementNS("http://www.w3.org/2000/svg","title");S.textContent=T,w.insertBefore(S,w.firstChild)}}function m(w,T,k=""){const S=["id","href","xlink:href","xlink:role","xlink:arcrole"],y=["href","xlink:href"],E=(D,$)=>y.includes(D)&&($?!$.includes("#"):!1);return[...w.children].forEach(D=>{var $;if(($=D.attributes)!=null&&$.length){const _=Object.values(D.attributes).map(L=>{const V=/url\((.*?)\)/.exec(L.value);return V!=null&&V[1]&&(L.value=L.value.replace(V[0],`url(${k}${V[1]}_${T})`)),L});S.forEach(L=>{const V=_.find(te=>te.name===L);V&&!E(L,V.value)&&(V.value=`${V.value}_${T}`)})}return D.children.length?m(D,T,k):D}),w}return(w,T)=>(I(),re(h))}}),or=ge({__name:"OcIcon",props:{accessibleLabel:{default:""},color:{default:""},fillType:{default:"fill"},name:{default:"info"},size:{default:"medium"},type:{default:"span"}},emits:["loaded"],setup(e,{emit:t}){mh.name="inline-svg";const n=t,r=A(()=>_r("oc-icon-title-")),o=A(()=>{const l=`${_S()}icons/`,u=e.fillType.toLowerCase();return u==="none"?`${l}${e.name}.svg`:`${l}${e.name}-${u}.svg`}),s=A(()=>({"size-3":e.size==="xsmall","size-4":e.size==="small","size-5.5":e.size==="medium","size-8":e.size==="large","size-12":e.size==="xlarge","size-22":e.size==="xxlarge","size-42":e.size==="xxxlarge"})),i=l=>{if(e.accessibleLabel!==""){const u=document.createElement("title");u.setAttribute("id",r.value),u.appendChild(document.createTextNode(e.accessibleLabel)),l.insertBefore(u,l.firstChild)}return l};return(l,u)=>(I(),re(rn(e.type),{class:R.normalizeClass(["oc-icon","box-content","inline-block","align-baseline","[&_svg]:block",s.value,{"bg-transparent min-h-0":e.type==="button"}])},{default:Z(()=>[J(a(mh),{src:o.value,"transform-source":i,"aria-hidden":e.accessibleLabel===""?"true":null,"aria-labelledby":e.accessibleLabel===""?null:r.value,focusable:e.accessibleLabel===""?"false":null,style:R.normalizeStyle(e.color!==""?{fill:e.color}:{}),class:R.normalizeClass(s.value),onLoaded:u[0]||(u[0]=d=>n("loaded"))},null,8,["src","aria-hidden","aria-labelledby","focusable","style","class"])]),_:1},8,["class"]))}});var gh=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Mi=gh.join(","),vh=typeof Element>"u",Ur=vh?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ni=!vh&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Bi=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Bi(t.parentNode));return i},YC=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},yh=function(t,n,r){if(Bi(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Mi));return n&&Ur.call(t,Mi)&&o.unshift(t),o=o.filter(r),o},ji=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!Bi(i,!1))if(i.tagName==="SLOT"){var l=i.assignedElements(),u=l.length?l:i.children,d=ji(u,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:i,candidates:d})}else{var c=Ur.call(i,Mi);c&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var p=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),f=!Bi(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(p&&f){var h=ji(p===!0?i.children:p.children,!0,r);r.flatten?o.push.apply(o,h):o.push({scopeParent:i,candidates:h})}else s.unshift.apply(s,i.children)}}return o},bh=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Vr=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||YC(t))&&!bh(t)?0:t.tabIndex},ZC=function(t,n){var r=Vr(t);return r<0&&n&&!bh(t)?0:r},ex=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},wh=function(t){return t.tagName==="INPUT"},tx=function(t){return wh(t)&&t.type==="hidden"},nx=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},rx=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},ox=function(t){if(!t.name)return!0;var n=t.form||Ni(t),r=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=rx(o,t.form);return!s||s===t},sx=function(t){return wh(t)&&t.type==="radio"},ix=function(t){return sx(t)&&!ox(t)},ax=function(t){var n,r=t&&Ni(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,l,u;for(s=!!((i=o)!==null&&i!==void 0&&(l=i.ownerDocument)!==null&&l!==void 0&&l.contains(o)||t!=null&&(u=t.ownerDocument)!==null&&u!==void 0&&u.contains(t));!s&&o;){var d,c,p;r=Ni(o),o=(d=r)===null||d===void 0?void 0:d.host,s=!!((c=o)!==null&&c!==void 0&&(p=c.ownerDocument)!==null&&p!==void 0&&p.contains(o))}}return s},Sh=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},lx=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=Ur.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if(Ur.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var u=t;t;){var d=t.parentElement,c=Ni(t);if(d&&!d.shadowRoot&&o(d)===!0)return Sh(t);t.assignedSlot?t=t.assignedSlot:!d&&c!==t.ownerDocument?t=c.host:t=d}t=u}if(ax(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Sh(t);return!1},cx=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Ur.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},zi=function(t,n){return!(n.disabled||tx(n)||lx(n,t)||nx(n)||cx(n))},Gl=function(t,n){return!(ix(n)||Vr(n)<0||!zi(t,n))},ux=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Th=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,l=i?o.scopeParent:o,u=ZC(l,i),d=i?Th(o.candidates):l;u===0?i?n.push.apply(n,d):n.push(l):r.push({documentOrder:s,tabIndex:u,item:o,isScope:i,content:d})}),r.sort(ex).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},dx=function(t,n){n=n||{};var r;return n.getShadowRoot?r=ji([t],n.includeContainer,{filter:Gl.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:ux}):r=yh(t,n.includeContainer,Gl.bind(null,n)),Th(r)},fx=function(t,n){n=n||{};var r;return n.getShadowRoot?r=ji([t],n.includeContainer,{filter:zi.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=yh(t,n.includeContainer,zi.bind(null,n)),r},vo=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Ur.call(t,Mi)===!1?!1:Gl(n,t)},px=gh.concat("iframe:not([inert]):not([inert] *)").join(","),Jl=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Ur.call(t,px)===!1?!1:zi(n,t)};function Xl(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hx(e){if(Array.isArray(e))return Xl(e)}function kh(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Ah(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
10
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return i=u.done,u},e:function(u){l=!0,s=u},f:function(){try{i||n.return==null||n.return()}finally{if(l)throw s}}}}function mx(e,t,n){return(t=wx(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gx(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vx(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
11
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ch(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function xh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ch(Object(n),!0).forEach(function(r){mx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ch(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yx(e){return hx(e)||gx(e)||Ah(e)||vx()}function bx(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wx(e){var t=bx(e,"string");return typeof t=="symbol"?t:t+""}function Ah(e,t){if(e){if(typeof e=="string")return Xl(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xl(e,t):void 0}}var sr={getActiveTrap:function(t){return t?.length>0?t[t.length-1]:null},activateTrap:function(t,n){var r=sr.getActiveTrap(t);n!==r&&sr.pauseTrap(t);var o=t.indexOf(n);o===-1||t.splice(o,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),sr.unpauseTrap(t)},pauseTrap:function(t){var n=sr.getActiveTrap(t);n?._setPausedState(!0)},unpauseTrap:function(t){var n=sr.getActiveTrap(t);n&&!n._isManuallyPaused()&&n._setPausedState(!1)}},Sx=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},Tx=function(t){return t?.key==="Escape"||t?.key==="Esc"||t?.keyCode===27},as=function(t){return t?.key==="Tab"||t?.keyCode===9},kx=function(t){return as(t)&&!t.shiftKey},Cx=function(t){return as(t)&&t.shiftKey},Eh=function(t){return setTimeout(t,0)},ls=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return typeof t=="function"?t.apply(void 0,r):t},Ui=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},xx=[],Ax=function(t,n){var r=n?.document||document,o=n?.trapStack||xx,s=xh({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:kx,isKeyBackward:Cx},n),i={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},l,u=function(M,N,q){return M&&M[N]!==void 0?M[N]:s[q||N]},d=function(M,N){var q=typeof N?.composedPath=="function"?N.composedPath():void 0;return i.containerGroups.findIndex(function(j){var H=j.container,se=j.tabbableNodes;return H.contains(M)||q?.includes(H)||se.find(function(Y){return Y===M})})},c=function(M){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},q=N.hasFallback,j=q===void 0?!1:q,H=N.params,se=H===void 0?[]:H,Y=s[M];if(typeof Y=="function"&&(Y=Y.apply(void 0,yx(se))),Y===!0&&(Y=void 0),!Y){if(Y===void 0||Y===!1)return Y;throw new Error("`".concat(M,"` was specified but was not a node, or did not return a node"))}var ae=Y;if(typeof Y=="string"){try{ae=r.querySelector(Y)}catch(ne){throw new Error("`".concat(M,'` appears to be an invalid selector; error="').concat(ne.message,'"'))}if(!ae&&!j)throw new Error("`".concat(M,"` as selector refers to no known node"))}return ae},p=function(){var M=c("initialFocus",{hasFallback:!0});if(M===!1)return!1;if(M===void 0||M&&!Jl(M,s.tabbableOptions))if(d(r.activeElement)>=0)M=r.activeElement;else{var N=i.tabbableGroups[0],q=N&&N.firstTabbableNode;M=q||c("fallbackFocus")}else M===null&&(M=c("fallbackFocus"));if(!M)throw new Error("Your focus-trap needs to have at least one focusable element");return M},f=function(){if(i.containerGroups=i.containers.map(function(M){var N=dx(M,s.tabbableOptions),q=fx(M,s.tabbableOptions),j=N.length>0?N[0]:void 0,H=N.length>0?N[N.length-1]:void 0,se=q.find(function(ne){return vo(ne)}),Y=q.slice().reverse().find(function(ne){return vo(ne)}),ae=!!N.find(function(ne){return Vr(ne)>0});return{container:M,tabbableNodes:N,focusableNodes:q,posTabIndexesFound:ae,firstTabbableNode:j,lastTabbableNode:H,firstDomTabbableNode:se,lastDomTabbableNode:Y,nextTabbableNode:function(pe){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,be=N.indexOf(pe);return be<0?fe?q.slice(q.indexOf(pe)+1).find(function(xe){return vo(xe)}):q.slice(0,q.indexOf(pe)).reverse().find(function(xe){return vo(xe)}):N[be+(fe?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(M){return M.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find(function(M){return M.posTabIndexesFound})&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function(M){var N=M.activeElement;if(N)return N.shadowRoot&&N.shadowRoot.activeElement!==null?h(N.shadowRoot):N},g=function(M){if(M!==!1&&M!==h(document)){if(!M||!M.focus){g(p());return}M.focus({preventScroll:!!s.preventScroll}),i.mostRecentlyFocusedNode=M,Sx(M)&&M.select()}},m=function(M){var N=c("setReturnFocus",{params:[M]});return N||(N===!1?!1:M)},w=function(M){var N=M.target,q=M.event,j=M.isBackward,H=j===void 0?!1:j;N=N||Ui(q),f();var se=null;if(i.tabbableGroups.length>0){var Y=d(N,q),ae=Y>=0?i.containerGroups[Y]:void 0;if(Y<0)H?se=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:se=i.tabbableGroups[0].firstTabbableNode;else if(H){var ne=i.tabbableGroups.findIndex(function(ie){var de=ie.firstTabbableNode;return N===de});if(ne<0&&(ae.container===N||Jl(N,s.tabbableOptions)&&!vo(N,s.tabbableOptions)&&!ae.nextTabbableNode(N,!1))&&(ne=Y),ne>=0){var pe=ne===0?i.tabbableGroups.length-1:ne-1,fe=i.tabbableGroups[pe];se=Vr(N)>=0?fe.lastTabbableNode:fe.lastDomTabbableNode}else as(q)||(se=ae.nextTabbableNode(N,!1))}else{var be=i.tabbableGroups.findIndex(function(ie){var de=ie.lastTabbableNode;return N===de});if(be<0&&(ae.container===N||Jl(N,s.tabbableOptions)&&!vo(N,s.tabbableOptions)&&!ae.nextTabbableNode(N))&&(be=Y),be>=0){var xe=be===i.tabbableGroups.length-1?0:be+1,he=i.tabbableGroups[xe];se=Vr(N)>=0?he.firstTabbableNode:he.firstDomTabbableNode}else as(q)||(se=ae.nextTabbableNode(N))}}else se=c("fallbackFocus");return se},T=function(M){var N=Ui(M);if(!(d(N,M)>=0)){if(ls(s.clickOutsideDeactivates,M)){l.deactivate({returnFocus:s.returnFocusOnDeactivate});return}ls(s.allowOutsideClick,M)||M.preventDefault()}},k=function(M){var N=Ui(M),q=d(N,M)>=0;if(q||N instanceof Document)q&&(i.mostRecentlyFocusedNode=N);else{M.stopImmediatePropagation();var j,H=!0;if(i.mostRecentlyFocusedNode)if(Vr(i.mostRecentlyFocusedNode)>0){var se=d(i.mostRecentlyFocusedNode),Y=i.containerGroups[se].tabbableNodes;if(Y.length>0){var ae=Y.findIndex(function(ne){return ne===i.mostRecentlyFocusedNode});ae>=0&&(s.isKeyForward(i.recentNavEvent)?ae+1<Y.length&&(j=Y[ae+1],H=!1):ae-1>=0&&(j=Y[ae-1],H=!1))}}else i.containerGroups.some(function(ne){return ne.tabbableNodes.some(function(pe){return Vr(pe)>0})})||(H=!1);else H=!1;H&&(j=w({target:i.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(i.recentNavEvent)})),g(j||i.mostRecentlyFocusedNode||p())}i.recentNavEvent=void 0},S=function(M){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=M;var q=w({event:M,isBackward:N});q&&(as(M)&&M.preventDefault(),g(q))},y=function(M){(s.isKeyForward(M)||s.isKeyBackward(M))&&S(M,s.isKeyBackward(M))},E=function(M){Tx(M)&&ls(s.escapeDeactivates,M)!==!1&&(M.preventDefault(),l.deactivate())},D=function(M){var N=Ui(M);d(N,M)>=0||ls(s.clickOutsideDeactivates,M)||ls(s.allowOutsideClick,M)||(M.preventDefault(),M.stopImmediatePropagation())},$=function(){if(i.active)return sr.activateTrap(o,l),i.delayInitialFocusTimer=s.delayInitialFocus?Eh(function(){g(p())}):g(p()),r.addEventListener("focusin",k,!0),r.addEventListener("mousedown",T,{capture:!0,passive:!1}),r.addEventListener("touchstart",T,{capture:!0,passive:!1}),r.addEventListener("click",D,{capture:!0,passive:!1}),r.addEventListener("keydown",y,{capture:!0,passive:!1}),r.addEventListener("keydown",E),l},_=function(M){i.active&&!i.paused&&l._setSubtreeIsolation(!1),i.adjacentElements.clear(),i.alreadySilent.clear();var N=new Set,q=new Set,j=kh(M),H;try{for(j.s();!(H=j.n()).done;){var se=H.value;N.add(se);for(var Y=typeof ShadowRoot<"u"&&se.getRootNode()instanceof ShadowRoot,ae=se;ae;){N.add(ae);var ne=ae.parentElement,pe=[];ne?pe=ne.children:!ne&&Y&&(pe=ae.getRootNode().children,ne=ae.getRootNode().host,Y=typeof ShadowRoot<"u"&&ne.getRootNode()instanceof ShadowRoot);var fe=kh(pe),be;try{for(fe.s();!(be=fe.n()).done;){var xe=be.value;q.add(xe)}}catch(he){fe.e(he)}finally{fe.f()}ae=ne}}}catch(he){j.e(he)}finally{j.f()}N.forEach(function(he){q.delete(he)}),i.adjacentElements=q},L=function(){if(i.active)return r.removeEventListener("focusin",k,!0),r.removeEventListener("mousedown",T,!0),r.removeEventListener("touchstart",T,!0),r.removeEventListener("click",D,!0),r.removeEventListener("keydown",y,!0),r.removeEventListener("keydown",E),l},V=function(M){var N=M.some(function(q){var j=Array.from(q.removedNodes);return j.some(function(H){return H===i.mostRecentlyFocusedNode})});N&&g(p())},te=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(V):void 0,B=function(){te&&(te.disconnect(),i.active&&!i.paused&&i.containers.map(function(M){te.observe(M,{subtree:!0,childList:!0})}))};return l={get active(){return i.active},get paused(){return i.paused},activate:function(M){if(i.active)return this;var N=u(M,"onActivate"),q=u(M,"onPostActivate"),j=u(M,"checkCanFocusTrap"),H=sr.getActiveTrap(o),se=!1;if(H&&!H.paused){var Y;(Y=H._setSubtreeIsolation)===null||Y===void 0||Y.call(H,!1),se=!0}try{j||f(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=h(r),N?.();var ae=function(){j&&f(),$(),B(),s.isolateSubtrees&&l._setSubtreeIsolation(!0),q?.()};if(j)return j(i.containers.concat()).then(ae,ae),this;ae()}catch(pe){if(H===sr.getActiveTrap(o)&&se){var ne;(ne=H._setSubtreeIsolation)===null||ne===void 0||ne.call(H,!0)}throw pe}return this},deactivate:function(M){if(!i.active)return this;var N=xh({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},M);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,i.paused||l._setSubtreeIsolation(!1),i.alreadySilent.clear(),L(),i.active=!1,i.paused=!1,B(),sr.deactivateTrap(o,l);var q=u(N,"onDeactivate"),j=u(N,"onPostDeactivate"),H=u(N,"checkCanReturnFocus"),se=u(N,"returnFocus","returnFocusOnDeactivate");q?.();var Y=function(){Eh(function(){se&&g(m(i.nodeFocusedBeforeActivation)),j?.()})};return se&&H?(H(m(i.nodeFocusedBeforeActivation)).then(Y,Y),this):(Y(),this)},pause:function(M){return i.active?(i.manuallyPaused=!0,this._setPausedState(!0,M)):this},unpause:function(M){return i.active?(i.manuallyPaused=!1,o[o.length-1]!==this?this:this._setPausedState(!1,M)):this},updateContainerElements:function(M){var N=[].concat(M).filter(Boolean);return i.containers=N.map(function(q){return typeof q=="string"?r.querySelector(q):q}),s.isolateSubtrees&&_(i.containers),i.active&&(f(),s.isolateSubtrees&&!i.paused&&l._setSubtreeIsolation(!0)),B(),this}},Object.defineProperties(l,{_isManuallyPaused:{value:function(){return i.manuallyPaused}},_setPausedState:{value:function(M,N){if(i.paused===M)return this;if(i.paused=M,M){var q=u(N,"onPause"),j=u(N,"onPostPause");q?.(),L(),B(),l._setSubtreeIsolation(!1),j?.()}else{var H=u(N,"onUnpause"),se=u(N,"onPostUnpause");H?.(),l._setSubtreeIsolation(!0),f(),$(),B(),se?.()}return this}},_setSubtreeIsolation:{value:function(M){s.isolateSubtrees&&i.adjacentElements.forEach(function(N){var q;M?s.isolateSubtrees==="aria-hidden"?((N.ariaHidden==="true"||((q=N.getAttribute("aria-hidden"))===null||q===void 0?void 0:q.toLowerCase())==="true")&&i.alreadySilent.add(N),N.setAttribute("aria-hidden","true")):((N.inert||N.hasAttribute("inert"))&&i.alreadySilent.add(N),N.setAttribute("inert",!0)):i.alreadySilent.has(N)||(s.isolateSubtrees==="aria-hidden"?N.removeAttribute("aria-hidden"):N.removeAttribute("inert"))})}}}),l.updateContainerElements(t),l};function FO(e){return e}const Ex={escapeDeactivates:{type:Boolean,default:!0},returnFocusOnDeactivate:{type:Boolean,default:!0},allowOutsideClick:{type:[Boolean,Function],default:!0},clickOutsideDeactivates:[Boolean,Function],initialFocus:[String,Function,Boolean],fallbackFocus:[String,Function],checkCanFocusTrap:Function,checkCanReturnFocus:Function,delayInitialFocus:{type:Boolean,default:!0},document:Object,preventScroll:Boolean,setReturnFocus:[Object,String,Boolean,Function],tabbableOptions:Object},Rx=ge({name:"FocusTrap",props:Object.assign({active:{type:Boolean,default:!0}},Ex),emits:["update:active","activate","postActivate","deactivate","postDeactivate"],render(){return this.renderImpl()},setup(e,{slots:t,emit:n}){let r;const o=W(null),s=A(()=>{const l=o.value;return l&&(l instanceof HTMLElement?l:l.$el)});function i(){return r||(r=Ax(s.value,{escapeDeactivates:e.escapeDeactivates,allowOutsideClick:e.allowOutsideClick,returnFocusOnDeactivate:e.returnFocusOnDeactivate,clickOutsideDeactivates:e.clickOutsideDeactivates,onActivate:()=>{n("update:active",!0),n("activate")},onDeactivate:()=>{n("update:active",!1),n("deactivate")},onPostActivate:()=>n("postActivate"),onPostDeactivate:()=>n("postDeactivate"),initialFocus:e.initialFocus,fallbackFocus:e.fallbackFocus,tabbableOptions:e.tabbableOptions,delayInitialFocus:e.delayInitialFocus,preventScroll:e.preventScroll}))}return yt(()=>{Ue(()=>e.active,l=>{l&&s.value?i().activate():r&&(r.deactivate(),(!s.value||s.value.nodeType===Node.COMMENT_NODE)&&(r=null))},{immediate:!0,flush:"post"})}),Qs(()=>{r&&r.deactivate(),r=null}),{activate(){i().activate()},deactivate(){r&&r.deactivate()},renderImpl(){if(!t.default)return null;const l=t.default().filter(d=>d.type!==to);return!l||!l.length||l.length>1?(console.error("[focus-trap-vue]: FocusTrap requires exactly one child."),l):no(l[0],{ref:o})}}}}),Dx=["open"],Px=["id"],Ix=Le(ge({__name:"OcBottomDrawer",props:{id:{},isDrawerActive:{type:Boolean,default:!0},isFocusTrapActive:{type:Boolean,default:!0},hasFullHeight:{type:Boolean,default:!1},maxHeight:{default:"max-h-[66vh]"}},emits:["clicked"],setup(e){return Ue(()=>e.isDrawerActive,async()=>{e.isDrawerActive&&(await xt(),document.getElementById(e.id)?.classList.add("active"))},{immediate:!0}),(t,n)=>(I(),G("dialog",{class:"oc-bottom-drawer fixed inset-0 bg-black/40 size-full",open:e.isDrawerActive,onClick:n[0]||(n[0]=r=>t.$emit("clicked",r))},[J(a(Rx),{active:e.isFocusTrapActive},{default:Z(()=>[Q("div",{id:e.id,tabindex:"-1",class:R.normalizeClass(["fixed inset-x-0 rounded-t-xl w-full overflow-y-auto transition-all duration-200 -bottom-full overflow-x-hidden",[{"[&.active]:bottom-0":e.isDrawerActive,"h-full":e.hasFullHeight},e.maxHeight]])},[Ce(t.$slots,"default",{},void 0,!0)],10,Px)]),_:3},8,["active"])],8,Dx))}}),[["__scopeId","data-v-42899e08"]]),Qt=ge({__name:"OcButton",props:{appearance:{default:"outline"},ariaLabel:{},colorRole:{default:"secondary"},disabled:{type:Boolean,default:!1},gapSize:{default:"medium"},href:{},justifyContent:{default:"center"},showSpinner:{type:Boolean,default:!1},size:{default:"medium"},submit:{default:"button"},target:{},to:{},type:{default:"button"},noHover:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){const n=t,r=A(()=>({...e.href&&{href:e.href},...e.target&&{target:e.target},...e.to&&{to:e.to},...e.type==="button"&&{type:e.submit},...e.type==="button"&&{disabled:e.disabled}})),o=A(()=>({...e.type==="button"&&{click:s}})),s=i=>{n("click",i)};return(i,l)=>{const u=oe("oc-spinner");return I(),re(rn(e.type),pt(r.value,{"aria-label":e.ariaLabel,class:[[`oc-button-${a(rt.kebabCase)(e.colorRole)}`,`oc-button-${e.appearance}`,`oc-button-${a(rt.kebabCase)(e.colorRole)}-${e.appearance}`,{...a(MS)(e.gapSize),...a(NS)(e.justifyContent),"text-sm min-h-3":e.size==="small","text-base min-h-4":e.size==="medium","text-lg min-h-7":e.size==="large","no-hover":e.noHover}],"oc-button cursor-pointer disabled:opacity-60 disabled:cursor-default"]},Gs(o.value)),{default:Z(()=>[e.showSpinner?(I(),re(u,{key:0,size:"small",class:"spinner"})):le("",!0),Ce(i.$slots,"default")]),_:3},16,["aria-label","class"])}}});var Kt="top",fn="bottom",pn="right",Gt="left",Yl="auto",cs=[Kt,fn,pn,Gt],yo="start",us="end",Fx="clippingParents",Rh="viewport",ds="popper",$x="reference",Dh=cs.reduce(function(e,t){return e.concat([t+"-"+yo,t+"-"+us])},[]),Ph=[].concat(cs,[Yl]).reduce(function(e,t){return e.concat([t,t+"-"+yo,t+"-"+us])},[]),Ox="beforeRead",Lx="read",_x="afterRead",Mx="beforeMain",Nx="main",Bx="afterMain",jx="beforeWrite",zx="write",Ux="afterWrite",Vx=[Ox,Lx,_x,Mx,Nx,Bx,jx,zx,Ux];function zn(e){return e?(e.nodeName||"").toLowerCase():null}function Zt(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function qr(e){var t=Zt(e).Element;return e instanceof t||e instanceof Element}function hn(e){var t=Zt(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Zl(e){if(typeof ShadowRoot>"u")return!1;var t=Zt(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function qx(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},s=t.elements[n];!hn(s)||!zn(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(i){var l=o[i];l===!1?s.removeAttribute(i):s.setAttribute(i,l===!0?"":l)}))})}function Hx(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],s=t.attributes[r]||{},i=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),l=i.reduce(function(u,d){return u[d]="",u},{});!hn(o)||!zn(o)||(Object.assign(o.style,l),Object.keys(s).forEach(function(u){o.removeAttribute(u)}))})}}const Ih={name:"applyStyles",enabled:!0,phase:"write",fn:qx,effect:Hx,requires:["computeStyles"]};function Un(e){return e.split("-")[0]}var Hr=Math.max,Vi=Math.min,bo=Math.round;function ec(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Fh(){return!/^((?!chrome|android).)*safari/i.test(ec())}function wo(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,s=1;t&&hn(e)&&(o=e.offsetWidth>0&&bo(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&bo(r.height)/e.offsetHeight||1);var i=qr(e)?Zt(e):window,l=i.visualViewport,u=!Fh()&&n,d=(r.left+(u&&l?l.offsetLeft:0))/o,c=(r.top+(u&&l?l.offsetTop:0))/s,p=r.width/o,f=r.height/s;return{width:p,height:f,top:c,right:d+p,bottom:c+f,left:d,x:d,y:c}}function tc(e){var t=wo(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function $h(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Zl(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ir(e){return Zt(e).getComputedStyle(e)}function Wx(e){return["table","td","th"].indexOf(zn(e))>=0}function kr(e){return((qr(e)?e.ownerDocument:e.document)||window.document).documentElement}function qi(e){return zn(e)==="html"?e:e.assignedSlot||e.parentNode||(Zl(e)?e.host:null)||kr(e)}function Oh(e){return!hn(e)||ir(e).position==="fixed"?null:e.offsetParent}function Qx(e){var t=/firefox/i.test(ec()),n=/Trident/i.test(ec());if(n&&hn(e)){var r=ir(e);if(r.position==="fixed")return null}var o=qi(e);for(Zl(o)&&(o=o.host);hn(o)&&["html","body"].indexOf(zn(o))<0;){var s=ir(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}function fs(e){for(var t=Zt(e),n=Oh(e);n&&Wx(n)&&ir(n).position==="static";)n=Oh(n);return n&&(zn(n)==="html"||zn(n)==="body"&&ir(n).position==="static")?t:n||Qx(e)||t}function nc(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ps(e,t,n){return Hr(e,Vi(t,n))}function Kx(e,t,n){var r=ps(e,t,n);return r>n?n:r}function Lh(){return{top:0,right:0,bottom:0,left:0}}function _h(e){return Object.assign({},Lh(),e)}function Mh(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Gx=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,_h(typeof t!="number"?t:Mh(t,cs))};function Jx(e){var t,n=e.state,r=e.name,o=e.options,s=n.elements.arrow,i=n.modifiersData.popperOffsets,l=Un(n.placement),u=nc(l),d=[Gt,pn].indexOf(l)>=0,c=d?"height":"width";if(!(!s||!i)){var p=Gx(o.padding,n),f=tc(s),h=u==="y"?Kt:Gt,g=u==="y"?fn:pn,m=n.rects.reference[c]+n.rects.reference[u]-i[u]-n.rects.popper[c],w=i[u]-n.rects.reference[u],T=fs(s),k=T?u==="y"?T.clientHeight||0:T.clientWidth||0:0,S=m/2-w/2,y=p[h],E=k-f[c]-p[g],D=k/2-f[c]/2+S,$=ps(y,D,E),_=u;n.modifiersData[r]=(t={},t[_]=$,t.centerOffset=$-D,t)}}function Xx(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||$h(t.elements.popper,o)&&(t.elements.arrow=o))}const Yx={name:"arrow",enabled:!0,phase:"main",fn:Jx,effect:Xx,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function So(e){return e.split("-")[1]}var Zx={top:"auto",right:"auto",bottom:"auto",left:"auto"};function eA(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:bo(n*o)/o||0,y:bo(r*o)/o||0}}function Nh(e){var t,n=e.popper,r=e.popperRect,o=e.placement,s=e.variation,i=e.offsets,l=e.position,u=e.gpuAcceleration,d=e.adaptive,c=e.roundOffsets,p=e.isFixed,f=i.x,h=f===void 0?0:f,g=i.y,m=g===void 0?0:g,w=typeof c=="function"?c({x:h,y:m}):{x:h,y:m};h=w.x,m=w.y;var T=i.hasOwnProperty("x"),k=i.hasOwnProperty("y"),S=Gt,y=Kt,E=window;if(d){var D=fs(n),$="clientHeight",_="clientWidth";if(D===Zt(n)&&(D=kr(n),ir(D).position!=="static"&&l==="absolute"&&($="scrollHeight",_="scrollWidth")),D=D,o===Kt||(o===Gt||o===pn)&&s===us){y=fn;var L=p&&D===E&&E.visualViewport?E.visualViewport.height:D[$];m-=L-r.height,m*=u?1:-1}if(o===Gt||(o===Kt||o===fn)&&s===us){S=pn;var V=p&&D===E&&E.visualViewport?E.visualViewport.width:D[_];h-=V-r.width,h*=u?1:-1}}var te=Object.assign({position:l},d&&Zx),B=c===!0?eA({x:h,y:m},Zt(n)):{x:h,y:m};if(h=B.x,m=B.y,u){var O;return Object.assign({},te,(O={},O[y]=k?"0":"",O[S]=T?"0":"",O.transform=(E.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",O))}return Object.assign({},te,(t={},t[y]=k?m+"px":"",t[S]=T?h+"px":"",t.transform="",t))}function tA(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,s=n.adaptive,i=s===void 0?!0:s,l=n.roundOffsets,u=l===void 0?!0:l,d={placement:Un(t.placement),variation:So(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Nh(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Nh(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const nA={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:tA,data:{}};var Hi={passive:!0};function rA(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,s=o===void 0?!0:o,i=r.resize,l=i===void 0?!0:i,u=Zt(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&d.forEach(function(c){c.addEventListener("scroll",n.update,Hi)}),l&&u.addEventListener("resize",n.update,Hi),function(){s&&d.forEach(function(c){c.removeEventListener("scroll",n.update,Hi)}),l&&u.removeEventListener("resize",n.update,Hi)}}const oA={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:rA,data:{}};var sA={left:"right",right:"left",bottom:"top",top:"bottom"};function Wi(e){return e.replace(/left|right|bottom|top/g,function(t){return sA[t]})}var iA={start:"end",end:"start"};function Bh(e){return e.replace(/start|end/g,function(t){return iA[t]})}function rc(e){var t=Zt(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function oc(e){return wo(kr(e)).left+rc(e).scrollLeft}function aA(e,t){var n=Zt(e),r=kr(e),o=n.visualViewport,s=r.clientWidth,i=r.clientHeight,l=0,u=0;if(o){s=o.width,i=o.height;var d=Fh();(d||!d&&t==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:l+oc(e),y:u}}function lA(e){var t,n=kr(e),r=rc(e),o=(t=e.ownerDocument)==null?void 0:t.body,s=Hr(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=Hr(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-r.scrollLeft+oc(e),u=-r.scrollTop;return ir(o||n).direction==="rtl"&&(l+=Hr(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:i,x:l,y:u}}function sc(e){var t=ir(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function jh(e){return["html","body","#document"].indexOf(zn(e))>=0?e.ownerDocument.body:hn(e)&&sc(e)?e:jh(qi(e))}function hs(e,t){var n;t===void 0&&(t=[]);var r=jh(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Zt(r),i=o?[s].concat(s.visualViewport||[],sc(r)?r:[]):r,l=t.concat(i);return o?l:l.concat(hs(qi(i)))}function ic(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function cA(e,t){var n=wo(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function zh(e,t,n){return t===Rh?ic(aA(e,n)):qr(t)?cA(t,n):ic(lA(kr(e)))}function uA(e){var t=hs(qi(e)),n=["absolute","fixed"].indexOf(ir(e).position)>=0,r=n&&hn(e)?fs(e):e;return qr(r)?t.filter(function(o){return qr(o)&&$h(o,r)&&zn(o)!=="body"}):[]}function dA(e,t,n,r){var o=t==="clippingParents"?uA(e):[].concat(t),s=[].concat(o,[n]),i=s[0],l=s.reduce(function(u,d){var c=zh(e,d,r);return u.top=Hr(c.top,u.top),u.right=Vi(c.right,u.right),u.bottom=Vi(c.bottom,u.bottom),u.left=Hr(c.left,u.left),u},zh(e,i,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function Uh(e){var t=e.reference,n=e.element,r=e.placement,o=r?Un(r):null,s=r?So(r):null,i=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,u;switch(o){case Kt:u={x:i,y:t.y-n.height};break;case fn:u={x:i,y:t.y+t.height};break;case pn:u={x:t.x+t.width,y:l};break;case Gt:u={x:t.x-n.width,y:l};break;default:u={x:t.x,y:t.y}}var d=o?nc(o):null;if(d!=null){var c=d==="y"?"height":"width";switch(s){case yo:u[d]=u[d]-(t[c]/2-n[c]/2);break;case us:u[d]=u[d]+(t[c]/2-n[c]/2);break}}return u}function To(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,s=n.strategy,i=s===void 0?e.strategy:s,l=n.boundary,u=l===void 0?Fx:l,d=n.rootBoundary,c=d===void 0?Rh:d,p=n.elementContext,f=p===void 0?ds:p,h=n.altBoundary,g=h===void 0?!1:h,m=n.padding,w=m===void 0?0:m,T=_h(typeof w!="number"?w:Mh(w,cs)),k=f===ds?$x:ds,S=e.rects.popper,y=e.elements[g?k:f],E=dA(qr(y)?y:y.contextElement||kr(e.elements.popper),u,c,i),D=wo(e.elements.reference),$=Uh({reference:D,element:S,placement:o}),_=ic(Object.assign({},S,$)),L=f===ds?_:D,V={top:E.top-L.top+T.top,bottom:L.bottom-E.bottom+T.bottom,left:E.left-L.left+T.left,right:L.right-E.right+T.right},te=e.modifiersData.offset;if(f===ds&&te){var B=te[o];Object.keys(V).forEach(function(O){var M=[pn,fn].indexOf(O)>=0?1:-1,N=[Kt,fn].indexOf(O)>=0?"y":"x";V[O]+=B[N]*M})}return V}function fA(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,s=n.rootBoundary,i=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,d=u===void 0?Ph:u,c=So(r),p=c?l?Dh:Dh.filter(function(g){return So(g)===c}):cs,f=p.filter(function(g){return d.indexOf(g)>=0});f.length===0&&(f=p);var h=f.reduce(function(g,m){return g[m]=To(e,{placement:m,boundary:o,rootBoundary:s,padding:i})[Un(m)],g},{});return Object.keys(h).sort(function(g,m){return h[g]-h[m]})}function pA(e){if(Un(e)===Yl)return[];var t=Wi(e);return[Bh(e),t,Bh(t)]}function hA(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,l=i===void 0?!0:i,u=n.fallbackPlacements,d=n.padding,c=n.boundary,p=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,g=h===void 0?!0:h,m=n.allowedAutoPlacements,w=t.options.placement,T=Un(w),k=T===w,S=u||(k||!g?[Wi(w)]:pA(w)),y=[w].concat(S).reduce(function(fe,be){return fe.concat(Un(be)===Yl?fA(t,{placement:be,boundary:c,rootBoundary:p,padding:d,flipVariations:g,allowedAutoPlacements:m}):be)},[]),E=t.rects.reference,D=t.rects.popper,$=new Map,_=!0,L=y[0],V=0;V<y.length;V++){var te=y[V],B=Un(te),O=So(te)===yo,M=[Kt,fn].indexOf(B)>=0,N=M?"width":"height",q=To(t,{placement:te,boundary:c,rootBoundary:p,altBoundary:f,padding:d}),j=M?O?pn:Gt:O?fn:Kt;E[N]>D[N]&&(j=Wi(j));var H=Wi(j),se=[];if(s&&se.push(q[B]<=0),l&&se.push(q[j]<=0,q[H]<=0),se.every(function(fe){return fe})){L=te,_=!1;break}$.set(te,se)}if(_)for(var Y=g?3:1,ae=function(be){var xe=y.find(function(he){var ie=$.get(he);if(ie)return ie.slice(0,be).every(function(de){return de})});if(xe)return L=xe,"break"},ne=Y;ne>0;ne--){var pe=ae(ne);if(pe==="break")break}t.placement!==L&&(t.modifiersData[r]._skip=!0,t.placement=L,t.reset=!0)}}const mA={name:"flip",enabled:!0,phase:"main",fn:hA,requiresIfExists:["offset"],data:{_skip:!1}};function Vh(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function qh(e){return[Kt,pn,fn,Gt].some(function(t){return e[t]>=0})}function gA(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,s=t.modifiersData.preventOverflow,i=To(t,{elementContext:"reference"}),l=To(t,{altBoundary:!0}),u=Vh(i,r),d=Vh(l,o,s),c=qh(u),p=qh(d);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:d,isReferenceHidden:c,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":p})}const vA={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:gA};function yA(e,t,n){var r=Un(e),o=[Gt,Kt].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,i=s[0],l=s[1];return i=i||0,l=(l||0)*o,[Gt,pn].indexOf(r)>=0?{x:l,y:i}:{x:i,y:l}}function bA(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,i=Ph.reduce(function(c,p){return c[p]=yA(p,t.rects,s),c},{}),l=i[t.placement],u=l.x,d=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=d),t.modifiersData[r]=i}const wA={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:bA};function SA(e){var t=e.state,n=e.name;t.modifiersData[n]=Uh({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const TA={name:"popperOffsets",enabled:!0,phase:"read",fn:SA,data:{}};function kA(e){return e==="x"?"y":"x"}function CA(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,l=i===void 0?!1:i,u=n.boundary,d=n.rootBoundary,c=n.altBoundary,p=n.padding,f=n.tether,h=f===void 0?!0:f,g=n.tetherOffset,m=g===void 0?0:g,w=To(t,{boundary:u,rootBoundary:d,padding:p,altBoundary:c}),T=Un(t.placement),k=So(t.placement),S=!k,y=nc(T),E=kA(y),D=t.modifiersData.popperOffsets,$=t.rects.reference,_=t.rects.popper,L=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,V=typeof L=="number"?{mainAxis:L,altAxis:L}:Object.assign({mainAxis:0,altAxis:0},L),te=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,B={x:0,y:0};if(D){if(s){var O,M=y==="y"?Kt:Gt,N=y==="y"?fn:pn,q=y==="y"?"height":"width",j=D[y],H=j+w[M],se=j-w[N],Y=h?-_[q]/2:0,ae=k===yo?$[q]:_[q],ne=k===yo?-_[q]:-$[q],pe=t.elements.arrow,fe=h&&pe?tc(pe):{width:0,height:0},be=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Lh(),xe=be[M],he=be[N],ie=ps(0,$[q],fe[q]),de=S?$[q]/2-Y-ie-xe-V.mainAxis:ae-ie-xe-V.mainAxis,ue=S?-$[q]/2+Y+ie+he+V.mainAxis:ne+ie+he+V.mainAxis,Se=t.elements.arrow&&fs(t.elements.arrow),$e=Se?y==="y"?Se.clientTop||0:Se.clientLeft||0:0,Ve=(O=te?.[y])!=null?O:0,lt=j+de-Ve-$e,Tt=j+ue-Ve,ut=ps(h?Vi(H,lt):H,j,h?Hr(se,Tt):se);D[y]=ut,B[y]=ut-j}if(l){var gt,ve=y==="x"?Kt:Gt,ke=y==="x"?fn:pn,qe=D[E],We=E==="y"?"height":"width",Jt=qe+w[ve],Xt=qe-w[ke],kt=[Kt,Gt].indexOf(T)!==-1,dt=(gt=te?.[E])!=null?gt:0,mn=kt?Jt:qe-$[We]-_[We]-dt+V.altAxis,qn=kt?qe+$[We]+_[We]-dt-V.altAxis:Xt,At=h&&kt?Kx(mn,qe,qn):ps(h?mn:Jt,qe,h?qn:Xt);D[E]=At,B[E]=At-qe}t.modifiersData[r]=B}}const xA={name:"preventOverflow",enabled:!0,phase:"main",fn:CA,requiresIfExists:["offset"]};function AA(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function EA(e){return e===Zt(e)||!hn(e)?rc(e):AA(e)}function RA(e){var t=e.getBoundingClientRect(),n=bo(t.width)/e.offsetWidth||1,r=bo(t.height)/e.offsetHeight||1;return n!==1||r!==1}function DA(e,t,n){n===void 0&&(n=!1);var r=hn(t),o=hn(t)&&RA(t),s=kr(t),i=wo(e,o,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((zn(t)!=="body"||sc(s))&&(l=EA(t)),hn(t)?(u=wo(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=oc(s))),{x:i.left+l.scrollLeft-u.x,y:i.top+l.scrollTop-u.y,width:i.width,height:i.height}}function PA(e){var t=new Map,n=new Set,r=[];e.forEach(function(s){t.set(s.name,s)});function o(s){n.add(s.name);var i=[].concat(s.requires||[],s.requiresIfExists||[]);i.forEach(function(l){if(!n.has(l)){var u=t.get(l);u&&o(u)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||o(s)}),r}function IA(e){var t=PA(e);return Vx.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function FA(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function $A(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Hh={placement:"bottom",modifiers:[],strategy:"absolute"};function Wh(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function OA(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?Hh:o;return function(l,u,d){d===void 0&&(d=s);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Hh,s),modifiersData:{},elements:{reference:l,popper:u},attributes:{},styles:{}},p=[],f=!1,h={state:c,setOptions:function(T){var k=typeof T=="function"?T(c.options):T;m(),c.options=Object.assign({},s,c.options,k),c.scrollParents={reference:qr(l)?hs(l):l.contextElement?hs(l.contextElement):[],popper:hs(u)};var S=IA($A([].concat(r,c.options.modifiers)));return c.orderedModifiers=S.filter(function(y){return y.enabled}),g(),h.update()},forceUpdate:function(){if(!f){var T=c.elements,k=T.reference,S=T.popper;if(Wh(k,S)){c.rects={reference:DA(k,fs(S),c.options.strategy==="fixed"),popper:tc(S)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(V){return c.modifiersData[V.name]=Object.assign({},V.data)});for(var y=0;y<c.orderedModifiers.length;y++){if(c.reset===!0){c.reset=!1,y=-1;continue}var E=c.orderedModifiers[y],D=E.fn,$=E.options,_=$===void 0?{}:$,L=E.name;typeof D=="function"&&(c=D({state:c,options:_,name:L,instance:h})||c)}}}},update:FA(function(){return new Promise(function(w){h.forceUpdate(),w(c)})}),destroy:function(){m(),f=!0}};if(!Wh(l,u))return h;h.setOptions(d).then(function(w){!f&&d.onFirstUpdate&&d.onFirstUpdate(w)});function g(){c.orderedModifiers.forEach(function(w){var T=w.name,k=w.options,S=k===void 0?{}:k,y=w.effect;if(typeof y=="function"){var E=y({state:c,name:T,instance:h,options:S}),D=function(){};p.push(E||D)}})}function m(){p.forEach(function(w){return w()}),p=[]}return h}}var LA=[oA,TA,nA,Ih,wA,mA,xA,Yx,vA],_A=OA({defaultModifiers:LA}),MA="tippy-box",Qh="tippy-content",NA="tippy-backdrop",Kh="tippy-arrow",Gh="tippy-svg-arrow",Wr={passive:!0,capture:!0},Jh=function(){return document.body};function BA(e,t){return{}.hasOwnProperty.call(e,t)}function ac(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function lc(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function Xh(e,t){return typeof e=="function"?e.apply(void 0,t):e}function Yh(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function jA(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function zA(e){return e.split(/\s+/).filter(Boolean)}function ko(e){return[].concat(e)}function Zh(e,t){e.indexOf(t)===-1&&e.push(t)}function UA(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function VA(e){return e.split("-")[0]}function Qi(e){return[].slice.call(e)}function em(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function ms(){return document.createElement("div")}function gs(e){return["Element","Fragment"].some(function(t){return lc(e,t)})}function qA(e){return lc(e,"NodeList")}function HA(e){return lc(e,"MouseEvent")}function tm(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function WA(e){return gs(e)?[e]:qA(e)?Qi(e):Array.isArray(e)?e:Qi(document.querySelectorAll(e))}function cc(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function nm(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function QA(e){var t,n=ko(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function KA(e,t){var n=t.clientX,r=t.clientY;return e.every(function(o){var s=o.popperRect,i=o.popperState,l=o.props,u=l.interactiveBorder,d=VA(i.placement),c=i.modifiersData.offset;if(!c)return!0;var p=d==="bottom"?c.top.y:0,f=d==="top"?c.bottom.y:0,h=d==="right"?c.left.x:0,g=d==="left"?c.right.x:0,m=s.top-r+p>u,w=r-s.bottom-f>u,T=s.left-n+h>u,k=n-s.right-g>u;return m||w||T||k})}function uc(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){e[r](o,n)})}function rm(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Vn={isTouch:!1},om=0;function GA(){Vn.isTouch||(Vn.isTouch=!0,window.performance&&document.addEventListener("mousemove",sm))}function sm(){var e=performance.now();e-om<20&&(Vn.isTouch=!1,document.removeEventListener("mousemove",sm)),om=e}function JA(){var e=document.activeElement;if(tm(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function XA(){document.addEventListener("touchstart",GA,Wr),window.addEventListener("blur",JA)}var YA=typeof window<"u"&&typeof document<"u",ZA=YA?!!window.msCrypto:!1;function Co(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function im(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function eE(e){return im(`
12
- %ctippy.js
13
-
14
- %c`+im(e)+`
15
-
16
- %c👷‍ This is a development-only message. It will be removed in production.
17
- `)}function am(e){return[eE(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var vs;ce.env.NODE_ENV!=="production"&&tE();function tE(){vs=new Set}function ar(e,t){if(e&&!vs.has(t)){var n;vs.add(t),(n=console).warn.apply(n,am(t))}}function dc(e,t){if(e&&!vs.has(t)){var n;vs.add(t),(n=console).error.apply(n,am(t))}}function nE(e){var t=!e,n=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;dc(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),dc(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var lm={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},rE={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},en=Object.assign({appendTo:Jh,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},lm,rE),oE=Object.keys(en),sE=function(t){ce.env.NODE_ENV!=="production"&&dm(t,[]);var n=Object.keys(t);n.forEach(function(r){en[r]=t[r]})};function cm(e){var t=e.plugins||[],n=t.reduce(function(r,o){var s=o.name,i=o.defaultValue;if(s){var l;r[s]=e[s]!==void 0?e[s]:(l=en[s])!=null?l:i}return r},{});return Object.assign({},e,n)}function iE(e,t){var n=t?Object.keys(cm(Object.assign({},en,{plugins:t}))):oE,r=n.reduce(function(o,s){var i=(e.getAttribute("data-tippy-"+s)||"").trim();if(!i)return o;if(s==="content")o[s]=i;else try{o[s]=JSON.parse(i)}catch{o[s]=i}return o},{});return r}function um(e,t){var n=Object.assign({},t,{content:Xh(t.content,[e])},t.ignoreAttributes?{}:iE(e,t.plugins));return n.aria=Object.assign({},en.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}function dm(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=Object.keys(e);n.forEach(function(r){var o=jA(en,Object.keys(lm)),s=!BA(o,r);s&&(s=t.filter(function(i){return i.name===r}).length===0),ar(s,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
18
-
19
- `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
20
- `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var aE=function(){return"innerHTML"};function fc(e,t){e[aE()]=t}function fm(e){var t=ms();return e===!0?t.className=Kh:(t.className=Gh,gs(e)?t.appendChild(e):fc(t,e)),t}function pm(e,t){gs(t.content)?(fc(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?fc(e,t.content):e.textContent=t.content)}function pc(e){var t=e.firstElementChild,n=Qi(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(Qh)}),arrow:n.find(function(r){return r.classList.contains(Kh)||r.classList.contains(Gh)}),backdrop:n.find(function(r){return r.classList.contains(NA)})}}function hm(e){var t=ms(),n=ms();n.className=MA,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ms();r.className=Qh,r.setAttribute("data-state","hidden"),pm(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props);function o(s,i){var l=pc(t),u=l.box,d=l.content,c=l.arrow;i.theme?u.setAttribute("data-theme",i.theme):u.removeAttribute("data-theme"),typeof i.animation=="string"?u.setAttribute("data-animation",i.animation):u.removeAttribute("data-animation"),i.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof i.maxWidth=="number"?i.maxWidth+"px":i.maxWidth,i.role?u.setAttribute("role",i.role):u.removeAttribute("role"),(s.content!==i.content||s.allowHTML!==i.allowHTML)&&pm(d,e.props),i.arrow?c?s.arrow!==i.arrow&&(u.removeChild(c),u.appendChild(fm(i.arrow))):u.appendChild(fm(i.arrow)):c&&u.removeChild(c)}return{popper:t,onUpdate:o}}hm.$$tippy=!0;var lE=1,Ki=[],Gi=[];function cE(e,t){var n=um(e,Object.assign({},en,cm(em(t)))),r,o,s,i=!1,l=!1,u=!1,d=!1,c,p,f,h=[],g=Yh(lt,n.interactiveDebounce),m,w=lE++,T=null,k=UA(n.plugins),S={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},y={id:w,reference:e,popper:ms(),popperInstance:T,props:n,state:S,plugins:k,clearDelayTimeouts:mn,setProps:qn,setContent:At,show:En,hide:C,hideWithInteractivity:v,enable:kt,disable:dt,unmount:b,destroy:F};if(!n.render)return ce.env.NODE_ENV!=="production"&&dc(!0,"render() function has not been supplied."),y;var E=n.render(y),D=E.popper,$=E.onUpdate;D.setAttribute("data-tippy-root",""),D.id="tippy-"+y.id,y.popper=D,e._tippy=y,D._tippy=y;var _=k.map(function(P){return P.fn(y)}),L=e.hasAttribute("aria-expanded");return Se(),Y(),j(),H("onCreate",[y]),n.showOnCreate&&Jt(),D.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),D.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&M().addEventListener("mousemove",g)}),y;function V(){var P=y.props.touch;return Array.isArray(P)?P:[P,0]}function te(){return V()[0]==="hold"}function B(){var P;return!!((P=y.props.render)!=null&&P.$$tippy)}function O(){return m||e}function M(){var P=O().parentNode;return P?QA(P):document}function N(){return pc(D)}function q(P){return y.state.isMounted&&!y.state.isVisible||Vn.isTouch||c&&c.type==="focus"?0:ac(y.props.delay,P?0:1,en.delay)}function j(P){P===void 0&&(P=!1),D.style.pointerEvents=y.props.interactive&&!P?"":"none",D.style.zIndex=""+y.props.zIndex}function H(P,U,X){if(X===void 0&&(X=!0),_.forEach(function(ye){ye[P]&&ye[P].apply(ye,U)}),X){var ee;(ee=y.props)[P].apply(ee,U)}}function se(){var P=y.props.aria;if(P.content){var U="aria-"+P.content,X=D.id,ee=ko(y.props.triggerTarget||e);ee.forEach(function(ye){var Ie=ye.getAttribute(U);if(y.state.isVisible)ye.setAttribute(U,Ie?Ie+" "+X:X);else{var Fe=Ie&&Ie.replace(X,"").trim();Fe?ye.setAttribute(U,Fe):ye.removeAttribute(U)}})}}function Y(){if(!(L||!y.props.aria.expanded)){var P=ko(y.props.triggerTarget||e);P.forEach(function(U){y.props.interactive?U.setAttribute("aria-expanded",y.state.isVisible&&U===O()?"true":"false"):U.removeAttribute("aria-expanded")})}}function ae(){M().removeEventListener("mousemove",g),Ki=Ki.filter(function(P){return P!==g})}function ne(P){if(!(Vn.isTouch&&(u||P.type==="mousedown"))){var U=P.composedPath&&P.composedPath()[0]||P.target;if(!(y.props.interactive&&rm(D,U))){if(ko(y.props.triggerTarget||e).some(function(X){return rm(X,U)})){if(Vn.isTouch||y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else H("onClickOutside",[y,P]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),l=!0,setTimeout(function(){l=!1}),y.state.isMounted||xe())}}}function pe(){u=!0}function fe(){u=!1}function be(){var P=M();P.addEventListener("mousedown",ne,!0),P.addEventListener("touchend",ne,Wr),P.addEventListener("touchstart",fe,Wr),P.addEventListener("touchmove",pe,Wr)}function xe(){var P=M();P.removeEventListener("mousedown",ne,!0),P.removeEventListener("touchend",ne,Wr),P.removeEventListener("touchstart",fe,Wr),P.removeEventListener("touchmove",pe,Wr)}function he(P,U){de(P,function(){!y.state.isVisible&&D.parentNode&&D.parentNode.contains(D)&&U()})}function ie(P,U){de(P,U)}function de(P,U){var X=N().box;function ee(ye){ye.target===X&&(uc(X,"remove",ee),U())}if(P===0)return U();uc(X,"remove",p),uc(X,"add",ee),p=ee}function ue(P,U,X){X===void 0&&(X=!1);var ee=ko(y.props.triggerTarget||e);ee.forEach(function(ye){ye.addEventListener(P,U,X),h.push({node:ye,eventType:P,handler:U,options:X})})}function Se(){te()&&(ue("touchstart",Ve,{passive:!0}),ue("touchend",Tt,{passive:!0})),zA(y.props.trigger).forEach(function(P){if(P!=="manual")switch(ue(P,Ve),P){case"mouseenter":ue("mouseleave",Tt);break;case"focus":ue(ZA?"focusout":"blur",ut);break;case"focusin":ue("focusout",ut);break}})}function $e(){h.forEach(function(P){var U=P.node,X=P.eventType,ee=P.handler,ye=P.options;U.removeEventListener(X,ee,ye)}),h=[]}function Ve(P){var U,X=!1;if(!(!y.state.isEnabled||gt(P)||l)){var ee=((U=c)==null?void 0:U.type)==="focus";c=P,m=P.currentTarget,Y(),!y.state.isVisible&&HA(P)&&Ki.forEach(function(ye){return ye(P)}),P.type==="click"&&(y.props.trigger.indexOf("mouseenter")<0||i)&&y.props.hideOnClick!==!1&&y.state.isVisible?X=!0:Jt(P),P.type==="click"&&(i=!X),X&&!ee&&Xt(P)}}function lt(P){var U=P.target,X=O().contains(U)||D.contains(U);if(!(P.type==="mousemove"&&X)){var ee=We().concat(D).map(function(ye){var Ie,Fe=ye._tippy,Ne=(Ie=Fe.popperInstance)==null?void 0:Ie.state;return Ne?{popperRect:ye.getBoundingClientRect(),popperState:Ne,props:n}:null}).filter(Boolean);KA(ee,P)&&(ae(),Xt(P))}}function Tt(P){var U=gt(P)||y.props.trigger.indexOf("click")>=0&&i;if(!U){if(y.props.interactive){y.hideWithInteractivity(P);return}Xt(P)}}function ut(P){y.props.trigger.indexOf("focusin")<0&&P.target!==O()||y.props.interactive&&P.relatedTarget&&D.contains(P.relatedTarget)||Xt(P)}function gt(P){return Vn.isTouch?te()!==P.type.indexOf("touch")>=0:!1}function ve(){ke();var P=y.props,U=P.popperOptions,X=P.placement,ee=P.offset,ye=P.getReferenceClientRect,Ie=P.moveTransition,Fe=B()?pc(D).arrow:null,Ne=ye?{getBoundingClientRect:ye,contextElement:ye.contextElement||O()}:e,xs={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Eo){var Te=Eo.state;if(B()){var Oe=N(),tt=Oe.box;["placement","reference-hidden","escaped"].forEach(function(Vt){Vt==="placement"?tt.setAttribute("data-placement",Te.placement):Te.attributes.popper["data-popper-"+Vt]?tt.setAttribute("data-"+Vt,""):tt.removeAttribute("data-"+Vt)}),Te.attributes.popper={}}}},cr=[{name:"offset",options:{offset:ee}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Ie}},xs];B()&&Fe&&cr.push({name:"arrow",options:{element:Fe,padding:3}}),cr.push.apply(cr,U?.modifiers||[]),y.popperInstance=_A(Ne,D,Object.assign({},U,{placement:X,onFirstUpdate:f,modifiers:cr}))}function ke(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function qe(){var P=y.props.appendTo,U,X=O();y.props.interactive&&P===Jh||P==="parent"?U=X.parentNode:U=Xh(P,[X]),U.contains(D)||U.appendChild(D),y.state.isMounted=!0,ve(),ce.env.NODE_ENV!=="production"&&ar(y.props.interactive&&P===en.appendTo&&X.nextElementSibling!==D,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
21
-
22
- `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
23
-
24
- `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
25
-
26
- `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function We(){return Qi(D.querySelectorAll("[data-tippy-root]"))}function Jt(P){y.clearDelayTimeouts(),P&&H("onTrigger",[y,P]),be();var U=q(!0),X=V(),ee=X[0],ye=X[1];Vn.isTouch&&ee==="hold"&&ye&&(U=ye),U?r=setTimeout(function(){y.show()},U):y.show()}function Xt(P){if(y.clearDelayTimeouts(),H("onUntrigger",[y,P]),!y.state.isVisible){xe();return}if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(P.type)>=0&&i)){var U=q(!1);U?o=setTimeout(function(){y.state.isVisible&&y.hide()},U):s=requestAnimationFrame(function(){y.hide()})}}function kt(){y.state.isEnabled=!0}function dt(){y.hide(),y.state.isEnabled=!1}function mn(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(s)}function qn(P){if(ce.env.NODE_ENV!=="production"&&ar(y.state.isDestroyed,Co("setProps")),!y.state.isDestroyed){H("onBeforeUpdate",[y,P]),$e();var U=y.props,X=um(e,Object.assign({},U,em(P),{ignoreAttributes:!0}));y.props=X,Se(),U.interactiveDebounce!==X.interactiveDebounce&&(ae(),g=Yh(lt,X.interactiveDebounce)),U.triggerTarget&&!X.triggerTarget?ko(U.triggerTarget).forEach(function(ee){ee.removeAttribute("aria-expanded")}):X.triggerTarget&&e.removeAttribute("aria-expanded"),Y(),j(),$&&$(U,X),y.popperInstance&&(ve(),We().forEach(function(ee){requestAnimationFrame(ee._tippy.popperInstance.forceUpdate)})),H("onAfterUpdate",[y,P])}}function At(P){y.setProps({content:P})}function En(){ce.env.NODE_ENV!=="production"&&ar(y.state.isDestroyed,Co("show"));var P=y.state.isVisible,U=y.state.isDestroyed,X=!y.state.isEnabled,ee=Vn.isTouch&&!y.props.touch,ye=ac(y.props.duration,0,en.duration);if(!(P||U||X||ee)&&!O().hasAttribute("disabled")&&(H("onShow",[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,B()&&(D.style.visibility="visible"),j(),be(),y.state.isMounted||(D.style.transition="none"),B()){var Ie=N(),Fe=Ie.box,Ne=Ie.content;cc([Fe,Ne],0)}f=function(){var cr;if(!(!y.state.isVisible||d)){if(d=!0,D.offsetHeight,D.style.transition=y.props.moveTransition,B()&&y.props.animation){var As=N(),Eo=As.box,Te=As.content;cc([Eo,Te],ye),nm([Eo,Te],"visible")}se(),Y(),Zh(Gi,y),(cr=y.popperInstance)==null||cr.forceUpdate(),H("onMount",[y]),y.props.animation&&B()&&ie(ye,function(){y.state.isShown=!0,H("onShown",[y])})}},qe()}}function C(){ce.env.NODE_ENV!=="production"&&ar(y.state.isDestroyed,Co("hide"));var P=!y.state.isVisible,U=y.state.isDestroyed,X=!y.state.isEnabled,ee=ac(y.props.duration,1,en.duration);if(!(P||U||X)&&(H("onHide",[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,d=!1,i=!1,B()&&(D.style.visibility="hidden"),ae(),xe(),j(!0),B()){var ye=N(),Ie=ye.box,Fe=ye.content;y.props.animation&&(cc([Ie,Fe],ee),nm([Ie,Fe],"hidden"))}se(),Y(),y.props.animation?B()&&he(ee,y.unmount):y.unmount()}}function v(P){ce.env.NODE_ENV!=="production"&&ar(y.state.isDestroyed,Co("hideWithInteractivity")),M().addEventListener("mousemove",g),Zh(Ki,g),g(P)}function b(){ce.env.NODE_ENV!=="production"&&ar(y.state.isDestroyed,Co("unmount")),y.state.isVisible&&y.hide(),y.state.isMounted&&(ke(),We().forEach(function(P){P._tippy.unmount()}),D.parentNode&&D.parentNode.removeChild(D),Gi=Gi.filter(function(P){return P!==y}),y.state.isMounted=!1,H("onHidden",[y]))}function F(){ce.env.NODE_ENV!=="production"&&ar(y.state.isDestroyed,Co("destroy")),!y.state.isDestroyed&&(y.clearDelayTimeouts(),y.unmount(),$e(),delete e._tippy,y.state.isDestroyed=!0,H("onDestroy",[y]))}}function ys(e,t){t===void 0&&(t={});var n=en.plugins.concat(t.plugins||[]);ce.env.NODE_ENV!=="production"&&(nE(e),dm(t,n)),XA();var r=Object.assign({},t,{plugins:n}),o=WA(e);if(ce.env.NODE_ENV!=="production"){var s=gs(r.content),i=o.length>1;ar(s&&i,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
27
-
28
- `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
29
-
30
- `,`1) content: element.innerHTML
31
- `,"2) content: () => element.cloneNode(true)"].join(" "))}var l=o.reduce(function(u,d){var c=d&&cE(d,r);return c&&u.push(c),u},[]);return gs(e)?l[0]:l}ys.defaultProps=en,ys.setDefaultProps=sE,ys.currentInput=Vn;var uE=function(t){var n=t===void 0?{}:t,r=n.exclude,o=n.duration;Gi.forEach(function(s){var i=!1;if(r&&(i=tm(r)?s.reference===r:s.popper===r.popper),!i){var l=s.props.duration;s.setProps({duration:o}),s.hide(),s.state.isDestroyed||s.setProps({duration:l})}})};Object.assign({},Ih,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),ys.setDefaultProps({render:hm});const dE={name:"hideOnEsc",defaultValue:!0,fn({hide:e}){const t=n=>{n.code==="Escape"&&e()};return{onShow:()=>{document.addEventListener("keydown",t)},onHide:()=>{document.removeEventListener("keydown",t)}}}},hc=e=>{if(e)try{e.destroy()}catch{}},fE=["src"],mc=ge({__name:"OcCard",props:{tag:{default:"div"},title:{},titleTag:{default:"h2"},logoUrl:{default:""},headerClass:{default:""},bodyClass:{default:""},footerClass:{default:""}},setup(e){const t=Ou(),n=A(()=>Object.hasOwn(t,"header")||!!a(e.title)||!!a(e.logoUrl)),r=A(()=>Object.hasOwn(t,"footer"));return(o,s)=>(I(),re(rn(e.tag),{class:"oc-card"},{default:Z(()=>[n.value?(I(),G("div",{key:0,class:R.normalizeClass(["oc-card-header",e.headerClass])},[Ce(o.$slots,"header",{},()=>[e.logoUrl?(I(),G("img",{key:0,src:e.logoUrl,alt:"","aria-hidden":!0,class:"max-w-48 max-h-48 absolute -translate-y-16"},null,8,fE)):le("",!0),e.title?(I(),re(rn(e.titleTag),{key:1,class:"mt-0"},{default:Z(()=>[ct(R.toDisplayString(e.title),1)]),_:1})):le("",!0)])],2)):le("",!0),Q("div",{class:R.normalizeClass(["oc-card-body",e.bodyClass])},[Ce(o.$slots,"default")],2),r.value?(I(),G("div",{key:1,class:R.normalizeClass(["oc-card-footer",e.footerClass])},[Ce(o.$slots,"footer")],2)):le("",!0)]),_:3}))}}),pE=["textContent"],hE=ge({__name:"OcMobileDrop",props:{drawerId:{},toggle:{},closeOnClick:{type:Boolean,default:!1},title:{default:""}},emits:["show","hide"],setup(e,{expose:t,emit:n}){const r=n,{$gettext:o}=me.useGettext(),s=FC(),{showDrawer:i,closeDrawer:l,closeAllDrawers:u}=s,{drawers:d,currentDrawer:c}=we.storeToRefs(s),p=W(null),f=nn("bottomDrawerCardBodyRef"),h=A(()=>a(d).map(({id:S})=>S).includes(a(p)?.id)),g=A(()=>a(p)?.id&&a(c)?.id===a(p).id),m=async()=>{p.value=i(),r("show"),await xt(),a(f)?.addEventListener("click",T)},w=()=>{l(a(p)?.id),a(f)?.removeEventListener("click",T),r("hide")},T=S=>{const y=S.target.closest("a[href], button");if(y){if(y.hasAttribute("aria-expanded")){y.setAttribute("aria-expanded","true");return}e.closeOnClick&&(w(),u())}},k=S=>{S.target===S.currentTarget&&u()};return Rn.onKeyStroke("Escape",S=>{S.preventDefault(),u()}),yt(()=>{a(e.toggle)&&document.querySelector(e.toggle).addEventListener("click",m)}),bn(()=>{document.querySelector(e.toggle).removeEventListener("click",m),a(p)&&l(a(p).id)}),t({show:m,hide:w}),(S,y)=>{const E=oe("oc-icon"),D=oe("portal");return h.value?(I(),re(D,{key:0,to:"app.runtime.bottom.drawer"},{default:Z(()=>[J(Ix,{id:e.drawerId,"is-drawer-active":g.value,"is-focus-trap-active":g.value,class:"oc-mobile-drop z-[calc(var(--z-index-modal)+2)]",onClicked:k},{default:Z(()=>[J(mc,{class:"bg-role-surface-container-high overflow-x-hidden rounded-b-none","header-class":"flex flex-row justify-between items-center"},{header:Z(()=>[a(d).length>1?(I(),re(Qt,{key:0,appearance:"raw",class:"raw-hover-surface oc-bottom-drawer-back-button","aria-label":a(o)("Open the parent context menu"),onClick:y[0]||(y[0]=$=>w())},{default:Z(()=>[J(E,{name:"arrow-left","fill-type":"line"})]),_:1},8,["aria-label"])):le("",!0),Q("span",{class:"font-semibold",textContent:R.toDisplayString(e.title)},null,8,pE),J(Qt,{appearance:"raw",class:"raw-hover-surface oc-bottom-drawer-close-button","aria-label":a(o)("Close the context menu"),onClick:y[1]||(y[1]=$=>a(u)())},{default:Z(()=>[J(E,{name:"close","fill-type":"line"})]),_:1},8,["aria-label"])]),default:Z(()=>[Q("div",{ref_key:"bottomDrawerCardBodyRef",ref:f},[Ce(S.$slots,"default")],512)]),_:3})]),_:3},8,["id","is-drawer-active","is-focus-trap-active"])]),_:3})):le("",!0)}}}),mE=["id"],gE=ge({__name:"OcDrop",props:{title:{default:""},closeOnClick:{type:Boolean,default:!1},dropId:{default:()=>_r("oc-drop-")},isNestedElement:{type:Boolean,default:!1},mode:{default:"click"},offset:{type:[Array,Function],default:[0,0]},paddingSize:{default:"medium"},popperOptions:{default:()=>({})},position:{default:"bottom-start"},target:{},toggle:{default:""},enforceDropOnMobile:{type:Boolean,default:!1}},emits:["hideDrop","showDrop"],setup(e,{expose:t,emit:n}){const r=n,{isMobile:o}=os(),s=W(!1),i=A(()=>a(o)&&!e.enforceDropOnMobile),l=nn("bottomDrawerRef"),u=nn("drop"),d=W(null),c=()=>{if(a(i)){a(l).show();return}a(d)?.show()},p=()=>{if(a(i)){a(l).hide();return}a(d)?.hide()};t({show:c,hide:p,tippy:d});const f=w=>{const T=w.target.closest(".oc-button")?.hasAttribute("aria-expanded");e.closeOnClick&&!T&&p()},h=w=>{const T=u.value?.closest(".tippy-box");w.relatedTarget&&!T?.contains(w.relatedTarget)&&p()},g=A(()=>({hover:"mouseenter focus",click:void 0,manual:void 0})[e.mode]||e.mode);Ue(()=>e.position,()=>{a(d)?.setProps({placement:e.position})}),Ue(()=>e.mode,()=>{a(d)?.setProps({trigger:g.value})}),bn(()=>{a(u)?.removeEventListener("focusout",h),hc(a(d))});const m=()=>{hc(a(d));const w=e.target?document.querySelector(e.target):e.toggle?document.querySelector(e.toggle):u.value?.previousElementSibling,T=u.value;if(!w||!T)return;const k={trigger:g.value,placement:e.position,arrow:!1,hideOnClick:!e.isNestedElement,interactive:!0,plugins:[dE],theme:"none",maxWidth:416,offset:e.offset,onShow:S=>{s.value=!0,r("showDrop"),e.isNestedElement||uE({exclude:S})},onHide:()=>{s.value=!1,r("hideDrop")},popperOptions:{...e.popperOptions,modifiers:[...e.popperOptions?.modifiers?e.popperOptions.modifiers:[],{name:"fixVerticalPosition",enabled:!0,phase:"beforeWrite",requiresIfExists:["offset","preventOverflow","flip"],fn({state:S}){const y=To(S),E=S.modifiersData.fullHeight||S.elements.popper.offsetHeight,D=y.top*-1-10,$=D+E+y.bottom*-1,_=$-D,L=$-_;E>_&&E>L&&(S.styles.popper.top=`-${D}px`,S.modifiersData.fullHeight=E),E>$&&(S.styles.popper.maxHeight=`${$-10}px`,S.styles.popper.overflowY="auto",S.styles.popper.overflowX="hidden")}}]},content:T};e.target&&(k.triggerTarget=e.toggle?document.querySelector(e.toggle):u.value?.previousElementSibling),d.value=ys(w,k),u.value?.addEventListener("focusout",h)};return Ue(i,async()=>{if(await xt(),a(i)){a(d)&&hc(a(d));return}m()},{immediate:!0}),(w,T)=>i.value?(I(),re(hE,{key:0,ref_key:"bottomDrawerRef",ref:l,"drawer-id":e.dropId,toggle:e.toggle,"close-on-click":e.closeOnClick,title:e.title,onShow:T[0]||(T[0]=k=>r("showDrop")),onHide:T[1]||(T[1]=k=>r("hideDrop"))},{default:Z(()=>[Ce(w.$slots,"default")]),_:3},8,["drawer-id","toggle","close-on-click","title"])):(I(),G("div",{key:1,id:e.dropId,ref_key:"drop",ref:u,class:"oc-drop shadow-md/20 rounded-sm",onClick:f},[s.value&&w.$slots.default?(I(),re(mc,{key:0,"body-class":[a(BS)(e.paddingSize)]},{default:Z(()=>[Ce(w.$slots,"default")]),_:3},8,["body-class"])):s.value?Ce(w.$slots,"special",{key:1}):le("",!0)],8,mE))}}),vE=["type","disabled"],yE={class:"flex flex-row flex-wrap text-sm pt-2 gap-x-2"},bE=["textContent"],mm="file-copy",wE=ge({__name:"OcTextInputPassword",props:{disabled:{type:Boolean,default:!1},generatePasswordMethod:{type:Function},hasError:{type:Boolean,default:!1},passwordPolicy:{},value:{default:""}},emits:["passwordChallengeCompleted","passwordChallengeFailed","passwordGenerated"],setup(e,{expose:t,emit:n}){const r=n,o=nn("passwordInput"),{$gettext:s}=me.useGettext(),i=W(e.value),l=W(!1),u=W(mm),d=W(!1),c=A(()=>!!Object.keys(e.passwordPolicy?.rules||{}).length),p=A(()=>e.passwordPolicy?.missing(a(i))),f=k=>{const S={};for(let y=0;y<k.format.length;y++)S[`param${y+1}`]=k.format[y]?.toString();return s(k.message,S,!0)},h=()=>{navigator.clipboard.writeText(a(i)),u.value="check",setTimeout(()=>u.value=mm,1500)},g=()=>{const k=e.generatePasswordMethod();i.value=k,r("passwordGenerated",i.value)};return t({focus:()=>{a(o).focus()},select:()=>{a(o).select()},setSelectionRange:(k,S)=>{a(o).setSelectionRange(k,S)}}),Ue(i,k=>{if(Object.keys(e.passwordPolicy).length){if(!e.passwordPolicy.check(k))return r("passwordChallengeFailed");r("passwordChallengeCompleted")}}),(k,S)=>{const y=oe("oc-contextual-helper"),E=oe("portal"),D=Lt("oc-tooltip");return I(),G(Ae,null,[Q("div",{class:R.normalizeClass(["oc-text-input-password-wrapper flex flex-row border rounded-sm",{"oc-text-input-password-wrapper-danger text-role-error focus:text-role-error border-role-error":e.hasError,"border-role-surface outline-2 outline-role-outline":d.value,"border-role-outline":!d.value}])},[je(Q("input",pt(k.$attrs,{ref_key:"passwordInput",ref:o,"onUpdate:modelValue":S[0]||(S[0]=$=>i.value=$),class:"grow-2 border-0 focus:border-0 focus:outline-0",type:l.value?"text":"password",disabled:e.disabled,onFocus:S[1]||(S[1]=$=>d.value=!0),onBlur:S[2]||(S[2]=$=>d.value=!1)}),null,16,vE),[[Ey,i.value]]),i.value&&!e.disabled?je((I(),re(Qt,{key:0,"aria-label":l.value?a(s)("Hide password"):a(s)("Show password"),class:"oc-text-input-show-password-toggle px-2",appearance:"raw",size:"small",onClick:S[3]||(S[3]=$=>l.value=!l.value)},{default:Z(()=>[J(or,{size:"small",name:l.value?"eye-off":"eye"},null,8,["name"])]),_:1},8,["aria-label"])),[[D,l.value?a(s)("Hide password"):a(s)("Show password")]]):le("",!0),i.value&&!e.disabled?je((I(),re(Qt,{key:1,"aria-label":a(s)("Copy password"),class:"oc-text-input-copy-password-button px-2",appearance:"raw",size:"small",onClick:h},{default:Z(()=>[J(or,{size:"small",name:u.value},null,8,["name"])]),_:1},8,["aria-label"])),[[D,a(s)("Copy password")]]):le("",!0),e.generatePasswordMethod&&!e.disabled?je((I(),re(Qt,{key:2,"aria-label":a(s)("Generate password"),class:"oc-text-input-generate-password-button px-2",appearance:"raw",size:"small",onClick:g},{default:Z(()=>[J(or,{size:"small",name:"refresh","fill-type":"line"})]),_:1},8,["aria-label"])),[[D,a(s)("Generate password")]]):le("",!0)],2),c.value?(I(),re(E,{key:0,to:"app.design-system.password-policy"},{default:Z(()=>[Q("div",yE,[(I(!0),G(Ae,null,Ye(p.value.rules,($,_)=>(I(),G("div",{key:_,class:"flex items-center oc-text-input-password-policy-rule"},[J(or,{size:"small",class:"mr-1",name:$.verified?"checkbox-circle":"close-circle",color:$.verified?"var(--oc-role-on-surface)":"var(--oc-role-error)"},null,8,["name","color"]),Q("span",{class:R.normalizeClass([{"oc-text-input-danger":!$.verified}]),textContent:R.toDisplayString(f($))},null,10,bE),$.helperMessage?(I(),re(y,{key:0,text:$.helperMessage,title:a(s)("Password policy")},null,8,["text","title"])):le("",!0)]))),128))])]),_:1})):le("",!0)],64)}}}),SE=["for"],TE={key:0,class:"text-role-error","aria-hidden":"true"},kE=["id","textContent"],CE=["id","textContent"],xE=ge({inheritAttrs:!1,__name:"OcTextInput",props:{id:{default:()=>_r("oc-textinput-")},type:{default:"text"},modelValue:{default:""},selectionRange:{},clearButtonEnabled:{type:Boolean,default:!1},clearButtonAccessibleLabel:{default:""},defaultValue:{},disabled:{type:Boolean,default:!1},label:{},inlineLabel:{type:Boolean,default:!1},errorMessage:{},errorMessageDebouncedTime:{default:500},fixMessageLine:{type:Boolean,default:!1},descriptionMessage:{},readOnly:{type:Boolean,default:!1},requiredMark:{type:Boolean,default:!1},passwordPolicy:{default:()=>({})},generatePasswordMethod:{type:Function},hasBorder:{type:Boolean,default:!0}},emits:["change","update:modelValue","focus","passwordChallengeCompleted","passwordChallengeFailed"],setup(e,{expose:t,emit:n}){const r=n,o=W(!1),s=A(()=>!!e.descriptionMessage),i=A(()=>e.fixMessageLine||a(o)||a(s)),l=A(()=>a(o).toString()),u=A(()=>`${e.id}-message`),d=A(()=>e.type==="password"?{passwordGenerated:S}:{}),c=Js(),p=A(()=>{const $={};(a(o)||a(s))&&($["aria-describedby"]=u.value),e.defaultValue&&($.placeholder=e.defaultValue),e.type==="password"&&($["password-policy"]=e.passwordPolicy,$["generate-password-method"]=e.generatePasswordMethod,$["has-error"]=a(o));const{change:_,input:L,focus:V,class:te,...B}=c;return{...B,...$}}),f=A(()=>!e.disabled&&e.clearButtonEnabled&&!!e.modelValue),h=A(()=>e.clearButtonAccessibleLabel||"Clear input"),g=A(()=>e.type==="password"?wE:"input"),m=nn("inputRef"),w=()=>{a(m).focus()};t({focus:w});function T(){w(),S(""),k(null)}const k=$=>{r("change",$)},S=$=>{r("update:modelValue",$)},y=async $=>{await xt(),a(m).select(),E(),r("focus",$.value)},E=()=>{e.selectionRange&&e.selectionRange.length>1&&a(m).setSelectionRange(e.selectionRange[0],e.selectionRange[1])};Ue([()=>e.selectionRange,m],async()=>{a(m)&&(await xt(),E())},{immediate:!0});const D=rt.debounce(()=>{o.value=!!e.errorMessage},e.errorMessageDebouncedTime);return Ue(()=>e.modelValue,()=>{D()}),Ue(()=>e.errorMessage,()=>{e.errorMessage?D():(o.value=!1,D.cancel?.())}),($,_)=>(I(),G("div",{class:R.normalizeClass([{"flex items-center":e.inlineLabel},$.$attrs.class])},[Ce($.$slots,"label",{},()=>[Q("label",{class:R.normalizeClass(["inline-block",{"mr-2":e.inlineLabel,"mb-0.5":!e.inlineLabel}]),for:e.id},[ct(R.toDisplayString(e.label)+" ",1),e.requiredMark?(I(),G("span",TE,"*")):le("",!0)],10,SE)]),Q("div",{class:R.normalizeClass(["relative",{"grow-1":e.inlineLabel}])},[e.readOnly?(I(),re(or,{key:0,name:"lock",size:"small",class:"mt-2 ml-2 absolute"})):le("",!0),(I(),re(rn(g.value),pt({id:e.id},p.value,{ref_key:"inputRef",ref:m,"aria-invalid":l.value,class:["oc-text-input oc-input",{"oc-text-input-danger border-role-error":!!o.value,"pl-6":!!e.readOnly,"pr-6":f.value,"border-none outline-none bg-transparent":!e.hasBorder}],type:e.type,value:e.modelValue,disabled:e.disabled||e.readOnly},Gs(d.value),{onChange:_[0]||(_[0]=L=>k(L.target.value)),onInput:_[1]||(_[1]=L=>S(L.target.value)),onPasswordChallengeCompleted:_[2]||(_[2]=L=>$.$emit("passwordChallengeCompleted")),onPasswordChallengeFailed:_[3]||(_[3]=L=>$.$emit("passwordChallengeFailed")),onFocus:_[4]||(_[4]=L=>y(L.target))}),null,16,["id","aria-invalid","class","type","value","disabled"])),f.value?(I(),re(Qt,{key:1,"aria-label":h.value,class:"pr-2 absolute top-[50%] transform-[translateY(-50%)] right-0 oc-text-input-btn-clear",appearance:"raw","no-hover":"",onClick:T},{default:Z(()=>[J(or,{name:"close",size:"small"})]),_:1},8,["aria-label"])):le("",!0)],2),i.value?(I(),G("div",{key:0,class:R.normalizeClass(["oc-text-input-message flex align-center text-sm mt-1 min-h-4.5",{"oc-text-input-description text-role-on-surface-variant relative":s.value,"oc-text-input-danger text-role-error focus:text-role-error border-role-error":o.value}])},[o.value?(I(),G(Ae,{key:0},[o.value?(I(),re(or,{key:0,name:"error-warning",size:"small","fill-type":"line","aria-hidden":"true",class:"mr-1"})):le("",!0),o.value?(I(),G("span",{key:1,id:u.value,class:"oc-text-input-danger text-role-error focus:text-role-error border-role-error",textContent:R.toDisplayString(e.errorMessage)},null,8,kE)):le("",!0)],64)):s.value?(I(),G("span",{key:1,id:u.value,class:"oc-text-input-description text-role-on-surface-variant flex items-center relative",textContent:R.toDisplayString(e.descriptionMessage)},null,8,CE)):le("",!0)],2)):le("",!0),e.type==="password"?(I(),re(a(Rs.PortalTarget),{key:1,name:"app.design-system.password-policy"})):le("",!0)],2))}});var AE=Object.defineProperty,gm=Object.getOwnPropertySymbols,EE=Object.prototype.hasOwnProperty,RE=Object.prototype.propertyIsEnumerable,vm=(e,t,n)=>t in e?AE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DE=(e,t)=>{for(var n in t||(t={}))EE.call(t,n)&&vm(e,n,t[n]);if(gm)for(var n of gm(t))RE.call(t,n)&&vm(e,n,t[n]);return e};const ym=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},PE={},IE={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},FE=Q("path",{d:"M6.895455 5l2.842897-2.842898c.348864-.348863.348864-.914488 0-1.263636L9.106534.261648c-.348864-.348864-.914489-.348864-1.263636 0L5 3.104545 2.157102.261648c-.348863-.348864-.914488-.348864-1.263636 0L.261648.893466c-.348864.348864-.348864.914489 0 1.263636L3.104545 5 .261648 7.842898c-.348864.348863-.348864.914488 0 1.263636l.631818.631818c.348864.348864.914773.348864 1.263636 0L5 6.895455l2.842898 2.842897c.348863.348864.914772.348864 1.263636 0l.631818-.631818c.348864-.348864.348864-.914489 0-1.263636L6.895455 5z"},null,-1),$E=[FE];function OE(e,t){return I(),G("svg",IE,$E)}const LE=ym(PE,[["render",OE]]),_E={},ME={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"},NE=Q("path",{d:"M9.211364 7.59931l4.48338-4.867229c.407008-.441854.407008-1.158247 0-1.60046l-.73712-.80023c-.407008-.441854-1.066904-.441854-1.474243 0L7 5.198617 2.51662.33139c-.407008-.441853-1.066904-.441853-1.474243 0l-.737121.80023c-.407008.441854-.407008 1.158248 0 1.600461l4.48338 4.867228L7 10l2.211364-2.40069z"},null,-1),BE=[NE];function jE(e,t){return I(),G("svg",ME,BE)}DE({},{Deselect:LE,OpenIndicator:ym(_E,[["render",jE]])});const zE=["aria-label","aria-live","aria-hidden","role"],UE=ge({__name:"OcSpinner",props:{ariaLabel:{default:()=>{}},size:{default:"medium"}},setup(e){return(t,n)=>(I(),G("span",{class:R.normalizeClass(["oc-spinner inline-block after:block after:bg-transparent after:border after:border-current after:rounded-full after:size-full relative after:relative animate-spin after:content-[''] after:border-b-transparent",{"size-2":e.size==="xsmall","size-4":e.size==="small","size-5":e.size==="medium","size-8":e.size==="large","size-10":e.size==="xlarge","size-12":e.size==="xxlarge","size-16":e.size==="xxxlarge"}]),"aria-label":e.ariaLabel||void 0,"aria-live":e.ariaLabel?"polite":void 0,"aria-hidden":e.ariaLabel?void 0:"true",tabindex:"-1",role:e.ariaLabel?"img":void 0},null,10,zE))}}),VE={class:"oc-status-indicators flex"},qE=["id","textContent"],HE=ge({__name:"OcStatusIndicators",props:{resource:{},indicators:{},disableHandler:{type:Boolean,default:!1}},setup(e){const{$gettext:t}=me.useGettext(),n=W({}),r=s=>Object.hasOwn(s,"handler"),o=s=>s.accessibleDescription?(a(n)[s.id]||(a(n)[s.id]=_r("oc-indicator-description-")),a(n)[s.id]):null;return(s,i)=>{const l=Lt("oc-tooltip");return I(),G("div",VE,[(I(!0),G(Ae,null,Ye(e.indicators,(u,d)=>(I(),G(Ae,null,[r(u)&&!e.disableHandler?je((I(),re(Qt,{id:u.id,key:`${u.id}-handler`,class:R.normalizeClass(["oc-status-indicators-indicator",{"ml-1":d>0}]),"aria-label":a(t)(u.label),"aria-describedby":o(u),appearance:"raw","data-testid":u.id,"data-test-indicator-type":u.type,"data-test-indicator-resource-name":e.resource.name,"data-test-indicator-resource-path":e.resource.path,"no-hover":"",onClick:c=>u.handler?.(e.resource,c)},{default:Z(()=>[J(or,{name:u.icon,size:"small","fill-type":u.fillType},null,8,["name","fill-type"])]),_:2},1032,["id","class","aria-label","aria-describedby","data-testid","data-test-indicator-type","data-test-indicator-resource-name","data-test-indicator-resource-path","onClick"])),[[l,a(t)(u.label)]]):je((I(),re(or,{id:u.id,key:u.id,tabindex:"-1",size:"small",class:R.normalizeClass(["oc-status-indicators-indicator",{"ml-1":d>0}]),name:u.icon,"fill-type":u.fillType,"accessible-label":a(t)(u.label),"aria-describedby":o(u),"data-testid":u.id,"data-test-indicator-type":u.type},null,8,["id","class","name","fill-type","accessible-label","aria-describedby","data-testid","data-test-indicator-type"])),[[l,a(t)(u.label)]]),o(u)?(I(),G("p",{id:o(u),key:o(u),class:"sr-only",textContent:R.toDisplayString(a(t)(u.accessibleDescription))},null,8,qE)):le("",!0)],64))),256))])}}}),WE={class:"oc-thead border-b"},QE=ge({name:"OcTableHead",__name:"OcTableHead",setup(e){return(t,n)=>(I(),G("thead",WE,[Ce(t.$slots,"default")]))}}),KE=ge({name:"OcTableBody",__name:"OcTableBody",setup(e){return(t,n)=>(I(),G("tbody",null,[Ce(t.$slots,"default")]))}}),bm=Le(ge({__name:"OcTableCell",props:{alignH:{default:"left"},alignV:{default:"middle"},type:{default:"td"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e,{emit:t}){const n=t;return(r,o)=>(I(),re(rn(e.type),{class:R.normalizeClass(["oc-table-cell",{"break-all":e.wrap==="break","whitespace-nowrap":e.wrap==="nowrap","overflow-visible max-w-0":e.wrap==="truncate","text-left":e.alignH==="left","text-right":e.alignH==="right","text-center":e.alignH==="center","align-top":e.alignV==="top","align-middle":e.alignV==="middle","align-bottom":e.alignV==="bottom","w-px":e.width==="shrink","min-w-38":e.width==="expand"}]),onClick:o[0]||(o[0]=s=>n("click",s))},{default:Z(()=>[Ce(r.$slots,"default",{},void 0,!0)]),_:3},8,["class"]))}}),[["__scopeId","data-v-dc7aa8e1"]]),wm=ge({__name:"OcTableTd",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},setup(e){return(t,n)=>(I(),re(bm,{type:"td","align-h":e.alignH,"align-v":e.alignV,width:e.width,wrap:e.wrap,class:"oc-td"},{default:Z(()=>[Ce(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),Sm=Le(ge({__name:"OcTableTr",props:{lazy:{}},emits:["contextmenu","click","dragstart","drop","dragenter","dragleave","dragover","mouseleave","itemVisible"],setup(e,{emit:t}){const n=t,r=vv((l,u)=>{let d;return{get(){return l(),d},set(c){d=c,u()}}}),o=A(()=>e.lazy?e.lazy.colspan:1),{isVisible:s}=e.lazy?Zp({...e.lazy,target:r,onVisibleCallback:()=>n("itemVisible")}):{isVisible:W(!0)},i=A(()=>!a(s));return e.lazy||n("itemVisible"),(l,u)=>(I(),G("tr",{ref_key:"observerTarget",ref:r,onClick:u[0]||(u[0]=d=>l.$emit("click",d)),onContextmenu:u[1]||(u[1]=d=>l.$emit("contextmenu",d)),onDragstart:u[2]||(u[2]=d=>l.$emit("dragstart",d)),onDrop:u[3]||(u[3]=d=>l.$emit("drop",d)),onDragenter:u[4]||(u[4]=d=>l.$emit("dragenter",d)),onDragleave:u[5]||(u[5]=d=>l.$emit("dragleave",d)),onDragover:u[6]||(u[6]=d=>l.$emit("dragover",d)),onMouseleave:u[7]||(u[7]=d=>l.$emit("mouseleave",d))},[i.value?(I(),re(wm,{key:0,colspan:o.value},{default:Z(()=>[...u[8]||(u[8]=[Q("span",{class:"shimmer inline-block bg-role-shadow overflow-hidden absolute inset-x-2 inset-y-3 after:absolute after:inset-0 after:transform-[translateX(-100%)] opacity-10 after:animate-shimmer"},null,-1)])]),_:1},8,["colspan"])):Ce(l.$slots,"default",{key:1},void 0,!0)],544))}}),[["__scopeId","data-v-7acab1b8"]]),GE=Le(ge({__name:"OcTableTh",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e){return(t,n)=>(I(),re(bm,{type:"th","align-h":e.alignH,"align-v":e.alignV,width:e.width,wrap:e.wrap,class:"oc-th aria-[sort]:cursor-pointer",onClick:n[0]||(n[0]=r=>t.$emit("click",r))},{default:Z(()=>[Ce(t.$slots,"default",{},void 0,!0)]),_:3},8,["align-h","align-v","width","wrap"]))}}),[["__scopeId","data-v-d746eb11"]]),JE={key:0,class:"oc-table-thead-content inline-table align-middle"},XE=["textContent"],YE={key:1},ZE={key:0,class:"oc-table-thead-content inline-table align-middle"},eR=["textContent"],tR={key:1,class:"oc-table-footer border-t"},nR={class:"oc-table-footer-row h-10.5"},rR=["colspan"],oR=Le(ge({__name:"OcTable",props:{data:{},fields:{},disabled:{default:()=>[]},dragDrop:{type:Boolean,default:!1},hasHeader:{type:Boolean,default:!0},headerPosition:{default:0},highlighted:{},hover:{type:Boolean,default:!1},idKey:{default:"id"},itemDomSelector:{type:Function},lazy:{type:Boolean,default:!1},paddingX:{default:"small"},sortBy:{},sortDir:{},sticky:{type:Boolean,default:!1}},emits:["itemDropped","itemDragged","theadClicked","highlight","rowMounted","contextmenuClicked","sort","dropRowStyling","itemVisible"],setup(e,{emit:t}){const n=t,r={EVENT_THEAD_CLICKED:PS,EVENT_TROW_CLICKED:IS,EVENT_TROW_MOUNTED:FS,EVENT_TROW_CONTEXTMENU:$S},{$gettext:o}=me.useGettext(),s=B=>e.itemDomSelector?e.itemDomSelector(B):B[e.idKey],i=A(()=>{const B=["oc-table"];return e.hover&&B.push("oc-table-hover"),e.sticky&&B.push("oc-table-sticky"),B}),l=A(()=>e.fields.length),u=B=>{B.preventDefault()},d=(B,O)=>{n(OS,[B,O])},c=(B,O)=>{n(of,[B,O])},p=(B,O,M)=>{n("dropRowStyling",B,O,M)},f=B=>B.type==="slot",h=B=>["callback","function"].indexOf(B.type)>=0,g=B=>Object.prototype.hasOwnProperty.call(B,"title")?B.title:B.name,m=()=>({class:i.value}),w=B=>{switch(e.paddingX){case"remove":return B==="right"?"pr-0":"pl-0";case"xsmall":return B==="right"?"pr-1":"pl-1";case"small":return B==="right"?"pr-2":"pl-2";case"medium":return B==="right"?"pr-4":"pl-4";case"large":return B==="right"?"pr-6":"pl-6";case"xlarge":return B==="right"?"pr-12":"pl-12";case"xxlarge":return B==="right"?"pr-24":"pl-24"}},T=(B,O)=>{const M=y(B);return M.class=`oc-table-header-cell oc-table-header-cell-${B.name}`,Object.prototype.hasOwnProperty.call(B,"thClass")&&(M.class+=` ${B.thClass}`),e.sticky&&(M.style=`top: ${e.headerPosition}px;`,M.class+=" z-10"),O===0&&(M.class+=` ${w("left")} `),O===e.fields.length-1&&(M.class+=` ${w("right")}`),L(M,B),M},k=(B,O)=>({...e.lazy&&{lazy:{colspan:l.value}},class:["oc-tbody-tr",`oc-tbody-tr-${s(B)||O}`,E(B)?"oc-table-highlighted":void 0,...D(B)?["oc-table-disabled","opacity-70","pointer-events-none","grayscale-60"]:[]].filter(Boolean)}),S=(B,O,M)=>{const N=y(B);return N.class=`oc-table-data-cell oc-table-data-cell-${B.name}`,Object.prototype.hasOwnProperty.call(B,"tdClass")&&(N.class+=` ${B.tdClass}`),Object.prototype.hasOwnProperty.call(B,"wrap")&&(N.wrap=B.wrap),O===0&&(N.class+=` ${w("left")} `),O===e.fields.length-1&&(N.class+=` ${w("right")}`),Object.prototype.hasOwnProperty.call(B,"accessibleLabelCallback")&&(N["aria-label"]=B.accessibleLabelCallback(M)),N},y=B=>({...B?.alignH&&{alignH:B.alignH},...B?.alignV&&{alignV:B.alignV},...B?.width&&{width:B.width},class:void 0,wrap:void 0,style:void 0}),E=B=>e.highlighted?Array.isArray(e.highlighted)?e.highlighted.indexOf(B[e.idKey])>-1:e.highlighted===B[e.idKey]:!1,D=B=>e.disabled.length?e.disabled.indexOf(B[e.idKey])>-1:!1,$=(B,O,M)=>{const N=[M[e.idKey],O+1].filter(Boolean);return f(B)?[...N,B.name].join("-"):h(B)?[...N,B.callback(M[B.name])].join("-"):[...N,M[B.name]].join("-")},_=B=>o("Sort by %{ name }",{name:B}),L=(B,O)=>{if(!V(O))return;let M="none";e.sortBy===O.name&&(M=e.sortDir===Xe.Asc?"ascending":"descending"),B["aria-sort"]=M},V=({sortable:B})=>!!B,te=B=>{if(!V(B))return;let O=e.sortDir;e.sortBy===B.name&&e.sortDir!==void 0&&(O=e.sortDir===Xe.Desc?Xe.Asc:Xe.Desc),(e.sortBy!==B.name||e.sortDir===void 0)&&(O=B.sortDir||Xe.Desc),n("sort",{sortBy:B.name,sortDir:O})};return(B,O)=>{const M=oe("oc-icon");return I(),G("table",pt(m(),{class:"has-item-context-menu"}),[e.hasHeader?(I(),re(QE,{key:0},{default:Z(()=>[J(Sm,{class:"oc-table-header-row h-10.5"},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.fields,(N,q)=>(I(),re(GE,pt({key:`oc-thead-${N.name}`},{ref_for:!0},T(N,q)),{default:Z(()=>[N.sortable?(I(),re(Qt,{key:0,"aria-label":_(N.name),appearance:"raw","justify-content":"left",class:"oc-button-sort w-full hover:underline","gap-size":"small","no-hover":"",onClick:j=>te(N)},{default:Z(()=>[N.headerType==="slot"?(I(),G("span",JE,[Ce(B.$slots,N.name+"Header",{},void 0,!0)])):(I(),G("span",{key:1,class:"oc-table-thead-content inline-table align-middle header-text",textContent:R.toDisplayString(g(N))},null,8,XE)),J(M,{name:e.sortDir==="asc"?"arrow-down":"arrow-up","fill-type":"line",class:R.normalizeClass([{"sr-only":e.sortBy!==N.name},"p-1 rounded-sm"]),size:"small"},null,8,["name","class"])]),_:2},1032,["aria-label","onClick"])):(I(),G("div",YE,[N.headerType==="slot"?(I(),G("span",ZE,[Ce(B.$slots,N.name+"Header",{},void 0,!0)])):(I(),G("span",{key:1,class:"oc-table-thead-content inline-table align-middle header-text",textContent:R.toDisplayString(g(N))},null,8,eR))]))]),_:2},1040))),128))]),_:3})]),_:3})):le("",!0),J(KE,{class:"has-item-context-menu"},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.data,(N,q)=>(I(),re(Sm,pt({key:`oc-tbody-tr-${s(N)||q}`,ref_for:!0,ref:`row-${q}`},{ref_for:!0},k(N,q),{"data-item-id":N[e.idKey],draggable:e.dragDrop,class:"border-t h-10.5",onClick:j=>B.$emit(r.EVENT_TROW_CLICKED,[N,j]),onContextmenu:j=>B.$emit(r.EVENT_TROW_CONTEXTMENU,B.$refs[`row-${q}`][0],j,N),onVnodeMounted:j=>B.$emit(r.EVENT_TROW_MOUNTED,N,B.$refs[`row-${q}`][0]),onDragstart:j=>d(N,j),onDrop:j=>c(N,j),onDragenter:wt(j=>p(N,!1,j),["prevent"]),onDragleave:wt(j=>p(N,!0,j),["prevent"]),onDragover:O[0]||(O[0]=j=>u(j)),onItemVisible:j=>B.$emit("itemVisible",N)}),{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.fields,(j,H)=>(I(),re(wm,pt({key:"oc-tbody-td-"+$(j,H,N)},{ref_for:!0},S(j,H,N)),{default:Z(()=>[f(j)?Ce(B.$slots,j.name,{key:0,item:N},void 0,!0):h(j)?(I(),G(Ae,{key:1},[ct(R.toDisplayString(j.callback(N[j.name])),1)],64)):(I(),G(Ae,{key:2},[ct(R.toDisplayString(N[j.name]),1)],64))]),_:2},1040))),128))]),_:2},1040,["data-item-id","draggable","onClick","onContextmenu","onVnodeMounted","onDragstart","onDrop","onDragenter","onDragleave","onItemVisible"]))),128))]),_:3}),B.$slots.footer?(I(),G("tfoot",tR,[Q("tr",nR,[Q("td",{colspan:l.value,class:"oc-table-footer-cell p-1 text-sm text-role-on-surface-variant"},[Ce(B.$slots,"footer",{},void 0,!0)],8,rR)])])):le("",!0)],16)}}}),[["__scopeId","data-v-57029fa4"]]),gc=()=>{const{$gettext:e,$ngettext:t}=me.useGettext(),{showMessage:n,showErrorMessage:r}=Me(),{copy:o}=Rn.useClipboard(),s=({result:l,password:u})=>{const d=l.filter(Nr);let c="";if(d.length){let f=e("Link has been created successfully");if(l.length===1)try{c=u?e("%{link} Password:%{password}",{link:d[0].value.webUrl,password:u},!0):d[0].value.webUrl,f=e("The link has been copied to your clipboard.")}catch(h){console.warn("Unable to copy link to clipboard",h)}n({title:t(f,"Links have been created successfully.",d.length)})}const p=l.filter(Br);return p.length&&r({errors:p.map(({reason:f})=>f),title:t("Failed to create link","Failed to create links",p.length)}),c};return{copyLink:async({createLinkHandler:l,password:u})=>{if(navigator.clipboard.write)await new Promise((d,c)=>{const p=new ClipboardItem({"text/plain":l().then(f=>{const h=s({result:f,password:u}),g=new Blob([h],{type:"text/plain"});return d(),g}).catch(f=>{throw c(),f})});navigator.clipboard.write([p])});else{const d=await l(),c=s({result:d,password:u});c&&o(c)}}}},Ji=()=>{const{$gettext:e}=me.useGettext(),t=Dt(),n=Bt(),r=A(()=>n.can("create-all","PublicLink")),o=A(()=>Wt.View),s=d=>d===Wt.View?t.sharingPublicPasswordEnforcedFor.read_only:d===Wt.Upload?t.sharingPublicPasswordEnforcedFor.upload_only:d===Wt.CreateOnly?t.sharingPublicPasswordEnforcedFor.read_write:d===Wt.Edit?t.sharingPublicPasswordEnforcedFor.read_write_delete:!1,i=({isFolder:d})=>a(r)?d?[Wt.View,Wt.Edit,Wt.CreateOnly]:[Wt.View,Wt.Edit]:[],l=[{id:Wt.View,displayName:e("Can view"),description:e("View, download"),icon:"eye"},{id:Wt.Upload,displayName:e("Can upload"),description:e("View, upload, download"),icon:"upload"},{id:Wt.Edit,displayName:e("Can edit"),description:e("View, upload, edit, download, delete"),icon:"pencil"},{id:Wt.CreateOnly,displayName:e("Secret File Drop"),description:e("Upload only, existing content is not revealed"),icon:"inbox-unarchive"}];return{defaultLinkType:o,isPasswordEnforcedForLinkType:s,getAvailableLinkTypes:i,linkShareRoles:l,getLinkRoleByType:d=>l.find(({id:c})=>c===d)}},sR=ge({name:"LinkRoleDropdown",props:{modelValue:{type:Object,required:!0},availableLinkTypeOptions:{type:Array,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=me.useGettext(),{getLinkRoleByType:r}=Ji(),o=u=>e.modelValue===u,s=u=>{t("update:modelValue",u)},i=A(()=>n(r(e.modelValue)?.displayName)),l=Ct.v4();return{isSelectedType:o,updateSelectedType:s,currentLinkRoleLabel:i,dropUuid:l,getLinkRoleByType:r}}}),iR=["textContent"],aR=["textContent"],lR={class:"flex items-center"},cR={class:"text-left"},uR=["textContent"],dR={class:"text-sm leading-4"},fR={class:"flex"};function pR(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-button"),u=oe("oc-list"),d=oe("oc-drop"),c=Lt("oc-tooltip");return I(),G(Ae,null,[e.availableLinkTypeOptions.length>1?(I(),re(l,{key:0,id:`link-role-dropdown-toggle-${e.dropUuid}`,appearance:"raw","gap-size":"none","no-hover":"",class:"text-left link-role-dropdown-toggle"},{default:Z(()=>[Q("span",{class:"link-current-role",textContent:R.toDisplayString(e.currentLinkRoleLabel||e.$gettext("Select a role"))},null,8,iR),J(i,{name:"arrow-down-s"})]),_:1},8,["id"])):je((I(),G("span",{key:1,class:"link-current-role mr-4",textContent:R.toDisplayString(e.currentLinkRoleLabel)},null,8,aR)),[[c,e.getLinkRoleByType(e.modelValue)?.description]]),e.availableLinkTypeOptions.length>1?(I(),re(d,{key:2,class:"link-role-dropdown w-md",title:e.$gettext("Role"),"drop-id":`link-role-dropdown-${e.dropUuid}`,toggle:`#link-role-dropdown-toggle-${e.dropUuid}`,"padding-size":"small",mode:"click","close-on-click":""},{default:Z(()=>[J(u,{class:"role-dropdown-list"},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.availableLinkTypeOptions,(p,f)=>(I(),G("li",{key:`role-dropdown-${f}`},[J(l,{id:`files-role-${e.getLinkRoleByType(p).id}`,class:R.normalizeClass([{selected:e.isSelectedType(p)},"p-2"]),appearance:e.isSelectedType(p)?"filled":"raw-inverse","color-role":e.isSelectedType(p)?"secondaryContainer":"surface","justify-content":"space-between",onClick:h=>e.updateSelectedType(p)},{default:Z(()=>[Q("span",lR,[J(i,{name:e.getLinkRoleByType(p).icon,class:"pl-2 pr-4"},null,8,["name"]),Q("span",cR,[Q("span",{class:"role-dropdown-list-option-label font-semibold block w-full leading-4",textContent:R.toDisplayString(e.$gettext(e.getLinkRoleByType(p).displayName))},null,8,uR),Q("span",dR,R.toDisplayString(e.$gettext(e.getLinkRoleByType(p).description)),1)])]),Q("span",fR,[e.isSelectedType(p)?(I(),re(i,{key:0,name:"check"})):le("",!0)])]),_:2},1032,["id","class","appearance","color-role","onClick"])]))),128))]),_:1})]),_:1},8,["title","drop-id","toggle"])):le("",!0)],64)}const Tm=Le(sR,[["render",pR]]),hR={class:"flex justify-between pb-2"},mR={key:0,class:"flex items-center"},gR={key:1,class:"flex items-center"},vR={class:"flex flex-col"},yR=["textContent"],bR=["textContent"],wR=["textContent"],SR={class:"mb-4 ml-[30px]"},TR={key:1,class:"text-sm text-role-on-surface-variant"},kR=["textContent"],CR=["textContent"],xR={class:"flex justify-end items-center mt-2"},AR={class:"sr-only"},km=ge({__name:"CreateLinkModal",props:{modal:{},resources:{},space:{default:()=>{}}},emits:["cancel","confirm"],setup(e,{expose:t}){const n=Pe(),r=me.useGettext(),{$gettext:o}=r,{removeModal:s}=Je(),{copyLink:i}=gc(),l=tg(),{isEnabled:u,postMessage:d}=Tr(),{defaultLinkType:c,getAvailableLinkTypes:p,getLinkRoleByType:f,isPasswordEnforcedForLinkType:h}=Ji(),{addLink:g}=tr(),m=Bn(),{currentTheme:w}=we.storeToRefs(m),T=W(!1),k=W(!1),S=A(()=>e.resources.every(({isFolder:he})=>he)),y=A(()=>a(u)?o("Share link(s)"):o("Copy link")),E=A(()=>a(u)?o("Share link(s) and password(s)"):o("Copy link and password")),D=W(Ct.v4()),$=W({}),_=W(),L=Ta({value:"",error:void 0}),V=W(a(c)),te=A(()=>o(f(a(V)).description)),B=A(()=>o(f(a(V)).displayName)),O=A(()=>f(a(V)).icon),M=A(()=>p({isFolder:a(S)})),N=A(()=>h(a(V))),q=l.getPolicy({enforcePassword:a(N)}),j=()=>{T.value=!0},H=({date:he,error:ie})=>{_.value=he,k.value=ie},se=()=>Promise.allSettled(e.resources.map(he=>g({clientService:n,space:e.space,resource:he,options:{type:a(V),"@libre.graph.quickLink":!1,password:a(L).value,expirationDateTime:a(_)?.toISO(),displayName:o("Unnamed link")}}))),Y=A(()=>q.check(a(L).value)),ae=A(()=>!a(Y)||a(k)),ne=async()=>{const he=await se(),ie=[],de=he.filter(Br);return de.length&&de.map(({reason:ue})=>ue).forEach(ue=>{if(console.error(ue),ue.response?.status===400){const Se=ue.response.data.error;Se.message=rt.upperFirst(Se.message),ie.push(Se)}}),ie.length?(L.error=o(ie[0].message),Promise.reject()):he};t({onConfirm:async(he={})=>{if(a(u)){const de=(await ne()).filter(Nr);de.length&&(d("opencloud-embed:share",de.map(({value:ue})=>ue.webUrl)),d("opencloud-embed:share-links",de.map(({value:ue})=>({url:ue.webUrl,...he.copyPassword&&{password:a(L).value}})))),s(e.modal.id);return}await i({createLinkHandler:ne,password:he.copyPassword?a(L).value:void 0}),s(e.modal.id)}});const fe=he=>{L.value=he,L.error=void 0},be=he=>{V.value=he},xe=()=>l.generatePassword();return yt(()=>{const he=a($)[a(V)];he&&he.$el.focus(),a(N)&&(L.value=l.generatePassword())}),(he,ie)=>{const de=oe("oc-icon"),ue=oe("oc-text-input"),Se=oe("oc-datepicker"),$e=oe("oc-list"),Ve=oe("oc-drop");return I(),G(Ae,null,[Q("div",hR,[T.value?(I(),G("div",mR,[J(de,{class:"mr-2",name:O.value,"fill-type":"line"},null,8,["name"]),J(Tm,{"model-value":V.value,"available-link-type-options":M.value,"onUpdate:modelValue":be},null,8,["model-value","available-link-type-options"])])):(I(),G("div",gR,[J(de,{class:"mr-2",name:O.value,"fill-type":"line"},null,8,["name"]),Q("div",vR,[Q("span",{class:"font-semibold",textContent:R.toDisplayString(B.value)},null,8,yR),Q("span",{class:"text-sm",textContent:R.toDisplayString(te.value)},null,8,bR)])])),T.value?le("",!0):(I(),re(a(Qt),{key:2,class:"link-modal-advanced-mode-button","gap-size":"xsmall",appearance:"raw","no-hover":"",onClick:ie[0]||(ie[0]=lt=>j())},{default:Z(()=>[J(de,{name:"settings-3",size:"small","fill-type":"fill"}),Q("span",{textContent:R.toDisplayString(a(o)("Options"))},null,8,wR)]),_:1}))]),Q("div",SR,[T.value?(I(),re(ue,{key:D.value,"model-value":L.value,type:"password","password-policy":a(q),"generate-password-method":xe,"error-message":L.error,label:a(o)("Password"),"required-mark":N.value,class:"link-modal-password-input","onUpdate:modelValue":fe},null,8,["model-value","password-policy","error-message","label","required-mark"])):L.value?(I(),G("div",TR,[Q("span",{textContent:R.toDisplayString(a(o)("Password:"))},null,8,kR),Q("span",{textContent:R.toDisplayString(L.value)},null,8,CR)])):le("",!0),T.value?(I(),re(Se,{key:2,class:"mt-2","min-date":a(vt.DateTime).now(),label:a(o)("Expiry date"),"is-dark":a(w).isDark,onDateChanged:H},null,8,["min-date","label","is-dark"])):le("",!0)]),Q("div",xR,[J(a(Qt),{class:"link-modal-cancel oc-modal-body-actions-cancel ml-2",onClick:ie[1]||(ie[1]=lt=>he.$emit("cancel"))},{default:Z(()=>[ct(R.toDisplayString(a(o)("Cancel")),1)]),_:1}),Q("div",{class:R.normalizeClass(["ml-2",{"oc-button-group":L.value}])},[J(a(Qt),{class:"link-modal-confirm oc-modal-body-actions-confirm",appearance:"filled",disabled:ae.value,onClick:ie[2]||(ie[2]=lt=>he.$emit("confirm"))},{default:Z(()=>[ct(R.toDisplayString(y.value),1)]),_:1},8,["disabled"]),L.value?(I(),re(a(Qt),{key:0,class:"link-modal-confirm oc-modal-body-actions-confirm-secondary-trigger p-1",appearance:"filled",disabled:ae.value,"aria-label":a(o)("More options")},{default:Z(()=>[J(de,{size:"small",name:"arrow-down-s"}),Q("span",AR,R.toDisplayString(a(o)("More options")),1)]),_:1},8,["disabled","aria-label"])):le("",!0),L.value?(I(),re(Ve,{key:1,"drop-id":"oc-modal-body-actions-confirm-secondary-drop",toggle:".oc-modal-body-actions-confirm-secondary-trigger",mode:"click","padding-size":"small",title:a(o)("More options"),"close-on-click":""},{default:Z(()=>[J($e,null,{default:Z(()=>[Q("li",null,[J(a(Qt),{class:"oc-modal-body-actions-confirm-password",appearance:"raw","justify-content":"left",onClick:ie[3]||(ie[3]=lt=>he.$emit("confirm",{copyPassword:!0}))},{default:Z(()=>[ct(R.toDisplayString(E.value),1)]),_:1})])]),_:1})]),_:1},8,["title"])):le("",!0)],2)])],64)}}}),ER=({enforceModal:e=!1}={})=>{const t=Pe(),n=et(),{$gettext:r,$ngettext:o}=me.useGettext(),s=Dt(),i=Bt(),l=Ut(),{defaultLinkType:u}=Ji(),{addLink:d}=tr(),{dispatchModal:c}=Je(),{copyLink:p}=gc(),f=({space:m,resources:w})=>{const T=s.sharingPublicPasswordEnforcedFor.read_only===!0;if(e||T){c({title:o("Copy link for »%{resourceName}«","Copy links for the selected items",w.length,{resourceName:w[0].name}),customComponent:km,customComponentAttrs:()=>({space:m,resources:w}),hideActions:!0});return}const k=w.map(y=>d({clientService:t,space:m,resource:y,options:{"@libre.graph.quickLink":!1,displayName:r("Unnamed link"),type:a(u)}}));p({createLinkHandler:()=>l.addTask(()=>Promise.allSettled(k))})},h=({resources:m})=>{if(!m.length)return!1;for(const w of m)if(!w.canShare({user:n.user,ability:i})||z.isProjectSpaceResource(w)&&w.disabled)return!1;return!0};return{actions:A(()=>[{name:"create-links",icon:"link",handler:f,label:()=>r("Create links"),isVisible:h,class:"oc-files-actions-create-links"}])}},RR=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=Me(),r=et(),{$gettext:o}=me.useGettext(),{dispatchModal:s}=Je(),i=Mn(),{isEnabled:l}=Tr(),{openEditor:u}=An(),d=Pe(),c=De(),{resources:p,currentFolder:f,areFileExtensionsShown:h}=we.storeToRefs(c),{isFileNameValid:g}=Qr(),m=A(()=>i.fileExtensions.filter(({newFileMenu:S})=>!!S)),w=(S,y)=>(c.upsertResource(S),u(y,a(e),S)),T=(S,y,E)=>{let D=o("New file")+`.${y}`;a(p).some(_=>_.name===D)&&(D=wn(D,y,a(p))),h.value||(D=z.extractNameWithoutExtension({name:D,extension:y}));const $=h.value?[0,D.length-(y.length+1)]:null;s({title:o("Create a new file"),confirmText:o("Create"),hasInput:!0,inputValue:D,inputLabel:o("File name"),inputRequiredMark:!0,inputSelectionRange:$,onConfirm:async _=>{h.value||(_=`${_}.${y}`);try{let L;if(E.createFileHandler)L=await E.createFileHandler({fileName:_,space:a(e),currentFolder:a(f)});else if(E.type==="folder"){const V=Ke.join(a(f).path,_);L=await d.webdav.createFolder(a(e),{path:V})}else{const V=Ke.join(a(f).path,_);L=await d.webdav.putFileContents(a(e),{path:V})}return c.upsertResource(L),t({title:o("»%{fileName}« was created successfully",{fileName:L.name})}),a(l)?void 0:w(L,E)}catch(L){console.error(L),n({title:o("Failed to create file"),errors:[L]})}},onInput:(_,L)=>{const V=h.value?_:`${_}.${y}`,te={path:Ke.join(a(f).path,V),name:V,extension:y},{isValid:B,error:O}=g(te,V);L(B?null:O)}})};return{actions:A(()=>{const S=[],y={};for(const E of a(m)||[])E.hasPriority?y[E.extension]=E:y[E.extension]=y[E.extension]||E;for(const[,E]of Object.entries(y))S.push({name:"create-new-file",icon:"add",handler:D=>T(D,E.extension,E),label:()=>o(E.newFileMenu.menuTitle()),isVisible:()=>a(f)?.canUpload({user:r.user}),class:"oc-files-actions-create-new-file",ext:E.extension,isExternal:E.app?.startsWith("external-")});return S}),openFile:w}},Cm=()=>{const e=Pt("scrollTo"),t=Pt("details"),n=De(),{openSideBarPanel:r}=_t(),o=A(()=>at(a(e))),s=A(()=>at(a(t))),i=(u,d={forceScroll:!1,topbarElement:null})=>{const c=document.querySelectorAll(`[data-item-id='${u}']`)[0];if(!c){ze.publish("app.files.navigate.page",{resourceId:u,forceScroll:d.forceScroll,topbarElement:d.topbarElement});return}const f=document.getElementById(d.topbarElement)?.offsetHeight||0+c.offsetHeight*2;(c.getBoundingClientRect().bottom>window.innerHeight||c.getBoundingClientRect().top<f||d.forceScroll)&&c.scrollIntoView({behavior:"smooth",block:"center"})};return ze.subscribe("app.files.navigate.scrollTo",u=>i(u.resourceId,{forceScroll:u.forceScroll,topbarElement:u.topbarElement})),{scrollToResource:i,scrollToResourceFromRoute:(u,d)=>{if(!a(o)||!u.length)return;const c=a(u).find(p=>z.isIncomingShareResource(p)?p.remoteItemId===a(o):p.id===a(o));c&&c.processing!==!0&&(n.setSelection([c.id]),i(c.id,{forceScroll:!0,topbarElement:d}),a(s)&&r(a(s)))}}},DR=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=Me(),{dispatchModal:r}=Je(),{$gettext:o}=me.useGettext(),{scrollToResource:s}=Cm(),i=De(),{resources:l,currentFolder:u}=we.storeToRefs(i),d=Pe(),{isFileNameValid:c}=Qr(),p=async g=>{g=g.trimEnd();try{const m=Ke.join(a(u).path,g),w=await d.webdav.createFolder(a(e),{path:m});z.isShareSpaceResource(a(e))&&(w.remoteItemId=a(e).id),i.upsertResource(w),t({title:o("»%{folderName}« was created successfully",{folderName:g})}),await xt(),s(w.id,{forceScroll:!0,topbarElement:"files-app-bar"})}catch(m){console.error(m),n({title:o("Failed to create folder"),errors:[m]})}},f=()=>{let g=o("New folder");a(l).some(m=>m.name===g)&&(g=wn(g,"",a(l))),r({title:o("Create a new folder"),confirmText:o("Create"),hasInput:!0,inputValue:g,inputLabel:o("Folder name"),inputRequiredMark:!0,onConfirm:p,onInput:(m,w)=>{const T={path:Ke.join(a(u).path,m),name:m,isFolder:!0},{isValid:k,error:S}=c(T,m,a(l));return w(k?null:S)}})};return{actions:A(()=>[{name:"create-folder",icon:"folder",handler:f,label:()=>o("New Folder"),isVisible:()=>a(u)?.canCreate(),class:"oc-files-actions-create-new-folder"}]),addNewFolder:p}},PR="rowMounted",IR="fileDropped",FR="contextmenuClicked";class bs{static Thumbnail=[36,36];static Tile=[1e3,1e3];static Preview=[1200,1200];static Avatar=64}class $R{static Thumbnail="thumbnail";static Preview="preview";static Avatar="avatar"}const vc=10,OR=63,yc=256;class LR{state;observeEnter;observeExit;onEnterCallCount;onExitCallCount;onEnter;onExit;threshold;unobserver;constructor(t,n,r){this.unobserver=t,this.threshold=n,this.onEnter=r.onEnter,this.onExit=r.onExit,this.observeEnter=!!r.onEnter,this.observeExit=!!r.onExit,this.onEnterCallCount=0,this.onExitCallCount=0}request(t,n){const r={element:n,unobserve:()=>this.unobserve(t,n)};t===0&&this.observeEnter&&this.onEnter?(this.onEnterCallCount++,this.onEnter({callCount:this.onEnterCallCount,...r})):this.state===0&&t===1&&this.observeExit&&this.onExit&&(this.onExitCallCount++,this.onExit({callCount:this.onExitCallCount,...r})),this.state=t}unobserve(t,n){t===0?this.observeEnter=!1:t===1&&(this.observeExit=!1),!this.observeEnter&&!this.observeExit&&this.unobserver(n)}}class xm{targets;intersectionObserver;options;constructor(t={}){this.options={root:t.root,rootMargin:t.rootMargin,threshold:t.threshold||0},this.targets=new WeakMap,this.intersectionObserver=new IntersectionObserver(this.trigger.bind(this),this.options)}observe(t,n={},r){!n.onEnter&&!n.onExit||(this.targets.set(t,new LR(this.unobserve.bind(this),r||this.options.threshold||0,{onEnter:n.onEnter,onExit:n.onExit})),this.intersectionObserver.observe(t))}unobserve(t){this.targets.delete(t),this.intersectionObserver.unobserve(t)}disconnect(){this.targets=new WeakMap,this.intersectionObserver.disconnect()}trigger(t){t.forEach(n=>{const r=this.targets.get(n.target);r&&r.request(n.isIntersecting&&n.intersectionRatio>r.threshold?0:1,n.target)})}}const ws=ge({__name:"ResourceIcon",props:{resource:{},size:{default:"large"}},setup(e){const t={name:"resource-type-folder",color:"var(--oc-color-icon-folder)"},n={name:"resource-type-folder",color:"var(--oc-role-secondary)"},r={name:"layout-grid",color:"var(--oc-role-secondary)"},o={name:"layout-grid",color:"var(--oc-role-secondary)"},s={name:"resource-type-file",color:"var(--oc-role-on-surface)"},i=gd(),l=Jn(md),u=A(()=>a(m)?.name===t.name),d=A(()=>e.resource.type==="space"),c=A(()=>z.isProjectSpaceResource(e.resource)&&e.resource.disabled===!0),p=A(()=>e.resource.type==="folder"||e.resource.isFolder?t:s),f=A(()=>z.isPersonalSpaceResource(e.resource)),h=A(()=>e.resource.extension?.toLowerCase()),g=A(()=>e.resource.mimeType?.toLowerCase()),m=A(()=>{if(a(f))return n;if(a(c))return o;if(a(d))return r;const w=i[a(h)]||l?.mimeType[a(g)]||l?.extension[a(h)];return{...a(p),...w}});return(w,T)=>{const k=oe("oc-icon");return I(),re(k,{key:`resource-icon-${m.value.name}`,name:m.value.name,color:m.value.color,size:e.size,class:R.normalizeClass(["oc-resource-icon","inline-flex","items-center",{"opacity-80 grayscale":c.value,"[&_svg]:h-[70%]":!d.value&&!u.value}])},null,8,["name","color","size","class"])}}}),_R={name:"ResourceLink",props:{link:{type:Object,required:!1,default:null},resource:{type:Object,required:!0},isResourceClickable:{type:Boolean,required:!1,default:!0}},emits:["click"],setup:e=>{const t=Ge(),{options:n}=we.storeToRefs(t);return{linkTarget:A(()=>a(n).cernFeatures&&e.link&&!e.resource.isFolder?"_blank":"_self")}},computed:{isNavigatable(){return this.resource?this.link&&!this.resource.disabled:!1},isClickable(){return this.isResourceClickable&&!this.resource?.disabled}},methods:{emitClick(e){!e||typeof e.stopPropagation!="function"||this.isNavigatable||this.$emit("click",e)}}},MR={key:1};function NR(e,t,n,r,o,s){return n.isResourceClickable?(I(),re(rn(s.isNavigatable?"router-link":"oc-button"),{key:0,to:s.isNavigatable?n.link:void 0,target:s.isNavigatable?e.linkTarget:void 0,rel:s.isNavigatable&&e.linkTarget==="_blank"?"noopener noreferrer":void 0,appearance:s.isNavigatable?void 0:"raw","gap-size":s.isNavigatable?void 0:"none","justify-content":s.isNavigatable?void 0:"left",type:s.isNavigatable?void 0:"button","no-hover":s.isNavigatable?void 0:!0,draggable:!1,class:"oc-resource-link max-w-full",onDragstart:t[0]||(t[0]=wt(()=>{},["prevent","stop"])),onClick:s.emitClick},{default:Z(()=>[Ce(e.$slots,"default",{},void 0,!0)]),_:3},40,["to","target","rel","appearance","gap-size","justify-content","type","no-hover","onClick"])):(I(),G("span",MR,[Ce(e.$slots,"default",{},void 0,!0)]))}const Xi=Le(_R,[["render",NR],["__scopeId","data-v-15d92dd6"]]),BR=["data-test-resource-path","data-test-resource-name","data-test-resource-type","title"],jR={key:0,class:"truncate leading-4"},zR=["textContent"],UR=["textContent"],VR=["textContent"],bc=ge({__name:"ResourceName",props:{name:{},type:{},fullPath:{},pathPrefix:{default:""},extension:{default:""},isPathDisplayed:{type:Boolean,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},truncateName:{type:Boolean,default:!0}},setup(e){const t=A(()=>e.extension?e.name.slice(0,-e.extension.length-1):e.name),n=A(()=>e.extension?"."+e.extension:""),r=A(()=>{if(!e.isPathDisplayed)return null;const l=e.fullPath.replace(/^\//,"").split("/");return l.length<2?null:l.length===2?l[0]+"/":`…/${l[l.length-2]}/`}),o=A(()=>!e.isPathDisplayed||a(r)===e.fullPath?null:e.pathPrefix?qa.join(e.pathPrefix,e.fullPath):e.fullPath),s=A(()=>{if(!a(o))return e.isExtensionDisplayed?`${a(t)}${a(n)}`:a(t)}),i=A(()=>(a(r)||"")+e.name);return(l,u)=>{const d=Lt("oc-tooltip");return je((I(),G("span",{class:R.normalizeClass(["oc-resource-name flex min-w-0",[{"inline-block":!e.truncateName}]]),"data-test-resource-path":e.fullPath,"data-test-resource-name":i.value,"data-test-resource-type":e.type,title:s.value},[e.truncateName?(I(),G("span",jR,[Q("span",{class:"oc-resource-basename whitespace-pre text-role-on-surface",textContent:R.toDisplayString(t.value)},null,8,zR)])):(I(),G("span",{key:1,class:"oc-resource-basename break-normal text-role-on-surface leading-4",textContent:R.toDisplayString(t.value)},null,8,UR)),e.extension&&e.isExtensionDisplayed?(I(),G("span",{key:2,class:"oc-resource-extension whitespace-pre text-role-on-surface leading-4",textContent:R.toDisplayString(n.value)},null,8,VR)):le("",!0)],10,BR)),[[d,o.value]])}}}),qR={class:"flex"},HR=["textContent"],Ss=ge({__name:"ResourceListItem",props:{resource:{},pathPrefix:{default:""},link:{default:null},isPathDisplayed:{type:Boolean,default:!1},parentFolderLink:{default:null},parentFolderName:{default:""},parentFolderLinkIconAdditionalAttributes:{default:()=>({})},isExtensionDisplayed:{type:Boolean,default:!0},isThumbnailDisplayed:{type:Boolean,default:!0},isIconDisplayed:{type:Boolean,default:!0},isResourceClickable:{type:Boolean,default:!0}},emits:["click"],setup(e,{emit:t}){const n=t,{$gettext:r}=me.useGettext(),o=A(()=>e.parentFolderLink?"router-link":"span"),s=A(()=>({"fill-type":"line",name:"folder-2",size:"small",...e.parentFolderLinkIconAdditionalAttributes})),i=A(()=>e.isThumbnailDisplayed&&Object.prototype.hasOwnProperty.call(e.resource,"thumbnail")),l=A(()=>e.resource.thumbnail),u=A(()=>e.resource.locked?r("This item is locked"):null),d=c=>{!c||typeof c.stopPropagation!="function"||n("click",c)};return(c,p)=>{const f=oe("oc-image"),h=oe("oc-icon"),g=Lt("oc-tooltip");return I(),G("div",{class:R.normalizeClass(["oc-resource inline-flex justify-start items-center max-w-full overflow-visible",{"pointer-events-none":!e.isResourceClickable}])},[e.isIconDisplayed?je((I(),re(Xi,{key:0,resource:e.resource,link:e.link,"is-resource-clickable":e.isResourceClickable,class:R.normalizeClass(["relative",{"hover:underline":e.isResourceClickable}]),"aria-label":e.isResourceClickable?a(r)("Open »%{name}«",{name:e.resource?.name??""}):void 0,onClick:d},{default:Z(()=>[i.value?je((I(),re(f,{key:l.value,src:l.value,"data-test-thumbnail-resource-name":e.resource.name,class:"rounded-xs size-8 object-cover max-w-fit","aria-label":u.value,alt:""},null,8,["src","data-test-thumbnail-resource-name","aria-label"])),[[g,u.value]]):je((I(),re(ws,{key:1,"aria-label":u.value,"aria-hidden":"true",resource:e.resource},null,8,["aria-label","resource"])),[[g,u.value]])]),_:1},8,["resource","link","is-resource-clickable","class","aria-label"])),[[g,e.isResourceClickable?u.value:void 0]]):le("",!0),Q("div",{class:R.normalizeClass(["oc-resource-details block truncate",{"pl-2":e.isIconDisplayed}])},[J(Xi,{resource:e.resource,"is-resource-clickable":e.isResourceClickable,link:e.link,class:R.normalizeClass(["hover:outline-offset-0 focus:outline-offset-0",{"hover:underline":e.isResourceClickable}]),onClick:d},{default:Z(()=>[(I(),re(bc,{key:e.resource.name,name:e.resource.name,"path-prefix":e.pathPrefix,extension:e.resource.extension,type:e.resource.type,"full-path":e.resource.path,"is-path-displayed":e.isPathDisplayed,"is-extension-displayed":e.isExtensionDisplayed},null,8,["name","path-prefix","extension","type","full-path","is-path-displayed","is-extension-displayed"]))]),_:1},8,["resource","is-resource-clickable","link","class"]),Q("div",qR,[e.isPathDisplayed?(I(),re(rn(o.value),{key:0,to:e.parentFolderLink,class:R.normalizeClass(["parent-folder flex items-center truncate px-0.5 mr-2 -ml-0.5 hover:bg-transparent",{"cursor-pointer":e.parentFolderLink,"cursor-default":!e.parentFolderLink}])},{default:Z(()=>[J(h,pt(s.value,{class:"mr-1"}),null,16),Q("span",{class:"text truncate text-sm hover:underline",textContent:R.toDisplayString(e.parentFolderName)},null,8,HR)]),_:1},8,["to","class"])):le("",!0)])],2)],2)}}}),Am=ge({__name:"ResourcePreview",props:{searchResult:{default:()=>({data:{}})},isClickable:{type:Boolean,default:!0},term:{default:""}},setup(e){const t=new xm,{triggerDefaultAction:n}=An(),{getMatchingSpace:r}=It(),{getDefaultAction:o}=An(),{loadPreview:s}=Rc(),i=nn("resourceListItem"),{getPathPrefix:l,getParentFolderName:u,getParentFolderLink:d,getParentFolderLinkIconAdditionalAttributes:c,getFolderLink:p}=Cr(),f=De(),h=W(),g=A(()=>f.areFileExtensionsShown),m=A(()=>({...e.searchResult.data,...a(h)&&{thumbnail:a(h)}})),w=A(()=>r(a(m))),T=A(()=>{const _=a(m);return z.isSpaceResource(_)&&_.disabled===!0}),k=()=>{n({space:a(w),resources:[a(m)]})},S=A(()=>e.isClickable?{parentFolderLink:d(a(m)),onClick:k}:{isResourceClickable:!1}),y=A(()=>{if(a(m).isFolder)return p(a(m));const _=o({resources:[a(m)],space:a(w)});if(!_?.route)return null;const L=_.route({space:a(w),resources:[a(m)]});return L.query={...L.query,contextRouteQuery:{...L.query?.contextRouteQuery||{},term:e.term}},L}),E=l(a(m)),D=u(a(m)),$=c(a(m));return yt(()=>{a(T)&&a(i).parentElement.classList.add("disabled");const _=async()=>{const V=await s({space:a(w),resource:a(m),dimensions:bs.Thumbnail,cancelRunning:!0,updateStore:!1});V&&(h.value=V)},L=rt.debounce(({unobserve:V})=>{V(),_()},250);t.observe(a(i).$el,{onEnter:L,onExit:L.cancel})}),bn(()=>{t.disconnect()}),(_,L)=>(I(),re(Ss,pt({ref_key:"resourceListItem",ref:i,resource:m.value,"path-prefix":a(E),"is-path-displayed":!0,link:y.value,"is-extension-displayed":g.value,"parent-folder-link-icon-additional-attributes":a($),"parent-folder-name":a(D),"is-thumbnail-displayed":!!h.value},S.value),null,16,["resource","path-prefix","link","is-extension-displayed","parent-folder-link-icon-additional-attributes","parent-folder-name","is-thumbnail-displayed"]))}}),WR=7,QR=200,KR=ge({name:"CreateShortcutModal",components:{ResourcePreview:Am},props:{modal:{type:Object,required:!0},space:{type:Object,required:!0}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:n}){const r=Pe(),{$gettext:o}=me.useGettext(),{showMessage:s,showErrorMessage:i}=Me(),l=Re(),{search:u}=Hl(),{getPathPrefix:d,getParentFolderName:c,getParentFolderLink:p,getParentFolderLinkIconAdditionalAttributes:f,getFolderLink:h}=Cr(),g=De(),{resources:m,currentFolder:w}=we.storeToRefs(g),T=nn("dropRef"),k=W(""),S=W(""),y=W(null),E=W(null),D=W(!1);let $;const _=de=>{const ue=de.trim();return N(ue)?ue:`https://${ue}`},L=A(()=>_(a(k))),V=A(()=>!!a(m).find(de=>de.name===`${a(S)}.url`)),te=A(()=>a(V)||!a(S)||!a(k));Ue(te,()=>{t("update:confirmDisabled",a(te))},{immediate:!0});const B=A(()=>a(V)?o("»%{name}« already exists",{name:`${a(S)}.url`}):/[/]/.test(a(S))?o('Shortcut name cannot contain "/"'):""),O=$t.useTask(function*(de,ue){y.value=null,ue=`name:"*${ue}*" NOT name:"*.url"`;try{y.value=yield u(ue,WR)}catch{}}),M=rt.debounce(()=>{O.perform(a(k))},QR),N=de=>["http://","https://"].some(Se=>Se.startsWith(de)||de.startsWith(Se)),q=()=>{y.value=null,k.value=a(L);try{let de=new URL(a(L)).host;a(m).some(ue=>ue.name===`${de}.url`)&&(de=wn(`${de}.url`,"url",a(m)).slice(0,-4)),S.value=de}catch{}},j=de=>{y.value=null;const ue=new URL(window.location.href);let Se=de.data.name;k.value=`${ue.origin}/f/${de.id}`,a(m).some($e=>$e.name===`${Se}.url`)&&(Se=wn(`${Se}.url`,"url",a(m)).slice(0,-4)),S.value=Se},H=de=>a(E)===de,se=(de=!1)=>{const ue=Array.from(document.querySelectorAll("li.selectable-item"));let Se=a(E)!==null?a(E):de?ue.length:-1;const $e=de?-1:1;do if(Se+=$e,Se<0||Se>ue.length-1)return null;while(ue[Se].classList.contains("disabled"));return Se},Y=()=>{E.value=se(!0)},ae=()=>{E.value=se(!1)},ne=de=>{a(D)&&(de.stopPropagation(),a(T).hide())},pe=de=>{a(D)&&(de.stopPropagation(),a(E)!==null&&(a(E)===0?q():j(a(y)?.values?.[a(E)-1]),a(T).hide()))},fe=()=>{D.value=!1,E.value=null},be=()=>{D.value=!0,E.value=0},xe=()=>{k.value.trim().length&&a(T).show()},he=async()=>{if(await xt(),S.value=k.value.trim(),!k.value.trim().length){a(T).hide();return}a(T).show(),ln(l,"files-public-link")||M()},ie=async()=>{try{const ue=`[InternetShortcut]
32
- URL=${Uc.sanitize(_(a(k)),{USE_PROFILES:{html:!0}})}`,Se=z.urlJoin(a(w).path,`${a(S)}.url`),$e=await r.webdav.putFileContents(e.space,{path:Se,content:ue});g.upsertResource($e),s({title:o("Shortcut was created successfully")})}catch(de){console.error(de),i({title:o("Failed to create shortcut"),errors:[de]})}};return yt(async()=>{await xt(),$=new Vc(a(T)?.$refs?.drop)}),Ue(y,async()=>{await xt(),!(!a(D)||!$)&&($.unmark(),$.mark(a(k),{element:"span",className:"mark-highlight",exclude:[".selectable-item-url *",".create-shortcut-modal-search-separator *"]}))},{deep:!0}),Ue(E,()=>{if(!a(D)||typeof a(T)?.$el?.scrollTo!="function")return;const de=a(T).$el.querySelectorAll(".selectable-item");de[a(E)]&&a(T).$el.scrollTo(0,a(E)===null?0:de[a(E)].getBoundingClientRect().y-de[a(E)].getBoundingClientRect().height)}),n({onConfirm:ie}),{inputUrl:k,inputFilename:S,dropRef:T,dropItemUrl:L,searchResult:y,confirmButtonDisabled:te,inputFileNameErrorMessage:B,searchTask:O,dropItemUrlClicked:q,dropItemResourceClicked:j,getPathPrefix:d,getFolderLink:h,getParentFolderLink:p,getParentFolderName:c,getParentFolderLinkIconAdditionalAttributes:f,onKeyEnterDrop:pe,onKeyDownDrop:ae,onKeyUpDrop:Y,onKeyEscDrop:ne,onHideDrop:fe,onShowDrop:be,onInputUrlInput:he,onClickUrlInput:xe,isDropItemActive:H,onConfirm:ie}}}),GR={class:"flex items-center mb-1"},JR={for:"create-shortcut-modal-url-input"},XR=["textContent"],YR={key:0,class:"p-1 flex justify-center"},ZR={class:"create-shortcut-modal-search-separator text-role-on-surface-variant text-sm pl-1"},eD=["textContent"],tD={key:0,class:"flex w-full mt-4"},nD={class:"flex items-center mb-1"},rD={for:"create-shortcut-modal-filename-input"};function oD(e,t,n,r,o,s){const i=oe("oc-contextual-helper"),l=oe("oc-text-input"),u=oe("oc-icon"),d=oe("oc-button"),c=oe("oc-spinner"),p=oe("resource-preview"),f=oe("oc-list"),h=oe("oc-drop");return I(),G(Ae,null,[J(l,{id:"create-shortcut-modal-url-input",modelValue:e.inputUrl,"onUpdate:modelValue":[t[0]||(t[0]=g=>e.inputUrl=g),e.onInputUrlInput],placeholder:"example.org",label:e.$gettext("Webpage or file"),onKeydown:[zo(e.onKeyUpDrop,["up"]),zo(e.onKeyDownDrop,["down"]),zo(e.onKeyEscDrop,["esc"]),zo(e.onKeyEnterDrop,["enter"])],onClick:e.onClickUrlInput},{label:Z(()=>[Q("div",GR,[Q("label",JR,[ct(R.toDisplayString(e.$gettext("Webpage or file"))+" ",1),t[2]||(t[2]=Q("span",{class:"text-role-error","aria-hidden":"true"},"*",-1))]),J(i,{text:e.$gettext("Enter the target URL of a webpage or the name of a file. Users will be directed to this webpage or file."),title:e.$gettext("Webpage or file"),class:"ml-1"},null,8,["text","title"])])]),_:1},8,["modelValue","label","onKeydown","onUpdate:modelValue","onClick"]),J(h,{ref:"dropRef",class:"w-lg","padding-size":"remove","drop-id":"create-shortcut-modal-contextmenu",mode:"manual",position:"bottom-start","close-on-click":"","enforce-drop-on-mobile":"",onHideDrop:e.onHideDrop,onShowDrop:e.onShowDrop},{default:Z(()=>[J(f,null,{default:Z(()=>[Q("li",{class:R.normalizeClass(["selectable-item selectable-item-url",{active:e.isDropItemActive(0)}])},[J(d,{class:"w-full",appearance:"raw","justify-content":"left",onClick:e.dropItemUrlClicked},{default:Z(()=>[J(u,{name:"external-link"}),Q("span",{textContent:R.toDisplayString(e.dropItemUrl)},null,8,XR)]),_:1},8,["onClick"])],2),e.searchTask.isRunning?(I(),G("li",YR,[J(c)])):le("",!0),e.searchResult?.values?.length?(I(),G(Ae,{key:1},[Q("li",ZR,[Q("span",{textContent:R.toDisplayString(e.$gettext("Link to a file"))},null,8,eD)]),(I(!0),G(Ae,null,Ye(e.searchResult.values,(g,m)=>(I(),G("li",{key:m,class:R.normalizeClass(["selectable-item",{active:e.isDropItemActive(m+1)}])},[J(d,{class:"w-full",appearance:"raw","justify-content":"left",onClick:w=>e.dropItemResourceClicked(g)},{default:Z(()=>[J(p,{"search-result":g,"is-clickable":!1},null,8,["search-result"])]),_:2},1032,["onClick"])],2))),128))],64)):le("",!0)]),_:1})]),_:1},8,["onHideDrop","onShowDrop"]),e.inputFilename?(I(),G("div",tD,[J(l,{id:"create-shortcut-modal-filename-input",modelValue:e.inputFilename,"onUpdate:modelValue":t[1]||(t[1]=g=>e.inputFilename=g),label:e.$gettext("Shortcut name"),class:"w-full","error-message":e.inputFileNameErrorMessage,"fix-message-line":!0},{label:Z(()=>[Q("div",nD,[Q("label",rD,[ct(R.toDisplayString(e.$gettext("Shortcut name"))+" ",1),t[3]||(t[3]=Q("span",{class:"text-role-error","aria-hidden":"true"},"*",-1))]),J(i,{text:e.$gettext("Shortcut name as it will appear in the file list."),title:e.$gettext("Shortcut name"),class:"ml-1"},null,8,["text","title"])])]),_:1},8,["modelValue","label","error-message"])])):le("",!0)],64)}const Em=Le(KR,[["render",oD]]),sD=({space:e})=>{const{dispatchModal:t}=Je(),{$gettext:n}=me.useGettext(),r=De(),{currentFolder:o}=we.storeToRefs(r);return{actions:A(()=>[{name:"create-shortcut",icon:"external-link",handler:()=>{t({title:n("Create a Shortcut"),confirmText:n("Create"),customComponent:Em,customComponentAttrs:()=>({space:a(e)})})},label:()=>n("New Shortcut"),isVisible:()=>a(o)?.canCreate(),class:"oc-files-actions-create-new-shortcut"}])}},wc=()=>{const{showMessage:e,showErrorMessage:t}=Me(),{can:n}=Bt(),{$gettext:r,$ngettext:o}=me.useGettext(),{createSpace:s}=go(),i=Pe(),l=Re(),u=A(()=>n("create-all","Drive")),{dispatchModal:d}=Je(),c=Ge(),p=He(),f=De(),{isSpaceNameValid:h}=Qr(),g=async({spaceName:T,resources:k,space:S})=>{const{webdav:y}=i,E=new ur({concurrency:c.options.concurrentRequests.resourceBatchActions}),D=[];try{const $=await s(T);p.upsertSpace($),k.length===1&&k[0].isFolder&&(k=(await y.listFiles(S,{path:k[0].path})).children);for(const _ of k)D.push(E.add(()=>y.copyFiles(S,_,$,{path:_.name})));await Promise.all(D),f.resetSelection(),e({title:r("Space was created successfully")})}catch($){console.error($);const _=$.statusCode===425?r("Some files could not be copied"):r("Creating space failed…");t({title:_,errors:[$]})}},m=({resources:T,space:k})=>{d({title:o("Create Space from »%{resourceName}«","Create Space from selection",T.length,{resourceName:T[0].name}),message:o("Create Space with the content of »%{resourceName}«.","Create Space with the selected files.",T.length,{resourceName:T[0].name}),contextualHelperLabel:r("The marked elements will be copied."),contextualHelperData:{title:r("Restrictions"),text:r("Shares, versions and tags will not be copied.")},confirmText:r("Create"),hasInput:!0,inputLabel:r("Space name"),inputRequiredMark:!0,onInput:(S,y)=>{const{isValid:E,error:D}=h(S);y(E?null:D)},onConfirm:S=>g({spaceName:S,space:k,resources:T})})};return{actions:A(()=>[{name:"create-space-from-resource",icon:"function",handler:m,label:()=>r("Create Space from selection"),isVisible:({resources:T,space:k})=>!(!T.length||!a(u)||!st(l,"files-spaces-generic")||!z.isPersonalSpaceResource(k)),class:"oc-files-actions-create-space-from-resource-trigger"}])}},Ts=()=>{const e=et(),t=Dt(),{displayDialog:n,filesList_delete:r}=Vm(),{$gettext:o}=me.useGettext();return{actions:A(()=>[{name:"delete",icon:"delete-bin-5",label:()=>o("Delete"),handler:({resources:i})=>{r(i)},isVisible:({resources:i})=>i.length?i.every(l=>l.canBeDeleted()&&!z.isSpaceResource(l)&&!z.isIncomingShareResource(l)&&!z.isTrashResource(l)&&!l.isShareRoot()):!1,isDisabled:({resources:i})=>i.length===1&&i[0].locked,disabledTooltip:()=>o("File can't be deleted because it is currently locked."),class:"oc-files-actions-delete-trigger"},{name:"delete-permanent",icon:"delete-bin-5",label:()=>o("Delete"),handler:({space:i,resources:l})=>{n(i,l)},isVisible:({space:i,resources:l})=>!l.length||!t.filesPermanentDeletion||z.isProjectSpaceResource(i)&&!i.canDeleteFromTrashBin({user:e.user})?!1:l.every(z.isTrashResource),class:"oc-files-actions-delete-permanent-trigger"}])}},Yi=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Re(),{$gettext:r,$ngettext:o}=me.useGettext(),s=Pe(),i=Ut(),l=Ge(),{updateResourceField:u}=De(),d=async({resources:p})=>{const f=[],h=[],g=new ur({concurrency:l.options.concurrentRequests.resourceBatchActions});if(p.forEach(m=>{h.push(g.add(async()=>{try{const{graphAuthenticated:w}=s;await w.driveItems.deleteDriveItem(m.driveId,m.id),u({id:m.id,field:"syncEnabled",value:!1})}catch(w){console.error(w),f.push(w)}}))}),await Promise.all(h),f.length===0){st(n,"files-spaces-generic")&&(e({title:o("Sync for the selected share was disabled successfully","Sync for the selected shares was disabled successfully",p.length)}),n.push(an("files-shares-with-me")));return}t({title:o("Failed to disable sync for the the selected share","Failed to disable sync for the selected shares",p.length),errors:f})};return{actions:A(()=>[{name:"disable-sync",icon:"spam-3",handler:p=>i.addTask(()=>d(p)),label:()=>r("Disable sync"),isVisible:({space:p,resources:f})=>!mt(n,"files-shares-with-me")&&!st(n,"files-spaces-generic")||f.length===0||st(n,"files-spaces-generic")&&(p?.driveType!=="share"||f.length>1||f[0].path!=="/")?!1:f.some(h=>h.syncEnabled),class:"oc-files-actions-disable-sync-trigger"}])}},Rm=()=>er("$archiverService"),Zi=()=>{const{showErrorMessage:e}=Me(),t=Re(),n=Rm(),{$ngettext:r,$gettext:o,current:s}=me.useGettext(),i=Lr(),l=lr(),u=({space:p,resources:f})=>(f.length>1&&(f=f.filter(h=>h.canDownload()&&!z.isProjectSpaceResource(h))),n.triggerDownload({fileIds:f.map(h=>h.fileId),...p&&z.isPublicSpaceResource(p)&&{publicToken:p.id,publicLinkPassword:i.publicLinkPassword}}).catch(h=>{console.error(h),e({title:r("Failed to download the selected folder.","Failed to download the selected files.",f.length),errors:[h]})})),d=p=>{const f=a(n.capability);return f?p.reduce((g,m)=>g+parseInt(`${m.size}`),0)>parseInt(f.max_size):void 0};return{actions:A(()=>[{name:"download-archive",icon:"inbox-archive",handler:p=>{u(p)},label:()=>o("Download"),disabledTooltip:({resources:p})=>d(p)?o("The selection exceeds the allowed archive size (max. %{maxSize})",{maxSize:Ht(a(n.capability).max_size,s)}):"",isDisabled:({resources:p})=>d(p),isVisible:({resources:p})=>a(l)&&!st(t,"files-spaces-generic")&&!ln(t,"files-public-link")&&!bt(t,"files-common-favorites")&&!bt(t,"files-common-search")&&!mt(t,"files-shares-with-me")&&!mt(t,"files-shares-with-others")&&!mt(t,"files-shares-via-link")&&!bt(t,"files-common-search")||!a(n.available)||p.length===0||p.length===1&&!p[0].isFolder||p.length>1&&p.every(h=>z.isProjectSpaceResource(h))||z.isProjectSpaceResource(p[0])&&p[0].disabled?!1:!p.some(h=>!h.canDownload()),class:"oc-files-actions-download-archive-trigger"}])}},Sc=e=>{const{showErrorMessage:t}=Me(),{getMatchingSpace:n}=It(),r=e?.clientService||Pe(),{$gettext:o}=me.useGettext(),s=et();return{downloadFile:async(l=null,u,d=null)=>{try{l||(l=n(u));const c=await r.webdav.getFileUrl(l,u,{version:d,username:s.user?.onPremisesSamAccountName});gl(c,u.name)}catch(c){console.error(c),t({title:o("Download failed"),desc:o("File could not be located"),errors:[c]})}}}},xo=()=>{const e=Re(),{$gettext:t}=me.useGettext(),n=lr(),r=oa(),{downloadFile:o}=Sc(),s=({space:l,resources:u})=>{o(l,u[0])};return{actions:A(()=>[{name:"download-file",icon:"file-download",handler:s,label:()=>t("Download"),isVisible:({resources:l})=>a(n)&&!a(r)&&!st(e,"files-spaces-generic")&&!ln(e,"files-public-link")&&!bt(e,"files-common-favorites")&&!bt(e,"files-common-search")&&!mt(e,"files-shares-with-me")&&!mt(e,"files-shares-with-others")&&!mt(e,"files-shares-via-link")||l.length!==1||l[0].isFolder?!1:l[0].canDownload(),class:"oc-files-actions-download-file-trigger"}])}},iD=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=et(),r=Dt(),{$gettext:o}=me.useGettext(),s=Pe(),{dispatchModal:i}=Je(),l=De(),u=He(),d=Ut(),c=async({space:h})=>{try{await s.webdav.clearTrashBin(h),e({title:o("All deleted files were removed")}),l.resetSelection(),u.updateSpaceField({id:h.id,field:"hasTrashedItems",value:!1}),l.resources.some(z.isTrashResource)&&l.clearResources()}catch(g){console.error(g),t({title:o("Failed to empty trash bin"),errors:[g]})}},p=({resources:h})=>{i({title:o("Empty trash bin for »%{name}«",{name:h[0].name}),confirmText:o("Delete"),message:o("Are you sure you want to permanently delete the items in »%{name}«? You can’t undo this action.",{name:h[0].name}),hasInput:!1,onConfirm:()=>d.addTask(()=>c({space:h[0]}))})};return{actions:A(()=>[{name:"empty-trash-bin",icon:({resources:h})=>h[0]?.hasTrashedItems?"delete-bin-2":"delete-bin-7",label:()=>o("Empty trash bin"),handler:p,isVisible:({resources:h})=>h.length!==1||!r.filesPermanentDeletion||!z.isSpaceResource(h[0])?!1:h[0].canDeleteFromTrashBin({user:n.user}),isDisabled:({resources:h})=>!h[0].hasTrashedItems,class:"oc-files-actions-empty-trash-bin-trigger"}]),emptyTrashBin:c}},ea=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Re(),{$gettext:r,$ngettext:o}=me.useGettext(),s=Pe(),i=Ut(),l=Ge(),u=De(),{updateResourceField:d}=u,c=async({resources:f})=>{const h=[],g=[],m=new ur({concurrency:l.options.concurrentRequests.resourceBatchActions});if(f.forEach(w=>{g.push(m.add(async()=>{try{const{graphAuthenticated:T}=s;await T.driveItems.createDriveItem(w.driveId,{name:w.name,remoteItem:{id:w.fileId}}),d({id:w.id,field:"syncEnabled",value:!0})}catch(T){console.error(T),h.push(T)}}))}),await Promise.all(g),h.length===0){u.resetSelection(),st(n,"files-spaces-generic")&&e({title:o("Sync for the selected share was enabled successfully","Sync for the selected shares was enabled successfully",f.length)});return}t({title:o("Failed to enable sync for the the selected share","Failed to enable sync for the selected shares",f.length),errors:h})};return{actions:A(()=>[{name:"enable-sync",icon:"check",handler:f=>i.addTask(()=>c(f)),label:()=>r("Enable sync"),isVisible:({space:f,resources:h})=>!mt(n,"files-shares-with-me")&&!st(n,"files-spaces-generic")||h.length===0||st(n,"files-spaces-generic")&&(a(f)?.driveType!=="share"||h.length>1||h[0].path!=="/")?!1:h.some(g=>!g.syncEnabled),class:"oc-files-actions-enable-sync-trigger"}])}},Tc=()=>{const{showErrorMessage:e}=Me(),t=Dt(),n=Re(),{$gettext:r}=me.useGettext(),o=Pe(),s=lr(),i=Bt(),l=De(),u=rr(),d=async({space:p,resources:f})=>{try{const h=!f[0].starred;await o.webdav.setFavorite(p,f[0],h),l.updateResourceField({id:f[0].id,field:"starred",value:h}),h||u.publish("app.files.list.removeFromFavorites",f[0].id)}catch(h){const g=r('Failed to change favorite state of "%{file}"',{file:f[0].name},!0);e({title:g,errors:[h]})}};return{actions:A(()=>[{name:"favorite",icon:"star",handler:d,label:({resources:p})=>p[0].starred?r("Remove from favorites"):r("Add to favorites"),isVisible:({resources:p})=>a(s)&&!st(n,"files-spaces-generic")&&!bt(n,"files-common-favorites")||p.length!==1?!1:t.filesFavorites&&i.can("create","Favorite"),class:"oc-files-actions-favorite-trigger"}])}};function aD(e,t){const n=e.isReceivedShare()||e.isMounted(),r=t===""&&n;return e.canBeDeleted()&&!r}const ta=()=>{const e=Re(),{cutResources:t}=ns(),n=me.useGettext(),{$gettext:r}=n,o=De(),{currentFolder:s}=we.storeToRefs(o),i=A(()=>ts()?r("⌘ + X"):r("Ctrl + X")),l=({resources:d})=>{t(d)};return{actions:A(()=>[{name:"cut",icon:"scissors",handler:l,shortcut:a(i),label:()=>r("Cut"),isVisible:({resources:d})=>!st(e,"files-spaces-generic")&&!ln(e,"files-public-link")&&!bt(e,"files-common-favorites")||d.length===0||!a(s)||d.length===1&&d[0].locked?!1:!d.some(p=>aD(p,a(s).path)===!1),class:"oc-files-actions-move-trigger"}])}},Dm=()=>{const e=Re(),{$gettext:t}=me.useGettext(),n=De(),{currentFolder:r}=we.storeToRefs(n),o=A(()=>ln(e,"files-public-link")?co("files-public-link"):qt(e,"files-trash-overview")?wr("files-trash-generic"):kn("files-spaces-generic"));return{actions:A(()=>[{name:"navigate",icon:"folder-open",label:()=>t("Navigate"),isVisible:({resources:i})=>i.length!==1||a(r)!==null&&Uo(i[0],a(r))||z.isTrashResource(i[0])?!1:i[0].isFolder||i[0].type==="space",route:({space:i,resources:l})=>Go({},a(o),_n(i,{path:l[0].path,fileId:l[0].fileId})),class:"oc-files-actions-navigate-trigger"}])}},Pm=()=>{const{$gettext:e}=me.useGettext(),{getDefaultAction:t}=An();return{actions:A(()=>[{name:"open",icon:"eye",label:()=>e("Open"),handler:r=>{const o=t({...r,omitSystemActions:!0});!o||!Object.hasOwn(o,"handler")||o.handler(r)},route:r=>{const o=t({...r,omitSystemActions:!0});if(!(!o||!Object.hasOwn(o,"route")))return o.route(r)},isVisible:r=>{const o=t({...r,omitSystemActions:!0});return o?o.isVisible(r):!1},class:"oc-files-actions-default-editor-trigger"}])}},lD=()=>{const{showErrorMessage:e}=Me(),t=Re(),{$gettext:n}=me.useGettext(),r=lr(),o=oa(),s=Pe(),i=d=>{const c=/URL=(.+)/,p=d.match(c);if(p&&p[1])return p[1];throw new Error("unable to extract url")},l=async({resources:d,space:c})=>{try{const p=new URL(window.location.href),f=(await s.webdav.getFileContents(c,d[0])).body;let h=i(f);if(h=h.match(/^http[s]?:\/\//)?h:`https://${h}`,h=Uc.sanitize(h,{USE_PROFILES:{html:!0}}),h.startsWith(p.origin)){window.location.href=h;return}window.open(h)}catch(p){console.error(p),e({title:n("Failed to open shortcut"),errors:[p]})}};return{actions:A(()=>[{name:"open-shortcut",icon:"external-link",category:"context",handler:l,label:()=>n("Open shortcut"),isVisible:({resources:d})=>a(r)&&!a(o)&&!st(t,"files-spaces-generic")&&!ln(t,"files-public-link")&&!bt(t,"files-common-favorites")&&!bt(t,"files-common-search")&&!mt(t,"files-shares-with-me")&&!mt(t,"files-shares-with-others")&&!mt(t,"files-shares-via-link")||d.length!==1||d[0].extension!=="url"?!1:d[0].canDownload(),class:"oc-files-actions-open-short-cut-trigger"}]),extractUrl:i}},cD=ge({name:"AppLoadingSpinner"}),uD={class:"flex items-center justify-center size-full"};function dD(e,t,n,r,o,s){const i=oe("oc-spinner");return I(),G("div",uD,[J(i,{id:"app-loading-spinner",size:"large","aria-hidden":!0,"aria-label":""})])}const kc=Le(cD,[["render",dD]]),fD=ge({name:"FilePickerModal",components:{AppLoadingSpinner:kc},props:{modal:{type:Object,required:!0},allowedFileTypes:{type:Array,required:!0},parentFolderLink:{type:Object,required:!0},callbackFn:{type:Function,required:!0}},setup(e){const t=W(),n=W(!0),r=Re(),{removeModal:o}=Je(),s=Bn(),i=r.resolve(e.parentFolderLink),l=s.currentTheme.name,u=new URL(i.href,window.location.origin);u.searchParams.append("hide-logo","true"),u.searchParams.append("embed","true"),u.searchParams.append("embed-target","file"),u.searchParams.append("embed-delegate-authentication","false"),u.searchParams.append("embed-file-types",e.allowedFileTypes.join(","));const d=()=>{n.value=!1,a(t).contentWindow.focus()},c=({data:f})=>{if(f.name!=="opencloud-embed:file-pick")return;const{resource:h,locationQuery:g}=f.data;e.callbackFn({resource:h,locationQuery:g}),o(e.modal.id)},p=({data:f})=>{f.name==="opencloud-embed:cancel"&&o(e.modal.id)};return yt(()=>{window.addEventListener("message",c),window.addEventListener("message",p)}),bn(()=>{window.removeEventListener("message",c),window.removeEventListener("message",p)}),{isLoading:n,onLoad:d,iframeTitle:l,iframeSrc:u.href,iframeRef:t,onFilePick:c}}}),pD={class:"h-full",tabindex:"0"},hD=["title","src"];function mD(e,t,n,r,o,s){const i=oe("app-loading-spinner");return I(),G("div",pD,[e.isLoading?(I(),re(i,{key:0})):le("",!0),je(Q("iframe",{ref:"iframeRef",class:"size-full",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...l)=>e.onLoad&&e.onLoad(...l))},null,40,hD),[[rd,!e.isLoading]])])}const Im=Le(fD,[["render",mD]]),Fm=(e={})=>{const t=Re(),{getMatchingSpace:n}=It(e);return{createFolderLink:o=>{const{path:s,fileId:i,resource:l}=o,u=a(e.space)||n(l);return u?qt(t,"files-trash-overview")?wr("files-trash-generic",_n(u)):kn("files-spaces-generic",_n(u,{path:s,fileId:i})):{}}}},Cr=(e={})=>{const t=Dt(),{$gettext:n}=me.useGettext(),{getInternalSpace:r,getMatchingSpace:o,isResourceAccessible:s}=It(),{createFolderLink:i}=Fm(e);return{getPathPrefix:f=>{const h=a(e.space)||o(f);return z.isProjectSpaceResource(h)?qa.join(n("Spaces"),h.name):z.isShareSpaceResource(h)?qa.join(n("Shares"),h.name):h.name},getFolderLink:f=>i({path:f.path,fileId:f.fileId,resource:f}),getParentFolderLink:f=>{const h=a(e.space)||o(f),g=s({space:h,path:Ke.dirname(f.path)});return f.remoteItemId&&f.path==="/"||!g?an("files-shares-with-me"):z.isProjectSpaceResource(f)?kn("files-spaces-projects"):i({path:Ke.dirname(f.path),...f.parentFolderId&&{fileId:f.parentFolderId},resource:f})},getParentFolderName:f=>{const h=a(e.space)||o(f),g=s({space:h,path:Ke.dirname(f.path)});if(z.isShareRoot(f)||f.id===h.id&&z.isShareSpaceResource(h)||!g)return n("Shared with me");const w=z.extractParentFolderName(f);if(w)return w;if(z.isShareSpaceResource(h))return h.name;if(t.spacesProjects){if(z.isProjectSpaceResource(f))return n("Spaces");if(h?.driveType==="project")return h.name}return n("Personal")},getParentFolderLinkIconAdditionalAttributes:f=>z.isProjectSpaceResource(f)||z.isProjectSpaceResource(r(f.storageId)||{})&&f.path.split("/").length===2?{name:"layout-grid","fill-type":"fill"}:{}}},$m=({appId:e})=>{const{$gettext:t}=me.useGettext(),n=lr(),{dispatchModal:r}=Je(),o=Mn(),{apps:s}=we.storeToRefs(o),i=Re(),{getParentFolderLink:l}=Cr(),{getMatchingSpace:u}=It(),{getEditorRouteOpts:d}=An(),c=({resources:h})=>{const g=a(s)[e],m=l(h[0]),w=g.extensions.map(T=>T.extension?T.extension:T.mimeType);r({elementClass:"file-picker-modal",title:t("Open file in %{app}",{app:g.name}),customComponent:Im,hideActions:!0,customComponentAttrs:()=>({allowedFileTypes:w,parentFolderLink:m,callbackFn:f}),focusTrapInitial:!1})},p=A(()=>[{name:"open-with-app",icon:"folder-open",handler:c,label:()=>t("Open"),isVisible:()=>!a(n),class:"oc-files-actions-open-with-app-trigger"}]),f=({resource:h,locationQuery:g})=>{const m=u(h),w=z.isShareSpaceResource(m)?m.id:void 0,T=d(a(i.currentRoute).name,m,h,w);T.query={...T.query,...g};const k=i.resolve(T),S=new URL(k.href,window.location.origin);window.open(S.href,"_blank")};return{actions:p,onFilePicked:f}},Om=()=>{const e=Re(),t=Pe(),{getMatchingSpace:n}=It(),{$gettext:r,$ngettext:o}=me.useGettext(),s=ns(),{startWorker:i}=ph(),l=De(),{currentFolder:u}=we.storeToRefs(l),d=A(()=>ts()?r("⌘ + V"):r("Ctrl + V")),c=A(()=>s.action===Zo.Cut?Xn.MOVE:Xn.COPY),p=async({targetSpace:g,sourceSpace:m,resources:w})=>{const T=new hd(m,w,g,a(u),u,t,r,o),k=await T.getTransferData(a(c));if(!k.length)return;const S=a(u)?.id;i(k,async({successful:y,failed:E})=>{if(T.showResultMessage(E,y,a(c)),!y.length||a(u)&&S!==a(u).id)return;const D=[],$=[];for(const _ of y)D.push((async()=>{const L=await t.webdav.getFileInfo(g,_);$.push(L)})());await Promise.allSettled(D),z.isShareSpaceResource(g)&&$.forEach(_=>{_.remoteItemId=g.id}),l.upsertResources($)})},f=async({space:g})=>{const m=s.resources.reduce((T,k)=>{if(k.storageId in T)return T[k.storageId].resources.push(k),T;const S=n(k);return S.id in T||(T[S.id]={space:S,resources:[]}),T[S.id].resources.push(k),T},{}),w=Object.values(m).map(({space:T,resources:k})=>p({targetSpace:g,sourceSpace:T,resources:k}));await Promise.all(w),s.clearClipboard()};return{actions:A(()=>[{name:"paste",icon:"clipboard",handler:f,label:()=>r("Paste"),shortcut:a(d),isVisible:({resources:g})=>s.resources.length===0||!st(e,"files-spaces-generic")&&!ln(e,"files-public-link")&&!bt(e,"files-common-favorites")||g.length===0?!1:ln(e,"files-public-link")&&a(u)?a(u)?.canCreate():!0,class:"oc-files-actions-copy-trigger"}])}},na=()=>{const{showErrorMessage:e}=Me(),t=Dt(),n=Re(),{$gettext:r}=me.useGettext(),o=Pe(),s=Ge(),{dispatchModal:i}=Je(),l=et(),u=Bt(),d=De(),{setCurrentFolder:c,upsertResource:p}=d,{isFileNameValid:f}=Qr(),h=async(w,T,k)=>{let S=d.currentFolder;try{const y=Ke.join(Ke.dirname(T.path),k);await o.webdav.moveFiles(w,T,w,{path:y});const E=Uo(T,S);if(z.isShareSpaceResource(w)&&T.isReceivedShare()){if(w.rename(k),E)return S={...S},S.name=k,c(S),n.push(_n(w,{path:"",fileId:T.fileId}));const $={...T};$.name=k,p($);return}if(E)return S={...S},Qa(w,S,y),c(S),n.push(_n(w,{path:y,fileId:T.fileId}));const D={...T};Qa(w,D,y),p(D)}catch(y){console.error(y);let E=r('Failed to rename "%{file}" to »%{newName}«',{file:T.name,newName:k},!0);y.statusCode===423&&(E=r("Failed to rename »%{file}« to »%{newName}« - the file is locked",{file:T.name,newName:k},!0)),e({title:E,errors:[y]})}},g=async({space:w,resources:T})=>{const k=d.currentFolder;let S;if(Uo(T[0],k)){const B=Ke.dirname(k.path);S=(await o.webdav.listFiles(w,{path:B})).children}const y=d.areFileExtensionsShown,E=async B=>{y||(B=`${B}.${T[0].extension}`),await h(w,T[0],B)},D=(B,O)=>{y||(B=`${B}.${T[0].extension}`);const{isValid:M,error:N}=f(T[0],B,S);O(M?null:N)},$=z.extractNameWithoutExtension(T[0]),_=!T[0].isFolder&&!y?$:T[0].name,L=T[0].isFolder?r("Rename folder »%{name}«",{name:_}):r("Rename file »%{name}«",{name:_}),V=!T[0].isFolder&&!y?$:T[0].name,te=T[0].isFolder||!y?null:[0,$.length];i({title:L,confirmText:r("Rename"),hasInput:!0,inputValue:V,inputSelectionRange:te,inputLabel:T[0].isFolder?r("Folder name"):r("File name"),inputRequiredMark:!0,onConfirm:E,onInput:D})};return{actions:A(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:g,isVisible:({resources:w})=>qt(n,"files-trash-generic")||mt(n,"files-shares-with-me")&&!t.sharingCanRename||w.length!==1||(s.options.routing.fullShareOwnerPaths?w.some(S=>S.remoteItemPath&&S.path):w.some(S=>S.remoteItemId&&S.path==="/"))||w.length===1&&w[0].locked?!1:!w.some(S=>!S.canRename({user:l.user,ability:u})||S.processing),class:"oc-files-actions-rename-trigger"}]),renameResource:h}},ks=({showSuccessMessage:e=!0,onRestoreComplete:t}={})=>{const{showMessage:n,showErrorMessage:r}=Me(),o=et(),s=Re(),{$gettext:i,$ngettext:l}=me.useGettext(),u=Pe(),d=He(),c=De(),{startWorker:p}=hh(),f=async(T,k)=>{const S={},y=[],E=[],D=[];for(const $ of k){const _=Ke.dirname($.path);let L=[];if(_ in S)L=S[_];else{try{L=(await u.webdav.listFiles(T,{path:_})).children}catch{D.push(_)}S[_]=L}L.some(te=>te.name===$.name)||E.filter(te=>te.id!==$.id).some(te=>te.path===$.path)?y.push($):E.push($)}return{existingResourcesByPath:S,conflicts:y,resolvedResources:E,missingFolderPaths:D.filter($=>!S[$]?.length)}},h=async T=>{let k=0;const S=[],y=T.length;let E=!1,D;for(const $ of T){const _=$.type==="folder";if(E){S.push({resource:$,strategy:D});continue}const L=y-k,te=await new Ha(i,l).resolveFileExists({name:$.name,isFolder:_},L,!1);k++,te.doForAllConflicts&&(E=!0,D=te.strategy),S.push({resource:$,strategy:te.strategy})}return S},g=(T,k,S)=>{const y=a(s.currentRoute);p({space:T,resources:k,missingFolderPaths:S},async({successful:E,failed:D})=>{if(E.length){let $;E.length===1?$=i("%{resource} was restored successfully",{resource:E[0].name}):$=i("%{resourceCount} files restored successfully",{resourceCount:E.length.toString()}),e&&n({title:$}),y.name===a(s.currentRoute).name&&y.query?.fileId===a(s.currentRoute).query?.fileId&&(c.removeResources(E),c.resetSelection());const L=await u.graphAuthenticated.drives.getDrive(T.id);d.updateSpaceField({id:L.id,field:"spaceQuota",value:L.spaceQuota}),t?.({space:T,resources:E})}if(D.length){let $;const _={};D.length===1?(_.resource=D[0].resource.name,$=i('Failed to restore "%{resource}"',_,!0)):(_.resourceCount=D.length.toString(),$=i("Failed to restore %{resourceCount} files",_,!0)),r({title:$,errors:D.map(({error:L})=>L)})}})},m=async({space:T,resources:k})=>{const S=k.sort((te,B)=>te.path.length-B.path.length),{existingResourcesByPath:y,conflicts:E,resolvedResources:D,missingFolderPaths:$}=await f(T,S),_=await h(E),L=_.filter(te=>te.strategy===Sn.REPLACE).map(te=>te.resource);D.push(...L);const V=_.filter(te=>te.strategy===Sn.KEEP_BOTH).map(te=>te.resource);for(let te of V){te={...te};const B=Ke.dirname(te.path),O=y[B]||[],M=z.extractExtensionFromFile(te),N=wn(te.name,M,[...O,..._.map(q=>q.resource),...D]);te.name=N,te.path=z.urlJoin(B,N),D.push(te)}return g(T,D,$)};return{actions:A(()=>[{name:"restore",icon:"arrow-go-back",label:()=>i("Restore"),handler:m,isVisible:({space:T,resources:k})=>!qt(s,"files-trash-generic")||!k.every(S=>z.isTrashResource(S)&&S.canBeRestored())||z.isProjectSpaceResource(T)&&!T.canRestoreFromTrashbin({user:o.user})?!1:k.length>0,class:"oc-files-actions-restore-trigger"}]),restoreResources:g,collectConflicts:f}},gD=ge({name:"SaveAsModal",components:{AppLoadingSpinner:kc},props:{modal:{type:Object,required:!0},parentFolderLink:{type:Object,required:!0},originalResource:{type:Object,required:!0},content:{type:String,required:!0}},setup(e){const t=W(),n=W(!0),r=Bn(),{$gettext:o}=me.useGettext(),s=Re(),i=Pe(),{removeModal:l}=Je(),{showMessage:u,showErrorMessage:d}=Me(),{getMatchingSpace:c}=It(),{getEditorRouteOpts:p}=An(),f=s.resolve(e.parentFolderLink),h=r.currentTheme.name,g=new URL(f.href,window.location.origin);g.searchParams.append("hide-logo","true"),g.searchParams.append("embed","true"),g.searchParams.append("embed-target","location"),g.searchParams.append("embed-choose-file-name","true"),g.searchParams.append("embed-delegate-authentication","false"),g.searchParams.append("embed-choose-file-name-suggestion",e.originalResource.name);const m=()=>{n.value=!1,a(t).contentWindow.focus()},w=async({data:y})=>{if(y.name!=="opencloud-embed:select")return;const{resources:E,fileName:D,locationQuery:$}=y.data,_=E[0],L=c(_);try{const V=await T({destinationFolder:_,fileName:D,space:L});u({title:o("»%{fileName}« was saved successfully",{fileName:V.name})}),k({resource:V,space:L,locationQuery:$})}catch(V){console.error(V),d({title:o("Unable to save »%{fileName}«",{fileName:D}),errors:[V]}),console.error(V)}l(e.modal.id)},T=async({destinationFolder:y,fileName:E,space:D})=>{const{children:$}=await i.webdav.listFiles(D,{fileId:y.fileId},{davProperties:[Ee.Name]});return $.find(L=>L.name===E)&&(E=wn(E,e.originalResource.extension,$)),i.webdav.putFileContents(D,{fileName:E,parentFolderId:y.id,content:e.content,path:z.urlJoin(y.path,E)})},k=({locationQuery:y,resource:E,space:D})=>{const $=z.isShareSpaceResource(D)?D.id:void 0,_=p(a(s.currentRoute).name,D,E,$);_.query={..._.query,...y};const L=s.resolve(_),V=new URL(L.href,window.location.origin);window.open(V.href,"_blank")},S=({data:y})=>{y.name==="opencloud-embed:cancel"&&l(e.modal.id)};return yt(()=>{window.addEventListener("message",w),window.addEventListener("message",S)}),bn(()=>{window.removeEventListener("message",w),window.removeEventListener("message",S)}),{isLoading:n,onLoad:m,iframeTitle:h,iframeSrc:g.href,iframeRef:t,onLocationPick:w}}}),vD={class:"h-full",tabindex:"0"},yD=["title","src"];function bD(e,t,n,r,o,s){const i=oe("app-loading-spinner");return I(),G("div",vD,[e.isLoading?(I(),re(i,{key:0})):le("",!0),je(Q("iframe",{ref:"iframeRef",class:"size-full",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...l)=>e.onLoad&&e.onLoad(...l))},null,40,yD),[[rd,!e.isLoading]])])}const Lm=Le(gD,[["render",bD]]),_m=({content:e})=>{const{$gettext:t}=me.useGettext(),n=lr(),{dispatchModal:r}=Je(),{getParentFolderLink:o}=Cr(),s=({resources:l})=>{const u=o(l[0]);r({elementClass:"save-as-modal",title:t("Save as"),customComponent:Lm,hideActions:!0,customComponentAttrs:()=>({content:a(e),parentFolderLink:u,originalResource:l[0]}),focusTrapInitial:!1})};return{actions:A(()=>[{name:"save-as",icon:"save-2",handler:s,label:()=>t("Save as"),isVisible:({resources:l})=>!a(n)||l.length!==1,class:"oc-files-actions-save-as-trigger"}])}},wD={class:R.normalizeClass(["[&_.cropper-crop-box]:!outline-1","[&_.cropper-crop-box]:!outline-role-outline","[&_.cropper-line]:!bg-role-outline","[&_.cropper-point]:!bg-role-outline"])},SD={key:0,class:"max-h-[400px]"},TD=["src"],kD={class:"text-sm text-role-on-surface-variant flex items-center mt-1"},CD=["textContent"],Mm=ge({__name:"SpaceImageModal",props:{modal:{},space:{},file:{}},setup(e,{expose:t}){const{showMessage:n,showErrorMessage:r}=Me(),{$gettext:o}=me.useGettext(),s=Pe(),i=He(),{createDefaultMetaFolder:l}=go(),{getDefaultMetaFolder:u}=Fi(),{setCropperInstance:d}=Ql(),c=W(null),p=nn("imageRef"),f=W(null);t({onConfirm:async()=>{const w=a(c)?.getCroppedCanvas({imageSmoothingQuality:"high"}),T=await g(w);await m(T)}});const g=async w=>(await new Promise(k=>w.toBlob(k,"image/png"))).arrayBuffer(),m=async w=>{const T=s.graphAuthenticated;i.addToImagesLoading(e.space.id);let k=await u(e.space);k||(k=await l(e.space));const S={"Content-Type":"application/offset+octet-stream"};try{const{fileId:y,processing:E}=await s.webdav.putFileContents(e.space,{parentFolderId:k.id,fileName:"image.png",content:w,headers:S,overwrite:!0}),D=await T.drives.updateDrive(e.space.id,{name:e.space.name,special:[{specialFolder:{name:"image"},id:y}]});E||i.removeFromImagesLoading(e.space.id),i.updateSpaceField({id:e.space.id,field:"spaceImageData",value:D.spaceImageData}),n({title:o("Space image was set successfully")}),ze.publish("app.files.spaces.uploaded-image",D)}catch(y){if(console.error(y),i.removeFromImagesLoading(e.space.id),y instanceof z.HttpError&&y.statusCode===507){r({title:o("Failed to set space image"),desc:o("Not enough quota to set the space image"),errors:[y]});return}r({title:o("Failed to set space image"),errors:[y]})}};return yt(async()=>{try{f.value=URL.createObjectURL(e.file),a(c)&&a(c)?.destroy(),await xt(),c.value=new ca(a(p),{aspectRatio:16/9,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1}),d(c)}catch(w){r({title:o("Failed to load space image"),errors:[w]})}}),(w,T)=>{const k=oe("oc-icon");return I(),G("div",wD,[f.value?(I(),G("div",SD,[Q("img",{ref_key:"imageRef",ref:p,src:f.value},null,8,TD),Q("div",kD,[J(k,{class:"mr-1",name:"information",size:"small","fill-type":"line"}),Q("span",{textContent:R.toDisplayString(a(o)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:a(o)("+-"),panKeys:a(o)("↑↓←→")}))},null,8,CD)])])):le("",!0)])}}}),Nm=()=>{const e=et(),t=Re(),{$gettext:n}=me.useGettext(),r=Pe(),o=Ut(),{dispatchModal:s}=Je(),i=async({space:u,resources:d})=>{const{getFileContents:c}=r.webdav,p=await c(u,d[0],{responseType:"blob"}),f=new File([p.body],d[0].name);s({title:n("Crop your Space image"),confirmText:n("Confirm"),customComponent:Mm,customComponentAttrs:()=>({file:f,space:u})})};return{actions:A(()=>[{name:"set-space-image",icon:"image-edit",handler:u=>o.addTask(()=>i(u)),label:()=>n("Set as space image"),isVisible:({space:u,resources:d})=>d.length!==1||!d[0].hasPreview?.()||!d[0].mimeType?.includes("image/")||!st(t,"files-spaces-generic")||!u||!z.isProjectSpaceResource(u)?!1:u.canEditImage({user:e.user}),class:"oc-files-actions-set-space-image-trigger"}])}},xD=()=>{const e=Re(),{$gettext:t}=me.useGettext(),n=lr(),{openSideBarPanel:r}=_t(),o=()=>{const i=qt(e,"files-trash-generic")?null:"actions";r(i)};return{actions:A(()=>[{name:"show-actions",icon:"slideshow-3",label:()=>t("All Actions"),handler:o,isVisible:({resources:i})=>a(n)?i.length===1:!1,class:"oc-files-actions-show-actions-trigger"}])}},Cc=()=>{const e=Re(),t=De(),{openSideBar:n}=_t(),{$gettext:r}=me.useGettext();return{actions:A(()=>[{name:"show-details",icon:"information",class:"oc-files-actions-show-details-trigger",label:()=>r("Details"),isVisible:({resources:s})=>qt(e,"files-trash-generic")?!1:s.length>0,handler({resources:s}){t.setSelection(s.map(({id:i})=>i)),n()}}])}},Bm=()=>{const e=Dt(),{isPersonalSpaceRoot:t}=It();return{canListShares:({space:r,resource:o})=>!e.sharingApiEnabled||z.isPublicSpaceResource(r)||t(o)||z.isTrashResource(o)?!1:z.isIncomingShareResource(o)?o.sharePermissions.includes(z.GraphSharePermission.readPermissions):z.isShareSpaceResource(r)?r.graphPermissions?.includes(z.GraphSharePermission.readPermissions):!0}},jm=()=>{const e=Dt(),t=Bt(),n=et();return{canShare:({space:o,resource:s})=>!e.sharingApiEnabled||z.isShareSpaceResource(o)||z.isProjectSpaceResource(o)&&!o.canShare({user:n.user})?!1:s.canShare({ability:t,user:n.user})}},xc=()=>{const e=Re(),{$gettext:t}=me.useGettext(),{canShare:n}=jm(),{openSideBarPanel:r}=_t(),{interceptModifierClick:o}=zr(),s=({resources:l,event:u})=>{const d=l[0];u&&o(u,d)||r("sharing")};return{actions:A(()=>[{name:"show-shares",icon:"user-add",label:()=>t("Share"),handler:s,isVisible:({space:l,resources:u})=>qt(e,"files-trash-generic")||u.length!==1?!1:n({space:l,resource:u[0]}),class:"oc-files-actions-show-shares-trigger"}])}},ra=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Re(),{$gettext:r}=me.useGettext(),o=Pe(),s=Ut(),i=Ge(),{updateResourceField:l,resetSelection:u}=De(),d=async({resources:p})=>{const f=[],h=[],g=new ur({concurrency:i.options.concurrentRequests.resourceBatchActions}),m=!p[0].hidden;if(p.forEach(w=>{h.push(g.add(async()=>{try{await o.graphAuthenticated.driveItems.updateDriveItem(w.driveId,w.id,{"@UI.Hidden":m}),l({id:w.id,field:"hidden",value:m})}catch(T){console.error(T),f.push(T)}}))}),await Promise.all(h),f.length===0){u(),e({title:r(m?"The share was hidden successfully":"The share was unhidden successfully")});return}t({title:r(m?"Failed to hide the share":"Failed to unhide the share"),errors:f})};return{actions:A(()=>[{name:"toggle-hide-share",icon:"eye-off",handler:p=>s.addTask(()=>d(p)),label:({resources:p})=>p[0].hidden?r("Unhide"):r("Hide"),isVisible:({resources:p})=>p.length===0?!1:mt(n,"files-shares-with-me"),class:"oc-files-actions-hide-share-trigger"}])}},zm=()=>{const{$gettext:e}=me.useGettext(),{showErrorMessage:t}=Me(),{webdav:n}=Pe(),r=Dt(),o=De(),{currentFolder:s}=we.storeToRefs(o),{actions:i}=ks({showSuccessMessage:!1,onRestoreComplete:async({space:p,resources:f})=>{if(vd({resourcesStore:o,parentFolderId:f[0].parentFolderId})){const{children:h}=await n.listFiles(p,{path:a(s).path});o.upsertResources(h.filter(({id:g})=>f.some(m=>m.id===l(g))))}}}),l=p=>p.includes("!")?p.split("!")[1]:p,u=async({space:p,resources:f,callback:h})=>{const g=f.map(m=>({...m,id:l(m.id)}));try{await a(i)[0].handler({space:p,resources:g}),h()}catch(m){console.error(m),t({title:e("Failed to restore files"),errors:[m]})}},d=A(()=>ts()?e("⌘ + Z"):e("Ctrl + Z"));return{actions:A(()=>[{name:"undoDelete",icon:"arrow-go-back",shortcut:a(d),isVisible:({space:p})=>r.davTrashbin?z.isProjectSpaceResource(p)||z.isPersonalSpaceResource(p):!1,label:()=>e("Undo"),handler:u}])}},Um=()=>{const{$gettext:e}=me.useGettext(),{actions:t}=xo(),{downloadFile:n}=Sc(),{dispatchModal:r}=Je(),o=({space:i,resources:l})=>{r({title:e("No preview available for »%{name}«",{name:l[0].name}),confirmText:e("Download"),message:e("There is no preview available for this file. Do you want to download it instead?"),onConfirm:()=>{n(i,l[0])}})};return{actions:A(()=>[{name:"fallback-to-download",icon:"file-download",handler:o,label:()=>e("Download"),isVisible:i=>a(t)[0].isVisible(i),class:"oc-files-actions-fallback-to-download-trigger"}])}},Vm=()=>{const e=Ge(),{showMessage:t,showErrorMessage:n,removeMessage:r}=Me(),o=Re(),s=me.useGettext(),{getMatchingSpace:i}=It(),{$gettext:l,$ngettext:u}=s,d=Pe(),{dispatchModal:c}=Je(),p=He(),f=rr(),{bindKeyAction:h,removeKeyAction:g}=_i(),{startWorker:m}=fh({concurrentRequests:e.options.concurrentRequests.resourceBatchActions}),{actions:w}=zm(),T=De(),{currentFolder:k}=we.storeToRefs(T),S=W([]),y=Pt("page","1"),E=A(()=>parseInt(at(a(y)))),D=Pt("items-per-page","1"),$=A(()=>parseInt(at(a(D)))),_=A(()=>cd(a(S))),L=({space:N,filesToDelete:q,deletedFiles:j})=>{const H=j.length===1&&q.length===1?l('"%{item}" was moved to trash bin',{item:j[0].name}):u("%{itemCount} item was moved to trash bin","%{itemCount} items were moved to trash bin",j.length,{itemCount:j.length.toString()},!0),se=7,Y=a(w)[0],ae=Y.isVisible({space:N,resources:j});let ne;const pe=t({title:H,timeout:se,actions:[Y],actionOptions:{space:N,resources:j,callback:()=>{r(pe),ne&&g(ne)}}});ae&&(ne=h({primary:jn.Z,modifier:Li.Ctrl},()=>(g(ne),Y.handler({space:N,resources:j,callback:()=>{r(pe)}}))),setTimeout(()=>g(ne),se*1e3))},V=A(()=>{const N=a(_),q=N[0].type==="folder";let j=null;return N.length===1?(q?j=l("Permanently delete folder »%{name}«",{name:N[0].name},!0):j=l("Permanently delete file »%{name}«",{name:N[0].name},!0),j):u("Permanently delete selected resource?","Permanently delete %{amount} selected resources?",N.length,{amount:N.length.toString()},!1)}),te=A(()=>{const N=a(_),q=N[0].type==="folder";return N.length===1?l(q?"Are you sure you want to delete this folder? All its content will be permanently removed. This action cannot be undone.":"Are you sure you want to delete this file? All its content will be permanently removed. This action cannot be undone."):l("Are you sure you want to delete all selected resources? All their content will be permanently removed. This action cannot be undone.")}),B=N=>{const q=a(o.currentRoute);m({topic:"trashBinDelete",space:N,resources:a(_)},({successful:j,failed:H})=>{if(j.length){const se=j.length===1&&a(_).length===1?l('"%{item}" was deleted successfully',{item:j[0].name}):u("%{itemCount} item was deleted successfully","%{itemCount} items were deleted successfully",j.length,{itemCount:j.length.toString()},!0);t({title:se})}H.forEach(({resource:se})=>{const Y=l('Failed to delete "%{item}"',{item:se.name});n({title:Y,errors:[new Error]})}),q.name===a(o.currentRoute).name&&q.query?.fileId===a(o.currentRoute).query?.fileId&&(T.removeResources(j),T.resetSelection())})};return{displayDialog:(N,q)=>{S.value=[...q],c({title:a(V),message:a(te),confirmText:l("Delete"),onConfirm:()=>B(N)})},filesList_delete:N=>{S.value=[...N],T.addResourcesIntoDeleteQueue(a(S).map(({id:H})=>H)),a(S).forEach(({id:H})=>T.removeSelection(H));const q=a(N).reduce((H,se)=>{if(se.storageId in H)return H[se.storageId].resources.push(se),H;const Y=i(se);return Y.id in H||(H[Y.id]={space:Y,resources:[]}),H[Y.id].resources.push(se),H},{}),j=a(k)?.id;return Object.values(q).map(({space:H,resources:se})=>{m({topic:"fileListDelete",space:H,resources:se},async({successful:Y,failed:ae})=>{if(Y.length&&(L({space:H,filesToDelete:se,deletedFiles:Y}),f.publish("runtime.resource.deleted",Y)),T.removeResourcesFromDeleteQueue(ae.map(({resource:ne})=>ne.id)),T.removeResourcesFromDeleteQueue(Y.map(({id:ne})=>ne)),ae.forEach(({error:ne,resource:pe})=>{let fe=l('Failed to delete "%{resource}"',{resource:pe.name});ne.statusCode===423&&(fe=l('Failed to delete "%{resource}" - the file is locked',{resource:pe.name})),n({title:fe,errors:[ne]})}),j===a(k)?.id){T.removeResources(Y);const ne=T.activeResources.length,pe=Math.ceil(a(ne)/a($));a(E)>1&&a(E)>pe&&(y.value=pe.toString())}if(st(o,"files-spaces-generic")&&!["public","share"].includes(H?.driveType)){const pe=await d.graphAuthenticated.drives.getDrive(a(N)[0].storageId);p.updateSpaceField({id:pe.id,field:"spaceQuota",value:pe.spaceQuota})}if(a(S).length&&Uo(a(S)[0],a(k)))return o.push(_n(H,{path:Ke.dirname(a(S)[0].path),fileId:a(S)[0].parentFolderId}))})})}}},AD=()=>{const e=St();return A(()=>a(e)?.query?.contextRouteName)},ED=e=>e==="files",lr=()=>{const e=St();return A(()=>ED(pl(a(e))))},Qr=()=>{const{$gettext:e}=me.useGettext(),t=De();return{isSpaceNameValid:o=>o.trim()===""?{isValid:!1,error:e("The Space name cannot be empty")}:Nl(o)>yc?{isValid:!1,error:e("The Space name is too long")}:o.trim()!==o?{isValid:!1,error:e("The Space name cannot start or end with whitespace")}:/[/\\.:?*"><|]/.test(o)?{isValid:!1,error:e(`The Space name cannot contain the following characters: / \\\\ . : ? * " > < |'`)}:{isValid:!0,error:void 0},isFileNameValid:(o,s,i=void 0)=>{if(!s)return{isValid:!1,error:e("The name cannot be empty")};if(/[/]/.test(s))return{isValid:!1,error:e('The name cannot contain "/"')};if(/[\\]/.test(s))return{isValid:!1,error:e('The name cannot contain "\\"')};if(s===".")return{isValid:!1,error:e('The name cannot be equal to "."')};if(s==="..")return{isValid:!1,error:e('The name cannot be equal to ".."')};if(s.trim()!==s)return{isValid:!1,error:e("The name cannot start or end with whitespace")};if(Nl(s)>yc)return{isValid:!1,error:e("The name is too long")};const l=o.path.substring(0,o.path.length-o.name.length)+s;if((i||t.resources).some(d=>d.path===l&&d.name===s)){const d=e("The name »%{name}« is already taken");return{isValid:!1,error:e(d,{name:s},!0)}}return{isValid:!0,error:void 0}}}},oa=()=>A(()=>!!document.getElementById("files-global-search-options")),qm=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=et(),{$gettext:r,$ngettext:o}=me.useGettext(),s=Bt(),i=Pe(),l=St(),{dispatchModal:u}=Je(),d=He(),{removeResources:c}=De(),p=m=>m.filter(w=>z.isProjectSpaceResource(w)&&w.canBeDeleted({user:n.user,ability:s})),f=async m=>{const w=i.graphAuthenticated,T=m.map(E=>w.drives.deleteDrive(E.id).then(()=>(c([E]),d.removeSpace(E),!0))),k=await Promise.allSettled(T),S=k.filter(Nr);if(S.length){const E=S.length===1&&m.length===1?r("Space »%{space}« was deleted successfully",{space:m[0].name}):o("%{spaceCount} space was deleted successfully","%{spaceCount} spaces were deleted successfully",S.length,{spaceCount:S.length.toString()},!0);e({title:E})}const y=k.filter(Br);if(y.length){y.forEach(console.error);const E=y.length===1&&m.length===1?r("Failed to delete space »%{space}«",{space:m[0].name}):o("Failed to delete %{spaceCount} space","Failed to delete %{spaceCount} spaces",y.length,{spaceCount:y.length.toString()},!0);t({title:E,errors:y.map(D=>D.reason)})}a(l).name==="admin-settings-spaces"&&ze.publish("app.admin-settings.list.load")},h=({resources:m})=>{const w=p(m);if(!w.length)return;const T=o("Are you sure you want to delete the selected space?","Are you sure you want to delete %{count} selected spaces?",w.length,{count:w.length.toString()});u({title:o("Delete Space »%{space}«?","Delete %{spaceCount} Spaces?",w.length,{space:w[0].name,spaceCount:w.length.toString()}),confirmText:r("Delete"),message:T,hasInput:!1,onConfirm:()=>f(w)})};return{actions:A(()=>[{name:"delete",icon:"delete-bin",label:()=>r("Delete"),handler:h,isVisible:({resources:m})=>!!p(m).length,class:"oc-files-actions-delete-trigger"}]),deleteSpaces:f}},Hm=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=et(),{$gettext:r,$ngettext:o}=me.useGettext(),s=Bt(),i=Pe(),l=St(),u=Re(),{dispatchModal:d}=Je(),c=He(),p=m=>m.filter(w=>z.isProjectSpaceResource(w)&&w.canDisable({user:n.user,ability:s})),f=async m=>{const w=a(l),T=i.graphAuthenticated,k=m.map(D=>T.drives.disableDrive(D.id).then(()=>(w.name==="files-spaces-generic"&&u.push({name:"files-spaces-projects"}),w.name==="admin-settings-spaces"&&(D.disabled=!0,D.spaceQuota={total:D.spaceQuota.total}),c.updateSpaceField({id:D.id,field:"disabled",value:!0}),!0))),S=await Promise.allSettled(k),y=S.filter(Nr);if(y.length){const D=y.length===1&&m.length===1?r("Space »%{space}« was disabled successfully",{space:m[0].name}):o("%{spaceCount} space was disabled successfully","%{spaceCount} spaces were disabled successfully",y.length,{spaceCount:y.length.toString()},!0);e({title:D})}const E=S.filter(Br);if(E.length){E.forEach(console.error);const D=E.length===1&&m.length===1?r("Failed to disable space »%{space}«",{space:m[0].name}):o("Failed to disable %{spaceCount} space","Failed to disable %{spaceCount} spaces",E.length,{spaceCount:E.length.toString()},!0);t({title:D,errors:E.map($=>$.reason)})}},h=({resources:m})=>{const w=p(m);if(!w.length)return;const T=o("If you disable the selected space, it can no longer be accessed. Only Space managers will still have access. Note: No files will be deleted from the server.","If you disable the %{count} selected spaces, they can no longer be accessed. Only Space managers will still have access. Note: No files will be deleted from the server.",w.length,{count:w.length.toString()}),k=r("Disable");d({title:o("Disable Space »%{space}«?","Disable %{spaceCount} Spaces?",w.length,{space:w[0].name,spaceCount:w.length.toString()}),confirmText:k,message:T,hasInput:!1,onConfirm:()=>f(w)})};return{actions:A(()=>[{name:"disable",icon:"stop-circle",label:()=>r("Disable"),handler:h,isVisible:({resources:m})=>!!p(m).length,class:"oc-files-actions-disable-trigger"}]),disableSpaces:f}},Wm=()=>{const e=Ge(),t=He(),n=tr(),{showMessage:r,showErrorMessage:o}=Me(),s=Re(),{$gettext:i}=me.useGettext(),l=Bt(),u=Pe(),d=Ut(),{upsertResource:c}=De(),p=st(s,"files-spaces-projects"),f=async m=>{const w=t.spaces.filter(z.isProjectSpaceResource),T=wn(m.name,"",w);try{let k=await u.graphAuthenticated.drives.createDrive({name:T,description:m.description,quota:{total:m.spaceQuota.total}});const S=await u.webdav.listFiles(m);if(S.children.length){const y=new ur({concurrency:e.options.concurrentRequests.resourceBatchActions}),E=[];for(const D of S.children)E.push(y.add(()=>u.webdav.copyFiles(m,D,k,{path:D.name})));await Promise.all(E)}if(m.spaceReadmeData||m.spaceImageData){const y={special:[]};if(m.spaceReadmeData){const E=await u.webdav.getFileInfo(k,{path:`.space/${m.spaceReadmeData.name}`});y.special.push({specialFolder:{name:"readme"},id:E.id})}if(m.spaceImageData){const E=await u.webdav.getFileInfo(k,{path:`.space/${m.spaceImageData.name}`});y.special.push({specialFolder:{name:"image"},id:E.id})}k=await u.graphAuthenticated.drives.updateDrive(k.id,y,n.graphRoles)}t.upsertSpace(k),p&&c(k),r({title:i("Space »%{space}« was duplicated successfully",{space:m.name})})}catch(k){console.error(k),o({title:i("Failed to duplicate space »%{space}«",{space:m.name}),errors:[k]})}},h=async({resources:m})=>{for(const w of m)w.disabled||!z.isProjectSpaceResource(w)||await f(w)};return{actions:A(()=>[{name:"duplicate",icon:"folders",label:()=>i("Duplicate"),handler:m=>d.addTask(()=>h(m)),isVisible:({resources:m})=>!m?.length||m.every(w=>w.disabled)||m.every(w=>!z.isProjectSpaceResource(w))?!1:l.can("create-all","Drive"),class:"oc-files-actions-duplicate-trigger"}]),duplicateSpace:f}},RD=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=et(),{$gettext:r}=me.useGettext(),o=Bt(),s=Pe(),i=St(),{dispatchModal:l}=Je(),u=He(),d=(f,h)=>s.graphAuthenticated.drives.updateDrive(f.id,{name:f.name,description:h}).then(()=>{u.updateSpaceField({id:f.id,field:"description",value:h}),a(i).name==="admin-settings-spaces"&&(f.description=h),e({title:r("Space subtitle was changed successfully")})}).catch(m=>{console.error(m),t({title:r("Failed to change space subtitle"),errors:[m]})}),c=({resources:f})=>{f.length===1&&l({title:r("Change subtitle for space")+" "+f[0].name,confirmText:r("Confirm"),hasInput:!0,inputLabel:r("Space subtitle"),inputValue:f[0].description,onConfirm:h=>d(f[0],h)})};return{actions:A(()=>[{name:"editDescription",icon:"h-2",iconFillType:"none",label:()=>r("Edit subtitle"),handler:c,isVisible:({resources:f})=>f.length!==1?!1:f[0].canEditDescription({user:n.user,ability:o}),class:"oc-files-actions-edit-description-trigger"}]),editDescriptionSpace:d}},DD={name:"QuotaSelect",props:{totalQuota:{type:Number,default:0},maxQuota:{type:Number,default:0}},emits:["selectedOptionChange"],setup(){return{selectedOption:W(void 0),options:W([])}},computed:{quotaLimit(){return this.maxQuota||1e15},DEFAULT_OPTIONS(){return[{value:Math.pow(10,9),displayValue:this.getFormattedFileSize(Math.pow(10,9))},{value:2*Math.pow(10,9),displayValue:this.getFormattedFileSize(2*Math.pow(10,9))},{value:5*Math.pow(10,9),displayValue:this.getFormattedFileSize(5*Math.pow(10,9))},{value:10*Math.pow(10,9),displayValue:this.getFormattedFileSize(10*Math.pow(10,9))},{value:50*Math.pow(10,9),displayValue:this.getFormattedFileSize(50*Math.pow(10,9))},{value:100*Math.pow(10,9),displayValue:this.getFormattedFileSize(100*Math.pow(10,9))},{displayValue:this.$gettext("No restriction"),value:0}]}},watch:{totalQuota(){const e=this.options.find(t=>t.value===this.totalQuota);e&&(this.selectedOption=e)}},mounted(){this.setOptions(),this.selectedOption=this.options.find(e=>e.value===this.totalQuota)},methods:{onUpdate(e){this.selectedOption=e,this.$emit("selectedOptionChange",this.selectedOption)},optionSelectable(e){return e.selectable!==!1},isValueValidNumber(e){return rt.isNumber(e)?e>0:/^[0-9]\d*(([.,])\d+)?$/g.test(e)},createOption(e){if(e=e.replace(",","."),!this.isValueValidNumber(e))return{displayValue:e,value:e,error:this.$gettext("Please enter only numbers"),selectable:!1};const t=parseFloat(e)*Math.pow(10,9);return t>this.quotaLimit?{value:t,displayValue:this.getFormattedFileSize(t),error:this.$gettext("Please enter a value equal to or less than %{ quotaLimit }",{quotaLimit:this.getFormattedFileSize(this.quotaLimit).toString()}),selectable:!1}:{value:t,displayValue:this.getFormattedFileSize(t)}},setOptions(){let e=[...this.DEFAULT_OPTIONS];this.maxQuota&&(e=e.filter(n=>this.totalQuota===0&&n.value===0?(n.selectable=!1,!0):n.value!==0&&n.value<=this.maxQuota)),e.find(n=>n.value===this.totalQuota)||e.push({displayValue:this.getFormattedFileSize(this.totalQuota),value:this.totalQuota,selectable:this.totalQuota<=this.quotaLimit}),e=[...e.filter(n=>n.value).sort((n,r)=>n.value-r.value),...e.filter(n=>!n.value)],this.options=e},getFormattedFileSize(e){const t=Ht(e,this.$language.current);return this.isValueValidNumber(e)?t:e.toString()}}},PD={class:"quota-select-batch-action-form"},ID=["textContent"],FD={class:"flex justify-between"},$D=["textContent"],OD={key:0,class:"oc-text-input-danger"};function LD(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-select");return I(),G("div",PD,[J(l,pt({ref:"select","model-value":r.selectedOption,selectable:s.optionSelectable,taggable:"","push-tags":"",clearable:!1,options:r.options,"create-option":s.createOption,"option-label":"displayValue",label:e.$gettext("Quota")},e.$attrs,{"onUpdate:modelValue":s.onUpdate}),{"selected-option":Z(({displayValue:u})=>[e.$attrs["read-only"]?(I(),re(i,{key:0,name:"lock",class:"mr-1",size:"small"})):le("",!0),Q("span",{textContent:R.toDisplayString(u)},null,8,ID)]),search:Z(({attributes:u,events:d})=>[Q("input",pt({class:"vs__search"},u,Gs(d,!0)),null,16)]),option:Z(({displayValue:u,error:d})=>[Q("div",FD,[Q("span",{textContent:R.toDisplayString(u)},null,8,$D)]),d?(I(),G("div",OD,R.toDisplayString(d),1)):le("",!0)]),_:1},16,["model-value","selectable","options","create-option","label","onUpdate:modelValue"])])}const Qm=Le(DD,[["render",LD]]),_D={key:0,class:"mt-2"},MD=["textContent"],Km=ge({__name:"QuotaModal",props:{modal:{},spaces:{},warningMessage:{default:""},warningMessageContextualHelperData:{default:()=>{}},resourceType:{default:"space"}},emits:["update:confirmDisabled"],setup(e,{expose:t,emit:n}){const r=n,{showMessage:o,showErrorMessage:s}=Me(),{$gettext:i,$ngettext:l}=me.useGettext(),u=Pe(),d=Re(),c=He(),p=Dt(),{spacesMaxQuota:f}=we.storeToRefs(p),{updateResourceField:h}=De(),g=W(e.spaces[0]?.spaceQuota?.total||0),m=y=>e.resourceType==="space"?l("Space quota was changed successfully","Quota of %{count} spaces was changed successfully",y,{count:y.toString()}):e.resourceType==="user"?l("User quota was changed successfully","Quota of %{count} users was changed successfully",y,{count:y.toString()}):i("Quota was changed successfully"),w=y=>e.resourceType==="space"?l("Failed to change space quota","Failed to change quota for %{count} spaces",y,{count:y.toString()}):e.resourceType==="user"?l("Failed to change user quota","Failed to change quota for %{count} users",y,{count:y.toString()}):i("Failed to change quota"),T=A(()=>!e.spaces.some(y=>y.spaceQuota.total!==a(g)));Ue(T,()=>{r("update:confirmDisabled",a(T))},{immediate:!0});const k=y=>{g.value=y.value};return t({onConfirm:async()=>{const y=u.graphAuthenticated,E=e.spaces.map(async L=>{const V=await y.drives.updateDrive(L.id,{name:L.name,quota:{total:a(g)}});a(d.currentRoute).name==="admin-settings-spaces"&&ze.publish("app.admin-settings.spaces.space.quota.updated",{spaceId:L.id,quota:V.spaceQuota}),a(d.currentRoute).name==="admin-settings-users"&&ze.publish("app.admin-settings.users.user.quota.updated",{spaceId:L.id,quota:V.spaceQuota}),c.updateSpaceField({id:L.id,field:"spaceQuota",value:V.spaceQuota}),h({id:L.id,field:"spaceQuota",value:V.spaceQuota})}),D=await Promise.allSettled(E),$=D.filter(Nr);$.length&&o({title:m($.length)});const _=D.filter(Br);_.length&&(console.error(_),_.forEach(console.error),s({title:w(_.length),errors:_.map(L=>L.reason)}))}}),(y,E)=>{const D=oe("oc-contextual-helper");return I(),G(Ae,null,[J(Qm,{"total-quota":g.value,"max-quota":a(f),"position-fixed":!0,onSelectedOptionChange:k},null,8,["total-quota","max-quota"]),e.warningMessage?(I(),G("div",_D,[Q("span",{class:"oc-text-input-warning",textContent:R.toDisplayString(e.warningMessage)},null,8,MD),e.warningMessageContextualHelperData?(I(),re(D,pt({key:0,class:"pl-1"},e.warningMessageContextualHelperData),null,16)):le("",!0)])):le("",!0)],64)}}}),Gm=()=>{const{dispatchModal:e}=Je(),{$gettext:t}=me.useGettext(),n=Bt(),r=({resources:i})=>i.length===1?t("Change quota for Space »%{name}«",{name:i[0].name}):t("Change quota for %{count} Spaces",{count:i.length.toString()}),o=({resources:i})=>{e({title:r({resources:i}),customComponent:Km,customComponentAttrs:()=>({spaces:i,resourceType:"space"})})};return{actions:A(()=>[{name:"editQuota",icon:"cloud",label:()=>t("Edit quota"),handler:o,isVisible:({resources:i})=>!i||!i.length||i.some(l=>!z.isProjectSpaceResource(l)||z.isSpaceResource(l)&&!l.spaceQuota)?!1:n.can("set-quota-all","Drive"),class:"oc-files-actions-edit-quota-trigger"}])}};function Jm(){const{triggerDefaultAction:e}=An();return{openWithDefaultApp:({space:n,resource:r})=>{if(!r||r.isFolder)return;e({...{resources:[r],space:n},omitSystemActions:!0})}}}const ND=()=>{const e=Pe(),{openWithDefaultApp:t}=Jm(),{createDefaultMetaFolder:n}=go(),r=et(),o=He(),{$gettext:s}=me.useGettext(),{getDefaultMetaFolder:i}=Fi(),l=async(c,p)=>{const f=await e.webdav.putFileContents(c,{path:".space/readme.md",parentFolderId:p.id,fileName:"readme.md"}),h=await e.graphAuthenticated.drives.updateDrive(c.id,{name:c.name,special:[{specialFolder:{name:"readme"},id:f.id}]});return o.updateSpaceField({id:c.id,field:"spaceReadmeData",value:h.spaceReadmeData}),f},u=async({resources:c})=>{let p=null,f=await i(c[0]);if(f||(f=await n(c[0]),p=await l(c[0],f)),!p){const h=z.getRelativeSpecialFolderSpacePath(c[0],"readme");h?p=await e.webdav.getFileInfo(c[0],{path:h}):p=await l(c[0],f)}t({space:c[0],resource:p})};return{actions:A(()=>[{name:"editReadmeContent",icon:"article",label:()=>s("Edit description"),handler:u,isVisible:({resources:c})=>c.length!==1?!1:c[0].canEditReadme({user:r.user}),class:"oc-files-actions-edit-readme-content-trigger"}])}},Xm=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=et(),{$gettext:r}=me.useGettext(),o=Bt(),s=Pe(),i=St(),{isSpaceNameValid:l}=Qr(),{dispatchModal:u}=Je(),d=He(),c=(h,g)=>s.graphAuthenticated.drives.updateDrive(h.id,{name:g}).then(()=>{a(i).name==="admin-settings-spaces"&&(h.name=g),d.updateSpaceField({id:h.id,field:"name",value:g}),e({title:r("Space name was changed successfully")})}).catch(w=>{console.error(w),t({title:r("Failed to rename space"),errors:[w]})}),p=({resources:h})=>{h.length===1&&u({title:r("Rename space »%{name}«",{name:h[0].name}),confirmText:r("Rename"),hasInput:!0,inputLabel:r("Space name"),inputValue:h[0].name,inputRequiredMark:!0,onConfirm:g=>c(h[0],g),onInput:(g,m)=>{const{isValid:w,error:T}=l(g);m(w?null:T)}})};return{actions:A(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:p,isVisible:({resources:h})=>h.length!==1?!1:h[0].canRename({user:n.user,ability:o}),class:"oc-files-actions-rename-trigger"}]),renameSpace:c}},Ym=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=et(),{$gettext:r,$ngettext:o}=me.useGettext(),s=Bt(),i=Pe(),l=Ut(),u=St(),{dispatchModal:d}=Je(),c=He(),p=m=>m.filter(w=>z.isProjectSpaceResource(w)&&w.canRestore({user:n.user,ability:s})),f=async m=>{const w=i.graphAuthenticated,T=m.map(E=>w.drives.updateDrive(E.id,{name:E.name},{headers:{Restore:"true"}}).then(D=>(a(u).name==="admin-settings-spaces"&&(E.disabled=!1,E.spaceQuota=D.spaceQuota),c.updateSpaceField({id:E.id,field:"disabled",value:!1}),!0))),k=await l.addTask(()=>Promise.allSettled(T));await c.loadGraphPermissions({ids:m.map(E=>E.id),graphClient:w});const S=k.filter(Nr);if(S.length){const E=S.length===1&&m.length===1?r("Space »%{space}« was enabled successfully",{space:m[0].name}):o("%{spaceCount} space was enabled successfully","%{spaceCount} spaces were enabled successfully",S.length,{spaceCount:S.length.toString()},!0);e({title:E})}const y=k.filter(Br);if(y.length){y.forEach(console.error);const E=y.length===1&&m.length===1?r("Failed to enable space »%{space}«",{space:m[0].name}):o("Failed to enable %{spaceCount} space","Failed to enable %{spaceCount} spaces",y.length,{spaceCount:y.length.toString()},!0);t({title:E,errors:y.map(D=>D.reason)})}},h=({resources:m})=>{const w=p(m);if(!w.length)return;const T=o("If you enable the selected space, it can be accessed again.","If you enable the %{count} selected spaces, they can be accessed again.",w.length,{count:w.length.toString()}),k=r("Enable");d({title:o("Enable Space »%{space}«?","Enable %{spaceCount} Spaces?",w.length,{space:w[0].name,spaceCount:w.length.toString()}),confirmText:k,message:T,hasInput:!1,onConfirm:()=>f(w)})};return{actions:A(()=>[{name:"restore",icon:"play-circle",label:()=>r("Enable"),handler:h,isVisible:({resources:m})=>!!p(m).length,class:"oc-files-actions-restore-trigger"}]),restoreSpaces:f}},BD=()=>{const{$gettext:e}=me.useGettext(),t=De(),{openSideBarPanel:n}=_t(),r=({resources:s})=>{t.setSelection(s.map(({id:i})=>i)),n("space-share")};return{actions:A(()=>[{name:"show-members",icon:"group",label:()=>e("Members"),handler:r,isVisible:({resources:s})=>s.length===1&&!s[0].disabled,class:"oc-files-actions-show-details-trigger"}])}},jD=()=>{const e=Re(),{$gettext:t}=me.useGettext(),n=o=>wr("files-trash-generic",{..._n(o,{fileId:o.fileId})});return{actions:A(()=>[{name:"navigateToTrash",icon:"delete-bin-5",label:()=>t("Open trash bin"),handler:({resources:o})=>{e.push(n(o[0]))},isVisible:({resources:o})=>!(o.length!==1||!z.isProjectSpaceResource(o[0])&&!z.isPersonalSpaceResource(o[0])||o[0].disabled),class:"oc-files-actions-navigate-to-trash-trigger"}])}},zD=ge({name:"EmojiPickerModal",components:{},props:{modal:{type:Object,required:!0}},emits:["confirm"],setup(e,{emit:t}){const n=Bn(),{currentTheme:r}=we.storeToRefs(n),o=A(()=>a(r).isDark?"dark":"light");return{onEmojiSelect:i=>{t("confirm",i)},theme:o}}});function UD(e,t,n,r,o,s){const i=oe("oc-emoji-picker");return I(),re(i,{theme:e.theme,onEmojiSelect:e.onEmojiSelect},null,8,["theme","onEmojiSelect"])}const Zm=Le(zD,[["render",UD]]),VD=()=>{const e=et(),{showMessage:t,showErrorMessage:n}=Me(),{$gettext:r}=me.useGettext(),o=Pe(),s=Ut(),i=He(),{createDefaultMetaFolder:l}=go(),{dispatchModal:u}=Je(),{getDefaultMetaFolder:d}=Fi(),c=({resources:g})=>{g.length===1&&u({elementClass:"w-auto",title:r("Set icon for »%{space}«",{space:g[0].name}),hideConfirmButton:!0,customComponent:Zm,focusTrapInitial:!1,onConfirm:m=>f(g[0],m)})},p=async g=>{const m=document.createElement("canvas"),w=m.getContext("2d"),T=16/9,k=720,S=k/T;m.width=k,m.height=S;const y=.4*k;w.font=`${y}px sans-serif`,w.textBaseline="middle",w.textAlign="center",w.fillText(g,m.width/2,m.height/2+15);const D=await wp(m);return bp(D)},f=async(g,m)=>{const w=o.graphAuthenticated,T=await p(m);let k=await d(g);return k||(k=await l(g)),s.addTask(async()=>{const S={"Content-Type":"application/offset+octet-stream"};try{const{fileId:y}=await o.webdav.putFileContents(g,{parentFolderId:k.id,fileName:"image.png",content:T,headers:S,overwrite:!0}),E=await w.drives.updateDrive(g.id,{name:g.name,special:[{specialFolder:{name:"image"},id:y}]});i.updateSpaceField({id:g.id,field:"spaceImageData",value:E.spaceImageData}),t({title:r("Space icon was set successfully")}),ze.publish("app.files.spaces.uploaded-image",E)}catch(y){if(console.error(y),y instanceof z.HttpError&&y.statusCode===507){n({title:r("Failed to set space icon"),desc:r("Not enough quota to set the space icon"),errors:[y]});return}n({title:r("Failed to set space icon"),errors:[y]})}})};return{actions:A(()=>[{name:"set-space-icon",icon:"emoji-sticker",handler:c,label:()=>r("Set icon"),isVisible:({resources:g})=>g.length!==1?!1:g[0].canEditImage({user:e.user}),class:"oc-files-actions-set-space-icon-trigger"}]),setIconSpace:f}},qD=()=>{const e=et(),{$gettext:t}=me.useGettext(),{dispatchModal:n}=Je(),{graphAuthenticated:r,webdav:o}=Pe(),s=He(),{showMessage:i,showErrorMessage:l}=Me(),{defaultSpaceImageBlobURL:u}=we.storeToRefs(s),d=async({space:f})=>{try{await o.deleteFile(f,{path:".space/image.png"}),await r.drives.updateDrive(f.id,{name:f.name,special:[{specialFolder:{name:"image"},id:null}]}),s.updateSpaceField({id:f.id,field:"spaceImageData",value:null}),s.updateSpaceField({id:f.id,field:"thumbnail",value:a(u)}),i({title:t("Space image deleted successfully")})}catch(h){console.error(h),l({title:t("Failed to delete space image"),errors:[h]})}},c=({resources:f})=>{n({title:t("Delete »%{space}« image",{space:f[0].name}),confirmText:t("Delete"),onConfirm:()=>d({space:f[0]}),message:t("Are you sure you want to delete the image of »%{space}«?",{space:f[0].name})})};return{actions:A(()=>[{name:"delete-space-image",icon:"delete-bin",handler:c,label:()=>t("Delete image"),isVisible:({resources:f})=>f.length!==1||!f[0].spaceImageData?!1:f[0].canEditImage({user:e.user}),class:"oc-files-actions-delete-space-image-trigger"}]),deleteSpaceImage:d}},HD=()=>{const{$gettext:e}=me.useGettext(),{openSideBar:t}=_t();return{actions:A(()=>[{name:"show-details",icon:"information",label:()=>e("Details"),handler:()=>t(),isVisible:({resources:r})=>r.length>0,class:"oc-admin-settings-show-details-trigger"}])}},WD=()=>{const{getMatchingSpace:e}=It(),t=He(),n=Mn(),r=De(),o=Pe(),{$gettext:s}=me.useGettext(),{openEditor:i}=An(),{resources:l,currentFolder:u}=we.storeToRefs(r);return{openEmptyEditor:async(c,p)=>{let f=a(u)?e(a(u)):null,h=a(l),g=a(u)?.path;(!f||!a(u).canCreate())&&(f=t.personalSpace,h=(await o.webdav.listFiles(f)).children,g="");let m=s("New file")+`.${p}`;h.some(S=>S.name===m)&&(m=wn(m,p,h));const w=await o.webdav.putFileContents(f,{path:z.urlJoin(g,m)}),T=e(w),k=n.fileExtensions.find(({app:S,extension:y})=>S===c&&y===p);i(k,T,w)}}},eg=()=>{const{$gettext:e}=me.useGettext(),{showMessage:t}=Me();return{openUrl:(r,o,s)=>{const i=window.open(r,o);i?s&&i.focus():t({title:e("Pop-up and redirect block detected"),timeout:20,status:"warning",desc:e("Please turn on pop-ups and redirects in your browser settings to make sure everything works right.")})}}},QD=()=>er("$appProviderService"),KD=()=>{const{isResourceAccessible:e}=It();return{breadcrumbsFromPath:({route:r,space:o,resourcePath:s,ancestorMetaData:i=W({})})=>{const l=(c="")=>c.split("/").filter(Boolean),u=l(r.path),d=l(s);return d.map((c,p)=>{const f=z.urlJoin(...d.slice(0,p+1),{leadingSlash:!0}),h=e({space:a(o),path:f});let g;return h&&(g=a(i)[f]),{id:Ct.v4(),allowContextActions:!0,text:c,...h&&{to:{path:"/"+[...u].splice(0,u.length-d.length+p+1).join("/"),query:{...po(r.query,"page","fileId"),...g&&{fileId:g.id}}}},isStaticNav:!1}})},concatBreadcrumbs:(...r)=>{const o=r.pop();return[...r,{id:Ct.v4(),allowContextActions:o.allowContextActions,text:o.text,onClick:()=>ze.publish("app.files.list.load"),isTruncationPlaceholder:o.isTruncationPlaceholder,isStaticNav:o.isStaticNav}]}}},GD=(e="")=>{const t=W(0),n=async()=>{await xt();const r=document.querySelector(e||"#files-app-bar"),o=r?r.getBoundingClientRect().height:0;t.value!==o&&(t.value=o)};return window.onresize=n,yt(n),{y:t,refresh:n}},Ac=()=>{const e=W(!0),t=()=>{e.value=window.innerHeight>500};return yt(()=>{t(),window.addEventListener("resize",t)}),bn(()=>{window.removeEventListener("resize",t)}),{isSticky:e}};class Ao{static perPageDefault="100";static perPageQueryName="items-per-page";static options=["20","50","100","250","500"]}function JD(e){const t=Ds.useRouter(),n=Ds.useRoute(),r=XD(e),o=YD(e),s=A(()=>Math.ceil(a(e.items).length/a(o))||1),i=A(()=>{if(!a(o))return a(e.items);const l=(a(r)-1)*a(o),u=l+a(o);return a(e.items).slice(l,u)});return ze.subscribe("app.files.navigate.page",({resourceId:l,forceScroll:u,topbarElement:d})=>{const c=rt.findIndex(a(e.items),p=>p.id===l);if(c>=0){const p=Math.ceil((c+1)/Number(a(o)));t.push({...a(n),query:{...a(n).query,page:p}}).then(()=>{ze.publish("app.files.navigate.scrollTo",{resourceId:l,forceScroll:u,topbarElement:d})})}}),{items:i,total:s,page:r,perPage:o}}function XD(e){if(e.page)return A(()=>a(e.page));const t=Pt("page","1");return A(()=>parseInt(at(a(t))))}function YD(e){if(e.perPage)return A(()=>a(e.perPage));const t=nr({name:e.perPageQueryName||Ao.perPageQueryName,defaultValue:e.perPageDefault||Ao.perPageDefault,storagePrefix:e.perPageStoragePrefix});return A(()=>parseInt(at(a(t))))}const tg=()=>er("$passwordPolicyService");var sa=(e=>(e.mounted="portal-target.mounted",e))(sa||{});const ZD=()=>{const e=rr(),t=Rs.useWormhole();return{registerPortal:r=>{e.subscribe(sa.mounted,()=>{t.open(r)})}}},ng=()=>er("$previewService"),rg=()=>{const e=Mn();return{canBeOpenedWithSecureView:n=>e.fileExtensions.filter(({secureView:o})=>o).some(({mimeType:o})=>o===n.mimeType)}},og=()=>{const e=et();return{canListVersions:({space:n,resource:r})=>r.type==="folder"||z.isSpaceResource(r)||z.isTrashResource(r)?!1:n?.canListVersions({user:e.user})}},sg=()=>{const e=Pe(),t=He(),n=A(()=>t.spaces),r=u=>a(n).find(d=>u.toString().startsWith(d.id.toString())),o=u=>a(n).find(d=>z.isMountPointSpaceResource(d)&&d.root?.remoteItem?.id===u),s=(u,d)=>{const c=[Ee.FileId,Ee.FileParent,Ee.Name,Ee.ResourceType],p=z.buildSpace({id:u,name:""});return e.webdav.getFileInfo(p,{fileId:u},{davProperties:c,signal:d})},i=$t.useTask(function*(u,d){let c,p,f=r(d);if(f)return c=yield e.webdav.getPathForFileId(d,{signal:u}),p=yield e.webdav.getFileInfo(f,{path:c},{signal:u}),{space:f,resource:p,path:c};yield t.loadMountPoints({graphClient:e.graphAuthenticated,signal:u});let h=o(d);p=yield s(d,u);const g=h?[]:[a(p).name];let m=a(p);for(;!h;)m=yield s(m.parentFolderId,u),h=o(m.id),h||g.unshift(m.name);return f=t.getSpace(h.root?.remoteItem?.id)||t.createShareSpace({driveAliasPrefix:p.storageId?.startsWith(z.OCM_PROVIDER_ID)?"ocm-share":"share",id:h.root?.remoteItem?.id,shareName:h.name}),c=z.urlJoin(...g),{space:f,resource:p,path:c}}).restartable();return{getResourceContext:u=>i.perform(u)}},Ft={name:{table:"resource-table",condensedTable:"resource-table-condensed",tiles:"resource-tiles"},defaultModeName:"resource-tiles",queryName:"view-mode",tilesSizeDefault:2,tilesSizeMax:6,tilesSizeQueryName:"tiles-size"},eP=140,tP=84,ig=()=>{const e=W(eP),t=W(tP),n=o=>a(e)+(o-1)*a(t);return{calculateTileSizePixels:n,calculateTileSizeRem:o=>{const s=parseFloat(getComputedStyle(document.documentElement).fontSize);return n(o)/s}}};function nP(e){if(e)return A(()=>a(e));const t=nr({name:Ft.queryName,defaultValue:Ft.defaultModeName});return A(()=>at(a(t)))}function rP(e){if(e)return A(()=>parseInt(a(e)));const t=nr({name:Ft.tilesSizeQueryName,defaultValue:Ft.tilesSizeDefault.toString()});return A(()=>parseInt(at(a(t))))}const oP=W(Ft.tilesSizeMax);function Ec(){return oP}const Rc=e=>{const t=ng(),{updateResourceField:n}=De(),{httpAuthenticated:r}=Pe(),o=He(),{defaultSpaceImageBlobURL:s}=we.storeToRefs(o),i=Ge(),{serverUrl:l}=we.storeToRefs(i),u=new ur({concurrency:4}),d=A(()=>a(e)===Ft.name.tiles),c=A(()=>a(d)?Ci.enum.fit:Ci.enum.thumbnail),p=A(()=>a(d)?bs.Tile:bs.Thumbnail),f=$t.useTask(function*(w,{space:T,resource:k,dimensions:S,processor:y,updateStore:E=!0}){const D=z.isProjectSpaceResource(k)?z.buildSpaceImageResource(k):k,$=D.id===T.spaceImageData?.id;$&&o.addToImagesLoading(T.id);const _=yield u.add(()=>t.loadPreview({space:T,resource:D,processor:y||a(c),dimensions:S||a(p)},!0,!0,w));return _&&E&&n({id:k.id,field:"thumbnail",value:_}),$&&o.removeFromImagesLoading(T.id),_}),h=async w=>{const{resource:T,cancelRunning:k}=w;if(k&&m(),z.isProjectSpaceResource(T)&&(!T.spaceImageData||T.disabled)){a(s)&&o.updateSpaceField({id:T.id,field:"thumbnail",value:a(s)});try{const S=await r.get(`${a(l)}images/default-space-icon.png`,{responseType:"blob"});return o.setDefaultSpaceImageBlobURL(URL.createObjectURL(S.data)),o.updateSpaceField({id:T.id,field:"thumbnail",value:a(s)}),a(s)}catch{return null}}try{return await f.perform(w)}catch(S){S!=="cancel"&&console.error(S)}},g=A(()=>f.isRunning),m=()=>{f.cancelAll(),u.clear(),o.purgeImagesLoading()};return Qs(m),{loadPreview:h,previewsLoading:g}},ag=({showSizeInformation:e=!0}={})=>{const t=De(),{current:n,$gettext:r,$ngettext:o}=me.useGettext(),s=Re(),{resources:i,totalResourcesCount:l,areHiddenFilesShown:u,currentFolder:d}=we.storeToRefs(t),c=A(()=>{if(!a(d)?.size||a(d)?.size==="0"){const f=a(i).map(h=>h.size?parseInt(h.size.toString()):0).reduce((h,g)=>h+g,0);return Ht(f,n)}return Ht(a(d).size,n)});return{resourceContentsText:A(()=>{let f=o("%{ filesCount } file","%{ filesCount } files",a(l).files,{filesCount:a(l).files.toString()});!a(u)&&a(l).hiddenFiles&&(f=o("%{ filesCount } file including %{ filesHiddenCount } hidden","%{ filesCount } files including %{ filesHiddenCount } hidden",a(l).files,{filesCount:a(l).files.toString(),filesHiddenCount:a(l).hiddenFiles.toString()}));let h=o("%{ foldersCount } folder","%{ foldersCount } folders",a(l).folders,{foldersCount:a(l).folders.toString()});!a(u)&&a(l).hiddenFolders&&(h=o("%{ foldersCount } folder including %{ foldersHiddenCount } hidden","%{ foldersCount } folders including %{ foldersHiddenCount } hidden",a(l).folders,{foldersCount:a(l).folders.toString(),foldersHiddenCount:a(l).hiddenFolders.toString()}));const g=o("%{ spacesCount } space","%{ spacesCount } spaces",a(l).spaces,{spacesCount:a(l).spaces.toString()}),m=a(l).files+a(l).folders+a(l).spaces,w=e&&parseFloat(a(c))>0,T=mt(s,"files-shares-via-link"),k=r(w?"%{ itemsCount } item with %{ itemSize } in total":"%{ itemsCount } item in total"),S=r(w?"%{ itemsCount } items with %{ itemSize } in total":"%{ itemsCount } items in total"),y=T?"(%{ filesStr}, %{ foldersStr}, %{ spacesStr})":"(%{ filesStr}, %{ foldersStr})",E=`${k} ${y}`,D=`${S} ${y}`;return o(E,D,m,{itemsCount:m.toString(),itemSize:a(c),filesStr:f,foldersStr:h,spacesStr:g})})}},Dc=()=>{const{$gettext:e}=me.useGettext(),{interceptModifierClick:t}=zr(),{openSideBarPanel:n}=_t(),r=De(),o=et(),s=k=>z.ShareTypes.containsAnyValue(z.ShareTypes.authenticated,k??[]),i=k=>z.ShareTypes.containsAnyValue(z.ShareTypes.unauthenticated,k??[]),l=({isDirect:k})=>e(k?"This item is directly shared with others.":"This item is shared with others through one of the parent folders."),u=({isDirect:k})=>e(k?"This item is directly shared via links.":"This item is shared via links through one of the parent folders."),d=({resource:k,isDirect:S})=>({id:`files-sharing-${k.getDomSelector()}`,accessibleDescription:l({isDirect:S}),label:e("Show invited people"),icon:"group",category:"sharing",type:S?"user-direct":"user-indirect",fillType:"line",handler:(y,E)=>{E&&t(E,y)||n("sharing")}}),c=({resource:k})=>({id:`files-sharing-synced-${k.getDomSelector()}`,accessibleDescription:e("This item is synced with your devices"),label:e("Synced with your devices"),icon:"loop-right",category:"sharing",type:"resource-synced",fillType:"line"}),p=({resource:k})=>k.shareRoles?.length?{id:`files-sharing-role-${k.getDomSelector()}`,accessibleDescription:e(k.shareRoles[0].description),label:e(k.shareRoles[0].displayName),icon:k.shareRoles[0].icon,category:"sharing",type:"share-role",fillType:"line"}:{id:`files-sharing-role-${k.getDomSelector()}`,accessibleDescription:z.ShareTypes.remote.label,label:z.ShareTypes.remote.label,icon:z.ShareTypes.remote.icon,category:"sharing",type:"share-role",fillType:"line"},f=({resource:k,isDirect:S})=>({id:`file-link-${k.getDomSelector()}`,accessibleDescription:u({isDirect:S}),label:e("Show links"),icon:"link",category:"sharing",type:S?"link-direct":"link-indirect",fillType:"line",handler:()=>n("sharing")}),h=({resource:k})=>({id:`resource-locked-${k.getDomSelector()}`,accessibleDescription:e("Item locked"),label:e("This item is locked"),icon:"lock",category:"system",type:"resource-locked",fillType:"line"}),g=({resource:k})=>({id:`resource-processing-${k.getDomSelector()}`,accessibleDescription:e("Item in processing"),label:e("This item is in processing"),icon:"loop-right",category:"system",type:"resource-processing",fillType:"line"}),m=({resource:k})=>({id:`resource-space-enabled-${k.getDomSelector()}`,accessibleDescription:e("Space is enabled"),label:e("This space is enabled"),icon:"play-circle",category:"space",type:"resource-space-enabled",fillType:"line"}),w=({resource:k})=>({id:`resource-space-disabled-${k.getDomSelector()}`,accessibleDescription:e("Space is disabled"),label:e("This space is disabled"),icon:"stop-circle",category:"space",type:"resource-space-disabled",fillType:"line"});return{getIndicators:({space:k,resource:S})=>{const y=[];if(S.locked&&y.push(h({resource:S})),S.processing&&y.push(g({resource:S})),z.isProjectSpaceResource(S)&&!S.disabled&&y.push(m({resource:S})),z.isProjectSpaceResource(S)&&S.disabled&&y.push(w({resource:S})),z.isIncomingShareResource(S)&&(S.shareTypes.includes(z.ShareTypes.remote.value)||S.shareRoles?.length)&&y.push(p({resource:S})),z.isIncomingShareResource(S)&&S.syncEnabled&&y.push(c({resource:S})),z.isProjectSpaceResource(k)||z.isPersonalSpaceResource(k)&&k.isOwner(o.user)){const $=Object.values(r.ancestorMetaData).flatMap(({shareTypes:V})=>V),_=s(S.shareTypes);(_||s($))&&y.push(d({resource:S,isDirect:_}));const L=i(S.shareTypes);(L||i($))&&y.push(f({resource:S,isDirect:L}))}return y}}},lg=({isResourceSelected:e,isResourceDisabled:t,emit:n})=>{const r=rr(),{isMobile:o}=os(),{interceptModifierClick:s}=zr(),i=f=>{r.publish("app.files.list.clicked"),n("update:selectedIds",f)},l=xn(qt,"files-trash-overview"),u=f=>a(l)&&z.isProjectSpaceResource(f)&&f.disabled?!1:!t(f),d=f=>document.getElementById(`context-menu-trigger-${f.getDomSelector()}`);return{shouldShowContextDrop:u,showContextMenuOnBtnClick:(f,h)=>{const{dropdown:g,event:m}=f;if(m instanceof MouseEvent&&s(m,h))return;if(t(h))return!1;if(g?.tippy===void 0)return;const w=d(h);w&&(e(h)||i([h.id]),Ml(g.tippy,m,w))},showContextMenuOnRightClick:(f,h)=>{if(f instanceof MouseEvent&&s(f,h))return;if(f.preventDefault(),t(h))return!1;const g=d(h);if(g){if(e(h)||i([h.id]),a(o)){g.click();return}Ml(g._tippy,f,g)}}}},cg=({selectedIds:e,selectedResources:t,emit:n})=>{const r=De(),o=W(),s=nn("ghostElement"),i=async(f,h)=>{o.value=f,await xt(),a(s).$el.ariaHidden="true",a(s).$el.style.left="-99999px",a(s).$el.style.top="-99999px",h.dataTransfer.setDragImage(a(s).$el,0,0),h.dataTransfer.dropEffect="move",h.dataTransfer.effectAllowed="move"},l=async(f,h)=>{a(e).includes(f.id)||(r.toggleSelection(f.id),n("update:selectedIds",[...r.selectedIds])),await i(f,h)},u=A(()=>a(t).filter(({id:f})=>f!==a(o)?.id)),d=f=>(f.dataTransfer.types||[]).some(h=>h==="Files"),c=(f,h)=>{d(h)||(o.value=null,p(f,!0,h),n("fileDropped",f.id))},p=(f,h,g)=>{if(d(g)||g.currentTarget?.contains(g.relatedTarget)||a(e).includes(f.id)||f.type!=="folder")return;const m=document.querySelectorAll(`[data-item-id='${f.id}']`)?.[0];if(!m)return;const w="!bg-role-secondary-container";h?m.classList.remove(w):m.classList.add(w)};return{ghostElement:s,dragItem:o,dragSelection:u,dragStart:l,fileDropped:c,setDropStyling:p}},ug=({resources:e,disabledResources:t,selectedIds:n,emit:r})=>{const o=rr(),{$gettext:s}=me.useGettext(),i=p=>{o.publish("app.files.list.clicked"),r("update:selectedIds",p)},l=p=>{switch(p.type){case"folder":return s("Select folder");case"space":return s("Select space");default:return s("Select file")}},u=A(()=>{const p=a(t).length===a(e).length,f=a(n).length===a(e).length-a(t).length;return!p&&f}),d=A(()=>a(u)?s("Clear selection"):s("Select all"));return{getResourceCheckboxLabel:l,areAllResourcesSelected:u,selectAllCheckboxLabel:d,toggleSelectionAll:()=>{if(a(u))return i([]);i(a(e).filter(p=>!a(t).includes(p.id)).map(p=>p.id))}}},Pc=({space:e,resources:t,selectedIds:n,emit:r})=>{const o=De(),s=Re(),i=rr(),{interceptModifierClick:l}=zr(),{getMatchingSpace:u}=It(),{canBeOpenedWithSecureView:d}=rg(),{getDefaultAction:c}=An(),{isEnabled:p,fileTypes:f,isFilePicker:h,postMessage:g}=Tr(),m=ns(),{resources:w,action:T}=we.storeToRefs(m),k=A(()=>a(t).filter(O=>a(n).includes(O.id))),S=O=>a(n).includes(O.id),y=O=>o.deleteQueue.includes(O),E=O=>a(p)&&a(f)?.length?!a(f).includes(O.extension)&&!a(f).includes(O.mimeType)&&!O.isFolder:y(O.id)?!0:O.processing===!0,D=A(()=>a(t)?.filter(E)?.map(O=>O.id)||[]);return{selectedResources:k,disabledResources:D,isResourceSelected:S,isResourceInDeleteQueue:y,isResourceDisabled:E,isResourceClickable:(O,M)=>!M||z.isProjectSpaceResource(O)&&O.disabled||!O.isFolder&&!O.canDownload()&&!d(O)?!1:!E(O),isResourceCut:O=>a(T)!==Zo.Cut?!1:a(w).some(M=>M.id===O.id),fileContainerClicked:({resource:O,event:M})=>{if(E(O))return;if(a(p)&&a(h)&&!O.isFolder)return g("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(O)),locationQuery:JSON.parse(JSON.stringify(Ii(a(s.currentRoute))))});!M.shiftKey&&!M.metaKey&&!M.ctrlKey&&i.publish("app.files.shiftAnchor.reset");const N=M?.target;if(N?.closest("div")?.id==="oc-files-context-menu")return;if(M&&M.metaKey)return i.publish("app.files.list.clicked.meta",O);if(M&&M.shiftKey)return i.publish("app.files.list.clicked.shift",{resource:O,skipTargetSelection:!1});N.getAttribute("type")!=="checkbox"&&(S(O)||(i.publish("app.files.list.clicked"),r("update:selectedIds",[O.id])))},fileNameClicked:({resource:O,event:M})=>{if(!l(M,O)){if(a(p))return a(h)||r("update:selectedIds",[O.id]),a(h)&&!O.isFolder?g("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(O)),locationQuery:JSON.parse(JSON.stringify(Ii(a(s.currentRoute))))}):void 0;r("fileClick",{space:u(O),resources:[O]})}},fileCheckboxClicked:({resource:O,event:M})=>{l(M,O)||(o.toggleSelection(O.id),i.publish("app.files.list.clicked"),r("update:selectedIds",[...o.selectedIds]))},getResourceLink:O=>{let M=a(e);M||(M=u(O));const N=c({resources:[O],space:M});if(N?.route)return N.route({space:M,resources:[O]})},...cg({selectedIds:n,selectedResources:k,emit:r}),...lg({isResourceDisabled:E,isResourceSelected:S,emit:r}),...ug({resources:t,disabledResources:D,selectedIds:n,emit:r})}},Ic=()=>{const{getMatchingSpace:e}=It(),t=De(),n=A({get(){return t.selectedResources},set(i){t.setSelection(i.map(({id:l})=>l))}}),r=A({get(){return t.selectedIds},set(i){t.setSelection(i)}}),o=i=>a(r).includes(i.id),s=A(()=>{if(a(n).length!==1)return null;const i=a(n)[0];return e(i)});return{selectedResources:n,selectedResourcesIds:r,isResourceInSelection:o,selectedResourceSpace:s}};class Cs{static sortByQueryName="sort-by";static sortDirQueryName="sort-dir"}function sP(e){const t=Re(),n=iP(e),r=aP(e),o=A(()=>fg(a(n))||a(Fc(a(i))?.name)),s=A(()=>cP(a(r))||lP(a(o),a(i))),i=e.fields;return{items:A(()=>{const d=a(e.items);return a(o)?dg(d,a(i),a(o),a(s)):d}),sortBy:o,sortDir:s,handleSort:({sortBy:d,sortDir:c})=>t.replace({query:{...a(t.currentRoute).query,[a(e.sortByQueryName)||Cs.sortByQueryName]:d,[a(e.sortDirQueryName)||Cs.sortDirQueryName]:c}})}}function iP(e){return e.sortBy?ft(e.sortBy)?e.sortBy:W(e.sortBy):nr({name:a(e.sortByQueryName)||Cs.sortByQueryName,defaultValue:a(Fc(a(e.fields))?.name),storagePrefix:a(e.routeName)||a(jl())})}function aP(e){return e.sortDir?ft(e.sortDir)?e.sortDir:W(e.sortDir):nr({name:a(e.sortDirQueryName)||Cs.sortDirQueryName,defaultValue:a(Fc(a(e.fields))?.sortDir),storagePrefix:a(e.routeName)||a(jl())})}const Fc=e=>{const t=e.filter(n=>n.sortable);return t?t[0]:null},lP=(e,t)=>{const n=t.find(r=>r.name===e);return n&&n.sortDir?a(n.sortDir):Xe.Desc},dg=(e,t,n,r)=>{const o=t.find(l=>l.name===n);if(!o)return e;const{sortable:s}=o,i=new Intl.Collator(navigator.language,{sensitivity:"base",numeric:!0});if(n==="name"){const l=c=>c.type==="folder"&&!c.extension,u=[...e.filter(c=>l(c))].sort((c,p)=>$c(c,p,i,n,r,s)),d=[...e.filter(c=>!l(c))].sort((c,p)=>$c(c,p,i,n,r,s));return r===Xe.Asc?u.concat(d):d.concat(u)}return[...e].sort((l,u)=>$c(l,u,i,o.prop||o.name,r,s))},$c=(e,t,n,r,o,s)=>{let i=El(e,r),l=El(t,r);const u=o===Xe.Asc?1:-1;if(s)if(typeof s=="string"){const c=p=>p.map(f=>f[s]).join("");i=c(i),l=c(l)}else typeof s=="function"&&(i=s(i),l=s(l));return!isNaN(i)&&!isNaN(l)?(i-l)*u:n.compare((i||"").toString(),(l||"").toString())*u},fg=e=>Array.isArray(e)?e[0]:e,cP=e=>{switch(fg(e)){case Xe.Asc:return Xe.Asc;case Xe.Desc:return Xe.Desc}return null};function uP(e){const t=Dt(),n=Lr(),r=Pe(),o=me.useGettext(),s=A(()=>t.tusMaxChunkSize>0),i=()=>{const d={};return n.publicLinkPassword?d.Authorization="Basic "+gi.from(["public",n.publicLinkPassword].join(":")).toString("base64"):n.accessToken&&!n.publicLinkPassword&&(d.Authorization="Bearer "+n.accessToken),d["X-Request-ID"]=Ct.v4(),d["Accept-Language"]=o.current,d["Initiator-ID"]=r.initiatorId,d},l=A(()=>{const d={onBeforeRequest:(c,p)=>new Promise(f=>{const h=i();c.setHeader("Authorization",h.Authorization),c.setHeader("X-Request-ID",h["X-Request-ID"]),c.setHeader("Accept-Language",h["Accept-Language"]),c.setHeader("Initiator-ID",h["Initiator-ID"]),p?.isRemote&&c.setHeader("x-oc-mtime",(p?.data?.lastModified/1e3).toFixed(0)),f()}),chunkSize:t.tusMaxChunkSize||1/0,overridePatchMethod:t.tusHttpMethodOverride,uploadDataDuringCreation:t.tusExtension.includes("creation-with-upload")};return d.headers=c=>{if(c.xhrUpload||c?.isRemote)return{"x-oc-mtime":(c?.data?.lastModified/1e3).toFixed(0),...i()}},d}),u=A(()=>({timeout:6e4,endpoint:"",headers:d=>({"x-oc-mtime":(d?.data?.lastModified/1e3).toFixed(0),...i()})}));Ue([l,u],()=>{if(a(s)){e.uppyService.useTus(a(l));return}e.uppyService.useXhr(a(u))},{immediate:!0})}const pg=()=>{const e=Pe(),{addAvatar:t,getAvatar:n,avatarsQueue:r,pendingAvatarsRequests:o}=fi(),s=async l=>{try{const u=await e.graphAuthenticated.photos.getUserPhoto(l,{responseType:"blob"});t(l,URL.createObjectURL(u))}catch(u){u.response?.status===404&&t(l,null)}return n(l)};return{enqueueAvatar:l=>{if(n(l)!==void 0||o.has(l))return;const u=r.add(()=>s(l));o.set(l,u),u.finally(()=>o.delete(l))}}},dP=ge({name:"ActionMenuItem",props:{action:{type:Object,required:!0},actionOptions:{type:Object,required:!0},size:{type:String,required:!1,default:"medium"},appearance:{type:String,default:"raw"},shortcutHint:{type:Boolean,default:!0,required:!1},showTooltip:{type:Boolean,default:!1,required:!1},buttonClasses:{type:Array,default:()=>[]}},setup(e){const t=Ge(),{options:n}=we.storeToRefs(t),r=A(()=>Object.hasOwn(e.action,"route")?"router-link":Object.hasOwn(e.action,"href")?"a":(Object.hasOwn(e.action,"handler")||console.warn("ActionMenuItem: No handler, route or href callback found in action",e.action),"button")),o=A(()=>({...{appearance:e.action.appearance||e.appearance,...e.action.isDisabled&&{disabled:e.action.isDisabled(e.actionOptions)},...e.action.id&&{id:e.action.id}},...a(r)==="router-link"&&{to:e.action.route(e.actionOptions)},...a(r)==="a"&&{href:e.action.href(e.actionOptions)},...["router-link","a"].includes(a(r))&&{target:n.value.cernFeatures?"_blank":"_self"}})),s=A(()=>typeof e.action.icon=="function"?e.action.icon(e.actionOptions):e.action.icon);return{componentType:r,componentProps:o,actionIcon:s}},computed:{hasExternalImageIcon(){return this.actionIcon&&/^https?:\/\//i.test(this.actionIcon)},componentListeners(){if(typeof this.action.handler!="function")return{};const e=()=>this.action.handler({...this.actionOptions});return this.action.keepOpen?{click:t=>{t.stopPropagation(),e()}}:{click:e}}}}),fP={key:3,class:"oc-files-context-action-label flex flex-col","data-testid":"action-label"},pP=["textContent"],hP=["textContent"];function mP(e,t,n,r,o,s){const i=oe("oc-image"),l=oe("oc-icon"),u=oe("oc-button"),d=Lt("oc-tooltip");return je((I(),G("li",null,[je((I(),re(u,pt({type:e.componentType},e.componentProps,{class:[e.action.class,"action-menu-item","align-middle","w-full",...e.buttonClasses],"aria-label":e.componentProps.disabled?e.action.disabledTooltip?.(e.actionOptions)??e.action.label(e.actionOptions):e.action.label(e.actionOptions),"data-testid":"action-handler",size:e.size,"justify-content":"left"},Gs(e.componentListeners)),{default:Z(()=>[e.action.img?(I(),re(i,{key:0,"data-testid":"action-img",src:e.action.img,alt:"",class:"oc-icon oc-icon-m w-[22px]"},null,8,["src"])):e.hasExternalImageIcon?(I(),re(i,{key:1,"data-testid":"action-img",src:e.actionIcon,alt:"",class:"oc-icon oc-icon-m w-[22px]"},null,8,["src"])):e.actionIcon?(I(),re(l,{key:2,"data-testid":"action-icon",name:e.actionIcon,"fill-type":e.action.iconFillType||"line",size:e.size},null,8,["name","fill-type","size"])):le("",!0),e.action.hideLabel?le("",!0):(I(),G("span",fP,[Q("span",{class:"text-left",textContent:R.toDisplayString(e.action.label(e.actionOptions))},null,8,pP)])),e.action.shortcut&&e.shortcutHint?(I(),G("span",{key:4,class:"text-sm flex-row-reverse",textContent:R.toDisplayString(e.action.shortcut)},null,8,hP)):le("",!0)]),_:1},16,["type","class","aria-label","size"])),[[d,e.showTooltip||e.action.hideLabel?e.action.label(e.actionOptions):""]])])),[[d,e.componentProps.disabled?e.action.disabledTooltip?.(e.actionOptions):""]])}const ia=Le(dP,[["render",mP]]),gP=ge({name:"BatchActions",components:{ActionMenuItem:ia},props:{actions:{type:Array,required:!0},actionOptions:{type:Object,required:!0},limitedScreenSpace:{type:Boolean,default:!1,required:!1}}});function vP(e,t,n,r,o,s){const i=oe("action-menu-item"),l=oe("oc-list");return I(),G("div",null,[J(l,{id:"oc-appbar-batch-actions",class:R.normalizeClass(["block xl:flex xl:items-center",{"oc-appbar-batch-actions-squashed [&_.oc-files-context-action-label]:hidden":e.limitedScreenSpace}])},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.actions,(u,d)=>(I(),re(i,{key:`action-${d}`,action:u,"action-options":e.actionOptions,appearance:"raw",class:"batch-actions mr-2 float-left [&_.action-menu-item]:p-2 [&_.action-menu-item]:gap-1","shortcut-hint":!1,"show-tooltip":e.limitedScreenSpace},null,8,["action","action-options","show-tooltip"]))),128))]),_:1},8,["class"])])}const hg=Le(gP,[["render",vP]]),yP={class:"context-menu px-2"},bP={class:"inline-flex gap-2"},wP={class:"flex oc-files-context-action-label"},SP=["textContent"],mg=ge({__name:"ActionMenuDropItem",props:{menuSectionDrop:{},appearance:{},actionOptions:{}},setup(e){const t=_r(`oc-files-context-actions-${e.menuSectionDrop.name}-drop-`),n=_r(`oc-files-context-actions-${e.menuSectionDrop.name}-toggle-`);return(r,o)=>{const s=oe("oc-icon"),i=oe("oc-button"),l=oe("oc-list");return I(),G("li",yP,[J(i,{id:a(n),appearance:"raw","justify-content":"space-between","gap-size":"medium",class:"w-full flex justify-between","aria-expanded":"false"},{default:Z(()=>[Q("span",bP,[J(s,{name:e.menuSectionDrop.icon,size:"medium","fill-type":"line"},null,8,["name"]),Q("span",wP,[Q("span",{textContent:R.toDisplayString(e.menuSectionDrop.label)},null,8,SP)])]),J(s,{name:"arrow-right-s",size:"small","fill-type":"line"})]),_:1},8,["id"]),J(a(gE),{title:e.menuSectionDrop.label,"drop-id":a(t),toggle:`#${a(n)}`,"is-nested-element":!0,mode:"hover",class:"w-3xs oc-files-context-action-drop","padding-size":"small",position:"auto-start","close-on-click":""},{default:Z(()=>[e.menuSectionDrop.items.length?(I(),re(l,{key:0},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.menuSectionDrop.items,(u,d)=>(I(),re(ia,{key:`section-${e.menuSectionDrop.label}-action-${d}`,action:u,appearance:e.appearance,"action-options":e.actionOptions},null,8,["action","appearance","action-options"]))),128))]),_:1})):le("",!0)]),_:1},8,["title","drop-id","toggle"])])}}}),TP=ge({name:"ContextActionMenu",components:{ActionMenuDropItem:mg,ActionMenuItem:ia},props:{menuSections:{type:Array,required:!0},appearance:{type:String,default:"raw"},actionOptions:{type:Object,required:!0}},methods:{getSectionClasses(e){const t=[];return this.menuSections.length&&(e<this.menuSections.length-1&&t.push("pb-2"),e>0&&t.push("pt-2"),e<this.menuSections.length-1&&t.push("border-b")),t}}}),kP={id:"oc-files-context-menu"};function CP(e,t,n,r,o,s){const i=oe("action-menu-item"),l=oe("action-menu-drop-item"),u=oe("oc-list");return I(),G("div",kP,[(I(!0),G(Ae,null,Ye(e.menuSections,(d,c)=>(I(),re(u,{id:`oc-files-context-actions-${d.name}`,key:`section-${d.name}-list`,class:R.normalizeClass(["[&_li]:px-0",e.getSectionClasses(c)])},{default:Z(()=>[d.items?(I(!0),G(Ae,{key:0},Ye(d.items,(p,f)=>(I(),re(i,{key:`section-${d.name}-action-${f}`,action:p,appearance:e.appearance,"action-options":e.actionOptions,class:"context-menu"},null,8,["action","appearance","action-options"]))),128)):le("",!0),(I(!0),G(Ae,null,Ye(d.dropItems,p=>(I(),G(Ae,null,[p.items.length?(I(),re(l,{key:p.name,"menu-section-drop":p,appearance:e.appearance,"action-options":e.actionOptions},null,8,["menu-section-drop","appearance","action-options"])):le("",!0)],64))),256))]),_:2},1032,["id","class"]))),128))])}const aa=Le(TP,[["render",CP]]),xP=ge({name:"ContextActions",components:{ContextActionMenu:aa},props:{actionOptions:{type:Object,required:!0}},setup(e){const{getAllOpenWithActions:t}=An(),{$gettext:n}=me.useGettext(),{actions:r}=Pm(),{actions:o}=ea(),{actions:s}=ra(),{actions:i}=Oi(),{actions:l}=Kl(),{actions:u}=Yi(),{actions:d}=Ts(),{actions:c}=Zi(),{actions:p}=xo(),{actions:f}=Tc(),{actions:h}=ta(),{actions:g}=Om(),{actions:m}=na(),{actions:w}=ks(),{actions:T}=Nm(),{actions:k}=Cc(),{actions:S}=wc(),{actions:y}=xc(),E=ho(),D=A(()=>E.requestExtensions({id:"global.files.context-actions",extensionType:"action"}).map(j=>j.action)),$=A(()=>E.requestExtensions({id:"global.files.batch-actions",extensionType:"action"}).map(j=>j.action)),_=wv(e,"actionOptions"),L=A(()=>[...a(o),...a(u),...a(c),...a(h),...a(i),...a(d),...a(w),...a(S),...a($).filter(j=>j.category==="actions"||rt.isNil(j.category))].filter(j=>j.isVisible(a(_)))),V=A(()=>[...a(k),...a($).filter(j=>j.category==="sidebar")].filter(j=>j.isVisible(a(_)))),te=A(()=>a(r).filter(j=>j.isVisible(a(_))).sort((j,H)=>Number(H.hasPriority)-Number(j.hasPriority))),B=A(()=>t({...a(_),omitSystemActions:!0}).filter(j=>j.isVisible(a(_))).sort((j,H)=>Number(H.hasPriority)-Number(j.hasPriority))),O=A(()=>[...a(y),...a(l),...a(D).filter(j=>j.category==="share")].filter(j=>j.isVisible(a(_)))),M=A(()=>[...a(c),...a(p),...a(d),...a(h),...a(i),...a(g),...a(m),...a(S),...a(w),...a(o),...a(u),...a(s),...a(T),...a(D).filter(j=>j.category==="actions"||rt.isNil(j.category))].filter(j=>j.isVisible(a(_)))),N=A(()=>[...a(f).map(j=>(j.keepOpen=!0,j)),...a(k),...a(D).filter(j=>j.category==="sidebar")].filter(j=>j.isVisible(a(_))));return{menuSections:A(()=>{const j=[];return a(_).resources.length>1?(a(L).length&&j.push({name:"batch-actions",items:[...a(L)]}),j.push({name:"batch-details",items:[...a(V)]}),j):([...a(te),...a(B)].length&&j.push({name:"context",items:[...a(te)],dropItems:[{label:n("Open with..."),name:"open-with",icon:"apps",items:[...a(B)]}]}),a(O).length&&j.push({name:"share",items:a(O)}),a(M).length&&j.push({name:"actions",items:a(M)}),a(N).length&&j.push({name:"sidebar",items:a(N)}),j)})}}});function AP(e,t,n,r,o,s){const i=oe("context-action-menu");return I(),re(i,{"menu-sections":e.menuSections,"action-options":e.actionOptions},null,8,["menu-sections","action-options"])}const gg=Le(xP,[["render",AP]]),EP={class:"flex items-center"},RP={class:"flex justify-between w-full"},DP={class:"flex items-center"},PP=["textContent"],IP={key:0,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},FP={key:1,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},$P={key:2,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},OP={key:3,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},LP={key:4,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},_P={key:5,class:"mt-2 mb-4 last:mb-0 flex justify-between items-center [&>*]:flex [&>*]:justify-between"},MP=["textContent"],NP=["max"],vg=Le(ge({__name:"ViewOptions",props:{perPageStoragePrefix:{},hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},paginationOptions:{default:()=>Ao.options},perPageQueryName:{default:()=>Ao.perPageQueryName},perPageDefault:{default:()=>Ao.perPageDefault},viewModeDefault:{default:()=>Ft.defaultModeName},viewModes:{default:()=>[]}},setup(e){const t=Re(),n=St(),{$gettext:r}=me.useGettext(),o=_t(),{isSideBarOpen:s}=we.storeToRefs(o),i=De(),{setAreHiddenFilesShown:l,setAreFileExtensionsShown:u,setAreDisabledSpacesShown:d,setAreEmptyTrashesShown:c}=i,{areHiddenFilesShown:p,areFileExtensionsShown:f,areDisabledSpacesShown:h,areEmptyTrashesShown:g}=we.storeToRefs(i),m=W(!1),w=xn(st,"files-spaces-projects"),T=xn(qt,"files-trash-overview"),k=Pt("page"),S=A(()=>a(k)?parseInt(at(a(k))):1),y=nr({name:e.perPageQueryName,defaultValue:e.perPageDefault,storagePrefix:e.perPageStoragePrefix}),E=nr({name:Ft.queryName,defaultValue:e.viewModeDefault}),D=nr({name:Ft.tilesSizeQueryName,defaultValue:Ft.tilesSizeDefault.toString()}),$=H=>t.replace({query:{...a(n).query,[e.perPageQueryName]:H.toString(),...a(S)>1&&{page:"1"}}}),_=H=>{E.value=H.name};Ue([y,E,D],H=>{m.value=H.some(se=>!se)},{immediate:!0,deep:!0});const L=Ec(),V=A({get(){return a(p)},set(H){l(H)}}),te=A({get(){return a(f)},set(H){u(H)}}),B=A({get(){return a(h)},set(H){d(H)}}),O=A({get(){return a(g)},set(H){c(H)}}),M=H=>{V.value=H},N=H=>{te.value=H},q=H=>{B.value=H},j=H=>{O.value=H};return(H,se)=>{const Y=oe("oc-icon"),ae=oe("oc-button"),ne=oe("oc-list"),pe=oe("oc-drop"),fe=oe("oc-switch"),be=oe("oc-page-size"),xe=Lt("oc-tooltip");return I(),G("div",EP,[e.viewModes.length?(I(),G(Ae,{key:0},[je((I(),re(ae,{id:"mobile-viewmode-switch-toggle","aria-label":a(r)("Switch view mode"),appearance:"raw",class:R.normalizeClass(["my-2 mx-1 p-1 align-middle",{"sm:hidden":!a(s),"md:hidden":a(s)}])},{default:Z(()=>[J(Y,{name:"list-view","fill-type":"none"})]),_:1},8,["aria-label","class"])),[[xe,a(r)("Switch view mode")]]),J(pe,{title:a(r)("View mode"),"drop-id":"mobile-viewmode-switch-drop",toggle:"#mobile-viewmode-switch-toggle",class:"w-auto","padding-size":"medium","close-on-click":""},{default:Z(()=>[J(ne,null,{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.viewModes,he=>(I(),G("li",{key:he.name},[J(ae,{appearance:a(E)===he.name?"filled":"raw","color-role":a(E)===he.name?"secondaryContainer":"secondary","justify-content":"left",onClick:ie=>_(he)},{default:Z(()=>[Q("div",RP,[Q("span",DP,[J(Y,{name:he.icon.name,"fill-type":he.icon.fillType,size:"medium",class:"mr-1"},null,8,["name","fill-type"]),Q("span",{textContent:R.toDisplayString(he.label)},null,8,PP)]),a(E)===he.name?(I(),re(Y,{key:0,name:"check",size:"medium"})):le("",!0)])]),_:2},1032,["appearance","color-role","onClick"])]))),128))]),_:1})]),_:1},8,["title"])],64)):le("",!0),e.viewModes.length>1?(I(),G("div",{key:1,class:R.normalizeClass(["viewmode-switch-buttons oc-button-group hidden mr-2",{"sm:inline-flex":!a(s),"md:inline-flex":a(s)}])},[(I(!0),G(Ae,null,Ye(e.viewModes,he=>je((I(),re(ae,{key:he.name,"no-hover":a(E)===he.name,class:R.normalizeClass([he.name]),appearance:a(E)===he.name?"filled":"outline","color-role":a(E)===he.name?"secondaryContainer":"secondary","aria-label":a(r)("Switch to %{viewMode}",{viewMode:he.label}),onClick:ie=>_(he)},{default:Z(()=>[J(Y,{name:he.icon.name,"fill-type":he.icon.fillType,size:"small"},null,8,["name","fill-type"])]),_:2},1032,["no-hover","class","appearance","color-role","aria-label","onClick"])),[[xe,a(r)("Switch to %{viewMode}",{viewMode:he.label})]])),128))],2)):le("",!0),je((I(),re(ae,{id:"files-view-options-btn",key:"files-view-options-btn","data-testid":"files-view-options-btn","aria-label":a(r)("Display customization options of the files list"),appearance:"raw",class:"my-2 mx-1 p-1 align-middle"},{default:Z(()=>[J(Y,{name:"settings-3","fill-type":"line"})]),_:1},8,["aria-label"])),[[xe,a(r)("Display customization options of the files list")]]),J(pe,{title:a(r)("View options"),"drop-id":"files-view-options-drop",toggle:"#files-view-options-btn",mode:"click",class:"w-auto","padding-size":"medium"},{default:Z(()=>[J(ne,null,{default:Z(()=>[e.hasHiddenFiles?(I(),G("li",IP,[J(fe,{checked:V.value,"onUpdate:checked":[se[0]||(se[0]=he=>V.value=he),M],"data-testid":"files-switch-hidden-files",label:a(r)("Show hidden files")},null,8,["checked","label"])])):le("",!0),e.hasFileExtensions?(I(),G("li",FP,[J(fe,{checked:te.value,"onUpdate:checked":[se[1]||(se[1]=he=>te.value=he),N],"data-testid":"files-switch-files-extensions-files",label:a(r)("Show file extensions")},null,8,["checked","label"])])):le("",!0),e.hasPagination?(I(),G("li",$P,[m.value?le("",!0):(I(),re(be,{key:0,selected:a(at)(a(y)),"data-testid":"files-pagination-size",label:a(r)("Items per page"),options:e.paginationOptions,class:"files-pagination-size",onChange:$},null,8,["selected","label","options"]))])):le("",!0),a(w)?(I(),G("li",OP,[J(fe,{checked:B.value,"onUpdate:checked":[se[2]||(se[2]=he=>B.value=he),q],"data-testid":"files-switch-projects-show-disabled",label:a(r)("Show disabled Spaces")},null,8,["checked","label"])])):le("",!0),a(T)?(I(),G("li",LP,[J(fe,{checked:O.value,"onUpdate:checked":[se[3]||(se[3]=he=>O.value=he),j],"data-testid":"files-switch-projects-show-disabled",label:a(r)("Show empty trash bins")},null,8,["checked","label"])])):le("",!0),a(E)===a(Ft).name.tiles?(I(),G("li",_P,[Q("label",{for:"tiles-size-slider",textContent:R.toDisplayString(a(r)("Tile size"))},null,8,MP),je(Q("input",{id:"tiles-size-slider","onUpdate:modelValue":se[4]||(se[4]=he=>ft(D)?D.value=he:null),type:"range",min:1,max:a(L),class:"oc-range bg-role-surface-container-high rounded-sm outline-0 w-full max-w-[50%] h-1.5 hover:opacity-100 appearance-none","data-testid":"files-tiles-size-slider"},null,8,NP),[[Ua,a(D)]])])):le("",!0)]),_:1})]),_:1},8,["title"])])}}}),[["__scopeId","data-v-17fa8a66"]]),BP=ge({name:"AppBar",components:{BatchActions:hg,ContextActions:gg,ViewOptions:vg},props:{viewModeDefault:{type:String,required:!1,default:()=>Ft.defaultModeName},breadcrumbs:{type:Array,default:()=>[]},breadcrumbsContextActionsItems:{type:Array,default:()=>[]},viewModes:{type:Array,default:()=>[]},hasBulkActions:{type:Boolean,default:!1},hasViewOptions:{type:Boolean,default:!0},hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},showActionsOnSelection:{type:Boolean,default:!1},batchActionsLoading:{type:Boolean,default:!1},space:{type:Object,required:!1,default:null}},setup(e,{emit:t}){const n=He(),{$gettext:r}=me.useGettext(),{can:o}=Bt(),s=Re(),{requestExtensions:i}=ho(),{isSticky:l}=Ac(),u=_t(),{isSideBarOpen:d}=we.storeToRefs(u),c=De(),{selectedResources:p}=we.storeToRefs(c),f=A(()=>e.space),{actions:h}=ea(),{actions:g}=ra(),{actions:m}=Oi(),{actions:w}=Wm(),{actions:T}=Yi(),{actions:k}=Ts(),{actions:S}=Zi(),{actions:y}=xo(),{actions:E}=ta(),{actions:D}=ks(),{actions:$}=qm(),{actions:_}=Hm(),{actions:L}=Gm(),{actions:V}=Ym(),te=W(0),B=xn(bt,"files-common-search"),O=A(()=>Object.hasOwn(Ou(),"navigation")&&o("create-all","Share")),M=A(()=>{let fe=[...a(g),...a(h),...a(T),...a(S),...a(y),...a(E),...a(m),...a(k),...a(D)];B.value||(fe=[...fe,...a(w),...a(L),...a(V),...a($),...a(_)]);const be=i({id:"global.files.batch-actions",extensionType:"action"});return be.length&&(fe=[...fe,...be.map(xe=>xe.action)]),fe.filter(xe=>xe.isVisible({space:a(f),resources:c.selectedResources}))}),N=A(()=>n.spaces.filter(fe=>z.isPersonalSpaceResource(fe)||z.isProjectSpaceResource(fe))),q=Jn("isMobileWidth"),j=xn(qt,"files-trash-generic"),H=A(()=>!a(q)&&e.breadcrumbs.length?!0:a(j)&&a(N).length===1?!1:e.breadcrumbs.length>1),se=A(()=>a(j)&&a(N).length===1?e.breadcrumbs.length<=2:e.breadcrumbs.length<=1),Y=A(()=>a(f)&&(z.isProjectSpaceResource(a(f))||z.isShareSpaceResource(a(f)))?3:2),ae=fe=>{t(of,fe)},ne=nh("title"),pe=A(()=>a(ne)?r(a(ne)):a(f)?.name||"");return{router:s,hasSharesNavigation:O,batchActions:M,showBreadcrumb:H,showMobileNav:se,breadcrumbMaxWidth:te,breadcrumbTruncationOffset:Y,fileDroppedBreadcrumb:ae,pageTitle:pe,selectedResources:p,isSticky:l,isSideBarOpen:d}},data:function(){return{resizeObserver:new ResizeObserver(this.onResize),limitedScreenSpace:!1}},computed:{showContextActions(){return qc(this.breadcrumbs).allowContextActions},showBatchActions(){return this.hasBulkActions&&(this.selectedResources.length>=1||qt(this.router,"files-trash-generic"))},selectedResourcesAnnouncement(){return this.selectedResources.length===0?this.$gettext("No items selected."):this.$ngettext("%{ amount } item selected. Actions are available above the table.","%{ amount } items selected. Actions are available above the table.",this.selectedResources.length,{amount:this.selectedResources.length.toString()})}},mounted(){this.resizeObserver.observe(this.$refs.filesAppBar),window.addEventListener("resize",this.onResize)},beforeUnmount(){this.resizeObserver.unobserve(this.$refs.filesAppBar),window.removeEventListener("resize",this.onResize)},methods:{onResize(){const e=document.getElementById("web-content-main")?.getBoundingClientRect().width||0,t=document.getElementById("web-nav-sidebar")?.getBoundingClientRect().width||0,n=document.getElementById("app-sidebar")?.getBoundingClientRect().width||0,r=document.getElementById("files-app-bar-controls-right")?.clientWidth;this.breadcrumbMaxWidth=e-t-n-r,this.limitedScreenSpace=this.isSideBarOpen?window.innerWidth<=1280:window.innerWidth<=1e3}}}),jP={class:"files-topbar py-2 w-full"},zP=["textContent"],UP={key:3,id:"files-app-bar-controls-right",class:"flex"},VP={class:"files-app-bar-actions flex items-center justify-end mt-1 min-h-10 gap-2"},qP={class:"flex-1 flex justify-start items-center"},HP={key:1};function WP(e,t,n,r,o,s){const i=oe("oc-hidden-announcer"),l=oe("context-actions"),u=oe("oc-breadcrumb"),d=oe("portal-target"),c=oe("view-options"),p=oe("batch-actions"),f=oe("oc-spinner");return I(),G("div",{id:"files-app-bar",ref:"filesAppBar",class:R.normalizeClass(["px-4 bg-role-surface rounded-t-xl [display:inherit] top-0 z-20",{"files-app-bar-squashed":e.isSideBarOpen,sticky:e.isSticky}])},[Q("div",jP,[Q("h1",{class:"sr-only",textContent:R.toDisplayString(e.pageTitle)},null,8,zP),J(i,{announcement:e.selectedResourcesAnnouncement,level:"polite"},null,8,["announcement"]),Q("div",{class:R.normalizeClass(["flex items-center files-app-bar-controls min-h-13",{"justify-between":e.breadcrumbs.length||e.hasSharesNavigation,"justify-end":!e.breadcrumbs.length&&!e.hasSharesNavigation}])},[e.showBreadcrumb?(I(),re(u,{key:0,id:"files-breadcrumb","context-menu-padding":"small","show-context-actions":e.showContextActions,items:e.breadcrumbs,"max-width":e.breadcrumbMaxWidth,"truncation-offset":e.breadcrumbTruncationOffset,"mobile-breakpoint":e.isSideBarOpen?"md":"sm",onItemDroppedBreadcrumb:e.fileDroppedBreadcrumb},{contextMenu:Z(()=>[J(l,{"action-options":{space:e.space,resources:e.breadcrumbsContextActionsItems.filter(Boolean)}},null,8,["action-options"])]),_:1},8,["show-context-actions","items","max-width","truncation-offset","mobile-breakpoint","onItemDroppedBreadcrumb"])):le("",!0),e.showMobileNav?(I(),re(d,{key:1,name:"app.runtime.mobile.nav"})):le("",!0),e.hasSharesNavigation?Ce(e.$slots,"navigation",{key:2}):le("",!0),e.hasViewOptions?(I(),G("div",UP,[J(c,{"view-modes":e.viewModes,"has-hidden-files":e.hasHiddenFiles,"has-file-extensions":e.hasFileExtensions,"has-pagination":e.hasPagination,"per-page-storage-prefix":"files","view-mode-default":e.viewModeDefault},null,8,["view-modes","has-hidden-files","has-file-extensions","has-pagination","view-mode-default"])])):le("",!0)],2),Q("div",VP,[Q("div",qP,[Ce(e.$slots,"actions",{limitedScreenSpace:e.limitedScreenSpace}),e.showBatchActions&&!e.batchActionsLoading?(I(),re(p,{key:0,actions:e.batchActions,"action-options":{space:e.space,resources:e.selectedResources},"limited-screen-space":e.limitedScreenSpace},null,8,["actions","action-options","limited-screen-space"])):e.showBatchActions&&e.batchActionsLoading?(I(),G("div",HP,[J(f,{"aria-label":e.$gettext("Loading actions")},null,8,["aria-label"])])):le("",!0)])]),Ce(e.$slots,"content")])],2)}const QP=Le(BP,[["render",WP]]),KP=ge({name:"CreateSpace",props:{showLabel:{type:Boolean,default:!0}},emits:["spaceCreated"],setup(e,{emit:t}){const{showMessage:n,showErrorMessage:r}=Me(),{$gettext:o}=me.useGettext(),{createSpace:s}=go(),{isSpaceNameValid:i}=Qr(),{dispatchModal:l}=Je(),u=He(),{upsertResource:d}=De(),c=async f=>{try{const h=await s(f);d(h),u.upsertSpace(h),t("spaceCreated",h),n({title:o("Space was created successfully")})}catch(h){console.error(h),r({title:o("Creating space failed…"),errors:[h]})}};return{showCreateSpaceModal:()=>{l({title:o("Create a new space"),confirmText:o("Create"),hasInput:!0,inputLabel:o("Space name"),inputValue:o("New space"),inputRequiredMark:!0,onConfirm:f=>c(f),onInput:(f,h)=>{const{isValid:g,error:m}=i(f);h(g?null:m)}})}}}}),GP=["textContent"];function JP(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-button"),u=Lt("oc-tooltip");return je((I(),re(l,{id:"new-space-menu-btn","aria-label":e.showLabel?void 0:e.$gettext("New space"),appearance:"filled",onClick:e.showCreateSpaceModal},{default:Z(()=>[J(i,{name:"add"}),e.showLabel?(I(),G("span",{key:0,textContent:R.toDisplayString(e.$gettext("New Space"))},null,8,GP)):le("",!0)]),_:1},8,["aria-label","onClick"])),[[u,e.showLabel?void 0:e.$gettext("New space")]])}const XP=Le(KP,[["render",JP]]),YP={class:"oc-app-top-bar self-center flex col-[1/4] row-2 sm:col-2 sm:row-1 [&_.parent-folder]:text-role-on-chrome"},ZP={class:"pl-4 pr-1 my-2 mx-auto sm:m-0 inline-flex items-center justify-between bg-role-chrome border border-role-on-chrome rounded-lg h-10 gap-4 w-full sm:w-fit"},eI={class:"open-file-bar flex"},tI={class:"flex"},nI={key:1,class:"flex items-center","data-testid":"autosave-indicator"},yg=ge({__name:"AppTopBar",props:{dropDownMenuSections:{default:()=>[]},dropDownActionOptions:{default:()=>({space:null,resources:[]})},mainActions:{default:()=>[]},hasAutoSave:{type:Boolean,default:!0},isEditor:{type:Boolean,default:!1},resource:{default:null},isReadOnly:{type:Boolean,default:!0}},emits:["close"],setup(e){const{$gettext:t,current:n}=me.useGettext(),r=De(),o=Ge(),{getMatchingSpace:s}=It(),{getParentFolderName:i,getPathPrefix:l,getParentFolderLinkIconAdditionalAttributes:u}=Cr(),d=A(()=>r.areFileExtensionsShown),c=A(()=>t("Show context menu")),p=A(()=>e.isEditor&&e.hasAutoSave&&o.options.editor.autosaveEnabled),f=A(()=>{const m=vt.Duration.fromObject({seconds:o.options.editor.autosaveInterval},{locale:n});return t("Autosave (every %{ duration })",{duration:m.toHuman()})}),h=A(()=>s(e.resource)),g=A(()=>!z.isPublicSpaceResource(a(h)));return(m,w)=>{const T=oe("oc-icon"),k=oe("oc-button"),S=oe("oc-drop"),y=oe("portal"),E=Lt("oc-tooltip");return I(),re(y,{to:"app.runtime.header.left"},{default:Z(()=>[Q("div",YP,[Q("div",ZP,[Q("div",eI,[e.resource?(I(),re(Ss,{key:0,id:"app-top-bar-resource",class:"[&_.oc-resource-name]:max-w-60 xs:[&_.oc-resource-name]:max-w-full sm:[&_.oc-resource-name]:max-w-20 md:[&_.oc-resource-name]:max-w-60 [&_svg]:!fill-role-on-chrome [&_span]:text-role-on-chrome","is-thumbnail-displayed":!1,"is-extension-displayed":d.value,"path-prefix":a(l)(e.resource),resource:e.resource,"parent-folder-name":a(i)(e.resource),"parent-folder-link-icon-additional-attributes":a(u)(e.resource),"is-path-displayed":g.value,"is-resource-clickable":!1},null,8,["is-extension-displayed","path-prefix","resource","parent-folder-name","parent-folder-link-icon-additional-attributes","is-path-displayed"])):le("",!0)]),Q("div",tI,[e.dropDownMenuSections.length?(I(),G(Ae,{key:0},[je((I(),re(k,{id:"oc-openfile-contextmenu-trigger","aria-label":c.value,appearance:"raw-inverse","color-role":"chrome",class:"p-1"},{default:Z(()=>[J(T,{name:"more-2"})]),_:1},8,["aria-label"])),[[E,c.value]]),J(S,{"drop-id":"oc-openfile-contextmenu",mode:"click","padding-size":"small",toggle:"#oc-openfile-contextmenu-trigger","close-on-click":"",title:e.resource.name,onClick:w[0]||(w[0]=wt(()=>{},["stop","prevent"]))},{default:Z(()=>[J(aa,{"menu-sections":e.dropDownMenuSections,"action-options":e.dropDownActionOptions},null,8,["menu-sections","action-options"])]),_:1},8,["title"])],64)):le("",!0),p.value&&!e.isReadOnly?(I(),G("span",nI,[je(J(T,{"accessible-label":f.value,name:"refresh",color:"white",class:"ox-p-xs mx-1"},null,8,["accessible-label"]),[[E,f.value]])])):le("",!0),e.mainActions.length&&e.resource?(I(),re(aa,{key:2,"menu-sections":[{name:"main-actions",items:e.mainActions.filter(D=>D.isVisible()).map(D=>({...D,class:"p-1 text-role-on-chrome [&_svg]:!fill-role-on-chrome [&:hover:not(:disabled)_svg]:!fill-role-chrome",hideLabel:!0}))}],"action-options":{resources:[e.resource]},appearance:"raw-inverse","color-role":"chrome"},null,8,["menu-sections","action-options"])):le("",!0),J(k,{id:"app-top-bar-close",appearance:"raw-inverse","color-role":"chrome",class:"p-1","aria-label":a(t)("Close"),onClick:w[1]||(w[1]=D=>m.$emit("close"))},{default:Z(()=>[J(T,{name:"close"})]),_:1},8,["aria-label"])])])])]),_:1})}}}),rI=ge({name:"ErrorScreen",props:{message:{default:"",type:String,required:!1}}}),oI={class:"text-center flex justify-center items-center h-full"},sI={key:0,class:"text-xl"};function iI(e,t,n,r,o,s){const i=oe("oc-icon");return I(),G("div",oI,[J(i,{size:"xxlarge",name:"error-warning","fill-type":"line"}),e.message?(I(),G("p",sI,R.toDisplayString(e.message),1)):le("",!0)])}const aI=Le(rI,[["render",iI]]),lI=ge({name:"LoadingScreen"}),cI={class:"text-center flex justify-center items-center h-full"},uI=["textContent"];function dI(e,t,n,r,o,s){const i=oe("oc-spinner");return I(),G("div",cI,[J(i,{size:"xlarge"}),Q("p",{class:"sr-only",textContent:R.toDisplayString(e.$gettext("Loading app"))},null,8,uI)])}const fI=Le(lI,[["render",dI]]),pI=["id","data-testid","tabindex","inert"],hI={key:0,class:"sidebar-panel__header header grid grid-cols-[auto_1fr_auto] items-center pt-2 px-2"},mI={class:"col-start-2 text-center my-0 text-lg"},gI={key:0,class:"mt-4"},bg=Le(ge({__name:"SideBarPanels",props:{loading:{type:Boolean},availablePanels:{},panelContext:{},activePanel:{default:""}},emits:["selectPanel","close","closePanel"],setup(e,{emit:t}){const n=t,{$gettext:r}=me.useGettext(),o=A(()=>e.availablePanels.filter(S=>S.isVisible(e.panelContext)&&S.isRoot?.(e.panelContext))),s=A(()=>e.availablePanels.filter(S=>S.isVisible(e.panelContext)&&!S.isRoot?.(e.panelContext))),i=A(()=>a(o).length?[a(o)[0],...a(s)]:a(s)),l=A(()=>{const S=e.activePanel?.split("#")[0];return!S||!a(s).map(y=>y.name).includes(S)?null:S}),u=A(()=>a(l)!==null),d=A(()=>a(l)===null),c=W(null),p=S=>{c.value=S},f=A(()=>a(u)?a(l):a(o)[0].name),h=A(()=>a(o).length===1?r("Back to %{panel} panel",{panel:a(o)[0].title(e.panelContext)}):r("Back to main panels")),g=S=>{n("selectPanel",S)},m=()=>{n("selectPanel",null)},w=()=>{n("close")},T=S=>{p(a(f)),g(S)},k=()=>{p(a(f)),m(),n("closePanel")};return(S,y)=>{const E=oe("oc-spinner"),D=oe("oc-icon"),$=oe("oc-button"),_=Lt("oc-tooltip");return e.loading?(I(),re(E,{key:0,"aria-label":a(r)("Loading sidebar content")},null,8,["aria-label"])):(I(!0),G(Ae,{key:1},Ye(i.value,L=>(I(),G("div",{id:`sidebar-panel-${L.name}`,key:`panel-${L.name}`,"data-testid":`sidebar-panel-${L.name}`,tabindex:f.value===L.name?-1:null,class:R.normalizeClass(["sidebar-panel absolute top-0 grid grid-rows-[auto_auto_1fr] bg-role-surface w-full size-full max-w-full max-h-full motion-reduce:transition-none",{"is-root-panel transition-[right] duration-[0.4s,0s]":L.isRoot?.(e.panelContext),"is-active-sub-panel":u.value&&l.value===L.name,"is-active-root-panel transition-[right] duration-[0.4s,0s]":d.value&&L.isRoot?.(e.panelContext)}]),inert:f.value!==L.name},[[f.value,c.value].includes(L.name)?(I(),G("div",hI,[L.isRoot?.(e.panelContext)?le("",!0):je((I(),re($,{key:0,class:"header__back col-start-1 p-1",appearance:"raw","aria-label":h.value,onClick:k},{default:Z(()=>[J(D,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"])),[[_,h.value]]),Q("h2",mI,R.toDisplayString(L.title(e.panelContext)),1),J($,{appearance:"raw",class:"header__close col-start-3 p-1","aria-label":a(r)("Close file sidebar"),onClick:w},{default:Z(()=>[J(D,{name:"close"})]),_:1},8,["aria-label"])])):le("",!0),Q("div",null,[L.isRoot?.(e.panelContext)?Ce(S.$slots,"rootHeader",{key:0},void 0,!0):Ce(S.$slots,"subHeader",{key:1},void 0,!0)]),Q("div",{class:R.normalizeClass(["sidebar-panel__body flex flex-col p-2 overflow-y-auto overflow-x-hidden",[`sidebar-panel__body-${L.name}`]])},[Q("div",{class:R.normalizeClass(["sidebar-panel__body-content",{"flex-1 ":!L.isRoot?.(e.panelContext)}])},[Ce(S.$slots,"body",{},()=>[(I(!0),G(Ae,null,Ye(L.isRoot?.(e.panelContext)?o.value:[L],(V,te)=>(I(),G("div",{key:`sidebar-panel-${V.name}`},[(d.value?V.isRoot?.(e.panelContext):[f.value,c.value].includes(V.name))?(I(),re(rn(V.component),pt({key:0,class:[{"multi-root-panel-separator mt-4 pt-2 border-t":te>0},"rounded-sm"]},{ref_for:!0},V.componentAttrs?.(e.panelContext)||{}),null,16,["class"])):le("",!0)]))),128))],!0)],2),L.isRoot?.(e.panelContext)&&s.value.length>0?(I(),G("div",gI,[(I(!0),G(Ae,null,Ye(s.value,V=>(I(),re($,{id:`sidebar-panel-${V.name}-select`,key:`panel-select-${V.name}`,"data-testid":`sidebar-panel-${V.name}-select`,appearance:"raw-inverse","color-role":"surface",class:"!grid !grid-cols-[auto_1fr_auto] text-left px-2 w-full h-12",onClick:te=>T(V.name)},{default:Z(()=>[J(D,{name:V.icon,"fill-type":V.iconFillType},null,8,["name","fill-type"]),ct(" "+R.toDisplayString(V.title(e.panelContext))+" ",1),J(D,{name:"arrow-right-s","fill-type":"line"})]),_:2},1032,["id","data-testid","onClick"]))),128))])):le("",!0)],2)],10,pI))),128))}}}),[["__scopeId","data-v-839c4e7a"]]),wg=ge({inheritAttrs:!1,__name:"SideBar",props:{loading:{type:Boolean},availablePanels:{},panelContext:{}},emits:["selectPanel","close"],setup(e,{emit:t}){const n=t,r=Js(),{isMobile:o}=os(),s=_t(),{focusSidebar:i}=s,{sideBarActivePanel:l}=we.storeToRefs(s),u=A(()=>{if(a(o))return{...a(r),isFocusTrapActive:!e.loading,hasFullHeight:!0,maxHeight:"max-h-[80vh]",class:"z-100",onClicked:d};const f=["border-l","focus:outline-0","focus-visible:outline-0","w-[440px]","min-w-[440px]","overflow-hidden","relative","focus:shadow-none","focus-visible:shadow-none",...a(r)?.class?[a(r).class]:[]];return e.loading&&f.push("flex","justify-center","items-center"),{...a(r),class:f}}),d=f=>{if(!f.target)return;const h=f.target===f.currentTarget,g=f.target instanceof HTMLAnchorElement,m=f.target.closest("ul.sidebar-actions-panel");(h||g||m)&&c()},c=()=>{s.closeSideBar(),n("close")},p=f=>{s.openSideBarPanel(f),n("selectPanel",f)};return Qs(()=>{a(o)&&c()}),(f,h)=>(I(),re(Fa,{to:"#mobile-right-sidebar",disabled:!a(o)},[(I(),re(rn(a(o)?"oc-bottom-drawer":"div"),pt({id:"app-sidebar",tabindex:"-1"},u.value),{default:Z(()=>[J(bg,{loading:e.loading,"available-panels":e.availablePanels,"panel-context":e.panelContext,"active-panel":a(l),onSelectPanel:p,onClose:c,onClosePanel:a(i)},{body:Z(()=>[Ce(f.$slots,"body")]),rootHeader:Z(()=>[Ce(f.$slots,"rootHeader")]),subHeader:Z(()=>[Ce(f.$slots,"subHeader")]),_:3},8,["loading","available-panels","panel-context","active-panel","onClosePanel"])]),_:3},16))],8,["disabled"]))}}),vI={class:"grid items-center p-2"},yI={class:"flex items-center text-sm"},bI=["textContent"],wI=["textContent"],Oc=ge({__name:"SpaceInfo",setup(e){const t=Jn("resource");return(n,r)=>{const o=oe("oc-icon");return I(),G("div",vI,[Q("div",yI,[J(o,{name:"layout-grid",size:a(t).description?"large":"medium",class:"block mr-2"},null,8,["size"]),Q("div",null,[Q("h3",{"data-testid":"space-info-name",class:"font-semibold m-0 text-base break-all",textContent:R.toDisplayString(a(t).name)},null,8,bI),Q("span",{"data-testid":"space-info-subtitle",textContent:R.toDisplayString(a(t).description)},null,8,wI)])])])}}}),SI={class:"flex justify-between p-2"},TI={class:"flex items-center"},kI={"data-testid":"files-info-name",class:"font-semibold m-0 text-base break-all"},Lc=ge({__name:"FileInfo",props:{isSubPanelActive:{type:Boolean,default:!0}},setup(e){const t=De(),{isPersonalSpaceRoot:n}=It(),r=Jn("resource"),o=Jn("space"),s=A(()=>t.areFileExtensionsShown),i=A(()=>n(a(r))?a(o).name:a(r).name);return(l,u)=>(I(),G("div",SI,[Q("div",TI,[e.isSubPanelActive?(I(),re(ws,{key:0,resource:a(r),size:"large",class:"mr-2 relative"},null,8,["resource"])):le("",!0),Q("div",null,[Q("h3",kI,[J(bc,{name:i.value,extension:a(r).extension,type:a(r).type,"full-path":a(r).webDavPath,"is-extension-displayed":s.value,"is-path-displayed":!1,"truncate-name":!1,class:"[&_span]:break-all"},null,8,["name","extension","type","full-path","is-extension-displayed"])])])])]))}}),Sg=ge({__name:"FileSideBar",props:{space:{default:()=>{}}},setup(e){const t=Re(),n=Pe(),r=ho(),o=He(),s=tr(),i=Ge(),l=Mn(),{canListShares:u}=Bm(),{canListVersions:d}=og(),c=De(),{currentFolder:p}=we.storeToRefs(c),f=_t(),{isSideBarOpen:h,sideBarActivePanel:g}=we.storeToRefs(f),m=W(),w=W([]),T=W([]),k=W([]),{selectedResources:S}=Ic(),y=W(!1),E=A(()=>a(y)),D=A(()=>a(S).length===0?{root:e.space,parent:null,items:a(p)?.id?[a(p)]:[]}:{root:e.space,parent:a(p),items:a(S)}),$=xn(mt,"files-shares-with-me"),_=xn(mt,"files-shares-with-others"),L=xn(mt,"files-shares-via-link"),V=st(t,"files-spaces-projects"),te=xn(bt,"files-common-favorites"),B=xn(bt,"files-common-search"),O=A(()=>a(D).items?.length===1&&!z.isProjectSpaceResource(a(D).items[0])),M=A(()=>a(D).items?.length===1&&z.isProjectSpaceResource(a(D).items[0])),N=A(()=>a($)||a(_)||a(L)),q=A(()=>a(N)||a(B)||a(te)),j=A(()=>r.requestExtensions({id:"global.files.sidebar",extensionType:"sidebarPanel"}).map(ne=>ne.panel)),H=$t.useTask(function*(ne,pe){w.value=yield n.webdav.listFileVersions(pe.id,{signal:ne})}),se=$t.useTask(function*(ne,pe){s.setLoading(!0),s.removeOrphanedShares();const{collaboratorShares:fe,linkShares:be}=s,xe=n.graphAuthenticated.permissions;let he=e.space?.id;if(z.isShareSpaceResource(e.space)){const ve=yield o.getMountPointForSpace({graphClient:n.graphAuthenticated,space:e.space,signal:ne});ve&&(he=ve.root.remoteItem.rootId)}const{shares:ie,allowedRoles:de}=yield*z.call(xe.listPermissions(he,pe.fileId,s.graphRoles,{},{signal:ne})),ue=ie.filter(z.isCollaboratorShare),Se=ie.filter(z.isLinkShare),$e=Object.values(s.graphRoles);if(T.value=de?.map(ve=>({...ve,icon:$e.find(ke=>ke.id===ve.id)?.icon}))||[],l.isAppEnabled("open-cloud-mesh")){const{allowedRoles:ve}=yield*z.call(xe.listPermissions(he,pe.fileId,s.graphRoles,{filter:`@libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition, '@Subject.UserType=="Federated"'))`,select:[Xp.LibreGraphPermissionsRolesAllowedValues]},{signal:ne}));k.value=ve?.map(ke=>({...ke,icon:$e.find(qe=>qe.id===ke.id)?.icon}))||[]}!a(q)&&!a(V)&&(fe.forEach(ve=>{ue.some(ke=>ke.id===ve.id)||ue.push({...ve,indirect:!0})}),be.forEach(ve=>{Se.some(ke=>ke.id===ve.id)||Se.push({...ve,indirect:!0})})),bt(t,"files-common-search")&&(yield c.loadAncestorMetaData({folder:a(pe),space:e.space,client:n.webdav,signal:ne}));const lt=[...fe,...be].map(({resourceId:ve})=>ve),Tt=Object.values(c.ancestorMetaData).filter(({id:ve,path:ke})=>ve===pe.id||lt.includes(ve)||z.isIncomingShareResource(pe)?!1:z.isPersonalSpaceResource(e.space)?ke!=="/":!0).map(({id:ve})=>ve);a(q)&&z.isProjectSpaceResource(e.space)&&!z.isProjectSpaceResource(pe)&&Tt.push(e.space.id);const ut=new ur({concurrency:i.options.concurrentRequests.shares.list}),gt=[...new Set(Tt)].map(ve=>ut.add(()=>n.graphAuthenticated.permissions.listPermissions(he,ve,s.graphRoles,{},{signal:ne}).then(ke=>{const qe=ke.shares.map(We=>({...We,indirect:!0}));ue.push(...qe.filter(z.isCollaboratorShare)),Se.push(...qe.filter(z.isLinkShare))})));yield Promise.allSettled(gt),s.setCollaboratorShares(ue),s.setLinkShares(Se),s.setLoading(!1)}).restartable(),Y=W();Ue(()=>[...a(D).items,h],async(ne,pe)=>{if(a(D).items?.length!==1)return;if(!a(h)){Y.value=void 0,w.value=[];return}const fe=ne?.[0],be=pe?.[0];if(fe?.id===be?.id&&fe?.mdate===a(Y))return;const xe=a(D).items[0];if(Y.value=xe.mdate,H.isRunning&&H.cancelAll(),!!d({space:e.space,resource:xe}))try{await H.perform(xe)}catch(he){console.error(he)}},{immediate:!0,deep:!0});const ae=A(()=>a(D).items.map(ne=>ne.id));return Ue(()=>[ae,h],async()=>{if(!a(h)||!a(D).items?.length){s.pruneShares(),m.value=null;return}if(a(D).items?.length!==1)return;const ne=a(D).items[0];if(y.value=!0,z.isProjectSpaceResource(ne)&&await o.loadGraphPermissions({ids:[ne.id],graphClient:n.graphAuthenticated}),u({space:e.space,resource:ne}))try{se.isRunning&&se.cancelAll(),se.perform(ne)}catch(pe){console.error(pe)}if(!z.isOutgoingShareResource(ne)&&!z.isIncomingShareResource(ne)){m.value=ne,y.value=!1;return}try{const pe=await n.webdav.getFileInfo(e.space,{path:ne.path}),fe={...pe,...ne,tags:pe.tags};m.value=fe}catch(pe){m.value=ne,console.error(pe)}y.value=!1},{deep:!0,immediate:!0}),Dr("resource",pr(m)),Dr("versions",pr(w)),Dr("space",A(()=>e.space)),Dr("availableInternalShareRoles",pr(T)),Dr("availableExternalShareRoles",pr(k)),Dr("versionsLoading",A(()=>H.isRunning)),Dr("activePanel",g),(ne,pe)=>a(h)?(I(),re(wg,pt({key:0,ref:"sidebar",class:"files-side-bar z-30","available-panels":j.value,"panel-context":D.value,loading:E.value},ne.$attrs,{"data-custom-key-bindings-disabled":"true"}),{rootHeader:Z(()=>[O.value?(I(),re(Lc,{key:0,class:"px-2 pt-2","is-sub-panel-active":!1})):M.value?(I(),re(Oc,{key:1})):le("",!0)]),subHeader:Z(()=>[O.value?(I(),re(Lc,{key:0,class:"px-2 pt-2","is-sub-panel-active":!0})):M.value?(I(),re(Oc,{key:1})):le("",!0)]),_:1},16,["available-panels","panel-context","loading"])):le("",!0)}}),CI=ge({name:"DatePickerModal",props:{modal:{type:Object,required:!0},currentDate:{type:Object,required:!1,default:null},minDate:{type:Object,required:!1,default:null},isClearable:{type:Boolean,default:!0}},emits:["confirm","cancel"],setup(){const e=Bn(),{currentTheme:t}=we.storeToRefs(e),n=W(),r=W(!0);return{confirmDisabled:r,onDateChanged:({date:s,error:i})=>{r.value=i||!s,n.value=s},currentTheme:t,dateTime:n}}}),xI={class:"flex justify-end items-center mt-2"};function AI(e,t,n,r,o,s){const i=oe("oc-datepicker"),l=oe("oc-button");return I(),G(Ae,null,[J(i,{label:e.$gettext("Expiration date"),type:"date","min-date":e.minDate,"current-date":e.currentDate,"is-clearable":e.isClearable,"is-dark":e.currentTheme.isDark,"required-mark":"",onDateChanged:e.onDateChanged},null,8,["label","min-date","current-date","is-clearable","is-dark","onDateChanged"]),Q("div",xI,[J(l,{class:"oc-modal-body-actions-cancel ml-2",onClick:t[0]||(t[0]=u=>e.$emit("cancel"))},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),J(l,{disabled:e.confirmDisabled,class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:t[1]||(t[1]=u=>e.$emit("confirm",e.dateTime))},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Confirm")),1)]),_:1},8,["disabled"])])],64)}const EI=Le(CI,[["render",AI]]),RI=ge({name:"UnsavedChangesModal",props:{modal:{type:Object,required:!0},closeCallback:{type:Function,required:!0}},emits:["cancel","confirm"],setup(e){const{removeModal:t}=Je();return{onClose:()=>{t(e.modal.id),e.closeCallback()}}}}),DI=["textContent"],PI={class:"flex justify-end items-center mt-4"},II={class:"oc-modal-body-actions-grid"};function FI(e,t,n,r,o,s){const i=oe("oc-button");return I(),G(Ae,null,[Q("span",{class:"inline-block mb-4",textContent:R.toDisplayString(e.$gettext("Your changes were not saved. Do you want to save them?"))},null,8,DI),t[2]||(t[2]=Q("div",{class:"my-4"},null,-1)),Q("div",PI,[Q("div",II,[J(i,{class:"oc-modal-body-actions-cancel ml-2",onClick:t[0]||(t[0]=l=>e.$emit("cancel"))},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),J(i,{class:"oc-modal-body-actions-secondary ml-2",onClick:e.onClose},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Don't Save")),1)]),_:1},8,["onClick"]),J(i,{class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:t[1]||(t[1]=l=>e.$emit("confirm"))},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Save")),1)]),_:1})])])],64)}const Tg=Le(RI,[["render",FI]]);var $I=/\s/;function OI(e){for(var t=e.length;t--&&$I.test(e.charAt(t)););return t}var LI=/^\s+/;function _I(e){return e&&e.slice(0,OI(e)+1).replace(LI,"")}var kg=NaN,MI=/^[-+]0x[0-9a-f]+$/i,NI=/^0b[01]+$/i,BI=/^0o[0-7]+$/i,jI=parseInt;function zI(e){if(typeof e=="number")return e;if(bi(e))return kg;if($n(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=$n(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=_I(e);var n=NI.test(e);return n||BI.test(e)?jI(e.slice(2),n?2:8):MI.test(e)?kg:+e}const UI=["id"],VI=["textContent"],qI={key:3,class:"flex size-full"},Cg=ge({__name:"AppWrapper",props:{applicationId:{},urlForResourceOptions:{default:null},fileContentOptions:{default:null},wrappedComponent:{default:null},importResourceWithExtension:{type:Function,default:()=>null},disableAutoSave:{type:Boolean,default:!1}},setup(e){const{$gettext:t,current:n}=me.useGettext(),r=Mn(),{showMessage:o,showErrorMessage:s}=Me(),i=Ds.useRouter(),l=St(),u=Pe(),d=Ut(),{getResourceContext:c}=sg(),{selectedResources:p}=Ic(),{dispatchModal:f}=Je(),h=He(),g=Ge(),m=De(),w=tr(),T=rr(),{isMobile:k}=os(),S=_t(),{isSideBarOpen:y}=we.storeToRefs(S),{actions:E}=$m({appId:e.applicationId}),{actions:D}=Kl(),{actions:$}=xo(),{actions:_}=Cc(),{actions:L}=xc(),{actions:V}=Ts(),te=A(()=>!!e.wrappedComponent.emits?.includes("update:resource")),B=W(),O=W(),M=W(""),N=W(""),q=W(!a(te)),j=W(),H=W(!1),se=W(),Y=W();let ae="",ne=null;const{actions:pe}=_m({content:Y}),fe=A(()=>!!e.wrappedComponent.emits?.includes("update:currentContent")),be=Te=>!!Object.keys(e.wrappedComponent.props).includes(Te),xe=A(()=>a(Y)!==a(se)),he=Te=>{Te.preventDefault()};Ue(xe,Te=>{Te?window.addEventListener("beforeunload",he):window.removeEventListener("beforeunload",he)});const{applicationConfig:ie,closeApp:de,currentFileContext:ue,getFileContents:Se,getFileInfo:$e,getUrlForResource:Ve,putFileContents:lt,replaceInvalidFileRoute:Tt,revokeUrl:ut,activeFiles:gt,loadFolderForFileContext:ve,isFolderLoading:ke}=dh({applicationId:e.applicationId}),{applicationMeta:qe}=Wl({applicationId:e.applicationId,appsStore:r}),We=A(()=>a(qe).meta?.fileSizeLimit),Jt=A(()=>{const{name:Te}=a(qe);return t("%{appName} for %{fileName}",{appName:t(Te),fileName:a(a(ue).fileName)})}),Xt=Di("driveAliasAndItem"),kt=Pt("fileId"),dt=A(()=>at(a(kt))),mn=async()=>{const Te=a(dt),{space:Oe,path:tt}=await c(Te),Vt=Oe.getDriveAliasAndItem({path:tt});return z.isPersonalSpaceResource(Oe)?i.push({params:{...a(l).params,driveAliasAndItem:Vt},query:{...a(l).query,fileId:Te,contextRouteName:"files-spaces-generic",contextRouteParams:{driveAliasAndItem:Ke.dirname(Vt)}}}):i.push({params:{...a(l).params,driveAliasAndItem:Vt},query:{...a(l).query,fileId:Te,contextRouteName:tt==="/"?"files-shares-with-me":"files-spaces-generic",...z.isShareSpaceResource(Oe)&&{shareId:Oe.id},contextRouteParams:{driveAliasAndItem:Ke.dirname(Vt)},contextRouteQuery:{...z.isShareSpaceResource(Oe)&&{shareId:Oe.id}}}})},qn=$t.useTask(function*(Te){try{a(Xt)||(yield mn()),O.value=a(a(ue).space);const Oe=yield $e(a(ue),{signal:Te});if(B.value=Oe,z.isShareSpaceResource(a(O))&&(a(B).remoteItemId=a(O).id,a(B).id===a(B).remoteItemId)){const tt=yield*z.call(pi({graphClient:u.graphAuthenticated,spacesStore:h,space:a(O)}));tt&&(B.value={...Oe,...z.buildIncomingShareResource({graphRoles:w.graphRoles,driveItem:tt,serverUrl:g.serverUrl}),tags:Oe.tags})}m.initResourceList({currentFolder:null,resources:[a(B)]}),p.value=[a(B)]}catch(Oe){console.error(Oe),j.value=Oe,q.value=!1}}).restartable(),At=$t.useTask(function*(Te){try{const Oe=e.importResourceWithExtension(a(B));if(Oe){const tt=vt.DateTime.local().toFormat("yyyyMMddHHmmss"),Vt=`${a(B).name}_${tt}.${Oe}`;if(!(yield u.webdav.copyFiles(a(O),a(B),a(O),{path:Vt},{signal:Te})))throw new Error(t("Importing failed"));B.value={path:Vt}}if(Tt(ue,a(B)))return;if(H.value=![pf.Updateable,pf.FileUpdateable].some(tt=>(a(B).permissions||"").indexOf(tt)>-1),a(be("currentContent"))){const tt=yield*z.call(Se(ue,{...e.fileContentOptions,signal:Te}));se.value=Y.value=tt.body,M.value=tt.headers["OC-ETag"]}a(be("url"))&&(N.value=yield Ve(a(O),a(B),{...e.urlForResourceOptions,signal:Te}))}catch(Oe){console.error(Oe),j.value=Oe}finally{q.value=!1}}).restartable();Ue(ue,async()=>{a(te)?O.value=a(a(ue).space):(await qn.perform(),a(We)&&zI(a(B).size)>a(We)?f({title:t("File exceeds %{threshold}",{threshold:Ht(a(We),n)}),message:t("%{resource} exceeds the recommended size of %{threshold} for editing, and may cause performance issues.",{resource:a(B).name,threshold:Ht(a(We),n)}),confirmText:t("Continue"),onCancel:()=>{de()},onConfirm:()=>{At.perform()}}):At.perform())},{immediate:!0});const En=Te=>{console.error(Te),s({title:t("An error occurred"),desc:Te.message,errors:[Te]})},C=()=>{o({title:t("File autosaved")})},v=$t.useTask(function*(){const Te=a(Y);try{const Oe=yield lt(ue,{content:Te,previousEntityTag:a(M)});se.value=Te,M.value=Oe.etag,m.upsertResource(Oe)}catch(Oe){switch(Oe.statusCode){case 401:case 403:En(new z.HttpError(t("You're not authorized to save this file"),Oe.response));break;case 409:case 412:En(new z.HttpError(t("This file was updated outside this window. Please copy your changes or save the file under a new name (»Save As...«)."),Oe.response));break;case 507:const tt=h.spaces.find(Vt=>Vt.id===a(B).storageId&&z.isProjectSpaceResource(Vt));if(tt){En(new z.HttpError(t('Insufficient quota on "%{spaceName}" to save this file',{spaceName:tt.name}),Oe.response));break}En(new z.HttpError(t("Insufficient quota for saving this file"),Oe.response));break;default:En(new z.HttpError("",Oe.response))}}}).drop(),b=async()=>{await v.perform()};let F=null;yt(()=>{if(ae=T.subscribe("runtime.resource.deleted",ye),m.ancestorMetaData?.["/"]&&a(O)&&m.ancestorMetaData["/"].spaceId!==a(O).id&&m.setAncestorMetaData({}),!a(fe))return;const Te=g.options.editor;Te.autosaveEnabled&&!e.disableAutoSave&&(F=setInterval(async()=>{xe.value&&(await b(),C())},(Te.autosaveInterval||120)*1e3))}),bn(()=>{T.unsubscribe("runtime.resource.deleted",ae),d.isLoading||window.removeEventListener("beforeunload",he),a(be("url"))&&ut(N.value),a(fe)&&(clearInterval(F),F=null)});const{bindKeyAction:P}=_i({skipDisabledKeyBindingsCheck:!0});P({modifier:Li.Ctrl,primary:jn.S},()=>{a(xe)&&b()});const U=A(()=>[{name:"save-file",disabledTooltip:()=>"",isVisible:()=>a(fe)&&!a(H),isDisabled:()=>!a(xe),icon:"save",id:"app-save-action",label:()=>t("Save"),handler:b}]),X=A(()=>({space:a(O),resources:[a(B)]})),ee=async(Te,Oe)=>{a(xe)&&(await b(),C()),Oe(Te)},ye=Te=>{if(Te.find(tt=>tt.id===a(B).id)){if(ne)return ne();de()}},Ie=A(()=>[...a(E),...a(U),...a(pe).map(Te=>({...Te,isVisible:Oe=>fe.value&&Te.isVisible(Oe)}))].filter(Te=>Te.isVisible(a(X)))),Fe=A(()=>[...a(L),...a(D)].filter(Te=>Te.isVisible(a(X)))),Ne=A(()=>[...a($).map(Te=>({...Te,handler:Oe=>ee(Oe,Te.handler)})),...a(V)].filter(Te=>Te.isVisible(a(X)))),xs=A(()=>[...a(_)].filter(Te=>Te.isVisible(a(X)))),cr=A(()=>{const Te=[];return a(Ie).length&&Te.push({name:"context",items:a(Ie)}),a(Fe).length&&Te.push({name:"share",items:a(Fe)}),a(Ne).length&&Te.push({name:"actions",items:a(Ne)}),a(xs).length&&Te.push({name:"sidebar",items:a(xs)}),Te}),As=A(()=>[...a(U)]);Ds.onBeforeRouteLeave((Te,Oe,tt)=>{a(xe)?f({title:t("Unsaved changes"),customComponent:Tg,focusTrapInitial:".oc-modal-body-actions-confirm",hideActions:!0,customComponentAttrs:()=>({closeCallback:()=>{tt()}}),async onConfirm(){await b(),tt()}}):tt()});const Eo=A(()=>({url:a(N),space:a(a(ue).space),resource:a(B),activeFiles:a(gt),isDirty:a(xe),isReadOnly:a(H),applicationConfig:a(ie),currentFileContext:a(ue),currentContent:a(Y),isFolderLoading:a(ke),"onUpdate:resource":Te=>{O.value=a(a(ue).space),B.value={...Te,...z.isShareSpaceResource(a(O))&&{remoteItemId:a(O).id}},p.value=[a(B)]},"onUpdate:currentContent":Te=>{Y.value=Te},"onRegister:onDeleteResourceCallback":Te=>{ne=Te},"onDelete:resource":()=>{a(V)[0].isVisible({space:a(O),resources:[a(B)]})&&a(V)[0].handler({space:a(O),resources:[a(B)]})},onSave:b,onClose:de,loadFolderForFileContext:ve,revokeUrl:ut,getUrlForResource:Ve}));return(Te,Oe)=>(I(),G("main",{id:e.applicationId,class:"app-wrapper h-full",onKeydown:Oe[0]||(Oe[0]=zo((...tt)=>a(de)&&a(de)(...tt),["esc"]))},[Q("h1",{class:"sr-only",textContent:R.toDisplayString(Jt.value)},null,8,VI),!q.value&&!j.value&&B.value?(I(),re(yg,{key:0,"main-actions":As.value,"drop-down-menu-sections":cr.value,"drop-down-action-options":X.value,"has-auto-save":!e.disableAutoSave,"is-editor":fe.value,resource:B.value,"is-read-only":H.value,onClose:a(de)},null,8,["main-actions","drop-down-menu-sections","drop-down-action-options","has-auto-save","is-editor","resource","is-read-only","onClose"])):le("",!0),q.value?(I(),re(fI,{key:1})):j.value?(I(),re(aI,{key:2,message:j.value.message},null,8,["message"])):(I(),G("div",qI,[Ce(Te.$slots,"default",pt({class:["app-wrapper-content size-full",{"w-[calc(100%-440px)]":a(y)&&!a(k)}]},Eo.value)),J(Sg,{space:O.value},null,8,["space"])]))],40,UI))}});function HI(e,t){return ge({render(){return za(Cg,{wrappedComponent:e,...t},{default:n=>za(e,n)})}})}const _c=ge({__name:"ContextMenuQuickAction",props:{item:{},resourceDomSelector:{type:Function,default:e=>z.extractDomSelector(e.id)},title:{default:""}},emits:["quickActionClicked"],setup(e){const{$gettext:t}=me.useGettext(),n=A(()=>t("Show context menu"));return(r,o)=>{const s=oe("oc-icon"),i=oe("oc-drop"),l=oe("oc-button"),u=Lt("oc-tooltip");return je((I(),re(l,{id:`context-menu-trigger-${e.resourceDomSelector(e.item)}`,"data-test-context-menu-resource-name":e.item.name,"aria-label":n.value,appearance:"raw",class:"quick-action-button ml-1 p-1",onClick:o[0]||(o[0]=wt(d=>r.$emit("quickActionClicked",{event:d,dropdown:r.$refs[`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`]}),["stop","prevent"]))},{default:Z(()=>[J(s,{name:"more-2"}),J(i,{ref:`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`,"drop-id":`context-menu-drop-${e.resourceDomSelector(e.item)}`,toggle:`#context-menu-trigger-${e.resourceDomSelector(e.item)}`,title:e.title,position:"bottom-end",mode:"click","padding-size":"small","close-on-click":""},{default:Z(()=>[Ce(r.$slots,"contextMenu",{item:e.item})]),_:3},8,["drop-id","toggle","title"])]),_:3},8,["id","data-test-context-menu-resource-name","aria-label"])),[[u,n.value]])}}}),WI=ge({name:"ResourceGhostElement",components:{ResourceIcon:ws},props:{previewItems:{type:Array,required:!0}},computed:{layerCount(){return Math.min(this.previewItems.length,3)},showSecondLayer(){return this.layerCount>1},showThirdLayer(){return this.layerCount>2},itemCount(){return this.previewItems.length}}}),QI={id:"ghost-element",class:"z-[var(--z-index-modal)] absolute pt-1 pl-4 bg-transparent"},KI={class:"relative rounded-sm bg-role-surface-container-high"},GI={key:0,class:"-z-10 absolute top-[3px] left-[3px] right-[-3px] bottom-[-3px] rounded-sm bg-role-surface-container-high brightness-82"},JI={key:1,class:"-z-20 absolute top-[6px] left-[6px] right-[-6px] bottom-[-6px] rounded-sm bg-role-surface-container-high brightness-72"},XI={class:"badge absolute top-[-2px] right-[-8px] p-1 text-sm text-center leading-2 bg-red-600 text-white rounded-4xl box-content min-w-2 h-2"};function YI(e,t,n,r,o,s){const i=oe("resource-icon");return I(),G("div",QI,[Q("div",KI,[J(i,{class:"p-1",resource:e.previewItems[0]},null,8,["resource"]),e.showSecondLayer?(I(),G("div",GI)):le("",!0),e.showThirdLayer?(I(),G("div",JI)):le("",!0)]),Q("span",XI,R.toDisplayString(e.itemCount),1)])}const Mc=Le(WI,[["render",YI]]),ZI=ge({name:"ResourceSize",props:{size:{type:[String,Number],required:!0}},setup:e=>{const{current:t}=me.useGettext();return{formattedSize:A(()=>Ht(e.size,t))}}}),eF=["textContent"];function tF(e,t,n,r,o,s){return I(),G("span",{textContent:R.toDisplayString(e.formattedSize)},null,8,eF)}const xg=Le(ZI,[["render",tF]]),Ag=ge({__name:"ResourceStatusIndicators",props:{resource:{},space:{default:()=>{}},filter:{type:Function,default:void 0}},setup(e){const t=Js(),{getIndicators:n}=Dc(),r=A(()=>{const o=n({space:e.space,resource:e.resource});return e.filter?o.filter(e.filter):o});return(o,s)=>r.value.length>0?(I(),re(a(HE),pt({key:0},a(t),{indicators:r.value,resource:e.resource}),null,16,["indicators","resource"])):le("",!0)}}),la=ge({__name:"UserAvatar",props:{userId:{},userName:{}},setup(e){const t=fi(),{avatarMap:n}=we.storeToRefs(t),{enqueueAvatar:r}=pg(),o=A(()=>a(n)[e.userId]);return yt(()=>{r(e.userId)}),(s,i)=>{const l=oe("oc-avatar");return I(),re(l,{"user-name":e.userName,src:o.value,width:36},null,8,["user-name","src"])}}}),nF={class:R.normalizeClass(["[&_.cropper-crop-box]:!outline-1","[&_.cropper-crop-box]:!outline-role-outline","[&_.cropper-view-box]:!rounded-[50%]","[&_.cropper-crop-box]:!rounded-[50%]","[&_.cropper-line]:!bg-role-outline","[&_.cropper-point]:!bg-role-outline"])},rF={class:"flex flex-col items-center"},oF={class:"oc-button-group"},sF={key:0},iF=["src"],aF={class:"text-sm text-role-on-surface-variant flex items-center mt-1"},lF=["textContent"],cF=ge({__name:"AvatarUpload",setup(e){const t=et(),n=fi(),{avatarMap:r}=we.storeToRefs(n),{user:o}=we.storeToRefs(t),{$gettext:s}=me.useGettext(),{showErrorMessage:i,showMessage:l}=Me(),{graphAuthenticated:u}=Pe(),{setCropperInstance:d}=Ql(),c=W(null),p=W(null),f=W(null),h=W(!1),g=W(!1),m=W(!1),w=W(null),T=vc*1024*1024,k=A(()=>!!a(r)[a(o).id]),S=te=>{const O=te.target.files?.[0];if(O){if(O.size>T){i({title:s("File size exceeds the limit of %{size}MB",{size:vc.toString()})});return}c.value=URL.createObjectURL(O),g.value=!0}};Ue(c,async te=>{te&&(await xt(),f.value&&f.value.destroy(),p.value&&(f.value=new ca(p.value,{aspectRatio:1,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1,ready(){h.value=!0}}),d(f)))});const y=()=>f.value.getCroppedCanvas({width:256,height:256,imageSmoothingQuality:"high"}),E=async te=>await new Promise(B=>{te.toBlob(O=>B(O),"image/png")}),D=()=>{w.value?.click()},$=()=>{g.value=!1,V()},_=async()=>{const te=y(),B=await E(te),O=URL.createObjectURL(B),M=new File([B],"avatar.png",{type:"image/png",lastModified:Date.now()});try{await u.photos.updateOwnUserPhotoPatch(M),n.addAvatar(a(o).id,O),l({title:s("Profile picture was set successfully")})}catch(N){i({title:s("Failed to set profile picture"),errors:[N]})}g.value=!1,V()},L=async()=>{try{await u.photos.deleteOwnUserPhoto(),n.removeAvatar(a(o).id),l({title:s("Profile picture was removed successfully")})}catch(te){i({title:s("Failed to remove profile picture"),errors:[te]})}m.value=!1},V=()=>{f.value?.destroy(),f.value=null,w.value&&(w.value.value=""),c.value=null};return(te,B)=>{const O=oe("oc-button"),M=oe("oc-icon"),N=oe("oc-modal");return I(),G("div",nF,[Q("input",{ref_key:"fileInputRef",ref:w,class:"invisible avatar-file-input",type:"file",accept:"image/jpeg, image/png",onChange:S},null,544),Q("div",rF,[J(la,{class:"mb-4",width:128,"user-id":a(o).id,"user-name":a(o).displayName},null,8,["user-id","user-name"]),Q("div",null,[Q("div",oF,[J(O,{size:"small",onClick:D},{default:Z(()=>[ct(R.toDisplayString(a(s)("Upload")),1)]),_:1}),k.value?(I(),re(O,{key:0,class:"avatar-upload-remove-button",size:"small",onClick:B[0]||(B[0]=q=>m.value=!0)},{default:Z(()=>[ct(R.toDisplayString(a(s)("Remove")),1)]),_:1})):le("",!0)])])]),g.value?(I(),re(N,{key:0,title:a(s)("Crop your new profile picture"),"button-cancel-text":a(s)("Cancel"),"button-confirm-text":a(s)("Set"),"button-confirm-disabled":!h.value,"focus-trap-initial":!1,onCancel:$,onConfirm:_},{content:Z(()=>[c.value?(I(),G("div",sF,[Q("img",{ref_key:"imageRef",ref:p,class:"max-h-[400px]",src:c.value},null,8,iF),Q("div",aF,[J(M,{class:"mr-1",name:"information",size:"small","fill-type":"line"}),Q("span",{textContent:R.toDisplayString(a(s)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:a(s)("+-"),panKeys:a(s)("↑↓←→")}))},null,8,lF)])])):le("",!0)]),_:1},8,["title","button-cancel-text","button-confirm-text","button-confirm-disabled"])):le("",!0),m.value?(I(),re(N,{key:1,message:a(s)("Are you sure you want to remove your profile picture?"),title:a(s)("Remove profile picture"),"button-cancel-text":a(s)("Cancel"),"button-confirm-text":a(s)("Remove"),onCancel:B[1]||(B[1]=q=>m.value=!1),onConfirm:L},null,8,["message","title","button-cancel-text","button-confirm-text"])):le("",!0)])}}}),uF={class:"resource-table-select-all flex justify-center items-center"},dF={class:"truncate"},fF=["textContent"],pF=["textContent"],hF=["textContent"],mF={key:0,class:"flex items-center justify-end flex-row flex-nowrap"},gF=850,vF=ge({__name:"ResourceTable",props:{resources:{},resourceDomSelector:{type:Function,default:e=>z.extractDomSelector(e.id)},arePathsDisplayed:{type:Boolean,default:!1},selectedIds:{default:()=>[]},hasActions:{type:Boolean,default:!0},showRenameQuickAction:{type:Boolean,default:!0},areResourcesClickable:{type:Boolean,default:!0},headerPosition:{default:0},isSelectable:{type:Boolean,default:!0},dragDrop:{type:Boolean,default:!1},viewMode:{default:()=>Ft.defaultModeName},hover:{type:Boolean,default:!0},sortBy:{default:()=>{}},fieldsDisplayed:{default:()=>{}},sortDir:{default:()=>{}},space:{default:()=>{}},resourceType:{default:"file"},lazy:{type:Boolean,default:!0}},emits:["fileClick","sort","fileDropped","update:selectedIds","update:modelValue"],setup(e,{emit:t}){const n=t,r=Re(),o=Dt(),{getMatchingSpace:s}=It(),{interceptModifierClick:i}=zr(),{getParentFolderLink:l,getParentFolderLinkIconAdditionalAttributes:u,getParentFolderName:d,getPathPrefix:c}=Cr({space:W(e.space)}),{isSticky:p}=Ac(),{$gettext:f,$ngettext:h,current:g}=me.useGettext(),{isLocationPicker:m,isFilePicker:w}=Tr(),{selectedResources:T,disabledResources:k,isResourceSelected:S,fileContainerClicked:y,fileNameClicked:E,fileCheckboxClicked:D,isResourceDisabled:$,isResourceInDeleteQueue:_,isResourceClickable:L,isResourceCut:V,getResourceLink:te,dragItem:B,dragSelection:O,dragStart:M,fileDropped:N,setDropStyling:q,shouldShowContextDrop:j,showContextMenuOnRightClick:H,showContextMenuOnBtnClick:se,selectAllCheckboxLabel:Y,getResourceCheckboxLabel:ae,toggleSelectionAll:ne,areAllResourcesSelected:pe}=Pc({space:A(()=>e.space),resources:A(()=>e.resources),selectedIds:A(()=>e.selectedIds),emit:n}),fe=_t(),{isSideBarOpen:be}=we.storeToRefs(fe),xe=Lr(),{userContextReady:he}=we.storeToRefs(xe),ie=De(),{areFileExtensionsShown:de,latestSelectedId:ue}=we.storeToRefs(ie),{width:Se}=Rn.useWindowSize(),$e=A(()=>o.filesTags&&Se.value>=gF),{actions:Ve}=na(),{actions:lt}=Xm(),Tt=A(()=>a(Ve)[0].handler),ut=A(()=>a(lt)[0].handler),gt=C=>f("Search for tag %{tag}",{tag:C}),ve=A(()=>{if(e.resources.length===0)return[];const C=e.resources[0],v=[];e.isSelectable&&v.push({name:"select",title:"",type:"slot",headerType:"slot",width:"shrink"});const b=af(C);return v.push(...[{name:"name",title:f("Name"),type:"slot",width:"expand",wrap:"truncate"},{name:"manager",prop:"members",title:f("Manager"),type:"slot"},{name:"members",title:f("Members"),prop:"members",type:"slot"},{name:"totalQuota",prop:"spaceQuota.total",title:f("Total quota"),type:"slot",sortable:!0},{name:"usedQuota",prop:"spaceQuota.used",title:f("Used quota"),type:"slot",sortable:!0},{name:"remainingQuota",prop:"spaceQuota.remaining",title:f("Remaining quota"),type:"slot",sortable:!0},{name:"indicators",title:f("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"size",title:f("Size"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"syncEnabled",title:f("Info"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"tags",title:f("Tags"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedBy",title:f("Shared by"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedWith",title:f("Shared with"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"mdate",title:f("Modified"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:F=>dt(F.mdate)+" ("+kt(F.mdate)+")"},{name:"sdate",title:f("Shared on"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:F=>dt(F.sdate)+" ("+kt(F.sdate)+")"},{name:"ddate",title:f("Deleted"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:F=>dt(F.ddate)+" ("+kt(F.ddate)+")"}].filter(F=>{if(F.name==="tags"&&!a($e))return!1;if(F.name==="indicators")return!0;let P;return F.prop?P=El(C,F.prop)!==void 0:P=Object.prototype.hasOwnProperty.call(C,F.name),e.fieldsDisplayed?P&&e.fieldsDisplayed.includes(F.name):P}).map(F=>{const P=b.find(U=>U.name===F.name);return P&&Object.assign(F,{sortable:P.sortable,sortDir:P.sortDir}),F})),e.hasActions&&v.push({name:"actions",title:f("Actions"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"}),v}),ke=C=>{const v=a(r.currentRoute).query?.term;return lo("files-common-search",{query:{provider:"files.sdk",q_tags:C,...v&&{term:v}}})},qe=C=>a(he)?{to:ke(C)}:{},We=C=>C.id===a(ue),Jt=C=>e.showRenameQuickAction?z.isProjectSpaceResource(C)?a(lt).filter(v=>v.isVisible({resources:[C]})).length:a(Ve).filter(v=>v.isVisible({space:e.space,resources:[C]})).length:!1,Xt=C=>{if(z.isProjectSpaceResource(C))return a(ut)({resources:[C]});a(Tt)({space:s(C),resources:[C]})},kt=C=>mp(new Date(C),g),dt=C=>vp(new Date(C),g),mn=C=>{if(!z.isShareResource(C))return;const v=C.type==="folder"?f("folder"):f("file"),b=C.sharedWith.filter(({shareType:F})=>z.ShareTypes.authenticated.includes(z.ShareTypes.getByValue(F))).length;return b?h("This %{ resourceType } is shared via %{ shareCount } invite","This %{ resourceType } is shared via %{ shareCount } invites",b,{resourceType:v,shareCount:b.toString()}):""},qn=C=>{if(!z.isShareResource(C))return"";const v=C.type==="folder"?f("folder"):f("file");return f("This %{ resourceType } is shared by %{ user }",{resourceType:v,user:C.sharedBy.map(({displayName:b})=>b).join(", ")})},At=C=>z.isShareResource(C)?C.sharedBy.map(v=>({displayName:v.displayName,name:v.displayName,avatarType:z.ShareTypes.user.key,username:v.id,userId:v.id})):[],En=C=>z.isShareResource(C)?C.sharedWith.filter(({shareType:v})=>z.ShareTypes.authenticated.includes(z.ShareTypes.getByValue(v))).map(v=>({displayName:v.displayName,name:v.displayName,avatarType:z.ShareTypes.getByValue(v.shareType).key,username:v.id,userId:v.id})):[];return(C,v)=>{const b=oe("oc-checkbox"),F=oe("oc-icon"),P=oe("oc-tag"),U=oe("oc-avatars"),X=Lt("oc-tooltip");return I(),G(Ae,null,[J(a(oR),pt(C.$attrs,{id:"files-space-table",class:[{condensed:e.viewMode===a(Ft).name.condensedTable,"files-table":e.resourceType==="file","files-table-squashed":e.resourceType==="file"&&a(be),"spaces-table":e.resourceType==="space","spaces-table-squashed":e.resourceType==="space"&&a(be)}],data:e.resources,fields:ve.value,highlighted:e.selectedIds,disabled:a(k),sticky:a(p),"header-position":e.headerPosition,"drag-drop":e.dragDrop,hover:e.hover,"item-dom-selector":e.resourceDomSelector,selection:a(T),"sort-by":e.sortBy,"sort-dir":e.sortDir,lazy:e.lazy,"padding-x":"medium",onHighlight:v[1]||(v[1]=ee=>a(y)({resource:ee[0],event:ee[1]})),onContextmenuClicked:v[2]||(v[2]=(ee,ye,Ie)=>a(H)(ye,Ie)),onItemDropped:v[3]||(v[3]=ee=>a(N)(ee[0],ee[1])),onItemDragged:v[4]||(v[4]=ee=>a(M)(ee[0],ee[1])),onDropRowStyling:a(q),onSort:v[5]||(v[5]=ee=>C.$emit("sort",ee)),"onUpdate:modelValue":v[6]||(v[6]=ee=>C.$emit("update:modelValue",ee))}),Fu({name:Z(({item:ee})=>[Q("div",{class:R.normalizeClass(["resource-table-resource-wrapper flex items-center",[{"resource-table-resource-wrapper-limit-max-width":Jt(ee)}]])},[Ce(C.$slots,"image",{resource:ee}),(I(),re(Ss,{key:`${ee.path}-${e.resourceDomSelector(ee)}-${ee.thumbnail}`,resource:ee,"path-prefix":a(c)(ee),"is-path-displayed":e.arePathsDisplayed,"parent-folder-name":a(d)(ee),"is-icon-displayed":!C.$slots.image,"is-extension-displayed":a(de),"is-resource-clickable":a(L)(ee,e.areResourcesClickable),link:a(te)(ee),"parent-folder-link":a(l)(ee),"parent-folder-link-icon-additional-attributes":a(u)(ee),class:R.normalizeClass({"opacity-60":a(V)(ee)}),onClick:wt(ye=>a(E)({resource:ee,event:ye}),["stop"])},null,8,["resource","path-prefix","is-path-displayed","parent-folder-name","is-icon-displayed","is-extension-displayed","is-resource-clickable","link","parent-folder-link","parent-folder-link-icon-additional-attributes","class","onClick"])),Jt(ee)?(I(),re(a(Qt),{key:0,class:"resource-table-edit-name inline-flex raw-hover-surface p-1 ml-1",appearance:"raw","aria-label":a(f)("Rename file »%{name}«",{name:ee.name}),title:a(f)("Rename"),onClick:wt(ye=>{a(i)(ye,ee)||Xt(ee)},["stop"])},{default:Z(()=>[J(F,{name:"edit-2","fill-type":"line",size:"small",color:"var(--oc-role-on-surface)"})]),_:1},8,["aria-label","title","onClick"])):le("",!0)],2),Ce(C.$slots,"additionalResourceContent",{resource:ee})]),syncEnabled:Z(({item:ee})=>[Ce(C.$slots,"syncEnabled",{resource:ee})]),size:Z(({item:ee})=>[J(xg,{size:ee.size||Number.NaN},null,8,["size"])]),tags:Z(({item:ee})=>[(I(!0),G(Ae,null,Ye(ee.tags.slice(0,2),ye=>(I(),re(rn(a(he)?"router-link":"span"),pt({key:ye},{ref_for:!0},qe(ye),{class:"resource-table-tag-wrapper"}),{default:Z(()=>[je((I(),re(P,{class:"resource-table-tag ml-1 max-w-20",rounded:!0,size:"small"},{default:Z(()=>[J(F,{name:"price-tag-3",size:"small"}),Q("span",dF,R.toDisplayString(ye),1)]),_:2},1024)),[[X,gt(ye)]])]),_:2},1040))),128)),ee.tags.length>2?(I(),re(P,{key:0,size:"small",class:"resource-table-tag-more align-text-bottom cursor-pointer",onClick:v[0]||(v[0]=ye=>a(fe).openSideBar())},{default:Z(()=>[ct(" + "+R.toDisplayString(ee.tags.length-2),1)]),_:2},1024)):le("",!0)]),manager:Z(({item:ee})=>[Ce(C.$slots,"manager",{resource:ee})]),members:Z(({item:ee})=>[Ce(C.$slots,"members",{resource:ee})]),totalQuota:Z(({item:ee})=>[Ce(C.$slots,"totalQuota",{resource:ee})]),usedQuota:Z(({item:ee})=>[Ce(C.$slots,"usedQuota",{resource:ee})]),remainingQuota:Z(({item:ee})=>[Ce(C.$slots,"remainingQuota",{resource:ee})]),mdate:Z(({item:ee})=>[je(Q("span",{tabindex:"0",textContent:R.toDisplayString(dt(ee.mdate))},null,8,fF),[[X,kt(ee.mdate)]])]),indicators:Z(({item:ee})=>[J(Ag,{space:e.space,resource:ee,"disable-handler":a($)(ee)},null,8,["space","resource","disable-handler"])]),sdate:Z(({item:ee})=>[je(Q("span",{tabindex:"0",textContent:R.toDisplayString(dt(ee.sdate))},null,8,pF),[[X,kt(ee.sdate)]])]),ddate:Z(({item:ee})=>[je(Q("p",{tabindex:"0",class:"m-0",textContent:R.toDisplayString(dt(ee.ddate))},null,8,hF),[[X,kt(ee.ddate)]])]),sharedBy:Z(({item:ee})=>[J(U,{class:"flex items-center justify-end flex-row flex-nowrap","is-tooltip-displayed":!0,items:At(ee),"accessible-description":qn(ee),"hover-effect":""},{userAvatars:Z(({avatars:ye,width:Ie})=>[(I(!0),G(Ae,null,Ye(ye,Fe=>(I(),re(a(la),{key:Fe.userId,"user-id":Fe.userId,"user-name":Fe.displayName,width:Ie},null,8,["user-id","user-name","width"]))),128))]),_:1},8,["items","accessible-description"])]),sharedWith:Z(({item:ee})=>[J(U,{class:"flex items-center justify-end flex-row flex-nowrap","data-testid":"resource-table-shared-with",items:En(ee),stacked:!0,"max-displayed":3,"is-tooltip-displayed":!0,"accessible-description":mn(ee),"hover-effect":""},{userAvatars:Z(({avatars:ye,width:Ie})=>[(I(!0),G(Ae,null,Ye(ye,Fe=>(I(),re(a(la),{key:Fe.userId,"user-id":Fe.userId,"user-name":Fe.displayName,width:Ie},null,8,["user-id","user-name","width"]))),128))]),_:1},8,["items","accessible-description"])]),actions:Z(({item:ee})=>[a(j)(ee)?(I(),G("div",mF,[Ce(C.$slots,"quickActions",{resource:ee}),J(_c,{title:ee.name,item:ee,"resource-dom-selector":e.resourceDomSelector,class:"resource-table-btn-action-dropdown",onQuickActionClicked:ye=>a(se)(ye,ee)},{contextMenu:Z(()=>[Ce(C.$slots,"contextMenu",{resource:ee})]),_:2},1032,["title","item","resource-dom-selector","onQuickActionClicked"])])):le("",!0)]),_:2},[!a(m)&&!a(w)?{name:"selectHeader",fn:Z(()=>[Q("div",uF,[je(J(b,{id:"resource-table-select-all",size:"large",label:a(Y),disabled:e.resources.length===a(k).length,"label-hidden":!0,"model-value":a(pe),onClick:wt(a(ne),["stop"])},null,8,["label","disabled","model-value","onClick"]),[[X,{content:a(Y),placement:"bottom"}]])])]),key:"0"}:void 0,!a(m)&&!a(w)?{name:"select",fn:Z(({item:ee})=>[a(_)(ee.id)?(I(),re(a(UE),{key:0,class:"inline-flex ml-1",size:"medium","aria-label":a(f)("File is being processed")},null,8,["aria-label"])):(I(),re(b,{key:1,id:`resource-table-select-${e.resourceDomSelector(ee)}`,label:a(ae)(ee),"label-hidden":!0,size:"large",disabled:a($)(ee),"model-value":a(S)(ee),outline:We(ee),"data-test-selection-resource-name":ee.name,"data-test-selection-resource-path":ee.path,onClick:wt(ye=>a(D)({resource:ee,event:ye}),["stop"])},null,8,["id","label","disabled","model-value","outline","data-test-selection-resource-name","data-test-selection-resource-path","onClick"]))]),key:"1"}:void 0,C.$slots.footer?{name:"footer",fn:Z(()=>[Ce(C.$slots,"footer")]),key:"2"}:void 0]),1040,["class","data","fields","highlighted","disabled","sticky","header-position","drag-drop","hover","item-dom-selector","selection","sort-by","sort-dir","lazy","onDropRowStyling"]),a(B)?(I(),re(Fa,{key:0,to:"body"},[J(Mc,{ref:"ghostElement","preview-items":[a(B),...a(O)]},null,8,["preview-items"])])):le("",!0)],64)}}}),yF={key:0,class:"oc-tile-card-lazy-shimmer h-30 overflow-hidden relative after:absolute after:inset-0 after:transform-[translateX(-100%)] opacity-20 after:animate-shimmer"},bF={class:"z-10 absolute top-0 left-0 [&_input]:not-[.oc-checkbox-checked]:bg-role-surface-container"},wF={key:0,class:"oc-tile-card-loading-spinner z-990 m-2"},SF=["textContent"],TF=["aria-label"],kF={class:"flex justify-between items-center"},CF={class:"flex items-center truncate resource-name-wrapper text-role-on-surface overflow-hidden"},xF={class:"flex items-center"},AF={key:0,class:"text-left my-0 truncate"},EF=["textContent"],Eg=ge({__name:"ResourceTile",props:{resource:{},resourceRoute:{},space:{},isResourceSelected:{type:Boolean,default:!1},isResourceClickable:{type:Boolean,default:!0},isResourceDisabled:{type:Boolean,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},isPathDisplayed:{type:Boolean,default:!1},resourceIconSize:{default:"xlarge"},lazy:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1}},emits:["fileNameClicked","contextmenu","itemVisible","tileClicked"],setup(e,{emit:t}){const n=t,{$gettext:r}=me.useGettext(),{getParentFolderName:o,getParentFolderLink:s}=Cr({space:W(e.space)}),i=nn("observerTarget"),l=A(()=>a(i)?.$el),u=A(()=>e.resource.locked||e.resource.processing),d=A(()=>e.resource.locked?{name:"lock",fillType:"fill"}:e.resource.processing?{name:"loop-right",fillType:"line"}:{}),c=A(()=>e.resource.locked?r("This item is locked"):null),p=A(()=>z.isSpaceResource(e.resource)?e.resource.description:""),{isVisible:f}=e.lazy?Zp({target:l,onVisibleCallback:()=>n("itemVisible")}):{isVisible:W(!0)},h=A(()=>!a(f));return e.lazy||n("itemVisible"),(g,m)=>{const w=oe("oc-spinner"),T=oe("oc-tag"),k=oe("oc-image"),S=oe("oc-icon"),y=Lt("oc-tooltip");return I(),re(a(mc),{ref_key:"observerTarget",ref:i,"body-class":"p-0",class:R.normalizeClass(["oc-tile-card flex flex-col h-full shadow-none [&.item-accentuated]:bg-role-secondary-container",{"oc-tile-card-selected bg-role-secondary-container outline-2 outline-role-outline":e.isResourceSelected,"bg-role-surface-container hover:bg-role-surface-container-highest outline outline-role-surface-container-highest":!e.isResourceSelected,"oc-tile-card-disabled opacity-70 grayscale-60 pointer-events-none":e.isResourceDisabled&&!a(z.isProjectSpaceResource)(e.resource),"state-trashed [&_.tile-preview]:opacity-80 [&_.tile-default-image_svg]:opacity-80 [&_.tile-preview]:grayscale [&_.tile-default-image_svg]:grayscale":e.isResourceDisabled&&a(z.isProjectSpaceResource)(e.resource)}]),"data-item-id":e.resource.id,onContextmenu:m[4]||(m[4]=E=>g.$emit("contextmenu",E))},{default:Z(()=>[h.value?(I(),G("div",yF)):(I(),G(Ae,{key:1},[J(Xi,{class:"oc-card-media-top flex justify-center items-center m-0 w-full relative aspect-[16/9]",resource:e.resource,link:e.resourceRoute,"is-resource-clickable":e.isResourceClickable,tabindex:"-1",onClick:m[1]||(m[1]=E=>g.$emit("fileNameClicked",E))},{default:Z(()=>[Q("div",bF,[e.isLoading?(I(),G("div",wF,[J(w,{"aria-label":a(r)("File is being processed")},null,8,["aria-label"])])):Ce(g.$slots,"selection",{key:1,item:e.resource})]),e.isResourceDisabled&&a(z.isProjectSpaceResource)(e.resource)?(I(),re(T,{key:0,class:"z-10 absolute text-role-on-surface",type:"span"},{default:Z(()=>[Q("span",{textContent:R.toDisplayString(a(r)("Disabled"))},null,8,SF)]),_:1})):le("",!0),je((I(),G("div",{class:R.normalizeClass(["oc-tile-card-preview flex items-center justify-center text-center size-full absolute",{"p-2":e.isResourceSelected,"hover:p-2":!e.isResourceSelected}]),"aria-label":c.value},[Ce(g.$slots,"imageField",{item:e.resource},()=>[e.resource.thumbnail?(I(),re(k,{key:0,class:R.normalizeClass(["tile-preview rounded-t-sm size-full object-cover aspect-[16/9] pointer-events-none",{"rounded-sm":e.isResourceSelected}]),src:e.resource.thumbnail,"data-test-thumbnail-resource-name":e.resource.name,onClick:m[0]||(m[0]=wt(E=>g.$emit("tileClicked",[e.resource,E]),["stop"]))},null,8,["class","src","data-test-thumbnail-resource-name"])):(I(),re(ws,{key:1,resource:e.resource,size:e.resourceIconSize,class:"tile-default-image pt-1 relative"},Fu({_:2},[u.value?{name:"status",fn:Z(()=>[J(S,pt(d.value,{size:"xsmall"}),null,16)]),key:"0"}:void 0]),1032,["resource","size"]))])],10,TF)),[[y,c.value]])]),_:3},8,["resource","link","is-resource-clickable"]),Q("div",{class:"p-2",onClick:m[3]||(m[3]=wt(E=>g.$emit("tileClicked",[e.resource,E]),["stop"]))},[Q("div",kF,[Q("div",CF,[J(Ss,{resource:e.resource,"is-icon-displayed":!1,"is-extension-displayed":e.isExtensionDisplayed,"is-resource-clickable":e.isResourceClickable,"is-path-displayed":e.isPathDisplayed,"parent-folder-name":a(o)(e.resource),"parent-folder-link":a(s)(e.resource),link:e.resourceRoute,onClick:m[2]||(m[2]=wt(E=>g.$emit("fileNameClicked",E),["stop"]))},null,8,["resource","is-extension-displayed","is-resource-clickable","is-path-displayed","parent-folder-name","parent-folder-link","link"])]),Q("div",xF,[Ce(g.$slots,"indicators",{item:e.resource,class:"resource-indicators"}),Ce(g.$slots,"actions",{item:e.resource}),Ce(g.$slots,"contextMenu",{item:e.resource})])]),p.value?(I(),G("p",AF,[Q("span",{class:"text-sm",textContent:R.toDisplayString(p.value)},null,8,EF)])):le("",!0),Ce(g.$slots,"additionalResourceContent",{item:e.resource})])],64))]),_:3},8,["data-item-id","class"])}}}),RF={id:"tiles-view",class:"px-4 pt-2"},DF={class:"flex items-center mb-2 pb-2 oc-tiles-controls"},PF={key:1,class:"oc-tiles-sort"},IF={key:0,class:"flex"},FF={class:"p-1 text-sm"},$F=Le(ge({__name:"ResourceTiles",props:{resources:{default:()=>[]},selectedIds:{default:()=>[]},isSelectable:{type:Boolean,default:!0},space:{},sortFields:{default:()=>[]},sortBy:{},sortDir:{},viewSize:{default:()=>Ft.tilesSizeDefault},dragDrop:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0},areResourcesClickable:{type:Boolean,default:!0},arePathsDisplayed:{type:Boolean,default:!1}},emits:["fileClick","fileDropped","sort","itemVisible","update:selectedIds"],setup(e,{emit:t}){const n=t,{$gettext:r}=me.useGettext(),o=De(),{areFileExtensionsShown:s}=we.storeToRefs(o),{isLocationPicker:i,isFilePicker:l}=Tr(),u=Ec(),d=A(()=>Math.min(a(u),e.viewSize)),c=_t(),{isSideBarOpen:p}=we.storeToRefs(c),{disabledResources:f,isResourceSelected:h,fileContainerClicked:g,fileNameClicked:m,fileCheckboxClicked:w,isResourceDisabled:T,isResourceInDeleteQueue:k,isResourceClickable:S,isResourceCut:y,getResourceLink:E,dragItem:D,dragSelection:$,dragStart:_,fileDropped:L,setDropStyling:V,shouldShowContextDrop:te,showContextMenuOnRightClick:B,showContextMenuOnBtnClick:O,selectAllCheckboxLabel:M,getResourceCheckboxLabel:N,toggleSelectionAll:q,areAllResourcesSelected:j}=Pc({space:A(()=>e.space),resources:A(()=>e.resources),selectedIds:A(()=>e.selectedIds),emit:n}),H=window.__E2E__===!0?!1:e.lazy,se=A(()=>e.sortFields.find(ue=>ue.name===e.sortBy&&ue.sortDir===e.sortDir)||e.sortFields[0]),Y=ue=>{n("sort",{sortBy:ue.name,sortDir:a(ue.sortDir)})},ae=A(()=>{const ue={1:"xlarge",2:"xlarge",3:"xxlarge",4:"xxlarge",5:"xxxlarge",6:"xxxlarge"},Se=a(d);return ue[Se]??"xxlarge"}),ne=W(0),pe=()=>{const ue=document.getElementById("tiles-view"),Se=getComputedStyle(ue),$e=parseInt(Se.getPropertyValue("padding-left"),10)|0,Ve=parseInt(Se.getPropertyValue("padding-right"),10)|0;ne.value=ue.clientWidth-$e-Ve},fe=A(()=>parseFloat(getComputedStyle(document.documentElement).fontSize)),{calculateTileSizePixels:be}=ig(),xe=A(()=>{const ue=[...Array(Ft.tilesSizeMax).keys()].map(Se=>Se+1);return[...new Set(ue.map(Se=>{const $e=be(Se);return $e?Math.round(a(ne)/($e+a(fe))):0}))]}),he=A(()=>{const ue=a(xe);return ue.length<a(d)?ue[ue.length-1]:ue[a(d)-1]}),ie=A(()=>{const ue=a(he)?e.resources.length%a(he):0;return ue?a(he)-ue:0}),de=A(()=>a(ne)/a(he)-a(fe));return Ue(de,ue=>{ue&&!isNaN(ue)&&document.documentElement.style.setProperty("--oc-size-tiles-actual",`${ue}px`)},{immediate:!0}),Ue(xe,ue=>{u.value=Math.max(ue.length,1)}),Ue(p,()=>{pe()}),yt(()=>{window.addEventListener("resize",pe),pe()}),bn(()=>{window.removeEventListener("resize",pe)}),(ue,Se)=>{const $e=oe("oc-checkbox"),Ve=oe("oc-icon"),lt=oe("oc-button"),Tt=oe("oc-list"),ut=oe("oc-filter-chip"),gt=Lt("oc-tooltip");return I(),G("div",RF,[Q("div",DF,[e.isSelectable&&!a(l)?je((I(),re($e,{key:0,id:"tiles-view-select-all",class:"ml-2",size:"large",label:a(M),"label-hidden":!0,disabled:e.resources.length===a(f).length,"model-value":a(j),onClick:wt(a(q),["stop"])},null,8,["label","disabled","model-value","onClick"])),[[gt,a(M)]]):le("",!0),e.sortFields.length?(I(),G("div",PF,[J(ut,{class:"[&_.oc-filter-chip-label]:text-sm","filter-label":a(r)("Sort by"),"selected-item-names":[se.value.label],"has-active-state":!1,"close-on-click":"",raw:""},{default:Z(()=>[J(Tt,null,{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.sortFields,(ve,ke)=>(I(),G("li",{key:ke},[J(lt,{appearance:se.value===ve?"filled":"raw-inverse","color-role":se.value===ve?"secondaryContainer":"surface","no-hover":se.value===ve,"justify-content":"space-between",class:"oc-tiles-sort-filter-chip-item",onClick:qe=>Y(ve)},{default:Z(()=>[Q("span",null,R.toDisplayString(ve.label),1),ve===se.value?(I(),G("div",IF,[J(Ve,{name:"check"})])):le("",!0)]),_:2},1032,["appearance","color-role","no-hover","onClick"])]))),128))]),_:1})]),_:1},8,["filter-label","selected-item-names"])])):le("",!0)]),J(Tt,{class:"oc-tiles grid justify-start gap-3"},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.resources,ve=>(I(),G("li",{key:ve.id,class:"oc-tiles-item has-item-context-menu"},[J(Eg,{resource:ve,space:e.space,"resource-route":a(E)(ve),"is-resource-selected":a(h)(ve),"is-resource-clickable":a(S)(ve,e.areResourcesClickable),"is-resource-disabled":a(T)(ve),"is-extension-displayed":a(s),"is-path-displayed":e.arePathsDisplayed,"resource-icon-size":ae.value,draggable:e.dragDrop,lazy:a(H),"is-loading":a(k)(ve.id),class:R.normalizeClass({"opacity-60":a(y)(ve)}),onContextmenu:ke=>a(B)(ke,ve),onFileNameClicked:wt(ke=>a(m)({resource:ve,event:ke}),["stop"]),onDragstart:ke=>a(_)(ve,ke),onDragenter:wt(ke=>a(V)(ve,!1,ke),["prevent"]),onDragleave:wt(ke=>a(V)(ve,!0,ke),["prevent"]),onDrop:ke=>a(L)(ve,ke),onDragover:Se[0]||(Se[0]=ke=>ke.preventDefault()),onItemVisible:ke=>ue.$emit("itemVisible",ve),onTileClicked:ke=>a(g)({resource:ve,event:ke[1]})},{selection:Z(()=>[e.isSelectable&&!a(i)&&!a(l)?(I(),re($e,{key:0,label:a(N)(ve),"label-hidden":!0,size:"large",class:"inline-flex p-2.5",disabled:a(T)(ve),"model-value":a(h)(ve),"data-test-selection-resource-name":ve.name,"data-test-selection-resource-path":ve.path,onClick:wt(ke=>a(w)({resource:ve,event:ke}),["stop","prevent"])},null,8,["label","disabled","model-value","data-test-selection-resource-name","data-test-selection-resource-path","onClick"])):le("",!0)]),imageField:Z(()=>[Ce(ue.$slots,"image",{resource:ve},void 0,!0)]),indicators:Z(()=>[J(Ag,{space:e.space,class:"ml-2",resource:ve,filter:ke=>["system","sharing"].includes(ke.category),"disable-handler":a(T)(ve)},null,8,["space","resource","filter","disable-handler"])]),actions:Z(()=>[Ce(ue.$slots,"actions",{resource:ve},void 0,!0)]),contextMenu:Z(()=>[a(te)(ve)?(I(),re(a(_c),{key:0,item:ve,title:ve.name,class:"resource-tiles-btn-action-dropdown",onQuickActionClicked:ke=>a(O)(ke,ve)},{contextMenu:Z(()=>[Ce(ue.$slots,"contextMenu",{resource:ve},void 0,!0)]),_:2},1032,["item","title","onQuickActionClicked"])):le("",!0)]),additionalResourceContent:Z(()=>[Ce(ue.$slots,"additionalResourceContent",{resource:ve},void 0,!0)]),_:2},1032,["resource","space","resource-route","is-resource-selected","is-resource-clickable","is-resource-disabled","is-extension-displayed","is-path-displayed","resource-icon-size","draggable","lazy","is-loading","class","onContextmenu","onFileNameClicked","onDragstart","onDragenter","onDragleave","onDrop","onItemVisible","onTileClicked"])]))),128)),(I(!0),G(Ae,null,Ye(ie.value,ve=>(I(),G("li",{key:`ghost-tile-${ve}`,class:"list-item","aria-hidden":!0}))),128))]),_:3}),a(D)?(I(),re(Fa,{key:0,to:"body"},[J(Mc,{ref:"ghostElement","preview-items":[a(D),...a($)]},null,8,["preview-items"])])):le("",!0),Q("div",FF,[Ce(ue.$slots,"footer",{},void 0,!0)])])}}}),[["__scopeId","data-v-6956bf7e"]]),OF=ge({name:"DateFilter",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0},items:{type:Array,required:!0},idAttribute:{type:String,required:!1,default:"id"},displayNameAttribute:{type:String,required:!1,default:"name"}},emits:["selectionChange"],setup:function(e,{emit:t,expose:n}){const r=Re(),{current:o}=me.useGettext(),s=St(),i=Bn(),{currentTheme:l}=we.storeToRefs(i),u=W(),d=W(e.items),c=W(),p=W(),f=W(!1),h=W(),g=`q_${e.filterName}`,m=Pt(g),w=M=>M[e.idAttribute],T=()=>r.push({query:{...po(a(s).query,[g]),...a(u)&&{[g]:w(a(u))}}}),k=M=>a(u)&&w(a(u))===w(M),S=()=>{c.value=void 0,p.value=void 0},y=async M=>{S(),k(M)?u.value=void 0:(u.value=M,a(h).hideDrop()),await T(),t("selectionChange",a(u))},E=()=>{u.value=void 0,f.value=!1,S(),t("selectionChange",a(u)),T()},D=()=>{d.value=e.items},$=()=>{f.value=!1},_=()=>{const M=at(a(m));if(!M)return;const N=e.items.find(q=>w(q)===M);if(N){u.value=N;return}if(a(L)){const q=M.replace("range:",""),j=Number(q.split(" - ")[0]),H=Number(q.split(" - ")[1]);c.value=vt.DateTime.fromMillis(j),p.value=vt.DateTime.fromMillis(H),u.value=a(te)}},L=A(()=>at(a(m))?.startsWith("range:")),V=A(()=>!a(c)||!a(p)?!1:a(c)<=a(p)),te=A(()=>{if(!a(c)||!a(p))return null;const M=Mr(a(c),o,vt.DateTime.DATE_SHORT),N=Mr(a(p),o,vt.DateTime.DATE_SHORT),q=a(c).toMillis(),j=a(p).toMillis();return{[e.idAttribute]:`range:${q} - ${j}`,[e.displayNameAttribute]:`${M} - ${N}`}}),B=async()=>{u.value=a(te),await T(),a(h).hideDrop(),t("selectionChange",a(u))},O=({date:M,error:N},q)=>{if(N){console.error("date could not be set");return}const j=q==="from"?c:p;if(!M){j.value=void 0;return}const H=q==="from"?M.startOf("day"):M.endOf("day");j.value=H};return n({setSelectedItemsBasedOnQuery:_}),yt(()=>{_()}),{clearFilter:E,displayedItems:d,isItemSelected:k,selectedItem:u,onShowDrop:D,onHideDrop:$,filterChip:h,toggleItemSelection:y,setSelectedItemsBasedOnQuery:_,fromDate:c,toDate:p,dateRangeValid:V,applyDateRangeFilter:B,dateRangeApplied:L,setDateRangeDate:O,dateRangeClicked:f,currentTheme:l,queryParam:g}}}),LF={class:"flex items-center truncate"},_F={class:"truncate ml-2"},MF={class:"flex"},NF={class:"my-1"},BF={class:"flex items-center truncate"},jF={class:"truncate ml-2"},zF=["textContent"],UF={class:"flex"},VF={class:"flex items-center justify-between mb-4"},qF=["textContent"],HF={class:"mt-2"},WF={class:"date-filter-apply-btn text-end"};function QF(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-button"),u=oe("oc-list"),d=oe("oc-datepicker"),c=oe("oc-filter-chip");return I(),G("div",{class:R.normalizeClass(["date-filter flex overflow-hidden [&_label]:text-sm",`date-filter-${e.filterName}`])},[J(c,{ref:"filterChip","filter-label":e.filterLabel,"selected-item-names":e.selectedItem?[e.selectedItem[e.displayNameAttribute]]:void 0,onClearFilter:e.clearFilter,onShowDrop:e.onShowDrop,onHideDrop:e.onHideDrop},{default:Z(()=>[J(u,{class:R.normalizeClass({"invisible min-h-[225px] transition-[visibility] duration-[0.4s,0s]":e.dateRangeClicked})},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.displayedItems,(p,f)=>(I(),G("li",{key:f,class:"my-1 first:mt-0 last:mb-0"},[J(l,{class:R.normalizeClass(["date-filter-list-item flex justify-between items-center w-full p-1",{"date-filter-list-item-active":e.isItemSelected(p)}]),"justify-content":"space-between",appearance:"raw","data-testid":p[e.displayNameAttribute],onClick:h=>e.toggleItemSelection(p)},{default:Z(()=>[Q("div",LF,[Q("div",_F,[Ce(e.$slots,"item",{item:p},void 0,!0)])]),Q("div",MF,[e.isItemSelected(p)?(I(),re(i,{key:0,name:"check"})):le("",!0)])]),_:2},1032,["class","data-testid","onClick"])]))),128)),Q("li",NF,[J(l,{class:R.normalizeClass(["date-filter-list-item flex justify-between items-center w-full p-1",{"date-filter-list-item-active":e.dateRangeApplied}]),"justify-content":"space-between",appearance:"raw","data-testid":"custom-date-range",onClick:t[0]||(t[0]=p=>e.dateRangeClicked=!0)},{default:Z(()=>[Q("div",BF,[Q("div",jF,[Q("span",{textContent:R.toDisplayString(e.$gettext("Custom date range"))},null,8,zF)])]),Q("div",UF,[e.dateRangeApplied?(I(),re(i,{key:0,name:"check"})):le("",!0)])]),_:1},8,["class"])])]),_:3},8,["class"]),Q("div",{class:R.normalizeClass(["date-filter-range-panel absolute top-0 p-2 bg-role-surface",{"transform-[translateX(0)] visible":e.dateRangeClicked,"transform-[translateX(100%)] invisible":!e.dateRangeClicked}])},[Q("div",VF,[J(l,{appearance:"raw",class:"date-filter-range-panel-back","aria-label":e.$gettext("Go back to filter options"),onClick:t[1]||(t[1]=p=>e.dateRangeClicked=!1)},{default:Z(()=>[J(i,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"]),Q("span",{textContent:R.toDisplayString(e.$gettext("Custom date range"))},null,8,qF),J(l,{appearance:"raw",class:"date-filter-range-panel-close","aria-label":e.$gettext("Close filter"),onClick:t[2]||(t[2]=p=>e.filterChip.hideDrop())},{default:Z(()=>[J(i,{name:"close"})]),_:1},8,["aria-label"])]),Q("div",HF,[J(d,{label:e.$gettext("From"),"is-clearable":!0,"current-date":e.fromDate,"is-dark":e.currentTheme.isDark,onDateChanged:t[3]||(t[3]=p=>e.setDateRangeDate(p,"from"))},null,8,["label","current-date","is-dark"]),J(d,{label:e.$gettext("To"),"is-clearable":!0,"current-date":e.toDate,"min-date":e.fromDate?e.fromDate:void 0,"is-dark":e.currentTheme.isDark,onDateChanged:t[4]||(t[4]=p=>e.setDateRangeDate(p,"to"))},null,8,["label","current-date","min-date","is-dark"])]),Q("div",WF,[J(l,{size:"small",disabled:!e.dateRangeValid,onClick:e.applyDateRangeFilter},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Apply")),1)]),_:1},8,["disabled","onClick"])])],2)]),_:3},8,["filter-label","selected-item-names","onClearFilter","onShowDrop","onHideDrop"])],2)}const KF=Le(OF,[["render",QF],["__scopeId","data-v-80ea8301"]]),GF=ge({name:"ItemFilterInline",props:{filterName:{type:String,required:!0},filterOptions:{type:Array,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=Re(),r=St(),o=W(e.filterOptions[0].name),s=`q_${e.filterName}`,i=Pt(s),l=d=>n.push({query:{...po(a(r).query,[s]),[s]:d}}),u=async d=>{o.value=d.name,await l(d.name),t("toggleFilter",d)};return yt(()=>{const d=at(a(i));d&&e.filterOptions.some(({name:c})=>c===d)&&(o.value=d,t("toggleFilter",e.filterOptions.find(({name:c})=>c===d)))}),{queryParam:s,activeOption:o,toggleFilter:u}}}),JF=["textContent"];function XF(e,t,n,r,o,s){const i=oe("oc-button");return I(),G("div",null,[Q("div",{class:R.normalizeClass(["item-inline-filter inline-flex outline outline-role-secondary outline-offset-[-1px] rounded-full",`item-inline-filter-${e.filterName}`])},[(I(!0),G(Ae,null,Ye(e.filterOptions,(l,u)=>(I(),re(i,{id:l.name,key:u,class:R.normalizeClass(["item-inline-filter-option py-1 px-2 text-xs first:rounded-l-full last:rounded-r-full h-[26px]",{"item-inline-filter-option-selected":e.activeOption===l.name}]),appearance:e.activeOption===l.name?"filled":"raw-inverse","color-role":e.activeOption===l.name?"secondaryContainer":"surface","no-hover":e.activeOption===l.name,onClick:d=>e.toggleFilter(l)},{default:Z(()=>[Q("span",{class:"truncate item-inline-filter-option-label",textContent:R.toDisplayString(l.label)},null,8,JF)]),_:2},1032,["id","class","appearance","color-role","no-hover","onClick"]))),128))],2)])}const YF=Le(GF,[["render",XF]]),ZF={class:"space-quota"},e$=["textContent"],Rg=ge({__name:"SpaceQuota",props:{spaceQuota:{}},setup(e){const{$gettext:t,current:n}=me.useGettext(),r=A(()=>e.spaceQuota.total?t("%{used} of %{total} used (%{percentage}% used)",{used:a(s),total:a(o),percentage:a(i).toString()}):t("%{used} used (no restriction)",{used:a(s)})),o=A(()=>Ht(e.spaceQuota.total,n)),s=A(()=>Ht(e.spaceQuota.used,n)),i=A(()=>parseFloat((e.spaceQuota.used/e.spaceQuota.total*100).toFixed(2))),l=A(()=>e.spaceQuota.state==="normal"?"var(--oc-role-secondary)":"var(--oc-role-error)");return(u,d)=>{const c=oe("oc-progress");return I(),G("div",ZF,[Q("p",{class:"mb-2 mt-0",textContent:R.toDisplayString(r.value)},null,8,e$),J(c,{value:i.value,max:100,size:"small",color:l.value,"background-color":"var(--oc-role-surface)"},null,8,["value","color"])])}}}),t$=ge({name:"WebDavDetails",props:{space:{type:Object,required:!0}},setup(e){const t=Jn("resource"),n="check",r="file-copy",o=W(r),s=W(r),i=A(()=>vl(a(t).webDavPath)),l=A(()=>e.space?.getWebDavUrl({path:a(t).path}));return{copyWebDAVPathIcon:o,copyWebDAVPathToClipboard:()=>{navigator.clipboard.writeText(a(i)),o.value=n,setTimeout(()=>o.value=r,1500)},copyWebDAVUrlIcon:s,copyWebDAVUrlToClipboard:()=>{navigator.clipboard.writeText(a(l)),s.value=n,setTimeout(()=>s.value=r,1500)},webDavPath:i,webDavUrl:l}}}),n$={class:"flex"},r$=["textContent"],o$={class:"flex"},s$=["textContent"];function i$(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-button"),u=Lt("oc-tooltip");return I(),G(Ae,null,[Q("dt",null,R.toDisplayString(e.$gettext("WebDAV path")),1),Q("dd",n$,[je(Q("div",{class:"truncate",textContent:R.toDisplayString(e.webDavPath)},null,8,r$),[[u,e.webDavPath]]),je((I(),re(l,{class:"ml-2",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV path to clipboard"),"no-hover":"",onClick:e.copyWebDAVPathToClipboard},{default:Z(()=>[J(i,{name:e.copyWebDAVPathIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[u,e.$gettext("Copy WebDAV path")]])]),Q("dt",null,R.toDisplayString(e.$gettext("WebDAV URL")),1),Q("dd",o$,[je(Q("div",{class:"truncate",textContent:R.toDisplayString(e.webDavUrl)},null,8,s$),[[u,e.webDavUrl]]),je((I(),re(l,{class:"ml-2",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV URL to clipboard"),"no-hover":"",onClick:e.copyWebDAVUrlToClipboard},{default:Z(()=>[J(i,{name:e.copyWebDAVUrlIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[u,e.$gettext("Copy WebDAV URL")]])])],64)}const Dg=Le(t$,[["render",i$]]),a$={id:"oc-space-details-sidebar",class:"p-4 bg-role-surface-container rounded-sm"},l$={class:"text-center"},c$={key:1,class:"relative mb-2"},u$=["src"],d$={key:0,class:"flex items-center oc-space-details-sidebar-members mb-2 text-sm gap-2"},f$=["textContent"],p$=["textContent"],h$=["aria-label"],m$=ge({__name:"SpaceDetails",props:{showShareIndicators:{type:Boolean,default:!0}},setup(e){const t=et(),n=De(),{resourceContentsText:r}=ag({showSizeInformation:!1}),o=Re(),{$gettext:s,$ngettext:i,current:l}=me.useGettext(),{loadPreview:u}=Rc(),{openSideBarPanel:d}=_t(),c=He(),{imagesLoading:p}=we.storeToRefs(c),f=tr(),h=Jn("resource"),g=W(""),{user:m}=we.storeToRefs(t),w=A(()=>c.getSpaceMembers(a(h))),T=A(()=>f.linkShares.length),k=A(()=>n.areWebDavDetailsShown),S=A(()=>!st(o,"files-spaces-projects")),y=A(()=>`${Ht(a(h).size,l)}, ${a(r)}`);Ue(()=>a(h).spaceImageData,async()=>{g.value=await u({space:a(h),resource:a(h).spaceImageData?z.buildSpaceImageResource(a(h)):a(h),dimensions:bs.Tile,processor:Ci.enum.fit,cancelRunning:!0,updateStore:!1})},{immediate:!0});const E=A(()=>a(w).length?a(w).filter(z.isManager).map(({sharedWith:H})=>H.id===a(m)?.id?s("%{displayName} (me)",{displayName:H.displayName}):H.displayName).join(", "):z.getSpaceManagers(a(h),f.graphRoles)?.map(({grantedToV2:se})=>se.user?.id===a(m)?.id?s("%{displayName} (me)",{displayName:se.user.displayName}):se.user?.displayName||se.group?.displayName).join(", ")),D=A(()=>gp(a(h).mdate,l)),$=A(()=>a(B)||a(O)),_=A(()=>a(B)&&!a(O)?a(N):!a(B)&&a(O)?a(q):a(M)===1?i("This space has one member and %{linkShareCount} link.","This space has one member and %{linkShareCount} links.",a(T),{linkShareCount:a(T).toString()}):a(T)===1?s("This space has %{memberShareCount} members and one link.",{memberShareCount:a(M).toString()}):s("This space has %{memberShareCount} members and %{linkShareCount} links.",{memberShareCount:a(M).toString(),linkShareCount:a(T).toString()})),L=A(()=>s("Open share panel")),V=A(()=>s("Open link list in share panel")),te=A(()=>s("Open member list in share panel")),B=A(()=>a(M)>0),O=A(()=>a(T)>0),M=A(()=>a(w).length),N=A(()=>i("This space has %{memberShareCount} member.","This space has %{memberShareCount} members.",a(M),{memberShareCount:a(M).toString()})),q=A(()=>i("%{linkShareCount} link giving access.","%{linkShareCount} links giving access.",a(T),{linkShareCount:a(T).toString()}));return(j,H)=>{const se=oe("oc-spinner"),Y=oe("oc-icon"),ae=oe("oc-button"),ne=oe("portal-target");return I(),G("div",a$,[Q("div",l$,[a(p).includes(a(h).id)?(I(),re(se,{key:0,"aria-label":a(s)("Space image is loading")},null,8,["aria-label"])):g.value?(I(),G("div",c$,[Q("img",{src:g.value,alt:"",class:"size-full object-cover aspect-[16/9]"},null,8,u$)])):(I(),re(Y,{key:2,name:"layout-grid",size:"xxlarge",class:"space-default-image px-4 py-4"}))]),e.showShareIndicators&&$.value&&!a(h).disabled?(I(),G("div",d$,[B.value?(I(),re(ae,{key:0,appearance:"raw","aria-label":te.value,"no-hover":"",onClick:H[0]||(H[0]=pe=>a(d)("space-share"))},{default:Z(()=>[J(Y,{name:"group",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):le("",!0),O.value?(I(),re(ae,{key:1,appearance:"raw","aria-label":V.value,"no-hover":"",onClick:H[1]||(H[1]=pe=>a(d)("space-share"))},{default:Z(()=>[J(Y,{name:"link",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):le("",!0),Q("p",{textContent:R.toDisplayString(_.value)},null,8,f$),J(ae,{appearance:"raw","aria-label":L.value,size:"small","no-hover":"",onClick:H[2]||(H[2]=pe=>a(d)("space-share"))},{default:Z(()=>[Q("span",{class:"text-sm",textContent:R.toDisplayString(a(s)("Show"))},null,8,p$)]),_:1},8,["aria-label"])])):le("",!0),Q("dl",{class:"details-list grid grid-cols-[auto_minmax(0,1fr)] m-0","aria-label":a(s)("Overview of the information about the selected space")},[Q("dt",null,R.toDisplayString(a(s)("Last activity")),1),Q("dd",null,R.toDisplayString(D.value),1),a(h).description?(I(),G(Ae,{key:0},[Q("dt",null,R.toDisplayString(a(s)("Subtitle")),1),Q("dd",null,R.toDisplayString(a(h).description),1)],64)):le("",!0),Q("dt",null,R.toDisplayString(a(s)("Manager")),1),Q("dd",null,R.toDisplayString(E.value),1),a(h).disabled?le("",!0):(I(),G(Ae,{key:1},[Q("dt",null,R.toDisplayString(a(s)("Quota")),1),Q("dd",null,[J(Rg,{"space-quota":a(h).spaceQuota},null,8,["space-quota"])])],64)),S.value?(I(),G(Ae,{key:2},[Q("dt",null,R.toDisplayString(a(s)("Size")),1),Q("dd",null,R.toDisplayString(y.value),1)],64)):le("",!0),k.value?(I(),re(Dg,{key:3,space:a(h)},null,8,["space"])):le("",!0),J(ne,{name:"app.files.sidebar.space.details.table","slot-props":{space:a(h),resource:a(h)},multiple:!0},null,8,["slot-props"])],8,h$)])}}}),g$={id:"oc-spaces-details-multiple-sidebar",class:"p-4 bg-role-surface-container rounded-sm"},v$={class:"text-center mb-6 rounded-sm"},y$=["textContent"],b$=ge({__name:"SpaceDetailsMultiple",props:{selectedSpaces:{}},setup(e){const t=me.useGettext(),{$gettext:n,$ngettext:r}=t,o=A(()=>{let f=0;return e.selectedSpaces.forEach(h=>{f+=h.spaceQuota.total}),Ht(f,t.current)}),s=A(()=>{let f=0;return e.selectedSpaces.forEach(h=>{h.disabled||(f+=h.spaceQuota.remaining)}),Ht(f,t.current)}),i=A(()=>{let f=0;return e.selectedSpaces.forEach(h=>{h.disabled||(f+=h.spaceQuota.used)}),Ht(f,t.current)}),l=A(()=>e.selectedSpaces.filter(f=>!f.disabled).length),u=A(()=>e.selectedSpaces.filter(f=>f.disabled).length),d=A(()=>n("Overview of the information about the selected spaces")),c=A(()=>r("%{ itemCount } space selected","%{ itemCount } spaces selected",e.selectedSpaces.length,{itemCount:e.selectedSpaces.length.toString()})),p=A(()=>[{term:n("Total quota:"),definition:a(o).toString()},{term:n("Remaining quota:"),definition:a(s).toString()},{term:n("Used quota:"),definition:a(i).toString()},{term:n("Enabled:"),definition:a(l).toString()},{term:n("Disabled:"),definition:a(u).toString()}]);return(f,h)=>{const g=oe("oc-icon"),m=oe("oc-definition-list");return I(),G("div",g$,[Q("div",v$,[Q("div",null,[J(g,{size:"xxlarge",name:"layout-grid"}),Q("p",{textContent:R.toDisplayString(c.value)},null,8,y$)])]),J(m,{"aria-label":d.value,items:p.value,class:"m-0"},null,8,["aria-label","items"])])}}}),w$=ge({name:"SpaceNoSelection"}),S$={class:"mt-12"},T$={class:"flex flex-col items-center space-info text-center"};function k$(e,t,n,r,o,s){const i=oe("oc-icon"),l=Lt("translate");return I(),G("div",S$,[Q("div",T$,[J(i,{name:"layout-grid",size:"xxlarge"}),je((I(),G("p",null,[...t[0]||(t[0]=[ct("Select a space to view details",-1)])])),[[l]])])])}const C$=Le(w$,[["render",k$]]),x$=ge({name:"CompareSaveDialog",props:{originalObject:{type:Object,required:!0},compareObject:{type:Object,required:!0},confirmButtonDisabled:{type:Boolean,default:()=>!1}},emits:["confirm","revert"],setup(){const e=W(!1);let t;return yt(()=>{t=ze.subscribe("sidebar.entity.saved",()=>{e.value=!0})}),bn(()=>{ze.unsubscribe("sidebar.entity.saved",t)}),{saved:e}},computed:{unsavedChanges(){return!tp(this.originalObject,this.compareObject)},unsavedChangesText(){return this.unsavedChanges?this.$gettext("Unsaved changes"):this.$gettext("No changes")}},watch:{unsavedChanges(){this.unsavedChanges&&(this.saved=!1)},"originalObject.id":function(){this.saved=!1}}}),A$={class:"w-full flex flex-row flex-wrap justify-between items-center"},E$={key:0,class:"flex items-center"},R$=["textContent"],D$={key:1},P$=["textContent"],I$=["textContent"];function F$(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-button");return I(),G("div",A$,[e.saved?(I(),G("span",E$,[J(i,{name:"checkbox-circle"}),Q("span",{class:"ml-2",textContent:R.toDisplayString(e.$gettext("Changes saved"))},null,8,R$)])):(I(),G("span",D$,R.toDisplayString(e.unsavedChangesText),1)),Q("div",null,[J(l,{disabled:!e.unsavedChanges,class:"compare-save-dialog-revert-btn",onClick:t[0]||(t[0]=u=>e.$emit("revert"))},{default:Z(()=>[Q("span",{textContent:R.toDisplayString(e.$gettext("Revert"))},null,8,P$)]),_:1},8,["disabled"]),J(l,{appearance:"filled",class:"compare-save-dialog-confirm-btn",disabled:!e.unsavedChanges||e.confirmButtonDisabled,onClick:t[1]||(t[1]=u=>e.$emit("confirm"))},{default:Z(()=>[Q("span",{textContent:R.toDisplayString(e.$gettext("Save"))},null,8,I$)]),_:1},8,["disabled"])])])}const $$=Le(x$,[["render",F$]]),O$=ey(async()=>(await Promise.resolve().then(()=>DO)).default),L$=ge({name:"CustomComponentTarget",props:{extensionPoint:{type:Object,required:!0}},setup(e){const t=ho(),n=Sp(),r=A(()=>t.requestExtensions(e.extensionPoint)),o=n.extractDefaultExtensionIds(e.extensionPoint,a(r));return{extensions:A(()=>{if(e.extensionPoint.multiple||a(r).length<=1)return a(r);const i=n.getExtensionPreference(e.extensionPoint.id,o);return i.selectedExtensionIds.length?[a(r).find(l=>i.selectedExtensionIds.includes(l.id))||a(r)[0]]:[a(r)[0]]})}}});function _$(e,t,n,r,o,s){return I(!0),G(Ae,null,Ye(e.extensions,i=>(I(),re(rn(i.content),{key:`custom-component-${i.id}`}))),128)}const M$=Le(L$,[["render",_$]]),N$={class:"flex items-center truncate"},B$={class:"truncate"},j$={class:"flex"},z$=ge({__name:"ItemFilter",props:{filterLabel:{},filterName:{},items:{},optionFilterLabel:{default:""},showOptionFilter:{type:Boolean,default:!1},allowMultiple:{type:Boolean,default:!1},idAttribute:{default:"id"},displayNameAttribute:{default:"name"},filterableAttributes:{default:()=>[]},closeOnClick:{type:Boolean,default:!1}},emits:["selectionChange"],setup(e,{expose:t,emit:n}){const r=n,o=Re(),s=St(),i=nn("filterInputRef"),l=W([]),u=W(e.items),d=nn("itemFilterListRef"),c=`q_${e.filterName}`,p=Pt(c),f=$=>$[e.idAttribute],h=()=>o.push({query:{...po(a(s).query,[c]),...!!a(l).length&&{[c]:a(l).reduce(($,_)=>($+=`${f(_)}+`,$),"").slice(0,-1)}}}),g=$=>!!a(l).find(_=>f(_)===f($)),m=async $=>{g($)?l.value=a(l).filter(_=>f(_)!==f($)):(e.allowMultiple||(l.value=[]),l.value.push($)),await h(),r("selectionChange",a(l))},w=W(),T=($,_)=>{if(!(_||"").trim())return $;const V=new Nc($,{...Wa,keys:e.filterableAttributes}).search(_).map(te=>te.item);return $.filter(te=>V.includes(te))},k=()=>{l.value=[],r("selectionChange",a(l)),h()},S=$=>{u.value=$},y=async()=>{S(e.items),await xt(),a(i)?.focus()};let E;Ue(w,()=>{S(T(e.items,a(w))),a(d)&&(E=new Vc(a(d)),E.unmark(),E.mark(a(w),{element:"span",className:"mark-highlight"}))});const D=()=>{const $=at(a(p));if($){const _=$.split("+");l.value=e.items.filter(L=>_.includes(f(L)))}};return t({setSelectedItemsBasedOnQuery:D}),yt(()=>{D()}),($,_)=>{const L=oe("oc-checkbox"),V=oe("oc-icon"),te=oe("oc-button"),B=oe("oc-list"),O=oe("oc-filter-chip");return I(),G("div",{class:R.normalizeClass(["item-filter flex",`item-filter-${e.filterName}`])},[J(O,{"filter-label":e.filterLabel,"selected-item-names":l.value.map(M=>M[e.displayNameAttribute]),"close-on-click":e.closeOnClick,onClearFilter:k,onShowDrop:y},{default:Z(()=>[e.showOptionFilter&&e.filterableAttributes.length?(I(),re(a(xE),{key:0,ref_key:"filterInputRef",ref:i,modelValue:w.value,"onUpdate:modelValue":_[0]||(_[0]=M=>w.value=M),class:"item-filter-input mb-4 mt-2",autocomplete:"off",label:e.optionFilterLabel===""?$.$gettext("Filter list"):e.optionFilterLabel},null,8,["modelValue","label"])):le("",!0),Q("div",{ref_key:"itemFilterListRef",ref:d},[J(B,{class:"item-filter-list"},{default:Z(()=>[(I(!0),G(Ae,null,Ye(u.value,(M,N)=>(I(),G("li",{key:N,class:"my-1"},[J(te,{class:R.normalizeClass(["item-filter-list-item flex items-center w-full",{"item-filter-list-item-active":!e.allowMultiple&&g(M),"justify-start":e.allowMultiple,"justify-between":!e.allowMultiple}]),"justify-content":"space-between",appearance:"raw","data-test-value":M[e.displayNameAttribute],onClick:q=>m(M)},{default:Z(()=>[Q("div",N$,[e.allowMultiple?(I(),re(L,{key:0,size:"large",class:"mr-2",label:$.$gettext("Toggle selection"),"model-value":g(M),"label-hidden":!0,"onUpdate:modelValue":q=>m(M),onClick:_[1]||(_[1]=wt(()=>{},["stop"]))},null,8,["label","model-value","onUpdate:modelValue"])):le("",!0),Q("div",null,[Ce($.$slots,"image",{item:M})]),Q("div",B$,[Ce($.$slots,"item",{item:M})])]),Q("div",j$,[!e.allowMultiple&&g(M)?(I(),re(V,{key:0,name:"check"})):le("",!0)])]),_:2},1032,["class","data-test-value","onClick"])]))),128))]),_:3})],512)]),_:3},8,["filter-label","selected-item-names","close-on-click"])],2)}}}),U$=ge({name:"ItemFilterToggle",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=Re(),r=St(),o=W(!1),s=`q_${e.filterName}`,i=Pt(s),l=()=>n.push({query:{...po(a(r).query,[s]),...a(o)&&{[s]:"true"}}}),u=async()=>{o.value=!a(o),await l(),t("toggleFilter",a(o))};return yt(()=>{at(a(i))==="true"&&(o.value=!0)}),{queryParam:s,filterActive:o,toggleFilter:u}}});function V$(e,t,n,r,o,s){const i=oe("oc-filter-chip");return I(),G("div",{class:R.normalizeClass(["item-filter flex",`item-filter-${e.filterName}`])},[J(i,{"is-toggle":!0,"filter-label":e.filterLabel,"is-toggle-active":e.filterActive,onToggleFilter:e.toggleFilter,onClearFilter:e.toggleFilter},null,8,["filter-label","is-toggle-active","onToggleFilter","onClearFilter"])],2)}const q$=Le(U$,[["render",V$]]),H$=ge({name:"LoadingIndicator",setup(){const e=Ut();let t,n,r;const o=W(e.isLoading),s=W(e.currentProgress),i=()=>{s.value=e.currentProgress,o.value=e.isLoading},l=()=>{s.value=e.currentProgress};return yt(()=>{t=ze.subscribe(Sr.add,i),n=ze.subscribe(Sr.remove,i),r=ze.subscribe(Sr.setProgress,l)}),bn(()=>{ze.unsubscribe(Sr.add,t),ze.unsubscribe(Sr.remove,n),ze.unsubscribe(Sr.setProgress,r)}),{isLoading:o,currentProgress:s}}}),W$={key:0,id:"oc-loading-indicator",class:"w-full"};function Q$(e,t,n,r,o,s){const i=oe("oc-progress");return e.isLoading?(I(),G("div",W$,[J(i,{max:100,indeterminate:e.currentProgress===null,value:e.currentProgress,size:"xsmall"},null,8,["indeterminate","value"])])):le("",!0)}const K$=Le(H$,[["render",Q$]]),G$={class:"no-content-message flex flex-col justify-center items-center text-center"},J$={class:"text-role-on-surface-variant text-xl"},X$={class:"text-role-on-surface-variant"},Y$=Le(ge({__name:"NoContentMessage",props:{icon:{},iconFillType:{default:"fill"}},setup(e){return(t,n)=>{const r=oe("oc-icon");return I(),G("div",G$,[J(r,{name:e.icon,type:"div",size:"xxlarge","fill-type":e.iconFillType,class:"mb-4"},null,8,["name","fill-type"]),Q("div",J$,[Ce(t.$slots,"message",{},void 0,!0)]),Q("div",X$,[Ce(t.$slots,"callToAction",{},void 0,!0)])])}}}),[["__scopeId","data-v-734c490b"]]),Z$=ge({props:{pages:{type:Number,required:!0},currentPage:{type:Number,required:!0}},watch:{currentPage:{handler:function(){document.getElementsByClassName("files-view-wrapper")[0]?.scrollTo(0,0)}}}});function eO(e,t,n,r,o,s){const i=oe("oc-pagination");return e.pages>1?(I(),re(i,{key:0,pages:e.pages,"current-page":e.currentPage,"max-displayed":3,"current-route":e.$route,class:"files-pagination flex justify-center my-2"},null,8,["pages","current-page","current-route"])):le("",!0)}const tO=Le(Z$,[["render",eO]]),nO=ge({name:"SearchBarFilter",props:{currentFolderAvailable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=me.useGettext(),r=Pt("useScope"),o=W(),s=W(),i=A(()=>n(o.value?.title)),l=A(()=>[{id:jr.currentFolder,title:n("Current folder"),enabled:e.currentFolderAvailable},{id:jr.allFiles,title:n("All files"),enabled:!0}]);return Ue(()=>e.currentFolderAvailable,()=>{if(a(r)){if(a(r).toString()==="true"){o.value=a(l).find(({id:c})=>c===jr.currentFolder);return}o.value=a(l).find(({id:c})=>c===jr.allFiles);return}if(!e.currentFolderAvailable){o.value=a(l).find(({id:d})=>d===jr.allFiles);return}if(a(s)){o.value=a(l).find(({id:d})=>d===a(s).id);return}o.value=a(l).find(({id:d})=>d===jr.allFiles)},{immediate:!0}),{currentSelection:o,currentSelectionTitle:i,onOptionSelected:d=>{s.value=d,o.value=d,t("update:modelValue",{value:d})},locationOptions:l}}}),rO={key:0},oO={key:0,class:"flex"};function sO(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-button"),u=oe("oc-list"),d=oe("oc-filter-chip");return I(),G("div",{class:"z-[var(--z-index-modal)] absolute top-[50%] transform-[translateY(-50%)] right-0 ml-4 mb-4 mt-0 mr-[34px] float-right","data-testid":"search-bar-filter",onClick:t[0]||(t[0]=wt(()=>{},["stop"]))},[e.currentSelection?(I(),G("div",rO,[J(d,{"is-toggle":!1,"is-toggle-active":!1,"filter-label":e.$gettext("Location filter"),"selected-item-names":[e.currentSelectionTitle],class:"oc-search-bar-filter [&_button]:items-center [&_.oc-drop]:w-45","has-active-state":!1,raw:"","close-on-click":""},{default:Z(()=>[J(u,null,{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.locationOptions,(c,p)=>(I(),G("li",{key:p},[J(l,{appearance:c.id===e.currentSelection.id?"filled":"raw-inverse","color-role":c.id===e.currentSelection.id?"secondaryContainer":"surface","no-hover":c.id===e.currentSelection.id,size:"medium",class:"flex items-center w-full py-1 px-2","justify-content":"space-between",disabled:!c.enabled,"data-test-id":c.id,onClick:f=>e.onOptionSelected(c)},{default:Z(()=>[Q("span",null,R.toDisplayString(c.title),1),c.id===e.currentSelection.id?(I(),G("div",oO,[J(i,{name:"check"})])):le("",!0)]),_:2},1032,["appearance","color-role","no-hover","disabled","data-test-id","onClick"])]))),128))]),_:1})]),_:1},8,["filter-label","selected-item-names"])])):le("",!0)])}const iO=Le(nO,[["render",sO]]),aO=ge({__name:"PortalTarget",setup(e){const t={...Rs.PortalTarget.props},n=A(()=>t);return yt(()=>{ze.publish(sa.mounted,t)}),(r,o)=>(I(),re(a(Rs.PortalTarget),R.normalizeProps(Wu(n.value)),null,16))}}),lO={key:0},cO={key:0,class:"version-check-loading flex items-center"},uO=["textContent"],dO={key:0,class:"version-check-no-updates flex items-center"},fO=["textContent"],pO=["textContent"],hO=ge({__name:"VersionCheck",setup(e){const{$gettext:t}=me.useGettext(),n=Dt(),r=th(),o=n.capabilities.core["check-for-updates"],{updates:s,isLoading:i,hasError:l}=we.storeToRefs(r),u=A(()=>o&&!a(l)),d=W(!1),c=W(),p=n.status.edition||"rolling",h=n.status.productversion.split("+")[0];return Ue(()=>s,()=>{if(!a(s))return;const g=a(s).channels[p].current_version;bl(g,h)>0&&(d.value=!0,c.value=a(s).channels[p])},{immediate:!0,deep:!0}),(g,m)=>{const w=oe("oc-spinner"),T=oe("oc-icon"),k=oe("oc-button");return u.value?(I(),G("div",lO,[a(i)?(I(),G("div",cO,[Q("span",{textContent:R.toDisplayString(a(t)("Checking for updates"))},null,8,uO),J(w,{class:"ml-1",size:"xsmall"})])):(I(),G(Ae,{key:1},[d.value?(I(),re(k,{key:1,class:"version-check-update text-role-on-surface-variant",size:"small",type:"a",href:c.value.url,target:"_blank","gap-size":"small",appearance:"raw","no-hover":""},{default:Z(()=>[Q("span",{class:"text-xs",textContent:R.toDisplayString(a(t)("Version %{version} available",{version:c.value.current_version}))},null,8,pO),J(T,{name:"refresh",size:"xsmall","fill-type":"line"})]),_:1},8,["href"])):(I(),G("div",dO,[Q("span",{textContent:R.toDisplayString(a(t)("Up to date"))},null,8,fO),J(T,{class:"ml-0.5",name:"checkbox-circle",size:"xsmall","fill-type":"line"})]))],64))])):le("",!0)}}}),mO={toolbarTips:{bold:"Gras",underline:"Souligné",italic:"Italique",strikeThrough:"Barré",title:"Titre",sub:"Indice",sup:"Exposant",quote:"Citation",unorderedList:"Liste",orderedList:"Liste numérique",task:"Liste de tâche",codeRow:"Code intégré",code:"Bloc de code",link:"Lien",image:"Image",table:"Table",mermaid:"Organigramme",katex:"Formule",revoke:"Annuler",next:"Refaire",save:"Sauvegarder",prettier:"Sublimer",pageFullscreen:"Passer en pleine page",fullscreen:"Passer en plein écran",preview:"Prévisualiser",htmlPreview:"Prévisualiser le HTML",catalog:"Table des matières",github:"Code source de l'editeur"},titleItem:{h1:"Titre niveau 1",h2:"Titre niveau 2",h3:"Titre niveau 3",h4:"Titre niveau 4",h5:"Titre niveau 5",h6:"Titre niveau 6"},imgTitleItem:{link:"Ajouter depuis une url",upload:"Télécharger une image",clip2upload:"Télécharger et recadrer"},linkModalTips:{linkTitle:"Ajouter un lien",imageTitle:"Ajouter une image depuis une url",descLabel:"Texte : ",descLabelPlaceHolder:"Entrez un texte...",urlLabel:"Url : ",urlLabelPlaceHolder:"Entrez une url...",buttonOK:"Valider"},clipModalTips:{title:"Télécharger et recadrer une image",buttonUpload:"Valider"},copyCode:{text:"Copier le code",successTips:"Copié",failTips:"La copie a échoué!"},mermaid:{flow:"Organigramme",sequence:"Chronogramme",gantt:"Diagramme de Gantt",class:"Diagramme de classes",state:"Diagramme d'état",pie:"Diagramme circulaire",relationship:"Diagramme de relation",journey:"Diagramme de tâches"},katex:{inline:"Formule en ligne",block:"Formule en bloc"},footer:{markdownTotal:"Nombre de mots",scrollAuto:"Défilement synchronisé"}},gO={toolbarTips:{bold:"Fett",underline:"Unterstrichen",italic:"Kursiv",strikeThrough:"Durchgestrichen",title:"Titel",sub:"Tiefgestellt",sup:"Hochgestellt",quote:"Zitat",unorderedList:"Ungeordnete Liste",orderedList:"Geordnete Liste",task:"Aufgabenliste",codeRow:"Eingebetteter Code",code:"Codeblock",link:"Link",image:"Bild",table:"Tabelle",mermaid:"Flussdiagramm",katex:"Formel",revoke:"Rückgängig machen",next:"Wiederherstellen",save:"Speichern",prettier:"Verschönern",pageFullscreen:"Vollbildmodus",fullscreen:"Vollbild",preview:"Vorschau",htmlPreview:"HTML Vorschau",catalog:"Inhaltsverzeichnis",github:"Quellcode des Editors"},titleItem:{h1:"Überschrift Ebene 1",h2:"Überschrift Ebene 2",h3:"Überschrift Ebene 3",h4:"Überschrift Ebene 4",h5:"Überschrift Ebene 5",h6:"Überschrift Ebene 6"},imgTitleItem:{link:"Bildlink hinzufügen",upload:"Bild hochladen",clip2upload:"Bild zuschneiden und hochladen"},linkModalTips:{linkTitle:"Link hinzufügen",imageTitle:"Bild von URL hinzufügen",descLabel:"Text: ",descLabelPlaceHolder:"Text eingeben...",urlLabel:"URL: ",urlLabelPlaceHolder:"URL eingeben...",buttonOK:"Bestätigen"},clipModalTips:{title:"Bild zuschneiden und hochladen",buttonUpload:"Hochladen"},copyCode:{text:"Code kopieren",successTips:"Kopiert!",failTips:"Kopieren fehlgeschlagen!"},mermaid:{flow:"Flussdiagramm",sequence:"Sequenzdiagramm",gantt:"Gantt-Diagramm",class:"Klassendiagramm",state:"Zustandsdiagramm",pie:"Kreisdiagramm",relationship:"Beziehungsdiagramm",journey:"Reisediagramm"},katex:{inline:"Inline-Formel",block:"Blockformel"},footer:{markdownTotal:"Zeichenanzahl",scrollAuto:"Automatisches Scrollen"}},vO={toolbarTips:{bold:"Grassetto",underline:"Sottolineato",italic:"Corsivo",strikeThrough:"Barrato",title:"Titolo",sub:"Indice",sup:"Esponente",quote:"Citazione",unorderedList:"Elenco non ordinato",orderedList:"Elenco ordinato",task:"Lista di compiti",codeRow:"Codice incorporato",code:"Blocco di codice",link:"Link",image:"Immagine",table:"Tabella",mermaid:"Diagramma",katex:"Formula",revoke:"Annulla",next:"Ripristina",save:"Salva",prettier:"Formatta",pageFullscreen:"Pagina a schermo intero",fullscreen:"Schermo intero",preview:"Anteprima",htmlPreview:"Anteprima HTML",catalog:"Indice",github:"Codice sorgente dell'editor"},titleItem:{h1:"Intestazione Livello 1",h2:"Intestazione Livello 2",h3:"Intestazione Livello 3",h4:"Intestazione Livello 4",h5:"Intestazione Livello 5",h6:"Intestazione Livello 6"},imgTitleItem:{link:"Aggiungi link immagine",upload:"Carica immagine",clip2upload:"Ritaglia e carica immagine"},linkModalTips:{linkTitle:"Aggiungi link",imageTitle:"Aggiungi immagine da URL",descLabel:"Testo: ",descLabelPlaceHolder:"Inserisci il testo...",urlLabel:"URL: ",urlLabelPlaceHolder:"Inserisci l'URL...",buttonOK:"Conferma"},clipModalTips:{title:"Ritaglia e carica immagine",buttonUpload:"Carica"},copyCode:{text:"Copia codice",successTips:"Copiato!",failTips:"Copia fallita!"},mermaid:{flow:"Diagramma di flusso",sequence:"Diagramma di sequenza",gantt:"Diagramma di Gantt",class:"Diagramma di classe",state:"Diagramma di stato",pie:"Diagramma a torta",relationship:"Diagramma di relazione",journey:"Diagramma di viaggio"},katex:{inline:"Formula in linea",block:"Formula a blocco"},footer:{markdownTotal:"Conteggio parole",scrollAuto:"Scorrimento automatico"}},yO={toolbarTips:{bold:"Negrita",underline:"Subrayado",italic:"Cursiva",strikeThrough:"Tachado",title:"Título",sub:"Subíndice",sup:"Superíndice",quote:"Cita",unorderedList:"Lista desordenada",orderedList:"Lista ordenada",task:"Lista de tareas",codeRow:"Código en línea",code:"Bloque de código",link:"Enlace",image:"Imagen",table:"Tabla",mermaid:"Diagrama",katex:"Fórmula",revoke:"Deshacer",next:"Rehacer",save:"Guardar",prettier:"Formatear",pageFullscreen:"Página en pantalla completa",fullscreen:"Pantalla completa",preview:"Vista previa",htmlPreview:"Vista previa del HTML",catalog:"Índice",github:"Código fuente del editor"},titleItem:{h1:"Encabezado de nivel 1",h2:"Encabezado de nivel 2",h3:"Encabezado de nivel 3",h4:"Encabezado de nivel 4",h5:"Encabezado de nivel 5",h6:"Encabezado de nivel 6"},imgTitleItem:{link:"Agregar enlace de imagen",upload:"Subir imagen",clip2upload:"Recortar y subir imagen"},linkModalTips:{linkTitle:"Agregar enlace",imageTitle:"Agregar imagen desde URL",descLabel:"Texto: ",descLabelPlaceHolder:"Introduce el texto...",urlLabel:"Enlace: ",urlLabelPlaceHolder:"Introduce el enlace...",buttonOK:"Confirmar"},clipModalTips:{title:"Recortar y subir imagen",buttonUpload:"Subir"},copyCode:{text:"Copiar código",successTips:"¡Copiado!",failTips:"¡Copia fallida!"},mermaid:{flow:"Diagrama de flujo",sequence:"Diagrama de secuencia",gantt:"Diagrama de Gantt",class:"Diagrama de clase",state:"Diagrama de estado",pie:"Diagrama de pastel",relationship:"Diagrama de relación",journey:"Diagrama de viaje"},katex:{inline:"Fórmula en línea",block:"Fórmula de bloque"},footer:{markdownTotal:"Conteo de letras",scrollAuto:"Desplazamiento automático"}},bO={toolbarTips:{bold:"Pogrubienie",underline:"Podkreślenie",italic:"Kursywa",strikeThrough:"Przekreślenie",title:"Tytuł",sub:"Indeks dolny",sup:"Indeks górny",quote:"Cytat",unorderedList:"Lista nieuporządkowana",orderedList:"Lista uporządkowana",task:"Lista zadań",codeRow:"Wbudowany kod",code:"Blok kodu",link:"Link",image:"Obraz",table:"Tabela",mermaid:"Schemat przepływu",katex:"Formuła",revoke:"Cofnij",next:"Przywróć",save:"Zapisz",prettier:"Upiększ",pageFullscreen:"Pełny ekran strony",fullscreen:"Pełny ekran",preview:"Podgląd",htmlPreview:"Podgląd HTML",catalog:"Spis treści",github:"Kod źródłowy edytora"},titleItem:{h1:"Nagłówek poziom 1",h2:"Nagłówek poziom 2",h3:"Nagłówek poziom 3",h4:"Nagłówek poziom 4",h5:"Nagłówek poziom 5",h6:"Nagłówek poziom 6"},imgTitleItem:{link:"Dodaj link do obrazu",upload:"Prześlij obraz",clip2upload:"Przytnij i prześlij obraz"},linkModalTips:{linkTitle:"Dodaj link",imageTitle:"Dodaj obraz z URL",descLabel:"Tekst: ",descLabelPlaceHolder:"Wpisz tekst...",urlLabel:"URL: ",urlLabelPlaceHolder:"Wpisz URL...",buttonOK:"Potwierdź"},clipModalTips:{title:"Przytnij i prześlij obraz",buttonUpload:"Prześlij"},copyCode:{text:"Skopiuj kod",successTips:"Skopiowano!",failTips:"Nie udało się skopiować!"},mermaid:{flow:"Schemat przepływu",sequence:"Schemat sekwencji",gantt:"Wykres Gantta",class:"Diagram klas",state:"Diagram stanów",pie:"Diagram kołowy",relationship:"Diagram relacji",journey:"Diagram podróży"},katex:{inline:"Formuła inline",block:"Formuła blokowa"},footer:{markdownTotal:"Liczba znaków",scrollAuto:"Automatyczne przewijanie"}},wO={toolbarTips:{bold:"жирный",underline:"подчёркнутый",italic:"курсив",strikeThrough:"зачёркнутый",title:"заголовок",sub:"нижний индекс",sup:"верхний индекс",quote:"цитата",unorderedList:"неупорядоченный список",orderedList:"упорядоченный список",task:"список задач",codeRow:"встроенный код",code:"блочный код",link:"ссылка",image:"изображение",table:"таблица",mermaid:"диаграмма",katex:"формула",revoke:"отмена",next:"вернуть",save:"сохранить",prettier:"форматировать",pageFullscreen:"на всю страницу",fullscreen:"на весь экран",preview:"превью",previewOnly:"только превью",htmlPreview:"превью html",catalog:"каталог",github:"исходный код"},titleItem:{h1:"Заголовок 1-го ур.",h2:"Заголовок 2-го ур.",h3:"Заголовок 3-го ур.",h4:"Заголовок 4-го ур.",h5:"Заголовок 5-го ур.",h6:"Заголовок 6-го ур."},imgTitleItem:{link:"Добавить ссылку на изображение",upload:"Загрузить изображение",clip2upload:"Из буфера обмена"},linkModalTips:{linkTitle:"Добавить ссылку",imageTitle:"Добавить изображение",descLabel:"Описание:",descLabelPlaceHolder:"Введите описание...",urlLabel:"Ссылка:",urlLabelPlaceHolder:"Введите ссылку...",buttonOK:"ОК"},clipModalTips:{title:"Обрезать изображение",buttonUpload:"Загрузить"},copyCode:{text:"Скопировать",successTips:"Скопировано!",failTips:"Не удалось скопировать!"},mermaid:{flow:"цепная",sequence:"последовательная",gantt:"временная",class:"структурная",state:"статусная",pie:"круговая",relationship:"реляционная",journey:"путешествия"},katex:{inline:"встроенная",block:"блочная"},footer:{markdownTotal:"Кол-во символов",scrollAuto:"Автопрокрутка"}},SO={toolbarTips:{bold:"太字",underline:"下線",italic:"斜体",strikeThrough:"取り消し線",title:"タイトル",sub:"下付き文字",sup:"上付き文字",quote:"引用",unorderedList:"番号なし箇条書き",orderedList:"番号付の箇条書き",task:"タスクリスト",codeRow:"インラインコード",code:"ブロックコード",link:"リンク",image:"イメージ",table:"テーブル",mermaid:"mermaid図",katex:"katex数式",revoke:"後退",next:"前進",save:"保存",prettier:"フォーマット",pageFullscreen:"ブラウザのフルスクリーン",fullscreen:"フルスクリーン",preview:"プレビュー",htmlPreview:"htmlプレビュー",catalog:"目次",github:"ギットハブ"},titleItem:{h1:"見出し1",h2:"見出し2",h3:"見出し3",h4:"見出し4",h5:"見出し5",h6:"見出し6"},imgTitleItem:{link:"リンク",upload:"アップロード",clip2upload:"トリミングアップロード"},linkModalTips:{linkTitle:"追加",imageTitle:"イメージ追加",descLabel:"リンクの説明:",descLabelPlaceHolder:"説明を入力してください...",urlLabel:"リンクアドレス:",urlLabelPlaceHolder:"リンクを入力してください...",buttonOK:"確定"},clipModalTips:{title:"トリミング画像のアップロード",buttonUpload:"アップロード"},copyCode:{text:"コードをコピー",successTips:"コピー成功!",failTips:"コピー失敗!"},mermaid:{flow:"フローチャート",sequence:"タイミング図",gantt:"ガントチャート",class:"クラス図",state:"状態図",pie:"円グラフ",relationship:"関係図",journey:"旅路図"},katex:{inline:"インライン数式",block:"ブロック数式"},footer:{markdownTotal:"単語数",scrollAuto:"同期スクロール"}},TO={toolbarTips:{bold:"tebal",underline:"garis bawah",italic:"miring",strikeThrough:"coret sambung",title:"judul",sub:"subscript",sup:"superscript",quote:"quote",unorderedList:"daftar tak berurutan",orderedList:"daftar berurutan",task:"daftar tugas",codeRow:"kode inline",code:"kode blok",link:"tautan",image:"gambar",table:"tabel",mermaid:"mermaid",katex:"rumus",revoke:"membatalkan",next:"membatalkan pembatalan",save:"simpan",prettier:"penataan",pageFullscreen:"layar penuh di halaman",fullscreen:"layar penuh",preview:"pratinjau",htmlPreview:"pratinjau html",catalog:"daftar isi",github:"kode sumber"},titleItem:{h1:"Judul 1",h2:"Judul 2",h3:"Judul 3",h4:"Judul 4",h5:"Judul 5",h6:"Judul 6"},imgTitleItem:{link:"Tambahkan Tautan Gambar",upload:"Unggah Gambar",clip2upload:"Potong dan Unggah"},linkModalTips:{linkTitle:"Tambahkan Tautan",imageTitle:"Tambahkan Gambar",descLabel:"Deskripsi:",descLabelPlaceHolder:"Masukkan deskripsi...",urlLabel:"Tautan:",urlLabelPlaceHolder:"Masukkan tautan...",buttonOK:"OK"},clipModalTips:{title:"Potong dan Unggah Gambar",buttonUpload:"Unggah"},copyCode:{text:"Salin",successTips:"Tersalin!",failTips:"Gagal menyalin!"},mermaid:{flow:"diagram aliran",sequence:"diagram urutan",gantt:"diagram gantt",class:"diagram kelas",state:"diagram status",pie:"diagram pie",relationship:"diagram hubungan",journey:"diagram perjalanan"},katex:{inline:"rumus inline",block:"rumus blok"},footer:{markdownTotal:"Jumlah Kata",scrollAuto:"Gulir Otomatis"}},kO={zh:"zh-CN",fr:"fr-FR",ja:"jp-JP",id:"id-ID",ru:"ru",de:"de-DE",it:"it-IT",es:"es-ES",pl:"pl-PL",en:"en-US"},CO={"fr-FR":mO,"de-DE":gO,"it-IT":vO,"es-ES":yO,"pl-PL":bO,ru:wO,"jp-JP":SO,"id-ID":TO},xO=ge({name:"TextEditor",components:{MdEditor:Ro.MdEditor,MdPreview:Ro.MdPreview,NormalToolbar:Ro.NormalToolbar},props:{applicationConfig:{type:Object,required:!1},currentContent:{type:String,required:!0},markdownMode:{type:Boolean,required:!1,default:!1},isReadOnly:{type:Boolean,required:!1,default:!1},resource:{type:Object,required:!1}},emits:["update:currentContent"],setup(e,{emit:t}){const n=me.useGettext(),{currentTheme:r}=Bn(),o=W(!0),s=A(()=>{const{showPreviewOnlyMd:c=!0}=e.applicationConfig;return{showPreviewOnlyMd:c}}),i=A(()=>e.markdownMode||["md","markdown"].includes(e.resource?.extension)||!a(s).showPreviewOnlyMd),l=A(()=>a(r).isDark?"dark":"light"),u=A(()=>a(i)?["bold","underline","italic","-","title","strikeThrough","sub","sup","quote","unorderedList","orderedList","task","-","codeRow","code","link","image","table","-","revoke","next","=",0,"preview","previewOnly"]:["revoke","next","=",0]);return Ro.config({editorConfig:{languageUserDefined:CO},editorExtensions:{screenfull:{instance:Bg},cropper:{instance:ca}},markdownItPlugins(c){return[...c,{type:"xss",plugin:Ro.XSSPlugin,options:{}}]},codeMirrorExtensions(c){const p=[...c,{type:"lineNumbers",extension:jg.lineNumbers()}],f=p.find(h=>h.type==="linkShortener");return f&&(f.options.maxLength=120),a(i)?p:p.filter(h=>["lineWrapping","keymap","floatingToolbar","lineNumbers"].includes(h.type))}}),{isMarkdown:i,theme:l,toolbars:u,language:n,languages:kO,onUploadImg:async c=>{const f=(await Promise.all([...c].map(g=>new Promise((m,w)=>{const T=new FileReader;T.onload=()=>m(T.result),T.onerror=w,T.readAsDataURL(g)})))).map(g=>`![image](${g})`),h=`${a(e.currentContent)}
33
- ${f.join(`
1
+ (function(x,z){typeof exports=="object"&&typeof module<"u"?z(exports,require("@opencloud-eu/web-client"),require("@casl/vue"),require("vue3-gettext"),require("fuse.js"),require("lodash-es"),require("axios"),require("uuid"),require("@microsoft/fetch-event-source"),require("vue-concurrency"),require("luxon"),require("filesize"),require("qs"),require("password-sheriff"),require("@uppy/core"),require("@uppy/tus"),require("@uppy/xhr-upload"),require("@uppy/utils"),require("pinia"),require("oidc-client-ts"),require("@vueuse/core"),require("dompurify"),require("mark.js"),require("p-queue"),require("cropperjs"),require("vue-router"),require("@vue/shared"),require("md-editor-v3"),require("zod"),require("deepmerge"),require("@sentry/vue"),require("screenfull"),require("@codemirror/view")):typeof define=="function"&&define.amd?define(["exports","@opencloud-eu/web-client","@casl/vue","vue3-gettext","fuse.js","lodash-es","axios","uuid","@microsoft/fetch-event-source","vue-concurrency","luxon","filesize","qs","password-sheriff","@uppy/core","@uppy/tus","@uppy/xhr-upload","@uppy/utils","pinia","oidc-client-ts","@vueuse/core","dompurify","mark.js","p-queue","cropperjs","vue-router","@vue/shared","md-editor-v3","zod","deepmerge","@sentry/vue","screenfull","@codemirror/view"],z):(x=typeof globalThis<"u"?globalThis:x||self,z(x["web-pkg"]={},x.webClient,x.vue,x.vue3Gettext,x.Fuse,x.lodashEs,x.globalAxios,x.uuid,x.fetchEventSource,x.vueConcurrency,x.luxon,x.filesize,x.qs,x.passwordSheriff,x.Uppy,x.Tus,x.XHRUpload,x.utils,x.pinia,x.oidcClientTs,x.core,x.DOMPurify,x.Mark,x.PQueue,x.Cropper,x.vueRouter,x.shared,x.mdEditorV3,x.zod,x.merge$1,x.vue$1,x.screenfull,x.view))})(this,(function(x,z,wc,de,Sc,et,wo,wt,gg,Ft,ht,yg,vg,bg,kc,wg,Sg,Cc,ve,kg,Cn,Tc,xc,sr,ra,Kr,R,ks,G,Ac,Cg,Tg,xg){"use strict";const Ag=e=>e;function Rc(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Rg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ec={exports:{}},dt=Ec.exports={},Tn,xn;function sa(){throw new Error("setTimeout has not been defined")}function oa(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Tn=setTimeout:Tn=sa}catch{Tn=sa}try{typeof clearTimeout=="function"?xn=clearTimeout:xn=oa}catch{xn=oa}})();function Dc(e){if(Tn===setTimeout)return setTimeout(e,0);if((Tn===sa||!Tn)&&setTimeout)return Tn=setTimeout,setTimeout(e,0);try{return Tn(e,0)}catch{try{return Tn.call(null,e,0)}catch{return Tn.call(this,e,0)}}}function Eg(e){if(xn===clearTimeout)return clearTimeout(e);if((xn===oa||!xn)&&clearTimeout)return xn=clearTimeout,clearTimeout(e);try{return xn(e)}catch{try{return xn.call(null,e)}catch{return xn.call(this,e)}}}var Nn=[],Gr=!1,Ar,So=-1;function Dg(){!Gr||!Ar||(Gr=!1,Ar.length?Nn=Ar.concat(Nn):So=-1,Nn.length&&Fc())}function Fc(){if(!Gr){var e=Dc(Dg);Gr=!0;for(var t=Nn.length;t;){for(Ar=Nn,Nn=[];++So<t;)Ar&&Ar[So].run();So=-1,t=Nn.length}Ar=null,Gr=!1,Eg(e)}}dt.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Nn.push(new Ic(e,t)),Nn.length===1&&!Gr&&Dc(Fc)};function Ic(e,t){this.fun=e,this.array=t}Ic.prototype.run=function(){this.fun.apply(null,this.array)},dt.title="browser",dt.browser=!0,dt.env={},dt.argv=[],dt.version="",dt.versions={};function Bn(){}dt.on=Bn,dt.addListener=Bn,dt.once=Bn,dt.off=Bn,dt.removeListener=Bn,dt.removeAllListeners=Bn,dt.emit=Bn,dt.prependListener=Bn,dt.prependOnceListener=Bn,dt.listeners=function(e){return[]},dt.binding=function(e){throw new Error("process.binding is not supported")},dt.cwd=function(){return"/"},dt.chdir=function(e){throw new Error("process.chdir is not supported")},dt.umask=function(){return 0};var Fg=Ec.exports;const ce=Rg(Fg);function An(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let He;const ia=new WeakSet;class Ig{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ia.has(this)&&(ia.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||$c(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Nc(this),Oc(this);const t=He,n=un;He=this,un=!0;try{return this.fn()}finally{ce.env.NODE_ENV!=="production"&&He!==this&&An("Active effect was not restored correctly - this is likely a Vue internal bug."),Lc(this),He=t,un=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)ua(t);this.deps=this.depsTail=void 0,Nc(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ia.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ca(this)&&this.run()}get dirty(){return ca(this)}}let Pc=0,Cs,Ts;function $c(e,t=!1){if(e.flags|=8,t){e.next=Ts,Ts=e;return}e.next=Cs,Cs=e}function aa(){Pc++}function la(){if(--Pc>0)return;if(Ts){let t=Ts;for(Ts=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Cs;){let t=Cs;for(Cs=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function Oc(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Lc(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),ua(r),Pg(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function ca(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(_c(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function _c(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===xs)||(e.globalVersion=xs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ca(e))))return;e.flags|=2;const t=e.dep,n=He,r=un;He=e,un=!0;try{Oc(e);const s=e.fn(e._value);(t.version===0||R.hasChanged(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{He=n,un=r,Lc(e),e.flags&=-3}}function ua(e,t=!1){const{dep:n,prevSub:r,nextSub:s}=e;if(r&&(r.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=r,e.nextSub=void 0),ce.env.NODE_ENV!=="production"&&n.subsHead===e&&(n.subsHead=s),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)ua(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Pg(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let un=!0;const Mc=[];function Jr(){Mc.push(un),un=!1}function Xr(){const e=Mc.pop();un=e===void 0?!0:e}function Nc(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=He;He=void 0;try{t()}finally{He=n}}}let xs=0;class $g{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class ko{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,ce.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){if(!He||!un||He===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==He)n=this.activeLink=new $g(He,this),He.deps?(n.prevDep=He.depsTail,He.depsTail.nextDep=n,He.depsTail=n):He.deps=He.depsTail=n,Bc(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=He.depsTail,n.nextDep=void 0,He.depsTail.nextDep=n,He.depsTail=n,He.deps===n&&(He.deps=r)}return ce.env.NODE_ENV!=="production"&&He.onTrack&&He.onTrack(R.extend({effect:He},t)),n}trigger(t){this.version++,xs++,this.notify(t)}notify(t){aa();try{if(ce.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(R.extend({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{la()}}}function Bc(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)Bc(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),ce.env.NODE_ENV!=="production"&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}const Co=new WeakMap,Rr=Symbol(ce.env.NODE_ENV!=="production"?"Object iterate":""),da=Symbol(ce.env.NODE_ENV!=="production"?"Map keys iterate":""),As=Symbol(ce.env.NODE_ENV!=="production"?"Array iterate":"");function Tt(e,t,n){if(un&&He){let r=Co.get(e);r||Co.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new ko),s.map=r,s.key=n),ce.env.NODE_ENV!=="production"?s.track({target:e,type:t,key:n}):s.track()}}function or(e,t,n,r,s,o){const i=Co.get(e);if(!i){xs++;return}const l=u=>{u&&(ce.env.NODE_ENV!=="production"?u.trigger({target:e,type:t,key:n,newValue:r,oldValue:s,oldTarget:o}):u.trigger())};if(aa(),t==="clear")i.forEach(l);else{const u=R.isArray(e),d=u&&R.isIntegerKey(n);if(u&&n==="length"){const c=Number(r);i.forEach((f,p)=>{(p==="length"||p===As||!R.isSymbol(p)&&p>=c)&&l(f)})}else switch((n!==void 0||i.has(void 0))&&l(i.get(n)),d&&l(i.get(As)),t){case"add":u?d&&l(i.get("length")):(l(i.get(Rr)),R.isMap(e)&&l(i.get(da)));break;case"delete":u||(l(i.get(Rr)),R.isMap(e)&&l(i.get(da)));break;case"set":R.isMap(e)&&l(i.get(Rr));break}}la()}function Og(e,t){const n=Co.get(e);return n&&n.get(t)}function Yr(e){const t=Ne(e);return t===e?t:(Tt(t,"iterate",As),It(e)?t:t.map(fn))}function To(e){return Tt(e=Ne(e),"iterate",As),e}function ir(e,t){return dn(e)?Zr(lr(e)?fn(t):t):fn(t)}const Lg={__proto__:null,[Symbol.iterator](){return fa(this,Symbol.iterator,e=>ir(this,e))},concat(...e){return Yr(this).concat(...e.map(t=>R.isArray(t)?Yr(t):t))},entries(){return fa(this,"entries",e=>(e[1]=ir(this,e[1]),e))},every(e,t){return jn(this,"every",e,t,void 0,arguments)},filter(e,t){return jn(this,"filter",e,t,n=>n.map(r=>ir(this,r)),arguments)},find(e,t){return jn(this,"find",e,t,n=>ir(this,n),arguments)},findIndex(e,t){return jn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return jn(this,"findLast",e,t,n=>ir(this,n),arguments)},findLastIndex(e,t){return jn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return jn(this,"forEach",e,t,void 0,arguments)},includes(...e){return pa(this,"includes",e)},indexOf(...e){return pa(this,"indexOf",e)},join(e){return Yr(this).join(e)},lastIndexOf(...e){return pa(this,"lastIndexOf",e)},map(e,t){return jn(this,"map",e,t,void 0,arguments)},pop(){return Rs(this,"pop")},push(...e){return Rs(this,"push",e)},reduce(e,...t){return jc(this,"reduce",e,t)},reduceRight(e,...t){return jc(this,"reduceRight",e,t)},shift(){return Rs(this,"shift")},some(e,t){return jn(this,"some",e,t,void 0,arguments)},splice(...e){return Rs(this,"splice",e)},toReversed(){return Yr(this).toReversed()},toSorted(e){return Yr(this).toSorted(e)},toSpliced(...e){return Yr(this).toSpliced(...e)},unshift(...e){return Rs(this,"unshift",e)},values(){return fa(this,"values",e=>ir(this,e))}};function fa(e,t,n){const r=To(e),s=r[t]();return r!==e&&!It(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const _g=Array.prototype;function jn(e,t,n,r,s,o){const i=To(e),l=i!==e&&!It(e),u=i[t];if(u!==_g[t]){const f=u.apply(e,o);return l?fn(f):f}let d=n;i!==e&&(l?d=function(f,p){return n.call(this,ir(e,f),p,e)}:n.length>2&&(d=function(f,p){return n.call(this,f,p,e)}));const c=u.call(i,d,r);return l&&s?s(c):c}function jc(e,t,n,r){const s=To(e);let o=n;return s!==e&&(It(e)?n.length>3&&(o=function(i,l,u){return n.call(this,i,l,u,e)}):o=function(i,l,u){return n.call(this,i,ir(e,l),u,e)}),s[t](o,...r)}function pa(e,t,n){const r=Ne(e);Tt(r,"iterate",As);const s=r[t](...n);return(s===-1||s===!1)&&Es(n[0])?(n[0]=Ne(n[0]),r[t](...n)):s}function Rs(e,t,n=[]){Jr(),aa();const r=Ne(e)[t].apply(e,n);return la(),Xr(),r}const Mg=R.makeMap("__proto__,__v_isRef,__isVue"),zc=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(R.isSymbol));function Ng(e){R.isSymbol(e)||(e=String(e));const t=Ne(this);return Tt(t,"has",e),t.hasOwnProperty(e)}class Vc{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(s?o?Qc:Wc:o?Kg:Hc).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=R.isArray(t);if(!s){let u;if(i&&(u=Lg[n]))return u;if(n==="hasOwnProperty")return Ng}const l=Reflect.get(t,n,ct(t)?t:r);if((R.isSymbol(n)?zc.has(n):Mg(n))||(s||Tt(t,"get",n),o))return l;if(ct(l)){const u=i&&R.isIntegerKey(n)?l:l.value;return s&&R.isObject(u)?ar(u):u}return R.isObject(l)?s?ar(l):ga(l):l}}class Bg extends Vc{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=R.isArray(t)&&R.isIntegerKey(n);if(!this._isShallow){const d=dn(o);if(!It(r)&&!dn(r)&&(o=Ne(o),r=Ne(r)),!i&&ct(o)&&!ct(r))return d?(ce.env.NODE_ENV!=="production"&&An(`Set operation on key "${String(n)}" failed: target is readonly.`,t[n]),!0):(o.value=r,!0)}const l=i?Number(n)<t.length:R.hasOwn(t,n),u=Reflect.set(t,n,r,ct(t)?t:s);return t===Ne(s)&&(l?R.hasChanged(r,o)&&or(t,"set",n,r,o):or(t,"add",n,r)),u}deleteProperty(t,n){const r=R.hasOwn(t,n),s=t[n],o=Reflect.deleteProperty(t,n);return o&&r&&or(t,"delete",n,void 0,s),o}has(t,n){const r=Reflect.has(t,n);return(!R.isSymbol(n)||!zc.has(n))&&Tt(t,"has",n),r}ownKeys(t){return Tt(t,"iterate",R.isArray(t)?"length":Rr),Reflect.ownKeys(t)}}class Uc extends Vc{constructor(t=!1){super(!0,t)}set(t,n){return ce.env.NODE_ENV!=="production"&&An(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return ce.env.NODE_ENV!=="production"&&An(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const jg=new Bg,zg=new Uc,Vg=new Uc(!0),ha=e=>e,xo=e=>Reflect.getPrototypeOf(e);function Ug(e,t,n){return function(...r){const s=this.__v_raw,o=Ne(s),i=R.isMap(o),l=e==="entries"||e===Symbol.iterator&&i,u=e==="keys"&&i,d=s[e](...r),c=n?ha:t?Zr:fn;return!t&&Tt(o,"iterate",u?da:Rr),R.extend(Object.create(d),{next(){const{value:f,done:p}=d.next();return p?{value:f,done:p}:{value:l?[c(f[0]),c(f[1])]:c(f),done:p}}})}}function Ao(e){return function(...t){if(ce.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";An(`${R.capitalize(e)} operation ${n}failed: target is readonly.`,Ne(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function qg(e,t){const n={get(s){const o=this.__v_raw,i=Ne(o),l=Ne(s);e||(R.hasChanged(s,l)&&Tt(i,"get",s),Tt(i,"get",l));const{has:u}=xo(i),d=t?ha:e?Zr:fn;if(u.call(i,s))return d(o.get(s));if(u.call(i,l))return d(o.get(l));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&Tt(Ne(s),"iterate",Rr),s.size},has(s){const o=this.__v_raw,i=Ne(o),l=Ne(s);return e||(R.hasChanged(s,l)&&Tt(i,"has",s),Tt(i,"has",l)),s===l?o.has(s):o.has(s)||o.has(l)},forEach(s,o){const i=this,l=i.__v_raw,u=Ne(l),d=t?ha:e?Zr:fn;return!e&&Tt(u,"iterate",Rr),l.forEach((c,f)=>s.call(o,d(c),d(f),i))}};return R.extend(n,e?{add:Ao("add"),set:Ao("set"),delete:Ao("delete"),clear:Ao("clear")}:{add(s){!t&&!It(s)&&!dn(s)&&(s=Ne(s));const o=Ne(this);return xo(o).has.call(o,s)||(o.add(s),or(o,"add",s,s)),this},set(s,o){!t&&!It(o)&&!dn(o)&&(o=Ne(o));const i=Ne(this),{has:l,get:u}=xo(i);let d=l.call(i,s);d?ce.env.NODE_ENV!=="production"&&qc(i,l,s):(s=Ne(s),d=l.call(i,s));const c=u.call(i,s);return i.set(s,o),d?R.hasChanged(o,c)&&or(i,"set",s,o,c):or(i,"add",s,o),this},delete(s){const o=Ne(this),{has:i,get:l}=xo(o);let u=i.call(o,s);u?ce.env.NODE_ENV!=="production"&&qc(o,i,s):(s=Ne(s),u=i.call(o,s));const d=l?l.call(o,s):void 0,c=o.delete(s);return u&&or(o,"delete",s,void 0,d),c},clear(){const s=Ne(this),o=s.size!==0,i=ce.env.NODE_ENV!=="production"?R.isMap(s)?new Map(s):new Set(s):void 0,l=s.clear();return o&&or(s,"clear",void 0,void 0,i),l}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Ug(s,e,t)}),n}function ma(e,t){const n=qg(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(R.hasOwn(n,s)&&s in r?n:r,s,o)}const Hg={get:ma(!1,!1)},Wg={get:ma(!0,!1)},Qg={get:ma(!0,!0)};function qc(e,t,n){const r=Ne(n);if(r!==n&&t.call(e,r)){const s=R.toRawType(e);An(`Reactive ${s} contains both the raw and reactive versions of the same object${s==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Hc=new WeakMap,Kg=new WeakMap,Wc=new WeakMap,Qc=new WeakMap;function Gg(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Jg(e){return e.__v_skip||!Object.isExtensible(e)?0:Gg(R.toRawType(e))}function ga(e){return dn(e)?e:ya(e,!1,jg,Hg,Hc)}function ar(e){return ya(e,!0,zg,Wg,Wc)}function Ro(e){return ya(e,!0,Vg,Qg,Qc)}function ya(e,t,n,r,s){if(!R.isObject(e))return ce.env.NODE_ENV!=="production"&&An(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Jg(e);if(o===0)return e;const i=s.get(e);if(i)return i;const l=new Proxy(e,o===2?r:n);return s.set(e,l),l}function lr(e){return dn(e)?lr(e.__v_raw):!!(e&&e.__v_isReactive)}function dn(e){return!!(e&&e.__v_isReadonly)}function It(e){return!!(e&&e.__v_isShallow)}function Es(e){return e?!!e.__v_raw:!1}function Ne(e){const t=e&&e.__v_raw;return t?Ne(t):e}function Kc(e){return!R.hasOwn(e,"__v_skip")&&Object.isExtensible(e)&&R.def(e,"__v_skip",!0),e}const fn=e=>R.isObject(e)?ga(e):e,Zr=e=>R.isObject(e)?ar(e):e;function ct(e){return e?e.__v_isRef===!0:!1}function H(e){return Gc(e,!1)}function Xg(e){return Gc(e,!0)}function Gc(e,t){return ct(e)?e:new Yg(e,t)}class Yg{constructor(t,n){this.dep=new ko,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Ne(t),this._value=n?t:fn(t),this.__v_isShallow=n}get value(){return ce.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||It(t)||dn(t);t=r?t:Ne(t),R.hasChanged(t,n)&&(this._rawValue=t,this._value=r?t:fn(t),ce.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:n}):this.dep.trigger())}}function a(e){return ct(e)?e.value:e}const Zg={get:(e,t,n)=>t==="__v_raw"?e:a(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return ct(s)&&!ct(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function ey(e){return lr(e)?e:new Proxy(e,Zg)}class ty{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new ko,{get:r,set:s}=t(n.track.bind(n),n.trigger.bind(n));this._get=r,this._set=s}get value(){return this._value=this._get()}set value(t){this._set(t)}}function ny(e){return new ty(e)}class ry{constructor(t,n,r){this._object=t,this._key=n,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0,this._raw=Ne(t);let s=!0,o=t;if(!R.isArray(t)||!R.isIntegerKey(String(n)))do s=!Es(o)||It(o);while(s&&(o=o.__v_raw));this._shallow=s}get value(){let t=this._object[this._key];return this._shallow&&(t=a(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&ct(this._raw[this._key])){const n=this._object[this._key];if(ct(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return Og(this._raw,this._key)}}class sy{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function oy(e,t,n){return ct(e)?e:R.isFunction(e)?new sy(e):R.isObject(e)&&arguments.length>1?iy(e,t,n):H(e)}function iy(e,t,n){return new ry(e,t,n)}class ay{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ko(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=xs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&He!==this)return $c(this,!0),!0;ce.env.NODE_ENV}get value(){const t=ce.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return _c(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter?this.setter(t):ce.env.NODE_ENV!=="production"&&An("Write operation failed: computed value is readonly")}}function ly(e,t,n=!1){let r,s;R.isFunction(e)?r=e:(r=e.get,s=e.set);const o=new ay(r,s,n);return ce.env.NODE_ENV,o}const Eo={},Do=new WeakMap;let Er;function cy(e,t=!1,n=Er){if(n){let r=Do.get(n);r||Do.set(n,r=[]),r.push(e)}else ce.env.NODE_ENV!=="production"&&!t&&An("onWatcherCleanup() was called when there was no active watcher to associate with.")}function uy(e,t,n=R.EMPTY_OBJ){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:l,call:u}=n,d=C=>{(n.onWarn||An)("Invalid watch source: ",C,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},c=C=>s?C:It(C)||s===!1||s===0?zn(C,1):zn(C);let f,p,h,g,m=!1,b=!1;if(ct(e)?(p=()=>e.value,m=It(e)):lr(e)?(p=()=>c(e),m=!0):R.isArray(e)?(b=!0,m=e.some(C=>lr(C)||It(C)),p=()=>e.map(C=>{if(ct(C))return C.value;if(lr(C))return c(C);if(R.isFunction(C))return u?u(C,2):C();ce.env.NODE_ENV!=="production"&&d(C)})):R.isFunction(e)?t?p=u?()=>u(e,2):e:p=()=>{if(h){Jr();try{h()}finally{Xr()}}const C=Er;Er=f;try{return u?u(e,3,[g]):e(g)}finally{Er=C}}:(p=R.NOOP,ce.env.NODE_ENV!=="production"&&d(e)),t&&s){const C=p,A=s===!0?1/0:s;p=()=>zn(C(),A)}const S=()=>{f.stop()};if(o&&t){const C=t;t=(...A)=>{C(...A),S()}}let k=b?new Array(e.length).fill(Eo):Eo;const w=C=>{if(!(!(f.flags&1)||!f.dirty&&!C))if(t){const A=f.run();if(s||m||(b?A.some((I,N)=>R.hasChanged(I,k[N])):R.hasChanged(A,k))){h&&h();const I=Er;Er=f;try{const N=[A,k===Eo?void 0:b&&k[0]===Eo?[]:k,g];k=A,u?u(t,3,N):t(...N)}finally{Er=I}}}else f.run()};return l&&l(w),f=new Ig(p),f.scheduler=i?()=>i(w,!1):w,g=C=>cy(C,!1,f),h=f.onStop=()=>{const C=Do.get(f);if(C){if(u)u(C,4);else for(const A of C)A();Do.delete(f)}},ce.env.NODE_ENV!=="production"&&(f.onTrack=n.onTrack,f.onTrigger=n.onTrigger),t?r?w(!0):k=f.run():i?i(w.bind(null,!0),!0):f.run(),S.pause=f.pause.bind(f),S.resume=f.resume.bind(f),S.stop=S,S}function zn(e,t=1/0,n){if(t<=0||!R.isObject(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ct(e))zn(e.value,t,n);else if(R.isArray(e))for(let r=0;r<e.length;r++)zn(e[r],t,n);else if(R.isSet(e)||R.isMap(e))e.forEach(r=>{zn(r,t,n)});else if(R.isPlainObject(e)){for(const r in e)zn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&zn(e[r],t,n)}return e}const Dr=[];function dy(e){Dr.push(e)}function fy(){Dr.pop()}let va=!1;function Pe(e,...t){if(va)return;va=!0,Jr();const n=Dr.length?Dr[Dr.length-1].component:null,r=n&&n.appContext.config.warnHandler,s=py();if(r)Fo(r,n,11,[e+t.map(o=>{var i,l;return(l=(i=o.toString)==null?void 0:i.call(o))!=null?l:JSON.stringify(o)}).join(""),n&&n.proxy,s.map(({vnode:o})=>`at <${zu(n,o.type)}>`).join(`
2
+ `),s]);else{const o=[`[Vue warn]: ${e}`,...t];s.length&&o.push(`
3
+ `,...hy(s)),console.warn(...o)}Xr(),va=!1}function py(){let e=Dr[Dr.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const r=e.component&&e.component.parent;e=r&&r.vnode}return t}function hy(e){const t=[];return e.forEach((n,r)=>{t.push(...r===0?[]:[`
4
+ `],...my(n))}),t}function my({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",r=e.component?e.component.parent==null:!1,s=` at <${zu(e.component,e.type,r)}`,o=">"+n;return e.props?[s,...gy(e.props),o]:[s+o]}function gy(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(r=>{t.push(...Jc(r,e[r]))}),n.length>3&&t.push(" ..."),t}function Jc(e,t,n){return R.isString(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:ct(t)?(t=Jc(e,Ne(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):R.isFunction(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=Ne(t),n?t:[`${e}=`,t])}function yy(e,t){ce.env.NODE_ENV!=="production"&&e!==void 0&&(typeof e!="number"?Pe(`${t} is not a valid number - got ${JSON.stringify(e)}.`):isNaN(e)&&Pe(`${t} is NaN - the duration expression might be incorrect.`))}const ba={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Fo(e,t,n,r){try{return r?e(...r):e()}catch(s){Po(s,t,n)}}function Io(e,t,n,r){if(R.isFunction(e)){const s=Fo(e,t,n,r);return s&&R.isPromise(s)&&s.catch(o=>{Po(o,t,n)}),s}if(R.isArray(e)){const s=[];for(let o=0;o<e.length;o++)s.push(Io(e[o],t,n,r));return s}else ce.env.NODE_ENV!=="production"&&Pe(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function Po(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||R.EMPTY_OBJ;if(t){let l=t.parent;const u=t.proxy,d=ce.env.NODE_ENV!=="production"?ba[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const c=l.ec;if(c){for(let f=0;f<c.length;f++)if(c[f](e,u,d)===!1)return}l=l.parent}if(o){Jr(),Fo(o,null,10,[e,u,d]),Xr();return}}vy(e,n,s,r,i)}function vy(e,t,n,r=!0,s=!1){if(ce.env.NODE_ENV!=="production"){const o=ba[t];if(n&&dy(n),Pe(`Unhandled error${o?` during execution of ${o}`:""}`),n&&fy(),r)throw e;console.error(e)}else{if(s)throw e;console.error(e)}}const Gt=[];let Vn=-1;const es=[];let cr=null,ts=0;const Xc=Promise.resolve();let $o=null;const by=100;function St(e){const t=$o||Xc;return e?t.then(this?e.bind(this):e):t}function wy(e){let t=Vn+1,n=Gt.length;for(;t<n;){const r=t+n>>>1,s=Gt[r],o=Ds(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function wa(e){if(!(e.flags&1)){const t=Ds(e),n=Gt[Gt.length-1];!n||!(e.flags&2)&&t>=Ds(n)?Gt.push(e):Gt.splice(wy(t),0,e),e.flags|=1,Yc()}}function Yc(){$o||($o=Xc.then(eu))}function Zc(e){R.isArray(e)?es.push(...e):cr&&e.id===-1?cr.splice(ts+1,0,e):e.flags&1||(es.push(e),e.flags|=1),Yc()}function Sy(e){if(es.length){const t=[...new Set(es)].sort((n,r)=>Ds(n)-Ds(r));if(es.length=0,cr){cr.push(...t);return}for(cr=t,ce.env.NODE_ENV!=="production"&&(e=e||new Map),ts=0;ts<cr.length;ts++){const n=cr[ts];ce.env.NODE_ENV!=="production"&&tu(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}cr=null,ts=0}}const Ds=e=>e.id==null?e.flags&2?-1:1/0:e.id;function eu(e){ce.env.NODE_ENV!=="production"&&(e=e||new Map);const t=ce.env.NODE_ENV!=="production"?n=>tu(e,n):R.NOOP;try{for(Vn=0;Vn<Gt.length;Vn++){const n=Gt[Vn];if(n&&!(n.flags&8)){if(ce.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),Fo(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;Vn<Gt.length;Vn++){const n=Gt[Vn];n&&(n.flags&=-2)}Vn=-1,Gt.length=0,Sy(e),$o=null,(Gt.length||es.length)&&eu(e)}}function tu(e,t){const n=e.get(t)||0;if(n>by){const r=t.i,s=r&&Jo(r.type);return Po(`Maximum recursive updates exceeded${s?` in component <${s}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,n+1),!1}let Fs=!1;const Oo=new Map;ce.env.NODE_ENV!=="production"&&(R.getGlobalThis().__VUE_HMR_RUNTIME__={createRecord:Sa(ky),rerender:Sa(Cy),reload:Sa(Ty)});const Lo=new Map;function ky(e,t){return Lo.has(e)?!1:(Lo.set(e,{initialDef:_o(t),instances:new Set}),!0)}function _o(e){return Vu(e)?e.__vccOpts:e}function Cy(e,t){const n=Lo.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(r=>{t&&(r.render=t,_o(r.type).render=t),r.renderCache=[],Fs=!0,r.job.flags&8||r.update(),Fs=!1}))}function Ty(e,t){const n=Lo.get(e);if(!n)return;t=_o(t),nu(n.initialDef,t);const r=[...n.instances];for(let s=0;s<r.length;s++){const o=r[s],i=_o(o.type);let l=Oo.get(i);l||(i!==n.initialDef&&nu(i,t),Oo.set(i,l=new Set)),l.add(o),o.appContext.propsCache.delete(o.type),o.appContext.emitsCache.delete(o.type),o.appContext.optionsCache.delete(o.type),o.ceReload?(l.add(o),o.ceReload(t.styles),l.delete(o)):o.parent?wa(()=>{o.job.flags&8||(Fs=!0,o.parent.update(),Fs=!1,l.delete(o))}):o.appContext.reload?o.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),o.root.ce&&o!==o.root&&o.root.ce._removeChildStyle(i)}Zc(()=>{Oo.clear()})}function nu(e,t){R.extend(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function Sa(e){return(t,n)=>{try{return e(t,n)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let ur,Is=[],ka=!1;function xy(e,...t){ur?ur.emit(e,...t):ka||Is.push({event:e,args:t})}function ru(e,t){var n,r;ur=e,ur?(ur.enabled=!0,Is.forEach(({event:s,args:o})=>ur.emit(s,...o)),Is=[]):typeof window<"u"&&window.HTMLElement&&!((r=(n=window.navigator)==null?void 0:n.userAgent)!=null&&r.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{ru(o,t)}),setTimeout(()=>{ur||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ka=!0,Is=[])},3e3)):(ka=!0,Is=[])}const Ay=Ry("component:updated");function Ry(e){return t=>{xy(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let xt=null,su=null;function ou(e){const t=xt;return xt=e,su=e&&e.type.__scopeId||null,t}function X(e,t=xt,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&Qo(-1);const o=ou(t);let i;try{i=e(...s)}finally{ou(o),r._d&&Qo(1)}return ce.env.NODE_ENV!=="production"&&Ay(t),i};return r._n=!0,r._c=!0,r._d=!0,r}function je(e,t){if(xt===null)return ce.env.NODE_ENV!=="production"&&Pe("withDirectives can only be used inside render functions."),e;const n=ju(xt),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,l,u=R.EMPTY_OBJ]=t[s];o&&(R.isFunction(o)&&(o={mounted:o,updated:o}),o.deep&&zn(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:l,modifiers:u}))}return e}function ns(e,t){if(ce.env.NODE_ENV!=="production"&&(!Ot||Ot.isMounted)&&Pe("provide() can only be used inside setup()."),Ot){let n=Ot.provides;const r=Ot.parent&&Ot.parent.provides;r===n&&(n=Ot.provides=Object.create(r)),n[e]=t}}function Un(e,t,n=!1){const r=rs();if(r||Xy){let s=r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&R.isFunction(t)?t.call(r&&r.proxy):t;ce.env.NODE_ENV!=="production"&&Pe(`injection "${String(e)}" not found.`)}else ce.env.NODE_ENV!=="production"&&Pe("inject() can only be used inside setup() or functional components.")}const Ey=Symbol.for("v-scx"),Dy=()=>{{const e=Un(Ey);return e||ce.env.NODE_ENV!=="production"&&Pe("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function ze(e,t,n){return ce.env.NODE_ENV!=="production"&&!R.isFunction(t)&&Pe("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),iu(e,t,n)}function iu(e,t,n=R.EMPTY_OBJ){const{immediate:r,deep:s,flush:o,once:i}=n;ce.env.NODE_ENV!=="production"&&!t&&(r!==void 0&&Pe('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),s!==void 0&&Pe('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&Pe('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const l=R.extend({},n);ce.env.NODE_ENV!=="production"&&(l.onWarn=Pe);const u=t&&r||!t&&o!=="post";let d;if(ss){if(o==="sync"){const h=Dy();d=h.__watcherHandles||(h.__watcherHandles=[])}else if(!u){const h=()=>{};return h.stop=R.NOOP,h.resume=R.NOOP,h.pause=R.NOOP,h}}const c=Ot;l.call=(h,g,m)=>Io(h,c,g,m);let f=!1;o==="post"?l.scheduler=h=>{Pa(h,c&&c.suspense)}:o!=="sync"&&(f=!0,l.scheduler=(h,g)=>{g?h():wa(h)}),l.augmentJob=h=>{t&&(h.flags|=4),f&&(h.flags|=2,c&&(h.id=c.uid,h.i=c))};const p=uy(e,t,l);return ss&&(d?d.push(p):u&&p()),p}function Fy(e,t,n){const r=this.proxy,s=R.isString(e)?e.includes(".")?Iy(r,e):()=>r[e]:e.bind(r,r);let o;R.isFunction(t)?o=t:(o=t.handler,n=t);const i=Nu(this),l=iu(s,o.bind(r),n);return i(),l}function Iy(e,t){const n=t.split(".");return()=>{let r=e;for(let s=0;s<n.length&&r;s++)r=r[n[s]];return r}}const Py=Symbol("_vte"),au=e=>e.__isTeleport,Fr=e=>e&&(e.disabled||e.disabled===""),lu=e=>e&&(e.defer||e.defer===""),cu=e=>typeof SVGElement<"u"&&e instanceof SVGElement,uu=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ca=(e,t)=>{const n=e&&e.to;if(R.isString(n))if(t){const r=t(n);return ce.env.NODE_ENV!=="production"&&!r&&!Fr(e)&&Pe(`Failed to locate Teleport target with selector "${n}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`),r}else return ce.env.NODE_ENV!=="production"&&Pe("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"),null;else return ce.env.NODE_ENV!=="production"&&!n&&!Fr(e)&&Pe(`Invalid Teleport target: ${n}`),n},du={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,l,u,d){const{mc:c,pc:f,pbc:p,o:{insert:h,querySelector:g,createText:m,createComment:b}}=d,S=Fr(t.props);let{shapeFlag:k,children:w,dynamicChildren:C}=t;if(ce.env.NODE_ENV!=="production"&&Fs&&(u=!1,C=null),e==null){const A=t.el=ce.env.NODE_ENV!=="production"?b("teleport start"):m(""),I=t.anchor=ce.env.NODE_ENV!=="production"?b("teleport end"):m("");h(A,n,r),h(I,n,r);const N=(F,V)=>{k&16&&c(w,F,V,s,o,i,l,u)},_=()=>{const F=t.target=Ca(t.props,g),V=Ta(F,t,m,h);F?(i!=="svg"&&cu(F)?i="svg":i!=="mathml"&&uu(F)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(F),S||(N(F,V),No(t,!1))):ce.env.NODE_ENV!=="production"&&!S&&Pe("Invalid Teleport target on mount:",F,`(${typeof F})`)};S&&(N(n,I),No(t,!0)),lu(t.props)?(t.el.__isMounted=!1,Pa(()=>{_(),delete t.el.__isMounted},o)):_()}else{if(lu(t.props)&&e.el.__isMounted===!1){Pa(()=>{du.process(e,t,n,r,s,o,i,l,u,d)},o);return}t.el=e.el,t.targetStart=e.targetStart;const A=t.anchor=e.anchor,I=t.target=e.target,N=t.targetAnchor=e.targetAnchor,_=Fr(e.props),F=_?n:I,V=_?A:N;if(i==="svg"||cu(I)?i="svg":(i==="mathml"||uu(I))&&(i="mathml"),C?(p(e.dynamicChildren,C,F,s,o,i,l),Fu(e,t,ce.env.NODE_ENV==="production")):u||f(e,t,F,V,s,o,i,l,!1),S)_?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Mo(t,n,A,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const Z=t.target=Ca(t.props,g);Z?Mo(t,Z,null,d,0):ce.env.NODE_ENV!=="production"&&Pe("Invalid Teleport target on update:",I,`(${typeof I})`)}else _&&Mo(t,I,N,d,1);No(t,S)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:l,anchor:u,targetStart:d,targetAnchor:c,target:f,props:p}=e;if(f&&(s(d),s(c)),o&&s(u),i&16){const h=o||!Fr(p);for(let g=0;g<l.length;g++){const m=l[g];r(m,t,n,h,!!m.dynamicChildren)}}},move:Mo,hydrate:$y};function Mo(e,t,n,{o:{insert:r},m:s},o=2){o===0&&r(e.targetAnchor,t,n);const{el:i,anchor:l,shapeFlag:u,children:d,props:c}=e,f=o===2;if(f&&r(i,t,n),(!f||Fr(c))&&u&16)for(let p=0;p<d.length;p++)s(d[p],t,n,2);f&&r(l,t,n)}function $y(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:l,querySelector:u,insert:d,createText:c}},f){function p(b,S){let k=S;for(;k;){if(k&&k.nodeType===8){if(k.data==="teleport start anchor")t.targetStart=k;else if(k.data==="teleport anchor"){t.targetAnchor=k,b._lpa=t.targetAnchor&&i(t.targetAnchor);break}}k=i(k)}}function h(b,S){S.anchor=f(i(b),S,l(b),n,r,s,o)}const g=t.target=Ca(t.props,u),m=Fr(t.props);if(g){const b=g._lpa||g.firstChild;t.shapeFlag&16&&(m?(h(e,t),p(g,b),t.targetAnchor||Ta(g,t,c,d,l(e)===g?e:null)):(t.anchor=i(e),p(g,b),t.targetAnchor||Ta(g,t,c,d),f(b&&i(b),t,g,n,r,s,o))),No(t,m)}else m&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Ps=du;function No(e,t){const n=e.ctx;if(n&&n.ut){let r,s;for(t?(r=e.el,s=e.anchor):(r=e.targetStart,s=e.targetAnchor);r&&r!==s;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function Ta(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Py]=i,e&&(r(o,e,s),r(i,e,s)),i}const qn=Symbol("_leaveCb"),$s=Symbol("_enterCb");function Oy(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ft(()=>{e.isMounted=!0}),Xt(()=>{e.isUnmounting=!0}),e}const Jt=[Function,Array],fu={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Jt,onEnter:Jt,onAfterEnter:Jt,onEnterCancelled:Jt,onBeforeLeave:Jt,onLeave:Jt,onAfterLeave:Jt,onLeaveCancelled:Jt,onBeforeAppear:Jt,onAppear:Jt,onAfterAppear:Jt,onAppearCancelled:Jt},pu=e=>{const t=e.subTree;return t.component?pu(t.component):t},Ly={name:"BaseTransition",props:fu,setup(e,{slots:t}){const n=rs(),r=Oy();return()=>{const s=t.default&&yu(t.default(),!0);if(!s||!s.length)return;const o=hu(s),i=Ne(e),{mode:l}=i;if(ce.env.NODE_ENV!=="production"&&l&&l!=="in-out"&&l!=="out-in"&&l!=="default"&&Pe(`invalid <transition> mode: ${l}`),r.isLeaving)return Aa(o);const u=gu(o);if(!u)return Aa(o);let d=xa(u,i,r,n,f=>d=f);u.type!==Ht&&Bo(u,d);let c=n.subTree&&gu(n.subTree);if(c&&c.type!==Ht&&!$u(c,u)&&pu(n).type!==Ht){let f=xa(c,i,r,n);if(Bo(c,f),l==="out-in"&&u.type!==Ht)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,c=void 0},Aa(o);l==="in-out"&&u.type!==Ht?f.delayLeave=(p,h,g)=>{const m=mu(r,c);m[String(c.key)]=c,p[qn]=()=>{h(),p[qn]=void 0,delete d.delayedLeave,c=void 0},d.delayedLeave=()=>{g(),delete d.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function hu(e){let t=e[0];if(e.length>1){let n=!1;for(const r of e)if(r.type!==Ht){if(ce.env.NODE_ENV!=="production"&&n){Pe("<transition> can only be used on a single element or component. Use <transition-group> for lists.");break}if(t=r,n=!0,ce.env.NODE_ENV==="production")break}}return t}const _y=Ly;function mu(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function xa(e,t,n,r,s){const{appear:o,mode:i,persisted:l=!1,onBeforeEnter:u,onEnter:d,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:p,onLeave:h,onAfterLeave:g,onLeaveCancelled:m,onBeforeAppear:b,onAppear:S,onAfterAppear:k,onAppearCancelled:w}=t,C=String(e.key),A=mu(n,e),I=(F,V)=>{F&&Io(F,r,9,V)},N=(F,V)=>{const Z=V[1];I(F,V),R.isArray(F)?F.every(P=>P.length<=1)&&Z():F.length<=1&&Z()},_={mode:i,persisted:l,beforeEnter(F){let V=u;if(!n.isMounted)if(o)V=b||u;else return;F[qn]&&F[qn](!0);const Z=A[C];Z&&$u(e,Z)&&Z.el[qn]&&Z.el[qn](),I(V,[F])},enter(F){if(A[C]===e)return;let V=d,Z=c,P=f;if(!n.isMounted)if(o)V=S||d,Z=k||c,P=w||f;else return;let $=!1;F[$s]=M=>{$||($=!0,M?I(P,[F]):I(Z,[F]),_.delayedLeave&&_.delayedLeave(),F[$s]=void 0)};const L=F[$s].bind(null,!1);V?N(V,[F,L]):L()},leave(F,V){const Z=String(e.key);if(F[$s]&&F[$s](!0),n.isUnmounting)return V();I(p,[F]);let P=!1;F[qn]=L=>{P||(P=!0,V(),L?I(m,[F]):I(g,[F]),F[qn]=void 0,A[Z]===e&&delete A[Z])};const $=F[qn].bind(null,!1);A[Z]=e,h?N(h,[F,$]):$()},clone(F){const V=xa(F,t,n,r,s);return s&&s(V),V}};return _}function Aa(e){if(Ra(e))return e=dr(e),e.children=null,e}function gu(e){if(!Ra(e))return au(e.type)&&e.children?hu(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&R.isFunction(n.default))return n.default()}}function Bo(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Bo(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function yu(e,t=!1,n){let r=[],s=0;for(let o=0;o<e.length;o++){let i=e[o];const l=n==null?i.key:String(n)+String(i.key!=null?i.key:o);i.type===ke?(i.patchFlag&128&&s++,r=r.concat(yu(i.children,t,l))):(t||i.type!==Ht)&&r.push(l!=null?dr(i,{key:l}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function ge(e,t){return R.isFunction(e)?R.extend({name:e.name},t,{setup:e}):e}function My(){const e=rs();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:(ce.env.NODE_ENV!=="production"&&Pe("useId() is called when there is no active component instance to be associated with."),"")}function Ny(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const By=new WeakSet;function qt(e){const t=rs(),n=Xg(null);if(t){const s=t.refs===R.EMPTY_OBJ?t.refs={}:t.refs;ce.env.NODE_ENV!=="production"&&jy(s,e)?Pe(`useTemplateRef('${e}') already exists.`):Object.defineProperty(s,e,{enumerable:!0,get:()=>n.value,set:o=>n.value=o})}else ce.env.NODE_ENV!=="production"&&Pe("useTemplateRef() is called when there is no active component instance to be associated with.");const r=ce.env.NODE_ENV!=="production"?ar(n):n;return ce.env.NODE_ENV!=="production"&&By.add(r),r}function jy(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const vu=e=>e.nodeType===8;R.getGlobalThis().requestIdleCallback,R.getGlobalThis().cancelIdleCallback;function zy(e,t){if(vu(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(vu(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const Vy=e=>!!e.type.__asyncLoader;function Uy(e){R.isFunction(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:s=200,hydrate:o,timeout:i,suspensible:l=!0,onError:u}=e;let d=null,c,f=0;const p=()=>(f++,d=null,h()),h=()=>{let g;return d||(g=d=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),u)return new Promise((b,S)=>{u(m,()=>b(p()),()=>S(m),f+1)});throw m}).then(m=>{if(g!==d&&d)return d;if(ce.env.NODE_ENV!=="production"&&!m&&Pe("Async component loader resolved to undefined. If you are using retry(), make sure to return its return value."),m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),ce.env.NODE_ENV!=="production"&&m&&!R.isObject(m)&&!R.isFunction(m))throw new Error(`Invalid async component load result: ${m}`);return c=m,m}))};return ge({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(g,m,b){let S=!1;(m.bu||(m.bu=[])).push(()=>S=!0);const k=()=>{if(S){ce.env.NODE_ENV!=="production"&&Pe(`Skipping lazy hydration for component '${Jo(c)||c.__file}': it was updated before lazy hydration performed.`);return}b()},w=o?()=>{const C=o(k,A=>zy(g,A));C&&(m.bum||(m.bum=[])).push(C)}:k;c?w():h().then(()=>!m.isUnmounted&&w())},get __asyncResolved(){return c},setup(){const g=Ot;if(Ny(g),c)return()=>jo(c,g);const m=w=>{d=null,Po(w,g,13,!r)};if(l&&g.suspense||ss)return h().then(w=>()=>jo(w,g)).catch(w=>(m(w),()=>r?Q(r,{error:w}):null));const b=H(!1),S=H(),k=H(!!s);return s&&setTimeout(()=>{k.value=!1},s),i!=null&&setTimeout(()=>{if(!b.value&&!S.value){const w=new Error(`Async component timed out after ${i}ms.`);m(w),S.value=w}},i),h().then(()=>{b.value=!0,g.parent&&Ra(g.parent.vnode)&&g.parent.update()}).catch(w=>{m(w),S.value=w}),()=>{if(b.value&&c)return jo(c,g);if(S.value&&r)return Q(r,{error:S.value});if(n&&!k.value)return jo(n,g)}}})}function jo(e,t){const{ref:n,props:r,children:s,ce:o}=t.vnode,i=Q(e,r,s);return i.ref=n,i.ce=o,delete t.vnode.ce,i}const Ra=e=>e.type.__isKeepAlive;function qy(e,t,n=Ot,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Jr();const l=Nu(n),u=Io(t,n,e,i);return l(),Xr(),u});return r?s.unshift(o):s.push(o),o}else if(ce.env.NODE_ENV!=="production"){const s=R.toHandlerKey(ba[e].replace(/ hook$/,""));Pe(`${s} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const Ea=e=>(t,n=Ot)=>{(!ss||e==="sp")&&qy(e,(...r)=>t(...r),n)},ft=Ea("m"),Xt=Ea("bum"),zo=Ea("um"),Vo="components",Hy="directives";function te(e,t){return Da(Vo,e,!0,t)||e}const bu=Symbol.for("v-ndc");function Yt(e){return R.isString(e)?Da(Vo,e,!1)||e:e||bu}function Bt(e){return Da(Hy,e)}function Da(e,t,n=!0,r=!1){const s=xt||Ot;if(s){const o=s.type;if(e===Vo){const l=Jo(o,!1);if(l&&(l===t||l===R.camelize(t)||l===R.capitalize(R.camelize(t))))return o}const i=wu(s[e]||o[e],t)||wu(s.appContext[e],t);if(!i&&r)return o;if(ce.env.NODE_ENV!=="production"&&n&&!i){const l=e===Vo?`
5
+ If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`:"";Pe(`Failed to resolve ${e.slice(0,-1)}: ${t}${l}`)}return i}else ce.env.NODE_ENV!=="production"&&Pe(`resolve${R.capitalize(e.slice(0,-1))} can only be used in render() or setup().`)}function wu(e,t){return e&&(e[t]||e[R.camelize(t)]||e[R.capitalize(R.camelize(t))])}function Ge(e,t,n,r){let s;const o=n,i=R.isArray(e);if(i||R.isString(e)){const l=i&&lr(e);let u=!1,d=!1;l&&(u=!It(e),d=dn(e),e=To(e)),s=new Array(e.length);for(let c=0,f=e.length;c<f;c++)s[c]=t(u?d?Zr(fn(e[c])):fn(e[c]):e[c],c,void 0,o)}else if(typeof e=="number"){ce.env.NODE_ENV!=="production"&&!Number.isInteger(e)&&Pe(`The v-for range expect an integer value but got ${e}.`),s=new Array(e);for(let l=0;l<e;l++)s[l]=t(l+1,l,void 0,o)}else if(R.isObject(e))if(e[Symbol.iterator])s=Array.from(e,(l,u)=>t(l,u,void 0,o));else{const l=Object.keys(e);s=new Array(l.length);for(let u=0,d=l.length;u<d;u++){const c=l[u];s[u]=t(e[c],c,u,o)}}else s=[];return s}function Su(e,t){for(let n=0;n<t.length;n++){const r=t[n];if(R.isArray(r))for(let s=0;s<r.length;s++)e[r[s].name]=r[s].fn;else r&&(e[r.name]=r.key?(...s)=>{const o=r.fn(...s);return o&&(o.key=r.key),o}:r.fn)}return e}function Se(e,t,n={},r,s){if(xt.ce||xt.parent&&Vy(xt.parent)&&xt.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),D(),ee(ke,null,[Q("slot",n,r&&r())],d?-2:64)}let o=e[t];ce.env.NODE_ENV!=="production"&&o&&o.length>1&&(Pe("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template."),o=()=>[]),o&&o._c&&(o._d=!1),D();const i=o&&ku(o(n)),l=n.key||i&&i.key,u=ee(ke,{key:(l&&!R.isSymbol(l)?l:`_${t}`)+(!i&&r?"_fb":"")},i||(r?r():[]),i&&e._===1?64:-2);return!s&&u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),o&&o._c&&(o._d=!0),u}function ku(e){return e.some(t=>Ko(t)?!(t.type===Ht||t.type===ke&&!ku(t.children)):!0)?e:null}function Uo(e,t){const n={};if(ce.env.NODE_ENV!=="production"&&!R.isObject(e))return Pe("v-on with no argument expects an object value."),n;for(const r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:R.toHandlerKey(r)]=e[r];return n}const Fa=e=>e?sv(e)?ju(e):Fa(e.parent):null,Ia=R.extend(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>ce.env.NODE_ENV!=="production"?Ro(e.props):e.props,$attrs:e=>ce.env.NODE_ENV!=="production"?Ro(e.attrs):e.attrs,$slots:e=>ce.env.NODE_ENV!=="production"?Ro(e.slots):e.slots,$refs:e=>ce.env.NODE_ENV!=="production"?Ro(e.refs):e.refs,$parent:e=>Fa(e.parent),$root:e=>Fa(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Qy(e),$forceUpdate:e=>e.f||(e.f=()=>{wa(e.update)}),$nextTick:e=>e.n||(e.n=St.bind(e.proxy)),$watch:e=>Fy.bind(e)}),Wy={};ce.env.NODE_ENV!=="production"&&(Wy.ownKeys=e=>(Pe("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));function Cu(){return Tu("useSlots").slots}function qo(){return Tu("useAttrs").attrs}function Tu(e){const t=rs();return ce.env.NODE_ENV!=="production"&&!t&&Pe(`${e}() called without active instance.`),t.setupContext||(t.setupContext=iv(t))}function xu(e){return R.isArray(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Qy(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,l=o.get(t);let u;return l?u=l:!s.length&&!n&&!r?u=t:(u={},s.length&&s.forEach(d=>Ho(u,d,i,!0)),Ho(u,t,i)),R.isObject(t)&&o.set(t,u),u}function Ho(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Ho(e,o,n,!0),s&&s.forEach(i=>Ho(e,i,n,!0));for(const i in t)if(r&&i==="expose")ce.env.NODE_ENV!=="production"&&Pe('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const l=Ky[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const Ky={data:Au,props:Eu,emits:Eu,methods:Os,computed:Os,beforeCreate:$t,created:$t,beforeMount:$t,mounted:$t,beforeUpdate:$t,updated:$t,beforeDestroy:$t,beforeUnmount:$t,destroyed:$t,unmounted:$t,activated:$t,deactivated:$t,errorCaptured:$t,serverPrefetch:$t,components:Os,directives:Os,watch:Jy,provide:Au,inject:Gy};function Au(e,t){return t?e?function(){return R.extend(R.isFunction(e)?e.call(this,this):e,R.isFunction(t)?t.call(this,this):t)}:t:e}function Gy(e,t){return Os(Ru(e),Ru(t))}function Ru(e){if(R.isArray(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function $t(e,t){return e?[...new Set([].concat(e,t))]:t}function Os(e,t){return e?R.extend(Object.create(null),e,t):t}function Eu(e,t){return e?R.isArray(e)&&R.isArray(t)?[...new Set([...e,...t])]:R.extend(Object.create(null),xu(e),xu(t??{})):t}function Jy(e,t){if(!e)return t;if(!t)return e;const n=R.extend(Object.create(null),e);for(const r in t)n[r]=$t(e[r],t[r]);return n}let Xy=null;const Yy={},Du=e=>Object.getPrototypeOf(e)===Yy,Pa=ev;function Fu(e,t,n=!1){const r=e.children,s=t.children;if(R.isArray(r)&&R.isArray(s))for(let o=0;o<r.length;o++){const i=r[o];let l=s[o];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=s[o]=Mu(s[o]),l.el=i.el),!n&&l.patchFlag!==-2&&Fu(i,l)),l.type===Iu&&(l.patchFlag===-1&&(l=s[o]=Mu(l)),l.el=i.el),l.type===Ht&&!l.el&&(l.el=i.el),ce.env.NODE_ENV!=="production"&&l.el&&(l.el.__vnode=l)}}const Zy=e=>e.__isSuspense;function ev(e,t){t&&t.pendingBranch?R.isArray(e)?t.effects.push(...e):t.effects.push(e):Zc(e)}const ke=Symbol.for("v-fgt"),Iu=Symbol.for("v-txt"),Ht=Symbol.for("v-cmt"),Wo=[];let Wt=null;function D(e=!1){Wo.push(Wt=e?null:[])}function tv(){Wo.pop(),Wt=Wo[Wo.length-1]||null}let Ls=1;function Qo(e,t=!1){Ls+=e,e<0&&Wt&&t&&(Wt.hasOnce=!0)}function Pu(e){return e.dynamicChildren=Ls>0?Wt||R.EMPTY_ARR:null,tv(),Ls>0&&Wt&&Wt.push(e),e}function K(e,t,n,r,s,o){return Pu(W(e,t,n,r,s,o,!0))}function ee(e,t,n,r,s){return Pu(Q(e,t,n,r,s,!0))}function Ko(e){return e?e.__v_isVNode===!0:!1}function $u(e,t){if(ce.env.NODE_ENV!=="production"&&t.shapeFlag&6&&e.component){const n=Oo.get(t.type);if(n&&n.has(e.component))return e.shapeFlag&=-257,t.shapeFlag&=-513,!1}return e.type===t.type&&e.key===t.key}const nv=(...e)=>Lu(...e),Ou=({key:e})=>e??null,Go=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?R.isString(e)||ct(e)||R.isFunction(e)?{i:xt,r:e,k:t,f:!!n}:e:null);function W(e,t=null,n=null,r=0,s=null,o=e===ke?0:1,i=!1,l=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ou(t),ref:t&&Go(t),scopeId:su,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:xt};return l?($a(u,n),o&128&&e.normalize(u)):n&&(u.shapeFlag|=R.isString(n)?8:16),ce.env.NODE_ENV!=="production"&&u.key!==u.key&&Pe("VNode created with invalid key (NaN). VNode type:",u.type),Ls>0&&!i&&Wt&&(u.patchFlag>0||o&6)&&u.patchFlag!==32&&Wt.push(u),u}const Q=ce.env.NODE_ENV!=="production"?nv:Lu;function Lu(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===bu)&&(ce.env.NODE_ENV!=="production"&&!e&&Pe(`Invalid vnode type when creating vnode: ${e}.`),e=Ht),Ko(e)){const l=dr(e,t,!0);return n&&$a(l,n),Ls>0&&!o&&Wt&&(l.shapeFlag&6?Wt[Wt.indexOf(e)]=l:Wt.push(l)),l.patchFlag=-2,l}if(Vu(e)&&(e=e.__vccOpts),t){t=rv(t);let{class:l,style:u}=t;l&&!R.isString(l)&&(t.class=R.normalizeClass(l)),R.isObject(u)&&(Es(u)&&!R.isArray(u)&&(u=R.extend({},u)),t.style=R.normalizeStyle(u))}const i=R.isString(e)?1:Zy(e)?128:au(e)?64:R.isObject(e)?4:R.isFunction(e)?2:0;return ce.env.NODE_ENV!=="production"&&i&4&&Es(e)&&(e=Ne(e),Pe("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
6
+ Component that was made reactive: `,e)),W(e,t,n,r,s,i,o,!0)}function rv(e){return e?Es(e)||Du(e)?R.extend({},e):e:null}function dr(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:l,transition:u}=e,d=t?at(s||{},t):s,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Ou(d),ref:t&&t.ref?n&&o?R.isArray(o)?o.concat(Go(t)):[o,Go(t)]:Go(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:ce.env.NODE_ENV!=="production"&&i===-1&&R.isArray(l)?l.map(_u):l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ke?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&dr(e.ssContent),ssFallback:e.ssFallback&&dr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&r&&Bo(c,u.clone(c)),c}function _u(e){const t=dr(e);return R.isArray(e.children)&&(t.children=e.children.map(_u)),t}function it(e=" ",t=0){return Q(Iu,null,e,t)}function ie(e="",t=!1){return t?(D(),ee(Ht,null,e)):Q(Ht,null,e)}function Mu(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:dr(e)}function $a(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(R.isArray(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),$a(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!Du(t)?t._ctx=xt:s===3&&xt&&(xt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else R.isFunction(t)?(t={default:t,_ctx:xt},n=32):(t=String(t),r&64?(n=16,t=[it(t)]):n=8);e.children=t,e.shapeFlag|=n}function at(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const s in r)if(s==="class")t.class!==r.class&&(t.class=R.normalizeClass([t.class,r.class]));else if(s==="style")t.style=R.normalizeStyle([t.style,r.style]);else if(R.isOn(s)){const o=t[s],i=r[s];i&&o!==i&&!(R.isArray(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}let Ot=null;const rs=()=>Ot||xt;let Oa;{const e=R.getGlobalThis(),t=(n,r)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(r),o=>{s.length>1?s.forEach(i=>i(o)):s[0](o)}};Oa=t("__VUE_INSTANCE_SETTERS__",n=>Ot=n),t("__VUE_SSR_SETTERS__",n=>ss=n)}const Nu=e=>{const t=Ot;return Oa(e),e.scope.on(),()=>{e.scope.off(),Oa(t)}};function sv(e){return e.vnode.shapeFlag&4}let ss=!1;const Bu=ce.env.NODE_ENV!=="production"?{get(e,t){return Tt(e,"get",""),e[t]},set(){return Pe("setupContext.attrs is readonly."),!1},deleteProperty(){return Pe("setupContext.attrs is readonly."),!1}}:{get(e,t){return Tt(e,"get",""),e[t]}};function ov(e){return new Proxy(e.slots,{get(t,n){return Tt(e,"get","$slots"),t[n]}})}function iv(e){const t=n=>{if(ce.env.NODE_ENV!=="production"&&(e.exposed&&Pe("expose() should be called only once per setup()."),n!=null)){let r=typeof n;r==="object"&&(R.isArray(n)?r="array":ct(n)&&(r="ref")),r!=="object"&&Pe(`expose() should be passed a plain object, received ${r}.`)}e.exposed=n||{}};if(ce.env.NODE_ENV!=="production"){let n,r;return Object.freeze({get attrs(){return n||(n=new Proxy(e.attrs,Bu))},get slots(){return r||(r=ov(e))},get emit(){return(s,...o)=>e.emit(s,...o)},expose:t})}else return{attrs:new Proxy(e.attrs,Bu),slots:e.slots,emit:e.emit,expose:t}}function ju(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ey(Kc(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ia)return Ia[n](e)},has(t,n){return n in t||n in Ia}})):e.proxy}const av=/(?:^|[-_])\w/g,lv=e=>e.replace(av,t=>t.toUpperCase()).replace(/[-_]/g,"");function Jo(e,t=!0){return R.isFunction(e)?e.displayName||e.name:e.name||t&&e.__name}function zu(e,t,n=!1){let r=Jo(t);if(!r&&t.__file){const s=t.__file.match(/([^/\\]+)\.\w+$/);s&&(r=s[1])}if(!r&&e){const s=o=>{for(const i in o)if(o[i]===t)return i};r=s(e.components)||e.parent&&s(e.parent.type.components)||s(e.appContext.components)}return r?lv(r):n?"App":"Anonymous"}function Vu(e){return R.isFunction(e)&&"__vccOpts"in e}const T=(e,t)=>{const n=ly(e,t,ss);if(ce.env.NODE_ENV!=="production"){const r=rs();r&&r.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function Xo(e,t,n){try{Qo(-1);const r=arguments.length;return r===2?R.isObject(t)&&!R.isArray(t)?Ko(t)?Q(e,null,[t]):Q(e,t):Q(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ko(n)&&(n=[n]),Q(e,t,n))}finally{Qo(1)}}function cv(){if(ce.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},n={style:"color:#f5222d"},r={style:"color:#eb2f96"},s={__vue_custom_formatter:!0,header(f){if(!R.isObject(f))return null;if(f.__isVue)return["div",e,"VueInstance"];if(ct(f)){Jr();const p=f.value;return Xr(),["div",{},["span",e,c(f)],"<",l(p),">"]}else{if(lr(f))return["div",{},["span",e,It(f)?"ShallowReactive":"Reactive"],"<",l(f),`>${dn(f)?" (readonly)":""}`];if(dn(f))return["div",{},["span",e,It(f)?"ShallowReadonly":"Readonly"],"<",l(f),">"]}return null},hasBody(f){return f&&f.__isVue},body(f){if(f&&f.__isVue)return["div",{},...o(f.$)]}};function o(f){const p=[];f.type.props&&f.props&&p.push(i("props",Ne(f.props))),f.setupState!==R.EMPTY_OBJ&&p.push(i("setup",f.setupState)),f.data!==R.EMPTY_OBJ&&p.push(i("data",Ne(f.data)));const h=u(f,"computed");h&&p.push(i("computed",h));const g=u(f,"inject");return g&&p.push(i("injected",g)),p.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:f}]]),p}function i(f,p){return p=R.extend({},p),Object.keys(p).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},f],["div",{style:"padding-left:1.25em"},...Object.keys(p).map(h=>["div",{},["span",r,h+": "],l(p[h],!1)])]]:["span",{}]}function l(f,p=!0){return typeof f=="number"?["span",t,f]:typeof f=="string"?["span",n,JSON.stringify(f)]:typeof f=="boolean"?["span",r,f]:R.isObject(f)?["object",{object:p?Ne(f):f}]:["span",n,String(f)]}function u(f,p){const h=f.type;if(R.isFunction(h))return;const g={};for(const m in f.ctx)d(h,m,p)&&(g[m]=f.ctx[m]);return g}function d(f,p,h){const g=f[h];if(R.isArray(g)&&g.includes(p)||R.isObject(g)&&p in g||f.extends&&d(f.extends,p,h)||f.mixins&&f.mixins.some(m=>d(m,p,h)))return!0}function c(f){return It(f)?"ShallowRef":f.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(s):window.devtoolsFormatters=[s]}const Uu=ce.env.NODE_ENV!=="production"?Pe:R.NOOP;ce.env.NODE_ENV,ce.env.NODE_ENV;let uv;const qu=typeof window<"u"&&window.trustedTypes;if(qu)try{uv=qu.createPolicy("vue",{createHTML:e=>e})}catch(e){ce.env.NODE_ENV!=="production"&&Uu(`Error creating trusted types policy: ${e}`)}const fr="transition",_s="animation",Yo=Symbol("_vtc"),Hu={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},dv=R.extend({},fu,Hu),fv=(e=>(e.displayName="Transition",e.props=dv,e))((e,{slots:t})=>Xo(_y,pv(e),t)),Ir=(e,t=[])=>{R.isArray(e)?e.forEach(n=>n(...t)):e&&e(...t)},Wu=e=>e?R.isArray(e)?e.some(t=>t.length>1):e.length>1:!1;function pv(e){const t={};for(const P in e)P in Hu||(t[P]=e[P]);if(e.css===!1)return t;const{name:n="v",type:r,duration:s,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:u=o,appearActiveClass:d=i,appearToClass:c=l,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,g=hv(s),m=g&&g[0],b=g&&g[1],{onBeforeEnter:S,onEnter:k,onEnterCancelled:w,onLeave:C,onLeaveCancelled:A,onBeforeAppear:I=S,onAppear:N=k,onAppearCancelled:_=w}=t,F=(P,$,L,M)=>{P._enterCancelled=M,Pr(P,$?c:l),Pr(P,$?d:i),L&&L()},V=(P,$)=>{P._isLeaving=!1,Pr(P,f),Pr(P,h),Pr(P,p),$&&$()},Z=P=>($,L)=>{const M=P?N:k,j=()=>F($,P,L);Ir(M,[$,j]),Qu(()=>{Pr($,P?u:o),Hn($,P?c:l),Wu(M)||Ku($,r,m,j)})};return R.extend(t,{onBeforeEnter(P){Ir(S,[P]),Hn(P,o),Hn(P,i)},onBeforeAppear(P){Ir(I,[P]),Hn(P,u),Hn(P,d)},onEnter:Z(!1),onAppear:Z(!0),onLeave(P,$){P._isLeaving=!0;const L=()=>V(P,$);Hn(P,f),P._enterCancelled?(Hn(P,p),Xu(P)):(Xu(P),Hn(P,p)),Qu(()=>{P._isLeaving&&(Pr(P,f),Hn(P,h),Wu(C)||Ku(P,r,b,L))}),Ir(C,[P,L])},onEnterCancelled(P){F(P,!1,void 0,!0),Ir(w,[P])},onAppearCancelled(P){F(P,!0,void 0,!0),Ir(_,[P])},onLeaveCancelled(P){V(P),Ir(A,[P])}})}function hv(e){if(e==null)return null;if(R.isObject(e))return[La(e.enter),La(e.leave)];{const t=La(e);return[t,t]}}function La(e){const t=R.toNumber(e);return ce.env.NODE_ENV!=="production"&&yy(t,"<transition> explicit duration"),t}function Hn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Yo]||(e[Yo]=new Set)).add(t)}function Pr(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Yo];n&&(n.delete(t),n.size||(e[Yo]=void 0))}function Qu(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let mv=0;function Ku(e,t,n,r){const s=e._endId=++mv,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:l,propCount:u}=gv(e,t);if(!i)return r();const d=i+"end";let c=0;const f=()=>{e.removeEventListener(d,p),o()},p=h=>{h.target===e&&++c>=u&&f()};setTimeout(()=>{c<u&&f()},l+1),e.addEventListener(d,p)}function gv(e,t){const n=window.getComputedStyle(e),r=g=>(n[g]||"").split(", "),s=r(`${fr}Delay`),o=r(`${fr}Duration`),i=Gu(s,o),l=r(`${_s}Delay`),u=r(`${_s}Duration`),d=Gu(l,u);let c=null,f=0,p=0;t===fr?i>0&&(c=fr,f=i,p=o.length):t===_s?d>0&&(c=_s,f=d,p=u.length):(f=Math.max(i,d),c=f>0?i>d?fr:_s:null,p=c?c===fr?o.length:u.length:0);const h=c===fr&&/\b(?:transform|all)(?:,|$)/.test(r(`${fr}Property`).toString());return{type:c,timeout:f,propCount:p,hasTransform:h}}function Gu(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Ju(n)+Ju(e[r])))}function Ju(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Xu(e){return(e?e.ownerDocument:document).body.offsetHeight}const Yu=Symbol("_vod"),yv=Symbol("_vsh"),Zu={name:"show",beforeMount(e,{value:t},{transition:n}){e[Yu]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Ms(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),Ms(e,!0),r.enter(e)):r.leave(e,()=>{Ms(e,!1)}):Ms(e,t))},beforeUnmount(e,{value:t}){Ms(e,t)}};function Ms(e,t){e.style.display=t?e[Yu]:"none",e[yv]=!t}ce.env.NODE_ENV;function pr(e,t,n,r){e.addEventListener(t,n,r)}const hr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return R.isArray(t)?n=>R.invokeArrayFns(t,n):t};function vv(e){e.target.composing=!0}function ed(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Zt=Symbol("_assign");function td(e,t,n){return t&&(e=e.trim()),n&&(e=R.looseToNumber(e)),e}const _a={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[Zt]=hr(s);const o=r||s.props&&s.props.type==="number";pr(e,t?"change":"input",i=>{i.target.composing||e[Zt](td(e.value,n,o))}),(n||o)&&pr(e,"change",()=>{e.value=td(e.value,n,o)}),t||(pr(e,"compositionstart",vv),pr(e,"compositionend",ed),pr(e,"change",ed))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[Zt]=hr(i),e.composing)return;const l=(o||e.type==="number")&&!/^0\d/.test(e.value)?R.looseToNumber(e.value):e.value,u=t??"";l!==u&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||s&&e.value.trim()===u)||(e.value=u))}},bv={deep:!0,created(e,t,n){e[Zt]=hr(n),pr(e,"change",()=>{const r=e._modelValue,s=os(e),o=e.checked,i=e[Zt];if(R.isArray(r)){const l=R.looseIndexOf(r,s),u=l!==-1;if(o&&!u)i(r.concat(s));else if(!o&&u){const d=[...r];d.splice(l,1),i(d)}}else if(R.isSet(r)){const l=new Set(r);o?l.add(s):l.delete(s),i(l)}else i(sd(e,o))})},mounted:nd,beforeUpdate(e,t,n){e[Zt]=hr(n),nd(e,t,n)}};function nd(e,{value:t,oldValue:n},r){e._modelValue=t;let s;if(R.isArray(t))s=R.looseIndexOf(t,r.props.value)>-1;else if(R.isSet(t))s=t.has(r.props.value);else{if(t===n)return;s=R.looseEqual(t,sd(e,!0))}e.checked!==s&&(e.checked=s)}const wv={created(e,{value:t},n){e.checked=R.looseEqual(t,n.props.value),e[Zt]=hr(n),pr(e,"change",()=>{e[Zt](os(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Zt]=hr(r),t!==n&&(e.checked=R.looseEqual(t,r.props.value))}},Sv={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const s=R.isSet(t);pr(e,"change",()=>{const o=Array.prototype.filter.call(e.options,i=>i.selected).map(i=>n?R.looseToNumber(os(i)):os(i));e[Zt](e.multiple?s?new Set(o):o:o[0]),e._assigning=!0,St(()=>{e._assigning=!1})}),e[Zt]=hr(r)},mounted(e,{value:t}){rd(e,t)},beforeUpdate(e,t,n){e[Zt]=hr(n)},updated(e,{value:t}){e._assigning||rd(e,t)}};function rd(e,t){const n=e.multiple,r=R.isArray(t);if(n&&!r&&!R.isSet(t)){ce.env.NODE_ENV!=="production"&&Uu(`<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(t).slice(8,-1)}.`);return}for(let s=0,o=e.options.length;s<o;s++){const i=e.options[s],l=os(i);if(n)if(r){const u=typeof l;u==="string"||u==="number"?i.selected=t.some(d=>String(d)===String(l)):i.selected=R.looseIndexOf(t,l)>-1}else i.selected=t.has(l);else if(R.looseEqual(os(i),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}function os(e){return"_value"in e?e._value:e.value}function sd(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const kv={created(e,t,n){Zo(e,t,n,null,"created")},mounted(e,t,n){Zo(e,t,n,null,"mounted")},beforeUpdate(e,t,n,r){Zo(e,t,n,r,"beforeUpdate")},updated(e,t,n,r){Zo(e,t,n,r,"updated")}};function Cv(e,t){switch(e){case"SELECT":return Sv;case"TEXTAREA":return _a;default:switch(t){case"checkbox":return bv;case"radio":return wv;default:return _a}}}function Zo(e,t,n,r,s){const i=Cv(e.tagName,n.props&&n.props.type)[s];i&&i(e,t,n,r)}const Tv=["ctrl","shift","alt","meta"],xv={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Tv.some(n=>e[`${n}Key`]&&!t.includes(n))},kt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...o)=>{for(let i=0;i<t.length;i++){const l=xv[t[i]];if(l&&l(s,t))return}return e(s,...o)}))},Av={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ns=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=R.hyphenate(s.key);if(t.some(i=>i===o||Av[i]===o))return e(s)}))};function Rv(){cv()}ce.env.NODE_ENV!=="production"&&Rv();const Lt=()=>wc.useAbility();function od(e){if(e===void 0)throw new Error('cloneStateObject: cannot clone "undefined"');return JSON.parse(JSON.stringify(e))}const Bs=(e,t)=>!e||!t?!1:e.id===t.id;function Ev(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ma,id;function Dv(){if(id)return Ma;id=1;function e(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function t(s,o){for(var i="",l=0,u=-1,d=0,c,f=0;f<=s.length;++f){if(f<s.length)c=s.charCodeAt(f);else{if(c===47)break;c=47}if(c===47){if(!(u===f-1||d===1))if(u!==f-1&&d===2){if(i.length<2||l!==2||i.charCodeAt(i.length-1)!==46||i.charCodeAt(i.length-2)!==46){if(i.length>2){var p=i.lastIndexOf("/");if(p!==i.length-1){p===-1?(i="",l=0):(i=i.slice(0,p),l=i.length-1-i.lastIndexOf("/")),u=f,d=0;continue}}else if(i.length===2||i.length===1){i="",l=0,u=f,d=0;continue}}o&&(i.length>0?i+="/..":i="..",l=2)}else i.length>0?i+="/"+s.slice(u+1,f):i=s.slice(u+1,f),l=f-u-1;u=f,d=0}else c===46&&d!==-1?++d:d=-1}return i}function n(s,o){var i=o.dir||o.root,l=o.base||(o.name||"")+(o.ext||"");return i?i===o.root?i+l:i+s+l:l}var r={resolve:function(){for(var o="",i=!1,l,u=arguments.length-1;u>=-1&&!i;u--){var d;u>=0?d=arguments[u]:(l===void 0&&(l=ce.cwd()),d=l),e(d),d.length!==0&&(o=d+"/"+o,i=d.charCodeAt(0)===47)}return o=t(o,!i),i?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(o){if(e(o),o.length===0)return".";var i=o.charCodeAt(0)===47,l=o.charCodeAt(o.length-1)===47;return o=t(o,!i),o.length===0&&!i&&(o="."),o.length>0&&l&&(o+="/"),i?"/"+o:o},isAbsolute:function(o){return e(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,i=0;i<arguments.length;++i){var l=arguments[i];e(l),l.length>0&&(o===void 0?o=l:o+="/"+l)}return o===void 0?".":r.normalize(o)},relative:function(o,i){if(e(o),e(i),o===i||(o=r.resolve(o),i=r.resolve(i),o===i))return"";for(var l=1;l<o.length&&o.charCodeAt(l)===47;++l);for(var u=o.length,d=u-l,c=1;c<i.length&&i.charCodeAt(c)===47;++c);for(var f=i.length,p=f-c,h=d<p?d:p,g=-1,m=0;m<=h;++m){if(m===h){if(p>h){if(i.charCodeAt(c+m)===47)return i.slice(c+m+1);if(m===0)return i.slice(c+m)}else d>h&&(o.charCodeAt(l+m)===47?g=m:m===0&&(g=0));break}var b=o.charCodeAt(l+m),S=i.charCodeAt(c+m);if(b!==S)break;b===47&&(g=m)}var k="";for(m=l+g+1;m<=u;++m)(m===u||o.charCodeAt(m)===47)&&(k.length===0?k+="..":k+="/..");return k.length>0?k+i.slice(c+g):(c+=g,i.charCodeAt(c)===47&&++c,i.slice(c))},_makeLong:function(o){return o},dirname:function(o){if(e(o),o.length===0)return".";for(var i=o.charCodeAt(0),l=i===47,u=-1,d=!0,c=o.length-1;c>=1;--c)if(i=o.charCodeAt(c),i===47){if(!d){u=c;break}}else d=!1;return u===-1?l?"/":".":l&&u===1?"//":o.slice(0,u)},basename:function(o,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');e(o);var l=0,u=-1,d=!0,c;if(i!==void 0&&i.length>0&&i.length<=o.length){if(i.length===o.length&&i===o)return"";var f=i.length-1,p=-1;for(c=o.length-1;c>=0;--c){var h=o.charCodeAt(c);if(h===47){if(!d){l=c+1;break}}else p===-1&&(d=!1,p=c+1),f>=0&&(h===i.charCodeAt(f)?--f===-1&&(u=c):(f=-1,u=p))}return l===u?u=p:u===-1&&(u=o.length),o.slice(l,u)}else{for(c=o.length-1;c>=0;--c)if(o.charCodeAt(c)===47){if(!d){l=c+1;break}}else u===-1&&(d=!1,u=c+1);return u===-1?"":o.slice(l,u)}},extname:function(o){e(o);for(var i=-1,l=0,u=-1,d=!0,c=0,f=o.length-1;f>=0;--f){var p=o.charCodeAt(f);if(p===47){if(!d){l=f+1;break}continue}u===-1&&(d=!1,u=f+1),p===46?i===-1?i=f:c!==1&&(c=1):i!==-1&&(c=-1)}return i===-1||u===-1||c===0||c===1&&i===u-1&&i===l+1?"":o.slice(i,u)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return n("/",o)},parse:function(o){e(o);var i={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return i;var l=o.charCodeAt(0),u=l===47,d;u?(i.root="/",d=1):d=0;for(var c=-1,f=0,p=-1,h=!0,g=o.length-1,m=0;g>=d;--g){if(l=o.charCodeAt(g),l===47){if(!h){f=g+1;break}continue}p===-1&&(h=!1,p=g+1),l===46?c===-1?c=g:m!==1&&(m=1):c!==-1&&(m=-1)}return c===-1||p===-1||m===0||m===1&&c===p-1&&c===f+1?p!==-1&&(f===0&&u?i.base=i.name=o.slice(1,p):i.base=i.name=o.slice(f,p)):(f===0&&u?(i.name=o.slice(1,c),i.base=o.slice(1,p)):(i.name=o.slice(f,c),i.base=o.slice(f,p)),i.ext=o.slice(c,p)),f>0?i.dir=o.slice(0,f-1):u&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};return r.posix=r,Ma=r,Ma}var We=Dv();const Na=Ev(We),Fv=ge({name:"SpaceMoveInfoModal",props:{modal:{type:Object,required:!0}}}),Le=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},Iv=["textContent"],Pv=["textContent"];function $v(e,t,n,r,s,o){return D(),K(ke,null,[W("p",{class:"mt-0",textContent:R.toDisplayString(e.$gettext("Moving files from one space to another is not possible. Do you want to copy instead?"))},null,8,Iv),W("p",{class:"mb-0",textContent:R.toDisplayString(e.$gettext("Note: Links and shares of the original file are not copied."))},null,8,Pv)],64)}const ad=Le(Fv,[["render",$v]]),Ov=ge({name:"ResourceConflictModal",props:{modal:{type:Object,required:!0},resource:{type:Object,required:!0},conflictCount:{type:Number,required:!0},callbackFn:{type:Function,required:!0},suggestMerge:{type:Boolean,default:!0},separateSkipHandling:{type:Boolean,default:!1},confirmSecondaryTextOverwrite:{type:String,default:null}},setup(e){const{removeModal:t}=Ke(),{$gettext:n}=de.useGettext(),r=H(!1),s=T(()=>e.conflictCount<2?"":e.separateSkipHandling?e.resource.isFolder?n("Apply to all %{count} folders",{count:e.conflictCount.toString()}):n("Apply to all %{count} files",{count:e.conflictCount.toString()}):n("Apply to all %{count} conflicts",{count:e.conflictCount.toString()})),o=T(()=>e.resource.isFolder?n("Folder with name »%{name}« already exists.",{name:e.resource.name}):n("File with name »%{name}« already exists.",{name:e.resource.name})),i=T(()=>e.confirmSecondaryTextOverwrite||n("Replace"));return{message:o,checkboxValue:r,checkboxLabel:s,confirmSecondaryText:i,onConfirm:()=>{t(e.modal.id),e.callbackFn({strategy:hn.KEEP_BOTH,doForAllConflicts:a(r)})},onConfirmSecondary:()=>{t(e.modal.id);const c=e.suggestMerge?hn.MERGE:hn.REPLACE;e.callbackFn({strategy:c,doForAllConflicts:a(r)})},onCancel:()=>{t(e.modal.id),e.callbackFn({strategy:hn.SKIP,doForAllConflicts:a(r)})}}}}),Lv=["textContent"],_v={class:"my-4"},Mv={class:"flex justify-end items-center mt-4"},Nv={class:"oc-modal-body-actions-grid"};function Bv(e,t,n,r,s,o){const i=te("oc-checkbox"),l=te("oc-button");return D(),K(ke,null,[W("span",{class:"inline-block mb-4",textContent:R.toDisplayString(e.message)},null,8,Lv),W("div",_v,[e.conflictCount>1?(D(),ee(i,{key:0,modelValue:e.checkboxValue,"onUpdate:modelValue":t[0]||(t[0]=u=>e.checkboxValue=u),size:"medium",label:e.checkboxLabel,"aria-label":e.checkboxLabel},null,8,["modelValue","label","aria-label"])):ie("",!0)]),W("div",Mv,[W("div",Nv,[Q(l,{class:"oc-modal-body-actions-cancel ml-2",onClick:e.onCancel},{default:X(()=>[it(R.toDisplayString(e.$gettext("Skip")),1)]),_:1},8,["onClick"]),Q(l,{class:"oc-modal-body-actions-secondary ml-2",onClick:e.onConfirmSecondary},{default:X(()=>[it(R.toDisplayString(e.confirmSecondaryText),1)]),_:1},8,["onClick"]),Q(l,{class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:e.onConfirm},{default:X(()=>[it(R.toDisplayString(e.$gettext("Keep both")),1)]),_:1},8,["onClick"])])])],64)}const ld=Le(Ov,[["render",Bv]]);class Ba{constructor(t,n){this.$gettext=t,this.$ngettext=n}async resolveAllConflicts(t,n,r){const s=[];for(const d of t){const c=We.join(n.path,d.name);r.some(p=>p.path===c)&&s.push({resource:d,strategy:null})}let o=0,i=!1,l=null;const u=[];for(const d of s){if(i){d.strategy=l,u.push(d);continue}const c=s.length-o,f=await this.resolveFileExists(d.resource,c);d.strategy=f.strategy,u.push(d),o+=1,f.doForAllConflicts&&(i=!0,l=f.strategy)}return u}resolveFileExists(t,n,r=!1,s=!1){const{dispatchModal:o}=Ke();return new Promise(i=>{o({title:t.isFolder?this.$gettext("Folder already exists"):this.$gettext("File already exists"),hideActions:!0,customComponent:ld,customComponentAttrs:()=>({resource:t,conflictCount:n,suggestMerge:r,separateSkipHandling:s,callbackFn:l=>{i(l)}})})})}resolveDoCopyInsteadOfMoveForSpaces(){const{dispatchModal:t}=Ke();return new Promise(n=>{t({title:this.$gettext("Copy here?"),customComponent:ad,confirmText:this.$gettext("Copy here"),onCancel:()=>{n(!1)},onConfirm:()=>Promise.resolve(n(!0))})})}}const pn=(e,t,n,r=1)=>{let s;return t?s=`${z.extractNameWithoutExtension({name:e,extension:t})} (${r}).${t}`:s=`${e} (${r})`,n.some(i=>i.name===s)?pn(e,t,n,r+1):s},cd=(e,t,n,r)=>e.id===n.id&&We.dirname(t.path)===r.path;var hn=(e=>(e[e.SKIP=0]="SKIP",e[e.REPLACE=1]="REPLACE",e[e.KEEP_BOTH=2]="KEEP_BOTH",e[e.MERGE=3]="MERGE",e))(hn||{}),Wn=(e=>(e[e.COPY=0]="COPY",e[e.MOVE=1]="MOVE",e))(Wn||{});class ud extends Ba{constructor(t,n,r,s,o,i,l,u){super(l,u),this.sourceSpace=t,this.resourcesToMove=n,this.targetSpace=r,this.targetFolder=s,this.currentFolder=o,this.clientService=i}hasRecursion(){return this.sourceSpace.id!==this.targetSpace.id?!1:this.resourcesToMove.some(t=>this.targetFolder.path===t.path)}showRecursionErrorMessage(){const t=this.resourcesToMove.length,n=this.$ngettext("You can't paste the selected file at this location because you can't paste an item into itself.","You can't paste the selected files at this location because you can't paste an item into itself.",t);Me().showErrorMessage({title:n})}showResultMessage(t,n,r){if(t.length===0){const l=n.length;if(l===0)return;const u=r===Wn.COPY?this.$ngettext("%{count} item was copied successfully","%{count} items were copied successfully",l,{count:l.toString()}):this.$ngettext("%{count} item was moved successfully","%{count} items were moved successfully",l,{count:l.toString()});Me().showMessage({title:u,status:"success"});return}let s=r===Wn.COPY?this.$gettext("Failed to copy %{count} resources",{count:t.length.toString()}):this.$gettext("Failed to move %{count} resources",{count:t.length.toString()});t.length===1&&(s=r===Wn.COPY?this.$gettext("Failed to copy »%{name}«",{name:t[0]?.resourceName}):this.$gettext("Failed to move »%{name}«",{name:t[0]?.resourceName}));let o="";t.some(({error:l})=>l instanceof z.HttpError&&l.statusCode===507)&&(o=this.$gettext("Insufficient quota")),Me().showErrorMessage({title:s,...o&&{desc:o},errors:t.map(({error:l})=>l)})}async getTransferData(t){if(this.hasRecursion())return this.showRecursionErrorMessage(),[];if(this.sourceSpace.id!==this.targetSpace.id&&t===Wn.MOVE){if(!await this.resolveDoCopyInsteadOfMoveForSpaces())return[];t=Wn.COPY}const n=(await this.clientService.webdav.listFiles(this.targetSpace,this.targetFolder)).children,r=await this.resolveAllConflicts(this.resourcesToMove,this.targetFolder,n),s=[];for(const o of this.resourcesToMove){const i={...o},{id:l,name:u,extension:d}=i,c=r.some(h=>h.resource.id===l);let f=u,p=!1;if(c){const h=r.find(g=>g.resource.id===l)?.strategy;if(h===hn.SKIP)continue;if(h===hn.REPLACE){if(this.isOverwritingParentFolder(i,this.targetFolder,n)){const g=new Error;this.showResultMessage([{error:g,resourceName:u}],[],t);continue}p=!0}h===hn.KEEP_BOTH&&(f=pn(u,d,n),i.name=f)}cd(this.sourceSpace,i,this.targetSpace,this.targetFolder)&&p||s.push({resource:i,sourceSpace:this.sourceSpace,targetSpace:this.targetSpace,targetFolder:this.targetFolder,path:We.join(this.targetFolder.path,f),overwrite:p,transferType:t})}return s}isOverwritingParentFolder(t,n,r){if(t.type!=="folder")return!1;const s=a(this.currentFolder)?.path;if(!s||n.path===s)return!1;const o=We.basename(t.path),i=We.join(n.path,o);return s.split("/").length<i.split("/").length?!1:r.some(l=>l.path===i)}}const ja={ignoreLocation:!0,threshold:0,useExtendedSearch:!0},jv=(e,t,n)=>new Sc(e,{...ja,keys:["name","type","icon","extension","tags"]}).search(t,{limit:n}).map(s=>s.item),dd="oc-resource-icon-mapping",zv={archive:{icon:{name:"resource-type-archive",color:"var(--oc-color-icon-archive)"},extensions:["7z","apk","bz2","deb","gz","gzip","rar","tar","tar.bz2","tar.gz","tar.xz","tbz2","tgz","zip"]},audio:{icon:{name:"resource-type-audio",color:"var(--oc-color-icon-audio)"},extensions:["3gp","8svx","aa","aac","aax","act","aiff","alac","amr","ape","au","awb","cda","dss","dvf","flac","gsm","iklax","ivs","m4a","m4b","m4p","mmf","mogg","movpkg","mp3","mpc","msv","nmf","oga","ogga","opus","ra","raw","rf64","rm","sln","tta","voc","vox","wav","wma","wv"]},code:{icon:{name:"resource-type-code",color:"var(--oc-role-on-surface)"},extensions:["bash","c++","c","cc","cpp","css","feature","go","h","hh","hpp","htm","html","java","js","json","php","pl","py","scss","sh","sh-lib","sql","ts","xml","yaml","yml"]},default:{icon:{name:"resource-type-file",color:"var(--oc-role-on-surface)"},extensions:["accdb","rss","swf"]},drawio:{icon:{name:"resource-type-drawio",color:"var(--oc-color-icon-drawio)"},extensions:["drawio"]},document:{icon:{name:"resource-type-document",color:"var(--oc-color-icon-document)"},extensions:["doc","docm","docx","dot","dotx","lwp","odt","one","vsd","wpd"]},ifc:{icon:{name:"resource-type-ifc",color:"var(--oc-color-icon-ifc)"},extensions:["ifc"]},ipynb:{icon:{name:"resource-type-jupyter",color:"var(--oc-color-icon-jupyter)"},extensions:["ipynb"]},image:{icon:{name:"resource-type-image",color:"var(--oc-color-icon-image)"},extensions:["ai","cdr","eot","eps","gif","jpeg","jpg","otf","pfb","png","ps","psd","svg","ttf","webp","woff","xcf"]},form:{icon:{name:"resource-type-form",color:"var(--oc-color-icon-form)"},extensions:["docf","docxf","oform"]},markdown:{icon:{name:"resource-type-markdown",color:"var(--oc-color-icon-markdown)"},extensions:["md","markdown"]},odg:{icon:{name:"resource-type-graphic",color:"var(--oc-color-icon-graphic)"},extensions:["odg"]},pdf:{icon:{name:"resource-type-pdf",color:"var(--oc-color-icon-pdf)"},extensions:["pdf"]},presentation:{icon:{name:"resource-type-presentation",color:"var(--oc-color-icon-presentation)"},extensions:["odp","otp","pot","potm","potx","ppa","ppam","pps","ppsm","ppsx","ppt","pptm","pptx"]},root:{icon:{name:"resource-type-root",color:"var(--oc-color-icon-root)"},extensions:["root"]},spreadsheet:{icon:{name:"resource-type-spreadsheet",color:"var(--oc-color-icon-spreadsheet)"},extensions:["csv","ods","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx"]},text:{icon:{name:"resource-type-text",color:"var(--oc-role-on-surface)"},extensions:["cb7","cba","cbr","cbt","cbtc","cbz","cvbdl","eml","mdb","tex","txt"]},url:{icon:{name:"resource-type-url",color:"var(--oc-role-on-surface)"},extensions:["url"]},video:{icon:{name:"resource-type-video",color:"var(--oc-color-icon-video)"},extensions:["mov","mp4","webm","wmv"]},epub:{icon:{name:"resource-type-book",color:"var(--oc-color-icon-epub)"},extensions:["epub"]},board:{icon:{name:"resource-type-board"},extensions:["ggs"]},notes:{icon:{name:"resource-type-sticky-note",color:"var(--oc-color-icon-notes)"},extensions:["ocnb"]}};function fd(){const e={};return Object.values(zv).forEach(t=>{t.extensions.forEach(n=>{e[n]=t.icon})}),e}const pd=({resourcesStore:e,parentFolderId:t})=>{const n=e.currentFolder;if(!n||!n.id)return!1;if(z.extractNodeId(n.id)){if(n.id!==t)return!1}else{const r=n.id.split("$")[1];if(`${n.id}!${r}`!==t)return!1}return!0};function za(e,t,n){return t.name=We.basename(n),t.path=n,t.webDavPath=We.join(e.webDavPath,n),t.extension=z.extractExtensionFromFile(t),t}function Vv(){this.__data__=[],this.size=0}function js(e,t){return e===t||e!==e&&t!==t}function ei(e,t){for(var n=e.length;n--;)if(js(e[n][0],t))return n;return-1}var Uv=Array.prototype,qv=Uv.splice;function Hv(e){var t=this.__data__,n=ei(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():qv.call(t,n,1),--this.size,!0}function Wv(e){var t=this.__data__,n=ei(t,e);return n<0?void 0:t[n][1]}function Qv(e){return ei(this.__data__,e)>-1}function Kv(e,t){var n=this.__data__,r=ei(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Qn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Qn.prototype.clear=Vv,Qn.prototype.delete=Hv,Qn.prototype.get=Wv,Qn.prototype.has=Qv,Qn.prototype.set=Kv;function Gv(){this.__data__=new Qn,this.size=0}function Jv(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Xv(e){return this.__data__.get(e)}function Yv(e){return this.__data__.has(e)}const mr=globalThis||void 0||self;var hd=typeof mr=="object"&&mr&&mr.Object===Object&&mr,Zv=typeof self=="object"&&self&&self.Object===Object&&self,Rn=hd||Zv||Function("return this")(),en=Rn.Symbol,md=Object.prototype,eb=md.hasOwnProperty,tb=md.toString,zs=en?en.toStringTag:void 0;function nb(e){var t=eb.call(e,zs),n=e[zs];try{e[zs]=void 0;var r=!0}catch{}var s=tb.call(e);return r&&(t?e[zs]=n:delete e[zs]),s}var rb=Object.prototype,sb=rb.toString;function ob(e){return sb.call(e)}var ib="[object Null]",ab="[object Undefined]",gd=en?en.toStringTag:void 0;function $r(e){return e==null?e===void 0?ab:ib:gd&&gd in Object(e)?nb(e):ob(e)}function En(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var lb="[object AsyncFunction]",cb="[object Function]",ub="[object GeneratorFunction]",db="[object Proxy]";function Va(e){if(!En(e))return!1;var t=$r(e);return t==cb||t==ub||t==lb||t==db}var Ua=Rn["__core-js_shared__"],yd=(function(){var e=/[^.]+$/.exec(Ua&&Ua.keys&&Ua.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function fb(e){return!!yd&&yd in e}var pb=Function.prototype,hb=pb.toString;function Or(e){if(e!=null){try{return hb.call(e)}catch{}try{return e+""}catch{}}return""}var mb=/[\\^$.*+?()[\]{}|]/g,gb=/^\[object .+?Constructor\]$/,yb=Function.prototype,vb=Object.prototype,bb=yb.toString,wb=vb.hasOwnProperty,Sb=RegExp("^"+bb.call(wb).replace(mb,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function kb(e){if(!En(e)||fb(e))return!1;var t=Va(e)?Sb:gb;return t.test(Or(e))}function Cb(e,t){return e?.[t]}function Lr(e,t){var n=Cb(e,t);return kb(n)?n:void 0}var Vs=Lr(Rn,"Map"),Us=Lr(Object,"create");function Tb(){this.__data__=Us?Us(null):{},this.size=0}function xb(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ab="__lodash_hash_undefined__",Rb=Object.prototype,Eb=Rb.hasOwnProperty;function Db(e){var t=this.__data__;if(Us){var n=t[e];return n===Ab?void 0:n}return Eb.call(t,e)?t[e]:void 0}var Fb=Object.prototype,Ib=Fb.hasOwnProperty;function Pb(e){var t=this.__data__;return Us?t[e]!==void 0:Ib.call(t,e)}var $b="__lodash_hash_undefined__";function Ob(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Us&&t===void 0?$b:t,this}function _r(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}_r.prototype.clear=Tb,_r.prototype.delete=xb,_r.prototype.get=Db,_r.prototype.has=Pb,_r.prototype.set=Ob;function Lb(){this.size=0,this.__data__={hash:new _r,map:new(Vs||Qn),string:new _r}}function _b(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ti(e,t){var n=e.__data__;return _b(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Mb(e){var t=ti(this,e).delete(e);return this.size-=t?1:0,t}function Nb(e){return ti(this,e).get(e)}function Bb(e){return ti(this,e).has(e)}function jb(e,t){var n=ti(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Kn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Kn.prototype.clear=Lb,Kn.prototype.delete=Mb,Kn.prototype.get=Nb,Kn.prototype.has=Bb,Kn.prototype.set=jb;var zb=200;function Vb(e,t){var n=this.__data__;if(n instanceof Qn){var r=n.__data__;if(!Vs||r.length<zb-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Kn(r)}return n.set(e,t),this.size=n.size,this}function Dn(e){var t=this.__data__=new Qn(e);this.size=t.size}Dn.prototype.clear=Gv,Dn.prototype.delete=Jv,Dn.prototype.get=Xv,Dn.prototype.has=Yv,Dn.prototype.set=Vb;var ni=(function(){try{var e=Lr(Object,"defineProperty");return e({},"",{}),e}catch{}})();function qa(e,t,n){t=="__proto__"&&ni?ni(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Ha(e,t,n){(n!==void 0&&!js(e[t],n)||n===void 0&&!(t in e))&&qa(e,t,n)}function Ub(e){return function(t,n,r){for(var s=-1,o=Object(t),i=r(t),l=i.length;l--;){var u=i[++s];if(n(o[u],u,o)===!1)break}return t}}var qb=Ub(),vd=typeof x=="object"&&x&&!x.nodeType&&x,bd=vd&&typeof module=="object"&&module&&!module.nodeType&&module,Hb=bd&&bd.exports===vd,wd=Hb?Rn.Buffer:void 0,Sd=wd?wd.allocUnsafe:void 0;function kd(e,t){if(t)return e.slice();var n=e.length,r=Sd?Sd(n):new e.constructor(n);return e.copy(r),r}var ri=Rn.Uint8Array;function Wa(e){var t=new e.constructor(e.byteLength);return new ri(t).set(new ri(e)),t}function Cd(e,t){var n=t?Wa(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Wb(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Td=Object.create,Qb=(function(){function e(){}return function(t){if(!En(t))return{};if(Td)return Td(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function xd(e,t){return function(n){return e(t(n))}}var Qa=xd(Object.getPrototypeOf,Object),Kb=Object.prototype;function Ka(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Kb;return e===n}function Gb(e){return typeof e.constructor=="function"&&!Ka(e)?Qb(Qa(e)):{}}function Fn(e){return e!=null&&typeof e=="object"}var Jb="[object Arguments]";function Ad(e){return Fn(e)&&$r(e)==Jb}var Rd=Object.prototype,Xb=Rd.hasOwnProperty,Yb=Rd.propertyIsEnumerable,si=Ad((function(){return arguments})())?Ad:function(e){return Fn(e)&&Xb.call(e,"callee")&&!Yb.call(e,"callee")},mn=Array.isArray,Zb=9007199254740991;function Ed(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Zb}function oi(e){return e!=null&&Ed(e.length)&&!Va(e)}function ew(e){return Fn(e)&&oi(e)}function tw(){return!1}var Dd=typeof x=="object"&&x&&!x.nodeType&&x,Fd=Dd&&typeof module=="object"&&module&&!module.nodeType&&module,nw=Fd&&Fd.exports===Dd,Id=nw?Rn.Buffer:void 0,rw=Id?Id.isBuffer:void 0,qs=rw||tw,sw="[object Object]",ow=Function.prototype,iw=Object.prototype,Pd=ow.toString,aw=iw.hasOwnProperty,lw=Pd.call(Object);function Ga(e){if(!Fn(e)||$r(e)!=sw)return!1;var t=Qa(e);if(t===null)return!0;var n=aw.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Pd.call(n)==lw}var cw="[object Arguments]",uw="[object Array]",dw="[object Boolean]",fw="[object Date]",pw="[object Error]",hw="[object Function]",mw="[object Map]",gw="[object Number]",yw="[object Object]",vw="[object RegExp]",bw="[object Set]",ww="[object String]",Sw="[object WeakMap]",kw="[object ArrayBuffer]",Cw="[object DataView]",Tw="[object Float32Array]",xw="[object Float64Array]",Aw="[object Int8Array]",Rw="[object Int16Array]",Ew="[object Int32Array]",Dw="[object Uint8Array]",Fw="[object Uint8ClampedArray]",Iw="[object Uint16Array]",Pw="[object Uint32Array]",nt={};nt[Tw]=nt[xw]=nt[Aw]=nt[Rw]=nt[Ew]=nt[Dw]=nt[Fw]=nt[Iw]=nt[Pw]=!0,nt[cw]=nt[uw]=nt[kw]=nt[dw]=nt[Cw]=nt[fw]=nt[pw]=nt[hw]=nt[mw]=nt[gw]=nt[yw]=nt[vw]=nt[bw]=nt[ww]=nt[Sw]=!1;function $w(e){return Fn(e)&&Ed(e.length)&&!!nt[$r(e)]}function Ja(e){return function(t){return e(t)}}var $d=typeof x=="object"&&x&&!x.nodeType&&x,Hs=$d&&typeof module=="object"&&module&&!module.nodeType&&module,Ow=Hs&&Hs.exports===$d,Xa=Ow&&hd.process,is=(function(){try{var e=Hs&&Hs.require&&Hs.require("util").types;return e||Xa&&Xa.binding&&Xa.binding("util")}catch{}})(),Od=is&&is.isTypedArray,Ya=Od?Ja(Od):$w;function Za(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Lw=Object.prototype,_w=Lw.hasOwnProperty;function Ld(e,t,n){var r=e[t];(!(_w.call(e,t)&&js(r,n))||n===void 0&&!(t in e))&&qa(e,t,n)}function _d(e,t,n,r){var s=!n;n||(n={});for(var o=-1,i=t.length;++o<i;){var l=t[o],u=void 0;u===void 0&&(u=e[l]),s?qa(n,l,u):Ld(n,l,u)}return n}function Mw(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Nw=9007199254740991,Bw=/^(?:0|[1-9]\d*)$/;function Md(e,t){var n=typeof e;return t=t??Nw,!!t&&(n=="number"||n!="symbol"&&Bw.test(e))&&e>-1&&e%1==0&&e<t}var jw=Object.prototype,zw=jw.hasOwnProperty;function Nd(e,t){var n=mn(e),r=!n&&si(e),s=!n&&!r&&qs(e),o=!n&&!r&&!s&&Ya(e),i=n||r||s||o,l=i?Mw(e.length,String):[],u=l.length;for(var d in e)(t||zw.call(e,d))&&!(i&&(d=="length"||s&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Md(d,u)))&&l.push(d);return l}function Vw(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Uw=Object.prototype,qw=Uw.hasOwnProperty;function Hw(e){if(!En(e))return Vw(e);var t=Ka(e),n=[];for(var r in e)r=="constructor"&&(t||!qw.call(e,r))||n.push(r);return n}function el(e){return oi(e)?Nd(e,!0):Hw(e)}function Ww(e){return _d(e,el(e))}function Qw(e,t,n,r,s,o,i){var l=Za(e,n),u=Za(t,n),d=i.get(u);if(d){Ha(e,n,d);return}var c=o?o(l,u,n+"",e,t,i):void 0,f=c===void 0;if(f){var p=mn(u),h=!p&&qs(u),g=!p&&!h&&Ya(u);c=u,p||h||g?mn(l)?c=l:ew(l)?c=Wb(l):h?(f=!1,c=kd(u,!0)):g?(f=!1,c=Cd(u,!0)):c=[]:Ga(u)||si(u)?(c=l,si(l)?c=Ww(l):(!En(l)||Va(l))&&(c=Gb(u))):f=!1}f&&(i.set(u,c),s(c,u,r,o,i),i.delete(u)),Ha(e,n,c)}function Bd(e,t,n,r,s){e!==t&&qb(t,function(o,i){if(s||(s=new Dn),En(o))Qw(e,t,i,n,Bd,r,s);else{var l=r?r(Za(e,i),o,i+"",e,t,s):void 0;l===void 0&&(l=o),Ha(e,i,l)}},el)}function jd(e){return e}function Kw(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var zd=Math.max;function Vd(e,t,n){return t=zd(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,o=zd(r.length-t,0),i=Array(o);++s<o;)i[s]=r[t+s];s=-1;for(var l=Array(t+1);++s<t;)l[s]=r[s];return l[t]=n(i),Kw(e,this,l)}}function Gw(e){return function(){return e}}var Jw=ni?function(e,t){return ni(e,"toString",{configurable:!0,enumerable:!1,value:Gw(t),writable:!0})}:jd,Xw=800,Yw=16,Zw=Date.now;function eS(e){var t=0,n=0;return function(){var r=Zw(),s=Yw-(r-n);if(n=r,s>0){if(++t>=Xw)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Ud=eS(Jw);function tS(e,t){return Ud(Vd(e,t,jd),e+"")}function nS(e,t,n){if(!En(n))return!1;var r=typeof t;return(r=="number"?oi(n)&&Md(t,n.length):r=="string"&&t in n)?js(n[t],e):!1}function rS(e){return tS(function(t,n){var r=-1,s=n.length,o=s>1?n[s-1]:void 0,i=s>2?n[2]:void 0;for(o=e.length>3&&typeof o=="function"?(s--,o):void 0,i&&nS(n[0],n[1],i)&&(o=s<3?void 0:o,s=1),t=Object(t);++r<s;){var l=n[r];l&&e(t,l,r,o)}return t})}var Ws=rS(function(e,t,n){Bd(e,t,n)});const tl=(e,...t)=>{const{href:n}=e.resolve(a(e.currentRoute));return t.map(r=>{const{href:s}=e.resolve({...r});return s==="/"||s==="#/"?!1:n.startsWith(s)}).some(Boolean)},as=(...e)=>(t,...n)=>{if(!n.length)return tl(t,...e);const[r,...s]=n.map(o=>{const i=e.find(l=>l.name===o);if(!i)throw new Error(`unknown comparative '${o}'`);return i});return tl(t,r,...s)};function $$(e){return e}const ls=(e,...t)=>Ws({},{name:e},...t.map(n=>({...n.params&&{params:n.params},...n.query&&{query:n.query}}))),cs=(e,t={})=>ls(e,t),qd=cs("files-common-favorites"),Hd=cs("files-common-search"),mt=as(qd,Hd),sS=e=>[{path:"/search",component:e.App,children:[{name:Hd.name,path:"list/:page?",component:e.SearchResults,meta:{authContext:"user",title:"Search results",contextQueryItems:["term","provider","q_tags","q_lastModified","q_titleOnly","q_mediaType","scope","useScope","sort-by","sort-dir"]}}]},{path:"/favorites",component:e.App,children:[{name:qd.name,path:"",component:e.Favorites,meta:{authContext:"user",title:"Favorite files"}}]}],gn=(e,t={})=>ls(e,t),Wd=gn("files-spaces-projects"),nl=gn("files-spaces-generic"),rt=as(Wd,nl),oS=e=>[{path:"/spaces",component:e.App,children:[{path:"projects",name:Wd.name,component:e.Spaces.Projects,meta:{authContext:"user",title:"Spaces"}},{path:":driveAliasAndItem(.*)?",name:nl.name,component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0,contextQueryItems:["sort-by","sort-dir"]}}]}],tn=(e,t={})=>ls(e,t),iS=tn("files-shares"),ii=tn("files-shares-with-me"),rl=tn("files-shares-with-others"),sl=tn("files-shares-via-link"),pt=as(ii,rl,sl),aS=e=>[{name:iS.name,path:"/shares",component:e.App,redirect:ii,children:[{name:ii.name,path:"with-me",component:e.Shares.SharedWithMe,meta:{authContext:"user",title:"Files shared with me"}},{name:rl.name,path:"with-others",component:e.Shares.SharedWithOthers,meta:{authContext:"user",title:"Files shared with others"}},{name:sl.name,path:"via-link",component:e.Shares.SharedViaLink,meta:{authContext:"user",title:"Files shared via link"}}]}],us=(e,t={})=>ls(e,t),ol=us("files-public-link"),il=us("files-public-upload"),nn=as(ol,il),lS=e=>[{path:"/link",component:e.App,meta:{auth:!1},children:[{name:ol.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"publicLink",patchCleanPath:!0}}]},{path:"/upload",component:e.App,meta:{auth:!1},children:[{name:il.name,path:":token?",component:e.FilesDrop,meta:{authContext:"publicLink",title:"Public file upload"}}]}],gr=(e,t={})=>ls(e,t),Qd=gr("files-trash-generic"),Kd=gr("files-trash-overview"),jt=as(Qd,Kd),cS=e=>[{path:"/trash",component:e.App,children:[{path:"overview",name:Kd.name,component:e.Trash.Overview,meta:{authContext:"user",title:"Trash overview"}},{name:Qd.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0}}]}];function Gd(e){return{applicationConfig:T(()=>e.appsStore.externalAppConfig[e.applicationId]||{})}}const uS=["anonymous","user","idp","publicLink","hybrid"],Gn=e=>Un(e),Ae=()=>Gn("$router"),yt=()=>Ae().currentRoute,al=e=>e.path.split("/")[1],Jd=()=>{const e=yt();return T(()=>al(a(e)))},In=(e,t={},n)=>{const r=n?.configStore||Qe();return{params:{driveAliasAndItem:e.getDriveAliasAndItem({path:t.path||""})},query:{...z.isShareSpaceResource(e)&&{shareId:e.id},...r?.options?.routing?.idBased&&!et.isUndefined(t.fileId)&&{fileId:`${t.fileId}`}}}},dS=(e,t)=>{const n=document.querySelector("base"),r=!!n,s=new URL(window.location.href.split("#")[0]);return s.search="",r?s.pathname=new URL(n.href).pathname:s.pathname.endsWith("/index.html")&&(s.pathname=s.pathname.split("/").slice(0,-1).filter(Boolean).join("/")),/\.(html?)$/i.test(t)?s.pathname=[...s.pathname.split("/"),...t.split("/")].filter(Boolean).join("/"):s[r?"pathname":"hash"]=e.resolve(t).href,s.href},Pn=ve.defineStore("apps",()=>{const e=H({}),t=H({}),n=H([]),r=T(()=>Object.keys(a(e))),s=(u,d)=>{u.id&&(u.extensions&&u.extensions.forEach(c=>{o({appId:u.id,data:c})}),a(e)[u.id]={defaultExtension:u.defaultExtension||"",icon:"check_box_outline_blank",name:u.name||u.id,translations:d,...u})},o=({appId:u,data:d})=>{a(n).push({...d,app:u,hasPriority:d.hasPriority||a(t)?.[u]?.priorityExtensions?.includes(d.extension)||!1,secureView:d.secureView||!1})};return{apps:e,externalAppConfig:t,appIds:r,fileExtensions:n,registerApp:s,registerFileExtension:o,loadExternalAppConfig:({appId:u,config:d})=>{t.value={...a(t),[u]:d}},isAppEnabled:u=>a(r).includes(u)}}),yr=ve.defineStore("auth",()=>{const e=H(),t=H(),n=H(!1),r=H(!1),s=H(),o=H(),i=H(),l=H(!1),u=m=>{e.value=m},d=m=>{t.value=m},c=m=>{n.value=m},f=m=>{r.value=m},p=m=>{s.value=m.publicLinkToken,o.value=m.publicLinkPassword,i.value=m.publicLinkType,l.value=m.publicLinkContextReady};return{accessToken:e,sessionId:t,idpContextReady:n,userContextReady:r,publicLinkToken:s,publicLinkPassword:o,publicLinkType:i,publicLinkContextReady:l,setAccessToken:u,setSessionId:d,setIdpContextReady:c,setUserContextReady:f,setPublicLinkContext:p,clearUserContext:()=>{u(null),d(null),c(null),f(null)},clearPublicLinkContext:()=>{p({publicLinkToken:null,publicLinkPassword:null,publicLinkType:null,publicLinkContextReady:!1})}}}),Xd={cernFeatures:!1,concurrentRequests:{resourceBatchActions:4,shares:{create:4,list:2},sse:4,avatars:4},contextHelpers:!0,contextHelpersReadMore:!0,defaultAppId:"files",disabledExtensions:[],disableFeedbackLink:!1,editor:{autosaveEnabled:!0,autosaveInterval:120},embed:{enabled:!1,target:"resources"},ocm:{openRemotely:!1},routing:{idBased:!0,fullShareOwnerPaths:!1},runningOnEos:!1,tokenStorageLocal:!0,userListRequiresFilter:!1,hideLogo:!1},Qe=ve.defineStore("config",()=>{const e=Pn(),t=H(""),n=H(""),r=H({...Xd}),s=H([]),o=H([]),i=H([]),l=H(),u=H(),d=H(),c=H([]),f=H([]),p=T(()=>z.urlJoin(a(t)||window.location.origin,{trailingSlash:!0})),h=T(()=>z.urlJoin(a(p),"groupware",{trailingSlash:!0})),g=T(()=>!!a(l)),m=T(()=>!!a(u));return{options:r,oAuth2:l,openIdConnect:u,isOAuth2:g,isOIDC:m,customTranslations:i,apps:s,externalApps:o,sentry:d,theme:n,scripts:c,styles:f,serverUrl:p,groupwareUrl:h,loadConfig:S=>{S.server&&(t.value=S.server?.endsWith("/")?S.server:S.server+"/"),s.value=S.apps||[],i.value=S.customTranslations||[],l.value=S.auth,u.value=S.openIdConnect,d.value=S.sentry,c.value=S.scripts||[],f.value=S.styles||[],n.value=S.theme,S.options&&(r.value=Ws({...Xd},S.options),a(r).ocm.openRemotely=a(r).cernFeatures,a(r).routing.idBased=!a(r).cernFeatures,a(r).routing.fullShareOwnerPaths=a(r).cernFeatures),S.external_apps&&(o.value=S.external_apps,S.external_apps.filter(Boolean).forEach(k=>{e.loadExternalAppConfig({appId:k.id,config:k.config})}))}}}),fS=G.z.object({url:G.z.string()}),pS=G.z.object({apiUrl:G.z.string().optional(),authUrl:G.z.string().optional(),clientId:G.z.string().optional(),clientSecret:G.z.string().optional(),logoutUrl:G.z.string().optional(),metaDataUrl:G.z.string().optional(),url:G.z.string().optional()}),hS=G.z.object({authority:G.z.string().optional(),client_id:G.z.string().optional(),client_secret:G.z.string().optional(),dynamic:G.z.string().optional(),metadata_url:G.z.string().optional(),post_logout_redirect_uri:G.z.string().optional(),response_type:G.z.string().optional(),scope:G.z.string().optional()}).passthrough(),mS=G.z.record(G.z.any(),G.z.any()),gS=G.z.object({href:G.z.string().optional()}),yS=G.z.object({async:G.z.boolean().optional(),src:G.z.string().optional()}),vS=G.z.object({cernFeatures:G.z.boolean().optional(),concurrentRequests:G.z.object({resourceBatchActions:G.z.number().optional(),sse:G.z.number().optional(),shares:G.z.object({create:G.z.number().optional(),list:G.z.number().optional()}).optional(),avatars:G.z.number().optional()}).optional(),contextHelpers:G.z.boolean().optional(),contextHelpersReadMore:G.z.boolean().optional(),defaultAppId:G.z.string().optional(),disabledExtensions:G.z.array(G.z.string()).optional(),disableFeedbackLink:G.z.boolean().optional(),accountEditLink:G.z.object({href:G.z.string().optional()}).optional(),editor:G.z.object({autosaveEnabled:G.z.boolean().optional(),autosaveInterval:G.z.number().optional(),openAsPreview:G.z.union([G.z.boolean(),G.z.array(G.z.string())]).optional()}).optional(),embed:G.z.object({enabled:G.z.boolean().optional(),target:G.z.string().optional(),messagesOrigin:G.z.string().optional(),delegateAuthentication:G.z.boolean().optional(),delegateAuthenticationOrigin:G.z.string().optional(),fileTypes:G.z.array(G.z.string()).optional(),chooseFileName:G.z.boolean().optional(),chooseFileNameSuggestion:G.z.string().optional()}).optional(),feedbackLink:G.z.object({ariaLabel:G.z.string().optional(),description:G.z.string().optional(),href:G.z.string().optional()}).optional(),isRunningOnEos:G.z.boolean().optional(),loginUrl:G.z.string().optional(),logoutUrl:G.z.string().optional(),ocm:G.z.object({openRemotely:G.z.boolean().optional()}).optional(),routing:G.z.object({fullShareOwnerPaths:G.z.boolean().optional(),idBased:G.z.boolean().optional()}).optional(),runningOnEos:G.z.boolean().optional(),tokenStorageLocal:G.z.boolean().optional(),upload:G.z.object({companionUrl:G.z.string().optional()}).optional(),userListRequiresFilter:G.z.boolean().optional(),hideLogo:G.z.boolean().optional()}),bS=G.z.object({id:G.z.string(),path:G.z.string(),config:G.z.record(G.z.string(),G.z.unknown()).optional()}),wS=G.z.object({server:G.z.string(),theme:G.z.string(),options:vS,apps:G.z.array(G.z.string()).optional(),external_apps:G.z.array(bS).optional(),customTranslations:G.z.array(fS).optional(),auth:pS.optional(),openIdConnect:hS.optional(),sentry:mS.optional(),scripts:G.z.array(yS).optional(),styles:G.z.array(gS).optional()}),ai=ve.defineStore("avatars",()=>{const e=Qe(),t=H({}),n=Kc(new sr({concurrency:e.options.concurrentRequests.avatars}));return{avatarMap:t,getAvatar:u=>a(t)[u],addAvatar:(u,d)=>{t.value[u]=d},removeAvatar:u=>{t.value[u]=null},reset:()=>{t.value={}},avatarsQueue:n,pendingAvatarsRequests:new Map}}),Yd={core:{"support-sse":!1},dav:{},files:{app_providers:[],favorites:!1,permanent_deletion:!0,tags:!1,privateLinks:!1,tus_support:{extension:"",http_method_override:!1,max_chunk_size:0}},files_sharing:{allow_custom:!0,api_enabled:!0,can_rename:!0,deny_access:!1,public:{alias:!1,can_contribute:!0,can_edit:!1,default_permissions:z.SharePermissionBit.Read,enabled:!0,password:{enforced_for:{read_only:!1,upload_only:!1,read_write:!1}}}},graph:{"personal-data-export":!1,users:{change_password_self_disabled:!0,create_disabled:!1,delete_disabled:!1,read_only_attributes:[],edit_login_allowed_disabled:!1}},notifications:{"ocs-endpoints":[]},password_policy:{},search:{property:{mediatype:{},mtime:{}}},spaces:{enabled:!1,max_quota:0,projects:!1}},Ct=ve.defineStore("capabilities",()=>{const e=H(!1),t=H(Yd),n=$e=>{t.value=Ws({...Yd},$e.capabilities),e.value=!0},r=T(()=>a(t).core["support-sse"]),s=T(()=>a(t).core["support-radicale"]),o=T(()=>a(t).graph["personal-data-export"]),i=T(()=>a(t).core.status),l=T(()=>a(t).dav.reports),u=T(()=>a(t).dav.trashbin),d=T(()=>a(t).spaces.max_quota),c=T(()=>a(t).spaces.projects),f=T(()=>a(t).graph.users.create_disabled),p=T(()=>a(t).graph.users.delete_disabled),h=T(()=>a(t).graph.users.change_password_self_disabled),g=T(()=>a(t).graph.users.read_only_attributes),m=T(()=>a(t).graph.users.edit_login_allowed_disabled),b=T(()=>a(t).files.app_providers),S=T(()=>a(t).files.favorites),k=T(()=>a(t).files.archivers),w=T(()=>a(t).files.privateLinks),C=T(()=>a(t).files.permanent_deletion),A=T(()=>a(t).files.tags),I=T(()=>a(t).files.undelete),N=T(()=>a(t).files_sharing.api_enabled),_=T(()=>a(t).files_sharing.can_rename),F=T(()=>a(t).files_sharing.allow_custom),V=T(()=>a(t).files_sharing.public?.enabled),Z=T(()=>a(t).files_sharing.public?.can_edit),P=T(()=>a(t).files_sharing.public?.can_contribute),$=T(()=>a(t).files_sharing.public?.alias),L=T(()=>a(t).files_sharing.public?.default_permissions),M=T(()=>a(t).files_sharing.public?.password.enforced_for),j=T(()=>a(t).files_sharing.search_min_length),B=T(()=>a(t).files_sharing.user?.profile_picture),q=T(()=>a(t).files.tus_support?.max_chunk_size),re=T(()=>a(t).files.tus_support?.extension),J=T(()=>a(t).files.tus_support?.http_method_override),oe=T(()=>a(t).notifications["ocs-endpoints"]),ne=T(()=>a(t).password_policy),pe=T(()=>a(t).search.property?.mtime),fe=T(()=>a(t).search.property?.mediatype),we=T(()=>a(t).search.property?.content);return{isInitialized:e,capabilities:t,setCapabilities:n,status:i,supportSSE:r,supportRadicale:s,personalDataExport:o,davReports:l,davTrashbin:u,spacesMaxQuota:d,spacesProjects:c,graphUsersCreateDisabled:f,graphUsersDeleteDisabled:p,graphUsersChangeSelfPasswordDisabled:h,graphUsersEditLoginAllowedDisabled:m,graphUsersReadOnlyAttributes:g,filesAppProviders:b,filesFavorites:S,filesArchivers:k,filesPrivateLinks:w,filesPermanentDeletion:C,filesTags:A,filesUndelete:I,sharingApiEnabled:N,sharingCanRename:_,sharingAllowCustom:F,sharingPublicEnabled:V,sharingPublicCanEdit:Z,sharingPublicCanContribute:P,sharingPublicAlias:$,sharingPublicDefaultPermissions:L,sharingPublicPasswordEnforcedFor:M,sharingSearchMinLength:j,sharingUserProfilePicture:B,tusMaxChunkSize:q,tusExtension:re,tusHttpMethodOverride:J,notificationsOcsEndpoints:oe,passwordPolicy:ne,searchLastMofifiedDate:pe,searchMediaType:fe,searchContent:we}});class SS{value;expires;constructor(t,n){this.value=t,this.expires=n?new Date().getTime()+n:0}get expired(){return this.expires>0&&this.expires<new Date().getTime()}}class Zd{map;ttl;capacity;constructor(t){this.ttl=t.ttl||0,this.capacity=t.capacity||0,this.map=new Map}set(t,n,r){return this.evict(),this.map.set(t,new SS(n,isNaN(r)?this.ttl:r)),n}get(t){this.evict();const n=this.map.get(t);if(n)return n.value}delete(t){return this.map.delete(t)}clear(){return this.map.clear()}entries(){return this.evict(),[...this.map.entries()].map(t=>[t[0],t[1].value])}keys(){return this.evict(),[...this.map.keys()]}has(t){return this.evict(),this.map.has(t)}values(){return this.evict(),[...this.map.values()].map(t=>t.value)}evict(){if(this.map.forEach((t,n)=>{t.expired&&this.delete(n)}),!!this.capacity)for(const[t]of[...this.map.entries()]){if(this.map.size<=this.capacity)break;this.delete(t)}}}const li=async({graphClient:e,spacesStore:t,space:n,signal:r})=>{const s=await t.getMountPointForSpace({graphClient:e,space:n,signal:r});if(!s)return null;const{id:o}=s;return e.driveItems.getDriveItem(o.split("!")[0],o)},kS=({sharedAncestor:e,matchingSpace:t})=>t?gn("files-spaces-generic",In(t,{path:e.path,fileId:e.id})):{},ef=({sharesStore:e,spacesStore:t,space:n,sharedDriveItem:r})=>{const s=r?.remoteItem?.permissions||[];if(!s.length)return;const o=[];s.forEach(i=>{if(i["@libre.graph.permissions.actions"]){o.push(...i["@libre.graph.permissions.actions"]);return}const l=e.graphRoles[i.roles[0]];if(!l)return;const u=l.rolePermissions.flatMap(d=>d.allowedResourceActions);o.push(...u)}),t.updateSpaceField({id:n.id,field:"graphPermissions",value:[...new Set(o)]})},CS=e=>{const t=document.querySelectorAll(`[data-item-id="${e}"] input[type=checkbox]`)?.[0];t&&t.focus()},ci=(e,t)=>{t!==void 0&&document.querySelector(":root").style.setProperty("--oc-"+e,t)},TS="thead-clicked",xS="highlight",AS="rowMounted",RS="contextmenuClicked",tf="itemDropped",ES="itemDragged";let DS="";const FS=()=>DS,IS=e=>({"gap-0":e==="none","gap-0.5":e==="xsmall","gap-1":e==="small","gap-2":e==="medium","gap-4":e==="large","gap-5":e==="xlarge","gap-6":e==="xxlarge","gap-7":e==="xxxlarge"}),PS=e=>({"justify-start":e==="left","justify-center":e==="center","justify-end":e==="right","justify-around":e==="space-around","justify-between":e==="space-between","justify-evenly":e==="space-evenly"}),$S=e=>({"p-0":e==="remove","p-1":e==="xsmall","p-2":e==="small","p-4":e==="medium","p-6":e==="large","p-12":e==="xlarge","p-24":e==="xxlarge"});var Je=(e=>(e.Desc="desc",e.Asc="asc",e))(Je||{});let nf=0;const Mr=(e="")=>(e=e||"",nf+=1,e+nf),rf=e=>e?[{name:"name",sortable:!0,sortDir:Je.Asc},{name:"size",sortable:!0,sortDir:Je.Desc},{name:"sharedWith",sortable:t=>t.length>0?t.sort((n,r)=>n.shareType!==r.shareType?n.shareType<r.shareType?-1:1:n.displayName<r.displayName?-1:1).map(n=>n.displayName).join():!1,sortDir:Je.Asc},{name:"owner",sortable:"displayName",sortDir:Je.Asc},{name:"mdate",sortable:t=>new Date(t).valueOf(),sortDir:Je.Desc},{name:"sdate",sortable:t=>new Date(t).valueOf(),sortDir:Je.Desc},{name:"ddate",sortable:t=>new Date(t).valueOf(),sortDir:Je.Desc}].filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[];function O$(e){return e}const sf=[{label:"A-Z",name:"name",sortable:!0,sortDir:Je.Asc},{label:"Z-A",name:"name",sortable:!0,sortDir:Je.Desc},{label:"Newest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Je.Desc},{label:"Oldest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Je.Asc},{label:"Largest",name:"size",sortable:!0,sortDir:Je.Desc},{label:"Smallest",name:"size",sortable:!0,sortDir:Je.Asc},{label:"Remaining quota",name:"remainingQuota",prop:"spaceQuota.remaining",sortable:!0,sortDir:Je.Desc},{label:"Total quota",name:"totalQuota",prop:"spaceQuota.total",sortable:!0,sortDir:Je.Desc},{label:"Used quota",name:"usedQuota",prop:"spaceQuota.used",sortable:!0,sortDir:Je.Desc}],OS=e=>e?sf.filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[],LS=(e,{$gettext:t})=>e.map(n=>({...n,label:t(n.label)})),_S=G.z.object({icon:G.z.string(),name:G.z.string(),secure_view:G.z.boolean().optional().default(!1),target_ext:G.z.string().optional()}),MS=G.z.object({allow_creation:G.z.boolean().optional(),app_providers:G.z.array(_S),default_application:G.z.string().optional(),description:G.z.string().optional(),ext:G.z.string().optional(),mime_type:G.z.string(),name:G.z.string().optional()}),of=G.z.object({"mime-types":G.z.array(MS)});class NS{_mimeTypes=H([]);serverUrl;clientService;constructor(t,n){this.serverUrl=t,this.clientService=n}async loadData(){const t=z.urlJoin(this.serverUrl,"app","list"),{data:{"mime-types":n}}=await this.clientService.httpUnAuthenticated.get(t,{schema:of});this._mimeTypes.value=n}set mimeTypes(t){this._mimeTypes.value=t}get mimeTypes(){return a(this._mimeTypes)}get templateMimeTypes(){return a(this._mimeTypes).filter(t=>!!t.app_providers.some(n=>!!n.target_ext))}get appNames(){return[...new Set(a(this._mimeTypes).flatMap(t=>t.app_providers.map(n=>n.name)))]}getMimeTypesByAppName(t){return a(this._mimeTypes).filter(n=>n.app_providers.some(r=>r.name===t))}}var af={},ui={};ui.byteLength=zS,ui.toByteArray=US,ui.fromByteArray=WS;for(var $n=[],rn=[],BS=typeof Uint8Array<"u"?Uint8Array:Array,ll="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ds=0,jS=ll.length;ds<jS;++ds)$n[ds]=ll[ds],rn[ll.charCodeAt(ds)]=ds;rn[45]=62,rn[95]=63;function lf(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function zS(e){var t=lf(e),n=t[0],r=t[1];return(n+r)*3/4-r}function VS(e,t,n){return(t+n)*3/4-n}function US(e){var t,n=lf(e),r=n[0],s=n[1],o=new BS(VS(e,r,s)),i=0,l=s>0?r-4:r,u;for(u=0;u<l;u+=4)t=rn[e.charCodeAt(u)]<<18|rn[e.charCodeAt(u+1)]<<12|rn[e.charCodeAt(u+2)]<<6|rn[e.charCodeAt(u+3)],o[i++]=t>>16&255,o[i++]=t>>8&255,o[i++]=t&255;return s===2&&(t=rn[e.charCodeAt(u)]<<2|rn[e.charCodeAt(u+1)]>>4,o[i++]=t&255),s===1&&(t=rn[e.charCodeAt(u)]<<10|rn[e.charCodeAt(u+1)]<<4|rn[e.charCodeAt(u+2)]>>2,o[i++]=t>>8&255,o[i++]=t&255),o}function qS(e){return $n[e>>18&63]+$n[e>>12&63]+$n[e>>6&63]+$n[e&63]}function HS(e,t,n){for(var r,s=[],o=t;o<n;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),s.push(qS(r));return s.join("")}function WS(e){for(var t,n=e.length,r=n%3,s=[],o=16383,i=0,l=n-r;i<l;i+=o)s.push(HS(e,i,i+o>l?l:i+o));return r===1?(t=e[n-1],s.push($n[t>>2]+$n[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],s.push($n[t>>10]+$n[t>>4&63]+$n[t<<2&63]+"=")),s.join("")}var cl={};cl.read=function(e,t,n,r,s){var o,i,l=s*8-r-1,u=(1<<l)-1,d=u>>1,c=-7,f=n?s-1:0,p=n?-1:1,h=e[t+f];for(f+=p,o=h&(1<<-c)-1,h>>=-c,c+=l;c>0;o=o*256+e[t+f],f+=p,c-=8);for(i=o&(1<<-c)-1,o>>=-c,c+=r;c>0;i=i*256+e[t+f],f+=p,c-=8);if(o===0)o=1-d;else{if(o===u)return i?NaN:(h?-1:1)*(1/0);i=i+Math.pow(2,r),o=o-d}return(h?-1:1)*i*Math.pow(2,o-r)},cl.write=function(e,t,n,r,s,o){var i,l,u,d=o*8-s-1,c=(1<<d)-1,f=c>>1,p=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,g=r?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,i=c):(i=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-i))<1&&(i--,u*=2),i+f>=1?t+=p/u:t+=p*Math.pow(2,1-f),t*u>=2&&(i++,u/=2),i+f>=c?(l=0,i=c):i+f>=1?(l=(t*u-1)*Math.pow(2,s),i=i+f):(l=t*Math.pow(2,f-1)*Math.pow(2,s),i=0));s>=8;e[n+h]=l&255,h+=g,l/=256,s-=8);for(i=i<<s|l,d+=s;d>0;e[n+h]=i&255,h+=g,i/=256,d-=8);e[n+h-g]|=m*128};(function(e){const t=ui,n=cl,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=A,e.INSPECT_MAX_BYTES=50;const s=2147483647;e.kMaxLength=s;const{Uint8Array:o,ArrayBuffer:i,SharedArrayBuffer:l}=globalThis;c.TYPED_ARRAY_SUPPORT=u(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function u(){try{const E=new o(1),y={foo:function(){return 42}};return Object.setPrototypeOf(y,o.prototype),Object.setPrototypeOf(E,y),E.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function d(E){if(E>s)throw new RangeError('The value "'+E+'" is invalid for option "size"');const y=new o(E);return Object.setPrototypeOf(y,c.prototype),y}function c(E,y,v){if(typeof E=="number"){if(typeof y=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(E)}return f(E,y,v)}c.poolSize=8192;function f(E,y,v){if(typeof E=="string")return m(E,y);if(i.isView(E))return S(E);if(E==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(bt(E,i)||E&&bt(E.buffer,i)||typeof l<"u"&&(bt(E,l)||E&&bt(E.buffer,l)))return k(E,y,v);if(typeof E=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const O=E.valueOf&&E.valueOf();if(O!=null&&O!==E)return c.from(O,y,v);const U=w(E);if(U)return U;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof E[Symbol.toPrimitive]=="function")return c.from(E[Symbol.toPrimitive]("string"),y,v);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E)}c.from=function(E,y,v){return f(E,y,v)},Object.setPrototypeOf(c.prototype,o.prototype),Object.setPrototypeOf(c,o);function p(E){if(typeof E!="number")throw new TypeError('"size" argument must be of type number');if(E<0)throw new RangeError('The value "'+E+'" is invalid for option "size"')}function h(E,y,v){return p(E),E<=0?d(E):y!==void 0?typeof v=="string"?d(E).fill(y,v):d(E).fill(y):d(E)}c.alloc=function(E,y,v){return h(E,y,v)};function g(E){return p(E),d(E<0?0:C(E)|0)}c.allocUnsafe=function(E){return g(E)},c.allocUnsafeSlow=function(E){return g(E)};function m(E,y){if((typeof y!="string"||y==="")&&(y="utf8"),!c.isEncoding(y))throw new TypeError("Unknown encoding: "+y);const v=I(E,y)|0;let O=d(v);const U=O.write(E,y);return U!==v&&(O=O.slice(0,U)),O}function b(E){const y=E.length<0?0:C(E.length)|0,v=d(y);for(let O=0;O<y;O+=1)v[O]=E[O]&255;return v}function S(E){if(bt(E,o)){const y=new o(E);return k(y.buffer,y.byteOffset,y.byteLength)}return b(E)}function k(E,y,v){if(y<0||E.byteLength<y)throw new RangeError('"offset" is outside of buffer bounds');if(E.byteLength<y+(v||0))throw new RangeError('"length" is outside of buffer bounds');let O;return y===void 0&&v===void 0?O=new o(E):v===void 0?O=new o(E,y):O=new o(E,y,v),Object.setPrototypeOf(O,c.prototype),O}function w(E){if(c.isBuffer(E)){const y=C(E.length)|0,v=d(y);return v.length===0||E.copy(v,0,0,y),v}if(E.length!==void 0)return typeof E.length!="number"||ln(E.length)?d(0):b(E);if(E.type==="Buffer"&&Array.isArray(E.data))return b(E.data)}function C(E){if(E>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return E|0}function A(E){return+E!=E&&(E=0),c.alloc(+E)}c.isBuffer=function(y){return y!=null&&y._isBuffer===!0&&y!==c.prototype},c.compare=function(y,v){if(bt(y,o)&&(y=c.from(y,y.offset,y.byteLength)),bt(v,o)&&(v=c.from(v,v.offset,v.byteLength)),!c.isBuffer(y)||!c.isBuffer(v))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(y===v)return 0;let O=y.length,U=v.length;for(let Y=0,se=Math.min(O,U);Y<se;++Y)if(y[Y]!==v[Y]){O=y[Y],U=v[Y];break}return O<U?-1:U<O?1:0},c.isEncoding=function(y){switch(String(y).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(y,v){if(!Array.isArray(y))throw new TypeError('"list" argument must be an Array of Buffers');if(y.length===0)return c.alloc(0);let O;if(v===void 0)for(v=0,O=0;O<y.length;++O)v+=y[O].length;const U=c.allocUnsafe(v);let Y=0;for(O=0;O<y.length;++O){let se=y[O];if(bt(se,o))Y+se.length>U.length?(c.isBuffer(se)||(se=c.from(se)),se.copy(U,Y)):o.prototype.set.call(U,se,Y);else if(c.isBuffer(se))se.copy(U,Y);else throw new TypeError('"list" argument must be an Array of Buffers');Y+=se.length}return U};function I(E,y){if(c.isBuffer(E))return E.length;if(i.isView(E)||bt(E,i))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);const v=E.length,O=arguments.length>2&&arguments[2]===!0;if(!O&&v===0)return 0;let U=!1;for(;;)switch(y){case"ascii":case"latin1":case"binary":return v;case"utf8":case"utf-8":return Fe(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v*2;case"hex":return v>>>1;case"base64":return xr(E).length;default:if(U)return O?-1:Fe(E).length;y=(""+y).toLowerCase(),U=!0}}c.byteLength=I;function N(E,y,v){let O=!1;if((y===void 0||y<0)&&(y=0),y>this.length||((v===void 0||v>this.length)&&(v=this.length),v<=0)||(v>>>=0,y>>>=0,v<=y))return"";for(E||(E="utf8");;)switch(E){case"hex":return ne(this,y,v);case"utf8":case"utf-8":return B(this,y,v);case"ascii":return J(this,y,v);case"latin1":case"binary":return oe(this,y,v);case"base64":return j(this,y,v);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,y,v);default:if(O)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),O=!0}}c.prototype._isBuffer=!0;function _(E,y,v){const O=E[y];E[y]=E[v],E[v]=O}c.prototype.swap16=function(){const y=this.length;if(y%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let v=0;v<y;v+=2)_(this,v,v+1);return this},c.prototype.swap32=function(){const y=this.length;if(y%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let v=0;v<y;v+=4)_(this,v,v+3),_(this,v+1,v+2);return this},c.prototype.swap64=function(){const y=this.length;if(y%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let v=0;v<y;v+=8)_(this,v,v+7),_(this,v+1,v+6),_(this,v+2,v+5),_(this,v+3,v+4);return this},c.prototype.toString=function(){const y=this.length;return y===0?"":arguments.length===0?B(this,0,y):N.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(y){if(!c.isBuffer(y))throw new TypeError("Argument must be a Buffer");return this===y?!0:c.compare(this,y)===0},c.prototype.inspect=function(){let y="";const v=e.INSPECT_MAX_BYTES;return y=this.toString("hex",0,v).replace(/(.{2})/g,"$1 ").trim(),this.length>v&&(y+=" ... "),"<Buffer "+y+">"},r&&(c.prototype[r]=c.prototype.inspect),c.prototype.compare=function(y,v,O,U,Y){if(bt(y,o)&&(y=c.from(y,y.offset,y.byteLength)),!c.isBuffer(y))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof y);if(v===void 0&&(v=0),O===void 0&&(O=y?y.length:0),U===void 0&&(U=0),Y===void 0&&(Y=this.length),v<0||O>y.length||U<0||Y>this.length)throw new RangeError("out of range index");if(U>=Y&&v>=O)return 0;if(U>=Y)return-1;if(v>=O)return 1;if(v>>>=0,O>>>=0,U>>>=0,Y>>>=0,this===y)return 0;let se=Y-U,Ie=O-v;const le=Math.min(se,Ie),xe=this.slice(U,Y),qe=y.slice(v,O);for(let Be=0;Be<le;++Be)if(xe[Be]!==qe[Be]){se=xe[Be],Ie=qe[Be];break}return se<Ie?-1:Ie<se?1:0};function F(E,y,v,O,U){if(E.length===0)return-1;if(typeof v=="string"?(O=v,v=0):v>2147483647?v=2147483647:v<-2147483648&&(v=-2147483648),v=+v,ln(v)&&(v=U?0:E.length-1),v<0&&(v=E.length+v),v>=E.length){if(U)return-1;v=E.length-1}else if(v<0)if(U)v=0;else return-1;if(typeof y=="string"&&(y=c.from(y,O)),c.isBuffer(y))return y.length===0?-1:V(E,y,v,O,U);if(typeof y=="number")return y=y&255,typeof o.prototype.indexOf=="function"?U?o.prototype.indexOf.call(E,y,v):o.prototype.lastIndexOf.call(E,y,v):V(E,[y],v,O,U);throw new TypeError("val must be string, number or Buffer")}function V(E,y,v,O,U){let Y=1,se=E.length,Ie=y.length;if(O!==void 0&&(O=String(O).toLowerCase(),O==="ucs2"||O==="ucs-2"||O==="utf16le"||O==="utf-16le")){if(E.length<2||y.length<2)return-1;Y=2,se/=2,Ie/=2,v/=2}function le(qe,Be){return Y===1?qe[Be]:qe.readUInt16BE(Be*Y)}let xe;if(U){let qe=-1;for(xe=v;xe<se;xe++)if(le(E,xe)===le(y,qe===-1?0:xe-qe)){if(qe===-1&&(qe=xe),xe-qe+1===Ie)return qe*Y}else qe!==-1&&(xe-=xe-qe),qe=-1}else for(v+Ie>se&&(v=se-Ie),xe=v;xe>=0;xe--){let qe=!0;for(let Be=0;Be<Ie;Be++)if(le(E,xe+Be)!==le(y,Be)){qe=!1;break}if(qe)return xe}return-1}c.prototype.includes=function(y,v,O){return this.indexOf(y,v,O)!==-1},c.prototype.indexOf=function(y,v,O){return F(this,y,v,O,!0)},c.prototype.lastIndexOf=function(y,v,O){return F(this,y,v,O,!1)};function Z(E,y,v,O){v=Number(v)||0;const U=E.length-v;O?(O=Number(O),O>U&&(O=U)):O=U;const Y=y.length;O>Y/2&&(O=Y/2);let se;for(se=0;se<O;++se){const Ie=parseInt(y.substr(se*2,2),16);if(ln(Ie))return se;E[v+se]=Ie}return se}function P(E,y,v,O){return kn(Fe(y,E.length-v),E,v,O)}function $(E,y,v,O){return kn(gt(y),E,v,O)}function L(E,y,v,O){return kn(xr(y),E,v,O)}function M(E,y,v,O){return kn(Qr(y,E.length-v),E,v,O)}c.prototype.write=function(y,v,O,U){if(v===void 0)U="utf8",O=this.length,v=0;else if(O===void 0&&typeof v=="string")U=v,O=this.length,v=0;else if(isFinite(v))v=v>>>0,isFinite(O)?(O=O>>>0,U===void 0&&(U="utf8")):(U=O,O=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Y=this.length-v;if((O===void 0||O>Y)&&(O=Y),y.length>0&&(O<0||v<0)||v>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");let se=!1;for(;;)switch(U){case"hex":return Z(this,y,v,O);case"utf8":case"utf-8":return P(this,y,v,O);case"ascii":case"latin1":case"binary":return $(this,y,v,O);case"base64":return L(this,y,v,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,y,v,O);default:if(se)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),se=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function j(E,y,v){return y===0&&v===E.length?t.fromByteArray(E):t.fromByteArray(E.slice(y,v))}function B(E,y,v){v=Math.min(E.length,v);const O=[];let U=y;for(;U<v;){const Y=E[U];let se=null,Ie=Y>239?4:Y>223?3:Y>191?2:1;if(U+Ie<=v){let le,xe,qe,Be;switch(Ie){case 1:Y<128&&(se=Y);break;case 2:le=E[U+1],(le&192)===128&&(Be=(Y&31)<<6|le&63,Be>127&&(se=Be));break;case 3:le=E[U+1],xe=E[U+2],(le&192)===128&&(xe&192)===128&&(Be=(Y&15)<<12|(le&63)<<6|xe&63,Be>2047&&(Be<55296||Be>57343)&&(se=Be));break;case 4:le=E[U+1],xe=E[U+2],qe=E[U+3],(le&192)===128&&(xe&192)===128&&(qe&192)===128&&(Be=(Y&15)<<18|(le&63)<<12|(xe&63)<<6|qe&63,Be>65535&&Be<1114112&&(se=Be))}}se===null?(se=65533,Ie=1):se>65535&&(se-=65536,O.push(se>>>10&1023|55296),se=56320|se&1023),O.push(se),U+=Ie}return re(O)}const q=4096;function re(E){const y=E.length;if(y<=q)return String.fromCharCode.apply(String,E);let v="",O=0;for(;O<y;)v+=String.fromCharCode.apply(String,E.slice(O,O+=q));return v}function J(E,y,v){let O="";v=Math.min(E.length,v);for(let U=y;U<v;++U)O+=String.fromCharCode(E[U]&127);return O}function oe(E,y,v){let O="";v=Math.min(E.length,v);for(let U=y;U<v;++U)O+=String.fromCharCode(E[U]);return O}function ne(E,y,v){const O=E.length;(!y||y<0)&&(y=0),(!v||v<0||v>O)&&(v=O);let U="";for(let Y=y;Y<v;++Y)U+=vo[E[Y]];return U}function pe(E,y,v){const O=E.slice(y,v);let U="";for(let Y=0;Y<O.length-1;Y+=2)U+=String.fromCharCode(O[Y]+O[Y+1]*256);return U}c.prototype.slice=function(y,v){const O=this.length;y=~~y,v=v===void 0?O:~~v,y<0?(y+=O,y<0&&(y=0)):y>O&&(y=O),v<0?(v+=O,v<0&&(v=0)):v>O&&(v=O),v<y&&(v=y);const U=this.subarray(y,v);return Object.setPrototypeOf(U,c.prototype),U};function fe(E,y,v){if(E%1!==0||E<0)throw new RangeError("offset is not uint");if(E+y>v)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(y,v,O){y=y>>>0,v=v>>>0,O||fe(y,v,this.length);let U=this[y],Y=1,se=0;for(;++se<v&&(Y*=256);)U+=this[y+se]*Y;return U},c.prototype.readUintBE=c.prototype.readUIntBE=function(y,v,O){y=y>>>0,v=v>>>0,O||fe(y,v,this.length);let U=this[y+--v],Y=1;for(;v>0&&(Y*=256);)U+=this[y+--v]*Y;return U},c.prototype.readUint8=c.prototype.readUInt8=function(y,v){return y=y>>>0,v||fe(y,1,this.length),this[y]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(y,v){return y=y>>>0,v||fe(y,2,this.length),this[y]|this[y+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(y,v){return y=y>>>0,v||fe(y,2,this.length),this[y]<<8|this[y+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(y,v){return y=y>>>0,v||fe(y,4,this.length),(this[y]|this[y+1]<<8|this[y+2]<<16)+this[y+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(y,v){return y=y>>>0,v||fe(y,4,this.length),this[y]*16777216+(this[y+1]<<16|this[y+2]<<8|this[y+3])},c.prototype.readBigUInt64LE=cn(function(y){y=y>>>0,vt(y,"offset");const v=this[y],O=this[y+7];(v===void 0||O===void 0)&&Dt(y,this.length-8);const U=v+this[++y]*2**8+this[++y]*2**16+this[++y]*2**24,Y=this[++y]+this[++y]*2**8+this[++y]*2**16+O*2**24;return BigInt(U)+(BigInt(Y)<<BigInt(32))}),c.prototype.readBigUInt64BE=cn(function(y){y=y>>>0,vt(y,"offset");const v=this[y],O=this[y+7];(v===void 0||O===void 0)&&Dt(y,this.length-8);const U=v*2**24+this[++y]*2**16+this[++y]*2**8+this[++y],Y=this[++y]*2**24+this[++y]*2**16+this[++y]*2**8+O;return(BigInt(U)<<BigInt(32))+BigInt(Y)}),c.prototype.readIntLE=function(y,v,O){y=y>>>0,v=v>>>0,O||fe(y,v,this.length);let U=this[y],Y=1,se=0;for(;++se<v&&(Y*=256);)U+=this[y+se]*Y;return Y*=128,U>=Y&&(U-=Math.pow(2,8*v)),U},c.prototype.readIntBE=function(y,v,O){y=y>>>0,v=v>>>0,O||fe(y,v,this.length);let U=v,Y=1,se=this[y+--U];for(;U>0&&(Y*=256);)se+=this[y+--U]*Y;return Y*=128,se>=Y&&(se-=Math.pow(2,8*v)),se},c.prototype.readInt8=function(y,v){return y=y>>>0,v||fe(y,1,this.length),this[y]&128?(255-this[y]+1)*-1:this[y]},c.prototype.readInt16LE=function(y,v){y=y>>>0,v||fe(y,2,this.length);const O=this[y]|this[y+1]<<8;return O&32768?O|4294901760:O},c.prototype.readInt16BE=function(y,v){y=y>>>0,v||fe(y,2,this.length);const O=this[y+1]|this[y]<<8;return O&32768?O|4294901760:O},c.prototype.readInt32LE=function(y,v){return y=y>>>0,v||fe(y,4,this.length),this[y]|this[y+1]<<8|this[y+2]<<16|this[y+3]<<24},c.prototype.readInt32BE=function(y,v){return y=y>>>0,v||fe(y,4,this.length),this[y]<<24|this[y+1]<<16|this[y+2]<<8|this[y+3]},c.prototype.readBigInt64LE=cn(function(y){y=y>>>0,vt(y,"offset");const v=this[y],O=this[y+7];(v===void 0||O===void 0)&&Dt(y,this.length-8);const U=this[y+4]+this[y+5]*2**8+this[y+6]*2**16+(O<<24);return(BigInt(U)<<BigInt(32))+BigInt(v+this[++y]*2**8+this[++y]*2**16+this[++y]*2**24)}),c.prototype.readBigInt64BE=cn(function(y){y=y>>>0,vt(y,"offset");const v=this[y],O=this[y+7];(v===void 0||O===void 0)&&Dt(y,this.length-8);const U=(v<<24)+this[++y]*2**16+this[++y]*2**8+this[++y];return(BigInt(U)<<BigInt(32))+BigInt(this[++y]*2**24+this[++y]*2**16+this[++y]*2**8+O)}),c.prototype.readFloatLE=function(y,v){return y=y>>>0,v||fe(y,4,this.length),n.read(this,y,!0,23,4)},c.prototype.readFloatBE=function(y,v){return y=y>>>0,v||fe(y,4,this.length),n.read(this,y,!1,23,4)},c.prototype.readDoubleLE=function(y,v){return y=y>>>0,v||fe(y,8,this.length),n.read(this,y,!0,52,8)},c.prototype.readDoubleBE=function(y,v){return y=y>>>0,v||fe(y,8,this.length),n.read(this,y,!1,52,8)};function we(E,y,v,O,U,Y){if(!c.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(y>U||y<Y)throw new RangeError('"value" argument is out of bounds');if(v+O>E.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(y,v,O,U){if(y=+y,v=v>>>0,O=O>>>0,!U){const Ie=Math.pow(2,8*O)-1;we(this,y,v,O,Ie,0)}let Y=1,se=0;for(this[v]=y&255;++se<O&&(Y*=256);)this[v+se]=y/Y&255;return v+O},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(y,v,O,U){if(y=+y,v=v>>>0,O=O>>>0,!U){const Ie=Math.pow(2,8*O)-1;we(this,y,v,O,Ie,0)}let Y=O-1,se=1;for(this[v+Y]=y&255;--Y>=0&&(se*=256);)this[v+Y]=y/se&255;return v+O},c.prototype.writeUint8=c.prototype.writeUInt8=function(y,v,O){return y=+y,v=v>>>0,O||we(this,y,v,1,255,0),this[v]=y&255,v+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(y,v,O){return y=+y,v=v>>>0,O||we(this,y,v,2,65535,0),this[v]=y&255,this[v+1]=y>>>8,v+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(y,v,O){return y=+y,v=v>>>0,O||we(this,y,v,2,65535,0),this[v]=y>>>8,this[v+1]=y&255,v+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(y,v,O){return y=+y,v=v>>>0,O||we(this,y,v,4,4294967295,0),this[v+3]=y>>>24,this[v+2]=y>>>16,this[v+1]=y>>>8,this[v]=y&255,v+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(y,v,O){return y=+y,v=v>>>0,O||we(this,y,v,4,4294967295,0),this[v]=y>>>24,this[v+1]=y>>>16,this[v+2]=y>>>8,this[v+3]=y&255,v+4};function $e(E,y,v,O,U){Kt(y,O,U,E,v,7);let Y=Number(y&BigInt(4294967295));E[v++]=Y,Y=Y>>8,E[v++]=Y,Y=Y>>8,E[v++]=Y,Y=Y>>8,E[v++]=Y;let se=Number(y>>BigInt(32)&BigInt(4294967295));return E[v++]=se,se=se>>8,E[v++]=se,se=se>>8,E[v++]=se,se=se>>8,E[v++]=se,v}function he(E,y,v,O,U){Kt(y,O,U,E,v,7);let Y=Number(y&BigInt(4294967295));E[v+7]=Y,Y=Y>>8,E[v+6]=Y,Y=Y>>8,E[v+5]=Y,Y=Y>>8,E[v+4]=Y;let se=Number(y>>BigInt(32)&BigInt(4294967295));return E[v+3]=se,se=se>>8,E[v+2]=se,se=se>>8,E[v+1]=se,se=se>>8,E[v]=se,v+8}c.prototype.writeBigUInt64LE=cn(function(y,v=0){return $e(this,y,v,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=cn(function(y,v=0){return he(this,y,v,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(y,v,O,U){if(y=+y,v=v>>>0,!U){const le=Math.pow(2,8*O-1);we(this,y,v,O,le-1,-le)}let Y=0,se=1,Ie=0;for(this[v]=y&255;++Y<O&&(se*=256);)y<0&&Ie===0&&this[v+Y-1]!==0&&(Ie=1),this[v+Y]=(y/se>>0)-Ie&255;return v+O},c.prototype.writeIntBE=function(y,v,O,U){if(y=+y,v=v>>>0,!U){const le=Math.pow(2,8*O-1);we(this,y,v,O,le-1,-le)}let Y=O-1,se=1,Ie=0;for(this[v+Y]=y&255;--Y>=0&&(se*=256);)y<0&&Ie===0&&this[v+Y+1]!==0&&(Ie=1),this[v+Y]=(y/se>>0)-Ie&255;return v+O},c.prototype.writeInt8=function(y,v,O){return y=+y,v=v>>>0,O||we(this,y,v,1,127,-128),y<0&&(y=255+y+1),this[v]=y&255,v+1},c.prototype.writeInt16LE=function(y,v,O){return y=+y,v=v>>>0,O||we(this,y,v,2,32767,-32768),this[v]=y&255,this[v+1]=y>>>8,v+2},c.prototype.writeInt16BE=function(y,v,O){return y=+y,v=v>>>0,O||we(this,y,v,2,32767,-32768),this[v]=y>>>8,this[v+1]=y&255,v+2},c.prototype.writeInt32LE=function(y,v,O){return y=+y,v=v>>>0,O||we(this,y,v,4,2147483647,-2147483648),this[v]=y&255,this[v+1]=y>>>8,this[v+2]=y>>>16,this[v+3]=y>>>24,v+4},c.prototype.writeInt32BE=function(y,v,O){return y=+y,v=v>>>0,O||we(this,y,v,4,2147483647,-2147483648),y<0&&(y=4294967295+y+1),this[v]=y>>>24,this[v+1]=y>>>16,this[v+2]=y>>>8,this[v+3]=y&255,v+4},c.prototype.writeBigInt64LE=cn(function(y,v=0){return $e(this,y,v,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=cn(function(y,v=0){return he(this,y,v,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ae(E,y,v,O,U,Y){if(v+O>E.length)throw new RangeError("Index out of range");if(v<0)throw new RangeError("Index out of range")}function ue(E,y,v,O,U){return y=+y,v=v>>>0,U||ae(E,y,v,4),n.write(E,y,v,O,23,4),v+4}c.prototype.writeFloatLE=function(y,v,O){return ue(this,y,v,!0,O)},c.prototype.writeFloatBE=function(y,v,O){return ue(this,y,v,!1,O)};function be(E,y,v,O,U){return y=+y,v=v>>>0,U||ae(E,y,v,8),n.write(E,y,v,O,52,8),v+8}c.prototype.writeDoubleLE=function(y,v,O){return be(this,y,v,!0,O)},c.prototype.writeDoubleBE=function(y,v,O){return be(this,y,v,!1,O)},c.prototype.copy=function(y,v,O,U){if(!c.isBuffer(y))throw new TypeError("argument should be a Buffer");if(O||(O=0),!U&&U!==0&&(U=this.length),v>=y.length&&(v=y.length),v||(v=0),U>0&&U<O&&(U=O),U===O||y.length===0||this.length===0)return 0;if(v<0)throw new RangeError("targetStart out of bounds");if(O<0||O>=this.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),y.length-v<U-O&&(U=y.length-v+O);const Y=U-O;return this===y&&typeof o.prototype.copyWithin=="function"?this.copyWithin(v,O,U):o.prototype.set.call(y,this.subarray(O,U),v),Y},c.prototype.fill=function(y,v,O,U){if(typeof y=="string"){if(typeof v=="string"?(U=v,v=0,O=this.length):typeof O=="string"&&(U=O,O=this.length),U!==void 0&&typeof U!="string")throw new TypeError("encoding must be a string");if(typeof U=="string"&&!c.isEncoding(U))throw new TypeError("Unknown encoding: "+U);if(y.length===1){const se=y.charCodeAt(0);(U==="utf8"&&se<128||U==="latin1")&&(y=se)}}else typeof y=="number"?y=y&255:typeof y=="boolean"&&(y=Number(y));if(v<0||this.length<v||this.length<O)throw new RangeError("Out of range index");if(O<=v)return this;v=v>>>0,O=O===void 0?this.length:O>>>0,y||(y=0);let Y;if(typeof y=="number")for(Y=v;Y<O;++Y)this[Y]=y;else{const se=c.isBuffer(y)?y:c.from(y,U),Ie=se.length;if(Ie===0)throw new TypeError('The value "'+y+'" is invalid for argument "value"');for(Y=0;Y<O-v;++Y)this[Y+v]=se[Y%Ie]}return this};const me={};function De(E,y,v){me[E]=class extends v{constructor(){super(),Object.defineProperty(this,"message",{value:y.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${E}]`,this.stack,delete this.name}get code(){return E}set code(U){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:U,writable:!0})}toString(){return`${this.name} [${E}]: ${this.message}`}}}De("ERR_BUFFER_OUT_OF_BOUNDS",function(E){return E?`${E} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),De("ERR_INVALID_ARG_TYPE",function(E,y){return`The "${E}" argument must be of type number. Received type ${typeof y}`},TypeError),De("ERR_OUT_OF_RANGE",function(E,y,v){let O=`The value of "${E}" is out of range.`,U=v;return Number.isInteger(v)&&Math.abs(v)>2**32?U=_e(String(v)):typeof v=="bigint"&&(U=String(v),(v>BigInt(2)**BigInt(32)||v<-(BigInt(2)**BigInt(32)))&&(U=_e(U)),U+="n"),O+=` It must be ${y}. Received ${U}`,O},RangeError);function _e(E){let y="",v=E.length;const O=E[0]==="-"?1:0;for(;v>=O+4;v-=3)y=`_${E.slice(v-3,v)}${y}`;return`${E.slice(0,v)}${y}`}function ut(E,y,v){vt(y,"offset"),(E[y]===void 0||E[y+v]===void 0)&&Dt(y,E.length-(v+1))}function Kt(E,y,v,O,U,Y){if(E>v||E<y){const se=typeof y=="bigint"?"n":"";let Ie;throw y===0||y===BigInt(0)?Ie=`>= 0${se} and < 2${se} ** ${(Y+1)*8}${se}`:Ie=`>= -(2${se} ** ${(Y+1)*8-1}${se}) and < 2 ** ${(Y+1)*8-1}${se}`,new me.ERR_OUT_OF_RANGE("value",Ie,E)}ut(O,U,Y)}function vt(E,y){if(typeof E!="number")throw new me.ERR_INVALID_ARG_TYPE(y,"number",E)}function Dt(E,y,v){throw Math.floor(E)!==E?(vt(E,v),new me.ERR_OUT_OF_RANGE("offset","an integer",E)):y<0?new me.ERR_BUFFER_OUT_OF_BOUNDS:new me.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${y}`,E)}const Ve=/[^+/0-9A-Za-z-_]/g;function ye(E){if(E=E.split("=")[0],E=E.trim().replace(Ve,""),E.length<2)return"";for(;E.length%4!==0;)E=E+"=";return E}function Fe(E,y){y=y||1/0;let v;const O=E.length;let U=null;const Y=[];for(let se=0;se<O;++se){if(v=E.charCodeAt(se),v>55295&&v<57344){if(!U){if(v>56319){(y-=3)>-1&&Y.push(239,191,189);continue}else if(se+1===O){(y-=3)>-1&&Y.push(239,191,189);continue}U=v;continue}if(v<56320){(y-=3)>-1&&Y.push(239,191,189),U=v;continue}v=(U-55296<<10|v-56320)+65536}else U&&(y-=3)>-1&&Y.push(239,191,189);if(U=null,v<128){if((y-=1)<0)break;Y.push(v)}else if(v<2048){if((y-=2)<0)break;Y.push(v>>6|192,v&63|128)}else if(v<65536){if((y-=3)<0)break;Y.push(v>>12|224,v>>6&63|128,v&63|128)}else if(v<1114112){if((y-=4)<0)break;Y.push(v>>18|240,v>>12&63|128,v>>6&63|128,v&63|128)}else throw new Error("Invalid code point")}return Y}function gt(E){const y=[];for(let v=0;v<E.length;++v)y.push(E.charCodeAt(v)&255);return y}function Qr(E,y){let v,O,U;const Y=[];for(let se=0;se<E.length&&!((y-=2)<0);++se)v=E.charCodeAt(se),O=v>>8,U=v%256,Y.push(U),Y.push(O);return Y}function xr(E){return t.toByteArray(ye(E))}function kn(E,y,v,O){let U;for(U=0;U<O&&!(U+v>=y.length||U>=E.length);++U)y[U+v]=E[U];return U}function bt(E,y){return E instanceof y||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===y.name}function ln(E){return E!==E}const vo=(function(){const E="0123456789abcdef",y=new Array(256);for(let v=0;v<16;++v){const O=v*16;for(let U=0;U<16;++U)y[O+U]=E[v]+E[U]}return y})();function cn(E){return typeof BigInt>"u"?bo:E}function bo(){throw new Error("BigInt not supported")}})(af);const di=af.Buffer;class fs extends Error{name="RuntimeError";constructor(t,...n){super([t,...n].filter(Boolean).join(", ")),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class QS extends fs{name="ApiError"}const ul=(e,t="")=>{const n=document.createElement("a");n.style.display="none",document.body.appendChild(n),n.href=e,n.setAttribute("download",t),n.click(),document.body.removeChild(n)},dl=(e="")=>e.split("/").map(encodeURIComponent).join("/"),KS=e=>{const t=[],n=(r,s="")=>Object.keys(r).forEach(o=>{Ga(r[o])?n(r[o],`${s}${o}.`):t.push(`${s}${o}`)});return n(e),t},fl=e=>{const t=e.startsWith("v")?e.slice(1):e,[n,r]=t.split("-"),[s,o,i]=n.split(".").map(Number);return{major:s,minor:o,patch:i,pre:r}},pl=(e,t)=>{const n=fl(e),r=fl(t);return n.major!==r.major?n.major-r.major:n.minor!==r.minor?n.minor-r.minor:n.patch!==r.patch?n.patch-r.patch:n.pre&&!r.pre?-1:!n.pre&&r.pre?1:n.pre&&r.pre?n.pre.localeCompare(r.pre):0};class GS{clientService;userStore;serverUrl;capability;available;constructor(t,n,r,s=H([])){this.clientService=t,this.userStore=n,this.serverUrl=r,this.capability=T(()=>{const o=a(s).filter(i=>i.enabled).sort((i,l)=>pl(l.version,i.version));return o.length?o[0]:null}),this.available=T(()=>!!a(this.capability)?.version)}async triggerDownload(t){if(!a(this.available))throw new fs("no archiver available");if((t.fileIds?.length||0)+(t.files?.length||0)===0)throw new fs("requested archive with empty list of resources");const n=this.buildDownloadUrl({...t});if(!n)throw new fs("download url could not be built");let r=t.publicToken?n:await this.clientService.ocs.signUrl(n,this.userStore.user?.onPremisesSamAccountName),s;if(t.publicLinkPassword)try{const o=await fetch(r,{headers:{...this.clientService.getRequestHeaders({useAuth:!1}),Authorization:"Basic "+di.from(["public",t.publicLinkPassword].join(":")).toString("base64")}});if(!o.ok)throw new z.HttpError("",o);const i=await o.blob();r=URL.createObjectURL(i),s=decodeURI(o.headers.get("content-disposition")?.split('"')[1])}catch{throw new Error("archive could not be fetched")}return ul(r,s),r}buildDownloadUrl(t){const n=[];return t.publicToken&&n.push(`public-token=${t.publicToken}`),n.push(...t.fileIds.map(r=>`id=${r}`)),this.url+"?"+n.join("&")}get url(){if(!this.available)throw new fs("no archiver available");const t=a(this.capability);return/^https?:\/\//i.test(t.archiver_url)?t.archiver_url:z.urlJoin(this.serverUrl,t.archiver_url)}}const JS=new Zd({ttl:10*1e3,capacity:250});class XS{get filePreview(){return JS}}const hl=new XS;class ml{accessToken;publicLinkToken;publicLinkPassword;constructor(t={}){this.accessToken=t.accessToken,this.publicLinkToken=t.publicLinkToken,this.publicLinkPassword=t.publicLinkPassword}getHeaders(){return{...this.publicLinkToken&&{"public-token":this.publicLinkToken},...this.publicLinkPassword&&{Authorization:"Basic "+di.from(["public",this.publicLinkPassword].join(":")).toString("base64")},...this.accessToken&&!this.publicLinkPassword&&!this.publicLinkToken&&{Authorization:"Bearer "+this.accessToken}}}}class gl{instance;cancelToken;constructor(t,n){this.cancelToken=wo.CancelToken.source(),this.instance=wo.create(t),n&&this.instance.interceptors.request.use(n)}cancel(t){this.cancelToken.cancel(t)}async delete(t,n,r){return await this.internalRequestWithData("delete",t,n,r)}get(t,n){return this.internalRequest("get",t,n)}head(t,n){return this.internalRequest("head",t,n)}options(t,n){return this.internalRequest("options",t,n)}patch(t,n,r){return this.internalRequestWithData("patch",t,n,r)}post(t,n,r){return this.internalRequestWithData("post",t,n,r)}put(t,n,r){return this.internalRequestWithData("put",t,n,r)}async request(t){const n=await this.instance.request(this.obtainConfig(t));return this.processResponse(n,t)}obtainConfig(t){return Ws({cancelToken:this.cancelToken.token},t)}processResponse(t,n){if(n?.schema){const r=n.schema.parse(t.data);return{...t,data:r}}return t}async internalRequest(t,n,r){const s=await this.instance[t](n,this.obtainConfig(r));return this.processResponse(s,r)}async internalRequestWithData(t,n,r,s){const o=await this.instance[t](n,r,this.obtainConfig(s));return this.processResponse(o,s)}}class YS extends Error{name="RetriableError"}const ZS=15e3;class e0{url;fetchOptions;abortController;eventListenerMap;readyState;withCredentials;CONNECTING;OPEN;CLOSED;onerror;onmessage;onopen;constructor(t,n){this.url=t,this.fetchOptions=n,this.abortController=new AbortController,this.eventListenerMap={},this.readyState=this.CONNECTING,this.connect()}connect(){return gg.fetchEventSource(this.url,{openWhenHidden:!0,signal:this.abortController.signal,fetch:this.fetchProvider.bind(this),onopen:async()=>{const t=new Event("open");this.onopen?.bind(this)(t),this.readyState=this.OPEN},onmessage:t=>{const n=new MessageEvent("message",{data:t.data});this.onmessage?.bind(this)(n);const r=t.event;this.eventListenerMap[r]?.forEach(o=>o(n))},onclose:()=>{throw this.readyState=this.CLOSED,new YS},onerror:t=>{console.error(t);const n=new CustomEvent("error",{detail:t});return this.onerror?.bind(this)(n),3e4+Math.floor(Math.random()*ZS)}})}fetchProvider(...t){const[n,r]=t,s={...r,...this.fetchOptions};return window.fetch(n,s)}close(){this.abortController.abort("closed")}addEventListener(t,n){this.eventListenerMap[t]=this.eventListenerMap[t]||[],this.eventListenerMap[t].push(n)}removeEventListener(t,n){this.eventListenerMap[t]=this.eventListenerMap[t]?.filter(r=>r!==n)}dispatchEvent(){throw new Error("Method not implemented.")}updateAccessToken(t){this.fetchOptions.headers.Authorization=`Bearer ${t}`}updateLanguage(t){this.fetchOptions.headers["Accept-Language"]=t,this.close(),this.connect()}}let yl=null;const t0=(e,t)=>(yl||(yl=new e0(new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse",e).href,t)),yl),n0=(e,t)=>({headers:{Authorization:`Bearer ${e.accessToken}`,"Accept-Language":t,"X-Request-ID":wt.v4(),"X-Requested-With":"XMLHttpRequest"}});class r0{configStore;language;authStore;httpAuthenticatedClient;httpUnAuthenticatedClient;graphClient;ocsClient;webDavClient;initiatorId=wt.v4();staticHeaders={"Initiator-ID":this.initiatorId,"X-Requested-With":"XMLHttpRequest"};constructor(t){this.configStore=t.configStore,this.language=t.language,this.authStore=t.authStore,this.initGraphClient(),this.initOcsClient(),this.initWebDavClient(),this.httpAuthenticatedClient=new gl({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.httpUnAuthenticatedClient=new gl({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders({useAuth:!1})),n))}get httpAuthenticated(){return this.httpAuthenticatedClient}get httpUnAuthenticated(){return this.httpUnAuthenticatedClient}get graphAuthenticated(){return this.graphClient}get sseAuthenticated(){return t0(this.configStore.serverUrl,n0({accessToken:this.authStore.accessToken},this.currentLanguage))}get ocs(){return this.ocsClient}get webdav(){return this.webDavClient}get currentLanguage(){return this.language.current}getRequestHeaders=({useAuth:t=!0}={})=>({...this.staticHeaders,...this.getDynamicHeaders({useAuth:t})});initGraphClient(){const t=wo.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.graphClient=z.graph(this.configStore.serverUrl,t)}initOcsClient(){const t=wo.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.ocsClient=z.ocs(this.configStore.serverUrl,t)}initWebDavClient(){this.webDavClient=z.webdav(this.configStore.serverUrl,()=>{const t={...this.staticHeaders,...this.getDynamicHeaders()};return this.authStore.publicLinkToken&&(t["public-token"]=this.authStore.publicLinkToken),this.authStore.publicLinkPassword&&(t.Authorization="Basic "+di.from(["public",this.authStore.publicLinkPassword].join(":")).toString("base64")),t})}getDynamicHeaders({useAuth:t=!0}={}){return{"Accept-Language":this.currentLanguage,"X-Request-ID":wt.v4(),...t&&{Authorization:"Bearer "+this.authStore.accessToken}}}}class cf{topics;constructor(){this.topics=new Map}subscribe(t,n){const r={token:wt.v4(),callback:n},s=[r,...this.topics.get(t)||[]];return this.topics.set(t,s),r.token}publish(t,n){(this.topics.get(t)||[]).forEach(s=>s.callback(n))}unsubscribe(t,n){this.topics.has(t)&&this.topics.set(t,this.topics.get(t).filter(r=>r.token!==n))}}const Xe=new cf;class uf{static Shared="S";static Shareable="R";static Mounted="M";static Deletable="D";static Renameable="N";static Moveable="V";static Updateable="NV";static FileUpdateable="W";static FolderCreateable="CK";static Deny="Z";static SecureView="X"}const fi=e=>({value:e,type:null}),s0=e=>fi(e),Ye=e=>fi(e),pi=e=>fi(e),o0=e=>fi(e),i0={Permissions:Ye("permissions"),IsFavorite:pi("favorite"),FileId:Ye("fileid"),FileParent:Ye("file-parent"),Name:Ye("name"),OwnerId:Ye("owner-id"),OwnerDisplayName:Ye("owner-display-name"),PrivateLink:Ye("privatelink"),ContentLength:pi("getcontentlength"),ContentSize:pi("size"),LastModifiedDate:Ye("getlastmodified"),Tags:s0("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:Ye("getetag"),MimeType:Ye("getcontenttype"),ResourceType:o0("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:Ye("owner"),LockTime:Ye("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:Ye("downloadURL"),Highlights:Ye("highlights"),MetaPathForUser:Ye("meta-path-for-user"),RemoteItemId:Ye("remote-item-id"),HasPreview:pi("has-preview"),ShareId:Ye("shareid"),ShareRoot:Ye("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:Ye("share-permissions"),TrashbinOriginalFilename:Ye("trashbin-original-filename"),TrashbinOriginalLocation:Ye("trashbin-original-location"),TrashbinDeletedDate:Ye("trashbin-delete-datetime"),PublicLinkItemType:Ye("public-link-item-type"),PublicLinkPermission:Ye("public-link-permission"),PublicLinkExpiration:Ye("public-link-expiration"),PublicLinkShareDate:Ye("public-link-share-datetime"),PublicLinkShareOwner:Ye("public-link-share-owner")},Te=Object.fromEntries(Object.entries(i0).map(([e,t])=>[e,t.value]));class Qs{static Default=[Te.Permissions,Te.IsFavorite,Te.FileId,Te.FileParent,Te.Name,Te.LockDiscovery,Te.ActiveLock,Te.OwnerId,Te.OwnerDisplayName,Te.RemoteItemId,Te.ShareRoot,Te.ShareTypes,Te.PrivateLink,Te.ContentLength,Te.ContentSize,Te.LastModifiedDate,Te.ETag,Te.MimeType,Te.ResourceType,Te.Tags,Te.Audio,Te.Location,Te.Image,Te.Photo,Te.HasPreview];static PublicLink=Qs.Default.concat([Te.PublicLinkItemType,Te.PublicLinkPermission,Te.PublicLinkExpiration,Te.PublicLinkShareDate,Te.PublicLinkShareOwner]);static Trashbin=[Te.ContentLength,Te.ResourceType,Te.TrashbinOriginalLocation,Te.TrashbinOriginalFilename,Te.TrashbinDeletedDate,Te.Permissions,Te.FileParent];static DavNamespace=[Te.ContentLength,Te.LastModifiedDate,Te.ETag,Te.MimeType,Te.ResourceType,Te.LockDiscovery,Te.ActiveLock]}var a0="[object Symbol]";function hi(e){return typeof e=="symbol"||Fn(e)&&$r(e)==a0}var l0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c0=/^\w*$/;function u0(e,t){if(mn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||hi(e)?!0:c0.test(e)||!l0.test(e)||t!=null&&e in Object(t)}var d0="Expected a function";function vl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(d0);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],o=n.cache;if(o.has(s))return o.get(s);var i=e.apply(this,r);return n.cache=o.set(s,i)||o,i};return n.cache=new(vl.Cache||Kn),n}vl.Cache=Kn;var f0=500;function p0(e){var t=vl(e,function(r){return n.size===f0&&n.clear(),r}),n=t.cache;return t}var h0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,m0=/\\(\\)?/g,g0=p0(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(h0,function(n,r,s,o){t.push(s?o.replace(m0,"$1"):r||n)}),t});function df(e,t){for(var n=-1,r=e==null?0:e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}var ff=en?en.prototype:void 0,pf=ff?ff.toString:void 0;function hf(e){if(typeof e=="string")return e;if(mn(e))return df(e,hf)+"";if(hi(e))return pf?pf.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function bl(e){return e==null?"":hf(e)}function wl(e,t){return mn(e)?e:u0(e,t)?[e]:g0(bl(e))}function mf(e){if(typeof e=="string"||hi(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function gf(e,t){t=wl(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[mf(t[n++])];return n&&n==r?e:void 0}function Sl(e,t,n){var r=e==null?void 0:gf(e,t);return r===void 0?n:r}var y0={2:e=>{function t(s,o,i){s instanceof RegExp&&(s=n(s,i)),o instanceof RegExp&&(o=n(o,i));var l=r(s,o,i);return l&&{start:l[0],end:l[1],pre:i.slice(0,l[0]),body:i.slice(l[0]+s.length,l[1]),post:i.slice(l[1]+o.length)}}function n(s,o){var i=o.match(s);return i?i[0]:null}function r(s,o,i){var l,u,d,c,f,p=i.indexOf(s),h=i.indexOf(o,p+1),g=p;if(p>=0&&h>0){for(l=[],d=i.length;g>=0&&!f;)g==p?(l.push(g),p=i.indexOf(s,g+1)):l.length==1?f=[l.pop(),h]:((u=l.pop())<d&&(d=u,c=h),h=i.indexOf(o,g+1)),g=p<h&&p>=0?p:h;l.length&&(f=[d,c])}return f}e.exports=t,t.range=r},47:(e,t,n)=>{var r=n(410),s=function(d){return typeof d=="string"};function o(d,c){for(var f=[],p=0;p<d.length;p++){var h=d[p];h&&h!=="."&&(h===".."?f.length&&f[f.length-1]!==".."?f.pop():c&&f.push(".."):f.push(h))}return f}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,l={};function u(d){return i.exec(d).slice(1)}l.resolve=function(){for(var d="",c=!1,f=arguments.length-1;f>=-1&&!c;f--){var p=f>=0?arguments[f]:ce.cwd();if(!s(p))throw new TypeError("Arguments to path.resolve must be strings");p&&(d=p+"/"+d,c=p.charAt(0)==="/")}return(c?"/":"")+(d=o(d.split("/"),!c).join("/"))||"."},l.normalize=function(d){var c=l.isAbsolute(d),f=d.substr(-1)==="/";return(d=o(d.split("/"),!c).join("/"))||c||(d="."),d&&f&&(d+="/"),(c?"/":"")+d},l.isAbsolute=function(d){return d.charAt(0)==="/"},l.join=function(){for(var d="",c=0;c<arguments.length;c++){var f=arguments[c];if(!s(f))throw new TypeError("Arguments to path.join must be strings");f&&(d+=d?"/"+f:f)}return l.normalize(d)},l.relative=function(d,c){function f(k){for(var w=0;w<k.length&&k[w]==="";w++);for(var C=k.length-1;C>=0&&k[C]==="";C--);return w>C?[]:k.slice(w,C+1)}d=l.resolve(d).substr(1),c=l.resolve(c).substr(1);for(var p=f(d.split("/")),h=f(c.split("/")),g=Math.min(p.length,h.length),m=g,b=0;b<g;b++)if(p[b]!==h[b]){m=b;break}var S=[];for(b=m;b<p.length;b++)S.push("..");return(S=S.concat(h.slice(m))).join("/")},l._makeLong=function(d){return d},l.dirname=function(d){var c=u(d),f=c[0],p=c[1];return f||p?(p&&(p=p.substr(0,p.length-1)),f+p):"."},l.basename=function(d,c){var f=u(d)[2];return c&&f.substr(-1*c.length)===c&&(f=f.substr(0,f.length-c.length)),f},l.extname=function(d){return u(d)[3]},l.format=function(d){if(!r.isObject(d))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof d);var c=d.root||"";if(!s(c))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof d.root);return(d.dir?d.dir+l.sep:"")+(d.base||"")},l.parse=function(d){if(!s(d))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof d);var c=u(d);if(!c||c.length!==4)throw new TypeError("Invalid path '"+d+"'");return c[1]=c[1]||"",c[2]=c[2]||"",c[3]=c[3]||"",{root:c[0],dir:c[0]+c[1].slice(0,c[1].length-1),base:c[2],ext:c[3],name:c[2].slice(0,c[2].length-c[3].length)}},l.sep="/",l.delimiter=":",e.exports=l},101:function(e,t,n){var r;e=n.nmd(e),(function(){var s=(e&&e.exports,typeof mr=="object"&&mr);s.global!==s&&s.window;var o=function(c){this.message=c};(o.prototype=new Error).name="InvalidCharacterError";var i=function(c){throw new o(c)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,d={encode:function(c){c=String(c),/[^\0-\xFF]/.test(c)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var f,p,h,g,m=c.length%3,b="",S=-1,k=c.length-m;++S<k;)f=c.charCodeAt(S)<<16,p=c.charCodeAt(++S)<<8,h=c.charCodeAt(++S),b+=l.charAt((g=f+p+h)>>18&63)+l.charAt(g>>12&63)+l.charAt(g>>6&63)+l.charAt(63&g);return m==2?(f=c.charCodeAt(S)<<8,p=c.charCodeAt(++S),b+=l.charAt((g=f+p)>>10)+l.charAt(g>>4&63)+l.charAt(g<<2&63)+"="):m==1&&(g=c.charCodeAt(S),b+=l.charAt(g>>2)+l.charAt(g<<4&63)+"=="),b},decode:function(c){var f=(c=String(c).replace(u,"")).length;f%4==0&&(f=(c=c.replace(/==?$/,"")).length),(f%4==1||/[^+a-zA-Z0-9/]/.test(c))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var p,h,g=0,m="",b=-1;++b<f;)h=l.indexOf(c.charAt(b)),p=g%4?64*p+h:h,g++%4&&(m+=String.fromCharCode(255&p>>(-2*g&6)));return m},version:"1.0.0"};(r=(function(){return d}).call(t,n,t,e))===void 0||(e.exports=r)})()},135:e=>{function t(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}e.exports=function(n){return n!=null&&(t(n)||(function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&t(r.slice(0,0))})(n)||!!n._isBuffer)}},172:(e,t)=>{t.d=function(n){if(!n)return 0;for(var r=(n=n.toString()).length,s=n.length;s--;){var o=n.charCodeAt(s);56320<=o&&o<=57343&&s--,127<o&&o<=2047?r++:2047<o&&o<=65535&&(r+=2)}return r}},285:(e,t,n)=>{var r=n(2);e.exports=function(S){return S?(S.substr(0,2)==="{}"&&(S="\\{\\}"+S.substr(2)),b((function(k){return k.split("\\\\").join(s).split("\\{").join(o).split("\\}").join(i).split("\\,").join(l).split("\\.").join(u)})(S),!0).map(c)):[]};var s="\0SLASH"+Math.random()+"\0",o="\0OPEN"+Math.random()+"\0",i="\0CLOSE"+Math.random()+"\0",l="\0COMMA"+Math.random()+"\0",u="\0PERIOD"+Math.random()+"\0";function d(S){return parseInt(S,10)==S?parseInt(S,10):S.charCodeAt(0)}function c(S){return S.split(s).join("\\").split(o).join("{").split(i).join("}").split(l).join(",").split(u).join(".")}function f(S){if(!S)return[""];var k=[],w=r("{","}",S);if(!w)return S.split(",");var C=w.pre,A=w.body,I=w.post,N=C.split(",");N[N.length-1]+="{"+A+"}";var _=f(I);return I.length&&(N[N.length-1]+=_.shift(),N.push.apply(N,_)),k.push.apply(k,N),k}function p(S){return"{"+S+"}"}function h(S){return/^-?0\d/.test(S)}function g(S,k){return S<=k}function m(S,k){return S>=k}function b(S,k){var w=[],C=r("{","}",S);if(!C)return[S];var A=C.pre,I=C.post.length?b(C.post,!1):[""];if(/\$$/.test(C.pre))for(var N=0;N<I.length;N++){var _=A+"{"+C.body+"}"+I[N];w.push(_)}else{var F,V,Z=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(C.body),P=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(C.body),$=Z||P,L=C.body.indexOf(",")>=0;if(!$&&!L)return C.post.match(/,(?!,).*\}/)?b(S=C.pre+"{"+C.body+i+C.post):[S];if($)F=C.body.split(/\.\./);else if((F=f(C.body)).length===1&&(F=b(F[0],!1).map(p)).length===1)return I.map((function($e){return C.pre+F[0]+$e}));if($){var M=d(F[0]),j=d(F[1]),B=Math.max(F[0].length,F[1].length),q=F.length==3?Math.abs(d(F[2])):1,re=g;j<M&&(q*=-1,re=m);var J=F.some(h);V=[];for(var oe=M;re(oe,j);oe+=q){var ne;if(P)(ne=String.fromCharCode(oe))==="\\"&&(ne="");else if(ne=String(oe),J){var pe=B-ne.length;if(pe>0){var fe=new Array(pe+1).join("0");ne=oe<0?"-"+fe+ne.slice(1):fe+ne}}V.push(ne)}}else{V=[];for(var we=0;we<F.length;we++)V.push.apply(V,b(F[we],!1))}for(we=0;we<V.length;we++)for(N=0;N<I.length;N++)_=A+V[we]+I[N],(!k||$||_)&&w.push(_)}return w}},298:e=>{var t,n;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(r,s){return r<<s|r>>>32-s},rotr:function(r,s){return r<<32-s|r>>>s},endian:function(r){if(r.constructor==Number)return 16711935&n.rotl(r,8)|4278255360&n.rotl(r,24);for(var s=0;s<r.length;s++)r[s]=n.endian(r[s]);return r},randomBytes:function(r){for(var s=[];r>0;r--)s.push(Math.floor(256*Math.random()));return s},bytesToWords:function(r){for(var s=[],o=0,i=0;o<r.length;o++,i+=8)s[i>>>5]|=r[o]<<24-i%32;return s},wordsToBytes:function(r){for(var s=[],o=0;o<32*r.length;o+=8)s.push(r[o>>>5]>>>24-o%32&255);return s},bytesToHex:function(r){for(var s=[],o=0;o<r.length;o++)s.push((r[o]>>>4).toString(16)),s.push((15&r[o]).toString(16));return s.join("")},hexToBytes:function(r){for(var s=[],o=0;o<r.length;o+=2)s.push(parseInt(r.substr(o,2),16));return s},bytesToBase64:function(r){for(var s=[],o=0;o<r.length;o+=3)for(var i=r[o]<<16|r[o+1]<<8|r[o+2],l=0;l<4;l++)8*o+6*l<=8*r.length?s.push(t.charAt(i>>>6*(3-l)&63)):s.push("=");return s.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/gi,"");for(var s=[],o=0,i=0;o<r.length;i=++o%4)i!=0&&s.push((t.indexOf(r.charAt(o-1))&Math.pow(2,-2*i+8)-1)<<2*i|t.indexOf(r.charAt(o))>>>6-2*i);return s}},e.exports=n},345:()=>{},388:()=>{},410:()=>{},526:e=>{var t={utf8:{stringToBytes:function(n){return t.bin.stringToBytes(unescape(encodeURIComponent(n)))},bytesToString:function(n){return decodeURIComponent(escape(t.bin.bytesToString(n)))}},bin:{stringToBytes:function(n){for(var r=[],s=0;s<n.length;s++)r.push(255&n.charCodeAt(s));return r},bytesToString:function(n){for(var r=[],s=0;s<n.length;s++)r.push(String.fromCharCode(n[s]));return r.join("")}}};e.exports=t},542:(e,t,n)=>{(function(){var r=n(298),s=n(526).utf8,o=n(135),i=n(526).bin,l=function(u,d){u.constructor==String?u=d&&d.encoding==="binary"?i.stringToBytes(u):s.stringToBytes(u):o(u)?u=Array.prototype.slice.call(u,0):Array.isArray(u)||u.constructor===Uint8Array||(u=u.toString());for(var c=r.bytesToWords(u),f=8*u.length,p=1732584193,h=-271733879,g=-1732584194,m=271733878,b=0;b<c.length;b++)c[b]=16711935&(c[b]<<8|c[b]>>>24)|4278255360&(c[b]<<24|c[b]>>>8);c[f>>>5]|=128<<f%32,c[14+(f+64>>>9<<4)]=f;var S=l._ff,k=l._gg,w=l._hh,C=l._ii;for(b=0;b<c.length;b+=16){var A=p,I=h,N=g,_=m;p=S(p,h,g,m,c[b+0],7,-680876936),m=S(m,p,h,g,c[b+1],12,-389564586),g=S(g,m,p,h,c[b+2],17,606105819),h=S(h,g,m,p,c[b+3],22,-1044525330),p=S(p,h,g,m,c[b+4],7,-176418897),m=S(m,p,h,g,c[b+5],12,1200080426),g=S(g,m,p,h,c[b+6],17,-1473231341),h=S(h,g,m,p,c[b+7],22,-45705983),p=S(p,h,g,m,c[b+8],7,1770035416),m=S(m,p,h,g,c[b+9],12,-1958414417),g=S(g,m,p,h,c[b+10],17,-42063),h=S(h,g,m,p,c[b+11],22,-1990404162),p=S(p,h,g,m,c[b+12],7,1804603682),m=S(m,p,h,g,c[b+13],12,-40341101),g=S(g,m,p,h,c[b+14],17,-1502002290),p=k(p,h=S(h,g,m,p,c[b+15],22,1236535329),g,m,c[b+1],5,-165796510),m=k(m,p,h,g,c[b+6],9,-1069501632),g=k(g,m,p,h,c[b+11],14,643717713),h=k(h,g,m,p,c[b+0],20,-373897302),p=k(p,h,g,m,c[b+5],5,-701558691),m=k(m,p,h,g,c[b+10],9,38016083),g=k(g,m,p,h,c[b+15],14,-660478335),h=k(h,g,m,p,c[b+4],20,-405537848),p=k(p,h,g,m,c[b+9],5,568446438),m=k(m,p,h,g,c[b+14],9,-1019803690),g=k(g,m,p,h,c[b+3],14,-187363961),h=k(h,g,m,p,c[b+8],20,1163531501),p=k(p,h,g,m,c[b+13],5,-1444681467),m=k(m,p,h,g,c[b+2],9,-51403784),g=k(g,m,p,h,c[b+7],14,1735328473),p=w(p,h=k(h,g,m,p,c[b+12],20,-1926607734),g,m,c[b+5],4,-378558),m=w(m,p,h,g,c[b+8],11,-2022574463),g=w(g,m,p,h,c[b+11],16,1839030562),h=w(h,g,m,p,c[b+14],23,-35309556),p=w(p,h,g,m,c[b+1],4,-1530992060),m=w(m,p,h,g,c[b+4],11,1272893353),g=w(g,m,p,h,c[b+7],16,-155497632),h=w(h,g,m,p,c[b+10],23,-1094730640),p=w(p,h,g,m,c[b+13],4,681279174),m=w(m,p,h,g,c[b+0],11,-358537222),g=w(g,m,p,h,c[b+3],16,-722521979),h=w(h,g,m,p,c[b+6],23,76029189),p=w(p,h,g,m,c[b+9],4,-640364487),m=w(m,p,h,g,c[b+12],11,-421815835),g=w(g,m,p,h,c[b+15],16,530742520),p=C(p,h=w(h,g,m,p,c[b+2],23,-995338651),g,m,c[b+0],6,-198630844),m=C(m,p,h,g,c[b+7],10,1126891415),g=C(g,m,p,h,c[b+14],15,-1416354905),h=C(h,g,m,p,c[b+5],21,-57434055),p=C(p,h,g,m,c[b+12],6,1700485571),m=C(m,p,h,g,c[b+3],10,-1894986606),g=C(g,m,p,h,c[b+10],15,-1051523),h=C(h,g,m,p,c[b+1],21,-2054922799),p=C(p,h,g,m,c[b+8],6,1873313359),m=C(m,p,h,g,c[b+15],10,-30611744),g=C(g,m,p,h,c[b+6],15,-1560198380),h=C(h,g,m,p,c[b+13],21,1309151649),p=C(p,h,g,m,c[b+4],6,-145523070),m=C(m,p,h,g,c[b+11],10,-1120210379),g=C(g,m,p,h,c[b+2],15,718787259),h=C(h,g,m,p,c[b+9],21,-343485551),p=p+A>>>0,h=h+I>>>0,g=g+N>>>0,m=m+_>>>0}return r.endian([p,h,g,m])};l._ff=function(u,d,c,f,p,h,g){var m=u+(d&c|~d&f)+(p>>>0)+g;return(m<<h|m>>>32-h)+d},l._gg=function(u,d,c,f,p,h,g){var m=u+(d&f|c&~f)+(p>>>0)+g;return(m<<h|m>>>32-h)+d},l._hh=function(u,d,c,f,p,h,g){var m=u+(d^c^f)+(p>>>0)+g;return(m<<h|m>>>32-h)+d},l._ii=function(u,d,c,f,p,h,g){var m=u+(c^(d|~f))+(p>>>0)+g;return(m<<h|m>>>32-h)+d},l._blocksize=16,l._digestsize=16,e.exports=function(u,d){if(u==null)throw new Error("Illegal argument "+u);var c=r.wordsToBytes(l(u,d));return d&&d.asBytes?c:d&&d.asString?i.bytesToString(c):r.bytesToHex(c)}})()},647:(e,t)=>{var n=Object.prototype.hasOwnProperty;function r(o){try{return decodeURIComponent(o.replace(/\+/g," "))}catch{return null}}function s(o){try{return encodeURIComponent(o)}catch{return null}}t.stringify=function(o,i){i=i||"";var l,u,d=[];for(u in typeof i!="string"&&(i="?"),o)if(n.call(o,u)){if((l=o[u])||l!=null&&!isNaN(l)||(l=""),u=s(u),l=s(l),u===null||l===null)continue;d.push(u+"="+l)}return d.length?i+d.join("&"):""},t.parse=function(o){for(var i,l=/([^=?#&]+)=?([^&]*)/g,u={};i=l.exec(o);){var d=r(i[1]),c=r(i[2]);d===null||c===null||d in u||(u[d]=c)}return u}},670:e=>{e.exports=function(t,n){if(n=n.split(":")[0],!(t=+t))return!1;switch(n){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0}},737:(e,t,n)=>{var r=n(670),s=n(647),o=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i=/[\n\r\t]/g,l=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,u=/:\d+$/,d=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,c=/^[a-zA-Z]:/;function f(k){return(k||"").toString().replace(o,"")}var p=[["#","hash"],["?","query"],function(k,w){return m(w.protocol)?k.replace(/\\/g,"/"):k},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function g(k){var w,C=(typeof window<"u"?window:typeof mr<"u"?mr:typeof self<"u"?self:{}).location||{},A={},I=typeof(k=k||C);if(k.protocol==="blob:")A=new S(unescape(k.pathname),{});else if(I==="string")for(w in A=new S(k,{}),h)delete A[w];else if(I==="object"){for(w in k)w in h||(A[w]=k[w]);A.slashes===void 0&&(A.slashes=l.test(k.href))}return A}function m(k){return k==="file:"||k==="ftp:"||k==="http:"||k==="https:"||k==="ws:"||k==="wss:"}function b(k,w){k=(k=f(k)).replace(i,""),w=w||{};var C,A=d.exec(k),I=A[1]?A[1].toLowerCase():"",N=!!A[2],_=!!A[3],F=0;return N?_?(C=A[2]+A[3]+A[4],F=A[2].length+A[3].length):(C=A[2]+A[4],F=A[2].length):_?(C=A[3]+A[4],F=A[3].length):C=A[4],I==="file:"?F>=2&&(C=C.slice(2)):m(I)?C=A[4]:I?N&&(C=C.slice(2)):F>=2&&m(w.protocol)&&(C=A[4]),{protocol:I,slashes:N||m(I),slashesCount:F,rest:C}}function S(k,w,C){if(k=(k=f(k)).replace(i,""),!(this instanceof S))return new S(k,w,C);var A,I,N,_,F,V,Z=p.slice(),P=typeof w,$=this,L=0;for(P!=="object"&&P!=="string"&&(C=w,w=null),C&&typeof C!="function"&&(C=s.parse),A=!(I=b(k||"",w=g(w))).protocol&&!I.slashes,$.slashes=I.slashes||A&&w.slashes,$.protocol=I.protocol||w.protocol||"",k=I.rest,(I.protocol==="file:"&&(I.slashesCount!==2||c.test(k))||!I.slashes&&(I.protocol||I.slashesCount<2||!m($.protocol)))&&(Z[3]=[/(.*)/,"pathname"]);L<Z.length;L++)typeof(_=Z[L])!="function"?(N=_[0],V=_[1],N!=N?$[V]=k:typeof N=="string"?~(F=N==="@"?k.lastIndexOf(N):k.indexOf(N))&&(typeof _[2]=="number"?($[V]=k.slice(0,F),k=k.slice(F+_[2])):($[V]=k.slice(F),k=k.slice(0,F))):(F=N.exec(k))&&($[V]=F[1],k=k.slice(0,F.index)),$[V]=$[V]||A&&_[3]&&w[V]||"",_[4]&&($[V]=$[V].toLowerCase())):k=_(k,$);C&&($.query=C($.query)),A&&w.slashes&&$.pathname.charAt(0)!=="/"&&($.pathname!==""||w.pathname!=="")&&($.pathname=(function(M,j){if(M==="")return j;for(var B=(j||"/").split("/").slice(0,-1).concat(M.split("/")),q=B.length,re=B[q-1],J=!1,oe=0;q--;)B[q]==="."?B.splice(q,1):B[q]===".."?(B.splice(q,1),oe++):oe&&(q===0&&(J=!0),B.splice(q,1),oe--);return J&&B.unshift(""),re!=="."&&re!==".."||B.push(""),B.join("/")})($.pathname,w.pathname)),$.pathname.charAt(0)!=="/"&&m($.protocol)&&($.pathname="/"+$.pathname),r($.port,$.protocol)||($.host=$.hostname,$.port=""),$.username=$.password="",$.auth&&(~(F=$.auth.indexOf(":"))?($.username=$.auth.slice(0,F),$.username=encodeURIComponent(decodeURIComponent($.username)),$.password=$.auth.slice(F+1),$.password=encodeURIComponent(decodeURIComponent($.password))):$.username=encodeURIComponent(decodeURIComponent($.auth)),$.auth=$.password?$.username+":"+$.password:$.username),$.origin=$.protocol!=="file:"&&m($.protocol)&&$.host?$.protocol+"//"+$.host:"null",$.href=$.toString()}S.prototype={set:function(k,w,C){var A=this;switch(k){case"query":typeof w=="string"&&w.length&&(w=(C||s.parse)(w)),A[k]=w;break;case"port":A[k]=w,r(w,A.protocol)?w&&(A.host=A.hostname+":"+w):(A.host=A.hostname,A[k]="");break;case"hostname":A[k]=w,A.port&&(w+=":"+A.port),A.host=w;break;case"host":A[k]=w,u.test(w)?(w=w.split(":"),A.port=w.pop(),A.hostname=w.join(":")):(A.hostname=w,A.port="");break;case"protocol":A.protocol=w.toLowerCase(),A.slashes=!C;break;case"pathname":case"hash":if(w){var I=k==="pathname"?"/":"#";A[k]=w.charAt(0)!==I?I+w:w}else A[k]=w;break;case"username":case"password":A[k]=encodeURIComponent(w);break;case"auth":var N=w.indexOf(":");~N?(A.username=w.slice(0,N),A.username=encodeURIComponent(decodeURIComponent(A.username)),A.password=w.slice(N+1),A.password=encodeURIComponent(decodeURIComponent(A.password))):A.username=encodeURIComponent(decodeURIComponent(w))}for(var _=0;_<p.length;_++){var F=p[_];F[4]&&(A[F[1]]=A[F[1]].toLowerCase())}return A.auth=A.password?A.username+":"+A.password:A.username,A.origin=A.protocol!=="file:"&&m(A.protocol)&&A.host?A.protocol+"//"+A.host:"null",A.href=A.toString(),A},toString:function(k){k&&typeof k=="function"||(k=s.stringify);var w,C=this,A=C.host,I=C.protocol;I&&I.charAt(I.length-1)!==":"&&(I+=":");var N=I+(C.protocol&&C.slashes||m(C.protocol)?"//":"");return C.username?(N+=C.username,C.password&&(N+=":"+C.password),N+="@"):C.password?(N+=":"+C.password,N+="@"):C.protocol!=="file:"&&m(C.protocol)&&!A&&C.pathname!=="/"&&(N+="@"),(A[A.length-1]===":"||u.test(C.hostname)&&!C.port)&&(A+=":"),N+=A+C.pathname,(w=typeof C.query=="object"?k(C.query):C.query)&&(N+=w.charAt(0)!=="?"?"?"+w:w),C.hash&&(N+=C.hash),N}},S.extractProtocol=b,S.location=g,S.trimLeft=f,S.qs=s,e.exports=S},800:()=>{},805:()=>{},829:e=>{function t(d){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},t(d)}function n(d){var c=typeof Map=="function"?new Map:void 0;return n=function(f){if(f===null||(p=f,Function.toString.call(p).indexOf("[native code]")===-1))return f;var p;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(c!==void 0){if(c.has(f))return c.get(f);c.set(f,h)}function h(){return r(f,arguments,o(this).constructor)}return h.prototype=Object.create(f.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),s(h,f)},n(d)}function r(d,c,f){return r=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch{return!1}})()?Reflect.construct:function(p,h,g){var m=[null];m.push.apply(m,h);var b=new(Function.bind.apply(p,m));return g&&s(b,g.prototype),b},r.apply(null,arguments)}function s(d,c){return s=Object.setPrototypeOf||function(f,p){return f.__proto__=p,f},s(d,c)}function o(d){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(c){return c.__proto__||Object.getPrototypeOf(c)},o(d)}var i=(function(d){function c(f){var p;return(function(h,g){if(!(h instanceof g))throw new TypeError("Cannot call a class as a function")})(this,c),(p=(function(h,g){return!g||t(g)!=="object"&&typeof g!="function"?(function(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m})(h):g})(this,o(c).call(this,f))).name="ObjectPrototypeMutationError",p}return(function(f,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");f.prototype=Object.create(p&&p.prototype,{constructor:{value:f,writable:!0,configurable:!0}}),p&&s(f,p)})(c,d),c})(n(Error));function l(d,c){for(var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},p=c.split("."),h=p.length,g=function(S){var k=p[S];if(!d)return{v:void 0};if(k==="+"){if(Array.isArray(d))return{v:d.map((function(C,A){var I=p.slice(S+1);return I.length>0?l(C,I.join("."),f):f(d,A,p,S)}))};var w=p.slice(0,S).join(".");throw new Error("Object at wildcard (".concat(w,") is not an array"))}d=f(d,k,p,S)},m=0;m<h;m++){var b=g(m);if(t(b)==="object")return b.v}return d}function u(d,c){return d.length===c+1}e.exports={set:function(d,c,f){if(t(d)!="object"||d===null||c===void 0)return d;if(typeof c=="number")return d[c]=f,d[c];try{return l(d,c,(function(p,h,g,m){if(p===Reflect.getPrototypeOf({}))throw new i("Attempting to mutate Object.prototype");if(!p[h]){var b=Number.isInteger(Number(g[m+1])),S=g[m+1]==="+";p[h]=b||S?[]:{}}return u(g,m)&&(p[h]=f),p[h]}))}catch(p){if(p instanceof i)throw p;return d}},get:function(d,c){if(t(d)!="object"||d===null||c===void 0)return d;if(typeof c=="number")return d[c];try{return l(d,c,(function(f,p){return f[p]}))}catch{return d}},has:function(d,c){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t(d)!="object"||d===null||c===void 0)return!1;if(typeof c=="number")return c in d;try{var p=!1;return l(d,c,(function(h,g,m,b){if(!u(m,b))return h&&h[g];p=f.own?h.hasOwnProperty(g):g in h})),p}catch{return!1}},hasOwn:function(d,c,f){return this.has(d,c,f||{own:!0})},isIn:function(d,c,f){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(d)!="object"||d===null||c===void 0)return!1;try{var h=!1,g=!1;return l(d,c,(function(m,b,S,k){return h=h||m===f||!!m&&m[b]===f,g=u(S,k)&&t(m)==="object"&&b in m,m&&m[b]})),p.validPath?h&&g:h}catch{return!1}},ObjectPrototypeMutationError:i}}},yf={};function st(e){var t=yf[e];if(t!==void 0)return t.exports;var n=yf[e]={id:e,loaded:!1,exports:{}};return y0[e].call(n.exports,n,n.exports,st),n.loaded=!0,n.exports}st.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return st.d(t,{a:t}),t},st.d=(e,t)=>{for(var n in t)st.o(t,n)&&!st.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},st.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),st.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var v0=st(737);st.n(v0);var b0=st(47);st.n(b0);var w0=st(542);st.n(w0);var S0=st(101);st.n(S0);const vf=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis;vf.fetch.bind(vf),(function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e})({}),(function(e){return e.DataTypeNoLength="data-type-no-length",e.InvalidAuthType="invalid-auth-type",e.InvalidOutputFormat="invalid-output-format",e.LinkUnsupportedAuthType="link-unsupported-auth",e.InvalidUpdateRange="invalid-update-range",e.NotSupported="not-supported",e})({}),st(345),st(800),st(805);var k0=st(285);const mi=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},C0={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Ks=e=>e.replace(/[[\]\\-]/g,"\\$&"),bf=e=>e.join(""),T0=(e,t)=>{const n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");const r=[],s=[];let o=n+1,i=!1,l=!1,u=!1,d=!1,c=n,f="";e:for(;o<e.length;){const m=e.charAt(o);if(m!=="!"&&m!=="^"||o!==n+1){if(m==="]"&&i&&!u){c=o+1;break}if(i=!0,m!=="\\"||u){if(m==="["&&!u){for(const[b,[S,k,w]]of Object.entries(C0))if(e.startsWith(b,o)){if(f)return["$.",!1,e.length-n,!0];o+=b.length,w?s.push(S):r.push(S),l=l||k;continue e}}u=!1,f?(m>f?r.push(Ks(f)+"-"+Ks(m)):m===f&&r.push(Ks(m)),f="",o++):e.startsWith("-]",o+1)?(r.push(Ks(m+"-")),o+=2):e.startsWith("-",o+1)?(f=m,o+=2):(r.push(Ks(m)),o++)}else u=!0,o++}else d=!0,o++}if(c<o)return["",!1,0,!1];if(!r.length&&!s.length)return["$.",!1,e.length-n,!0];if(s.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!d)return[(p=r[0].length===2?r[0].slice(-1):r[0],p.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,c-n,!1];var p;const h="["+(d?"^":"")+bf(r)+"]",g="["+(d?"":"^")+bf(s)+"]";return[r.length&&s.length?"("+h+"|"+g+")":r.length?h:g,l,c-n,!0]},Gs=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")},x0=new Set(["!","?","+","*","@"]),wf=e=>x0.has(e),kl="(?!\\.)",A0=new Set(["[","."]),R0=new Set(["..","."]),E0=new Set("().*{}+?[]^$\\!"),Cl="[^/]",Sf=Cl+"*?",kf=Cl+"+?";class _t{type;#n;#r;#o=!1;#e=[];#t;#i;#l;#a=!1;#s;#c;#d=!1;constructor(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&(this.#r=!0),this.#t=n,this.#n=this.#t?this.#t.#n:this,this.#s=this.#n===this?r:this.#n.#s,this.#l=this.#n===this?[]:this.#n.#l,t!=="!"||this.#n.#a||this.#l.push(this),this.#i=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(const t of this.#e)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#e.map((t=>String(t))).join("|")+")":this.#c=this.#e.map((t=>String(t))).join("")}#p(){if(this!==this.#n)throw new Error("should only call on root");if(this.#a)return this;let t;for(this.toString(),this.#a=!0;t=this.#l.pop();){if(t.type!=="!")continue;let n=t,r=n.#t;for(;r;){for(let s=n.#i+1;!r.type&&s<r.#e.length;s++)for(const o of t.#e){if(typeof o=="string")throw new Error("string part in extglob AST??");o.copyIn(r.#e[s])}n=r,r=n.#t}}return this}push(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(const s of n)if(s!==""){if(typeof s!="string"&&!(s instanceof _t&&s.#t===this))throw new Error("invalid part: "+s);this.#e.push(s)}}toJSON(){const t=this.type===null?this.#e.slice().map((n=>typeof n=="string"?n:n.toJSON())):[this.type,...this.#e.map((n=>n.toJSON()))];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#a&&this.#t?.type==="!")&&t.push({}),t}isStart(){if(this.#n===this)return!0;if(!this.#t?.isStart())return!1;if(this.#i===0)return!0;const t=this.#t;for(let n=0;n<this.#i;n++){const r=t.#e[n];if(!(r instanceof _t&&r.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#t?.type==="!")return!0;if(!this.#t?.isEnd())return!1;if(!this.type)return this.#t?.isEnd();const t=this.#t?this.#t.#e.length:0;return this.#i===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const n=new _t(this.type,t);for(const r of this.#e)n.copyIn(r);return n}static#u(t,n,r,s){let o=!1,i=!1,l=-1,u=!1;if(n.type===null){let h=r,g="";for(;h<t.length;){const m=t.charAt(h++);if(o||m==="\\")o=!o,g+=m;else if(i)h===l+1?m!=="^"&&m!=="!"||(u=!0):m!=="]"||h===l+2&&u||(i=!1),g+=m;else if(m!=="[")if(s.noext||!wf(m)||t.charAt(h)!=="(")g+=m;else{n.push(g),g="";const b=new _t(m,n);h=_t.#u(t,b,h,s),n.push(b)}else i=!0,l=h,u=!1,g+=m}return n.push(g),h}let d=r+1,c=new _t(null,n);const f=[];let p="";for(;d<t.length;){const h=t.charAt(d++);if(o||h==="\\")o=!o,p+=h;else if(i)d===l+1?h!=="^"&&h!=="!"||(u=!0):h!=="]"||d===l+2&&u||(i=!1),p+=h;else if(h!=="[")if(wf(h)&&t.charAt(d)==="("){c.push(p),p="";const g=new _t(h,c);c.push(g),d=_t.#u(t,g,d,s)}else if(h!=="|"){if(h===")")return p===""&&n.#e.length===0&&(n.#d=!0),c.push(p),p="",n.push(...f,c),d;p+=h}else c.push(p),p="",f.push(c),c=new _t(null,n);else i=!0,l=d,u=!1,p+=h}return n.type=null,n.#r=void 0,n.#e=[t.substring(r-1)],d}static fromGlob(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=new _t(null,void 0,n);return _t.#u(t,r,0,n),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();const t=this.toString(),[n,r,s,o]=this.toRegExpSource();if(!(s||this.#r||this.#s.nocase&&!this.#s.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;const i=(this.#s.nocase?"i":"")+(o?"u":"");return Object.assign(new RegExp(`^${n}$`,i),{_src:n,_glob:t})}get options(){return this.#s}toRegExpSource(t){const n=t??!!this.#s.dot;if(this.#n===this&&this.#p(),!this.type){const u=this.isStart()&&this.isEnd(),d=this.#e.map((p=>{const[h,g,m,b]=typeof p=="string"?_t.#h(p,this.#r,u):p.toRegExpSource(t);return this.#r=this.#r||m,this.#o=this.#o||b,h})).join("");let c="";if(this.isStart()&&typeof this.#e[0]=="string"&&(this.#e.length!==1||!R0.has(this.#e[0]))){const p=A0,h=n&&p.has(d.charAt(0))||d.startsWith("\\.")&&p.has(d.charAt(2))||d.startsWith("\\.\\.")&&p.has(d.charAt(4)),g=!n&&!t&&p.has(d.charAt(0));c=h?"(?!(?:^|/)\\.\\.?(?:$|/))":g?kl:""}let f="";return this.isEnd()&&this.#n.#a&&this.#t?.type==="!"&&(f="(?:$|\\/)"),[c+d+f,Gs(d),this.#r=!!this.#r,this.#o]}const r=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:";let o=this.#f(n);if(this.isStart()&&this.isEnd()&&!o&&this.type!=="!"){const u=this.toString();return this.#e=[u],this.type=null,this.#r=void 0,[u,Gs(this.toString()),!1,!1]}let i=!r||t||n?"":this.#f(!0);i===o&&(i=""),i&&(o=`(?:${o})(?:${i})*?`);let l="";return l=this.type==="!"&&this.#d?(this.isStart()&&!n?kl:"")+kf:s+o+(this.type==="!"?"))"+(!this.isStart()||n||t?"":kl)+Sf+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&i?")":this.type==="*"&&i?")?":`)${this.type}`),[l,Gs(o),this.#r=!!this.#r,this.#o]}#f(t){return this.#e.map((n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");const[r,s,o,i]=n.toRegExpSource(t);return this.#o=this.#o||i,r})).filter((n=>!(this.isStart()&&this.isEnd()&&!n))).join("|")}static#h(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],s=!1,o="",i=!1;for(let l=0;l<t.length;l++){const u=t.charAt(l);if(s)s=!1,o+=(E0.has(u)?"\\":"")+u;else if(u!=="\\"){if(u==="["){const[d,c,f,p]=T0(t,l);if(f){o+=d,i=i||c,l+=f-1,n=n||p;continue}}u!=="*"?u!=="?"?o+=u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(o+=Cl,n=!0):(o+=r&&t==="*"?kf:Sf,n=!0)}else l===t.length-1?o+="\\\\":s=!0}return[o,Gs(t),!!n,i]}}const Mt=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return mi(t),!(!n.nocomment&&t.charAt(0)==="#")&&new gi(t,n).match(e)},D0=/^\*+([^+@!?\*\[\(]*)$/,F0=e=>t=>!t.startsWith(".")&&t.endsWith(e),I0=e=>t=>t.endsWith(e),P0=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),$0=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),O0=/^\*+\.\*+$/,L0=e=>!e.startsWith(".")&&e.includes("."),_0=e=>e!=="."&&e!==".."&&e.includes("."),M0=/^\.\*+$/,N0=e=>e!=="."&&e!==".."&&e.startsWith("."),B0=/^\*+$/,j0=e=>e.length!==0&&!e.startsWith("."),z0=e=>e.length!==0&&e!=="."&&e!=="..",V0=/^\?+([^+@!?\*\[\(]*)?$/,U0=e=>{let[t,n=""]=e;const r=Cf([t]);return n?(n=n.toLowerCase(),s=>r(s)&&s.toLowerCase().endsWith(n)):r},q0=e=>{let[t,n=""]=e;const r=Tf([t]);return n?(n=n.toLowerCase(),s=>r(s)&&s.toLowerCase().endsWith(n)):r},H0=e=>{let[t,n=""]=e;const r=Tf([t]);return n?s=>r(s)&&s.endsWith(n):r},W0=e=>{let[t,n=""]=e;const r=Cf([t]);return n?s=>r(s)&&s.endsWith(n):r},Cf=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&!r.startsWith(".")},Tf=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&r!=="."&&r!==".."},xf=typeof ce=="object"&&ce?typeof ce.env=="object"&&ce.env&&ce.env.__MINIMATCH_TESTING_PLATFORM__||ce.platform:"posix";Mt.sep=xf==="win32"?"\\":"/";const sn=Symbol("globstar **");Mt.GLOBSTAR=sn,Mt.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>Mt(n,e,t)};const on=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};Mt.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Mt;const t=Mt;return Object.assign((function(n,r){return t(n,r,on(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}),{Minimatch:class extends t.Minimatch{constructor(n){super(n,on(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(n){return t.defaults(on(e,n)).Minimatch}},AST:class extends t.AST{constructor(n,r){super(n,r,on(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}static fromGlob(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.AST.fromGlob(n,on(e,r))}},unescape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(n,on(e,r))},escape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(n,on(e,r))},filter:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(n,on(e,r))},defaults:n=>t.defaults(on(e,n)),makeRe:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(n,on(e,r))},braceExpand:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(n,on(e,r))},match:function(n,r){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(n,r,on(e,s))},sep:t.sep,GLOBSTAR:sn})};const Af=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return mi(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:k0(e)};Mt.braceExpand=Af,Mt.makeRe=function(e){return new gi(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},Mt.match=function(e,t){const n=new gi(t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{});return e=e.filter((r=>n.match(r))),n.options.nonull&&!e.length&&e.push(t),e};const Rf=/[?*]|[+@!]\(.*?\)|\[|\]/;class gi{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};mi(t),n=n||{},this.options=n,this.pattern=t,this.platform=n.platform||xf,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const n of t)if(typeof n!="string")return!0;return!1}debug(){}make(){const t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#")return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=function(){return console.error(...arguments)}),this.debug(this.pattern,this.globSet);const r=this.globSet.map((o=>this.slashSplit(o)));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let s=this.globParts.map(((o,i,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){const u=!(o[0]!==""||o[1]!==""||o[2]!=="?"&&Rf.test(o[2])||Rf.test(o[3])),d=/^[a-z]:/i.test(o[0]);if(u)return[...o.slice(0,4),...o.slice(4).map((c=>this.parse(c)))];if(d)return[o[0],...o.slice(1).map((c=>this.parse(c)))]}return o.map((u=>this.parse(u)))}));if(this.debug(this.pattern,s),this.set=s.filter((o=>o.indexOf(!1)===-1)),this.isWindows)for(let o=0;o<this.set.length;o++){const i=this.set[o];i[0]===""&&i[1]===""&&this.globParts[o][2]==="?"&&typeof i[3]=="string"&&/^[a-z]:$/i.test(i[3])&&(i[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let r=0;r<t.length;r++)for(let s=0;s<t[r].length;s++)t[r][s]==="**"&&(t[r][s]="*");const{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=n>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map((n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let s=r;for(;n[s+1]==="**";)s++;s!==r&&n.splice(r,s-r)}return n}))}levelOneOptimize(t){return t.map((n=>(n=n.reduce(((r,s)=>{const o=r[r.length-1];return s==="**"&&o==="**"?r:s===".."&&o&&o!==".."&&o!=="."&&o!=="**"?(r.pop(),r):(r.push(s),r)}),[])).length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let s=1;s<t.length-1;s++){const o=t[s];s===1&&o===""&&t[0]===""||o!=="."&&o!==""||(n=!0,t.splice(s,1),s--)}t[0]!=="."||t.length!==2||t[1]!=="."&&t[1]!==""||(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){const s=t[r-1];s&&s!=="."&&s!==".."&&s!=="**"&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let s=-1;for(;(s=r.indexOf("**",s+1))!==-1;){let i=s;for(;r[i+1]==="**";)i++;i>s&&r.splice(s+1,i-s);let l=r[s+1];const u=r[s+2],d=r[s+3];if(l!==".."||!u||u==="."||u===".."||!d||d==="."||d==="..")continue;n=!0,r.splice(s,1);const c=r.slice(0);c[s]="**",t.push(c),s--}if(!this.preserveMultipleSlashes){for(let i=1;i<r.length-1;i++){const l=r[i];i===1&&l===""&&r[0]===""||l!=="."&&l!==""||(n=!0,r.splice(i,1),i--)}r[0]!=="."||r.length!==2||r[1]!=="."&&r[1]!==""||(n=!0,r.pop())}let o=0;for(;(o=r.indexOf("..",o+1))!==-1;){const i=r[o-1];if(i&&i!=="."&&i!==".."&&i!=="**"){n=!0;const l=o===1&&r[o+1]==="**"?["."]:[];r.splice(o-1,2,...l),r.length===0&&r.push(""),o-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){const s=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(s){t[n]=[],t[r]=s;break}}return t.filter((n=>n.length))}partsMatch(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],s=0,o=0,i=[],l="";for(;s<t.length&&o<n.length;)if(t[s]===n[o])i.push(l==="b"?n[o]:t[s]),s++,o++;else if(r&&t[s]==="**"&&n[o]===t[s+1])i.push(t[s]),s++;else if(r&&n[o]==="**"&&t[s]===n[o+1])i.push(n[o]),o++;else if(t[s]!=="*"||!n[o]||!this.options.dot&&n[o].startsWith(".")||n[o]==="**"){if(n[o]!=="*"||!t[s]||!this.options.dot&&t[s].startsWith(".")||t[s]==="**"||l==="a")return!1;l="b",i.push(n[o]),s++,o++}else{if(l==="b")return!1;l="a",i.push(t[s]),s++,o++}return t.length===n.length&&i}parseNegate(){if(this.nonegate)return;const t=this.pattern;let n=!1,r=0;for(let s=0;s<t.length&&t.charAt(s)==="!";s++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const s=this.options;if(this.isWindows){const m=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),b=!m&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),S=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),k=b?3:m?0:void 0,w=!S&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])?3:S?0:void 0;if(typeof k=="number"&&typeof w=="number"){const[C,A]=[t[k],n[w]];C.toLowerCase()===A.toLowerCase()&&(n[w]=C,w>k?n=n.slice(w):k>w&&(t=t.slice(k)))}}const{optimizationLevel:o=1}=this.options;o>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:n}),this.debug("matchOne",t.length,n.length);for(var i=0,l=0,u=t.length,d=n.length;i<u&&l<d;i++,l++){this.debug("matchOne loop");var c=n[l],f=t[i];if(this.debug(n,c,f),c===!1)return!1;if(c===sn){this.debug("GLOBSTAR",[n,c,f]);var p=i,h=l+1;if(h===d){for(this.debug("** at the end");i<u;i++)if(t[i]==="."||t[i]===".."||!s.dot&&t[i].charAt(0)===".")return!1;return!0}for(;p<u;){var g=t[p];if(this.debug(`
7
+ globstar while`,t,p,n,h,g),this.matchOne(t.slice(p),n.slice(h),r))return this.debug("globstar found match!",p,u,g),!0;if(g==="."||g===".."||!s.dot&&g.charAt(0)==="."){this.debug("dot detected!",t,p,n,h);break}this.debug("globstar swallow a segment, and continue"),p++}return!(!r||(this.debug(`
8
+ >>> no match, partial?`,t,p,n,h),p!==u))}let m;if(typeof c=="string"?(m=f===c,this.debug("string match",c,f,m)):(m=c.test(f),this.debug("pattern match",c,f,m)),!m)return!1}if(i===u&&l===d)return!0;if(i===u)return r;if(l===d)return i===u-1&&t[i]==="";throw new Error("wtf?")}braceExpand(){return Af(this.pattern,this.options)}parse(t){mi(t);const n=this.options;if(t==="**")return sn;if(t==="")return"";let r,s=null;(r=t.match(B0))?s=n.dot?z0:j0:(r=t.match(D0))?s=(n.nocase?n.dot?$0:P0:n.dot?I0:F0)(r[1]):(r=t.match(V0))?s=(n.nocase?n.dot?q0:U0:n.dot?H0:W0)(r):(r=t.match(O0))?s=n.dot?_0:L0:(r=t.match(M0))&&(s=N0);const o=_t.fromGlob(t,this.options).toMMPattern();return s&&typeof o=="object"&&Reflect.defineProperty(o,"test",{value:s}),o}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const n=this.options,r=n.noglobstar?"[^/]*?":n.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",s=new Set(n.nocase?["i"]:[]);let o=t.map((u=>{const d=u.map((c=>{if(c instanceof RegExp)for(const f of c.flags.split(""))s.add(f);return typeof c=="string"?c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):c===sn?sn:c._src}));return d.forEach(((c,f)=>{const p=d[f+1],h=d[f-1];c===sn&&h!==sn&&(h===void 0?p!==void 0&&p!==sn?d[f+1]="(?:\\/|"+r+"\\/)?"+p:d[f]=r:p===void 0?d[f-1]=h+"(?:\\/|"+r+")?":p!==sn&&(d[f-1]=h+"(?:\\/|\\/"+r+"\\/)"+p,d[f+1]=sn))})),d.filter((c=>c!==sn)).join("/")})).join("|");const[i,l]=t.length>1?["(?:",")"]:["",""];o="^"+i+o+l+"$",this.negate&&(o="^(?!"+o+").+$");try{this.regexp=new RegExp(o,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.partial;if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;const r=this.options;this.isWindows&&(t=t.split("\\").join("/"));const s=this.slashSplit(t);this.debug(this.pattern,"split",s);const o=this.set;this.debug(this.pattern,"set",o);let i=s[s.length-1];if(!i)for(let l=s.length-2;!i&&l>=0;l--)i=s[l];for(let l=0;l<o.length;l++){const u=o[l];let d=s;if(r.matchBase&&u.length===1&&(d=[i]),this.matchOne(d,u,n))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate}static defaults(t){return Mt.defaults(t).Minimatch}}Mt.AST=_t,Mt.Minimatch=gi,Mt.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},Mt.unescape=Gs;var Q0=st(829);st.n(Q0);var K0=(function(e){return e.Array="array",e.Object="object",e.Original="original",e})(K0||{});typeof Symbol<"u"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")));var G0=st(388);st.n(G0),st(172);class Ef{isEnabled(){return!0}isActive(t){return rt(t,"files-spaces-projects")?!1:rt(t,"files-spaces-generic")||nn(t,"files-public-link")}getTask(t){const{router:n,clientService:r,resourcesStore:s,authService:o,spacesStore:i,sharesStore:l,configStore:u}=t,{webdav:d,graphAuthenticated:c}=r,{replaceInvalidFileRoute:f}=Ci({router:n});return Ft.useTask(function*(p,h,g,m=null,b=null,S={}){try{s.clearResourceList();const k=Qs.Default;z.isPublicSpaceResource(g)&&k.push(Te.DownloadURL);let{resource:w,children:C}=yield*z.call(d.listFiles(g,{path:m,fileId:b},{signal:p,davProperties:k}));w.id&&f({space:g,resource:w,path:m,fileId:b});let A;m==="/"&&(z.isShareSpaceResource(g)?(A=yield*z.call(li({graphClient:c,spacesStore:i,space:g,signal:p})),A&&(w=z.buildIncomingShareResource({graphRoles:l.graphRoles,driveItem:A,serverUrl:u.serverUrl}))):!z.isPersonalSpaceResource(g)&&!z.isPublicSpaceResource(g)&&(w=g)),yield s.loadAncestorMetaData({folder:w,space:g,client:d,signal:p}),z.isProjectSpaceResource(g)&&(yield i.loadGraphPermissions({ids:[g.id],graphClient:c})),z.isShareSpaceResource(g)&&(C.forEach(I=>I.remoteItemId=g.id),g.graphPermissions===void 0&&(A||(A=yield*z.call(li({graphClient:c,spacesStore:i,space:g,signal:p}))),ef({sharesStore:l,spacesStore:i,space:g,sharedDriveItem:A}))),s.initResourceList({currentFolder:w,resources:C})}catch(k){if(s.setCurrentFolder(null),console.error(k),k.statusCode===401)return o.handleAuthError(a(n.currentRoute))}}).restartable()}}class Df{isEnabled(){return!0}isActive(t){const n=a(t.currentRoute);return mt(t,"files-common-favorites")||n?.query?.contextRouteName==="files-common-favorites"}getTask(t){const{resourcesStore:n,clientService:r,userStore:s}=t;return Ft.useTask(function*(o,i){n.clearResourceList(),n.setAncestorMetaData({});let l=yield r.webdav.listFavoriteFiles({username:s.user?.onPremisesSamAccountName,signal:o});l=l.map(z.buildResource),n.initResourceList({currentFolder:null,resources:l})})}}class Ff{isEnabled(){return!0}isActive(t){const n=a(t.currentRoute);return pt(t,"files-shares-via-link")||n?.query?.contextRouteName==="files-shares-via-link"}getTask(t){const{userStore:n,spacesStore:r,clientService:s,configStore:o,resourcesStore:i}=t;return Ft.useTask(function*(l,u){i.clearResourceList(),i.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:s.graphAuthenticated,signal:l}));const c=(yield*z.call(s.graphAuthenticated.driveItems.listSharedByMe({expand:new Set(["thumbnails"])},{signal:l}))).filter(f=>f.permissions.some(({link:p})=>!!p)).map(f=>z.buildOutgoingShareResource({driveItem:f,user:n.user,serverUrl:o.serverUrl}));i.initResourceList({currentFolder:null,resources:c})})}}class If{isEnabled(){return!0}isActive(t){const n=a(t.currentRoute);return pt(t,"files-shares-with-me")||n?.query?.contextRouteName==="files-shares-with-me"}getTask(t){const{spacesStore:n,clientService:r,configStore:s,resourcesStore:o,sharesStore:i}=t;return Ft.useTask(function*(l,u){o.clearResourceList(),o.setAncestorMetaData({}),s.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:r.graphAuthenticated,signal:l}));const c=(yield*z.call(r.graphAuthenticated.driveItems.listSharedWithMe({expand:new Set(["thumbnails"])},{signal:l}))).map(f=>z.buildIncomingShareResource({driveItem:f,graphRoles:i.graphRoles,serverUrl:s.serverUrl}));o.initResourceList({currentFolder:null,resources:c})})}}class Pf{isEnabled(){return!0}isActive(t){const n=a(t.currentRoute);return pt(t,"files-shares-with-others")||n?.query?.contextRouteName==="files-shares-with-others"}getTask(t){const{userStore:n,spacesStore:r,clientService:s,configStore:o,resourcesStore:i}=t;return Ft.useTask(function*(l,u){i.clearResourceList(),i.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:s.graphAuthenticated,signal:l}));const c=(yield*z.call(s.graphAuthenticated.driveItems.listSharedByMe({expand:new Set(["thumbnails"])},{signal:l}))).filter(f=>f.permissions.some(({link:p})=>!p)).map(f=>z.buildOutgoingShareResource({driveItem:f,user:n.user,serverUrl:o.serverUrl}));i.initResourceList({currentFolder:null,resources:c})})}}class $f{isEnabled(){return!0}isActive(t){return jt(t,"files-trash-generic")}getTask(t){const{resourcesStore:n,spacesStore:r,clientService:{webdav:s,graphAuthenticated:o}}=t;return Ft.useTask(function*(i,l,u){n.clearResourceList(),n.setAncestorMetaData({});const{resource:d,children:c}=yield s.listFiles(u,{},{depth:1,davProperties:Qs.Trashbin,isTrash:!0,signal:i});z.isProjectSpaceResource(u)&&(yield r.loadGraphPermissions({ids:[u.id],graphClient:o})),n.initResourceList({currentFolder:d,resources:c})})}}class Of{loaders;constructor(){this.loaders=[new Ef,new Df,new Ff,new If,new Pf,new $f]}getTask(){const t=Ze(),n=Ue(),r=Ct(),s=Ae(),o=Ee(),i=Qe(),l=Re(),u=Jn(),d=_l(),c=this.loaders.find(f=>f.isEnabled()&&f.isActive(a(s)));if(!c){console.debug("No folder loader found for route");return}return Ft.useTask(function*(...f){const p={clientService:o,configStore:i,userStore:t,spacesStore:n,capabilityStore:r,resourcesStore:l,sharesStore:u,router:s,authService:d};try{yield c.getTask(p).perform(...f)}catch(h){console.error(h)}})}}const Lf=new Of;var vr=(e=>(e.add="loading-service.add",e.remove="loading-service.remove",e.setProgress="loading-service.set-progress",e))(vr||{});const J0=200;class X0{tasks=[];get isLoading(){return this.tasks.some(t=>t.active)}get currentProgress(){if(this.tasks.some(r=>!r.state&&r.active))return null;const t=this.tasks.filter(r=>!!r.state&&r.active);if(!t.length)return null;const n=t.reduce((r,s)=>(r+=s.state.current/s.state.total,r),0);return Math.round(n/t.length*100)}addTask(t,{debounceTime:n=J0,indeterminate:r=!0}={}){const s={id:wt.v4(),active:!1,...!r&&{state:{total:0,current:0}}};return this.tasks.length||window.addEventListener("beforeunload",this.onBeforeUnload),this.tasks.push(s),et.debounce(()=>{s.active=!0,Xe.publish("loading-service.add")},n)(),t({setProgress:({total:l,current:u})=>{r||this.setProgress({task:s,total:l,current:u})}}).finally(()=>{this.removeTask(s.id)})}removeTask(t){this.tasks=this.tasks.filter(n=>n.id!==t),this.tasks.length||window.removeEventListener("beforeunload",this.onBeforeUnload),Xe.publish("loading-service.remove")}setProgress({task:t,total:n,current:r}){t.state||(t.state={total:0,current:0}),t.state.total=n,t.state.current=r,Xe.publish("loading-service.set-progress")}onBeforeUnload(t){t.preventDefault()}}var Y0="__lodash_hash_undefined__";function Z0(e){return this.__data__.set(e,Y0),this}function e1(e){return this.__data__.has(e)}function yi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Kn;++t<n;)this.add(e[t])}yi.prototype.add=yi.prototype.push=Z0,yi.prototype.has=e1;function t1(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function n1(e,t){return e.has(t)}var r1=1,s1=2;function _f(e,t,n,r,s,o){var i=n&r1,l=e.length,u=t.length;if(l!=u&&!(i&&u>l))return!1;var d=o.get(e),c=o.get(t);if(d&&c)return d==t&&c==e;var f=-1,p=!0,h=n&s1?new yi:void 0;for(o.set(e,t),o.set(t,e);++f<l;){var g=e[f],m=t[f];if(r)var b=i?r(m,g,f,t,e,o):r(g,m,f,e,t,o);if(b!==void 0){if(b)continue;p=!1;break}if(h){if(!t1(t,function(S,k){if(!n1(h,k)&&(g===S||s(g,S,n,r,o)))return h.push(k)})){p=!1;break}}else if(!(g===m||s(g,m,n,r,o))){p=!1;break}}return o.delete(e),o.delete(t),p}function o1(e){var t=-1,n=Array(e.size);return e.forEach(function(r,s){n[++t]=[s,r]}),n}function i1(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var a1=1,l1=2,c1="[object Boolean]",u1="[object Date]",d1="[object Error]",f1="[object Map]",p1="[object Number]",h1="[object RegExp]",m1="[object Set]",g1="[object String]",y1="[object Symbol]",v1="[object ArrayBuffer]",b1="[object DataView]",Mf=en?en.prototype:void 0,Tl=Mf?Mf.valueOf:void 0;function w1(e,t,n,r,s,o,i){switch(n){case b1:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case v1:return!(e.byteLength!=t.byteLength||!o(new ri(e),new ri(t)));case c1:case u1:case p1:return js(+e,+t);case d1:return e.name==t.name&&e.message==t.message;case h1:case g1:return e==t+"";case f1:var l=o1;case m1:var u=r&a1;if(l||(l=i1),e.size!=t.size&&!u)return!1;var d=i.get(e);if(d)return d==t;r|=l1,i.set(e,t);var c=_f(l(e),l(t),r,s,o,i);return i.delete(e),c;case y1:if(Tl)return Tl.call(e)==Tl.call(t)}return!1}function xl(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e}function Nf(e,t,n){var r=t(e);return mn(e)?r:xl(r,n(e))}function S1(e,t){for(var n=-1,r=e==null?0:e.length,s=0,o=[];++n<r;){var i=e[n];t(i,n,e)&&(o[s++]=i)}return o}function Bf(){return[]}var k1=Object.prototype,C1=k1.propertyIsEnumerable,jf=Object.getOwnPropertySymbols,zf=jf?function(e){return e==null?[]:(e=Object(e),S1(jf(e),function(t){return C1.call(e,t)}))}:Bf,T1=xd(Object.keys,Object),x1=Object.prototype,A1=x1.hasOwnProperty;function R1(e){if(!Ka(e))return T1(e);var t=[];for(var n in Object(e))A1.call(e,n)&&n!="constructor"&&t.push(n);return t}function E1(e){return oi(e)?Nd(e):R1(e)}function Vf(e){return Nf(e,E1,zf)}var D1=1,F1=Object.prototype,I1=F1.hasOwnProperty;function P1(e,t,n,r,s,o){var i=n&D1,l=Vf(e),u=l.length,d=Vf(t),c=d.length;if(u!=c&&!i)return!1;for(var f=u;f--;){var p=l[f];if(!(i?p in t:I1.call(t,p)))return!1}var h=o.get(e),g=o.get(t);if(h&&g)return h==t&&g==e;var m=!0;o.set(e,t),o.set(t,e);for(var b=i;++f<u;){p=l[f];var S=e[p],k=t[p];if(r)var w=i?r(k,S,p,t,e,o):r(S,k,p,e,t,o);if(!(w===void 0?S===k||s(S,k,n,r,o):w)){m=!1;break}b||(b=p=="constructor")}if(m&&!b){var C=e.constructor,A=t.constructor;C!=A&&"constructor"in e&&"constructor"in t&&!(typeof C=="function"&&C instanceof C&&typeof A=="function"&&A instanceof A)&&(m=!1)}return o.delete(e),o.delete(t),m}var Al=Lr(Rn,"DataView"),Rl=Lr(Rn,"Promise"),El=Lr(Rn,"Set"),Dl=Lr(Rn,"WeakMap"),Uf="[object Map]",$1="[object Object]",qf="[object Promise]",Hf="[object Set]",Wf="[object WeakMap]",Qf="[object DataView]",O1=Or(Al),L1=Or(Vs),_1=Or(Rl),M1=Or(El),N1=Or(Dl),yn=$r;(Al&&yn(new Al(new ArrayBuffer(1)))!=Qf||Vs&&yn(new Vs)!=Uf||Rl&&yn(Rl.resolve())!=qf||El&&yn(new El)!=Hf||Dl&&yn(new Dl)!=Wf)&&(yn=function(e){var t=$r(e),n=t==$1?e.constructor:void 0,r=n?Or(n):"";if(r)switch(r){case O1:return Qf;case L1:return Uf;case _1:return qf;case M1:return Hf;case N1:return Wf}return t});var B1=1,Kf="[object Arguments]",Gf="[object Array]",vi="[object Object]",j1=Object.prototype,Jf=j1.hasOwnProperty;function z1(e,t,n,r,s,o){var i=mn(e),l=mn(t),u=i?Gf:yn(e),d=l?Gf:yn(t);u=u==Kf?vi:u,d=d==Kf?vi:d;var c=u==vi,f=d==vi,p=u==d;if(p&&qs(e)){if(!qs(t))return!1;i=!0,c=!1}if(p&&!c)return o||(o=new Dn),i||Ya(e)?_f(e,t,n,r,s,o):w1(e,t,u,n,r,s,o);if(!(n&B1)){var h=c&&Jf.call(e,"__wrapped__"),g=f&&Jf.call(t,"__wrapped__");if(h||g){var m=h?e.value():e,b=g?t.value():t;return o||(o=new Dn),s(m,b,n,r,o)}}return p?(o||(o=new Dn),P1(e,t,n,r,s,o)):!1}function Xf(e,t,n,r,s){return e===t?!0:e==null||t==null||!Fn(e)&&!Fn(t)?e!==e&&t!==t:z1(e,t,n,r,Xf,s)}function Yf(e,t){return Xf(e,t)}class V1{clientService;configStore;userStore;authStore;constructor({clientService:t,userStore:n,authStore:r,configStore:s}){this.clientService=t,this.userStore=n,this.authStore=r,this.configStore=s}get user(){return this.userStore.user}async loadPreview(t,n=!1,r=!0,s){const{space:o,resource:i}=t;if(!i.canDownload()||!i.hasPreview?.())return;const l=z.isPublicSpaceResource(o);if(!(!l&&(!this.configStore.serverUrl||!this.user.onPremisesSamAccountName||!this.authStore.accessToken))){if(l)return this.publicPreviewUrl(t,s);try{return await this.privatePreviewBlob(t,n,r,s)}catch(u){if(r)return;throw u}}}async cacheFactory(t,n,r){const{resource:s,dimensions:o}=t,i=hl.filePreview.get(s.id.toString());if(i&&i.etag===s.etag&&Yf(o,i.dimensions))return i.src;try{const l=await this.privatePreviewBlob(t,!1,!0,r);return hl.filePreview.set(s.id.toString(),{src:l,etag:s.etag,dimensions:o},0).src}catch(l){if(n)return;throw l}}buildQueryString(t){return vg.stringify({scalingup:t.scalingup||0,preview:Object.hasOwnProperty.call(t,"preview")?t.preview:1,a:Object.hasOwnProperty.call(t,"a")?t.a:1,...t.processor&&{processor:t.processor},...t.etag&&{c:t.etag.replaceAll('"',"")},...t.dimensions&&t.dimensions[0]&&{x:t.dimensions[0]},...t.dimensions&&t.dimensions[1]&&{y:t.dimensions[1]}})}async privatePreviewBlob(t,n=!1,r=!0,s){const{resource:o,dimensions:i,processor:l}=t;if(n)return this.cacheFactory(t,r,s);const u=[this.configStore.serverUrl,"remote.php/dav",dl(o.webDavPath),"?",this.buildQueryString({etag:o.etag,dimensions:i,processor:l})].join("");try{const{data:d}=await this.clientService.httpAuthenticated.get(u,{responseType:"blob",signal:s});return window.URL.createObjectURL(d)}catch(d){if([425,429].includes(d.status)){const c=d.response?.headers?.["retry-after"]||5;return await new Promise(f=>setTimeout(f,c*1e3)),this.privatePreviewBlob(t,n,r,s)}throw d}}async publicPreviewUrl(t,n){const{space:r,resource:s,dimensions:o,processor:i}=t;let{downloadURL:l}=s;if(!l){const{downloadURL:p}=await this.clientService.webdav.getFileInfo(r,s,{davProperties:[Te.DownloadURL]});l=p}const[u,d]=l.split("?"),c=[this.buildQueryString({etag:s.etag,dimensions:o,processor:i}),d].filter(Boolean).join("&"),f=[u,c].filter(Boolean).join("?");try{const{status:p}=await this.clientService.httpUnAuthenticated.head(f,{signal:n});if(p!==404)return f}catch(p){if([425,429].includes(p.status)){const h=p.response?.headers?.["retry-after"]||5;return await new Promise(g=>setTimeout(g,h*1e3)),this.publicPreviewUrl(t,n)}throw p}}}const bi=G.z.enum(["fit","resize","fill","thumbnail"]);class U1{$gettext;constructor({$gettext:t}){this.$gettext=t}explain(t,n){return{code:"mustNotBeEmpty",message:this.$gettext("Must not be empty"),format:[],...et.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>0}validate(){return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class q1{$gettext;constructor({$gettext:t}){this.$gettext=t}explain(t,n){return{code:"mustContain",helperMessage:this.$gettext("Valid special characters: %{characters}",{characters:t.characters}),message:this.$gettext("%{param1}+ special characters"),format:[t.minLength],...et.isBoolean(n)&&{verified:n}}}assert(t,n){return Array.from(n).filter(s=>t.characters.includes(s)).length>=t.minLength}validate(t){if(!et.isObject(t))throw new Error("options should be an object");if(!et.isNumber(t.minLength)||et.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");if(!et.isString(t.characters))throw new Error("characters should be a character sequence");return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class wi{$gettext;constructor({$gettext:t}){this.$gettext=t}assert(t,n){throw new Error("Method not implemented.")}explain(t,n){throw new Error("Method not implemented.")}validate(t){if(!et.isObject(t))throw new Error("options should be an object");if(!et.isNumber(t.minLength)||et.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class H1 extends wi{constructor(t){super(t)}explain(t,n){return{code:"atLeastCharacters",message:this.$gettext("%{param1}+ letters"),format:[t.minLength],...et.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>=t.minLength}}class W1 extends wi{constructor(t){super(t)}explain(t,n){return{code:"atLeastUppercaseCharacters",message:this.$gettext("%{param1}+ uppercase letters"),format:[t.minLength],...et.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/[A-Z\xC0-\xD6\xD8-\xDE]/g)?.length>=t.minLength}}class Q1 extends wi{constructor(t){super(t)}explain(t,n){return{code:"atLeastLowercaseCharacters",message:this.$gettext("%{param1}+ lowercase letters"),format:[t.minLength],...et.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/[a-z\xDF-\xF6\xF8-\xFF]/g)?.length>=t.minLength}}class K1 extends wi{constructor(t){super(t)}explain(t,n){return{code:"atLeastDigits",message:this.$gettext("%{param1}+ numbers"),format:[t.minLength],...et.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/\d/g)?.length>=t.minLength}}class G1{language;capability;policy;generatePasswordRules;constructor({language:t}){this.language=t}initialize(t){this.capability=t.passwordPolicy,this.buildGeneratePasswordRules()}hasRules(){return!!this.capability.min_characters||!!this.capability.min_lowercase_characters||!!this.capability.min_uppercase_characters||!!this.capability.min_digits||!!this.capability.min_special_characters}buildGeneratePasswordRules(){this.generatePasswordRules={length:Math.max(this.capability.min_characters||0,(this.capability.min_lowercase_characters||0)+(this.capability.min_uppercase_characters||0)+(this.capability.min_digits||0)+(this.capability.min_special_characters||0),12),minLowercaseCharacters:Math.max(this.capability.min_lowercase_characters||0,2),minUppercaseCharacters:Math.max(this.capability.min_uppercase_characters||0,2),minSpecialCharacters:Math.max(this.capability.min_special_characters||0,2),minDigits:Math.max(this.capability.min_digits||0,2)}}buildPolicy({enforcePassword:t=!1}={}){const n={atLeastCharacters:new H1({...this.language}),mustNotBeEmpty:new U1({...this.language}),atLeastUppercaseCharacters:new W1({...this.language}),atLeastLowercaseCharacters:new Q1({...this.language}),atLeastDigits:new K1({...this.language}),mustContain:new q1({...this.language})},r={};t&&!this.hasRules()&&(r.mustNotBeEmpty={}),this.capability.min_characters&&(r.atLeastCharacters={minLength:this.capability.min_characters}),this.capability.min_uppercase_characters&&(r.atLeastUppercaseCharacters={minLength:this.capability.min_uppercase_characters}),this.capability.min_lowercase_characters&&(r.atLeastLowercaseCharacters={minLength:this.capability.min_lowercase_characters}),this.capability.min_digits&&(r.atLeastDigits={minLength:this.capability.min_digits}),this.capability.min_special_characters&&(r.mustContain={minLength:this.capability.min_special_characters,characters:' "!#\\$%&\'()*+,-./:;<=>?@[\\]^_`{|}~"'}),this.policy=new bg.PasswordPolicy(r,n)}getPolicy({enforcePassword:t=!1}={}){return this.buildPolicy({enforcePassword:t}),this.policy}generatePassword(){const t="abcdefghijklmnopqrstuvwxyz",n="ABCDEFGHIJKLMNOPQRSTUVWXYZ",r="\"!#$%&'()*+,-./:;<=>?@[]^_`{|}~",s="0123456789",o=(h,g)=>{const m=256-256%h.length;let b="",S;for(let k=0;k<g;k++){do S=window.crypto.getRandomValues(new Uint8Array(1))[0];while(S>=m);b+=h[S%h.length]}return b},{minLowercaseCharacters:i,minUppercaseCharacters:l,minDigits:u,minSpecialCharacters:d,length:c}=this.generatePasswordRules;let f="";if(f+=o(t,i),f+=o(n,l),f+=o(s,u),f+=o(r,d),f.length<c){const h=c-f.length,g=t+n+r+s;f+=o(g,h)}return(h=>{const g=h.split(""),m=new Uint32Array(g.length);window.crypto.getRandomValues(m);for(let b=g.length-1;b>0;b--){const S=m[b]%(b+1);[g[b],g[S]]=[g[S],g[b]]}return g.join("")})(f)}}const Zf=e=>({name:We.basename(e),type:"directory",relativePath:e}),ep=(e,t)=>t.map(n=>({source:e,name:n.name,type:n.type,data:n,meta:{relativePath:n.relativePath||null}})),tp=async e=>{const t=await new Promise((r,s)=>e.file(r,s));return e.fullPath===z.urlJoin(e.name,{leadingSlash:!0})||(t.relativePath=e.fullPath),t},J1=e=>typeof e.getAsEntry=="function"?e.getAsEntry():e.webkitGetAsEntry();async function*X1(e){const t=e.createReader(),n=()=>new Promise((s,o)=>{t.readEntries(s,o)});let r;do{r=await n();for(const s of r)yield s}while(r.length>0)}async function*np(e,t){if(e.isDirectory){let n=!1;for await(const r of X1(e))if(r.isDirectory)yield*np(r,t);else if(r.isFile)try{n=!0,yield tp(r)}catch(s){console.error(s),t?.(s)}n||(yield Zf(e.fullPath||e.name))}else try{yield tp(e)}catch(n){console.error(n),t?.(n)}}const Y1=async(e,t)=>{try{const n=[],r=await Promise.all(Array.from(e.items,s=>J1(s)));for(let s=0;s<r.length;s++)for await(const o of np(r[s],t))n.push(o);return n}catch(n){console.error(n);const r=Array.from(e.files);return Promise.resolve(r)}},Z1={target:null,uppyService:null};class ek extends kc.BasePlugin{nodes;uppyService;constructor(t,n){super(t,{...Z1,...n}),this.type="acquirer",this.id=this.opts.id||"DropTarget"}handleDrop=async t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(o=>{o.type==="acquirer"&&o.handleRootDrop?.(t)});let n=!1;const r=o=>{this.uppy.log(o,"error"),n||(this.uppy.info(o.message,"error"),n=!0)},s=await Y1(t.dataTransfer,r);if(s.length>0){this.uppy.log("[DropTarget] Files were dropped");try{const o=ep("DropTarget",s);this.uppyService.addFiles(o)}catch(o){this.uppy.log(o)}}this.opts.onDrop?.(t),this.uppyService?.publish("drop",t)};handleDragOver=t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver?.(t),this.uppyService?.publish("drag-over",t)};handleDragLeave=t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave?.(t),this.uppyService?.publish("drag-out",t)};addListeners=()=>{const{target:t,uppyService:n}=this.opts;if(this.uppyService=n,t instanceof Element?this.nodes=[t]:typeof t=="string"&&(this.nodes=Cc.toArray(document.querySelectorAll(t))),!this.nodes||this.nodes.length===0)throw new Error(`"${t}" does not match any HTML elements`);this.nodes.forEach(r=>{r.addEventListener("dragover",this.handleDragOver,!1),r.addEventListener("dragleave",this.handleDragLeave,!1),r.addEventListener("drop",this.handleDrop,!1)})};removeListeners=()=>{this.nodes&&this.nodes.forEach(t=>{t.removeEventListener("dragover",this.handleDragOver,!1),t.removeEventListener("dragleave",this.handleDragLeave,!1),t.removeEventListener("drop",this.handleDrop,!1)})};install(){this.setPluginState({isDraggingOver:!1}),this.addListeners()}uninstall(){this.removeListeners()}}class tk{uppy;uploadInputs=[];uploadFolderMap={};constructor({language:t}){const{$gettext:n}=t;this.uppy=new kc({autoProceed:!1,onBeforeFileAdded:(r,s)=>r.id in s&&!s[r.id].error?!1:(r.name=r.name.normalize("NFC"),r.meta.relativePath=this.getRelativeFilePath(r)?.normalize("NFC"),r.id=this.generateUploadId(r),r)}),this.uppy.setOptions({locale:{strings:{addedNumFiles:n("Added %{numFiles} file(s)"),authenticate:n("Connect"),authenticateWith:n("Connect to %{pluginName}"),authenticateWithTitle:n("Please authenticate with %{pluginName} to select files"),cancel:n("Cancel"),companionError:n("Connection with Companion failed"),loadedXFiles:n("Loaded %{numFiles} files"),loading:n("Loading..."),logOut:n("Log out"),pluginWebdavInputLabel:n("Public link without password protection"),selectX:{0:n("Select %{smart_count}"),1:n("Select %{smart_count}")},signInWithGoogle:n("Sign in with Google")}}}),this.setUpEvents()}getRelativeFilePath=t=>{const n=t.data.relativePath||t.data.webkitRelativePath;return n?z.urlJoin(n):void 0};addPlugin(t,...n){this.uppy.use(t,...n)}removePlugin(t){this.uppy.removePlugin(t)}getPlugin(t){return this.uppy.getPlugin(t)}useTus({chunkSize:t,overridePatchMethod:n,uploadDataDuringCreation:r,onBeforeRequest:s,headers:o}){const i={chunkSize:t,removeFingerprintOnSuccess:!0,overridePatchMethod:n,retryDelays:[0,500,1e3],uploadDataDuringCreation:r,limit:5,headers:o,onBeforeRequest:s,onShouldRetry:(d,c,f,p)=>d?.originalResponse?.getStatus()>=500?!1:d?.originalResponse?.getStatus()===401?!0:p(d)},l=this.uppy.getPlugin("XHRUpload");l&&this.uppy.removePlugin(l);const u=this.uppy.getPlugin("Tus");if(u){u.setOptions(i);return}this.uppy.use(wg,i)}useXhr({headers:t,timeout:n,endpoint:r}){const s={endpoint:r,method:"put",headers:t,formData:!1,timeout:n,getResponseData(){return{}}},o=this.uppy.getPlugin("Tus");o&&this.uppy.removePlugin(o);const i=this.uppy.getPlugin("XHRUpload");if(i){i.setOptions(s);return}this.uppy.use(Sg,s)}tusActive(){return!!this.uppy.getPlugin("Tus")}useDropTarget({targetSelector:t}){this.uppy.getPlugin("DropTarget")||this.uppy.use(ek,{target:t,uppyService:this})}removeDropTarget(){const t=this.uppy.getPlugin("DropTarget");t&&this.uppy.removePlugin(t)}subscribe(t,n){return Xe.subscribe(t,n)}unsubscribe(t,n){Xe.unsubscribe(t,n)}publish(t,n){Xe.publish(t,n)}setUpEvents(){this.uppy.on("progress",t=>{this.publish("progress",t)}),this.uppy.on("upload-progress",(t,n)=>{this.publish("upload-progress",{file:t,progress:n})}),this.uppy.on("cancel-all",()=>{this.publish("uploadCancelled"),this.clearInputs()}),this.uppy.on("complete",t=>{if(!(!t||!t.successful.length&&!t.failed.length)){this.publish("uploadCompleted",t);for(let n=0;n<t.successful.length;n++)this.uppy.removeFile(t.successful[n].id);this.clearInputs()}}),this.uppy.on("upload-success",t=>{this.publish("uploadSuccess",t)}),this.uppy.on("upload-error",(t,n)=>{this.publish("uploadError",{file:t,error:n})})}registerUploadInput(t){t.getAttribute("listener")!=="true"&&(t.setAttribute("listener","true"),t.addEventListener("change",r=>{const s=r.target,o=Array.from(s.files);this.addFiles(o)}),this.uploadInputs.push(t))}removeUploadInput(t){this.uploadInputs=this.uploadInputs.filter(n=>n!==t)}generateUploadId(t){return Cc.generateFileID(t,this.uppy.getID())}log(t,n){this.uppy.log(t,n)}addFiles(t){this.uppy.addFiles(t)}uploadFiles(){return this.uppy.upload()}retryAllUploads(){return this.uppy.retryAll()}pauseAllUploads(){return this.uppy.pauseAll()}resumeAllUploads(){return this.uppy.resumeAll()}cancelAllUploads(){return this.uppy.cancelAll()}removeFailedFiles(){const{files:t}=this.uppy.getState(),n=Object.values(t).filter(r=>r.error);n.length&&this.uppy.removeFiles(n.map(({id:r})=>r))}getCurrentUploads(){return this.uppy.getState().currentUploads}isRemoteUploadInProgress(){return this.uppy.getFiles().some(t=>t.isRemote&&!t.error)}clearInputs(){this.uploadInputs.forEach(t=>{t.value=null})}setUploadFolder(t,n){this.uploadFolderMap[t]=n}removeUploadFolder(t){this.uploadFolderMap[t]&&delete this.uploadFolderMap[t]}}function nk(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var rk=Object.getOwnPropertySymbols,sk=rk?function(e){for(var t=[];e;)xl(t,zf(e)),e=Qa(e);return t}:Bf;function rp(e){return Nf(e,el,sk)}var ok=Object.prototype,ik=ok.hasOwnProperty;function ak(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&ik.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function lk(e,t){var n=Wa(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var ck=/\w*$/;function uk(e){var t=new e.constructor(e.source,ck.exec(e));return t.lastIndex=e.lastIndex,t}var sp=en?en.prototype:void 0,op=sp?sp.valueOf:void 0;function dk(e){return op?Object(op.call(e)):{}}var fk="[object Boolean]",pk="[object Date]",hk="[object Map]",mk="[object Number]",gk="[object RegExp]",yk="[object Set]",vk="[object String]",bk="[object Symbol]",wk="[object ArrayBuffer]",Sk="[object DataView]",kk="[object Float32Array]",Ck="[object Float64Array]",Tk="[object Int8Array]",xk="[object Int16Array]",Ak="[object Int32Array]",Rk="[object Uint8Array]",Ek="[object Uint8ClampedArray]",Dk="[object Uint16Array]",Fk="[object Uint32Array]";function Ik(e,t,n){var r=e.constructor;switch(t){case wk:return Wa(e);case fk:case pk:return new r(+e);case Sk:return lk(e);case kk:case Ck:case Tk:case xk:case Ak:case Rk:case Ek:case Dk:case Fk:return Cd(e,n);case hk:return new r;case mk:case vk:return new r(e);case gk:return uk(e);case yk:return new r;case bk:return dk(e)}}var Pk="[object Map]";function $k(e){return Fn(e)&&yn(e)==Pk}var ip=is&&is.isMap,Ok=ip?Ja(ip):$k,Lk="[object Set]";function _k(e){return Fn(e)&&yn(e)==Lk}var ap=is&&is.isSet,Mk=ap?Ja(ap):_k,Nk=1,lp="[object Arguments]",Bk="[object Array]",jk="[object Boolean]",zk="[object Date]",Vk="[object Error]",cp="[object Function]",Uk="[object GeneratorFunction]",qk="[object Map]",Hk="[object Number]",up="[object Object]",Wk="[object RegExp]",Qk="[object Set]",Kk="[object String]",Gk="[object Symbol]",Jk="[object WeakMap]",Xk="[object ArrayBuffer]",Yk="[object DataView]",Zk="[object Float32Array]",eC="[object Float64Array]",tC="[object Int8Array]",nC="[object Int16Array]",rC="[object Int32Array]",sC="[object Uint8Array]",oC="[object Uint8ClampedArray]",iC="[object Uint16Array]",aC="[object Uint32Array]",tt={};tt[lp]=tt[Bk]=tt[Xk]=tt[Yk]=tt[jk]=tt[zk]=tt[Zk]=tt[eC]=tt[tC]=tt[nC]=tt[rC]=tt[qk]=tt[Hk]=tt[up]=tt[Wk]=tt[Qk]=tt[Kk]=tt[Gk]=tt[sC]=tt[oC]=tt[iC]=tt[aC]=!0,tt[Vk]=tt[cp]=tt[Jk]=!1;function Si(e,t,n,r,s,o){var i,l=t&Nk;if(n&&(i=s?n(e,r,s,o):n(e)),i!==void 0)return i;if(!En(e))return e;var u=mn(e);if(u)i=ak(e);else{var d=yn(e),c=d==cp||d==Uk;if(qs(e))return kd(e,l);if(d==up||d==lp||c&&!s)i={};else{if(!tt[d])return s?e:{};i=Ik(e,d,l)}}o||(o=new Dn);var f=o.get(e);if(f)return f;o.set(e,i),Mk(e)?e.forEach(function(g){i.add(Si(g,t,n,g,e,o))}):Ok(e)&&e.forEach(function(g,m){i.set(m,Si(g,t,n,m,e,o))});var p=rp,h=u?void 0:p(e);return nk(h||e,function(g,m){h&&(m=g,g=e[m]),Ld(i,m,Si(g,t,n,m,e,o))}),i}function lC(e,t,n){var r=-1,s=e.length;t<0&&(t=-t>s?0:s+t),n=n>s?s:n,n<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(s);++r<s;)o[r]=e[r+t];return o}function cC(e,t){return t.length<2?e:gf(e,lC(t,0,-1))}var uC=Object.prototype,dC=uC.hasOwnProperty;function fC(e,t){t=wl(t,e);var n=-1,r=t.length;if(!r)return!0;for(var s=e==null||typeof e!="object"&&typeof e!="function";++n<r;){var o=t[n];if(typeof o=="string"){if(o==="__proto__"&&!dC.call(e,"__proto__"))return!1;if(o==="constructor"&&n+1<r&&typeof t[n+1]=="string"&&t[n+1]==="prototype"){if(s&&n===0)continue;return!1}}}var i=cC(e,t);return i==null||delete i[mf(Rc(t))]}function pC(e){return Ga(e)?void 0:e}var dp=en?en.isConcatSpreadable:void 0;function hC(e){return mn(e)||si(e)||!!(dp&&e&&e[dp])}function mC(e,t,n,r,s){var o=-1,i=e.length;for(n||(n=hC),s||(s=[]);++o<i;){var l=e[o];n(l)?xl(s,l):s[s.length]=l}return s}function gC(e){var t=e==null?0:e.length;return t?mC(e):[]}function yC(e){return Ud(Vd(e,void 0,gC),e+"")}var vC=1,bC=2,wC=4,ps=yC(function(e,t){var n={};if(e==null)return n;var r=!1;t=df(t,function(o){return o=wl(o,e),r||(r=o.length>1),o}),_d(e,rp(e),n),r&&(n=Si(n,vC|bC|wC,pC));for(var s=t.length;s--;)fC(n,t[s]);return n});const SC=(e,t)=>{const n=(o="")=>o.split("/").filter(Boolean),r=n(e.path),s=n(t);return s.map((o,i)=>({id:wt.v4(),allowContextActions:!0,text:o,to:{path:"/"+[...r].splice(0,r.length-s.length+i+1).join("/"),query:ps(e.query,"fileId","page")},isStaticNav:!1}))},kC=(...e)=>{const t=e.pop();return[...e,{id:wt.v4(),allowContextActions:t.allowContextActions,text:t.text,onClick:()=>Xe.publish("app.files.list.load"),isTruncationPlaceholder:t.isTruncationPlaceholder,isStaticNav:t.isStaticNav}]};class Js{static Cut="cut";static Copy="copy"}const ki=e=>(e||"").split("_")[0],Nr=(e,t,n=ht.DateTime.DATETIME_MED)=>e.setLocale(ki(t)).toLocaleString(n),fp=(e,t,n=ht.DateTime.DATETIME_MED)=>Nr(ht.DateTime.fromJSDate(e),t,n),CC=(e,t,n=ht.DateTime.DATETIME_MED)=>Nr(ht.DateTime.fromHTTP(e),t,n),pp=(e,t,n=ht.DateTime.DATETIME_MED)=>Nr(ht.DateTime.fromISO(e),t,n),TC=(e,t,n=ht.DateTime.DATETIME_MED)=>Nr(ht.DateTime.fromRFC2822(e),t,n),Xs=(e,t)=>e.setLocale(ki(t)).toRelative(),hp=(e,t)=>Xs(ht.DateTime.fromJSDate(e),t),xC=(e,t)=>Xs(ht.DateTime.fromHTTP(e),t),AC=(e,t)=>Xs(ht.DateTime.fromISO(e),t),RC=(e,t)=>Xs(ht.DateTime.fromRFC2822(e),t),EC=1048576,zt=(e,t)=>{const n=typeof e=="string"?parseInt(e):e;return n<0?"--":isNaN(n)?"?":yg.filesize(n,{round:n<EC?0:1,locale:ki(t),base:10,output:"string"})};function mp(e="",t=!1){const n=z.urlJoin(e,{leadingSlash:!0});if(n==="/")return[];const r=[],s=n.split("/");for(t&&r.push(n),s.pop();s.length>0;){if(!s.join("/")){s.pop();continue}r.push(s.join("/")),s.pop()}return r}const gp=e=>new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=s=>n(s),r.readAsArrayBuffer(e)}),yp=e=>new Promise(t=>e.toBlob(t)),Ys=()=>window.navigator.platform.match("Mac");function Br(e){return e.status==="fulfilled"}function jr(e){return e.status==="rejected"}const Fl=e=>new TextEncoder().encode(e).length,DC=()=>`OpenCloud Web UI ${ce.env.PACKAGE_VERSION}`,vp=({capabilityStore:e})=>{const t=e.status;if(!t||!t.versionstring)return;const n=t.product||"OpenCloud",r=t.productversion||t.versionstring,s=t.edition||"";return`${n} ${r} ${s}`.trim()},Me=ve.defineStore("messages",()=>{const e=H([]),t=o=>{const i={...o,id:wt.v4()};return e.value.push(i),i},n=o=>{const i=l=>l.response?.headers?.get("x-request-id");return o.map(l=>i(l)).filter(Boolean).map(l=>`X-Request-Id: ${l}`).join(`\r
9
+ `)};return{messages:e,showMessage:t,showErrorMessage:o=>{const i={id:wt.v4(),status:"danger",timeout:0,...o.errors&&{errorLogContent:n(o.errors)},...o};return e.value.push(i),i},removeMessage:o=>{e.value=a(e).filter(({id:i})=>o.id!==i)}}}),Zs=ve.defineStore("clipboard",()=>{const{$gettext:e}=de.useGettext(),{showMessage:t}=Me(),n=H(),r=H([]);return{action:n,resources:r,copyResources:l=>{l[0]?.canDownload()&&(n.value=Js.Copy,r.value=l,t({title:e("Copied to clipboard!"),status:"success"}))},cutResources:l=>{l[0]?.canDownload()&&(n.value=Js.Cut,r.value=l,t({title:e("Cut to clipboard!"),status:"success"}))},clearClipboard:()=>{n.value=void 0,r.value=[]}}}),bp=ve.defineStore("extensionPreferences",()=>{const e=Cn.useLocalStorage("extensionPreferences",{});return{extensionPreferences:e,extractDefaultExtensionIds:(s,o)=>s.multiple?o.map(i=>i.id):s.defaultExtensionId?[s.defaultExtensionId]:[],getExtensionPreference:(s,o)=>{const i=e.value[s];return i||{extensionPointId:s,selectedExtensionIds:o}},setSelectedExtensionIds:(s,o)=>{if(!Object.hasOwn(a(e),s)){e.value[s]={extensionPointId:s,selectedExtensionIds:o};return}e.value[s].selectedExtensionIds=o}}}),br=ve.defineStore("extensionRegistry",()=>{const e=Qe(),t=H([]),n=d=>{t.value.push(d)},r=d=>{t.value=a(t).map(c=>H(a(c).filter(({id:f})=>!d.includes(f)))).filter(c=>a(c).length)},s=d=>{if(!d.id||!d.extensionType)throw new Error("ExtensionPoint must have an id and an extensionType");return a(t).flatMap(c=>a(c).filter(f=>f.type===d.extensionType&&!e.options.disabledExtensions.includes(f.id)&&(!f.extensionPointIds||f.extensionPointIds?.includes(d.id))))},o=H([]);return{extensions:t,registerExtensions:n,unregisterExtensions:r,requestExtensions:s,extensionPoints:o,registerExtensionPoints:d=>{o.value.push(d)},unregisterExtensionPoints:d=>{o.value=a(o).map(c=>H(a(c).filter(({id:f})=>!d.includes(f)))).filter(c=>a(c).length)},getExtensionPoints:(d={})=>a(o).flatMap(c=>a(c).filter(f=>!(Object.hasOwn(d,"extensionType")&&f.extensionType!==d.extensionType)))}}),FC=ve.defineStore("groupwareConfig",()=>{const e=H(""),t=H([]),n=H(),r=H([]),s=H({});return{version:e,capabilities:t,limits:n,accounts:r,primaryAccounts:s,loadGroupwareConfig:i=>{e.value=i.version,t.value=i.capabilities||[],n.value=i.limits,r.value=i.accounts||[],s.value=i.primaryAccounts||{}}}}),wp=G.z.object({maxMailboxDepth:G.z.number(),maxSizeMailboxName:G.z.number(),maxMailboxesPerEmail:G.z.number(),maxSizeAttachmentsPerEmail:G.z.number(),mayCreateTopLevelMailbox:G.z.boolean(),maxDelayedSend:G.z.number()}),Sp=G.z.object({maxSizeScriptName:G.z.number(),maxSizeScript:G.z.number(),maxNumberScripts:G.z.number(),maxNumberRedirects:G.z.number()}),kp=G.z.object({mail:wp.optional(),sieve:Sp.optional()}),Cp=G.z.object({id:G.z.string(),name:G.z.string(),email:G.z.string().email(),mayDelete:G.z.boolean()}),Tp=G.z.object({accountId:G.z.string(),name:G.z.string(),isPersonal:G.z.boolean(),isReadOnly:G.z.boolean(),capabilities:kp,identities:G.z.array(Cp)}),xp=G.z.object({maxSizeUpload:G.z.number(),maxConcurrentUpload:G.z.number(),maxSizeRequest:G.z.number(),maxConcurrentRequests:G.z.number()}),Ap=G.z.array(Tp),Rp=G.z.record(G.z.string(),G.z.string()),IC=G.z.object({version:G.z.string(),capabilities:G.z.array(G.z.string()),limits:xp,accounts:Ap,primaryAccounts:Rp}),Ke=ve.defineStore("modals",()=>{const e=H([]),t=T(()=>a(e).at(-1)),n=u=>a(e).find(d=>d.id===u);return{modals:e,activeModal:t,dispatchModal:u=>{const d={...u,id:wt.v4()};return e.value.push(d),d},updateModal:(u,d,c)=>{const f=n(u);f[d]=c},removeModal:u=>{e.value=a(e).filter(d=>d.id!==u)},removeAllModals:()=>{e.value=[]},setModalActive:u=>{const d=a(e).findIndex(f=>f.id===u);if(d<0)return;const c=n(u);a(e).splice(d,1),e.value.push(c)}}}),Ze=ve.defineStore("user",()=>{const e=H();return{user:e,setUser:r=>{e.value=r,Cg.setUser({username:r.onPremisesSamAccountName})},reset:()=>{e.value=null}}});function PC(e,t,n,r){for(var s=-1,o=e==null?0:e.length;++s<o;)n=t(n,e[s],s,e);return n}function $C(e){return function(t){return e?.[t]}}var OC={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},LC=$C(OC),_C=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,MC="\\u0300-\\u036f",NC="\\ufe20-\\ufe2f",BC="\\u20d0-\\u20ff",jC=MC+NC+BC,zC="["+jC+"]",VC=RegExp(zC,"g");function UC(e){return e=bl(e),e&&e.replace(_C,LC).replace(VC,"")}var qC=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function HC(e){return e.match(qC)||[]}var WC=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function QC(e){return WC.test(e)}var Ep="\\ud800-\\udfff",KC="\\u0300-\\u036f",GC="\\ufe20-\\ufe2f",JC="\\u20d0-\\u20ff",XC=KC+GC+JC,Dp="\\u2700-\\u27bf",Fp="a-z\\xdf-\\xf6\\xf8-\\xff",YC="\\xac\\xb1\\xd7\\xf7",ZC="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",eT="\\u2000-\\u206f",tT=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ip="A-Z\\xc0-\\xd6\\xd8-\\xde",nT="\\ufe0e\\ufe0f",Pp=YC+ZC+eT+tT,$p="['’]",Op="["+Pp+"]",rT="["+XC+"]",Lp="\\d+",sT="["+Dp+"]",_p="["+Fp+"]",Mp="[^"+Ep+Pp+Lp+Dp+Fp+Ip+"]",oT="\\ud83c[\\udffb-\\udfff]",iT="(?:"+rT+"|"+oT+")",aT="[^"+Ep+"]",Np="(?:\\ud83c[\\udde6-\\uddff]){2}",Bp="[\\ud800-\\udbff][\\udc00-\\udfff]",hs="["+Ip+"]",lT="\\u200d",jp="(?:"+_p+"|"+Mp+")",cT="(?:"+hs+"|"+Mp+")",zp="(?:"+$p+"(?:d|ll|m|re|s|t|ve))?",Vp="(?:"+$p+"(?:D|LL|M|RE|S|T|VE))?",Up=iT+"?",qp="["+nT+"]?",uT="(?:"+lT+"(?:"+[aT,Np,Bp].join("|")+")"+qp+Up+")*",dT="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",fT="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",pT=qp+Up+uT,hT="(?:"+[sT,Np,Bp].join("|")+")"+pT,mT=RegExp([hs+"?"+_p+"+"+zp+"(?="+[Op,hs,"$"].join("|")+")",cT+"+"+Vp+"(?="+[Op,hs+jp,"$"].join("|")+")",hs+"?"+jp+"+"+zp,hs+"+"+Vp,fT,dT,Lp,hT].join("|"),"g");function gT(e){return e.match(mT)||[]}function yT(e,t,n){return e=bl(e),t=t,t===void 0?QC(e)?gT(e):HC(e):e.match(t)||[]}var vT="['’]",bT=RegExp(vT,"g");function wT(e){return function(t){return PC(yT(UC(t).replace(bT,"")),e,"")}}var Hp=wT(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Wp=G.z.object({name:G.z.string().optional(),slogan:G.z.string().optional(),logo:G.z.string().optional(),logoMobile:G.z.string().optional(),urls:G.z.object({accessDeniedHelp:G.z.string().optional(),imprint:G.z.string().optional(),privacy:G.z.string().optional(),accessibility:G.z.string().optional()}).optional(),shareRoles:G.z.record(G.z.string(),G.z.object({iconName:G.z.string()})).optional()}),ST=G.z.object({roles:G.z.record(G.z.string(),G.z.string()).optional(),colorPalette:G.z.record(G.z.string(),G.z.string()).optional(),fontFamily:G.z.string().optional()}),Qp=Wp.extend({designTokens:ST.optional(),favicon:G.z.string().optional(),background:G.z.string().optional()}),kT=Qp.extend({isDark:G.z.boolean(),label:G.z.string()}),Kp=G.z.object({defaults:Qp,themes:G.z.array(kT)}),CT=G.z.object({common:Wp.optional(),clients:G.z.object({web:Kp})}),TT="oc_currentThemeName",xT=e=>{let t=document.querySelector("link[rel~='icon']");t||(t=document.createElement("link"),t.rel="icon",document.head.appendChild(t)),t.href=e},On=ve.defineStore("theme",()=>{const e=Cn.useLocalStorage(TT,null),t=Cn.usePreferredDark(),n=H(),r=H([]),s=c=>{const f=c.common,p=c.clients.web.defaults,h=Ac(f,p);r.value=c.clients.web.themes.map(g=>Ac(h,g)),o()},o=()=>{const c=a(r).find(p=>!p.isDark),f=a(r).find(p=>p.isDark);u(a(r).find(p=>p.label===a(e))||(a(t)?f:c)||a(r)[0],!1)},i=()=>{e.value=null,o()},l=T(()=>e.value===null),u=(c,f=!0)=>{n.value=c,f&&(e.value=a(n).label);const p=[{name:"roles",prefix:"role"},{name:"colorPalette",prefix:"color"}];ci("font-family",a(n).designTokens.fontFamily),p.forEach(h=>{for(const g in a(n).designTokens[h.name])ci(`${h.prefix}-${Hp(g)}`,a(n).designTokens[h.name][g])}),a(n).designTokens?.roles?.chrome||(ci("role-chrome",a(n).designTokens?.roles?.surfaceContainer),ci("role-on-chrome",a(n).designTokens?.roles?.onSurface)),a(n).favicon&&xT(a(n).favicon)};return{availableThemes:r,currentTheme:n,initializeThemes:s,setAndApplyTheme:u,setAutoSystemTheme:i,isCurrentThemeAutoSystem:l,getRoleIcon:c=>a(n).shareRoles[c.id]?.iconName||"user"}}),Jn=ve.defineStore("shares",()=>{const e=Re(),{getRoleIcon:t}=On(),n=H(!1),r=H([]),s=H([]),o=H({}),i=_=>{o.value=_.reduce((F,V)=>(F[V.id]={...V,icon:t(V)},F),{})},l=_=>{const F=a(r).find(({id:V})=>V===_.id);if(F){Object.assign(F,_);return}a(r).push(_)},u=_=>{r.value=_},d=_=>{a(r).push(..._)},c=_=>{r.value=a(r).filter(({id:F})=>F!==_.id)},f=()=>{r.value=[],s.value=[],n.value=void 0},p=()=>{const _=Object.values(e.ancestorMetaData).map(({id:F})=>F);if(!_.length){r.value=[],s.value=[];return}a(r).forEach(F=>{_.includes(F.resourceId)||c(F)}),a(s).forEach(F=>{_.includes(F.resourceId)||m(F)})},h=_=>{s.value=_},g=_=>{const F=a(s).find(({id:V})=>V===_.id);if(F){Object.assign(F,_);return}a(s).push(_)},m=_=>{s.value=a(s).filter(({id:F})=>F!==_.id)},b=_=>{n.value=_},S=_=>{const F=$=>{const L=new Set;return $.forEach(M=>{L.add(M.shareType)}),Array.from(L)},V=[...e.resources,e.currentFolder].find($=>$?.id===_);if(!V||z.isProjectSpaceResource(V))return;const Z=[...a(r),...a(s)];e.updateResourceField({id:V.id,field:"shareTypes",value:F(Z.filter($=>!$.indirect))});const P=e.getAncestorById(_);P&&e.updateAncestorField({path:P.path,field:"shareTypes",value:F(Z.filter($=>!$.indirect))})};return{loading:n,collaboratorShares:r,linkShares:s,graphRoles:o,setGraphRoles:i,setLoading:b,setCollaboratorShares:u,setLinkShares:h,removeOrphanedShares:p,pruneShares:f,addShare:async({clientService:_,space:F,resource:V,options:Z})=>{const $=await _.graphAuthenticated.permissions.createInvite(F.id,V.id,Z,a(o));return d([$]),S(V.id),$},updateShare:async({clientService:_,space:F,resource:V,collaboratorShare:Z,options:P})=>{const $=_.graphAuthenticated.permissions,L={roles:P.roles,expirationDateTime:P.expirationDateTime},M=await $.updatePermission(F.id,V.id,Z.id,L,a(o));return l(M),M},deleteShare:async({clientService:_,space:F,resource:V,collaboratorShare:Z})=>{await _.graphAuthenticated.permissions.deletePermission(F.id,V.id,Z.id),c(Z),S(V.id)},addLink:async({clientService:_,space:F,resource:V,options:Z})=>{const $=await _.graphAuthenticated.permissions.createLink(F.id,V.id,Z),L=e.selectedResources,M=L.some(({fileId:j})=>j===V.fileId)||L.length===0&&e.currentFolder.fileId===V.fileId;if(g($),S(V.id),!M){const j=e.ancestorMetaData[V.path]??null;if(j){const{shareTypes:B}=j;B.includes(z.ShareTypes.link.value)||e.updateAncestorField({path:j.path,field:"shareTypes",value:[...B,z.ShareTypes.link.value]})}}return $},updateLink:async({clientService:_,space:F,resource:V,linkShare:Z,options:P})=>{const $=_.graphAuthenticated.permissions;let L;if(Object.hasOwn(P,"password"))L=await $.setPermissionPassword(F.id,V.id,Z.id,{password:P.password}),Z.hasPassword=!!P.password;else{const M={link:{...P.type&&{type:P.type},...P.displayName&&{"@libre.graph.displayName":P.displayName}},...Object.hasOwn(P,"expirationDateTime")&&{expirationDateTime:P.expirationDateTime}};L=await $.updatePermission(F.id,V.id,Z.id,M)}return g(L),L},deleteLink:async({clientService:_,space:F,resource:V,linkShare:Z})=>{await _.graphAuthenticated.permissions.deletePermission(F.id,V.id,Z.id),m(Z),S(V.id)}}}),Vt={View:"view",Upload:"upload",Edit:"edit",CreateOnly:"createOnly"},Gp={LibreGraphPermissionsActionsAllowedValues:"@libre.graph.permissions.actions.allowedValues",LibreGraphPermissionsRolesAllowedValues:"@libre.graph.permissions.roles.allowedValues"},Jp=e=>e.sort((t,n)=>n.permissions.length-t.permissions.length),eo=async({graphClient:e,driveType:t,configStore:n,signal:r})=>{const s=await e.drives.listMyDrives({orderBy:"name asc",filter:`driveType eq ${t}`},{signal:r});if(!s.length)return[];if(t!=="mountpoint"||!n.options.routing?.fullShareOwnerPaths)return s;const o={};s.forEach(l=>{const{rootId:u,driveAlias:d}=l.root.remoteItem;o[u]=d});const i=Object.entries(o).map(([l,u])=>z.buildSpace({id:z.extractStorageId(l),name:u,driveType:u.split("/")[0],driveAlias:u,path:"/",serverUrl:n.serverUrl}));return[...s,...i]},Ue=ve.defineStore("spaces",()=>{const e=Ze(),t=Qe(),n=Jn(),r=H([]),s=H(),o=H(!1),i=H(!1),l=H(!1),u=H(null),d=H([]),c=H([]),f=T(()=>a(r).find(J=>z.isPersonalSpaceResource(J)&&J.isOwner(e.user))),p=J=>{o.value=J},h=J=>{i.value=J},g=J=>{l.value=J},m=J=>{s.value=J},b=J=>{u.value=J},S=J=>{if(!z.isProjectSpaceResource(J))return[];const oe=n.collaboratorShares.filter(ne=>ne.resourceId===J.id);return Jp(oe)},k=J=>{a(r).push(...J)},w=J=>{r.value=a(r).filter(({id:oe})=>oe!==J.id)},C=J=>a(r).find(oe=>J==oe.id),A=async({graphClient:J,space:oe,signal:ne})=>(await V({graphClient:J,signal:ne}),a(r).find(pe=>z.isMountPointSpaceResource(pe)&&pe.root?.remoteItem?.id===oe.id)),I=({driveAliasPrefix:J,id:oe,shareName:ne})=>{const pe=z.buildShareSpaceResource({driveAliasPrefix:J,id:oe,shareName:ne,serverUrl:t.serverUrl});return k([pe]),pe},N=J=>{const oe=a(r).find(({id:ne})=>ne===J.id);if(oe){Object.assign(oe,J);return}k([J])},_=({id:J,field:oe,value:ne})=>{const pe=a(r).find(fe=>J===fe.id);pe&&(pe[oe]=ne)},F=async({graphClient:J})=>{l.value=!0;try{const[oe,ne]=await Promise.all([eo({graphClient:J,driveType:"personal",configStore:t}),eo({graphClient:J,driveType:"project",configStore:t})]);k([...oe,...ne])}finally{l.value=!1}},V=async({graphClient:J,signal:oe})=>{if(!a(i))try{const ne=await eo({graphClient:J,driveType:"mountpoint",configStore:t,signal:oe});k(ne)}finally{i.value=!0}},Z=async({graphClient:J,signal:oe})=>{const ne=await eo({graphClient:J,driveType:"project",configStore:t,signal:oe});r.value=a(r).filter(pe=>!z.isProjectSpaceResource(pe)),k(ne)},P=J=>{a(d).includes(J)||a(d).push(J)},$=J=>{d.value=a(d).filter(oe=>oe!==J)},L=()=>{d.value=[]},M=J=>{a(c).includes(J)||a(c).push(J)},j=J=>{c.value=a(c).filter(oe=>oe!==J)},B=()=>{c.value=[]},q=H({});return{spaces:r,spacesInitialized:o,mountPointsInitialized:i,spacesLoading:l,currentSpace:s,personalSpace:f,defaultSpaceImageBlobURL:u,imagesLoading:d,readmesLoading:c,getSpace:C,createShareSpace:I,setSpacesInitialized:p,setMountPointsInitialized:h,setSpacesLoading:g,setCurrentSpace:m,setDefaultSpaceImageBlobURL:b,getSpaceMembers:S,getMountPointForSpace:A,addSpaces:k,removeSpace:w,upsertSpace:N,updateSpaceField:_,loadSpaces:F,loadMountPoints:V,reloadProjectSpaces:Z,addToImagesLoading:P,removeFromImagesLoading:$,purgeImagesLoading:L,addToReadmesLoading:M,removeFromReadmesLoading:j,purgeReadmesLoading:B,loadGraphPermissions:async({ids:J,graphClient:oe,useCache:ne=!0})=>{const pe=a(r).filter(fe=>J.includes(fe.id)&&(fe.graphPermissions===void 0||!ne));if(pe.length){for(const{id:fe,disabled:we}of pe){if(we){_({id:fe,field:"graphPermissions",value:[]});continue}a(q)[fe]||(q.value[fe]=oe.permissions.listPermissions(fe,fe,n.graphRoles,{select:[Gp.LibreGraphPermissionsActionsAllowedValues]}).then(({allowedActions:$e})=>{_({id:fe,field:"graphPermissions",value:$e}),delete q.value[fe]}))}await Promise.all(Object.values(a(q)))}}}}),Re=ve.defineStore("resources",()=>{const e=Qe(),t=Ue(),n=Ze(),r=H([]),s=H(),o=H({}),i=H([]),l=T(()=>{let ae=a(r);return a(P)||(ae=ae.filter(ue=>!ue.name.startsWith("."))),ae}),u=T(()=>{const ae=a(r).filter(({type:_e})=>_e==="file").length,ue=a(r).filter(({type:_e,name:ut})=>_e==="file"&&ut.startsWith(".")).length,be=a(r).filter(({type:_e})=>_e==="folder").length,me=a(r).filter(({type:_e,name:ut})=>_e==="folder"&&ut.startsWith(".")).length,De=a(r).filter(z.isProjectSpaceResource).length;return{files:ae,hiddenFiles:ue,folders:be,hiddenFolders:me,spaces:De}}),d=ae=>{r.value=ae},c=ae=>{r.value=a(r).filter(ue=>!ae.find(({id:be})=>be===ue.id))},f=()=>{r.value=[]},p=ae=>{const ue=a(r).find(({id:be})=>be===ae.id);if(ue){Object.assign(ue,ae);return}a(r).push(ae)},h=ae=>{const ue=a(r).filter(be=>!ae.some(me=>me.path===be.path));r.value=[...ue,...ae]},g=({id:ae,field:ue,value:be})=>{const me=a(r).find(De=>ae===De.id);me&&(me[ue]=be)},m=ae=>{s.value=ae},b=()=>{s.value=void 0},S=ae=>{r.value=ae.resources,s.value=ae.currentFolder},k=()=>{r.value=[],s.value=void 0,w.value=[]},w=H([]),C=H(null),A=T(()=>a(r).filter(ae=>a(w).includes(ae.id))),I=ae=>{const ue=ae.find(be=>!a(w).includes(be));ue&&(C.value=ue),w.value=ae},N=ae=>{C.value=ae,a(w).includes(ae)||a(w).push(ae)},_=ae=>{C.value=ae,a(w).includes(ae)&&(w.value=a(w).filter(ue=>ue!==ae))},F=ae=>{a(w).includes(ae)?_(ae):N(ae)},V=()=>{w.value=[]},Z=ae=>{C.value=ae},P=H(!0),$=H(!0),L=H(!1),M=H(!0),j=H(!0),B=ae=>{P.value=ae,window.localStorage.setItem("oc_hiddenFilesShown",ae.toString())},q=ae=>{$.value=ae,window.localStorage.setItem("oc_fileExtensionsShown",ae.toString())},re=ae=>{L.value=ae,window.localStorage.setItem("oc_webDavDetailsShown",ae.toString())},J=ae=>{M.value=ae,window.localStorage.setItem("oc_disabledSpacesShown",ae.toString())},oe=ae=>{j.value=ae,window.localStorage.setItem("oc_emptyTrashesShown",ae.toString())},ne=ae=>{o.value=ae};return{resources:r,currentFolder:s,activeResources:l,totalResourcesCount:u,setResources:d,removeResources:c,clearResources:f,upsertResource:p,upsertResources:h,updateResourceField:g,setCurrentFolder:m,clearCurrentFolder:b,initResourceList:S,clearResourceList:k,selectedIds:w,latestSelectedId:C,selectedResources:A,setSelection:I,addSelection:N,removeSelection:_,toggleSelection:F,resetSelection:V,setLastSelectedId:Z,areHiddenFilesShown:P,areFileExtensionsShown:$,areWebDavDetailsShown:L,areDisabledSpacesShown:M,areEmptyTrashesShown:j,setAreHiddenFilesShown:B,setAreFileExtensionsShown:q,setAreWebDavDetailsShown:re,setAreDisabledSpacesShown:J,setAreEmptyTrashesShown:oe,ancestorMetaData:o,setAncestorMetaData:ne,updateAncestorField:({path:ae,field:ue,value:be})=>{const me=a(o)[ae]??null;me&&(me[ue]=be)},loadAncestorMetaData:({folder:ae,space:ue,client:be,signal:me})=>{const De={[ae.path]:{id:ae.fileId,shareTypes:ae.shareTypes,parentFolderId:ae.parentFolderId,spaceId:ue.id,path:ae.path}},_e=[],ut=[Te.FileId,Te.ShareTypes,Te.FileParent],Kt=mp(ae.path),vt=t.spaces,Dt=()=>vt.filter(ye=>z.isMountPointSpaceResource(ye)&&z.extractStorageId(ye.root.remoteItem.rootId)===ue.id);let Ve=!0;if(e.options.routing.fullShareOwnerPaths){const ye=vt.some(Fe=>z.isProjectSpaceResource(Fe)&&Fe.id===ue.id);Ve=ue.isOwner(n.user)||ye}for(const ye of Kt){const Fe=a(o)[ye]??null;if(Fe?.spaceId===ue.id){De[ye]=Fe;continue}if(!Ve&&!Dt().find(gt=>ye.startsWith(gt.root.remoteItem.path)))break;_e.push(be.listFiles(ue,{path:ye},{depth:0,davProperties:ut,signal:me}).then(({resource:gt})=>{De[ye]={id:gt.fileId,shareTypes:gt.shareTypes,parentFolderId:gt.parentFolderId,spaceId:ue.id,path:ye}}))}return Promise.all(_e).then(()=>{if(!Object.keys(De).includes("/")){const ye=a(o)["/"];if(ye?.spaceId===ue.id)De["/"]=ye;else{const{parentFolderId:Fe}=Object.values(De)[0],gt=t.spaces.find(({id:Qr})=>Fe.startsWith(Qr));gt&&(De["/"]={id:gt.id,shareTypes:gt.shareTypes,parentFolderId:gt.id,spaceId:gt.id,path:"/"})}}ne(De)})},getAncestorById:ae=>Object.values(a(o)).find(ue=>ae===ue.id),deleteQueue:i,addResourcesIntoDeleteQueue:ae=>{i.value=i.value.concat(ae.filter(ue=>!a(i).includes(ue)))},removeResourcesFromDeleteQueue:ae=>{i.value=i.value.filter(ue=>!ae.includes(ue))}}}),Il=(e,t=void 0)=>{const n=window.localStorage.getItem(e),r=H(t);if(n)try{r.value=JSON.parse(n)}catch{r.value=n}return ze(()=>a(r),(s,o)=>{s!==o&&(s!==void 0?window.localStorage.setItem(e,typeof s=="string"?s:JSON.stringify(s)):window.localStorage.removeItem(e))},{deep:!0}),r},wr=()=>{const e=Qe(),t=T(()=>e.options.embed?.enabled),n=T(()=>e.options.embed?.target==="location"),r=T(()=>e.options.embed?.chooseFileName),s=T(()=>e.options.embed?.chooseFileNameSuggestion),o=T(()=>e.options.embed?.target==="file"),i=T(()=>e.options.embed?.fileTypes),l=T(()=>e.options.embed?.messagesOrigin),u=T(()=>a(t)&&e.options.embed?.delegateAuthentication),d=T(()=>e.options.embed?.delegateAuthenticationOrigin);return{isEnabled:t,isLocationPicker:n,chooseFileName:r,chooseFileNameSuggestion:s,isFilePicker:o,messagesTargetOrigin:l,isDelegatingAuthentication:u,fileTypes:i,postMessage:(p,h)=>{const g={};a(l)&&(g.targetOrigin=a(l)),window.parent.postMessage({name:p,data:h},g)},verifyDelegatedAuthenticationOrigin:p=>a(d)?a(d)===p:!0}},Xp=({target:e,mode:t="show",rootMargin:n="100px",onVisibleCallback:r})=>{if(!(window&&"IntersectionObserver"in window))return{isVisible:H(!0)};const o=H(!1),i=new IntersectionObserver(l=>{const u=l.at(-1).isIntersecting;o.value=u,a(o)&&r&&r(),t!=="showHide"&&o.value&&i.unobserve(e.value)},{rootMargin:n});return ze(e,()=>{i.observe(e.value)}),Xt(()=>i.disconnect()),{isVisible:o}},to=()=>{const{width:e}=Cn.useWindowSize();return{isMobile:T(()=>e.value<640)}},AT=ve.defineStore("bottomDrawers",()=>{const e=H([]),t=T(()=>a(e).length?a(e)[a(e).length-1]:null);return{drawers:e,currentDrawer:t,showDrawer:()=>{const o={id:Mr()};return e.value.push(o),o},closeDrawer:o=>{e.value=a(e).filter(i=>i.id!==o)},closeAllDrawers:()=>{e.value=[]}}}),Pt=ve.defineStore("sideBar",()=>{const{isEnabled:e}=wr(),t=Il("oc_sideBarOpen",!1),{isMobile:n}=to(),r=H(!1),s=H(null),o=T({get(){return a(e)?a(r):a(t)},set(h){if(a(e)){r.value=h;return}t.value=h}}),i=async()=>{await St();const h=document.getElementById("app-sidebar");h&&h.focus()};return{isSideBarOpen:o,sideBarActivePanel:s,focusSidebar:i,onInitialLoad:()=>{a(n)&&(o.value=!1)},toggleSideBar:()=>{o.value=!a(o),a(o)&&i()},closeSideBar:()=>{o.value=!1,s.value=null},openSideBar:()=>{o.value=!0,s.value=null,i()},openSideBarPanel:h=>{o.value=!0,s.value=h,i()},setActiveSideBarPanel:h=>{s.value=h}}}),Yp=ve.defineStore("updates",()=>{const e=H(!0),t=H(!1),n=H();return{updates:n,isLoading:e,hasError:t,setUpdates:i=>{n.value=i},setHasError:i=>{t.value=i},setIsLoading:i=>{e.value=i}}}),no=ve.defineStore("webWorkers",()=>{const e=H([]);return{createWorker:(o,{needsTokenRenewal:i=!1}={})=>{const l=wt.v4(),u=Cn.useWebWorker(o,{type:"module",name:l}),d={id:l,needsTokenRenewal:i,...u};return a(e).push(d),d},terminateWorker:o=>{const i=a(e).find(l=>o===l.id);i&&(i.terminate(),e.value=a(e).filter(l=>o!==l.id))},terminateAllWorkers:()=>{a(e).forEach(({terminate:o})=>{o()}),e.value=[]},updateAccessTokens:o=>{a(e).filter(({needsTokenRenewal:i})=>i).forEach(({post:i})=>{i(JSON.stringify({topic:"tokenUpdate",data:{accessToken:`Bearer ${o}`}}))})}}}),Ci=(e={})=>{const t=e.router||Ae(),n=e.configStore||Qe();return{replaceInvalidFileRoute:({space:s,resource:o,path:i,fileId:l})=>{if(!n.options.routing?.idBased||i===o.path&&l===o.fileId)return!1;const u=In(s,o,{configStore:n});return t.replace(u),!0}}},Pl=()=>{const e=yt();return T(()=>a(e).name)},Zp=(e,t)=>{const n=yt();return T(()=>a(n).meta[e]||t)},Ti=(e,t)=>{const n=Ae();return T({get(){return ot(a(n.currentRoute).params[e])||t},async set(r){a(n.currentRoute).params[e]!==r&&await n.replace({params:{...a(n.currentRoute).params,[e]:r}})}})};let eh=Promise.resolve();const At=(e,t)=>{const n=Ae();return T({get(){return a(n.currentRoute).query[e]||t},set(r){if(a(n.currentRoute).query[e]===r)return;eh=eh.then(async()=>{try{await n.replace({path:a(n.currentRoute).path,query:{...a(n.currentRoute).query,[e]:r}})}catch{}})}})},Xn=e=>{const t=At(e.name),n=Il(RT(e));return ze(()=>a(t)?{value:a(t),source:"route"}:a(n)?{value:a(n),source:"storage"}:{value:e.defaultValue,source:"default"},r=>{["route","default"].includes(r.source)&&(n.value=r.value===e.defaultValue?void 0:ot(r.value)),["storage","default"].includes(r.source)&&(t.value=r.value)},{immediate:!0}),t},RT=e=>["oc-options",e.storagePrefix,e.name].filter(Boolean).join("_"),vn=(e,...t)=>{const n=H(!1),r=Ae(),s=yt();return ze(s,()=>{n.value=e(r,...t)},{immediate:!0}),n},xi="contextRouteName",$l="contextRouteParams",Ol="contextRouteQuery",Ai=e=>{const{params:t,query:n}=e,r={},s=["fileId","shareId","q_share-visibility","page"].concat(e.meta?.contextQueryItems||[]);for(const o of s)r[o]=n[o];return{[xi]:e.name,[$l]:t,[Ol]:r}},th=e=>({routeName:ot(e[xi]),routeParams:e[$l],routeQuery:e[Ol]}),ot=e=>Array.isArray(e)?e[0].toString():e?.toString();function nh({router:e,currentFileContext:t}){const n=l=>{const{fileName:u,routeName:d,routeParams:c,routeQuery:f}=a(l);return a(d)?e.push({name:a(d),params:a(c),query:{...a(f),scrollTo:a(u)}}):e.push({path:"/"})},{replaceInvalidFileRoute:r}=Ci({router:e}),s=(l,u)=>{const d=a(l);return r({space:a(d.space),resource:u,path:a(d.item),fileId:a(d.itemId)})},o=H(!1);return{replaceInvalidFileRoute:s,closeApp:()=>(o.value=!0,n(t)),closed:o}}const Ee=()=>Gn("$clientService");function Ll({clientService:e}){e=e||Ee();const t=Ze();return{getUrlForResource:(l,u,d)=>e.webdav.getFileUrl(l,u,{username:t.user?.onPremisesSamAccountName,...d}),revokeUrl:l=>e.webdav.revokeUrl(l),getFileContents:(l,u)=>e.webdav.getFileContents(a(a(l).space),{path:a(a(l).item)},{...u}),getFileInfo:(l,u={})=>e.webdav.getFileInfo(a(a(l).space),{path:a(a(l).item),fileId:a(a(l).itemId)},u),putFileContents:(l,u)=>e.webdav.putFileContents(a(a(l).space),{path:a(a(l).item),...u})}}const _l=()=>Gn("$authService");class zr{static allFiles="all-files";static currentFolder="current-folder"}const Ml=()=>{const e=Qe(),t=Ee(),n=Ue(),r=Re(),s=Ct(),o=T(()=>s.searchContent?.enabled),i=T(()=>r.areHiddenFilesShown),l=T(()=>n.spaces.filter(z.isProjectSpaceResource)),u=p=>a(l).find(h=>h.id===p),d=Ft.useTask(function*(p,h,g=null){if(e.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:t.graphAuthenticated,signal:p})),!h)return{totalResults:null,values:[]};const{resources:m,totalResults:b}=yield*z.call(t.webdav.search(h,{searchLimit:g,davProperties:Qs.Default,signal:p}));return{totalResults:b,values:m.map(S=>{const k=u(S.parentFolderId),w=k||S;return e.options.routing.fullShareOwnerPaths&&w.remoteItemPath&&(w.path=z.urlJoin(w.remoteItemPath,w.path)),{id:w.id,data:w}}).filter(({data:S})=>!S.name.startsWith(".")||a(i))}}).restartable();return{search:async(p,h=null)=>await d.perform(p,h),buildSearchTerm:({term:p,isTitleOnlySearch:h,tags:g,lastModified:m,mediaType:b,scope:S,useScope:k})=>{const w=[],C=p,A=a(o)&&!h;if(C){let I=`name:"*${C}*"`;A&&(I=`(name:"*${C}*" OR content:"${C}")`),w.push(I)}if(k&&S&&w.push(`scope:${S}`),g){const I=g.split("+").map(N=>`"${N}"`);w.push(`tag:(${I.join(" OR ")})`)}if(m&&w.push(`mtime:${m}`),b){const I=b.split("+").map(N=>`"${N}"`);w.push(`mediatype:(${I.join(" OR ")})`)}return w.sort((I,N)=>Number(I.startsWith("scope:"))-Number(N.startsWith("scope:"))).join(" AND ")}}};function rh({currentRoute:e,clientService:t}){const n=H(!1),{webdav:r}=t,{replaceInvalidFileRoute:s}=Ci(),{getFileInfo:o}=Ll({clientService:t}),i=_l(),l=Ue(),{buildSearchTerm:u,search:d}=Ml(),c=At("contextRouteQuery"),f=Re(),{activeResources:p}=ve.storeToRefs(f);return{isFolderLoading:n,loadFolderForFileContext:async g=>{n.value=!0;try{if(g=a(g),a(c)?.term){const I=u({term:a(c)?.term}),{values:N}=await d(I,200),_=N.filter(({data:F})=>z.isSearchResource(F)).map(F=>F.data);f.initResourceList({currentFolder:null,resources:_}),n.value=!1;return}if(["files-shares-with-me","files-shares-with-others","files-shares-via-link","files-common-favorites"].includes(a(g.routeName))){await Lf.getTask().perform(),n.value=!1;return}f.clearResourceList();const b=a(g.space),S=await o(g,{davProperties:[Te.FileId]});if(s({space:b,resource:S,path:a(g.item),fileId:a(g.itemId)}),l.spaces.some(I=>z.isMountPointSpaceResource(I)&&I.root.remoteItem?.id===S.id)){const I=await o(g);f.initResourceList({currentFolder:I,resources:[I]}),n.value=!1;return}const w=We.dirname(S.path),{resource:C,children:A}=await r.listFiles(b,{path:w});C.type==="file"?f.initResourceList({currentFolder:C,resources:[C]}):f.initResourceList({currentFolder:C,resources:A})}catch(m){if(m.statusCode===401)return i.handleAuthError(a(e));f.setCurrentFolder(null),console.error(m)}n.value=!1},activeFiles:p}}function Nl({appsStore:e,applicationId:t}){return{applicationMeta:T(()=>{const r=e.apps[t];if(!r)throw new Error(`useAppConfig: could not find config for applicationId: ${t}`);return r||{}})}}const Sr=()=>Xe;function sh({titleSegments:e,eventBus:t}){const n=On(),{currentTheme:r}=ve.storeToRefs(n);t=t||Sr(),ze(e,s=>{const o=a(s),i=" - ",l={shortDocumentTitle:o.join(i),fullDocumentTitle:[...o,a(r).name].join(i)};t.publish("runtime.documentTitle.changed",l)},{immediate:!0,deep:!0})}function ET({appsStore:e,applicationId:t,applicationName:n,currentFileContext:r,currentRoute:s}){const o=Nl({applicationId:t,appsStore:e}),{$gettext:i}=de.useGettext(),l=T(()=>{const u=We.basename(a(a(r)?.fileName))||i(a(s)?.meta?.title||""),d=a(a(o).applicationMeta);return[u,a(n)||d.name||d.id].filter(Boolean)});sh({titleSegments:l})}function oh(e={}){const t=e.clientService??Ee(),n=e.authStore??yr();return{makeRequest:(s,o,i={})=>{const l=!n.accessToken||n.publicLinkContextReady?t.httpUnAuthenticated:t.httpAuthenticated,u=new ml({accessToken:n.accessToken,publicLinkToken:n.publicLinkToken,publicLinkPassword:n.publicLinkPassword});return i.method=s,i.url=o,i.headers={...u.getHeaders(),...i?.headers||{}},l.request(i)}}}const ih=()=>{const e=Ue();return{areSpacesLoading:T(()=>!e.spacesInitialized||e.spacesLoading)}},ah=(e={})=>{const t=Ue(),{areSpacesLoading:n}=ih(),r=At("shareId"),s=At("fileId"),o=T(()=>ot(a(s))),i=Qe(),l=Ee(),u=T(()=>t.spaces),d=H(null),c=H(null),f=H(!1),p=h=>{const g=h.split("/");return a(u).find(m=>{if(!h.startsWith(m.driveAlias))return!1;const b=m.driveAlias.split("/");return g.length<b.length||g.slice(0,b.length).join("/")!==m.driveAlias?!1:m})};return zo(()=>{const h=a(e.driveAliasAndItem);!h?.startsWith("personal/")&&!h?.startsWith("project/")&&t.setCurrentSpace(null)}),ze([e.driveAliasAndItem,n],async([h,g],[m,b])=>{if(h===m&&g===b)return;if(!h||h.startsWith("virtual/")){d.value=null,c.value=null;return}if(a(d)&&h.startsWith(a(d).driveAlias)){c.value=z.urlJoin(h.slice(a(d).driveAlias.length),{leadingSlash:!0});return}let k=null,w=null;if(h.startsWith("public/")||h.startsWith("ocm/")){const[C,...A]=h.split("/").slice(1);k=a(u).find(I=>I.id===C),w=A.join("/")}else if(h.startsWith("share/")||h.startsWith("ocm-share/")){const[C,...A]=h.split("/").slice(1),I=h.startsWith("ocm-share/")?"ocm-share":"share";let N=ot(a(r));N?.includes(":")&&(N=[z.SHARE_JAIL_ID,N].join("!")),k=t.getSpace(N)||t.createShareSpace({driveAliasPrefix:I,id:N,shareName:a(C)}),w=A.join("/")}else a(o)?k=a(u).find(C=>a(o).startsWith(`${C.fileId}`)):k=p(h),k||(!t.mountPointsInitialized&&i.options.routing.fullShareOwnerPaths&&(f.value=!0,await t.loadMountPoints({graphClient:l.graphAuthenticated})),k=p(h)),k&&(w=h.slice(k.driveAlias.length));d.value=k,c.value=z.urlJoin(w,{leadingSlash:!0}),f.value=!1},{immediate:!0,deep:!0}),ze(d,h=>{t.setCurrentSpace(h)},{immediate:!0}),{space:d,item:c,itemId:o,loading:f}};function lh(e){const t=Ae(),n=Pn(),r=yt(),s=e.clientService??Ee(),o=e.applicationId,i=yr(),{publicLinkContextReady:l}=ve.storeToRefs(i),u=Ti("driveAliasAndItem"),{space:d,item:c,itemId:f,loading:p}=ah({driveAliasAndItem:u}),h=T(()=>{if(a(p))return null;let g;return a(d)?g=z.urlJoin(a(d).webDavPath,a(c)):g=z.urlJoin(ot(a(r).params.filePath)),{path:g,driveAliasAndItem:a(u),space:a(d),item:a(c),itemId:a(f),fileName:We.basename(g),routeName:ot(a(r).query[xi]),...th(a(r).query)}});return ET({appsStore:n,applicationId:o,applicationName:e.applicationName,currentFileContext:h,currentRoute:r}),{isPublicLinkContext:l,currentFileContext:h,...Gd({appsStore:n,...e}),...nh({router:t,currentFileContext:h}),...Ll({clientService:s}),...rh({clientService:s,currentRoute:r}),...oh({clientService:s,currentRoute:a(r)})}}const DT=e=>({meta:{...e.meta,authContext:"anonymous"},path:e.path,redirect:t=>{const n=e.redirect(t);return console.warn(`route "${e.path}" is deprecated, use "${String(n.path)||String(n.name)}" instead.`),n}}),FT=()=>[{path:"/list",redirect:e=>gn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:"personal/home"}})},{path:"/list/all/:item(.*)",redirect:e=>gn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:z.urlJoin("personal/home",ot(e.params.item),{leadingSlash:!1})}})},{path:"/list/favorites",redirect:e=>cs("files-common-favorites",e)},{path:"/list/shared-with-me",redirect:e=>tn("files-shares-with-me",e)},{path:"/list/shared-with-others",redirect:e=>tn("files-shares-with-others",e)},{path:"/list/shared-via-link",redirect:e=>tn("files-shares-via-link",e)},{path:"/trash-bin",redirect:e=>gr("files-trash-generic",e)},{path:"/public/list/:item(.*)",redirect:e=>us("files-public-link",e)},{path:"/private-link/:fileId",redirect:e=>({name:"resolvePrivateLink",params:{fileId:e.params.fileId}})},{path:"/public-link/:token",redirect:e=>({name:"resolvePublicLink",params:{token:e.params.token}})}].map(DT),IT=(e,...t)=>{const[n,...r]=t.map(s=>{const o={"files-personal":gn("files-spaces-generic").name,"files-favorites":cs("files-common-favorites").name,"files-shared-with-others":tn("files-shares-with-others").name,"files-shared-with-me":tn("files-shares-with-me").name,"files-trashbin ":gr("files-trash-generic").name,"files-public-list":us("files-public-link").name}[s.name.toString()];return o&&console.warn(`route name "${name}" is deprecated, use "${o.toString()}" instead.`),{...s,...!!o&&{name:o}}});return tl(e,n,...r)},PT={name:"root",path:"/",redirect:e=>gn("files-spaces-generic",e)},$T=e=>[PT,...sS(e),...aS(e),...lS(e),...oS(e),...cS(e),...FT()],Ri=()=>{const e=Ee();return{getDefaultMetaFolder:async n=>{const{children:r}=await e.webdav.listFiles(n);return r.find(({name:s})=>s===".space")}}},Rt=e=>{const t=Ze(),n=Ue(),r=Qe(),s=T(()=>n.spaces),o=Ti("driveAliasAndItem"),i=f=>a(e?.space)||a(s).find(p=>p.id===f),l=f=>{let p=f.storageId;(a(o)?.startsWith("public/")||a(o)?.startsWith("ocm/"))&&(p=a(o).split("/")[1]);const h=i(p);if(h&&!z.isMountPointSpaceResource(h))return h;const g=z.isShareResource(f)&&f.shareTypes.includes(z.ShareTypes.remote.value)||f?.id?.toString().startsWith(z.OCM_PROVIDER_ID)?"ocm-share":"share";let m;return f.remoteItemPath?m=We.basename(f.remoteItemPath):a(o)?.startsWith("share/")||a(o)?.startsWith("ocm-share/")?m=a(o).split("/")[1]:m=f.name,n.getSpace(f.remoteItemId)||n.createShareSpace({driveAliasPrefix:g,id:f.remoteItemId,shareName:m})},u=f=>a(s).filter(p=>z.isMountPointSpaceResource(p)&&z.extractStorageId(p.root.remoteItem.rootId)===f.id);return{getInternalSpace:i,getMatchingSpace:l,isPersonalSpaceRoot:f=>f?.storageId&&f?.storageId===n.personalSpace?.storageId&&f?.path==="/"&&!z.isIncomingShareResource(f),isResourceAccessible:({space:f,path:p})=>{if(!r.options.routing.fullShareOwnerPaths)return!0;const h=a(s).some(m=>z.isProjectSpaceResource(m)&&m.id===f.id);return f.isOwner(t.user)||h||u(f).some(m=>p.startsWith(m.root.remoteItem.path))}}},ms=()=>{const e=Ee(),t=Re(),{$gettext:n}=de.useGettext(),r=Ue(),{upsertResource:s}=Re(),{showMessage:o,showErrorMessage:i}=Me(),l=c=>{const{graphAuthenticated:f}=e;return f.drives.createDrive({name:c},{params:{template:"default"}})};return{createSpace:l,createDefaultMetaFolder:async c=>{const f=await e.webdav.createFolder(c,{path:".space"});return z.extractStorageId(f.parentFolderId)===t.currentFolder?.id&&t.upsertResource(f),f},addNewSpace:async c=>{try{const f=await l(c);return s(f),r.upsertSpace(f),o({title:n("Space was created successfully")}),f}catch(f){console.error(f),i({title:n("Creating space failed…"),errors:[f]})}}}},Nt=()=>Gn("$loadingService"),Ei=()=>{const e=yr(),t=Ee(),n=de.useGettext();return{headers:T(()=>{const s=new ml({accessToken:e.accessToken,publicLinkToken:e.publicLinkToken,publicLinkPassword:e.publicLinkPassword});return{"Accept-Language":n.current,"Initiator-ID":t.initiatorId,"X-Request-ID":wt.v4(),...s.getHeaders()}})}};function OT(e){return new Worker("/assets/worker-DJbU-qfq.js",{name:e?.name})}const ch=({concurrentRequests:e=4}={})=>{const t=Qe(),n=Nt(),{headers:r}=Ei(),{createWorker:s,terminateWorker:o}=no(),i=({topic:u,space:d,resources:c},f)=>{const p=s(OT,{needsTokenRenewal:!0});let h;a(p.worker).onmessage=g=>{o(p.id),h?.(!0);const{successful:m,failed:b}=JSON.parse(g.data),S=b.map(({resource:k,...w})=>({resource:k,error:z.createHttpError(w)}));f({successful:m,failed:S})},n.addTask(()=>new Promise(g=>{h=g})),p.post(l({topic:u,space:d,resources:c}))},l=({topic:u,space:d,resources:c})=>JSON.stringify({topic:u,data:{space:d,resources:c,concurrentRequests:e,baseUrl:t.serverUrl,headers:{...a(r),"X-Request-ID":void 0}}});return{startWorker:i}};function LT(e){return new Worker("/assets/worker-DyU7W9CZ.js",{name:e?.name})}const uh=()=>{const e=Qe(),t=Nt(),{headers:n}=Ei(),{createWorker:r,terminateWorker:s}=no(),o=(l,u)=>{const d=r(LT,{needsTokenRenewal:!0});let c;a(d.worker).onmessage=f=>{s(d.id),c?.(!0);const{successful:p,failed:h}=JSON.parse(f.data),g=h.map(({resourceName:m,...b})=>({resourceName:m,error:z.createHttpError(b)}));u({successful:p,failed:g})},t.addTask(()=>new Promise(f=>{c=f})),d.post(i(l))},i=l=>JSON.stringify({topic:"startProcess",data:{transferData:l,baseUrl:e.serverUrl,headers:{...a(n),"X-Request-ID":void 0}}});return{startWorker:o}};function _T(e){return new Worker("/assets/worker-CVwKToFD.js",{name:e?.name})}const dh=()=>{const e=Qe(),t=Nt(),{headers:n}=Ei(),{createWorker:r,terminateWorker:s}=no(),o=({space:l,resources:u,missingFolderPaths:d},c)=>{const f=r(_T,{needsTokenRenewal:!0});let p;a(f.worker).onmessage=h=>{s(f.id),p?.(!0);const{successful:g,failed:m}=JSON.parse(h.data),b=m.map(({resource:S,...k})=>({resource:S,error:z.createHttpError(k)}));c({successful:g,failed:b})},t.addTask(()=>new Promise(h=>{p=h})),f.post(i({space:l,resources:u,missingFolderPaths:d}))},i=({space:l,resources:u,missingFolderPaths:d})=>JSON.stringify({topic:"startProcess",data:{space:l,resources:u,missingFolderPaths:d,baseUrl:e.serverUrl,headers:{...a(n),"X-Request-ID":void 0}}});return{startWorker:o}};function MT(e){return new Worker("/assets/worker-BBQqm_-D.js",{name:e?.name})}const NT=({authService:e})=>{const{createWorker:t}=no(),n=H();return{startWorker:()=>{n.value=t(MT),a(a(n).worker).onmessage=()=>{e.signinSilent().catch(async i=>{if(i instanceof kg.ErrorTimeout){console.warn("token renewal timed out, retrying in 5 seconds..."),a(n).post(JSON.stringify({topic:"set",expiry:5,expiryThreshold:0}));return}if(console.error("token renewal error:",i),!await e.getRefreshToken())return e.logoutUser()})}},setTokenTimer:({expiry:i,expiryThreshold:l})=>{if(!a(n)){console.error("token timer worker is not running");return}a(n).post(JSON.stringify({topic:"set",expiry:i,expiryThreshold:l}))},resetTokenTimer:()=>{if(!a(n)){console.error("token timer worker is not running");return}a(n).post(JSON.stringify({topic:"reset"}))}}};function BT(e){return e==null}const bn=()=>{const e=Pn(),t=Ae(),n=Zi(),{isEnabled:r}=wr(),{requestExtensions:s}=br(),o=rr(),{openUrl:i}=Im(),l=Qe(),{options:u}=ve.storeToRefs(l),{actions:d}=Gi(),{actions:c}=Yi(),{actions:f}=Di(),{actions:p}=mo(),{actions:h}=Qi(),{actions:g}=Ki(),{actions:m}=ws(),{actions:b}=bm(),{actions:S}=rc(),{actions:k}=Ji(),{actions:w}=im(),{actions:C}=Xi(),{actions:A}=go(),{actions:I}=tc(),N=T(()=>[...a(g),...a(m),...a(p),...a(k),...a(f),...a(C),...a(I),...a(A),...a(d),...a(c),...a(h),...a(S)]),_=T(()=>(s({id:"global.files.context-actions",extensionType:"action"})||[]).map(j=>j.action).filter(j=>BT(j.category)||j.category==="context"||j.category==="actions")),F=T(()=>a(r)?[]:e.fileExtensions.map(j=>{const B=e.apps[j.app];return{name:`editor-${j.app}`,label:()=>j.label?typeof j.label=="function"?j.label():j.label:B.name,icon:j.icon||B.icon,...B.iconFillType&&{iconFillType:B.iconFillType},img:B.img,route:({space:q,resources:re})=>V({appFileExtension:j,space:q,resource:re[0]}),handler:q=>P(j,q.space,q.resources[0]),isVisible:({resources:q})=>!a(o)||q.length!==1||!q[0].canDownload()&&!j.secureView||!a(n)&&jt(t,"files-trash-generic")?!1:q[0].extension&&j.extension?q[0].extension.toLowerCase()===j.extension.toLowerCase():q[0].mimeType&&j.mimeType?q[0].mimeType.toLowerCase()===j.mimeType.toLowerCase()||q[0].mimeType.split("/")[0].toLowerCase()===j.mimeType.toLowerCase():!1,hasPriority:j.hasPriority,class:`oc-files-actions-${Hp(B.name).toLowerCase()}-trigger`}}).sort((j,B)=>B.hasPriority!==j.hasPriority&&B.hasPriority?1:0)),V=({appFileExtension:j,space:B,resource:q})=>{const re=z.isShareSpaceResource(B)?B.id:void 0;let J=j.routeName;if(J&&!t.hasRoute(J))return console.warn(`App "${j.app}" specifies routeName "${J}" but no such route exists.`),null;if(J=J||j.app,!J||!t.hasRoute(J))return null;const oe=Z(J,B,q,re);return t.resolve(oe)},Z=(j,B,q,re,J)=>({name:j,params:{driveAliasAndItem:B?.getDriveAliasAndItem(q)},query:{...re&&{shareId:re},...q.fileId&&a(u).routing.idBased&&{fileId:q.fileId},...J&&{templateId:J},...Ai(a(t.currentRoute))}}),P=(j,B,q)=>{const re=z.isShareSpaceResource(B)?B.id:void 0,J=j.routeName||j.app,oe=Z(J,B,q,re);if(a(u).cernFeatures){const ne=t.resolve(oe).href,pe=`${j.routeName}-${q.path}`;i(ne,pe,!0);return}t.push(oe)},$=j=>{const B=L(j);B&&B.handler({...j})},L=j=>{const B=M(j);if(B.length)return B[0].name===a(m)[0].name?a(b)[0]:B[0]},M=j=>{const B=J=>J.isVisible(j),q=[...a(_),...a(F),...a(w)].filter(B).sort((J,oe)=>Number(oe.hasPriority)-Number(J.hasPriority)),re=j.omitSystemActions?[]:a(N).filter(B);return[...q,...re]};return{getDefaultAction:L,getAllOpenWithActions:M,getEditorRouteOpts:Z,openEditor:P,triggerDefaultAction:$}},Di=()=>{const e=Qe(),t=Ae(),{copyResources:n}=Zs(),r=de.useGettext(),{$gettext:s}=r,o=Re(),{currentFolder:i}=ve.storeToRefs(o),l=T(()=>Ys()?s("⌘ + C"):s("Ctrl + C")),u=({resources:c})=>{mt(t,"files-common-search")&&(c=c.filter(f=>!z.isProjectSpaceResource(f))),n(c)};return{actions:T(()=>[{name:"copy",icon:"file-copy-2",handler:u,shortcut:a(l),label:()=>s("Copy"),isVisible:({resources:c})=>{if(!rt(t,"files-spaces-generic")&&!nn(t,"files-public-link")&&!mt(t,"files-common-favorites")&&!mt(t,"files-common-search")||rt(t,"files-spaces-projects")||c.length===0)return!1;if(nn(t,"files-public-link"))return a(i)?.canCreate();if(mt(t,"files-common-search")&&c.every(f=>z.isProjectSpaceResource(f)))return!1;if(a(e.options.runningOnEos)){const f=c[0].path?.split("/").filter(Boolean)||[];if(rt(t,"files-spaces-generic")&&f.length<5)return!1}return!!a(c)[0].canDownload()},class:"oc-files-actions-copy-trigger"}])}};var Ln=(e=>(e.C="c",e.V="v",e.X="x",e.A="a",e.S="s",e.Z="z",e.Plus="+",e.Minus="-",e.Space=" ",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.Esc="Escape",e.Backspace="Backspace",e.Delete="Delete",e))(Ln||{}),Fi=(e=>(e.Ctrl="Control",e.Shift="Shift",e))(Fi||{});const jT=()=>{const e=document.activeElement.tagName,t=document.activeElement.getAttribute("type");if(["textarea","input","select"].includes(e.toLowerCase())&&t!=="checkbox")return!0;const n=document.activeElement;if(!n)return!1;let r;try{r=n?.closest("[data-custom-key-bindings-disabled='true']")}catch{r=n?.parentElement.closest("[data-custom-key-bindings-disabled='true']")}return r?!0:window.getSelection().type==="Range"},Ii=e=>{const t=H([]),n=H(0),r=l=>{if(!e?.skipDisabledKeyBindingsCheck&&jT())return;const{key:u,ctrlKey:d,metaKey:c,shiftKey:f}=l;let p=null;const h=[];c||d?(p="Control",h.push("altKey","shiftKey")):f&&(p="Shift",h.push("altKey","ctrlKey","metaKey")),!((m,b)=>b.some(S=>m[S]))(l,h)&&a(t).filter(m=>m.primary===u&&m.modifier===p).forEach(m=>{m.preventDefault&&l.preventDefault(),m.callback(l)})},s=(l,u,{preventDefault:d=!0}={})=>{const c=wt.v4();return t.value.push({id:c,...l,modifier:l.modifier??null,preventDefault:d,callback:u}),c},o=l=>{t.value=t.value.filter(u=>u.id!==l)},i=()=>{n.value=0};return Cn.useEventListener(document,"keydown",r),{actions:t,bindKeyAction:s,removeKeyAction:o,selectionCursor:n,resetSelectionCursor:i}};function Vr(){return{interceptModifierClick:(t,n)=>{if(!t||!n)return!1;const r=t.shiftKey,s=t.ctrlKey||t.metaKey;return!r&&!s?!1:(t.stopPropagation?.(),t.stopImmediatePropagation?.(),r&&Xe.publish("app.files.list.clicked.shift",{resource:n,skipTargetSelection:!1}),s&&Xe.publish("app.files.list.clicked.meta",n),!0)}}}const Bl=()=>{const e=Ii(),t=10,n=.1;return{setCropperInstance:s=>{e.bindKeyAction({primary:Ln.ArrowRight},()=>a(s)?.move(-t,0)),e.bindKeyAction({primary:Ln.ArrowLeft},()=>a(s)?.move(t,0)),e.bindKeyAction({primary:Ln.ArrowDown},()=>a(s)?.move(0,-t)),e.bindKeyAction({primary:Ln.ArrowUp},()=>a(s)?.move(0,t)),e.bindKeyAction({primary:Ln.Plus},()=>a(s)?.zoom(n)),e.bindKeyAction({primary:Ln.Minus},()=>a(s)?.zoom(-n))}}},jl=()=>{const{showMessage:e,showErrorMessage:t}=Me(),{$gettext:n}=de.useGettext(),{copy:r}=Cn.useClipboard(),{interceptModifierClick:s}=Vr(),o=async l=>{try{await r(l),e({title:n("The link has been copied to your clipboard.")})}catch(u){t({title:n("Copy link failed"),errors:[u]})}};return{actions:T(()=>[{name:"copy-permanent-link",icon:"link",label:()=>n("Copy permanent link"),handler:l=>{const{resources:u,event:d}=l,c=u[0];if(!(d&&s(d,c)))return o(c.privateLink)},isVisible:({space:l,resources:u})=>!(u.length!==1||z.isPublicSpaceResource(l)||z.isTrashResource(u[0])),class:"oc-files-actions-copy-permanent-link-trigger"}])}},ro={};function zT(e){return e.getIsPending!==void 0}function VT(e){if(zT(e))return e;let t=!0,n=e.then(r=>(t=!1,r),r=>{throw t=!1,r});return n.getIsPending=function(){return t},n}function UT(e){let t={};const n=e.attributes;if(!n)return t;for(let r=n.length-1;r>=0;r--)t[n[r].name]=n[r].value;return t}function qT(e){return Object.keys(e).reduce((t,n)=>(e[n]!==!1&&e[n]!==null&&e[n]!==void 0&&(t[n]=e[n]),t),{})}function HT(e,t){const{class:n,style:r,...s}=UT(e),{class:o,style:i,...l}=qT(t);return{class:[n,o],style:[r,i],...s,...l}}const fh=ge({inheritAttrs:!1,__name:"InlineSvg",props:{src:{},title:{default:void 0},transformSource:{type:Function,default:e=>e},keepDuringLoading:{type:Boolean,default:!0},uniqueIds:{type:[Boolean,String],default:!1},uniqueIdsBase:{default:""}},emits:["loaded","unloaded","error"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=qo(),i=H(),l=H(),u=H(),d=Math.random().toString(36).substring(2);t({svgElSource:i,request:u}),ze(()=>r.src,b=>{f(b)}),f(r.src);function c(b){if(b=b.cloneNode(!0),r.uniqueIds){const S=typeof r.uniqueIds=="string"?r.uniqueIds:d;b=m(b,S,r.uniqueIdsBase)}return b=r.transformSource(b),r.title&&g(b,r.title),b.innerHTML}function f(b){ro[b]||(ro[b]=p(b)),i.value&&ro[b].getIsPending()&&!r.keepDuringLoading&&(i.value=null,s("unloaded")),ro[b].then(S=>{i.value=S,St(()=>{s("loaded",l.value)})}).catch(S=>{i.value&&(i.value=void 0,s("unloaded")),delete ro[b],s("error",S)})}function p(b){return VT(new Promise((S,k)=>{const w=new XMLHttpRequest;w.open("GET",b,!0),u.value=w,w.onload=()=>{if(w.status>=200&&w.status<400)try{let C=new DOMParser().parseFromString(w.responseText,"text/xml").getElementsByTagName("svg")[0];C?S(C):k(new Error('Loaded file is not valid SVG"'))}catch(C){k(C)}else k(new Error("Error loading SVG"))},w.onerror=k,w.send()}))}const h=()=>i.value?Xo("svg",{...HT(i.value,o),innerHTML:c(i.value),ref:l}):null;function g(b,S){const k=b.getElementsByTagName("title");if(k.length)k[0].textContent=S;else{const w=document.createElementNS("http://www.w3.org/2000/svg","title");w.textContent=S,b.insertBefore(w,b.firstChild)}}function m(b,S,k=""){const w=["id","href","xlink:href","xlink:role","xlink:arcrole"],C=["href","xlink:href"],A=(I,N)=>C.includes(I)&&(N?!N.includes("#"):!1);return[...b.children].forEach(I=>{var N;if((N=I.attributes)!=null&&N.length){const _=Object.values(I.attributes).map(F=>{const V=/url\((.*?)\)/.exec(F.value);return V!=null&&V[1]&&(F.value=F.value.replace(V[0],`url(${k}${V[1]}_${S})`)),F});w.forEach(F=>{const V=_.find(Z=>Z.name===F);V&&!A(F,V.value)&&(V.value=`${V.value}_${S}`)})}return I.children.length?m(I,S,k):I}),b}return(b,S)=>(D(),ee(h))}}),Yn=ge({__name:"OcIcon",props:{accessibleLabel:{default:""},color:{default:""},fillType:{default:"fill"},name:{default:"info"},size:{default:"medium"},type:{default:"span"}},emits:["loaded"],setup(e,{emit:t}){fh.name="inline-svg";const n=t,r=T(()=>Mr("oc-icon-title-")),s=T(()=>{const l=`${FS()}icons/`,u=e.fillType.toLowerCase();return u==="none"?`${l}${e.name}.svg`:`${l}${e.name}-${u}.svg`}),o=T(()=>({"size-3":e.size==="xsmall","size-4":e.size==="small","size-5":e.size==="medium","size-8":e.size==="large","size-12":e.size==="xlarge","size-22":e.size==="xxlarge","size-42":e.size==="xxxlarge"})),i=l=>{if(e.accessibleLabel!==""){const u=document.createElement("title");u.setAttribute("id",r.value),u.appendChild(document.createTextNode(e.accessibleLabel)),l.insertBefore(u,l.firstChild)}return l};return(l,u)=>(D(),ee(Yt(e.type),{class:R.normalizeClass(["oc-icon","box-content","inline-block","align-baseline","[&_svg]:block",o.value,{"bg-transparent min-h-0":e.type==="button"}])},{default:X(()=>[Q(a(fh),{src:s.value,"transform-source":i,"aria-hidden":e.accessibleLabel===""?"true":null,"aria-labelledby":e.accessibleLabel===""?null:r.value,focusable:e.accessibleLabel===""?"false":null,style:R.normalizeStyle(e.color!==""?{fill:e.color}:{}),class:R.normalizeClass(o.value),onLoaded:u[0]||(u[0]=d=>n("loaded"))},null,8,["src","aria-hidden","aria-labelledby","focusable","style","class"])]),_:1},8,["class"]))}});var ph=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Pi=ph.join(","),hh=typeof Element>"u",Ur=hh?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,$i=!hh&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Oi=function(t,n){var r;n===void 0&&(n=!0);var s=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=s===""||s==="true",i=o||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Oi(t.parentNode));return i},WT=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},mh=function(t,n,r){if(Oi(t))return[];var s=Array.prototype.slice.apply(t.querySelectorAll(Pi));return n&&Ur.call(t,Pi)&&s.unshift(t),s=s.filter(r),s},Li=function(t,n,r){for(var s=[],o=Array.from(t);o.length;){var i=o.shift();if(!Oi(i,!1))if(i.tagName==="SLOT"){var l=i.assignedElements(),u=l.length?l:i.children,d=Li(u,!0,r);r.flatten?s.push.apply(s,d):s.push({scopeParent:i,candidates:d})}else{var c=Ur.call(i,Pi);c&&r.filter(i)&&(n||!t.includes(i))&&s.push(i);var f=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),p=!Oi(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(f&&p){var h=Li(f===!0?i.children:f.children,!0,r);r.flatten?s.push.apply(s,h):s.push({scopeParent:i,candidates:h})}else o.unshift.apply(o,i.children)}}return s},gh=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},qr=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||WT(t))&&!gh(t)?0:t.tabIndex},QT=function(t,n){var r=qr(t);return r<0&&n&&!gh(t)?0:r},KT=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},yh=function(t){return t.tagName==="INPUT"},GT=function(t){return yh(t)&&t.type==="hidden"},JT=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},XT=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},YT=function(t){if(!t.name)return!0;var n=t.form||$i(t),r=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},s;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")s=r(window.CSS.escape(t.name));else try{s=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var o=XT(s,t.form);return!o||o===t},ZT=function(t){return yh(t)&&t.type==="radio"},ex=function(t){return ZT(t)&&!YT(t)},tx=function(t){var n,r=t&&$i(t),s=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var i,l,u;for(o=!!((i=s)!==null&&i!==void 0&&(l=i.ownerDocument)!==null&&l!==void 0&&l.contains(s)||t!=null&&(u=t.ownerDocument)!==null&&u!==void 0&&u.contains(t));!o&&s;){var d,c,f;r=$i(s),s=(d=r)===null||d===void 0?void 0:d.host,o=!!((c=s)!==null&&c!==void 0&&(f=c.ownerDocument)!==null&&f!==void 0&&f.contains(s))}}return o},vh=function(t){var n=t.getBoundingClientRect(),r=n.width,s=n.height;return r===0&&s===0},nx=function(t,n){var r=n.displayCheck,s=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(t).visibility==="hidden")return!0;var i=Ur.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if(Ur.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof s=="function"){for(var u=t;t;){var d=t.parentElement,c=$i(t);if(d&&!d.shadowRoot&&s(d)===!0)return vh(t);t.assignedSlot?t=t.assignedSlot:!d&&c!==t.ownerDocument?t=c.host:t=d}t=u}if(tx(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return vh(t);return!1},rx=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var s=n.children.item(r);if(s.tagName==="LEGEND")return Ur.call(n,"fieldset[disabled] *")?!0:!s.contains(t)}return!0}n=n.parentElement}return!1},_i=function(t,n){return!(n.disabled||GT(n)||nx(n,t)||JT(n)||rx(n))},zl=function(t,n){return!(ex(n)||qr(n)<0||!_i(t,n))},sx=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},bh=function(t){var n=[],r=[];return t.forEach(function(s,o){var i=!!s.scopeParent,l=i?s.scopeParent:s,u=QT(l,i),d=i?bh(s.candidates):l;u===0?i?n.push.apply(n,d):n.push(l):r.push({documentOrder:o,tabIndex:u,item:s,isScope:i,content:d})}),r.sort(KT).reduce(function(s,o){return o.isScope?s.push.apply(s,o.content):s.push(o.content),s},[]).concat(n)},ox=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Li([t],n.includeContainer,{filter:zl.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:sx}):r=mh(t,n.includeContainer,zl.bind(null,n)),bh(r)},ix=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Li([t],n.includeContainer,{filter:_i.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=mh(t,n.includeContainer,_i.bind(null,n)),r},gs=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Ur.call(t,Pi)===!1?!1:zl(n,t)},ax=ph.concat("iframe:not([inert]):not([inert] *)").join(","),Vl=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Ur.call(t,ax)===!1?!1:_i(n,t)};function Ul(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function lx(e){if(Array.isArray(e))return Ul(e)}function wh(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Ch(e))||t){n&&(e=n);var r=0,s=function(){};return{s,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
10
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return i=u.done,u},e:function(u){l=!0,o=u},f:function(){try{i||n.return==null||n.return()}finally{if(l)throw o}}}}function cx(e,t,n){return(t=hx(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ux(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dx(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
11
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function kh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Sh(Object(n),!0).forEach(function(r){cx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sh(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fx(e){return lx(e)||ux(e)||Ch(e)||dx()}function px(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hx(e){var t=px(e,"string");return typeof t=="symbol"?t:t+""}function Ch(e,t){if(e){if(typeof e=="string")return Ul(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ul(e,t):void 0}}var Zn={getActiveTrap:function(t){return t?.length>0?t[t.length-1]:null},activateTrap:function(t,n){var r=Zn.getActiveTrap(t);n!==r&&Zn.pauseTrap(t);var s=t.indexOf(n);s===-1||t.splice(s,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),Zn.unpauseTrap(t)},pauseTrap:function(t){var n=Zn.getActiveTrap(t);n?._setPausedState(!0)},unpauseTrap:function(t){var n=Zn.getActiveTrap(t);n&&!n._isManuallyPaused()&&n._setPausedState(!1)}},mx=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},gx=function(t){return t?.key==="Escape"||t?.key==="Esc"||t?.keyCode===27},so=function(t){return t?.key==="Tab"||t?.keyCode===9},yx=function(t){return so(t)&&!t.shiftKey},vx=function(t){return so(t)&&t.shiftKey},Th=function(t){return setTimeout(t,0)},oo=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return typeof t=="function"?t.apply(void 0,r):t},Mi=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},bx=[],wx=function(t,n){var r=n?.document||document,s=n?.trapStack||bx,o=kh({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:yx,isKeyBackward:vx},n),i={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},l,u=function(L,M,j){return L&&L[M]!==void 0?L[M]:o[j||M]},d=function(L,M){var j=typeof M?.composedPath=="function"?M.composedPath():void 0;return i.containerGroups.findIndex(function(B){var q=B.container,re=B.tabbableNodes;return q.contains(L)||j?.includes(q)||re.find(function(J){return J===L})})},c=function(L){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},j=M.hasFallback,B=j===void 0?!1:j,q=M.params,re=q===void 0?[]:q,J=o[L];if(typeof J=="function"&&(J=J.apply(void 0,fx(re))),J===!0&&(J=void 0),!J){if(J===void 0||J===!1)return J;throw new Error("`".concat(L,"` was specified but was not a node, or did not return a node"))}var oe=J;if(typeof J=="string"){try{oe=r.querySelector(J)}catch(ne){throw new Error("`".concat(L,'` appears to be an invalid selector; error="').concat(ne.message,'"'))}if(!oe&&!B)throw new Error("`".concat(L,"` as selector refers to no known node"))}return oe},f=function(){var L=c("initialFocus",{hasFallback:!0});if(L===!1)return!1;if(L===void 0||L&&!Vl(L,o.tabbableOptions))if(d(r.activeElement)>=0)L=r.activeElement;else{var M=i.tabbableGroups[0],j=M&&M.firstTabbableNode;L=j||c("fallbackFocus")}else L===null&&(L=c("fallbackFocus"));if(!L)throw new Error("Your focus-trap needs to have at least one focusable element");return L},p=function(){if(i.containerGroups=i.containers.map(function(L){var M=ox(L,o.tabbableOptions),j=ix(L,o.tabbableOptions),B=M.length>0?M[0]:void 0,q=M.length>0?M[M.length-1]:void 0,re=j.find(function(ne){return gs(ne)}),J=j.slice().reverse().find(function(ne){return gs(ne)}),oe=!!M.find(function(ne){return qr(ne)>0});return{container:L,tabbableNodes:M,focusableNodes:j,posTabIndexesFound:oe,firstTabbableNode:B,lastTabbableNode:q,firstDomTabbableNode:re,lastDomTabbableNode:J,nextTabbableNode:function(pe){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,we=M.indexOf(pe);return we<0?fe?j.slice(j.indexOf(pe)+1).find(function($e){return gs($e)}):j.slice(0,j.indexOf(pe)).reverse().find(function($e){return gs($e)}):M[we+(fe?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(L){return L.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find(function(L){return L.posTabIndexesFound})&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function(L){var M=L.activeElement;if(M)return M.shadowRoot&&M.shadowRoot.activeElement!==null?h(M.shadowRoot):M},g=function(L){if(L!==!1&&L!==h(document)){if(!L||!L.focus){g(f());return}L.focus({preventScroll:!!o.preventScroll}),i.mostRecentlyFocusedNode=L,mx(L)&&L.select()}},m=function(L){var M=c("setReturnFocus",{params:[L]});return M||(M===!1?!1:L)},b=function(L){var M=L.target,j=L.event,B=L.isBackward,q=B===void 0?!1:B;M=M||Mi(j),p();var re=null;if(i.tabbableGroups.length>0){var J=d(M,j),oe=J>=0?i.containerGroups[J]:void 0;if(J<0)q?re=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:re=i.tabbableGroups[0].firstTabbableNode;else if(q){var ne=i.tabbableGroups.findIndex(function(ae){var ue=ae.firstTabbableNode;return M===ue});if(ne<0&&(oe.container===M||Vl(M,o.tabbableOptions)&&!gs(M,o.tabbableOptions)&&!oe.nextTabbableNode(M,!1))&&(ne=J),ne>=0){var pe=ne===0?i.tabbableGroups.length-1:ne-1,fe=i.tabbableGroups[pe];re=qr(M)>=0?fe.lastTabbableNode:fe.lastDomTabbableNode}else so(j)||(re=oe.nextTabbableNode(M,!1))}else{var we=i.tabbableGroups.findIndex(function(ae){var ue=ae.lastTabbableNode;return M===ue});if(we<0&&(oe.container===M||Vl(M,o.tabbableOptions)&&!gs(M,o.tabbableOptions)&&!oe.nextTabbableNode(M))&&(we=J),we>=0){var $e=we===i.tabbableGroups.length-1?0:we+1,he=i.tabbableGroups[$e];re=qr(M)>=0?he.firstTabbableNode:he.firstDomTabbableNode}else so(j)||(re=oe.nextTabbableNode(M))}}else re=c("fallbackFocus");return re},S=function(L){var M=Mi(L);if(!(d(M,L)>=0)){if(oo(o.clickOutsideDeactivates,L)){l.deactivate({returnFocus:o.returnFocusOnDeactivate});return}oo(o.allowOutsideClick,L)||L.preventDefault()}},k=function(L){var M=Mi(L),j=d(M,L)>=0;if(j||M instanceof Document)j&&(i.mostRecentlyFocusedNode=M);else{L.stopImmediatePropagation();var B,q=!0;if(i.mostRecentlyFocusedNode)if(qr(i.mostRecentlyFocusedNode)>0){var re=d(i.mostRecentlyFocusedNode),J=i.containerGroups[re].tabbableNodes;if(J.length>0){var oe=J.findIndex(function(ne){return ne===i.mostRecentlyFocusedNode});oe>=0&&(o.isKeyForward(i.recentNavEvent)?oe+1<J.length&&(B=J[oe+1],q=!1):oe-1>=0&&(B=J[oe-1],q=!1))}}else i.containerGroups.some(function(ne){return ne.tabbableNodes.some(function(pe){return qr(pe)>0})})||(q=!1);else q=!1;q&&(B=b({target:i.mostRecentlyFocusedNode,isBackward:o.isKeyBackward(i.recentNavEvent)})),g(B||i.mostRecentlyFocusedNode||f())}i.recentNavEvent=void 0},w=function(L){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=L;var j=b({event:L,isBackward:M});j&&(so(L)&&L.preventDefault(),g(j))},C=function(L){(o.isKeyForward(L)||o.isKeyBackward(L))&&w(L,o.isKeyBackward(L))},A=function(L){gx(L)&&oo(o.escapeDeactivates,L)!==!1&&(L.preventDefault(),l.deactivate())},I=function(L){var M=Mi(L);d(M,L)>=0||oo(o.clickOutsideDeactivates,L)||oo(o.allowOutsideClick,L)||(L.preventDefault(),L.stopImmediatePropagation())},N=function(){if(i.active)return Zn.activateTrap(s,l),i.delayInitialFocusTimer=o.delayInitialFocus?Th(function(){g(f())}):g(f()),r.addEventListener("focusin",k,!0),r.addEventListener("mousedown",S,{capture:!0,passive:!1}),r.addEventListener("touchstart",S,{capture:!0,passive:!1}),r.addEventListener("click",I,{capture:!0,passive:!1}),r.addEventListener("keydown",C,{capture:!0,passive:!1}),r.addEventListener("keydown",A),l},_=function(L){i.active&&!i.paused&&l._setSubtreeIsolation(!1),i.adjacentElements.clear(),i.alreadySilent.clear();var M=new Set,j=new Set,B=wh(L),q;try{for(B.s();!(q=B.n()).done;){var re=q.value;M.add(re);for(var J=typeof ShadowRoot<"u"&&re.getRootNode()instanceof ShadowRoot,oe=re;oe;){M.add(oe);var ne=oe.parentElement,pe=[];ne?pe=ne.children:!ne&&J&&(pe=oe.getRootNode().children,ne=oe.getRootNode().host,J=typeof ShadowRoot<"u"&&ne.getRootNode()instanceof ShadowRoot);var fe=wh(pe),we;try{for(fe.s();!(we=fe.n()).done;){var $e=we.value;j.add($e)}}catch(he){fe.e(he)}finally{fe.f()}oe=ne}}}catch(he){B.e(he)}finally{B.f()}M.forEach(function(he){j.delete(he)}),i.adjacentElements=j},F=function(){if(i.active)return r.removeEventListener("focusin",k,!0),r.removeEventListener("mousedown",S,!0),r.removeEventListener("touchstart",S,!0),r.removeEventListener("click",I,!0),r.removeEventListener("keydown",C,!0),r.removeEventListener("keydown",A),l},V=function(L){var M=L.some(function(j){var B=Array.from(j.removedNodes);return B.some(function(q){return q===i.mostRecentlyFocusedNode})});M&&g(f())},Z=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(V):void 0,P=function(){Z&&(Z.disconnect(),i.active&&!i.paused&&i.containers.map(function(L){Z.observe(L,{subtree:!0,childList:!0})}))};return l={get active(){return i.active},get paused(){return i.paused},activate:function(L){if(i.active)return this;var M=u(L,"onActivate"),j=u(L,"onPostActivate"),B=u(L,"checkCanFocusTrap"),q=Zn.getActiveTrap(s),re=!1;if(q&&!q.paused){var J;(J=q._setSubtreeIsolation)===null||J===void 0||J.call(q,!1),re=!0}try{B||p(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=h(r),M?.();var oe=function(){B&&p(),N(),P(),o.isolateSubtrees&&l._setSubtreeIsolation(!0),j?.()};if(B)return B(i.containers.concat()).then(oe,oe),this;oe()}catch(pe){if(q===Zn.getActiveTrap(s)&&re){var ne;(ne=q._setSubtreeIsolation)===null||ne===void 0||ne.call(q,!0)}throw pe}return this},deactivate:function(L){if(!i.active)return this;var M=kh({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},L);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,i.paused||l._setSubtreeIsolation(!1),i.alreadySilent.clear(),F(),i.active=!1,i.paused=!1,P(),Zn.deactivateTrap(s,l);var j=u(M,"onDeactivate"),B=u(M,"onPostDeactivate"),q=u(M,"checkCanReturnFocus"),re=u(M,"returnFocus","returnFocusOnDeactivate");j?.();var J=function(){Th(function(){re&&g(m(i.nodeFocusedBeforeActivation)),B?.()})};return re&&q?(q(m(i.nodeFocusedBeforeActivation)).then(J,J),this):(J(),this)},pause:function(L){return i.active?(i.manuallyPaused=!0,this._setPausedState(!0,L)):this},unpause:function(L){return i.active?(i.manuallyPaused=!1,s[s.length-1]!==this?this:this._setPausedState(!1,L)):this},updateContainerElements:function(L){var M=[].concat(L).filter(Boolean);return i.containers=M.map(function(j){return typeof j=="string"?r.querySelector(j):j}),o.isolateSubtrees&&_(i.containers),i.active&&(p(),o.isolateSubtrees&&!i.paused&&l._setSubtreeIsolation(!0)),P(),this}},Object.defineProperties(l,{_isManuallyPaused:{value:function(){return i.manuallyPaused}},_setPausedState:{value:function(L,M){if(i.paused===L)return this;if(i.paused=L,L){var j=u(M,"onPause"),B=u(M,"onPostPause");j?.(),F(),P(),l._setSubtreeIsolation(!1),B?.()}else{var q=u(M,"onUnpause"),re=u(M,"onPostUnpause");q?.(),l._setSubtreeIsolation(!0),p(),N(),P(),re?.()}return this}},_setSubtreeIsolation:{value:function(L){o.isolateSubtrees&&i.adjacentElements.forEach(function(M){var j;L?o.isolateSubtrees==="aria-hidden"?((M.ariaHidden==="true"||((j=M.getAttribute("aria-hidden"))===null||j===void 0?void 0:j.toLowerCase())==="true")&&i.alreadySilent.add(M),M.setAttribute("aria-hidden","true")):((M.inert||M.hasAttribute("inert"))&&i.alreadySilent.add(M),M.setAttribute("inert",!0)):i.alreadySilent.has(M)||(o.isolateSubtrees==="aria-hidden"?M.removeAttribute("aria-hidden"):M.removeAttribute("inert"))})}}}),l.updateContainerElements(t),l};function L$(e){return e}const Sx={escapeDeactivates:{type:Boolean,default:!0},returnFocusOnDeactivate:{type:Boolean,default:!0},allowOutsideClick:{type:[Boolean,Function],default:!0},clickOutsideDeactivates:[Boolean,Function],initialFocus:[String,Function,Boolean],fallbackFocus:[String,Function],checkCanFocusTrap:Function,checkCanReturnFocus:Function,delayInitialFocus:{type:Boolean,default:!0},document:Object,preventScroll:Boolean,setReturnFocus:[Object,String,Boolean,Function],tabbableOptions:Object},kx=ge({name:"FocusTrap",props:Object.assign({active:{type:Boolean,default:!0}},Sx),emits:["update:active","activate","postActivate","deactivate","postDeactivate"],render(){return this.renderImpl()},setup(e,{slots:t,emit:n}){let r;const s=H(null),o=T(()=>{const l=s.value;return l&&(l instanceof HTMLElement?l:l.$el)});function i(){return r||(r=wx(o.value,{escapeDeactivates:e.escapeDeactivates,allowOutsideClick:e.allowOutsideClick,returnFocusOnDeactivate:e.returnFocusOnDeactivate,clickOutsideDeactivates:e.clickOutsideDeactivates,onActivate:()=>{n("update:active",!0),n("activate")},onDeactivate:()=>{n("update:active",!1),n("deactivate")},onPostActivate:()=>n("postActivate"),onPostDeactivate:()=>n("postDeactivate"),initialFocus:e.initialFocus,fallbackFocus:e.fallbackFocus,tabbableOptions:e.tabbableOptions,delayInitialFocus:e.delayInitialFocus,preventScroll:e.preventScroll}))}return ft(()=>{ze(()=>e.active,l=>{l&&o.value?i().activate():r&&(r.deactivate(),(!o.value||o.value.nodeType===Node.COMMENT_NODE)&&(r=null))},{immediate:!0,flush:"post"})}),zo(()=>{r&&r.deactivate(),r=null}),{activate(){i().activate()},deactivate(){r&&r.deactivate()},renderImpl(){if(!t.default)return null;const l=t.default().filter(d=>d.type!==Ht);return!l||!l.length||l.length>1?(console.error("[focus-trap-vue]: FocusTrap requires exactly one child."),l):dr(l[0],{ref:s})}}}}),Cx=["open"],Tx=["id"],xx=Le(ge({__name:"OcBottomDrawer",props:{id:{},isDrawerActive:{type:Boolean,default:!0},isFocusTrapActive:{type:Boolean,default:!0},hasFullHeight:{type:Boolean,default:!1},maxHeight:{default:"max-h-[66vh]"}},emits:["clicked"],setup(e){return ze(()=>e.isDrawerActive,async()=>{e.isDrawerActive&&(await St(),document.getElementById(e.id)?.classList.add("active"))},{immediate:!0}),(t,n)=>(D(),K("dialog",{class:"oc-bottom-drawer fixed inset-0 bg-black/40 size-full",open:e.isDrawerActive,onClick:n[0]||(n[0]=r=>t.$emit("clicked",r))},[Q(a(kx),{active:e.isFocusTrapActive},{default:X(()=>[W("div",{id:e.id,tabindex:"-1",class:R.normalizeClass(["fixed inset-x-0 rounded-t-xl w-full overflow-y-auto transition-all duration-200 -bottom-full overflow-x-hidden",[{"[&.active]:bottom-0":e.isDrawerActive,"h-full":e.hasFullHeight},e.maxHeight]])},[Se(t.$slots,"default",{},void 0,!0)],10,Tx)]),_:3},8,["active"])],8,Cx))}}),[["__scopeId","data-v-42899e08"]]),Ut=ge({__name:"OcButton",props:{appearance:{default:"outline"},ariaLabel:{},colorRole:{default:"secondary"},disabled:{type:Boolean,default:!1},gapSize:{default:"medium"},href:{},justifyContent:{default:"center"},showSpinner:{type:Boolean,default:!1},size:{default:"medium"},submit:{default:"button"},target:{},to:{},type:{default:"button"},noHover:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){const n=t,r=T(()=>({...e.href&&{href:e.href},...e.target&&{target:e.target},...e.to&&{to:e.to},...e.type==="button"&&{type:e.submit},...e.type==="button"&&{disabled:e.disabled}})),s=T(()=>({...e.type==="button"&&{click:o}})),o=i=>{n("click",i)};return(i,l)=>{const u=te("oc-spinner");return D(),ee(Yt(e.type),at(r.value,{"aria-label":e.ariaLabel,class:[[`oc-button-${a(et.kebabCase)(e.colorRole)}`,`oc-button-${e.appearance}`,`oc-button-${a(et.kebabCase)(e.colorRole)}-${e.appearance}`,{...a(IS)(e.gapSize),...a(PS)(e.justifyContent),"text-sm min-h-3":e.size==="small","text-base min-h-4":e.size==="medium","text-lg min-h-7":e.size==="large","no-hover":e.noHover}],"oc-button cursor-pointer disabled:opacity-60 disabled:cursor-default"]},Uo(s.value)),{default:X(()=>[e.showSpinner?(D(),ee(u,{key:0,size:"small",class:"spinner"})):ie("",!0),Se(i.$slots,"default")]),_:3},16,["aria-label","class"])}}}),io=Math.min,an=Math.max,Ni=Math.round,_n=e=>({x:e,y:e}),Ax={left:"right",right:"left",bottom:"top",top:"bottom"};function xh(e,t,n){return an(e,io(t,n))}function ao(e,t){return typeof e=="function"?e(t):e}function kr(e){return e.split("-")[0]}function lo(e){return e.split("-")[1]}function Ah(e){return e==="x"?"y":"x"}function Rh(e){return e==="y"?"height":"width"}function er(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Eh(e){return Ah(er(e))}function Rx(e,t,n){n===void 0&&(n=!1);const r=lo(e),s=Eh(e),o=Rh(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=Bi(i)),[i,Bi(i)]}function Ex(e){const t=Bi(e);return[ql(e),t,ql(t)]}function ql(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Dh=["left","right"],Fh=["right","left"],Dx=["top","bottom"],Fx=["bottom","top"];function Ix(e,t,n){switch(e){case"top":case"bottom":return n?t?Fh:Dh:t?Dh:Fh;case"left":case"right":return t?Dx:Fx;default:return[]}}function Px(e,t,n,r){const s=lo(e);let o=Ix(kr(e),n==="start",r);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(ql)))),o}function Bi(e){const t=kr(e);return Ax[t]+e.slice(t.length)}function $x(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ox(e){return typeof e!="number"?$x(e):{top:e,right:e,bottom:e,left:e}}function ji(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Ih(e,t,n){let{reference:r,floating:s}=e;const o=er(t),i=Eh(t),l=Rh(i),u=kr(t),d=o==="y",c=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,p=r[l]/2-s[l]/2;let h;switch(u){case"top":h={x:c,y:r.y-s.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-s.width,y:f};break;default:h={x:r.x,y:r.y}}switch(lo(t)){case"start":h[i]-=p*(n&&d?-1:1);break;case"end":h[i]+=p*(n&&d?-1:1);break}return h}async function Lx(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:i,elements:l,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=ao(t,e),g=Ox(h),b=l[p?f==="floating"?"reference":"floating":f],S=ji(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(b)))==null||n?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:d,rootBoundary:c,strategy:u})),k=f==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),C=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},A=ji(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:k,offsetParent:w,strategy:u}):k);return{top:(S.top-A.top+g.top)/C.y,bottom:(A.bottom-S.bottom+g.bottom)/C.y,left:(S.left-A.left+g.left)/C.x,right:(A.right-S.right+g.right)/C.x}}const _x=50,Mx=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:Lx},u=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:c,y:f}=Ih(d,r,u),p=r,h=0;const g={};for(let m=0;m<o.length;m++){const b=o[m];if(!b)continue;const{name:S,fn:k}=b,{x:w,y:C,data:A,reset:I}=await k({x:c,y:f,initialPlacement:r,placement:p,strategy:s,middlewareData:g,rects:d,platform:l,elements:{reference:e,floating:t}});c=w??c,f=C??f,g[S]={...g[S],...A},I&&h<_x&&(h++,typeof I=="object"&&(I.placement&&(p=I.placement),I.rects&&(d=I.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):I.rects),{x:c,y:f}=Ih(d,p,u)),m=-1)}return{x:c,y:f,placement:p,strategy:s,middlewareData:g}},Nx=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:i,initialPlacement:l,platform:u,elements:d}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...b}=ao(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const S=kr(s),k=er(l),w=kr(l)===l,C=await(u.isRTL==null?void 0:u.isRTL(d.floating)),A=p||(w||!m?[Bi(l)]:Ex(l)),I=g!=="none";!p&&I&&A.push(...Px(l,m,g,C));const N=[l,...A],_=await u.detectOverflow(t,b),F=[];let V=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&F.push(_[S]),f){const L=Rx(s,i,C);F.push(_[L[0]],_[L[1]])}if(V=[...V,{placement:s,overflows:F}],!F.every(L=>L<=0)){var Z,P;const L=(((Z=o.flip)==null?void 0:Z.index)||0)+1,M=N[L];if(M&&(!(f==="alignment"?k!==er(M):!1)||V.every(q=>er(q.placement)===k?q.overflows[0]>0:!0)))return{data:{index:L,overflows:V},reset:{placement:M}};let j=(P=V.filter(B=>B.overflows[0]<=0).sort((B,q)=>B.overflows[1]-q.overflows[1])[0])==null?void 0:P.placement;if(!j)switch(h){case"bestFit":{var $;const B=($=V.filter(q=>{if(I){const re=er(q.placement);return re===k||re==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(re=>re>0).reduce((re,J)=>re+J,0)]).sort((q,re)=>q[1]-re[1])[0])==null?void 0:$[0];B&&(j=B);break}case"initialPlacement":j=l;break}if(s!==j)return{reset:{placement:j}}}return{}}}},Bx=new Set(["left","top"]);async function jx(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=kr(n),l=lo(n),u=er(n)==="y",d=Bx.has(i)?-1:1,c=o&&u?-1:1,f=ao(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(h=l==="end"?g*-1:g),u?{x:h*c,y:p*d}:{x:p*d,y:h*c}}const zx=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:i,middlewareData:l}=t,u=await jx(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:o+u.y,data:{...u,placement:i}}}}},Vx=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:S=>{let{x:k,y:w}=S;return{x:k,y:w}}},...d}=ao(e,t),c={x:n,y:r},f=await o.detectOverflow(t,d),p=er(kr(s)),h=Ah(p);let g=c[h],m=c[p];if(i){const S=h==="y"?"top":"left",k=h==="y"?"bottom":"right",w=g+f[S],C=g-f[k];g=xh(w,g,C)}if(l){const S=p==="y"?"top":"left",k=p==="y"?"bottom":"right",w=m+f[S],C=m-f[k];m=xh(w,m,C)}const b=u.fn({...t,[h]:g,[p]:m});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[h]:i,[p]:l}}}}}},Ux=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:i,elements:l}=t,{apply:u=()=>{},...d}=ao(e,t),c=await i.detectOverflow(t,d),f=kr(s),p=lo(s),h=er(s)==="y",{width:g,height:m}=o.floating;let b,S;f==="top"||f==="bottom"?(b=f,S=p===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(S=f,b=p==="end"?"top":"bottom");const k=m-c.top-c.bottom,w=g-c.left-c.right,C=io(m-c[b],k),A=io(g-c[S],w),I=!t.middlewareData.shift;let N=C,_=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=k),I&&!p){const V=an(c.left,0),Z=an(c.right,0),P=an(c.top,0),$=an(c.bottom,0);h?_=g-2*(V!==0||Z!==0?V+Z:an(c.left,c.right)):N=m-2*(P!==0||$!==0?P+$:an(c.top,c.bottom))}await u({...t,availableWidth:_,availableHeight:N});const F=await i.getDimensions(l.floating);return g!==F.width||m!==F.height?{reset:{rects:!0}}:{}}}};function zi(){return typeof window<"u"}function ys(e){return Ph(e)?(e.nodeName||"").toLowerCase():"#document"}function Qt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function tr(e){var t;return(t=(Ph(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ph(e){return zi()?e instanceof Node||e instanceof Qt(e).Node:!1}function wn(e){return zi()?e instanceof Element||e instanceof Qt(e).Element:!1}function nr(e){return zi()?e instanceof HTMLElement||e instanceof Qt(e).HTMLElement:!1}function $h(e){return!zi()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Qt(e).ShadowRoot}function co(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Sn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function qx(e){return/^(table|td|th)$/.test(ys(e))}function Vi(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Hx=/transform|translate|scale|rotate|perspective|filter/,Wx=/paint|layout|strict|content/,Hr=e=>!!e&&e!=="none";let Hl;function Wl(e){const t=wn(e)?Sn(e):e;return Hr(t.transform)||Hr(t.translate)||Hr(t.scale)||Hr(t.rotate)||Hr(t.perspective)||!Ql()&&(Hr(t.backdropFilter)||Hr(t.filter))||Hx.test(t.willChange||"")||Wx.test(t.contain||"")}function Qx(e){let t=Cr(e);for(;nr(t)&&!vs(t);){if(Wl(t))return t;if(Vi(t))return null;t=Cr(t)}return null}function Ql(){return Hl==null&&(Hl=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Hl}function vs(e){return/^(html|body|#document)$/.test(ys(e))}function Sn(e){return Qt(e).getComputedStyle(e)}function Ui(e){return wn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Cr(e){if(ys(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$h(e)&&e.host||tr(e);return $h(t)?t.host:t}function Oh(e){const t=Cr(e);return vs(t)?e.ownerDocument?e.ownerDocument.body:e.body:nr(t)&&co(t)?t:Oh(t)}function Lh(e,t,n){var r;t===void 0&&(t=[]);const s=Oh(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),i=Qt(s);return o?(Kl(i),t.concat(i,i.visualViewport||[],co(s)?s:[],[])):t.concat(s,Lh(s,[]))}function Kl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _h(e){const t=Sn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=nr(e),o=s?e.offsetWidth:n,i=s?e.offsetHeight:r,l=Ni(n)!==o||Ni(r)!==i;return l&&(n=o,r=i),{width:n,height:r,$:l}}function Mh(e){return wn(e)?e:e.contextElement}function bs(e){const t=Mh(e);if(!nr(t))return _n(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=_h(t);let i=(o?Ni(n.width):n.width)/r,l=(o?Ni(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Kx=_n(0);function Nh(e){const t=Qt(e);return!Ql()||!t.visualViewport?Kx:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Gx(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Qt(e)?!1:t}function uo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=Mh(e);let i=_n(1);t&&(r?wn(r)&&(i=bs(r)):i=bs(e));const l=Gx(o,n,r)?Nh(o):_n(0);let u=(s.left+l.x)/i.x,d=(s.top+l.y)/i.y,c=s.width/i.x,f=s.height/i.y;if(o){const p=Qt(o),h=r&&wn(r)?Qt(r):r;let g=p,m=Kl(g);for(;m&&r&&h!==g;){const b=bs(m),S=m.getBoundingClientRect(),k=Sn(m),w=S.left+(m.clientLeft+parseFloat(k.paddingLeft))*b.x,C=S.top+(m.clientTop+parseFloat(k.paddingTop))*b.y;u*=b.x,d*=b.y,c*=b.x,f*=b.y,u+=w,d+=C,g=Qt(m),m=Kl(g)}}return ji({width:c,height:f,x:u,y:d})}function qi(e,t){const n=Ui(e).scrollLeft;return t?t.left+n:uo(tr(e)).left+n}function Bh(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-qi(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function Jx(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",i=tr(r),l=t?Vi(t.floating):!1;if(r===i||l&&o)return n;let u={scrollLeft:0,scrollTop:0},d=_n(1);const c=_n(0),f=nr(r);if((f||!f&&!o)&&((ys(r)!=="body"||co(i))&&(u=Ui(r)),f)){const h=uo(r);d=bs(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const p=i&&!f&&!o?Bh(i,u):_n(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+c.x+p.x,y:n.y*d.y-u.scrollTop*d.y+c.y+p.y}}function Xx(e){return Array.from(e.getClientRects())}function Yx(e){const t=tr(e),n=Ui(e),r=e.ownerDocument.body,s=an(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=an(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+qi(e);const l=-n.scrollTop;return Sn(r).direction==="rtl"&&(i+=an(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:i,y:l}}const jh=25;function Zx(e,t){const n=Qt(e),r=tr(e),s=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,l=0,u=0;if(s){o=s.width,i=s.height;const c=Ql();(!c||c&&t==="fixed")&&(l=s.offsetLeft,u=s.offsetTop)}const d=qi(r);if(d<=0){const c=r.ownerDocument,f=c.body,p=getComputedStyle(f),h=c.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-h);g<=jh&&(o-=g)}else d<=jh&&(o+=d);return{width:o,height:i,x:l,y:u}}function eA(e,t){const n=uo(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=nr(e)?bs(e):_n(1),i=e.clientWidth*o.x,l=e.clientHeight*o.y,u=s*o.x,d=r*o.y;return{width:i,height:l,x:u,y:d}}function zh(e,t,n){let r;if(t==="viewport")r=Zx(e,n);else if(t==="document")r=Yx(tr(e));else if(wn(t))r=eA(t,n);else{const s=Nh(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return ji(r)}function Vh(e,t){const n=Cr(e);return n===t||!wn(n)||vs(n)?!1:Sn(n).position==="fixed"||Vh(n,t)}function tA(e,t){const n=t.get(e);if(n)return n;let r=Lh(e,[]).filter(l=>wn(l)&&ys(l)!=="body"),s=null;const o=Sn(e).position==="fixed";let i=o?Cr(e):e;for(;wn(i)&&!vs(i);){const l=Sn(i),u=Wl(i);!u&&l.position==="fixed"&&(s=null),(o?!u&&!s:!u&&l.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||co(i)&&!u&&Vh(e,i))?r=r.filter(c=>c!==i):s=l,i=Cr(i)}return t.set(e,r),r}function nA(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?Vi(t)?[]:tA(t,this._c):[].concat(n),r],l=zh(t,i[0],s);let u=l.top,d=l.right,c=l.bottom,f=l.left;for(let p=1;p<i.length;p++){const h=zh(t,i[p],s);u=an(h.top,u),d=io(h.right,d),c=io(h.bottom,c),f=an(h.left,f)}return{width:d-f,height:c-u,x:f,y:u}}function rA(e){const{width:t,height:n}=_h(e);return{width:t,height:n}}function sA(e,t,n){const r=nr(t),s=tr(t),o=n==="fixed",i=uo(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const u=_n(0);function d(){u.x=qi(s)}if(r||!r&&!o)if((ys(t)!=="body"||co(s))&&(l=Ui(t)),r){const h=uo(t,!0,o,t);u.x=h.x+t.clientLeft,u.y=h.y+t.clientTop}else s&&d();o&&!r&&s&&d();const c=s&&!r&&!o?Bh(s,l):_n(0),f=i.left+l.scrollLeft-u.x-c.x,p=i.top+l.scrollTop-u.y-c.y;return{x:f,y:p,width:i.width,height:i.height}}function Gl(e){return Sn(e).position==="static"}function Uh(e,t){if(!nr(e)||Sn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return tr(e)===n&&(n=n.ownerDocument.body),n}function qh(e,t){const n=Qt(e);if(Vi(e))return n;if(!nr(e)){let s=Cr(e);for(;s&&!vs(s);){if(wn(s)&&!Gl(s))return s;s=Cr(s)}return n}let r=Uh(e,t);for(;r&&qx(r)&&Gl(r);)r=Uh(r,t);return r&&vs(r)&&Gl(r)&&!Wl(r)?n:r||Qx(e)||n}const oA=async function(e){const t=this.getOffsetParent||qh,n=this.getDimensions,r=await n(e.floating);return{reference:sA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function iA(e){return Sn(e).direction==="rtl"}const aA={convertOffsetParentRelativeRectToViewportRelativeRect:Jx,getDocumentElement:tr,getClippingRect:nA,getOffsetParent:qh,getElementRects:oA,getClientRects:Xx,getDimensions:rA,getScale:bs,isElement:wn,isRTL:iA},lA=zx,cA=Vx,uA=Nx,dA=Ux,fA=(e,t,n)=>{const r=new Map,s={platform:aA,...n},o={...s.platform,_c:r};return Mx(e,t,{...s,platform:o})},pA=["src"],Jl=ge({__name:"OcCard",props:{tag:{default:"div"},title:{},titleTag:{default:"h2"},logoUrl:{default:""},headerClass:{default:""},bodyClass:{default:""},footerClass:{default:""}},setup(e){const t=Cu(),n=T(()=>Object.hasOwn(t,"header")||!!a(e.title)||!!a(e.logoUrl)),r=T(()=>Object.hasOwn(t,"footer"));return(s,o)=>(D(),ee(Yt(e.tag),{class:"oc-card"},{default:X(()=>[n.value?(D(),K("div",{key:0,class:R.normalizeClass(["oc-card-header",e.headerClass])},[Se(s.$slots,"header",{},()=>[e.logoUrl?(D(),K("img",{key:0,src:e.logoUrl,alt:"","aria-hidden":!0,class:"max-w-48 max-h-48 absolute -translate-y-16"},null,8,pA)):ie("",!0),e.title?(D(),ee(Yt(e.titleTag),{key:1,class:"mt-0"},{default:X(()=>[it(R.toDisplayString(e.title),1)]),_:1})):ie("",!0)])],2)):ie("",!0),W("div",{class:R.normalizeClass(["oc-card-body",e.bodyClass])},[Se(s.$slots,"default")],2),r.value?(D(),K("div",{key:1,class:R.normalizeClass(["oc-card-footer",e.footerClass])},[Se(s.$slots,"footer")],2)):ie("",!0)]),_:3}))}}),hA=["textContent"],mA=ge({__name:"OcMobileDrop",props:{drawerId:{},toggle:{},closeOnClick:{type:Boolean,default:!1},title:{default:""},registerClickHandler:{type:Boolean,default:!0}},emits:["show","hide"],setup(e,{expose:t,emit:n}){const r=n,{$gettext:s}=de.useGettext(),o=AT(),{showDrawer:i,closeDrawer:l,closeAllDrawers:u}=o,{drawers:d,currentDrawer:c}=ve.storeToRefs(o),f=H(null),p=qt("bottomDrawerCardBodyRef"),h=T(()=>a(d).map(({id:w})=>w).includes(a(f)?.id)),g=T(()=>a(f)?.id&&a(c)?.id===a(f).id),m=async()=>{f.value=i(),r("show"),await St(),a(p)?.addEventListener("click",S)},b=()=>{l(a(f)?.id),a(p)?.removeEventListener("click",S),r("hide")},S=w=>{const C=w.target.closest("a[href], button");if(C){if(C.hasAttribute("aria-expanded")){C.setAttribute("aria-expanded","true");return}e.closeOnClick&&(b(),u())}},k=w=>{w.target===w.currentTarget&&u()};return Cn.onKeyStroke("Escape",w=>{w.preventDefault(),u()}),ft(()=>{!a(e.toggle)||!e.registerClickHandler||document.querySelector(e.toggle)?.addEventListener("click",m)}),Xt(()=>{e.registerClickHandler&&document.querySelector(e.toggle)?.removeEventListener("click",m),a(f)&&l(a(f).id)}),t({show:m,hide:b}),(w,C)=>{const A=te("oc-icon");return h.value?(D(),ee(Ps,{key:0,to:"#app-runtime-bottom-drawer"},[Q(xx,{id:e.drawerId,"is-drawer-active":g.value,"is-focus-trap-active":g.value,class:"oc-mobile-drop z-[calc(var(--z-index-modal)+2)]",onClicked:k},{default:X(()=>[Q(Jl,{class:"bg-role-surface-container-high overflow-x-hidden rounded-b-none","header-class":"flex flex-row justify-between items-center"},{header:X(()=>[a(d).length>1?(D(),ee(Ut,{key:0,appearance:"raw",class:"raw-hover-surface oc-bottom-drawer-back-button","aria-label":a(s)("Open the parent context menu"),onClick:C[0]||(C[0]=I=>b())},{default:X(()=>[Q(A,{name:"arrow-left","fill-type":"line"})]),_:1},8,["aria-label"])):ie("",!0),W("span",{class:"font-semibold",textContent:R.toDisplayString(e.title)},null,8,hA),Q(Ut,{appearance:"raw",class:"raw-hover-surface oc-bottom-drawer-close-button","aria-label":a(s)("Close the context menu"),onClick:C[1]||(C[1]=I=>a(u)())},{default:X(()=>[Q(A,{name:"close","fill-type":"line"})]),_:1},8,["aria-label"])]),default:X(()=>[W("div",{ref_key:"bottomDrawerCardBodyRef",ref:p},[Se(w.$slots,"default")],512)]),_:3})]),_:3},8,["id","is-drawer-active","is-focus-trap-active"])])):ie("",!0)}}}),gA=()=>{const e=[];return{registerEventListener:(r,s,o,i,l)=>{r.addEventListener(s,o,l),e.push({target:r,type:s,handler:o,options:l,category:i})},unregisterEventListeners:r=>{if(!r){e.forEach(({target:o,type:i,handler:l,options:u})=>{o.removeEventListener(i,l,u)}),e.length=0;return}e.filter(o=>r.includes(o.category)).forEach(({target:o,type:i,handler:l,options:u})=>{o.removeEventListener(i,l,u)}),e.splice(0,e.length,...e.filter(o=>!r.includes(o.category)))}}},yA=["id"],Hh=ge({__name:"OcDrop",props:{title:{default:""},closeOnClick:{type:Boolean,default:!1},dropId:{default:()=>Mr("oc-drop-")},mode:{default:"click"},offset:{default:5},paddingSize:{default:"medium"},position:{default:"bottom-start"},toggle:{default:""},enforceDropOnMobile:{type:Boolean,default:!1}},emits:["hideDrop","showDrop"],setup(e,{expose:t,emit:n}){const r=n,{registerEventListener:s,unregisterEventListeners:o}=gA(),{isMobile:i}=to(),l=H(!1),u=T(()=>a(i)&&!e.enforceDropOnMobile),d=qt("bottomDrawerRef"),c=qt("drop"),f=T(()=>e.toggle?document.querySelector(e.toggle):null);t({show:({event:j,useMouseAnchor:B}={})=>{if(a(u)){a(d).show();return}a(l)||b({event:j,useMouseAnchor:B})},hide:()=>{if(a(u)){a(d).hide();return}S()}});const g=j=>{const B=j.target.closest(".oc-button")?.hasAttribute("aria-expanded");e.closeOnClick&&!B&&S()},m=()=>new Promise(j=>requestAnimationFrame(j)),b=async({event:j,useMouseAnchor:B}={})=>{if(a(l)){S();return}let q=a(f);if(B){const oe=j;q={getBoundingClientRect(){return{width:0,height:0,x:oe.clientX,y:oe.clientY,top:oe.clientY,left:oe.clientX,right:oe.clientX,bottom:oe.clientY}}}}if(l.value=!0,await St(),!q){console.warn("OcDrop cannot be opened: anchor element not found");return}await m();const{x:re,y:J}=await fA(q,a(c),{placement:e.position,middleware:[lA(e.offset),uA(),cA({padding:5}),dA({apply({availableWidth:oe,availableHeight:ne,elements:pe}){Object.assign(pe.floating.style,{maxWidth:`${Math.min(400,oe-10)}px`,maxHeight:`${Math.max(0,ne-10)}px`})}})]});Object.assign(a(c).style,{left:`${re}px`,top:`${J}px`}),a(f)?.setAttribute("aria-expanded","true"),r("showDrop"),s(document,"click",A,"document",{capture:!0}),s(document,"contextmenu",A,"document",{capture:!0}),s(document,"keydown",I,"document"),s(a(c),"focusout",C,"drop"),e.mode==="hover"&&(s(a(c),"mouseenter",F,"drop"),s(a(c),"mouseleave",V,"drop"))},S=()=>{o(["drop","document"]),l.value=!1,a(f)?.setAttribute("aria-expanded","false"),r("hideDrop")},k=j=>j instanceof FocusEvent,w=j=>j instanceof KeyboardEvent,C=j=>{if(!k(j))return;j.relatedTarget&&!a(c)?.contains(j.relatedTarget)&&S()},A=j=>{const B=j.target;if(a(c)&&!a(c).contains(B)){const re=a(f);re&&re.contains(B)||S()}},I=j=>{w(j)&&j.code==="Escape"&&(S(),a(f)?.focus())};let N=null;const _=()=>{N!==null&&(clearTimeout(N),N=null)},F=()=>{_()},V=()=>{N=setTimeout(S,100)},Z=j=>{b({event:j})},P=j=>{_(),a(l)||b({event:j})},$=()=>{N=setTimeout(S,100)},L=()=>{const j=a(f);j&&(j.setAttribute("aria-haspopup","true"),j.setAttribute("aria-expanded","false"))},M=()=>{const j=a(f);if(!(!j||a(u)))switch(e.mode){case"click":s(j,"click",Z,"anchor");break;case"hover":s(j,"mouseenter",P,"anchor"),s(j,"mouseleave",$,"anchor");break}};return ze(u,()=>{L(),a(u)?o():M()}),ft(()=>{M(),L()}),Xt(()=>{_(),o();const j=a(f);j?.removeAttribute("aria-expanded"),j?.removeAttribute("aria-haspopup")}),(j,B)=>u.value?(D(),ee(mA,{key:0,ref_key:"bottomDrawerRef",ref:d,"drawer-id":e.dropId,toggle:e.toggle,"close-on-click":e.closeOnClick,title:e.title,"register-click-handler":e.mode!=="manual",onShow:B[0]||(B[0]=q=>r("showDrop")),onHide:B[1]||(B[1]=q=>r("hideDrop"))},{default:X(()=>[Se(j.$slots,"default")]),_:3},8,["drawer-id","toggle","close-on-click","title","register-click-handler"])):(D(),ee(fv,{key:1,name:"oc-drop"},{default:X(()=>[l.value?(D(),K("div",{key:0,id:e.dropId,ref_key:"drop",ref:c,class:"oc-drop shadow-md/20 rounded-sm bg-role-surface",onClick:g},[j.$slots.default?(D(),ee(Jl,{key:0,"body-class":[a($S)(e.paddingSize)]},{default:X(()=>[Se(j.$slots,"default")]),_:3},8,["body-class"])):Se(j.$slots,"special",{key:1})],8,yA)):ie("",!0)]),_:3}))}}),vA=["type","disabled"],bA={class:"flex flex-row flex-wrap text-sm pt-2 gap-x-2"},wA=["textContent"],Wh="file-copy",SA=ge({__name:"OcTextInputPassword",props:{disabled:{type:Boolean,default:!1},generatePasswordMethod:{type:Function},hasError:{type:Boolean,default:!1},passwordPolicy:{},teleportId:{default:""},value:{default:""}},emits:["passwordChallengeCompleted","passwordChallengeFailed","passwordGenerated"],setup(e,{expose:t,emit:n}){const r=n,s=qt("passwordInput"),{$gettext:o}=de.useGettext(),i=H(e.value),l=H(!1),u=H(Wh),d=H(!1),c=T(()=>!!Object.keys(e.passwordPolicy?.rules||{}).length),f=T(()=>e.passwordPolicy?.missing(a(i))),p=k=>{const w={};for(let C=0;C<k.format.length;C++)w[`param${C+1}`]=k.format[C]?.toString();return o(k.message,w)},h=()=>{navigator.clipboard.writeText(a(i)),u.value="check",setTimeout(()=>u.value=Wh,1500)},g=()=>{const k=e.generatePasswordMethod();i.value=k,r("passwordGenerated",i.value)};return t({focus:()=>{a(s).focus()},select:()=>{a(s).select()},setSelectionRange:(k,w)=>{a(s).setSelectionRange(k,w)}}),ze(i,k=>{if(Object.keys(e.passwordPolicy).length){if(!e.passwordPolicy.check(k))return r("passwordChallengeFailed");r("passwordChallengeCompleted")}}),(k,w)=>{const C=te("oc-contextual-helper"),A=Bt("oc-tooltip");return D(),K(ke,null,[W("div",{class:R.normalizeClass(["oc-text-input-password-wrapper flex flex-row border rounded-sm",{"oc-text-input-password-wrapper-danger text-role-error focus:text-role-error border-role-error":e.hasError,"border-role-surface outline-2 outline-role-outline":d.value,"border-role-outline":!d.value}])},[je(W("input",at(k.$attrs,{ref_key:"passwordInput",ref:s,"onUpdate:modelValue":w[0]||(w[0]=I=>i.value=I),class:"grow-2 border-0 focus:border-0 focus:outline-0",type:l.value?"text":"password",disabled:e.disabled,onFocus:w[1]||(w[1]=I=>d.value=!0),onBlur:w[2]||(w[2]=I=>d.value=!1)}),null,16,vA),[[kv,i.value]]),i.value&&!e.disabled?je((D(),ee(Ut,{key:0,"aria-label":l.value?a(o)("Hide password"):a(o)("Show password"),class:"oc-text-input-show-password-toggle px-2",appearance:"raw",size:"small",onClick:w[3]||(w[3]=I=>l.value=!l.value)},{default:X(()=>[Q(Yn,{size:"small",name:l.value?"eye-off":"eye"},null,8,["name"])]),_:1},8,["aria-label"])),[[A,l.value?a(o)("Hide password"):a(o)("Show password")]]):ie("",!0),i.value&&!e.disabled?je((D(),ee(Ut,{key:1,"aria-label":a(o)("Copy password"),class:"oc-text-input-copy-password-button px-2",appearance:"raw",size:"small",onClick:h},{default:X(()=>[Q(Yn,{size:"small",name:u.value},null,8,["name"])]),_:1},8,["aria-label"])),[[A,a(o)("Copy password")]]):ie("",!0),e.generatePasswordMethod&&!e.disabled?je((D(),ee(Ut,{key:2,"aria-label":a(o)("Generate password"),class:"oc-text-input-generate-password-button px-2",appearance:"raw",size:"small",onClick:g},{default:X(()=>[Q(Yn,{size:"small",name:"refresh","fill-type":"line"})]),_:1},8,["aria-label"])),[[A,a(o)("Generate password")]]):ie("",!0)],2),c.value?(D(),ee(Ps,{key:0,defer:"",to:`#${e.teleportId}`},[W("div",bA,[(D(!0),K(ke,null,Ge(f.value.rules,(I,N)=>(D(),K("div",{key:N,class:"flex items-center oc-text-input-password-policy-rule"},[Q(Yn,{size:"small",class:"mr-1",name:I.verified?"checkbox-circle":"close-circle",color:I.verified?"var(--oc-role-on-surface)":"var(--oc-role-error)"},null,8,["name","color"]),W("span",{class:R.normalizeClass([{"oc-text-input-danger":!I.verified}]),textContent:R.toDisplayString(p(I))},null,10,wA),I.helperMessage?(D(),ee(C,{key:0,text:I.helperMessage,title:a(o)("Password policy")},null,8,["text","title"])):ie("",!0)]))),128))])],8,["to"])):ie("",!0)],64)}}}),kA=["for"],CA={key:0,class:"text-role-error","aria-hidden":"true"},TA=["id","textContent"],xA=["id","textContent"],AA=["id"],RA=ge({inheritAttrs:!1,__name:"OcTextInput",props:{id:{default:()=>Mr("oc-textinput-")},type:{default:"text"},modelValue:{default:""},selectionRange:{},clearButtonEnabled:{type:Boolean,default:!1},clearButtonAccessibleLabel:{default:""},defaultValue:{},disabled:{type:Boolean,default:!1},label:{},inlineLabel:{type:Boolean,default:!1},errorMessage:{},errorMessageDebouncedTime:{default:500},fixMessageLine:{type:Boolean,default:!1},descriptionMessage:{},readOnly:{type:Boolean,default:!1},requiredMark:{type:Boolean,default:!1},passwordPolicy:{default:()=>({})},generatePasswordMethod:{type:Function},hasBorder:{type:Boolean,default:!0}},emits:["change","update:modelValue","focus","passwordChallengeCompleted","passwordChallengeFailed"],setup(e,{expose:t,emit:n}){const r=n,s=My(),o=H(!1),i=T(()=>!!e.descriptionMessage),l=T(()=>e.fixMessageLine||a(o)||a(i)),u=T(()=>a(o).toString()),d=T(()=>`${e.id}-message`),c=T(()=>e.type==="password"?{passwordGenerated:C}:{}),f=qo(),p=T(()=>{const _={};(a(o)||a(i))&&(_["aria-describedby"]=d.value),e.defaultValue&&(_.placeholder=e.defaultValue),e.type==="password"&&(_["password-policy"]=e.passwordPolicy,_["generate-password-method"]=e.generatePasswordMethod,_["has-error"]=a(o));const{change:F,input:V,focus:Z,class:P,...$}=f;return{...$,..._}}),h=T(()=>!e.disabled&&e.clearButtonEnabled&&!!e.modelValue),g=T(()=>e.clearButtonAccessibleLabel||"Clear input"),m=T(()=>e.type==="password"?SA:"input"),b=qt("inputRef"),S=()=>{a(b).focus()};t({focus:S});function k(){S(),C(""),w(null)}const w=_=>{r("change",_)},C=_=>{r("update:modelValue",_)},A=async _=>{await St(),a(b).select(),I(),r("focus",_.value)},I=()=>{e.selectionRange&&e.selectionRange.length>1&&a(b).setSelectionRange(e.selectionRange[0],e.selectionRange[1])};ze([()=>e.selectionRange,b],async()=>{a(b)&&(await St(),I())},{immediate:!0});const N=et.debounce(()=>{o.value=!!e.errorMessage},e.errorMessageDebouncedTime);return ze(()=>e.modelValue,()=>{N()}),ze(()=>e.errorMessage,()=>{e.errorMessage?N():(o.value=!1,N.cancel?.())}),(_,F)=>(D(),K("div",{class:R.normalizeClass([{"flex items-center":e.inlineLabel},_.$attrs.class])},[Se(_.$slots,"label",{},()=>[W("label",{class:R.normalizeClass(["inline-block",{"mr-2":e.inlineLabel,"mb-0.5":!e.inlineLabel}]),for:e.id},[it(R.toDisplayString(e.label)+" ",1),e.requiredMark?(D(),K("span",CA,"*")):ie("",!0)],10,kA)]),W("div",{class:R.normalizeClass(["relative",{"grow-1":e.inlineLabel}])},[e.readOnly?(D(),ee(Yn,{key:0,name:"lock",size:"small",class:"mt-2 ml-2 absolute"})):ie("",!0),(D(),ee(Yt(m.value),at({id:e.id},p.value,{ref_key:"inputRef",ref:b,"aria-invalid":u.value,class:["oc-text-input oc-input",{"oc-text-input-danger border-role-error":!!o.value,"pl-6":!!e.readOnly,"pr-6":h.value,"border-none outline-none bg-transparent":!e.hasBorder}],type:e.type,value:e.modelValue,disabled:e.disabled||e.readOnly,"teleport-id":a(s)},Uo(c.value),{onChange:F[0]||(F[0]=V=>w(V.target.value)),onInput:F[1]||(F[1]=V=>C(V.target.value)),onPasswordChallengeCompleted:F[2]||(F[2]=V=>_.$emit("passwordChallengeCompleted")),onPasswordChallengeFailed:F[3]||(F[3]=V=>_.$emit("passwordChallengeFailed")),onFocus:F[4]||(F[4]=V=>A(V.target))}),null,16,["id","aria-invalid","class","type","value","disabled","teleport-id"])),h.value?(D(),ee(Ut,{key:1,"aria-label":g.value,class:"pr-2 absolute top-[50%] transform-[translateY(-50%)] right-0 oc-text-input-btn-clear",appearance:"raw","no-hover":"",onClick:k},{default:X(()=>[Q(Yn,{name:"close",size:"small"})]),_:1},8,["aria-label"])):ie("",!0)],2),l.value?(D(),K("div",{key:0,class:R.normalizeClass(["oc-text-input-message flex align-center text-sm mt-1 min-h-4.5",{"oc-text-input-description text-role-on-surface-variant relative":i.value,"oc-text-input-danger text-role-error focus:text-role-error border-role-error":o.value}])},[o.value?(D(),K(ke,{key:0},[o.value?(D(),ee(Yn,{key:0,name:"error-warning",size:"small","fill-type":"line","aria-hidden":"true",class:"mr-1"})):ie("",!0),o.value?(D(),K("span",{key:1,id:d.value,class:"oc-text-input-danger text-role-error focus:text-role-error border-role-error",textContent:R.toDisplayString(e.errorMessage)},null,8,TA)):ie("",!0)],64)):i.value?(D(),K("span",{key:1,id:d.value,class:"oc-text-input-description text-role-on-surface-variant flex items-center relative",textContent:R.toDisplayString(e.descriptionMessage)},null,8,xA)):ie("",!0)],2)):ie("",!0),W("div",{id:a(s)},null,8,AA)],2))}});var EA=Object.defineProperty,Qh=Object.getOwnPropertySymbols,DA=Object.prototype.hasOwnProperty,FA=Object.prototype.propertyIsEnumerable,Kh=(e,t,n)=>t in e?EA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,IA=(e,t)=>{for(var n in t||(t={}))DA.call(t,n)&&Kh(e,n,t[n]);if(Qh)for(var n of Qh(t))FA.call(t,n)&&Kh(e,n,t[n]);return e};const Gh=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},PA={},$A={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},OA=W("path",{d:"M6.895455 5l2.842897-2.842898c.348864-.348863.348864-.914488 0-1.263636L9.106534.261648c-.348864-.348864-.914489-.348864-1.263636 0L5 3.104545 2.157102.261648c-.348863-.348864-.914488-.348864-1.263636 0L.261648.893466c-.348864.348864-.348864.914489 0 1.263636L3.104545 5 .261648 7.842898c-.348864.348863-.348864.914488 0 1.263636l.631818.631818c.348864.348864.914773.348864 1.263636 0L5 6.895455l2.842898 2.842897c.348863.348864.914772.348864 1.263636 0l.631818-.631818c.348864-.348864.348864-.914489 0-1.263636L6.895455 5z"},null,-1),LA=[OA];function _A(e,t){return D(),K("svg",$A,LA)}const MA=Gh(PA,[["render",_A]]),NA={},BA={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"},jA=W("path",{d:"M9.211364 7.59931l4.48338-4.867229c.407008-.441854.407008-1.158247 0-1.60046l-.73712-.80023c-.407008-.441854-1.066904-.441854-1.474243 0L7 5.198617 2.51662.33139c-.407008-.441853-1.066904-.441853-1.474243 0l-.737121.80023c-.407008.441854-.407008 1.158248 0 1.600461l4.48338 4.867228L7 10l2.211364-2.40069z"},null,-1),zA=[jA];function VA(e,t){return D(),K("svg",BA,zA)}IA({},{Deselect:MA,OpenIndicator:Gh(NA,[["render",VA]])});const UA=["aria-label","aria-live","aria-hidden","role"],qA=ge({__name:"OcSpinner",props:{ariaLabel:{default:()=>{}},size:{default:"medium"}},setup(e){return(t,n)=>(D(),K("span",{class:R.normalizeClass(["oc-spinner inline-block after:block after:bg-transparent after:border after:border-current after:rounded-full after:size-full relative after:relative animate-spin after:content-[''] after:border-b-transparent",{"size-2":e.size==="xsmall","size-4":e.size==="small","size-5":e.size==="medium","size-8":e.size==="large","size-10":e.size==="xlarge","size-12":e.size==="xxlarge","size-16":e.size==="xxxlarge"}]),"aria-label":e.ariaLabel||void 0,"aria-live":e.ariaLabel?"polite":void 0,"aria-hidden":e.ariaLabel?void 0:"true",tabindex:"-1",role:e.ariaLabel?"img":void 0},null,10,UA))}}),HA={class:"oc-status-indicators flex"},WA=["id","textContent"],QA=ge({__name:"OcStatusIndicators",props:{resource:{},indicators:{},disableHandler:{type:Boolean,default:!1}},setup(e){const{$gettext:t}=de.useGettext(),n=H({}),r=o=>Object.hasOwn(o,"handler"),s=o=>o.accessibleDescription?(a(n)[o.id]||(a(n)[o.id]=Mr("oc-indicator-description-")),a(n)[o.id]):null;return(o,i)=>{const l=Bt("oc-tooltip");return D(),K("div",HA,[(D(!0),K(ke,null,Ge(e.indicators,(u,d)=>(D(),K(ke,null,[r(u)&&!e.disableHandler?je((D(),ee(Ut,{id:u.id,key:`${u.id}-handler`,class:R.normalizeClass(["oc-status-indicators-indicator",{"ml-1":d>0}]),"aria-label":a(t)(u.label),"aria-describedby":s(u),appearance:"raw","data-testid":u.id,"data-test-indicator-type":u.type,"data-test-indicator-resource-name":e.resource.name,"data-test-indicator-resource-path":e.resource.path,"no-hover":"",onClick:c=>u.handler?.(e.resource,c)},{default:X(()=>[Q(Yn,{name:u.icon,size:"small","fill-type":u.fillType},null,8,["name","fill-type"])]),_:2},1032,["id","class","aria-label","aria-describedby","data-testid","data-test-indicator-type","data-test-indicator-resource-name","data-test-indicator-resource-path","onClick"])),[[l,a(t)(u.label)]]):je((D(),ee(Yn,{id:u.id,key:u.id,tabindex:"-1",size:"small",class:R.normalizeClass(["oc-status-indicators-indicator",{"ml-1":d>0}]),name:u.icon,"fill-type":u.fillType,"accessible-label":a(t)(u.label),"aria-describedby":s(u),"data-testid":u.id,"data-test-indicator-type":u.type},null,8,["id","class","name","fill-type","accessible-label","aria-describedby","data-testid","data-test-indicator-type"])),[[l,a(t)(u.label)]]),s(u)?(D(),K("p",{id:s(u),key:s(u),class:"sr-only",textContent:R.toDisplayString(a(t)(u.accessibleDescription))},null,8,WA)):ie("",!0)],64))),256))])}}}),KA={class:"oc-thead border-b"},GA=ge({name:"OcTableHead",__name:"OcTableHead",setup(e){return(t,n)=>(D(),K("thead",KA,[Se(t.$slots,"default")]))}}),JA=ge({name:"OcTableBody",__name:"OcTableBody",setup(e){return(t,n)=>(D(),K("tbody",null,[Se(t.$slots,"default")]))}}),Jh=Le(ge({__name:"OcTableCell",props:{alignH:{default:"left"},alignV:{default:"middle"},type:{default:"td"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e,{emit:t}){const n=t;return(r,s)=>(D(),ee(Yt(e.type),{class:R.normalizeClass(["oc-table-cell",{"break-all":e.wrap==="break","whitespace-nowrap":e.wrap==="nowrap","overflow-visible max-w-0":e.wrap==="truncate","text-left":e.alignH==="left","text-right":e.alignH==="right","text-center":e.alignH==="center","align-top":e.alignV==="top","align-middle":e.alignV==="middle","align-bottom":e.alignV==="bottom","w-px":e.width==="shrink","min-w-38":e.width==="expand"}]),onClick:s[0]||(s[0]=o=>n("click",o))},{default:X(()=>[Se(r.$slots,"default",{},void 0,!0)]),_:3},8,["class"]))}}),[["__scopeId","data-v-dc7aa8e1"]]),Xh=ge({__name:"OcTableTd",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},setup(e){return(t,n)=>(D(),ee(Jh,{type:"td","align-h":e.alignH,"align-v":e.alignV,width:e.width,wrap:e.wrap,class:"oc-td"},{default:X(()=>[Se(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),Yh=Le(ge({__name:"OcTableTr",props:{lazy:{}},emits:["contextmenu","click","dragstart","drop","dragenter","dragleave","dragover","mouseleave","itemVisible"],setup(e,{emit:t}){const n=t,r=ny((l,u)=>{let d;return{get(){return l(),d},set(c){d=c,u()}}}),s=T(()=>e.lazy?e.lazy.colspan:1),{isVisible:o}=e.lazy?Xp({...e.lazy,target:r,onVisibleCallback:()=>n("itemVisible")}):{isVisible:H(!0)},i=T(()=>!a(o));return e.lazy||n("itemVisible"),(l,u)=>(D(),K("tr",{ref_key:"observerTarget",ref:r,onClick:u[0]||(u[0]=d=>l.$emit("click",d)),onContextmenu:u[1]||(u[1]=d=>l.$emit("contextmenu",d)),onDragstart:u[2]||(u[2]=d=>l.$emit("dragstart",d)),onDrop:u[3]||(u[3]=d=>l.$emit("drop",d)),onDragenter:u[4]||(u[4]=d=>l.$emit("dragenter",d)),onDragleave:u[5]||(u[5]=d=>l.$emit("dragleave",d)),onDragover:u[6]||(u[6]=d=>l.$emit("dragover",d)),onMouseleave:u[7]||(u[7]=d=>l.$emit("mouseleave",d))},[i.value?(D(),ee(Xh,{key:0,colspan:s.value},{default:X(()=>[...u[8]||(u[8]=[W("span",{class:"shimmer inline-block bg-role-shadow overflow-hidden absolute inset-x-2 inset-y-3 after:absolute after:inset-0 after:transform-[translateX(-100%)] opacity-10 after:animate-shimmer"},null,-1)])]),_:1},8,["colspan"])):Se(l.$slots,"default",{key:1},void 0,!0)],544))}}),[["__scopeId","data-v-7acab1b8"]]),XA=Le(ge({__name:"OcTableTh",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e){return(t,n)=>(D(),ee(Jh,{type:"th","align-h":e.alignH,"align-v":e.alignV,width:e.width,wrap:e.wrap,class:"oc-th aria-[sort]:cursor-pointer",onClick:n[0]||(n[0]=r=>t.$emit("click",r))},{default:X(()=>[Se(t.$slots,"default",{},void 0,!0)]),_:3},8,["align-h","align-v","width","wrap"]))}}),[["__scopeId","data-v-d746eb11"]]),YA={key:0,class:"oc-table-thead-content inline-table align-middle"},ZA=["textContent"],eR={key:1},tR={key:0,class:"oc-table-thead-content inline-table align-middle"},nR=["textContent"],rR={key:1,class:"oc-table-footer border-t"},sR={class:"oc-table-footer-row h-10.5"},oR=["colspan"],iR=Le(ge({__name:"OcTable",props:{data:{},fields:{},disabled:{default:()=>[]},dragDrop:{type:Boolean,default:!1},hasHeader:{type:Boolean,default:!0},headerPosition:{default:0},highlighted:{},hover:{type:Boolean,default:!1},idKey:{default:"id"},itemDomSelector:{type:Function},lazy:{type:Boolean,default:!1},paddingX:{default:"small"},sortBy:{},sortDir:{},sticky:{type:Boolean,default:!1}},emits:["itemDropped","itemDragged","theadClicked","highlight","rowMounted","contextmenuClicked","sort","dropRowStyling","itemVisible"],setup(e,{emit:t}){const n=t,r={EVENT_THEAD_CLICKED:TS,EVENT_TROW_CLICKED:xS,EVENT_TROW_MOUNTED:AS,EVENT_TROW_CONTEXTMENU:RS},{$gettext:s}=de.useGettext(),o=P=>e.itemDomSelector?e.itemDomSelector(P):P[e.idKey],i=T(()=>{const P=["oc-table"];return e.hover&&P.push("oc-table-hover"),e.sticky&&P.push("oc-table-sticky"),P}),l=T(()=>e.fields.length),u=P=>{P.preventDefault()},d=(P,$)=>{n(ES,[P,$])},c=(P,$)=>{n(tf,[P,$])},f=(P,$,L)=>{n("dropRowStyling",P,$,L)},p=P=>P.type==="slot",h=P=>["callback","function"].indexOf(P.type)>=0,g=P=>Object.prototype.hasOwnProperty.call(P,"title")?P.title:P.name,m=()=>({class:i.value}),b=P=>{switch(e.paddingX){case"remove":return P==="right"?"pr-0":"pl-0";case"xsmall":return P==="right"?"pr-1":"pl-1";case"small":return P==="right"?"pr-2":"pl-2";case"medium":return P==="right"?"pr-4":"pl-4";case"large":return P==="right"?"pr-6":"pl-6";case"xlarge":return P==="right"?"pr-12":"pl-12";case"xxlarge":return P==="right"?"pr-24":"pl-24"}},S=(P,$)=>{const L=C(P);return L.class=`oc-table-header-cell oc-table-header-cell-${P.name}`,Object.prototype.hasOwnProperty.call(P,"thClass")&&(L.class+=` ${P.thClass}`),e.sticky&&(L.style=`top: ${e.headerPosition}px;`,L.class+=" z-10"),$===0&&(L.class+=` ${b("left")} `),$===e.fields.length-1&&(L.class+=` ${b("right")}`),F(L,P),L},k=(P,$)=>({...e.lazy&&{lazy:{colspan:l.value}},class:["oc-tbody-tr",`oc-tbody-tr-${o(P)||$}`,A(P)?"oc-table-highlighted":void 0,...I(P)?["oc-table-disabled","opacity-70","pointer-events-none","grayscale-60"]:[]].filter(Boolean)}),w=(P,$,L)=>{const M=C(P);return M.class=`oc-table-data-cell oc-table-data-cell-${P.name}`,Object.prototype.hasOwnProperty.call(P,"tdClass")&&(M.class+=` ${P.tdClass}`),Object.prototype.hasOwnProperty.call(P,"wrap")&&(M.wrap=P.wrap),$===0&&(M.class+=` ${b("left")} `),$===e.fields.length-1&&(M.class+=` ${b("right")}`),Object.prototype.hasOwnProperty.call(P,"accessibleLabelCallback")&&(M["aria-label"]=P.accessibleLabelCallback(L)),M},C=P=>({...P?.alignH&&{alignH:P.alignH},...P?.alignV&&{alignV:P.alignV},...P?.width&&{width:P.width},class:void 0,wrap:void 0,style:void 0}),A=P=>e.highlighted?Array.isArray(e.highlighted)?e.highlighted.indexOf(P[e.idKey])>-1:e.highlighted===P[e.idKey]:!1,I=P=>e.disabled.length?e.disabled.indexOf(P[e.idKey])>-1:!1,N=(P,$,L)=>{const M=[L[e.idKey],$+1].filter(Boolean);return p(P)?[...M,P.name].join("-"):h(P)?[...M,P.callback(L[P.name])].join("-"):[...M,L[P.name]].join("-")},_=P=>s("Sort by %{ name }",{name:P}),F=(P,$)=>{if(!V($))return;let L="none";e.sortBy===$.name&&(L=e.sortDir===Je.Asc?"ascending":"descending"),P["aria-sort"]=L},V=({sortable:P})=>!!P,Z=P=>{if(!V(P))return;let $=e.sortDir;e.sortBy===P.name&&e.sortDir!==void 0&&($=e.sortDir===Je.Desc?Je.Asc:Je.Desc),(e.sortBy!==P.name||e.sortDir===void 0)&&($=P.sortDir||Je.Desc),n("sort",{sortBy:P.name,sortDir:$})};return(P,$)=>{const L=te("oc-icon");return D(),K("table",at(m(),{class:"has-item-context-menu"}),[e.hasHeader?(D(),ee(GA,{key:0},{default:X(()=>[Q(Yh,{class:"oc-table-header-row h-10.5"},{default:X(()=>[(D(!0),K(ke,null,Ge(e.fields,(M,j)=>(D(),ee(XA,at({key:`oc-thead-${M.name}`},{ref_for:!0},S(M,j)),{default:X(()=>[M.sortable?(D(),ee(Ut,{key:0,"aria-label":_(M.name),appearance:"raw","justify-content":"left",class:"oc-button-sort w-full hover:underline","gap-size":"small","no-hover":"",onClick:B=>Z(M)},{default:X(()=>[M.headerType==="slot"?(D(),K("span",YA,[Se(P.$slots,M.name+"Header",{},void 0,!0)])):(D(),K("span",{key:1,class:"oc-table-thead-content inline-table align-middle header-text",textContent:R.toDisplayString(g(M))},null,8,ZA)),Q(L,{name:e.sortDir==="asc"?"arrow-down":"arrow-up","fill-type":"line",class:R.normalizeClass([{"sr-only":e.sortBy!==M.name},"p-1 rounded-sm"]),size:"small"},null,8,["name","class"])]),_:2},1032,["aria-label","onClick"])):(D(),K("div",eR,[M.headerType==="slot"?(D(),K("span",tR,[Se(P.$slots,M.name+"Header",{},void 0,!0)])):(D(),K("span",{key:1,class:"oc-table-thead-content inline-table align-middle header-text",textContent:R.toDisplayString(g(M))},null,8,nR))]))]),_:2},1040))),128))]),_:3})]),_:3})):ie("",!0),Q(JA,{class:"has-item-context-menu"},{default:X(()=>[(D(!0),K(ke,null,Ge(e.data,(M,j)=>(D(),ee(Yh,at({key:`oc-tbody-tr-${o(M)||j}`,ref_for:!0,ref:`row-${j}`},{ref_for:!0},k(M,j),{"data-item-id":M[e.idKey],draggable:e.dragDrop,class:"border-t h-10.5",onClick:B=>P.$emit(r.EVENT_TROW_CLICKED,[M,B]),onContextmenu:B=>P.$emit(r.EVENT_TROW_CONTEXTMENU,P.$refs[`row-${j}`][0],B,M),onVnodeMounted:B=>P.$emit(r.EVENT_TROW_MOUNTED,M,P.$refs[`row-${j}`][0]),onDragstart:B=>d(M,B),onDrop:B=>c(M,B),onDragenter:kt(B=>f(M,!1,B),["prevent"]),onDragleave:kt(B=>f(M,!0,B),["prevent"]),onDragover:$[0]||($[0]=B=>u(B)),onItemVisible:B=>P.$emit("itemVisible",M)}),{default:X(()=>[(D(!0),K(ke,null,Ge(e.fields,(B,q)=>(D(),ee(Xh,at({key:"oc-tbody-td-"+N(B,q,M)},{ref_for:!0},w(B,q,M)),{default:X(()=>[p(B)?Se(P.$slots,B.name,{key:0,item:M},void 0,!0):h(B)?(D(),K(ke,{key:1},[it(R.toDisplayString(B.callback(M[B.name])),1)],64)):(D(),K(ke,{key:2},[it(R.toDisplayString(M[B.name]),1)],64))]),_:2},1040))),128))]),_:2},1040,["data-item-id","draggable","onClick","onContextmenu","onVnodeMounted","onDragstart","onDrop","onDragenter","onDragleave","onItemVisible"]))),128))]),_:3}),P.$slots.footer?(D(),K("tfoot",rR,[W("tr",sR,[W("td",{colspan:l.value,class:"oc-table-footer-cell p-1 text-sm text-role-on-surface-variant"},[Se(P.$slots,"footer",{},void 0,!0)],8,oR)])])):ie("",!0)],16)}}}),[["__scopeId","data-v-57029fa4"]]),Xl=()=>{const{$gettext:e,$ngettext:t}=de.useGettext(),{showMessage:n,showErrorMessage:r}=Me(),{copy:s}=Cn.useClipboard(),o=({result:l,password:u})=>{const d=l.filter(Br);let c="";if(d.length){let p=e("Link has been created successfully");if(l.length===1)try{c=u?e("%{link} Password:%{password}",{link:d[0].value.webUrl,password:u}):d[0].value.webUrl,p=e("The link has been copied to your clipboard.")}catch(h){console.warn("Unable to copy link to clipboard",h)}n({title:t(p,"Links have been created successfully.",d.length)})}const f=l.filter(jr);return f.length&&r({errors:f.map(({reason:p})=>p),title:t("Failed to create link","Failed to create links",f.length)}),c};return{copyLink:async({createLinkHandler:l,password:u})=>{if(navigator.clipboard.write)await new Promise((d,c)=>{const f=new ClipboardItem({"text/plain":l().then(p=>{const h=o({result:p,password:u}),g=new Blob([h],{type:"text/plain"});return d(),g}).catch(p=>{throw c(),p})});navigator.clipboard.write([f])});else{const d=await l(),c=o({result:d,password:u});c&&s(c)}}}},Hi=()=>{const{$gettext:e}=de.useGettext(),t=Ct(),n=Lt(),r=T(()=>n.can("create-all","PublicLink")),s=T(()=>Vt.View),o=d=>d===Vt.View?t.sharingPublicPasswordEnforcedFor.read_only:d===Vt.Upload?t.sharingPublicPasswordEnforcedFor.upload_only:d===Vt.CreateOnly?t.sharingPublicPasswordEnforcedFor.read_write:d===Vt.Edit?t.sharingPublicPasswordEnforcedFor.read_write_delete:!1,i=({isFolder:d})=>a(r)?d?[Vt.View,Vt.Edit,Vt.CreateOnly]:[Vt.View,Vt.Edit]:[],l=[{id:Vt.View,displayName:e("Can view"),description:e("View, download"),icon:"eye"},{id:Vt.Upload,displayName:e("Can upload"),description:e("View, upload, download"),icon:"upload"},{id:Vt.Edit,displayName:e("Can edit"),description:e("View, upload, edit, download, delete"),icon:"pencil"},{id:Vt.CreateOnly,displayName:e("Secret File Drop"),description:e("Upload only, existing content is not revealed"),icon:"inbox-unarchive"}];return{defaultLinkType:s,isPasswordEnforcedForLinkType:o,getAvailableLinkTypes:i,linkShareRoles:l,getLinkRoleByType:d=>l.find(({id:c})=>c===d)}},aR=ge({name:"LinkRoleDropdown",props:{modelValue:{type:Object,required:!0},availableLinkTypeOptions:{type:Array,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=de.useGettext(),{getLinkRoleByType:r}=Hi(),s=u=>e.modelValue===u,o=u=>{t("update:modelValue",u)},i=T(()=>n(r(e.modelValue)?.displayName)),l=wt.v4();return{isSelectedType:s,updateSelectedType:o,currentLinkRoleLabel:i,dropUuid:l,getLinkRoleByType:r}}}),lR=["textContent"],cR=["textContent"],uR={class:"flex items-center"},dR={class:"text-left"},fR=["textContent"],pR={class:"text-sm leading-4"},hR={class:"flex"};function mR(e,t,n,r,s,o){const i=te("oc-icon"),l=te("oc-button"),u=te("oc-list"),d=te("oc-drop"),c=Bt("oc-tooltip");return D(),K(ke,null,[e.availableLinkTypeOptions.length>1?(D(),ee(l,{key:0,id:`link-role-dropdown-toggle-${e.dropUuid}`,appearance:"raw","gap-size":"none","no-hover":"",class:"text-left link-role-dropdown-toggle"},{default:X(()=>[W("span",{class:"link-current-role",textContent:R.toDisplayString(e.currentLinkRoleLabel||e.$gettext("Select a role"))},null,8,lR),Q(i,{name:"arrow-down-s"})]),_:1},8,["id"])):je((D(),K("span",{key:1,class:"link-current-role mr-4",textContent:R.toDisplayString(e.currentLinkRoleLabel)},null,8,cR)),[[c,e.getLinkRoleByType(e.modelValue)?.description]]),e.availableLinkTypeOptions.length>1?(D(),ee(d,{key:2,class:"link-role-dropdown w-md",title:e.$gettext("Role"),"drop-id":`link-role-dropdown-${e.dropUuid}`,toggle:`#link-role-dropdown-toggle-${e.dropUuid}`,"padding-size":"small",mode:"click","close-on-click":""},{default:X(()=>[Q(u,{class:"role-dropdown-list"},{default:X(()=>[(D(!0),K(ke,null,Ge(e.availableLinkTypeOptions,(f,p)=>(D(),K("li",{key:`role-dropdown-${p}`},[Q(l,{id:`files-role-${e.getLinkRoleByType(f).id}`,class:R.normalizeClass([{selected:e.isSelectedType(f)},"p-2"]),appearance:e.isSelectedType(f)?"filled":"raw-inverse","color-role":e.isSelectedType(f)?"secondaryContainer":"surface","justify-content":"space-between",onClick:h=>e.updateSelectedType(f)},{default:X(()=>[W("span",uR,[Q(i,{name:e.getLinkRoleByType(f).icon,class:"pl-2 pr-4"},null,8,["name"]),W("span",dR,[W("span",{class:"role-dropdown-list-option-label font-semibold block w-full leading-4",textContent:R.toDisplayString(e.$gettext(e.getLinkRoleByType(f).displayName))},null,8,fR),W("span",pR,R.toDisplayString(e.$gettext(e.getLinkRoleByType(f).description)),1)])]),W("span",hR,[e.isSelectedType(f)?(D(),ee(i,{key:0,name:"check"})):ie("",!0)])]),_:2},1032,["id","class","appearance","color-role","onClick"])]))),128))]),_:1})]),_:1},8,["title","drop-id","toggle"])):ie("",!0)],64)}const Zh=Le(aR,[["render",mR]]),gR={class:"flex justify-between pb-2"},yR={key:0,class:"flex items-center"},vR={key:1,class:"flex items-center"},bR={class:"flex flex-col"},wR=["textContent"],SR=["textContent"],kR=["textContent"],CR={class:"mb-4 ml-[30px]"},TR={key:1,class:"text-sm text-role-on-surface-variant"},xR=["textContent"],AR=["textContent"],RR={class:"flex justify-end items-center mt-2"},ER={class:"sr-only"},em=ge({__name:"CreateLinkModal",props:{modal:{},resources:{},space:{default:()=>{}}},emits:["cancel","confirm"],setup(e,{expose:t}){const n=Ee(),r=de.useGettext(),{$gettext:s}=r,{removeModal:o}=Ke(),{copyLink:i}=Xl(),l=Om(),{isEnabled:u,postMessage:d}=wr(),{defaultLinkType:c,getAvailableLinkTypes:f,getLinkRoleByType:p,isPasswordEnforcedForLinkType:h}=Hi(),{addLink:g}=Jn(),m=On(),{currentTheme:b}=ve.storeToRefs(m),S=H(!1),k=H(!1),w=T(()=>e.resources.every(({isFolder:he})=>he)),C=T(()=>a(u)?s("Share link(s)"):s("Copy link")),A=T(()=>a(u)?s("Share link(s) and password(s)"):s("Copy link and password")),I=H(wt.v4()),N=H({}),_=H(),F=ga({value:"",error:void 0}),V=H(a(c)),Z=T(()=>s(p(a(V)).description)),P=T(()=>s(p(a(V)).displayName)),$=T(()=>p(a(V)).icon),L=T(()=>f({isFolder:a(w)})),M=T(()=>h(a(V))),j=l.getPolicy({enforcePassword:a(M)}),B=()=>{S.value=!0},q=({date:he,error:ae})=>{_.value=he,k.value=ae},re=()=>Promise.allSettled(e.resources.map(he=>g({clientService:n,space:e.space,resource:he,options:{type:a(V),"@libre.graph.quickLink":!1,password:a(F).value,expirationDateTime:a(_)?.toISO(),displayName:s("Unnamed link")}}))),J=T(()=>j.check(a(F).value)),oe=T(()=>!a(J)||a(k)),ne=async()=>{const he=await re(),ae=[],ue=he.filter(jr);return ue.length&&ue.map(({reason:be})=>be).forEach(be=>{if(console.error(be),be.response?.status===400){const me=be.response.data.error;me.message=et.upperFirst(me.message),ae.push(me)}}),ae.length?(F.error=s(ae[0].message),Promise.reject()):he};t({onConfirm:async(he={})=>{if(a(u)){const ue=(await ne()).filter(Br);ue.length&&(d("opencloud-embed:share",ue.map(({value:be})=>be.webUrl)),d("opencloud-embed:share-links",ue.map(({value:be})=>({url:be.webUrl,...he.copyPassword&&{password:a(F).value}})))),o(e.modal.id);return}await i({createLinkHandler:ne,password:he.copyPassword?a(F).value:void 0}),o(e.modal.id)}});const fe=he=>{F.value=he,F.error=void 0},we=he=>{V.value=he},$e=()=>l.generatePassword();return ft(()=>{const he=a(N)[a(V)];he&&he.$el.focus(),a(M)&&(F.value=l.generatePassword())}),(he,ae)=>{const ue=te("oc-icon"),be=te("oc-text-input"),me=te("oc-datepicker"),De=te("oc-list"),_e=te("oc-drop");return D(),K(ke,null,[W("div",gR,[S.value?(D(),K("div",yR,[Q(ue,{class:"mr-2",name:$.value,"fill-type":"line"},null,8,["name"]),Q(Zh,{"model-value":V.value,"available-link-type-options":L.value,"onUpdate:modelValue":we},null,8,["model-value","available-link-type-options"])])):(D(),K("div",vR,[Q(ue,{class:"mr-2",name:$.value,"fill-type":"line"},null,8,["name"]),W("div",bR,[W("span",{class:"font-semibold",textContent:R.toDisplayString(P.value)},null,8,wR),W("span",{class:"text-sm",textContent:R.toDisplayString(Z.value)},null,8,SR)])])),S.value?ie("",!0):(D(),ee(a(Ut),{key:2,class:"link-modal-advanced-mode-button","gap-size":"xsmall",appearance:"raw","no-hover":"",onClick:ae[0]||(ae[0]=ut=>B())},{default:X(()=>[Q(ue,{name:"settings-3",size:"small","fill-type":"fill"}),W("span",{textContent:R.toDisplayString(a(s)("Options"))},null,8,kR)]),_:1}))]),W("div",CR,[S.value?(D(),ee(be,{key:I.value,"model-value":F.value,type:"password","password-policy":a(j),"generate-password-method":$e,"error-message":F.error,label:a(s)("Password"),"required-mark":M.value,class:"link-modal-password-input","onUpdate:modelValue":fe},null,8,["model-value","password-policy","error-message","label","required-mark"])):F.value?(D(),K("div",TR,[W("span",{textContent:R.toDisplayString(a(s)("Password:"))},null,8,xR),W("span",{textContent:R.toDisplayString(F.value)},null,8,AR)])):ie("",!0),S.value?(D(),ee(me,{key:2,class:"mt-2","min-date":a(ht.DateTime).now(),label:a(s)("Expiry date"),"is-dark":a(b).isDark,onDateChanged:q},null,8,["min-date","label","is-dark"])):ie("",!0)]),W("div",RR,[Q(a(Ut),{class:"link-modal-cancel oc-modal-body-actions-cancel ml-2",onClick:ae[1]||(ae[1]=ut=>he.$emit("cancel"))},{default:X(()=>[it(R.toDisplayString(a(s)("Cancel")),1)]),_:1}),W("div",{class:R.normalizeClass(["ml-2",{"oc-button-group":F.value}])},[Q(a(Ut),{class:"link-modal-confirm oc-modal-body-actions-confirm",appearance:"filled",disabled:oe.value,onClick:ae[2]||(ae[2]=ut=>he.$emit("confirm"))},{default:X(()=>[it(R.toDisplayString(C.value),1)]),_:1},8,["disabled"]),F.value?(D(),ee(a(Ut),{key:0,class:"link-modal-confirm oc-modal-body-actions-confirm-secondary-trigger p-1",appearance:"filled",disabled:oe.value,"aria-label":a(s)("More options")},{default:X(()=>[Q(ue,{size:"small",name:"arrow-down-s"}),W("span",ER,R.toDisplayString(a(s)("More options")),1)]),_:1},8,["disabled","aria-label"])):ie("",!0),F.value?(D(),ee(_e,{key:1,"drop-id":"oc-modal-body-actions-confirm-secondary-drop",toggle:".oc-modal-body-actions-confirm-secondary-trigger",mode:"click","padding-size":"small",title:a(s)("More options"),"close-on-click":""},{default:X(()=>[Q(De,null,{default:X(()=>[W("li",null,[Q(a(Ut),{class:"oc-modal-body-actions-confirm-password",appearance:"raw","justify-content":"left",onClick:ae[3]||(ae[3]=ut=>he.$emit("confirm",{copyPassword:!0}))},{default:X(()=>[it(R.toDisplayString(A.value),1)]),_:1})])]),_:1})]),_:1},8,["title"])):ie("",!0)],2)])],64)}}}),DR=({enforceModal:e=!1}={})=>{const t=Ee(),n=Ze(),{$gettext:r,$ngettext:s}=de.useGettext(),o=Ct(),i=Lt(),l=Nt(),{defaultLinkType:u}=Hi(),{addLink:d}=Jn(),{dispatchModal:c}=Ke(),{copyLink:f}=Xl(),p=({space:m,resources:b})=>{const S=o.sharingPublicPasswordEnforcedFor.read_only===!0;if(e||S){c({title:s("Copy link for »%{resourceName}«","Copy links for the selected items",b.length,{resourceName:b[0].name}),customComponent:em,customComponentAttrs:()=>({space:m,resources:b}),hideActions:!0});return}const k=b.map(C=>d({clientService:t,space:m,resource:C,options:{"@libre.graph.quickLink":!1,displayName:r("Unnamed link"),type:a(u)}}));f({createLinkHandler:()=>l.addTask(()=>Promise.allSettled(k))})},h=({resources:m})=>{if(!m.length)return!1;for(const b of m)if(!b.canShare({user:n.user,ability:i})||z.isProjectSpaceResource(b)&&b.disabled)return!1;return!0};return{actions:T(()=>[{name:"create-links",icon:"link",handler:p,label:()=>r("Create links"),isVisible:h,class:"oc-files-actions-create-links"}])}},FR=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=Me(),r=Ze(),{$gettext:s}=de.useGettext(),{dispatchModal:o}=Ke(),i=Pn(),{isEnabled:l}=wr(),{openEditor:u}=bn(),d=Ee(),c=Re(),{resources:f,currentFolder:p,areFileExtensionsShown:h}=ve.storeToRefs(c),{isFileNameValid:g}=Wr(),m=T(()=>i.fileExtensions.filter(({newFileMenu:w})=>!!w)),b=(w,C)=>(c.upsertResource(w),u(C,a(e),w)),S=(w,C,A)=>{let I=s("New file")+`.${C}`;a(f).some(_=>_.name===I)&&(I=pn(I,C,a(f))),h.value||(I=z.extractNameWithoutExtension({name:I,extension:C}));const N=h.value?[0,I.length-(C.length+1)]:null;o({title:s("Create a new file"),confirmText:s("Create"),hasInput:!0,inputValue:I,inputLabel:s("File name"),inputRequiredMark:!0,inputSelectionRange:N,onConfirm:async _=>{h.value||(_=`${_}.${C}`);try{let F;if(A.createFileHandler)F=await A.createFileHandler({fileName:_,space:a(e),currentFolder:a(p)});else if(A.type==="folder"){const V=We.join(a(p).path,_);F=await d.webdav.createFolder(a(e),{path:V})}else{const V=We.join(a(p).path,_);F=await d.webdav.putFileContents(a(e),{path:V})}return c.upsertResource(F),t({title:s("»%{fileName}« was created successfully",{fileName:F.name})}),a(l)?void 0:b(F,A)}catch(F){console.error(F),n({title:s("Failed to create file"),errors:[F]})}},onInput:(_,F)=>{const V=h.value?_:`${_}.${C}`,Z={path:We.join(a(p).path,V),name:V,extension:C},{isValid:P,error:$}=g(Z,V);F(P?null:$)}})};return{actions:T(()=>{const w=[],C={};for(const A of a(m)||[])A.hasPriority?C[A.extension]=A:C[A.extension]=C[A.extension]||A;for(const[,A]of Object.entries(C))w.push({name:"create-new-file",icon:"add",handler:I=>S(I,A.extension,A),label:()=>s(A.newFileMenu.menuTitle()),isVisible:()=>a(p)?.canUpload({user:r.user}),class:"oc-files-actions-create-new-file",ext:A.extension,isExternal:A.app?.startsWith("external-")});return w}),openFile:b}},tm=()=>{const e=At("scrollTo"),t=At("details"),n=Re(),{openSideBarPanel:r}=Pt(),s=T(()=>ot(a(e))),o=T(()=>ot(a(t))),i=(u,d={forceScroll:!1,topbarElement:null})=>{const c=document.querySelectorAll(`[data-item-id='${u}']`)[0];if(!c){Xe.publish("app.files.navigate.page",{resourceId:u,forceScroll:d.forceScroll,topbarElement:d.topbarElement});return}const p=document.getElementById(d.topbarElement)?.offsetHeight||0+c.offsetHeight*2;(c.getBoundingClientRect().bottom>window.innerHeight||c.getBoundingClientRect().top<p||d.forceScroll)&&c.scrollIntoView({behavior:"smooth",block:"center"})};return Xe.subscribe("app.files.navigate.scrollTo",u=>i(u.resourceId,{forceScroll:u.forceScroll,topbarElement:u.topbarElement})),{scrollToResource:i,scrollToResourceFromRoute:(u,d)=>{if(!a(s)||!u.length)return;const c=a(u).find(f=>z.isIncomingShareResource(f)?f.remoteItemId===a(s):f.id===a(s));c&&c.processing!==!0&&(n.setSelection([c.id]),i(c.id,{forceScroll:!0,topbarElement:d}),a(o)&&r(a(o)))}}},IR=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=Me(),{dispatchModal:r}=Ke(),{$gettext:s}=de.useGettext(),{scrollToResource:o}=tm(),i=Re(),{resources:l,currentFolder:u}=ve.storeToRefs(i),d=Ee(),{isFileNameValid:c}=Wr(),f=async g=>{g=g.trimEnd();try{const m=We.join(a(u).path,g),b=await d.webdav.createFolder(a(e),{path:m});z.isShareSpaceResource(a(e))&&(b.remoteItemId=a(e).id),i.upsertResource(b),t({title:s("»%{folderName}« was created successfully",{folderName:g})}),await St(),o(b.id,{forceScroll:!0,topbarElement:"files-app-bar"})}catch(m){console.error(m),n({title:s("Failed to create folder"),errors:[m]})}},p=()=>{let g=s("New folder");a(l).some(m=>m.name===g)&&(g=pn(g,"",a(l))),r({title:s("Create a new folder"),confirmText:s("Create"),hasInput:!0,inputValue:g,inputLabel:s("Folder name"),inputRequiredMark:!0,onConfirm:f,onInput:(m,b)=>{const S={path:We.join(a(u).path,m),name:m,isFolder:!0},{isValid:k,error:w}=c(S,m,a(l));return b(k?null:w)}})};return{actions:T(()=>[{name:"create-folder",icon:"folder",handler:p,label:()=>s("New Folder"),isVisible:()=>a(u)?.canCreate(),class:"oc-files-actions-create-new-folder"}]),addNewFolder:f}};class fo{static Thumbnail=[36,36];static Tile=[1e3,1e3];static Preview=[1200,1200];static Avatar=64}class PR{static Thumbnail="thumbnail";static Preview="preview";static Avatar="avatar"}const Yl=10,$R=63,Zl=256;class OR{state;observeEnter;observeExit;onEnterCallCount;onExitCallCount;onEnter;onExit;threshold;unobserver;constructor(t,n,r){this.unobserver=t,this.threshold=n,this.onEnter=r.onEnter,this.onExit=r.onExit,this.observeEnter=!!r.onEnter,this.observeExit=!!r.onExit,this.onEnterCallCount=0,this.onExitCallCount=0}request(t,n){const r={element:n,unobserve:()=>this.unobserve(t,n)};t===0&&this.observeEnter&&this.onEnter?(this.onEnterCallCount++,this.onEnter({callCount:this.onEnterCallCount,...r})):this.state===0&&t===1&&this.observeExit&&this.onExit&&(this.onExitCallCount++,this.onExit({callCount:this.onExitCallCount,...r})),this.state=t}unobserve(t,n){t===0?this.observeEnter=!1:t===1&&(this.observeExit=!1),!this.observeEnter&&!this.observeExit&&this.unobserver(n)}}class nm{targets;intersectionObserver;options;constructor(t={}){this.options={root:t.root,rootMargin:t.rootMargin,threshold:t.threshold||0},this.targets=new WeakMap,this.intersectionObserver=new IntersectionObserver(this.trigger.bind(this),this.options)}observe(t,n={},r){!n.onEnter&&!n.onExit||(this.targets.set(t,new OR(this.unobserve.bind(this),r||this.options.threshold||0,{onEnter:n.onEnter,onExit:n.onExit})),this.intersectionObserver.observe(t))}unobserve(t){this.targets.delete(t),this.intersectionObserver.unobserve(t)}disconnect(){this.targets=new WeakMap,this.intersectionObserver.disconnect()}trigger(t){t.forEach(n=>{const r=this.targets.get(n.target);r&&r.request(n.isIntersecting&&n.intersectionRatio>r.threshold?0:1,n.target)})}}const po=ge({__name:"ResourceIcon",props:{resource:{},size:{default:"large"}},setup(e){const t={name:"resource-type-folder",color:"var(--oc-color-icon-folder)"},n={name:"resource-type-folder",color:"var(--oc-role-secondary)"},r={name:"layout-grid",color:"var(--oc-role-secondary)"},s={name:"layout-grid",color:"var(--oc-role-secondary)"},o={name:"resource-type-file",color:"var(--oc-role-on-surface)"},i=fd(),l=Un(dd),u=T(()=>a(m)?.name===t.name),d=T(()=>e.resource.type==="space"),c=T(()=>z.isProjectSpaceResource(e.resource)&&e.resource.disabled===!0),f=T(()=>e.resource.type==="folder"||e.resource.isFolder?t:o),p=T(()=>z.isPersonalSpaceResource(e.resource)),h=T(()=>e.resource.extension?.toLowerCase()),g=T(()=>e.resource.mimeType?.toLowerCase()),m=T(()=>{if(a(p))return n;if(a(c))return s;if(a(d))return r;const b=i[a(h)]||l?.mimeType[a(g)]||l?.extension[a(h)];return{...a(f),...b}});return(b,S)=>{const k=te("oc-icon");return D(),ee(k,{key:`resource-icon-${m.value.name}`,name:m.value.name,color:m.value.color,size:e.size,class:R.normalizeClass(["oc-resource-icon","inline-flex","items-center",{"opacity-80 grayscale":c.value,"[&_svg]:h-[70%]":!d.value&&!u.value}])},null,8,["name","color","size","class"])}}}),LR={name:"ResourceLink",props:{link:{type:Object,required:!1,default:null},resource:{type:Object,required:!0},isResourceClickable:{type:Boolean,required:!1,default:!0}},emits:["click"],setup:e=>{const t=Qe(),{options:n}=ve.storeToRefs(t);return{linkTarget:T(()=>a(n).cernFeatures&&e.link&&!e.resource.isFolder?"_blank":"_self")}},computed:{isNavigatable(){return this.resource?this.link&&!this.resource.disabled:!1},isClickable(){return this.isResourceClickable&&!this.resource?.disabled}},methods:{emitClick(e){!e||typeof e.stopPropagation!="function"||this.isNavigatable||this.$emit("click",e)}}},_R={key:1};function MR(e,t,n,r,s,o){return n.isResourceClickable?(D(),ee(Yt(o.isNavigatable?"router-link":"oc-button"),{key:0,to:o.isNavigatable?n.link:void 0,target:o.isNavigatable?e.linkTarget:void 0,rel:o.isNavigatable&&e.linkTarget==="_blank"?"noopener noreferrer":void 0,appearance:o.isNavigatable?void 0:"raw","gap-size":o.isNavigatable?void 0:"none","justify-content":o.isNavigatable?void 0:"left",type:o.isNavigatable?void 0:"button","no-hover":o.isNavigatable?void 0:!0,draggable:!1,class:"oc-resource-link max-w-full",onDragstart:t[0]||(t[0]=kt(()=>{},["prevent","stop"])),onClick:o.emitClick},{default:X(()=>[Se(e.$slots,"default",{},void 0,!0)]),_:3},40,["to","target","rel","appearance","gap-size","justify-content","type","no-hover","onClick"])):(D(),K("span",_R,[Se(e.$slots,"default",{},void 0,!0)]))}const Wi=Le(LR,[["render",MR],["__scopeId","data-v-15d92dd6"]]),NR=["data-test-resource-path","data-test-resource-name","data-test-resource-type","title"],BR={key:0,class:"truncate leading-4"},jR=["textContent"],zR=["textContent"],VR=["textContent"],ec=ge({__name:"ResourceName",props:{name:{},type:{},fullPath:{},pathPrefix:{default:""},extension:{default:""},isPathDisplayed:{type:Boolean,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},truncateName:{type:Boolean,default:!0}},setup(e){const t=T(()=>e.extension?e.name.slice(0,-e.extension.length-1):e.name),n=T(()=>e.extension?"."+e.extension:""),r=T(()=>{if(!e.isPathDisplayed)return null;const l=e.fullPath.replace(/^\//,"").split("/");return l.length<2?null:l.length===2?l[0]+"/":`…/${l[l.length-2]}/`}),s=T(()=>!e.isPathDisplayed||a(r)===e.fullPath?null:e.pathPrefix?Na.join(e.pathPrefix,e.fullPath):e.fullPath),o=T(()=>{if(!a(s))return e.isExtensionDisplayed?`${a(t)}${a(n)}`:a(t)}),i=T(()=>(a(r)||"")+e.name);return(l,u)=>{const d=Bt("oc-tooltip");return je((D(),K("span",{class:R.normalizeClass(["oc-resource-name flex min-w-0",[{"inline-block":!e.truncateName}]]),"data-test-resource-path":e.fullPath,"data-test-resource-name":i.value,"data-test-resource-type":e.type,title:o.value},[e.truncateName?(D(),K("span",BR,[W("span",{class:"oc-resource-basename whitespace-pre text-role-on-surface",textContent:R.toDisplayString(t.value)},null,8,jR)])):(D(),K("span",{key:1,class:"oc-resource-basename break-normal text-role-on-surface leading-4",textContent:R.toDisplayString(t.value)},null,8,zR)),e.extension&&e.isExtensionDisplayed?(D(),K("span",{key:2,class:"oc-resource-extension whitespace-pre text-role-on-surface leading-4",textContent:R.toDisplayString(n.value)},null,8,VR)):ie("",!0)],10,NR)),[[d,s.value]])}}}),UR={class:"flex"},qR=["textContent"],ho=ge({__name:"ResourceListItem",props:{resource:{},pathPrefix:{default:""},link:{default:null},isPathDisplayed:{type:Boolean,default:!1},parentFolderLink:{default:null},parentFolderName:{default:""},parentFolderLinkIconAdditionalAttributes:{default:()=>({})},isExtensionDisplayed:{type:Boolean,default:!0},isThumbnailDisplayed:{type:Boolean,default:!0},isIconDisplayed:{type:Boolean,default:!0},isResourceClickable:{type:Boolean,default:!0}},emits:["click"],setup(e,{emit:t}){const n=t,{$gettext:r}=de.useGettext(),s=T(()=>e.parentFolderLink?"router-link":"span"),o=T(()=>({"fill-type":"line",name:"folder-2",size:"small",...e.parentFolderLinkIconAdditionalAttributes})),i=T(()=>e.isThumbnailDisplayed&&Object.prototype.hasOwnProperty.call(e.resource,"thumbnail")),l=T(()=>e.resource.thumbnail),u=T(()=>e.resource.locked?r("This item is locked"):null),d=c=>{!c||typeof c.stopPropagation!="function"||n("click",c)};return(c,f)=>{const p=te("oc-image"),h=te("oc-icon"),g=Bt("oc-tooltip");return D(),K("div",{class:R.normalizeClass(["oc-resource inline-flex justify-start items-center max-w-full overflow-visible",{"pointer-events-none":!e.isResourceClickable}])},[e.isIconDisplayed?je((D(),ee(Wi,{key:0,resource:e.resource,link:e.link,"is-resource-clickable":e.isResourceClickable,class:R.normalizeClass(["relative",{"hover:underline":e.isResourceClickable}]),"aria-label":e.isResourceClickable?a(r)("Open »%{name}«",{name:e.resource?.name??""}):void 0,onClick:d},{default:X(()=>[i.value?je((D(),ee(p,{key:l.value,src:l.value,"data-test-thumbnail-resource-name":e.resource.name,class:"rounded-xs size-8 object-cover max-w-fit","aria-label":u.value,alt:""},null,8,["src","data-test-thumbnail-resource-name","aria-label"])),[[g,u.value]]):je((D(),ee(po,{key:1,"aria-label":u.value,"aria-hidden":"true",resource:e.resource},null,8,["aria-label","resource"])),[[g,u.value]])]),_:1},8,["resource","link","is-resource-clickable","class","aria-label"])),[[g,e.isResourceClickable?u.value:void 0]]):ie("",!0),W("div",{class:R.normalizeClass(["oc-resource-details block truncate",{"pl-2":e.isIconDisplayed}])},[Q(Wi,{resource:e.resource,"is-resource-clickable":e.isResourceClickable,link:e.link,class:R.normalizeClass(["hover:outline-offset-0 focus:outline-offset-0",{"hover:underline":e.isResourceClickable}]),onClick:d},{default:X(()=>[(D(),ee(ec,{key:e.resource.name,name:e.resource.name,"path-prefix":e.pathPrefix,extension:e.resource.extension,type:e.resource.type,"full-path":e.resource.path,"is-path-displayed":e.isPathDisplayed,"is-extension-displayed":e.isExtensionDisplayed},null,8,["name","path-prefix","extension","type","full-path","is-path-displayed","is-extension-displayed"]))]),_:1},8,["resource","is-resource-clickable","link","class"]),W("div",UR,[e.isPathDisplayed?(D(),ee(Yt(s.value),{key:0,to:e.parentFolderLink,class:R.normalizeClass(["parent-folder flex items-center truncate px-0.5 mr-2 -ml-0.5 hover:bg-transparent",{"cursor-pointer":e.parentFolderLink,"cursor-default":!e.parentFolderLink}])},{default:X(()=>[Q(h,at(o.value,{class:"mr-1"}),null,16),W("span",{class:"text truncate text-sm hover:underline",textContent:R.toDisplayString(e.parentFolderName)},null,8,qR)]),_:1},8,["to","class"])):ie("",!0)])],2)],2)}}}),rm=ge({__name:"ResourcePreview",props:{searchResult:{default:()=>({data:{}})},isClickable:{type:Boolean,default:!0},term:{default:""}},setup(e){const t=new nm,{triggerDefaultAction:n}=bn(),{getMatchingSpace:r}=Rt(),{getDefaultAction:s}=bn(),{loadPreview:o}=cc(),i=qt("resourceListItem"),{getPathPrefix:l,getParentFolderName:u,getParentFolderLink:d,getParentFolderLinkIconAdditionalAttributes:c,getFolderLink:f}=Tr(),p=Re(),h=H(),g=T(()=>p.areFileExtensionsShown),m=T(()=>({...e.searchResult.data,...a(h)&&{thumbnail:a(h)}})),b=T(()=>r(a(m))),S=T(()=>{const _=a(m);return z.isSpaceResource(_)&&_.disabled===!0}),k=()=>{n({space:a(b),resources:[a(m)]})},w=T(()=>e.isClickable?{parentFolderLink:d(a(m)),onClick:k}:{isResourceClickable:!1}),C=T(()=>{if(a(m).isFolder)return f(a(m));const _=s({resources:[a(m)],space:a(b)});if(!_?.route)return null;const F=_.route({space:a(b),resources:[a(m)]});return F.query={...F.query,contextRouteQuery:{...F.query?.contextRouteQuery||{},term:e.term}},F}),A=l(a(m)),I=u(a(m)),N=c(a(m));return ft(()=>{a(S)&&a(i).parentElement.classList.add("disabled");const _=async()=>{const V=await o({space:a(b),resource:a(m),dimensions:fo.Thumbnail,cancelRunning:!0,updateStore:!1});V&&(h.value=V)},F=et.debounce(({unobserve:V})=>{V(),_()},250);t.observe(a(i).$el,{onEnter:F,onExit:F.cancel})}),Xt(()=>{t.disconnect()}),(_,F)=>(D(),ee(ho,at({ref_key:"resourceListItem",ref:i,resource:m.value,"path-prefix":a(A),"is-path-displayed":!0,link:C.value,"is-extension-displayed":g.value,"parent-folder-link-icon-additional-attributes":a(N),"parent-folder-name":a(I),"is-thumbnail-displayed":!!h.value},w.value),null,16,["resource","path-prefix","link","is-extension-displayed","parent-folder-link-icon-additional-attributes","parent-folder-name","is-thumbnail-displayed"]))}}),HR=7,WR=200,QR=ge({name:"CreateShortcutModal",components:{ResourcePreview:rm},props:{modal:{type:Object,required:!0},space:{type:Object,required:!0}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:n}){const r=Ee(),{$gettext:s}=de.useGettext(),{showMessage:o,showErrorMessage:i}=Me(),l=Ae(),{search:u}=Ml(),{getPathPrefix:d,getParentFolderName:c,getParentFolderLink:f,getParentFolderLinkIconAdditionalAttributes:p,getFolderLink:h}=Tr(),g=Re(),{resources:m,currentFolder:b}=ve.storeToRefs(g),S=qt("dropRef"),k=H(""),w=H(""),C=H(null),A=H(null),I=H(!1);let N;const _=ue=>{const be=ue.trim();return M(be)?be:`https://${be}`},F=T(()=>_(a(k))),V=T(()=>!!a(m).find(ue=>ue.name===`${a(w)}.url`)),Z=T(()=>a(V)||!a(w)||!a(k));ze(Z,()=>{t("update:confirmDisabled",a(Z))},{immediate:!0});const P=T(()=>a(V)?s("»%{name}« already exists",{name:`${a(w)}.url`}):/[/]/.test(a(w))?s('Shortcut name cannot contain "/"'):""),$=Ft.useTask(function*(ue,be){C.value=null,be=`name:"*${be}*" NOT name:"*.url"`;try{C.value=yield u(be,HR)}catch{}}),L=et.debounce(()=>{$.perform(a(k))},WR),M=ue=>["http://","https://"].some(me=>me.startsWith(ue)||ue.startsWith(me)),j=()=>{C.value=null,k.value=a(F);try{let ue=new URL(a(F)).host;a(m).some(be=>be.name===`${ue}.url`)&&(ue=pn(`${ue}.url`,"url",a(m)).slice(0,-4)),w.value=ue}catch{}},B=ue=>{C.value=null;const be=new URL(window.location.href);let me=ue.data.name;k.value=`${be.origin}/f/${ue.id}`,a(m).some(De=>De.name===`${me}.url`)&&(me=pn(`${me}.url`,"url",a(m)).slice(0,-4)),w.value=me},q=ue=>a(A)===ue,re=(ue=!1)=>{const be=Array.from(document.querySelectorAll("li.selectable-item"));let me=a(A)!==null?a(A):ue?be.length:-1;const De=ue?-1:1;do if(me+=De,me<0||me>be.length-1)return null;while(be[me].classList.contains("disabled"));return me},J=()=>{A.value=re(!0)},oe=()=>{A.value=re(!1)},ne=ue=>{a(I)&&(ue.stopPropagation(),a(S).hide())},pe=ue=>{a(I)&&(ue.stopPropagation(),a(A)!==null&&(a(A)===0?j():B(a(C)?.values?.[a(A)-1]),a(S).hide()))},fe=()=>{I.value=!1,A.value=null},we=()=>{I.value=!0,A.value=0},$e=()=>{k.value.trim().length&&a(S).show()},he=async()=>{if(await St(),w.value=k.value.trim(),!k.value.trim().length){a(S).hide();return}a(S).show(),nn(l,"files-public-link")||L()},ae=async()=>{try{const be=`[InternetShortcut]
12
+ URL=${Tc.sanitize(_(a(k)),{USE_PROFILES:{html:!0}})}`,me=z.urlJoin(a(b).path,`${a(w)}.url`),De=await r.webdav.putFileContents(e.space,{path:me,content:be});g.upsertResource(De),o({title:s("Shortcut was created successfully")})}catch(ue){console.error(ue),i({title:s("Failed to create shortcut"),errors:[ue]})}};return ft(async()=>{await St(),N=new xc(a(S)?.$refs?.drop)}),ze(C,async()=>{await St(),!(!a(I)||!N)&&(N.unmark(),N.mark(a(k),{element:"span",className:"mark-highlight",exclude:[".selectable-item-url *",".create-shortcut-modal-search-separator *"]}))},{deep:!0}),ze(A,()=>{if(!a(I)||typeof a(S)?.$el?.scrollTo!="function")return;const ue=a(S).$el.querySelectorAll(".selectable-item");ue[a(A)]&&a(S).$el.scrollTo(0,a(A)===null?0:ue[a(A)].getBoundingClientRect().y-ue[a(A)].getBoundingClientRect().height)}),n({onConfirm:ae}),{inputUrl:k,inputFilename:w,dropRef:S,dropItemUrl:F,searchResult:C,confirmButtonDisabled:Z,inputFileNameErrorMessage:P,searchTask:$,dropItemUrlClicked:j,dropItemResourceClicked:B,getPathPrefix:d,getFolderLink:h,getParentFolderLink:f,getParentFolderName:c,getParentFolderLinkIconAdditionalAttributes:p,onKeyEnterDrop:pe,onKeyDownDrop:oe,onKeyUpDrop:J,onKeyEscDrop:ne,onHideDrop:fe,onShowDrop:we,onInputUrlInput:he,onClickUrlInput:$e,isDropItemActive:q,onConfirm:ae}}}),KR={class:"flex items-center mb-1"},GR={for:"create-shortcut-modal-url-input"},JR=["textContent"],XR={key:0,class:"p-1 flex justify-center"},YR={class:"create-shortcut-modal-search-separator text-role-on-surface-variant text-sm pl-1"},ZR=["textContent"],eE={key:0,class:"flex w-full mt-4"},tE={class:"flex items-center mb-1"},nE={for:"create-shortcut-modal-filename-input"};function rE(e,t,n,r,s,o){const i=te("oc-contextual-helper"),l=te("oc-text-input"),u=te("oc-icon"),d=te("oc-button"),c=te("oc-spinner"),f=te("resource-preview"),p=te("oc-list"),h=te("oc-drop");return D(),K(ke,null,[Q(l,{id:"create-shortcut-modal-url-input",modelValue:e.inputUrl,"onUpdate:modelValue":[t[0]||(t[0]=g=>e.inputUrl=g),e.onInputUrlInput],placeholder:"example.org",label:e.$gettext("Webpage or file"),onKeydown:[Ns(e.onKeyUpDrop,["up"]),Ns(e.onKeyDownDrop,["down"]),Ns(e.onKeyEscDrop,["esc"]),Ns(e.onKeyEnterDrop,["enter"])],onClick:e.onClickUrlInput},{label:X(()=>[W("div",KR,[W("label",GR,[it(R.toDisplayString(e.$gettext("Webpage or file"))+" ",1),t[2]||(t[2]=W("span",{class:"text-role-error","aria-hidden":"true"},"*",-1))]),Q(i,{text:e.$gettext("Enter the target URL of a webpage or the name of a file. Users will be directed to this webpage or file."),title:e.$gettext("Webpage or file"),class:"ml-1"},null,8,["text","title"])])]),_:1},8,["modelValue","label","onKeydown","onUpdate:modelValue","onClick"]),Q(h,{ref:"dropRef",toggle:"#create-shortcut-modal-url-input",class:"w-lg","padding-size":"remove","drop-id":"create-shortcut-modal-contextmenu",mode:"manual",position:"bottom-start","close-on-click":"","enforce-drop-on-mobile":"",onHideDrop:e.onHideDrop,onShowDrop:e.onShowDrop},{default:X(()=>[Q(p,null,{default:X(()=>[W("li",{class:R.normalizeClass(["selectable-item selectable-item-url",{active:e.isDropItemActive(0)}])},[Q(d,{class:"w-full",appearance:"raw","justify-content":"left",onClick:e.dropItemUrlClicked},{default:X(()=>[Q(u,{name:"external-link"}),W("span",{textContent:R.toDisplayString(e.dropItemUrl)},null,8,JR)]),_:1},8,["onClick"])],2),e.searchTask.isRunning?(D(),K("li",XR,[Q(c)])):ie("",!0),e.searchResult?.values?.length?(D(),K(ke,{key:1},[W("li",YR,[W("span",{textContent:R.toDisplayString(e.$gettext("Link to a file"))},null,8,ZR)]),(D(!0),K(ke,null,Ge(e.searchResult.values,(g,m)=>(D(),K("li",{key:m,class:R.normalizeClass(["selectable-item",{active:e.isDropItemActive(m+1)}])},[Q(d,{class:"w-full",appearance:"raw","justify-content":"left",onClick:b=>e.dropItemResourceClicked(g)},{default:X(()=>[Q(f,{"search-result":g,"is-clickable":!1},null,8,["search-result"])]),_:2},1032,["onClick"])],2))),128))],64)):ie("",!0)]),_:1})]),_:1},8,["onHideDrop","onShowDrop"]),e.inputFilename?(D(),K("div",eE,[Q(l,{id:"create-shortcut-modal-filename-input",modelValue:e.inputFilename,"onUpdate:modelValue":t[1]||(t[1]=g=>e.inputFilename=g),label:e.$gettext("Shortcut name"),class:"w-full","error-message":e.inputFileNameErrorMessage,"fix-message-line":!0},{label:X(()=>[W("div",tE,[W("label",nE,[it(R.toDisplayString(e.$gettext("Shortcut name"))+" ",1),t[3]||(t[3]=W("span",{class:"text-role-error","aria-hidden":"true"},"*",-1))]),Q(i,{text:e.$gettext("Shortcut name as it will appear in the file list."),title:e.$gettext("Shortcut name"),class:"ml-1"},null,8,["text","title"])])]),_:1},8,["modelValue","label","error-message"])])):ie("",!0)],64)}const sm=Le(QR,[["render",rE]]),sE=({space:e})=>{const{dispatchModal:t}=Ke(),{$gettext:n}=de.useGettext(),r=Re(),{currentFolder:s}=ve.storeToRefs(r);return{actions:T(()=>[{name:"create-shortcut",icon:"external-link",handler:()=>{t({title:n("Create a Shortcut"),confirmText:n("Create"),customComponent:sm,customComponentAttrs:()=>({space:a(e)})})},label:()=>n("New Shortcut"),isVisible:()=>a(s)?.canCreate(),class:"oc-files-actions-create-new-shortcut"}])}},tc=()=>{const{showMessage:e,showErrorMessage:t}=Me(),{can:n}=Lt(),{$gettext:r,$ngettext:s}=de.useGettext(),{createSpace:o}=ms(),i=Ee(),l=Ae(),u=T(()=>n("create-all","Drive")),{dispatchModal:d}=Ke(),c=Qe(),f=Ue(),p=Re(),{isSpaceNameValid:h}=Wr(),g=async({spaceName:S,resources:k,space:w})=>{const{webdav:C}=i,A=new sr({concurrency:c.options.concurrentRequests.resourceBatchActions}),I=[];try{const N=await o(S);f.upsertSpace(N),k.length===1&&k[0].isFolder&&(k=(await C.listFiles(w,{path:k[0].path})).children);for(const _ of k)I.push(A.add(()=>C.copyFiles(w,_,N,{path:_.name})));await Promise.all(I),p.resetSelection(),e({title:r("Space was created successfully")})}catch(N){console.error(N);const _=N.statusCode===425?r("Some files could not be copied"):r("Creating space failed…");t({title:_,errors:[N]})}},m=({resources:S,space:k})=>{d({title:s("Create Space from »%{resourceName}«","Create Space from selection",S.length,{resourceName:S[0].name}),message:s("Create Space with the content of »%{resourceName}«.","Create Space with the selected files.",S.length,{resourceName:S[0].name}),contextualHelperLabel:r("The marked elements will be copied."),contextualHelperData:{title:r("Restrictions"),text:r("Shares, versions and tags will not be copied.")},confirmText:r("Create"),hasInput:!0,inputLabel:r("Space name"),inputRequiredMark:!0,onInput:(w,C)=>{const{isValid:A,error:I}=h(w);C(A?null:I)},onConfirm:w=>g({spaceName:w,space:k,resources:S})})};return{actions:T(()=>[{name:"create-space-from-resource",icon:"function",handler:m,label:()=>r("Create Space from selection"),isVisible:({resources:S,space:k})=>!(!S.length||!a(u)||!rt(l,"files-spaces-generic")||!z.isPersonalSpaceResource(k)),class:"oc-files-actions-create-space-from-resource-trigger"}])}},mo=()=>{const e=Ze(),t=Ct(),{displayDialog:n,filesList_delete:r}=wm(),{$gettext:s}=de.useGettext();return{actions:T(()=>[{name:"delete",icon:"delete-bin-5",label:()=>s("Delete"),handler:({resources:i})=>{r(i)},isVisible:({resources:i})=>i.length?i.every(l=>l.canBeDeleted()&&!z.isSpaceResource(l)&&!z.isIncomingShareResource(l)&&!z.isTrashResource(l)&&!l.isShareRoot()):!1,isDisabled:({resources:i})=>i.length===1&&i[0].locked,disabledTooltip:()=>s("File can't be deleted because it is currently locked."),class:"oc-files-actions-delete-trigger"},{name:"delete-permanent",icon:"delete-bin-5",label:()=>s("Delete"),handler:({space:i,resources:l})=>{n(i,l)},isVisible:({space:i,resources:l})=>!l.length||!t.filesPermanentDeletion||z.isProjectSpaceResource(i)&&!i.canDeleteFromTrashBin({user:e.user})?!1:l.every(z.isTrashResource),class:"oc-files-actions-delete-permanent-trigger"}])}},Qi=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Ae(),{$gettext:r,$ngettext:s}=de.useGettext(),o=Ee(),i=Nt(),l=Qe(),{updateResourceField:u}=Re(),d=async({resources:f})=>{const p=[],h=[],g=new sr({concurrency:l.options.concurrentRequests.resourceBatchActions});if(f.forEach(m=>{h.push(g.add(async()=>{try{const{graphAuthenticated:b}=o;await b.driveItems.deleteDriveItem(m.driveId,m.id),u({id:m.id,field:"syncEnabled",value:!1})}catch(b){console.error(b),p.push(b)}}))}),await Promise.all(h),p.length===0){rt(n,"files-spaces-generic")&&(e({title:s("Sync for the selected share was disabled successfully","Sync for the selected shares was disabled successfully",f.length)}),n.push(tn("files-shares-with-me")));return}t({title:s("Failed to disable sync for the the selected share","Failed to disable sync for the selected shares",f.length),errors:p})};return{actions:T(()=>[{name:"disable-sync",icon:"spam-3",handler:f=>i.addTask(()=>d(f)),label:()=>r("Disable sync"),isVisible:({space:f,resources:p})=>!pt(n,"files-shares-with-me")&&!rt(n,"files-spaces-generic")||p.length===0||rt(n,"files-spaces-generic")&&(f?.driveType!=="share"||p.length>1||p[0].path!=="/")?!1:p.some(h=>h.syncEnabled),class:"oc-files-actions-disable-sync-trigger"}])}},om=()=>Gn("$archiverService"),Ki=()=>{const{showErrorMessage:e}=Me(),t=Ae(),n=om(),{$ngettext:r,$gettext:s,current:o}=de.useGettext(),i=yr(),l=rr(),u=({space:f,resources:p})=>(p.length>1&&(p=p.filter(h=>h.canDownload()&&!z.isProjectSpaceResource(h))),n.triggerDownload({fileIds:p.map(h=>h.fileId),...f&&z.isPublicSpaceResource(f)&&{publicToken:f.id,publicLinkPassword:i.publicLinkPassword}}).catch(h=>{console.error(h),e({title:r("Failed to download the selected folder.","Failed to download the selected files.",p.length),errors:[h]})})),d=f=>{const p=a(n.capability);return p?f.reduce((g,m)=>g+parseInt(`${m.size}`),0)>parseInt(p.max_size):void 0};return{actions:T(()=>[{name:"download-archive",icon:"inbox-archive",handler:f=>{u(f)},label:()=>s("Download"),disabledTooltip:({resources:f})=>d(f)?s("The selection exceeds the allowed archive size (max. %{maxSize})",{maxSize:zt(a(n.capability).max_size,o)}):"",isDisabled:({resources:f})=>d(f),isVisible:({resources:f})=>a(l)&&!rt(t,"files-spaces-generic")&&!nn(t,"files-public-link")&&!mt(t,"files-common-favorites")&&!mt(t,"files-common-search")&&!pt(t,"files-shares-with-me")&&!pt(t,"files-shares-with-others")&&!pt(t,"files-shares-via-link")&&!mt(t,"files-common-search")||!a(n.available)||f.length===0||f.length===1&&!f[0].isFolder||f.length>1&&f.every(h=>z.isProjectSpaceResource(h))||z.isProjectSpaceResource(f[0])&&f[0].disabled?!1:!f.some(h=>!h.canDownload()),class:"oc-files-actions-download-archive-trigger"}])}},nc=e=>{const{showErrorMessage:t}=Me(),{getMatchingSpace:n}=Rt(),r=e?.clientService||Ee(),{$gettext:s}=de.useGettext(),o=Ze();return{downloadFile:async(l=null,u,d=null)=>{try{l||(l=n(u));const c=await r.webdav.getFileUrl(l,u,{version:d,username:o.user?.onPremisesSamAccountName});ul(c,u.name)}catch(c){console.error(c),t({title:s("Download failed"),desc:s("File could not be located"),errors:[c]})}}}},ws=()=>{const e=Ae(),{$gettext:t}=de.useGettext(),n=rr(),r=Zi(),{downloadFile:s}=nc(),o=({space:l,resources:u})=>{s(l,u[0])};return{actions:T(()=>[{name:"download-file",icon:"file-download",handler:o,label:()=>t("Download"),isVisible:({resources:l})=>a(n)&&!a(r)&&!rt(e,"files-spaces-generic")&&!nn(e,"files-public-link")&&!mt(e,"files-common-favorites")&&!mt(e,"files-common-search")&&!pt(e,"files-shares-with-me")&&!pt(e,"files-shares-with-others")&&!pt(e,"files-shares-via-link")||l.length!==1||l[0].isFolder?!1:l[0].canDownload(),class:"oc-files-actions-download-file-trigger"}])}},oE=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Ze(),r=Ct(),{$gettext:s}=de.useGettext(),o=Ee(),{dispatchModal:i}=Ke(),l=Re(),u=Ue(),d=Nt(),c=async({space:h})=>{try{await o.webdav.clearTrashBin(h),e({title:s("All deleted files were removed")}),l.resetSelection(),u.updateSpaceField({id:h.id,field:"hasTrashedItems",value:!1}),l.resources.some(z.isTrashResource)&&l.clearResources()}catch(g){console.error(g),t({title:s("Failed to empty trash bin"),errors:[g]})}},f=({resources:h})=>{i({title:s("Empty trash bin for »%{name}«",{name:h[0].name}),confirmText:s("Delete"),message:s("Are you sure you want to permanently delete the items in »%{name}«? You can’t undo this action.",{name:h[0].name}),hasInput:!1,onConfirm:()=>d.addTask(()=>c({space:h[0]}))})};return{actions:T(()=>[{name:"empty-trash-bin",icon:({resources:h})=>h[0]?.hasTrashedItems?"delete-bin-2":"delete-bin-7",label:()=>s("Empty trash bin"),handler:f,isVisible:({resources:h})=>h.length!==1||!r.filesPermanentDeletion||!z.isSpaceResource(h[0])?!1:h[0].canDeleteFromTrashBin({user:n.user}),isDisabled:({resources:h})=>!h[0].hasTrashedItems,class:"oc-files-actions-empty-trash-bin-trigger"}]),emptyTrashBin:c}},Gi=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Ae(),{$gettext:r,$ngettext:s}=de.useGettext(),o=Ee(),i=Nt(),l=Qe(),u=Re(),{updateResourceField:d}=u,c=async({resources:p})=>{const h=[],g=[],m=new sr({concurrency:l.options.concurrentRequests.resourceBatchActions});if(p.forEach(b=>{g.push(m.add(async()=>{try{const{graphAuthenticated:S}=o;await S.driveItems.createDriveItem(b.driveId,{name:b.name,remoteItem:{id:b.fileId}}),d({id:b.id,field:"syncEnabled",value:!0})}catch(S){console.error(S),h.push(S)}}))}),await Promise.all(g),h.length===0){u.resetSelection(),rt(n,"files-spaces-generic")&&e({title:s("Sync for the selected share was enabled successfully","Sync for the selected shares was enabled successfully",p.length)});return}t({title:s("Failed to enable sync for the the selected share","Failed to enable sync for the selected shares",p.length),errors:h})};return{actions:T(()=>[{name:"enable-sync",icon:"check",handler:p=>i.addTask(()=>c(p)),label:()=>r("Enable sync"),isVisible:({space:p,resources:h})=>!pt(n,"files-shares-with-me")&&!rt(n,"files-spaces-generic")||h.length===0||rt(n,"files-spaces-generic")&&(a(p)?.driveType!=="share"||h.length>1||h[0].path!=="/")?!1:h.some(g=>!g.syncEnabled),class:"oc-files-actions-enable-sync-trigger"}])}},rc=()=>{const{showErrorMessage:e}=Me(),t=Ct(),n=Ae(),{$gettext:r}=de.useGettext(),s=Ee(),o=rr(),i=Lt(),l=Re(),u=Sr(),d=async({space:f,resources:p})=>{try{const h=!p[0].starred;await s.webdav.setFavorite(f,p[0],h),l.updateResourceField({id:p[0].id,field:"starred",value:h}),h||u.publish("app.files.list.removeFromFavorites",p[0].id)}catch(h){const g=r('Failed to change favorite state of "%{file}"',{file:p[0].name});e({title:g,errors:[h]})}};return{actions:T(()=>[{name:"favorite",icon:"star",handler:d,label:({resources:f})=>f[0].starred?r("Remove from favorites"):r("Add to favorites"),isVisible:({resources:f})=>a(o)&&!rt(n,"files-spaces-generic")&&!mt(n,"files-common-favorites")||f.length!==1?!1:t.filesFavorites&&i.can("create","Favorite"),class:"oc-files-actions-favorite-trigger"}])}};function iE(e,t){const n=e.isReceivedShare()||e.isMounted(),r=t===""&&n;return e.canBeDeleted()&&!r}const Ji=()=>{const e=Ae(),{cutResources:t}=Zs(),n=de.useGettext(),{$gettext:r}=n,s=Re(),{currentFolder:o}=ve.storeToRefs(s),i=T(()=>Ys()?r("⌘ + X"):r("Ctrl + X")),l=({resources:d})=>{t(d)};return{actions:T(()=>[{name:"cut",icon:"scissors",handler:l,shortcut:a(i),label:()=>r("Cut"),isVisible:({resources:d})=>!rt(e,"files-spaces-generic")&&!nn(e,"files-public-link")&&!mt(e,"files-common-favorites")||d.length===0||!a(o)||d.length===1&&d[0].locked?!1:!d.some(f=>iE(f,a(o).path)===!1),class:"oc-files-actions-move-trigger"}])}},im=()=>{const e=Ae(),{$gettext:t}=de.useGettext(),n=Re(),{currentFolder:r}=ve.storeToRefs(n),s=T(()=>nn(e,"files-public-link")?us("files-public-link"):jt(e,"files-trash-overview")?gr("files-trash-generic"):gn("files-spaces-generic"));return{actions:T(()=>[{name:"navigate",icon:"folder-open",label:()=>t("Navigate"),isVisible:({resources:i})=>i.length!==1||a(r)!==null&&Bs(i[0],a(r))||z.isTrashResource(i[0])?!1:i[0].isFolder||i[0].type==="space",route:({space:i,resources:l})=>Ws({},a(s),In(i,{path:l[0].path,fileId:l[0].fileId})),class:"oc-files-actions-navigate-trigger"}])}},am=()=>{const{$gettext:e}=de.useGettext(),{getDefaultAction:t}=bn();return{actions:T(()=>[{name:"open",icon:"eye",label:()=>e("Open"),handler:r=>{const s=t({...r,omitSystemActions:!0});!s||!Object.hasOwn(s,"handler")||s.handler(r)},route:r=>{const s=t({...r,omitSystemActions:!0});if(!(!s||!Object.hasOwn(s,"route")))return s.route(r)},isVisible:r=>{const s=t({...r,omitSystemActions:!0});return s?s.isVisible(r):!1},class:"oc-files-actions-default-editor-trigger"}])}},aE=()=>{const{showErrorMessage:e}=Me(),t=Ae(),{$gettext:n}=de.useGettext(),r=rr(),s=Zi(),o=Ee(),i=d=>{const c=/URL=(.+)/,f=d.match(c);if(f&&f[1])return f[1];throw new Error("unable to extract url")},l=async({resources:d,space:c})=>{try{const f=new URL(window.location.href),p=(await o.webdav.getFileContents(c,d[0])).body;let h=i(p);if(h=h.match(/^http[s]?:\/\//)?h:`https://${h}`,h=Tc.sanitize(h,{USE_PROFILES:{html:!0}}),h.startsWith(f.origin)){window.location.href=h;return}window.open(h)}catch(f){console.error(f),e({title:n("Failed to open shortcut"),errors:[f]})}};return{actions:T(()=>[{name:"open-shortcut",icon:"external-link",category:"context",handler:l,label:()=>n("Open shortcut"),isVisible:({resources:d})=>a(r)&&!a(s)&&!rt(t,"files-spaces-generic")&&!nn(t,"files-public-link")&&!mt(t,"files-common-favorites")&&!mt(t,"files-common-search")&&!pt(t,"files-shares-with-me")&&!pt(t,"files-shares-with-others")&&!pt(t,"files-shares-via-link")||d.length!==1||d[0].extension!=="url"?!1:d[0].canDownload(),class:"oc-files-actions-open-short-cut-trigger"}]),extractUrl:i}},lE=ge({name:"AppLoadingSpinner"}),cE={class:"flex items-center justify-center size-full"};function uE(e,t,n,r,s,o){const i=te("oc-spinner");return D(),K("div",cE,[Q(i,{id:"app-loading-spinner",size:"large","aria-hidden":!0,"aria-label":""})])}const sc=Le(lE,[["render",uE]]),dE=ge({name:"FilePickerModal",components:{AppLoadingSpinner:sc},props:{modal:{type:Object,required:!0},allowedFileTypes:{type:Array,required:!0},parentFolderLink:{type:Object,required:!0},callbackFn:{type:Function,required:!0}},setup(e){const t=H(),n=H(!0),r=Ae(),{removeModal:s}=Ke(),o=On(),i=r.resolve(e.parentFolderLink),l=o.currentTheme.name,u=new URL(i.href,window.location.origin);u.searchParams.append("hide-logo","true"),u.searchParams.append("embed","true"),u.searchParams.append("embed-target","file"),u.searchParams.append("embed-delegate-authentication","false"),u.searchParams.append("embed-file-types",e.allowedFileTypes.join(","));const d=()=>{n.value=!1,a(t).contentWindow.focus()},c=({data:p})=>{if(p.name!=="opencloud-embed:file-pick")return;const{resource:h,locationQuery:g}=p.data;e.callbackFn({resource:h,locationQuery:g}),s(e.modal.id)},f=({data:p})=>{p.name==="opencloud-embed:cancel"&&s(e.modal.id)};return ft(()=>{window.addEventListener("message",c),window.addEventListener("message",f)}),Xt(()=>{window.removeEventListener("message",c),window.removeEventListener("message",f)}),{isLoading:n,onLoad:d,iframeTitle:l,iframeSrc:u.href,iframeRef:t,onFilePick:c}}}),fE={class:"h-full",tabindex:"0"},pE=["title","src"];function hE(e,t,n,r,s,o){const i=te("app-loading-spinner");return D(),K("div",fE,[e.isLoading?(D(),ee(i,{key:0})):ie("",!0),je(W("iframe",{ref:"iframeRef",class:"size-full",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...l)=>e.onLoad&&e.onLoad(...l))},null,40,pE),[[Zu,!e.isLoading]])])}const lm=Le(dE,[["render",hE]]),cm=(e={})=>{const t=Ae(),{getMatchingSpace:n}=Rt(e);return{createFolderLink:s=>{const{path:o,fileId:i,resource:l}=s,u=a(e.space)||n(l);return u?jt(t,"files-trash-overview")?gr("files-trash-generic",In(u)):gn("files-spaces-generic",In(u,{path:o,fileId:i})):{}}}},Tr=(e={})=>{const t=Ct(),{$gettext:n}=de.useGettext(),{getInternalSpace:r,getMatchingSpace:s,isResourceAccessible:o}=Rt(),{createFolderLink:i}=cm(e);return{getPathPrefix:p=>{const h=a(e.space)||s(p);return z.isProjectSpaceResource(h)?Na.join(n("Spaces"),h.name):z.isShareSpaceResource(h)?Na.join(n("Shares"),h.name):h.name},getFolderLink:p=>i({path:p.path,fileId:p.fileId,resource:p}),getParentFolderLink:p=>{const h=a(e.space)||s(p),g=o({space:h,path:We.dirname(p.path)});return p.remoteItemId&&p.path==="/"||!g?tn("files-shares-with-me"):z.isProjectSpaceResource(p)?gn("files-spaces-projects"):i({path:We.dirname(p.path),...p.parentFolderId&&{fileId:p.parentFolderId},resource:p})},getParentFolderName:p=>{const h=a(e.space)||s(p),g=o({space:h,path:We.dirname(p.path)});if(z.isShareRoot(p)||p.id===h.id&&z.isShareSpaceResource(h)||!g)return n("Shared with me");const b=z.extractParentFolderName(p);if(b)return b;if(z.isShareSpaceResource(h))return h.name;if(t.spacesProjects){if(z.isProjectSpaceResource(p))return n("Spaces");if(h?.driveType==="project")return h.name}return n("Personal")},getParentFolderLinkIconAdditionalAttributes:p=>z.isProjectSpaceResource(p)||z.isProjectSpaceResource(r(p.storageId)||{})&&p.path.split("/").length===2?{name:"layout-grid","fill-type":"fill"}:{}}},um=({appId:e})=>{const{$gettext:t}=de.useGettext(),n=rr(),{dispatchModal:r}=Ke(),s=Pn(),{apps:o}=ve.storeToRefs(s),i=Ae(),{getParentFolderLink:l}=Tr(),{getMatchingSpace:u}=Rt(),{getEditorRouteOpts:d}=bn(),c=({resources:h})=>{const g=a(o)[e],m=l(h[0]),b=g.extensions.map(S=>S.extension?S.extension:S.mimeType);r({elementClass:"file-picker-modal",title:t("Open file in %{app}",{app:g.name}),customComponent:lm,hideActions:!0,customComponentAttrs:()=>({allowedFileTypes:b,parentFolderLink:m,callbackFn:p}),focusTrapInitial:!1})},f=T(()=>[{name:"open-with-app",icon:"folder-open",handler:c,label:()=>t("Open"),isVisible:()=>!a(n),class:"oc-files-actions-open-with-app-trigger"}]),p=({resource:h,locationQuery:g})=>{const m=u(h),b=z.isShareSpaceResource(m)?m.id:void 0,S=d(a(i.currentRoute).name,m,h,b);S.query={...S.query,...g};const k=i.resolve(S),w=new URL(k.href,window.location.origin);window.open(w.href,"_blank")};return{actions:f,onFilePicked:p}},dm=()=>{const e=Ae(),t=Ee(),{getMatchingSpace:n}=Rt(),{$gettext:r,$ngettext:s}=de.useGettext(),o=Zs(),{startWorker:i}=uh(),l=Re(),{currentFolder:u}=ve.storeToRefs(l),d=T(()=>Ys()?r("⌘ + V"):r("Ctrl + V")),c=T(()=>o.action===Js.Cut?Wn.MOVE:Wn.COPY),f=async({targetSpace:g,sourceSpace:m,resources:b})=>{const S=new ud(m,b,g,a(u),u,t,r,s),k=await S.getTransferData(a(c));if(!k.length)return;const w=a(u)?.id;i(k,async({successful:C,failed:A})=>{if(S.showResultMessage(A,C,a(c)),!C.length||a(u)&&w!==a(u).id)return;const I=[],N=[];for(const _ of C)I.push((async()=>{const F=await t.webdav.getFileInfo(g,_);N.push(F)})());await Promise.allSettled(I),z.isShareSpaceResource(g)&&N.forEach(_=>{_.remoteItemId=g.id}),l.upsertResources(N)})},p=async({space:g})=>{const m=o.resources.reduce((S,k)=>{if(k.storageId in S)return S[k.storageId].resources.push(k),S;const w=n(k);return w.id in S||(S[w.id]={space:w,resources:[]}),S[w.id].resources.push(k),S},{}),b=Object.values(m).map(({space:S,resources:k})=>f({targetSpace:g,sourceSpace:S,resources:k}));await Promise.all(b),o.clearClipboard()};return{actions:T(()=>[{name:"paste",icon:"clipboard",handler:p,label:()=>r("Paste"),shortcut:a(d),isVisible:({resources:g})=>o.resources.length===0||!rt(e,"files-spaces-generic")&&!nn(e,"files-public-link")&&!mt(e,"files-common-favorites")||g.length===0?!1:nn(e,"files-public-link")&&a(u)?a(u)?.canCreate():!0,class:"oc-files-actions-copy-trigger"}])}},Xi=()=>{const{showErrorMessage:e}=Me(),t=Ct(),n=Ae(),{$gettext:r}=de.useGettext(),s=Ee(),o=Qe(),{dispatchModal:i}=Ke(),l=Ze(),u=Lt(),d=Re(),{setCurrentFolder:c,upsertResource:f}=d,{isFileNameValid:p}=Wr(),h=async(b,S,k)=>{let w=d.currentFolder;try{const C=We.join(We.dirname(S.path),k);await s.webdav.moveFiles(b,S,b,{path:C});const A=Bs(S,w);if(z.isShareSpaceResource(b)&&S.isReceivedShare()){if(b.rename(k),A)return w={...w},w.name=k,c(w),n.push(In(b,{path:"",fileId:S.fileId}));const N={...S};N.name=k,f(N);return}if(A)return w={...w},za(b,w,C),c(w),n.push(In(b,{path:C,fileId:S.fileId}));const I={...S};za(b,I,C),f(I)}catch(C){console.error(C);let A=r('Failed to rename "%{file}" to »%{newName}«',{file:S.name,newName:k});C.statusCode===423&&(A=r("Failed to rename »%{file}« to »%{newName}« - the file is locked",{file:S.name,newName:k})),e({title:A,errors:[C]})}},g=async({space:b,resources:S})=>{const k=d.currentFolder;let w;if(Bs(S[0],k)){const P=We.dirname(k.path);w=(await s.webdav.listFiles(b,{path:P})).children}const C=d.areFileExtensionsShown,A=async P=>{C||(P=`${P}.${S[0].extension}`),await h(b,S[0],P)},I=(P,$)=>{C||(P=`${P}.${S[0].extension}`);const{isValid:L,error:M}=p(S[0],P,w);$(L?null:M)},N=z.extractNameWithoutExtension(S[0]),_=!S[0].isFolder&&!C?N:S[0].name,F=S[0].isFolder?r("Rename folder »%{name}«",{name:_}):r("Rename file »%{name}«",{name:_}),V=!S[0].isFolder&&!C?N:S[0].name,Z=S[0].isFolder||!C?null:[0,N.length];i({title:F,confirmText:r("Rename"),hasInput:!0,inputValue:V,inputSelectionRange:Z,inputLabel:S[0].isFolder?r("Folder name"):r("File name"),inputRequiredMark:!0,onConfirm:A,onInput:I})};return{actions:T(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:g,isVisible:({resources:b})=>jt(n,"files-trash-generic")||pt(n,"files-shares-with-me")&&!t.sharingCanRename||b.length!==1||(o.options.routing.fullShareOwnerPaths?b.some(w=>w.remoteItemPath&&w.path):b.some(w=>w.remoteItemId&&w.path==="/"))||b.length===1&&b[0].locked?!1:!b.some(w=>!w.canRename({user:l.user,ability:u})||w.processing),class:"oc-files-actions-rename-trigger"}]),renameResource:h}},go=({showSuccessMessage:e=!0,onRestoreComplete:t}={})=>{const{showMessage:n,showErrorMessage:r}=Me(),s=Ze(),o=Ae(),{$gettext:i,$ngettext:l}=de.useGettext(),u=Ee(),d=Ue(),c=Re(),{startWorker:f}=dh(),p=async(S,k)=>{const w={},C=[],A=[],I=[];for(const N of k){const _=We.dirname(N.path);let F=[];if(_ in w)F=w[_];else{try{F=(await u.webdav.listFiles(S,{path:_})).children}catch{I.push(_)}w[_]=F}F.some(Z=>Z.name===N.name)||A.filter(Z=>Z.id!==N.id).some(Z=>Z.path===N.path)?C.push(N):A.push(N)}return{existingResourcesByPath:w,conflicts:C,resolvedResources:A,missingFolderPaths:I.filter(N=>!w[N]?.length)}},h=async S=>{let k=0;const w=[],C=S.length;let A=!1,I;for(const N of S){const _=N.type==="folder";if(A){w.push({resource:N,strategy:I});continue}const F=C-k,Z=await new Ba(i,l).resolveFileExists({name:N.name,isFolder:_},F,!1);k++,Z.doForAllConflicts&&(A=!0,I=Z.strategy),w.push({resource:N,strategy:Z.strategy})}return w},g=(S,k,w)=>{const C=a(o.currentRoute);f({space:S,resources:k,missingFolderPaths:w},async({successful:A,failed:I})=>{if(A.length){let N;A.length===1?N=i("%{resource} was restored successfully",{resource:A[0].name}):N=i("%{resourceCount} files restored successfully",{resourceCount:A.length.toString()}),e&&n({title:N}),C.name===a(o.currentRoute).name&&C.query?.fileId===a(o.currentRoute).query?.fileId&&(c.removeResources(A),c.resetSelection());const F=await u.graphAuthenticated.drives.getDrive(S.id);d.updateSpaceField({id:F.id,field:"spaceQuota",value:F.spaceQuota}),t?.({space:S,resources:A})}if(I.length){let N;I.length===1?N=i('Failed to restore "%{resource}"',{resource:I[0].resource.name}):N=i("Failed to restore %{resourceCount} files",{resourceCount:I.length.toString()}),r({title:N,errors:I.map(({error:_})=>_)})}})},m=async({space:S,resources:k})=>{const w=k.sort((Z,P)=>Z.path.length-P.path.length),{existingResourcesByPath:C,conflicts:A,resolvedResources:I,missingFolderPaths:N}=await p(S,w),_=await h(A),F=_.filter(Z=>Z.strategy===hn.REPLACE).map(Z=>Z.resource);I.push(...F);const V=_.filter(Z=>Z.strategy===hn.KEEP_BOTH).map(Z=>Z.resource);for(let Z of V){Z={...Z};const P=We.dirname(Z.path),$=C[P]||[],L=z.extractExtensionFromFile(Z),M=pn(Z.name,L,[...$,..._.map(j=>j.resource),...I]);Z.name=M,Z.path=z.urlJoin(P,M),I.push(Z)}return g(S,I,N)};return{actions:T(()=>[{name:"restore",icon:"arrow-go-back",label:()=>i("Restore"),handler:m,isVisible:({space:S,resources:k})=>!jt(o,"files-trash-generic")||!k.every(w=>z.isTrashResource(w)&&w.canBeRestored())||z.isProjectSpaceResource(S)&&!S.canRestoreFromTrashbin({user:s.user})?!1:k.length>0,class:"oc-files-actions-restore-trigger"}]),restoreResources:g,collectConflicts:p}},mE=ge({name:"SaveAsModal",components:{AppLoadingSpinner:sc},props:{modal:{type:Object,required:!0},parentFolderLink:{type:Object,required:!0},originalResource:{type:Object,required:!0},content:{type:String,required:!0}},setup(e){const t=H(),n=H(!0),r=On(),{$gettext:s}=de.useGettext(),o=Ae(),i=Ee(),{removeModal:l}=Ke(),{showMessage:u,showErrorMessage:d}=Me(),{getMatchingSpace:c}=Rt(),{getEditorRouteOpts:f}=bn(),p=o.resolve(e.parentFolderLink),h=r.currentTheme.name,g=new URL(p.href,window.location.origin);g.searchParams.append("hide-logo","true"),g.searchParams.append("embed","true"),g.searchParams.append("embed-target","location"),g.searchParams.append("embed-choose-file-name","true"),g.searchParams.append("embed-delegate-authentication","false"),g.searchParams.append("embed-choose-file-name-suggestion",e.originalResource.name);const m=()=>{n.value=!1,a(t).contentWindow.focus()},b=async({data:C})=>{if(C.name!=="opencloud-embed:select")return;const{resources:A,fileName:I,locationQuery:N}=C.data,_=A[0],F=c(_);try{const V=await S({destinationFolder:_,fileName:I,space:F});u({title:s("»%{fileName}« was saved successfully",{fileName:V.name})}),k({resource:V,space:F,locationQuery:N})}catch(V){console.error(V),d({title:s("Unable to save »%{fileName}«",{fileName:I}),errors:[V]}),console.error(V)}l(e.modal.id)},S=async({destinationFolder:C,fileName:A,space:I})=>{const{children:N}=await i.webdav.listFiles(I,{fileId:C.fileId},{davProperties:[Te.Name]});return N.find(F=>F.name===A)&&(A=pn(A,e.originalResource.extension,N)),i.webdav.putFileContents(I,{fileName:A,parentFolderId:C.id,content:e.content,path:z.urlJoin(C.path,A)})},k=({locationQuery:C,resource:A,space:I})=>{const N=z.isShareSpaceResource(I)?I.id:void 0,_=f(a(o.currentRoute).name,I,A,N);_.query={..._.query,...C};const F=o.resolve(_),V=new URL(F.href,window.location.origin);window.open(V.href,"_blank")},w=({data:C})=>{C.name==="opencloud-embed:cancel"&&l(e.modal.id)};return ft(()=>{window.addEventListener("message",b),window.addEventListener("message",w)}),Xt(()=>{window.removeEventListener("message",b),window.removeEventListener("message",w)}),{isLoading:n,onLoad:m,iframeTitle:h,iframeSrc:g.href,iframeRef:t,onLocationPick:b}}}),gE={class:"h-full",tabindex:"0"},yE=["title","src"];function vE(e,t,n,r,s,o){const i=te("app-loading-spinner");return D(),K("div",gE,[e.isLoading?(D(),ee(i,{key:0})):ie("",!0),je(W("iframe",{ref:"iframeRef",class:"size-full",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...l)=>e.onLoad&&e.onLoad(...l))},null,40,yE),[[Zu,!e.isLoading]])])}const fm=Le(mE,[["render",vE]]),pm=({content:e})=>{const{$gettext:t}=de.useGettext(),n=rr(),{dispatchModal:r}=Ke(),{getParentFolderLink:s}=Tr(),o=({resources:l})=>{const u=s(l[0]);r({elementClass:"save-as-modal",title:t("Save as"),customComponent:fm,hideActions:!0,customComponentAttrs:()=>({content:a(e),parentFolderLink:u,originalResource:l[0]}),focusTrapInitial:!1})};return{actions:T(()=>[{name:"save-as",icon:"save-2",handler:o,label:()=>t("Save as"),isVisible:({resources:l})=>!a(n)||l.length!==1,class:"oc-files-actions-save-as-trigger"}])}},bE={class:R.normalizeClass(["[&_.cropper-crop-box]:!outline-1","[&_.cropper-crop-box]:!outline-role-outline","[&_.cropper-line]:!bg-role-outline","[&_.cropper-point]:!bg-role-outline"])},wE={key:0,class:"max-h-[400px]"},SE=["src"],kE={class:"text-sm text-role-on-surface-variant flex items-center mt-1"},CE=["textContent"],hm=ge({__name:"SpaceImageModal",props:{modal:{},space:{},file:{}},setup(e,{expose:t}){const{showMessage:n,showErrorMessage:r}=Me(),{$gettext:s}=de.useGettext(),o=Ee(),i=Ue(),{createDefaultMetaFolder:l}=ms(),{getDefaultMetaFolder:u}=Ri(),{setCropperInstance:d}=Bl(),c=H(null),f=qt("imageRef"),p=H(null);t({onConfirm:async()=>{const b=a(c)?.getCroppedCanvas({imageSmoothingQuality:"high"}),S=await g(b);await m(S)}});const g=async b=>(await new Promise(k=>b.toBlob(k,"image/png"))).arrayBuffer(),m=async b=>{const S=o.graphAuthenticated;i.addToImagesLoading(e.space.id);let k=await u(e.space);k||(k=await l(e.space));const w={"Content-Type":"application/offset+octet-stream"};try{const{fileId:C,processing:A}=await o.webdav.putFileContents(e.space,{parentFolderId:k.id,fileName:"image.png",content:b,headers:w,overwrite:!0}),I=await S.drives.updateDrive(e.space.id,{name:e.space.name,special:[{specialFolder:{name:"image"},id:C}]});A||i.removeFromImagesLoading(e.space.id),i.updateSpaceField({id:e.space.id,field:"spaceImageData",value:I.spaceImageData}),n({title:s("Space image was set successfully")}),Xe.publish("app.files.spaces.uploaded-image",I)}catch(C){if(console.error(C),i.removeFromImagesLoading(e.space.id),C instanceof z.HttpError&&C.statusCode===507){r({title:s("Failed to set space image"),desc:s("Not enough quota to set the space image"),errors:[C]});return}r({title:s("Failed to set space image"),errors:[C]})}};return ft(async()=>{try{p.value=URL.createObjectURL(e.file),a(c)&&a(c)?.destroy(),await St(),c.value=new ra(a(f),{aspectRatio:16/9,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1}),d(c)}catch(b){r({title:s("Failed to load space image"),errors:[b]})}}),(b,S)=>{const k=te("oc-icon");return D(),K("div",bE,[p.value?(D(),K("div",wE,[W("img",{ref_key:"imageRef",ref:f,src:p.value},null,8,SE),W("div",kE,[Q(k,{class:"mr-1",name:"information",size:"small","fill-type":"line"}),W("span",{textContent:R.toDisplayString(a(s)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:a(s)("+-"),panKeys:a(s)("↑↓←→")}))},null,8,CE)])])):ie("",!0)])}}}),mm=()=>{const e=Ze(),t=Ae(),{$gettext:n}=de.useGettext(),r=Ee(),s=Nt(),{dispatchModal:o}=Ke(),i=async({space:u,resources:d})=>{const{getFileContents:c}=r.webdav,f=await c(u,d[0],{responseType:"blob"}),p=new File([f.body],d[0].name);o({title:n("Crop your Space image"),confirmText:n("Confirm"),customComponent:hm,customComponentAttrs:()=>({file:p,space:u})})};return{actions:T(()=>[{name:"set-space-image",icon:"image-edit",handler:u=>s.addTask(()=>i(u)),label:()=>n("Set as space image"),isVisible:({space:u,resources:d})=>d.length!==1||!d[0].hasPreview?.()||!d[0].mimeType?.includes("image/")||!rt(t,"files-spaces-generic")||!u||!z.isProjectSpaceResource(u)?!1:u.canEditImage({user:e.user}),class:"oc-files-actions-set-space-image-trigger"}])}},TE=()=>{const e=Ae(),{$gettext:t}=de.useGettext(),n=rr(),{openSideBarPanel:r}=Pt(),s=()=>{const i=jt(e,"files-trash-generic")?null:"actions";r(i)};return{actions:T(()=>[{name:"show-actions",icon:"slideshow-3",label:()=>t("All Actions"),handler:s,isVisible:({resources:i})=>a(n)?i.length===1:!1,class:"oc-files-actions-show-actions-trigger"}])}},oc=()=>{const e=Ae(),t=Re(),{openSideBar:n}=Pt(),{$gettext:r}=de.useGettext();return{actions:T(()=>[{name:"show-details",icon:"information",class:"oc-files-actions-show-details-trigger",label:()=>r("Details"),isVisible:({resources:o})=>jt(e,"files-trash-generic")?!1:o.length>0,handler({resources:o}){t.setSelection(o.map(({id:i})=>i)),n()}}])}},gm=()=>{const e=Ct(),{isPersonalSpaceRoot:t}=Rt();return{canListShares:({space:r,resource:s})=>!e.sharingApiEnabled||z.isPublicSpaceResource(r)||t(s)||z.isTrashResource(s)?!1:z.isIncomingShareResource(s)?s.sharePermissions.includes(z.GraphSharePermission.readPermissions):z.isShareSpaceResource(r)?r.graphPermissions?.includes(z.GraphSharePermission.readPermissions):!0}},ym=()=>{const e=Ct(),t=Lt(),n=Ze();return{canShare:({space:s,resource:o})=>!e.sharingApiEnabled||z.isShareSpaceResource(s)||z.isProjectSpaceResource(s)&&!s.canShare({user:n.user})?!1:o.canShare({ability:t,user:n.user})}},ic=()=>{const e=Ae(),{$gettext:t}=de.useGettext(),{canShare:n}=ym(),{openSideBarPanel:r}=Pt(),{interceptModifierClick:s}=Vr(),o=({resources:l,event:u})=>{const d=l[0];u&&s(u,d)||r("sharing")};return{actions:T(()=>[{name:"show-shares",icon:"user-add",label:()=>t("Share"),handler:o,isVisible:({space:l,resources:u})=>jt(e,"files-trash-generic")||u.length!==1?!1:n({space:l,resource:u[0]}),class:"oc-files-actions-show-shares-trigger"}])}},Yi=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Ae(),{$gettext:r}=de.useGettext(),s=Ee(),o=Nt(),i=Qe(),{updateResourceField:l,resetSelection:u}=Re(),d=async({resources:f})=>{const p=[],h=[],g=new sr({concurrency:i.options.concurrentRequests.resourceBatchActions}),m=!f[0].hidden;if(f.forEach(b=>{h.push(g.add(async()=>{try{await s.graphAuthenticated.driveItems.updateDriveItem(b.driveId,b.id,{"@UI.Hidden":m}),l({id:b.id,field:"hidden",value:m})}catch(S){console.error(S),p.push(S)}}))}),await Promise.all(h),p.length===0){u(),e({title:r(m?"The share was hidden successfully":"The share was unhidden successfully")});return}t({title:r(m?"Failed to hide the share":"Failed to unhide the share"),errors:p})};return{actions:T(()=>[{name:"toggle-hide-share",icon:"eye-off",handler:f=>o.addTask(()=>d(f)),label:({resources:f})=>f[0].hidden?r("Unhide"):r("Hide"),isVisible:({resources:f})=>f.length===0?!1:pt(n,"files-shares-with-me"),class:"oc-files-actions-hide-share-trigger"}])}},vm=()=>{const{$gettext:e}=de.useGettext(),{showErrorMessage:t}=Me(),{webdav:n}=Ee(),r=Ct(),s=Re(),{currentFolder:o}=ve.storeToRefs(s),{actions:i}=go({showSuccessMessage:!1,onRestoreComplete:async({space:f,resources:p})=>{if(pd({resourcesStore:s,parentFolderId:p[0].parentFolderId})){const{children:h}=await n.listFiles(f,{path:a(o).path});s.upsertResources(h.filter(({id:g})=>p.some(m=>m.id===l(g))))}}}),l=f=>f.includes("!")?f.split("!")[1]:f,u=async({space:f,resources:p,callback:h})=>{const g=p.map(m=>({...m,id:l(m.id)}));try{await a(i)[0].handler({space:f,resources:g}),h()}catch(m){console.error(m),t({title:e("Failed to restore files"),errors:[m]})}},d=T(()=>Ys()?e("⌘ + Z"):e("Ctrl + Z"));return{actions:T(()=>[{name:"undoDelete",icon:"arrow-go-back",shortcut:a(d),isVisible:({space:f})=>r.davTrashbin?z.isProjectSpaceResource(f)||z.isPersonalSpaceResource(f):!1,label:()=>e("Undo"),handler:u}])}},bm=()=>{const{$gettext:e}=de.useGettext(),{actions:t}=ws(),{downloadFile:n}=nc(),{dispatchModal:r}=Ke(),s=({space:i,resources:l})=>{r({title:e("No preview available for »%{name}«",{name:l[0].name}),confirmText:e("Download"),message:e("There is no preview available for this file. Do you want to download it instead?"),onConfirm:()=>{n(i,l[0])}})};return{actions:T(()=>[{name:"fallback-to-download",icon:"file-download",handler:s,label:()=>e("Download"),isVisible:i=>a(t)[0].isVisible(i),class:"oc-files-actions-fallback-to-download-trigger"}])}},wm=()=>{const e=Qe(),{showMessage:t,showErrorMessage:n,removeMessage:r}=Me(),s=Ae(),o=de.useGettext(),{getMatchingSpace:i}=Rt(),{$gettext:l,$ngettext:u}=o,d=Ee(),{dispatchModal:c}=Ke(),f=Ue(),p=Sr(),{bindKeyAction:h,removeKeyAction:g}=Ii(),{startWorker:m}=ch({concurrentRequests:e.options.concurrentRequests.resourceBatchActions}),{actions:b}=vm(),S=Re(),{currentFolder:k}=ve.storeToRefs(S),w=H([]),C=At("page","1"),A=T(()=>parseInt(ot(a(C)))),I=At("items-per-page","1"),N=T(()=>parseInt(ot(a(I)))),_=T(()=>od(a(w))),F=({space:M,filesToDelete:j,deletedFiles:B})=>{const q=B.length===1&&j.length===1?l('"%{item}" was moved to trash bin',{item:B[0].name}):u("%{itemCount} item was moved to trash bin","%{itemCount} items were moved to trash bin",B.length,{itemCount:B.length.toString()}),re=7,J=a(b)[0],oe=J.isVisible({space:M,resources:B});let ne;const pe=t({title:q,timeout:re,actions:[J],actionOptions:{space:M,resources:B,callback:()=>{r(pe),ne&&g(ne)}}});oe&&(ne=h({primary:Ln.Z,modifier:Fi.Ctrl},()=>(g(ne),J.handler({space:M,resources:B,callback:()=>{r(pe)}}))),setTimeout(()=>g(ne),re*1e3))},V=T(()=>{const M=a(_),j=M[0].type==="folder";let B=null;return M.length===1?(j?B=l("Permanently delete folder »%{name}«",{name:M[0].name}):B=l("Permanently delete file »%{name}«",{name:M[0].name}),B):u("Permanently delete selected resource?","Permanently delete %{amount} selected resources?",M.length,{amount:M.length.toString()})}),Z=T(()=>{const M=a(_),j=M[0].type==="folder";return M.length===1?l(j?"Are you sure you want to delete this folder? All its content will be permanently removed. This action cannot be undone.":"Are you sure you want to delete this file? All its content will be permanently removed. This action cannot be undone."):l("Are you sure you want to delete all selected resources? All their content will be permanently removed. This action cannot be undone.")}),P=M=>{const j=a(s.currentRoute);m({topic:"trashBinDelete",space:M,resources:a(_)},({successful:B,failed:q})=>{if(B.length){const re=B.length===1&&a(_).length===1?l('"%{item}" was deleted successfully',{item:B[0].name}):u("%{itemCount} item was deleted successfully","%{itemCount} items were deleted successfully",B.length,{itemCount:B.length.toString()});t({title:re})}q.forEach(({resource:re})=>{const J=l('Failed to delete "%{item}"',{item:re.name});n({title:J,errors:[new Error]})}),j.name===a(s.currentRoute).name&&j.query?.fileId===a(s.currentRoute).query?.fileId&&(S.removeResources(B),S.resetSelection())})};return{displayDialog:(M,j)=>{w.value=[...j],c({title:a(V),message:a(Z),confirmText:l("Delete"),onConfirm:()=>P(M)})},filesList_delete:M=>{w.value=[...M],S.addResourcesIntoDeleteQueue(a(w).map(({id:q})=>q)),a(w).forEach(({id:q})=>S.removeSelection(q));const j=a(M).reduce((q,re)=>{if(re.storageId in q)return q[re.storageId].resources.push(re),q;const J=i(re);return J.id in q||(q[J.id]={space:J,resources:[]}),q[J.id].resources.push(re),q},{}),B=a(k)?.id;return Object.values(j).map(({space:q,resources:re})=>{m({topic:"fileListDelete",space:q,resources:re},async({successful:J,failed:oe})=>{if(J.length&&(F({space:q,filesToDelete:re,deletedFiles:J}),p.publish("runtime.resource.deleted",J)),S.removeResourcesFromDeleteQueue(oe.map(({resource:ne})=>ne.id)),S.removeResourcesFromDeleteQueue(J.map(({id:ne})=>ne)),oe.forEach(({error:ne,resource:pe})=>{let fe=l('Failed to delete "%{resource}"',{resource:pe.name});ne.statusCode===423&&(fe=l('Failed to delete "%{resource}" - the file is locked',{resource:pe.name})),n({title:fe,errors:[ne]})}),B===a(k)?.id){S.removeResources(J);const ne=S.activeResources.length,pe=Math.ceil(a(ne)/a(N));a(A)>1&&a(A)>pe&&(C.value=pe.toString())}if(rt(s,"files-spaces-generic")&&!["public","share"].includes(q?.driveType)){const pe=await d.graphAuthenticated.drives.getDrive(a(M)[0].storageId);f.updateSpaceField({id:pe.id,field:"spaceQuota",value:pe.spaceQuota})}if(a(w).length&&Bs(a(w)[0],a(k)))return s.push(In(q,{path:We.dirname(a(w)[0].path),fileId:a(w)[0].parentFolderId}))})})}}},xE=()=>{const e=yt();return T(()=>a(e)?.query?.contextRouteName)},AE=e=>e==="files",rr=()=>{const e=yt();return T(()=>AE(al(a(e))))},Wr=()=>{const{$gettext:e}=de.useGettext(),t=Re();return{isSpaceNameValid:s=>s.trim()===""?{isValid:!1,error:e("The Space name cannot be empty")}:Fl(s)>Zl?{isValid:!1,error:e("The Space name is too long")}:s.trim()!==s?{isValid:!1,error:e("The Space name cannot start or end with whitespace")}:/[/\\.:?*"><|]/.test(s)?{isValid:!1,error:e(`The Space name cannot contain the following characters: / \\\\ . : ? * " > < |'`)}:{isValid:!0,error:void 0},isFileNameValid:(s,o,i=void 0)=>{if(!o)return{isValid:!1,error:e("The name cannot be empty")};if(/[/]/.test(o))return{isValid:!1,error:e('The name cannot contain "/"')};if(/[\\]/.test(o))return{isValid:!1,error:e('The name cannot contain "\\"')};if(o===".")return{isValid:!1,error:e('The name cannot be equal to "."')};if(o==="..")return{isValid:!1,error:e('The name cannot be equal to ".."')};if(o.trim()!==o)return{isValid:!1,error:e("The name cannot start or end with whitespace")};if(Fl(o)>Zl)return{isValid:!1,error:e("The name is too long")};const l=s.path.substring(0,s.path.length-s.name.length)+o;if((i||t.resources).some(d=>d.path===l&&d.name===o)){const d=e("The name »%{name}« is already taken");return{isValid:!1,error:e(d,{name:o})}}return{isValid:!0,error:void 0}}}},Zi=()=>T(()=>!!document.getElementById("files-global-search-options")),Sm=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Ze(),{$gettext:r,$ngettext:s}=de.useGettext(),o=Lt(),i=Ee(),l=yt(),{dispatchModal:u}=Ke(),d=Ue(),{removeResources:c}=Re(),f=m=>m.filter(b=>z.isProjectSpaceResource(b)&&b.canBeDeleted({user:n.user,ability:o})),p=async m=>{const b=i.graphAuthenticated,S=m.map(A=>b.drives.deleteDrive(A.id).then(()=>(c([A]),d.removeSpace(A),!0))),k=await Promise.allSettled(S),w=k.filter(Br);if(w.length){const A=w.length===1&&m.length===1?r("Space »%{space}« was deleted successfully",{space:m[0].name}):s("%{spaceCount} space was deleted successfully","%{spaceCount} spaces were deleted successfully",w.length,{spaceCount:w.length.toString()});e({title:A})}const C=k.filter(jr);if(C.length){C.forEach(console.error);const A=C.length===1&&m.length===1?r("Failed to delete space »%{space}«",{space:m[0].name}):s("Failed to delete %{spaceCount} space","Failed to delete %{spaceCount} spaces",C.length,{spaceCount:C.length.toString()});t({title:A,errors:C.map(I=>I.reason)})}a(l).name==="admin-settings-spaces"&&Xe.publish("app.admin-settings.list.load")},h=({resources:m})=>{const b=f(m);if(!b.length)return;const S=s("Are you sure you want to delete the selected space?","Are you sure you want to delete %{count} selected spaces?",b.length,{count:b.length.toString()});u({title:s("Delete Space »%{space}«?","Delete %{spaceCount} Spaces?",b.length,{space:b[0].name,spaceCount:b.length.toString()}),confirmText:r("Delete"),message:S,hasInput:!1,onConfirm:()=>p(b)})};return{actions:T(()=>[{name:"delete",icon:"delete-bin",label:()=>r("Delete"),handler:h,isVisible:({resources:m})=>!!f(m).length,class:"oc-files-actions-delete-trigger"}]),deleteSpaces:p}},km=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Ze(),{$gettext:r,$ngettext:s}=de.useGettext(),o=Lt(),i=Ee(),l=yt(),u=Ae(),{dispatchModal:d}=Ke(),c=Ue(),f=m=>m.filter(b=>z.isProjectSpaceResource(b)&&b.canDisable({user:n.user,ability:o})),p=async m=>{const b=a(l),S=i.graphAuthenticated,k=m.map(I=>S.drives.disableDrive(I.id).then(()=>(b.name==="files-spaces-generic"&&u.push({name:"files-spaces-projects"}),b.name==="admin-settings-spaces"&&(I.disabled=!0,I.spaceQuota={total:I.spaceQuota.total}),c.updateSpaceField({id:I.id,field:"disabled",value:!0}),!0))),w=await Promise.allSettled(k),C=w.filter(Br);if(C.length){const I=C.length===1&&m.length===1?r("Space »%{space}« was disabled successfully",{space:m[0].name}):s("%{spaceCount} space was disabled successfully","%{spaceCount} spaces were disabled successfully",C.length,{spaceCount:C.length.toString()});e({title:I})}const A=w.filter(jr);if(A.length){A.forEach(console.error);const I=A.length===1&&m.length===1?r("Failed to disable space »%{space}«",{space:m[0].name}):s("Failed to disable %{spaceCount} space","Failed to disable %{spaceCount} spaces",A.length,{spaceCount:A.length.toString()});t({title:I,errors:A.map(N=>N.reason)})}},h=({resources:m})=>{const b=f(m);if(!b.length)return;const S=s("If you disable the selected space, it can no longer be accessed. Only Space managers will still have access. Note: No files will be deleted from the server.","If you disable the %{count} selected spaces, they can no longer be accessed. Only Space managers will still have access. Note: No files will be deleted from the server.",b.length,{count:b.length.toString()}),k=r("Disable");d({title:s("Disable Space »%{space}«?","Disable %{spaceCount} Spaces?",b.length,{space:b[0].name,spaceCount:b.length.toString()}),confirmText:k,message:S,hasInput:!1,onConfirm:()=>p(b)})};return{actions:T(()=>[{name:"disable",icon:"stop-circle",label:()=>r("Disable"),handler:h,isVisible:({resources:m})=>!!f(m).length,class:"oc-files-actions-disable-trigger"}]),disableSpaces:p}},Cm=()=>{const e=Qe(),t=Ue(),n=Jn(),{showMessage:r,showErrorMessage:s}=Me(),o=Ae(),{$gettext:i}=de.useGettext(),l=Lt(),u=Ee(),d=Nt(),{upsertResource:c}=Re(),f=rt(o,"files-spaces-projects"),p=async m=>{const b=t.spaces.filter(z.isProjectSpaceResource),S=pn(m.name,"",b);try{let k=await u.graphAuthenticated.drives.createDrive({name:S,description:m.description,quota:{total:m.spaceQuota.total}});const w=await u.webdav.listFiles(m);if(w.children.length){const C=new sr({concurrency:e.options.concurrentRequests.resourceBatchActions}),A=[];for(const I of w.children)A.push(C.add(()=>u.webdav.copyFiles(m,I,k,{path:I.name})));await Promise.all(A)}if(m.spaceReadmeData||m.spaceImageData){const C={special:[]};if(m.spaceReadmeData){const A=await u.webdav.getFileInfo(k,{path:`.space/${m.spaceReadmeData.name}`});C.special.push({specialFolder:{name:"readme"},id:A.id})}if(m.spaceImageData){const A=await u.webdav.getFileInfo(k,{path:`.space/${m.spaceImageData.name}`});C.special.push({specialFolder:{name:"image"},id:A.id})}k=await u.graphAuthenticated.drives.updateDrive(k.id,C,n.graphRoles)}t.upsertSpace(k),f&&c(k),r({title:i("Space »%{space}« was duplicated successfully",{space:m.name})})}catch(k){console.error(k),s({title:i("Failed to duplicate space »%{space}«",{space:m.name}),errors:[k]})}},h=async({resources:m})=>{for(const b of m)b.disabled||!z.isProjectSpaceResource(b)||await p(b)};return{actions:T(()=>[{name:"duplicate",icon:"folders",label:()=>i("Duplicate"),handler:m=>d.addTask(()=>h(m)),isVisible:({resources:m})=>!m?.length||m.every(b=>b.disabled)||m.every(b=>!z.isProjectSpaceResource(b))?!1:l.can("create-all","Drive"),class:"oc-files-actions-duplicate-trigger"}]),duplicateSpace:p}},RE=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Ze(),{$gettext:r}=de.useGettext(),s=Lt(),o=Ee(),i=yt(),{dispatchModal:l}=Ke(),u=Ue(),d=(p,h)=>o.graphAuthenticated.drives.updateDrive(p.id,{name:p.name,description:h}).then(()=>{u.updateSpaceField({id:p.id,field:"description",value:h}),a(i).name==="admin-settings-spaces"&&(p.description=h),e({title:r("Space subtitle was changed successfully")})}).catch(m=>{console.error(m),t({title:r("Failed to change space subtitle"),errors:[m]})}),c=({resources:p})=>{p.length===1&&l({title:r("Change subtitle for space")+" "+p[0].name,confirmText:r("Confirm"),hasInput:!0,inputLabel:r("Space subtitle"),inputValue:p[0].description,onConfirm:h=>d(p[0],h)})};return{actions:T(()=>[{name:"editDescription",icon:"h-2",iconFillType:"none",label:()=>r("Edit subtitle"),handler:c,isVisible:({resources:p})=>p.length!==1?!1:p[0].canEditDescription({user:n.user,ability:s}),class:"oc-files-actions-edit-description-trigger"}]),editDescriptionSpace:d}},EE={name:"QuotaSelect",props:{totalQuota:{type:Number,default:0},maxQuota:{type:Number,default:0}},emits:["selectedOptionChange"],setup(){return{selectedOption:H(void 0),options:H([])}},computed:{quotaLimit(){return this.maxQuota||1e15},DEFAULT_OPTIONS(){return[{value:Math.pow(10,9),displayValue:this.getFormattedFileSize(Math.pow(10,9))},{value:2*Math.pow(10,9),displayValue:this.getFormattedFileSize(2*Math.pow(10,9))},{value:5*Math.pow(10,9),displayValue:this.getFormattedFileSize(5*Math.pow(10,9))},{value:10*Math.pow(10,9),displayValue:this.getFormattedFileSize(10*Math.pow(10,9))},{value:50*Math.pow(10,9),displayValue:this.getFormattedFileSize(50*Math.pow(10,9))},{value:100*Math.pow(10,9),displayValue:this.getFormattedFileSize(100*Math.pow(10,9))},{displayValue:this.$gettext("No restriction"),value:0}]}},watch:{totalQuota(){const e=this.options.find(t=>t.value===this.totalQuota);e&&(this.selectedOption=e)}},mounted(){this.setOptions(),this.selectedOption=this.options.find(e=>e.value===this.totalQuota)},methods:{onUpdate(e){this.selectedOption=e,this.$emit("selectedOptionChange",this.selectedOption)},optionSelectable(e){return e.selectable!==!1},isValueValidNumber(e){return et.isNumber(e)?e>0:/^[0-9]\d*(([.,])\d+)?$/g.test(e)},createOption(e){if(e=e.replace(",","."),!this.isValueValidNumber(e))return{displayValue:e,value:e,error:this.$gettext("Please enter only numbers"),selectable:!1};const t=parseFloat(e)*Math.pow(10,9);return t>this.quotaLimit?{value:t,displayValue:this.getFormattedFileSize(t),error:this.$gettext("Please enter a value equal to or less than %{ quotaLimit }",{quotaLimit:this.getFormattedFileSize(this.quotaLimit).toString()}),selectable:!1}:{value:t,displayValue:this.getFormattedFileSize(t)}},setOptions(){let e=[...this.DEFAULT_OPTIONS];this.maxQuota&&(e=e.filter(n=>this.totalQuota===0&&n.value===0?(n.selectable=!1,!0):n.value!==0&&n.value<=this.maxQuota)),e.find(n=>n.value===this.totalQuota)||e.push({displayValue:this.getFormattedFileSize(this.totalQuota),value:this.totalQuota,selectable:this.totalQuota<=this.quotaLimit}),e=[...e.filter(n=>n.value).sort((n,r)=>n.value-r.value),...e.filter(n=>!n.value)],this.options=e},getFormattedFileSize(e){const t=zt(e,this.$language.current);return this.isValueValidNumber(e)?t:e.toString()}}},DE={class:"quota-select-batch-action-form"},FE=["textContent"],IE={class:"flex justify-between"},PE=["textContent"],$E={key:0,class:"oc-text-input-danger"};function OE(e,t,n,r,s,o){const i=te("oc-icon"),l=te("oc-select");return D(),K("div",DE,[Q(l,at({ref:"select","model-value":r.selectedOption,selectable:o.optionSelectable,taggable:"","push-tags":"",clearable:!1,options:r.options,"create-option":o.createOption,"option-label":"displayValue",label:e.$gettext("Quota")},e.$attrs,{"onUpdate:modelValue":o.onUpdate}),{"selected-option":X(({displayValue:u})=>[e.$attrs["read-only"]?(D(),ee(i,{key:0,name:"lock",class:"mr-1",size:"small"})):ie("",!0),W("span",{textContent:R.toDisplayString(u)},null,8,FE)]),search:X(({attributes:u,events:d})=>[W("input",at({class:"vs__search"},u,Uo(d,!0)),null,16)]),option:X(({displayValue:u,error:d})=>[W("div",IE,[W("span",{textContent:R.toDisplayString(u)},null,8,PE)]),d?(D(),K("div",$E,R.toDisplayString(d),1)):ie("",!0)]),_:1},16,["model-value","selectable","options","create-option","label","onUpdate:modelValue"])])}const Tm=Le(EE,[["render",OE]]),LE={key:0,class:"mt-2"},_E=["textContent"],xm=ge({__name:"QuotaModal",props:{modal:{},spaces:{},warningMessage:{default:""},warningMessageContextualHelperData:{default:()=>{}},resourceType:{default:"space"}},emits:["update:confirmDisabled"],setup(e,{expose:t,emit:n}){const r=n,{showMessage:s,showErrorMessage:o}=Me(),{$gettext:i,$ngettext:l}=de.useGettext(),u=Ee(),d=Ae(),c=Ue(),f=Ct(),{spacesMaxQuota:p}=ve.storeToRefs(f),{updateResourceField:h}=Re(),g=H(e.spaces[0]?.spaceQuota?.total||0),m=C=>e.resourceType==="space"?l("Space quota was changed successfully","Quota of %{count} spaces was changed successfully",C,{count:C.toString()}):e.resourceType==="user"?l("User quota was changed successfully","Quota of %{count} users was changed successfully",C,{count:C.toString()}):i("Quota was changed successfully"),b=C=>e.resourceType==="space"?l("Failed to change space quota","Failed to change quota for %{count} spaces",C,{count:C.toString()}):e.resourceType==="user"?l("Failed to change user quota","Failed to change quota for %{count} users",C,{count:C.toString()}):i("Failed to change quota"),S=T(()=>!e.spaces.some(C=>C.spaceQuota.total!==a(g)));ze(S,()=>{r("update:confirmDisabled",a(S))},{immediate:!0});const k=C=>{g.value=C.value};return t({onConfirm:async()=>{const C=u.graphAuthenticated,A=e.spaces.map(async F=>{const V=await C.drives.updateDrive(F.id,{name:F.name,quota:{total:a(g)}});a(d.currentRoute).name==="admin-settings-spaces"&&Xe.publish("app.admin-settings.spaces.space.quota.updated",{spaceId:F.id,quota:V.spaceQuota}),a(d.currentRoute).name==="admin-settings-users"&&Xe.publish("app.admin-settings.users.user.quota.updated",{spaceId:F.id,quota:V.spaceQuota}),c.updateSpaceField({id:F.id,field:"spaceQuota",value:V.spaceQuota}),h({id:F.id,field:"spaceQuota",value:V.spaceQuota})}),I=await Promise.allSettled(A),N=I.filter(Br);N.length&&s({title:m(N.length)});const _=I.filter(jr);_.length&&(console.error(_),_.forEach(console.error),o({title:b(_.length),errors:_.map(F=>F.reason)}))}}),(C,A)=>{const I=te("oc-contextual-helper");return D(),K(ke,null,[Q(Tm,{"total-quota":g.value,"max-quota":a(p),"position-fixed":!0,onSelectedOptionChange:k},null,8,["total-quota","max-quota"]),e.warningMessage?(D(),K("div",LE,[W("span",{class:"oc-text-input-warning",textContent:R.toDisplayString(e.warningMessage)},null,8,_E),e.warningMessageContextualHelperData?(D(),ee(I,at({key:0,class:"pl-1"},e.warningMessageContextualHelperData),null,16)):ie("",!0)])):ie("",!0)],64)}}}),Am=()=>{const{dispatchModal:e}=Ke(),{$gettext:t}=de.useGettext(),n=Lt(),r=({resources:i})=>i.length===1?t("Change quota for Space »%{name}«",{name:i[0].name}):t("Change quota for %{count} Spaces",{count:i.length.toString()}),s=({resources:i})=>{e({title:r({resources:i}),customComponent:xm,customComponentAttrs:()=>({spaces:i,resourceType:"space"})})};return{actions:T(()=>[{name:"editQuota",icon:"cloud",label:()=>t("Edit quota"),handler:s,isVisible:({resources:i})=>!i||!i.length||i.some(l=>!z.isProjectSpaceResource(l)||z.isSpaceResource(l)&&!l.spaceQuota)?!1:n.can("set-quota-all","Drive"),class:"oc-files-actions-edit-quota-trigger"}])}};function Rm(){const{triggerDefaultAction:e}=bn();return{openWithDefaultApp:({space:n,resource:r})=>{if(!r||r.isFolder)return;e({...{resources:[r],space:n},omitSystemActions:!0})}}}const ME=()=>{const e=Ee(),{openWithDefaultApp:t}=Rm(),{createDefaultMetaFolder:n}=ms(),r=Ze(),s=Ue(),{$gettext:o}=de.useGettext(),{getDefaultMetaFolder:i}=Ri(),l=async(c,f)=>{const p=await e.webdav.putFileContents(c,{path:".space/readme.md",parentFolderId:f.id,fileName:"readme.md"}),h=await e.graphAuthenticated.drives.updateDrive(c.id,{name:c.name,special:[{specialFolder:{name:"readme"},id:p.id}]});return s.updateSpaceField({id:c.id,field:"spaceReadmeData",value:h.spaceReadmeData}),p},u=async({resources:c})=>{let f=null,p=await i(c[0]);if(p||(p=await n(c[0]),f=await l(c[0],p)),!f){const h=z.getRelativeSpecialFolderSpacePath(c[0],"readme");h?f=await e.webdav.getFileInfo(c[0],{path:h}):f=await l(c[0],p)}t({space:c[0],resource:f})};return{actions:T(()=>[{name:"editReadmeContent",icon:"article",label:()=>o("Edit description"),handler:u,isVisible:({resources:c})=>c.length!==1?!1:c[0].canEditReadme({user:r.user}),class:"oc-files-actions-edit-readme-content-trigger"}])}},Em=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Ze(),{$gettext:r}=de.useGettext(),s=Lt(),o=Ee(),i=yt(),{isSpaceNameValid:l}=Wr(),{dispatchModal:u}=Ke(),d=Ue(),c=(h,g)=>o.graphAuthenticated.drives.updateDrive(h.id,{name:g}).then(()=>{a(i).name==="admin-settings-spaces"&&(h.name=g),d.updateSpaceField({id:h.id,field:"name",value:g}),e({title:r("Space name was changed successfully")})}).catch(b=>{console.error(b),t({title:r("Failed to rename space"),errors:[b]})}),f=({resources:h})=>{h.length===1&&u({title:r("Rename space »%{name}«",{name:h[0].name}),confirmText:r("Rename"),hasInput:!0,inputLabel:r("Space name"),inputValue:h[0].name,inputRequiredMark:!0,onConfirm:g=>c(h[0],g),onInput:(g,m)=>{const{isValid:b,error:S}=l(g);m(b?null:S)}})};return{actions:T(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:f,isVisible:({resources:h})=>h.length!==1?!1:h[0].canRename({user:n.user,ability:s}),class:"oc-files-actions-rename-trigger"}]),renameSpace:c}},Dm=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Ze(),{$gettext:r,$ngettext:s}=de.useGettext(),o=Lt(),i=Ee(),l=Nt(),u=yt(),{dispatchModal:d}=Ke(),c=Ue(),f=m=>m.filter(b=>z.isProjectSpaceResource(b)&&b.canRestore({user:n.user,ability:o})),p=async m=>{const b=i.graphAuthenticated,S=m.map(A=>b.drives.updateDrive(A.id,{name:A.name},{headers:{Restore:"true"}}).then(I=>(a(u).name==="admin-settings-spaces"&&(A.disabled=!1,A.spaceQuota=I.spaceQuota),c.updateSpaceField({id:A.id,field:"disabled",value:!1}),!0))),k=await l.addTask(()=>Promise.allSettled(S));await c.loadGraphPermissions({ids:m.map(A=>A.id),graphClient:b});const w=k.filter(Br);if(w.length){const A=w.length===1&&m.length===1?r("Space »%{space}« was enabled successfully",{space:m[0].name}):s("%{spaceCount} space was enabled successfully","%{spaceCount} spaces were enabled successfully",w.length,{spaceCount:w.length.toString()});e({title:A})}const C=k.filter(jr);if(C.length){C.forEach(console.error);const A=C.length===1&&m.length===1?r("Failed to enable space »%{space}«",{space:m[0].name}):s("Failed to enable %{spaceCount} space","Failed to enable %{spaceCount} spaces",C.length,{spaceCount:C.length.toString()});t({title:A,errors:C.map(I=>I.reason)})}},h=({resources:m})=>{const b=f(m);if(!b.length)return;const S=s("If you enable the selected space, it can be accessed again.","If you enable the %{count} selected spaces, they can be accessed again.",b.length,{count:b.length.toString()}),k=r("Enable");d({title:s("Enable Space »%{space}«?","Enable %{spaceCount} Spaces?",b.length,{space:b[0].name,spaceCount:b.length.toString()}),confirmText:k,message:S,hasInput:!1,onConfirm:()=>p(b)})};return{actions:T(()=>[{name:"restore",icon:"play-circle",label:()=>r("Enable"),handler:h,isVisible:({resources:m})=>!!f(m).length,class:"oc-files-actions-restore-trigger"}]),restoreSpaces:p}},NE=()=>{const{$gettext:e}=de.useGettext(),t=Re(),{openSideBarPanel:n}=Pt(),r=({resources:o})=>{t.setSelection(o.map(({id:i})=>i)),n("space-share")};return{actions:T(()=>[{name:"show-members",icon:"group",label:()=>e("Members"),handler:r,isVisible:({resources:o})=>o.length===1&&!o[0].disabled,class:"oc-files-actions-show-details-trigger"}])}},BE=()=>{const e=Ae(),{$gettext:t}=de.useGettext(),n=s=>gr("files-trash-generic",{...In(s,{fileId:s.fileId})});return{actions:T(()=>[{name:"navigateToTrash",icon:"delete-bin-5",label:()=>t("Open trash bin"),handler:({resources:s})=>{e.push(n(s[0]))},isVisible:({resources:s})=>!(s.length!==1||!z.isProjectSpaceResource(s[0])&&!z.isPersonalSpaceResource(s[0])||s[0].disabled),class:"oc-files-actions-navigate-to-trash-trigger"}])}},jE=ge({name:"EmojiPickerModal",components:{},props:{modal:{type:Object,required:!0}},emits:["confirm"],setup(e,{emit:t}){const n=On(),{currentTheme:r}=ve.storeToRefs(n),s=T(()=>a(r).isDark?"dark":"light");return{onEmojiSelect:i=>{t("confirm",i)},theme:s}}});function zE(e,t,n,r,s,o){const i=te("oc-emoji-picker");return D(),ee(i,{theme:e.theme,onEmojiSelect:e.onEmojiSelect},null,8,["theme","onEmojiSelect"])}const Fm=Le(jE,[["render",zE]]),VE=()=>{const e=Ze(),{showMessage:t,showErrorMessage:n}=Me(),{$gettext:r}=de.useGettext(),s=Ee(),o=Nt(),i=Ue(),{createDefaultMetaFolder:l}=ms(),{dispatchModal:u}=Ke(),{getDefaultMetaFolder:d}=Ri(),c=({resources:g})=>{g.length===1&&u({elementClass:"w-auto",title:r("Set icon for »%{space}«",{space:g[0].name}),hideConfirmButton:!0,customComponent:Fm,focusTrapInitial:!1,onConfirm:m=>p(g[0],m)})},f=async g=>{const m=document.createElement("canvas"),b=m.getContext("2d"),S=16/9,k=720,w=k/S;m.width=k,m.height=w;const C=.4*k;b.font=`${C}px sans-serif`,b.textBaseline="middle",b.textAlign="center",b.fillText(g,m.width/2,m.height/2+15);const I=await yp(m);return gp(I)},p=async(g,m)=>{const b=s.graphAuthenticated,S=await f(m);let k=await d(g);return k||(k=await l(g)),o.addTask(async()=>{const w={"Content-Type":"application/offset+octet-stream"};try{const{fileId:C}=await s.webdav.putFileContents(g,{parentFolderId:k.id,fileName:"image.png",content:S,headers:w,overwrite:!0}),A=await b.drives.updateDrive(g.id,{name:g.name,special:[{specialFolder:{name:"image"},id:C}]});i.updateSpaceField({id:g.id,field:"spaceImageData",value:A.spaceImageData}),t({title:r("Space icon was set successfully")}),Xe.publish("app.files.spaces.uploaded-image",A)}catch(C){if(console.error(C),C instanceof z.HttpError&&C.statusCode===507){n({title:r("Failed to set space icon"),desc:r("Not enough quota to set the space icon"),errors:[C]});return}n({title:r("Failed to set space icon"),errors:[C]})}})};return{actions:T(()=>[{name:"set-space-icon",icon:"emoji-sticker",handler:c,label:()=>r("Set icon"),isVisible:({resources:g})=>g.length!==1?!1:g[0].canEditImage({user:e.user}),class:"oc-files-actions-set-space-icon-trigger"}]),setIconSpace:p}},UE=()=>{const e=Ze(),{$gettext:t}=de.useGettext(),{dispatchModal:n}=Ke(),{graphAuthenticated:r,webdav:s}=Ee(),o=Ue(),{showMessage:i,showErrorMessage:l}=Me(),{defaultSpaceImageBlobURL:u}=ve.storeToRefs(o),d=async({space:p})=>{try{await s.deleteFile(p,{path:".space/image.png"}),await r.drives.updateDrive(p.id,{name:p.name,special:[{specialFolder:{name:"image"},id:null}]}),o.updateSpaceField({id:p.id,field:"spaceImageData",value:null}),o.updateSpaceField({id:p.id,field:"thumbnail",value:a(u)}),i({title:t("Space image deleted successfully")})}catch(h){console.error(h),l({title:t("Failed to delete space image"),errors:[h]})}},c=({resources:p})=>{n({title:t("Delete »%{space}« image",{space:p[0].name}),confirmText:t("Delete"),onConfirm:()=>d({space:p[0]}),message:t("Are you sure you want to delete the image of »%{space}«?",{space:p[0].name})})};return{actions:T(()=>[{name:"delete-space-image",icon:"delete-bin",handler:c,label:()=>t("Delete image"),isVisible:({resources:p})=>p.length!==1||!p[0].spaceImageData?!1:p[0].canEditImage({user:e.user}),class:"oc-files-actions-delete-space-image-trigger"}]),deleteSpaceImage:d}},qE=({onSpaceCreated:e}={})=>{const{dispatchModal:t}=Ke(),{$gettext:n}=de.useGettext(),{can:r}=wc.useAbility(),{isSpaceNameValid:s}=Wr(),{addNewSpace:o}=ms();return{actions:T(()=>[{name:"create",icon:"add",class:"oc-files-actions-create-space-trigger",label:()=>n("New Space"),isVisible:()=>r("create-all","Drive"),handler:()=>{t({title:n("Create a new space"),confirmText:n("Create"),hasInput:!0,inputLabel:n("Space name"),inputValue:n("New space"),inputRequiredMark:!0,onConfirm:async l=>{const u=await o(l);e?.(u)},onInput:(l,u)=>{const{isValid:d,error:c}=s(l);u(d?null:c)}})}}])}},HE=()=>{const{$gettext:e}=de.useGettext(),{openSideBar:t}=Pt();return{actions:T(()=>[{name:"show-details",icon:"information",label:()=>e("Details"),handler:()=>t(),isVisible:({resources:r})=>r.length>0,class:"oc-admin-settings-show-details-trigger"}])}},WE=()=>{const{getMatchingSpace:e}=Rt(),t=Ue(),n=Pn(),r=Re(),s=Ee(),{$gettext:o}=de.useGettext(),{openEditor:i}=bn(),{resources:l,currentFolder:u}=ve.storeToRefs(r);return{openEmptyEditor:async(c,f)=>{let p=a(u)?e(a(u)):null,h=a(l),g=a(u)?.path;(!p||!a(u).canCreate())&&(p=t.personalSpace,h=(await s.webdav.listFiles(p)).children,g="");let m=o("New file")+`.${f}`;h.some(w=>w.name===m)&&(m=pn(m,f,h));const b=await s.webdav.putFileContents(p,{path:z.urlJoin(g,m)}),S=e(b),k=n.fileExtensions.find(({app:w,extension:C})=>w===c&&C===f);i(k,S,b)}}},Im=()=>{const{$gettext:e}=de.useGettext(),{showMessage:t}=Me();return{openUrl:(r,s,o)=>{const i=window.open(r,s);i?o&&i.focus():t({title:e("Pop-up and redirect block detected"),timeout:20,status:"warning",desc:e("Please turn on pop-ups and redirects in your browser settings to make sure everything works right.")})}}},QE=()=>Gn("$appProviderService"),KE=()=>{const{isResourceAccessible:e}=Rt();return{breadcrumbsFromPath:({route:r,space:s,resourcePath:o,ancestorMetaData:i=H({})})=>{const l=(c="")=>c.split("/").filter(Boolean),u=l(r.path),d=l(o);return d.map((c,f)=>{const p=z.urlJoin(...d.slice(0,f+1),{leadingSlash:!0}),h=e({space:a(s),path:p});let g;return h&&(g=a(i)[p]),{id:wt.v4(),allowContextActions:!0,text:c,...h&&{to:{path:"/"+[...u].splice(0,u.length-d.length+f+1).join("/"),query:{...ps(r.query,"page","fileId"),...g&&{fileId:g.id}}}},isStaticNav:!1}})},concatBreadcrumbs:(...r)=>{const s=r.pop();return[...r,{id:wt.v4(),allowContextActions:s.allowContextActions,text:s.text,onClick:()=>Xe.publish("app.files.list.load"),isTruncationPlaceholder:s.isTruncationPlaceholder,isStaticNav:s.isStaticNav}]}}},GE=(e="")=>{const t=H(0),n=async()=>{await St();const r=document.querySelector(e||"#files-app-bar"),s=r?r.getBoundingClientRect().height:0;t.value!==s&&(t.value=s)};return window.onresize=n,ft(n),{y:t,refresh:n}},ac=()=>{const e=H(!0),t=()=>{e.value=window.innerHeight>500};return ft(()=>{t(),window.addEventListener("resize",t)}),Xt(()=>{window.removeEventListener("resize",t)}),{isSticky:e}},Pm=({extensionRegistry:e,appId:t})=>e.requestExtensions({id:`app.${t}.navItems`,extensionType:"sidebarNav"}).map(({navItem:n})=>n).filter(n=>!Object.hasOwn(n,"isVisible")||n.isVisible()),$m=()=>{const e=Kr.useRouter(),t=Kr.useRoute(),{$gettext:n}=de.useGettext(),r=yr(),s=Jd(),o=br(),i=T(()=>Pm({extensionRegistry:o,appId:a(s)}));return{navItems:T(()=>{if(!r.userContextReady)return[];const{href:u}=e.resolve(a(t));return et.orderBy(a(i).map(d=>{let c=typeof d.isActive!="function"||d.isActive();c&&(c=[d.route,...d.activeFor||[]].filter(Boolean).some(p=>{try{const h=e.resolve(p).href;return u.startsWith(h)}catch(h){return console.error(h),!1}}));const f=typeof d.name=="function"?d.name():d.name;return{...d,name:n(f),active:c}}),["priority","name"])})}};class Ss{static perPageDefault="100";static perPageQueryName="items-per-page";static options=["20","50","100","250","500"]}function JE(e){const t=Kr.useRouter(),n=Kr.useRoute(),r=XE(e),s=YE(e),o=T(()=>Math.ceil(a(e.items).length/a(s))||1),i=T(()=>{if(!a(s))return a(e.items);const l=(a(r)-1)*a(s),u=l+a(s);return a(e.items).slice(l,u)});return Xe.subscribe("app.files.navigate.page",({resourceId:l,forceScroll:u,topbarElement:d})=>{const c=et.findIndex(a(e.items),f=>f.id===l);if(c>=0){const f=Math.ceil((c+1)/Number(a(s)));t.push({...a(n),query:{...a(n).query,page:f}}).then(()=>{Xe.publish("app.files.navigate.scrollTo",{resourceId:l,forceScroll:u,topbarElement:d})})}}),{items:i,total:o,page:r,perPage:s}}function XE(e){if(e.page)return T(()=>a(e.page));const t=At("page","1");return T(()=>parseInt(ot(a(t))))}function YE(e){if(e.perPage)return T(()=>a(e.perPage));const t=Xn({name:e.perPageQueryName||Ss.perPageQueryName,defaultValue:e.perPageDefault||Ss.perPageDefault,storagePrefix:e.perPageStoragePrefix});return T(()=>parseInt(ot(a(t))))}const Om=()=>Gn("$passwordPolicyService"),Lm=()=>Gn("$previewService"),_m=()=>{const e=Pn();return{canBeOpenedWithSecureView:n=>e.fileExtensions.filter(({secureView:s})=>s).some(({mimeType:s})=>s===n.mimeType)}},Mm=()=>{const e=Ze();return{canListVersions:({space:n,resource:r})=>r.type==="folder"||z.isSpaceResource(r)||z.isTrashResource(r)?!1:n?.canListVersions({user:e.user})}},Nm=()=>{const e=Ee(),t=Ue(),n=T(()=>t.spaces),r=u=>a(n).find(d=>u.toString().startsWith(d.id.toString())),s=u=>a(n).find(d=>z.isMountPointSpaceResource(d)&&d.root?.remoteItem?.id===u),o=(u,d)=>{const c=[Te.FileId,Te.FileParent,Te.Name,Te.ResourceType],f=z.buildSpace({id:u,name:""});return e.webdav.getFileInfo(f,{fileId:u},{davProperties:c,signal:d})},i=Ft.useTask(function*(u,d){let c,f,p=r(d);if(p)return c=yield e.webdav.getPathForFileId(d,{signal:u}),f=yield e.webdav.getFileInfo(p,{path:c},{signal:u}),{space:p,resource:f,path:c};yield t.loadMountPoints({graphClient:e.graphAuthenticated,signal:u});let h=s(d);f=yield o(d,u);const g=h?[]:[a(f).name];let m=a(f);for(;!h;)m=yield o(m.parentFolderId,u),h=s(m.id),h||g.unshift(m.name);return p=t.getSpace(h.root?.remoteItem?.id)||t.createShareSpace({driveAliasPrefix:f.storageId?.startsWith(z.OCM_PROVIDER_ID)?"ocm-share":"share",id:h.root?.remoteItem?.id,shareName:h.name}),c=z.urlJoin(...g),{space:p,resource:f,path:c}}).restartable();return{getResourceContext:u=>i.perform(u)}},Et={name:{table:"resource-table",condensedTable:"resource-table-condensed",tiles:"resource-tiles"},defaultModeName:"resource-tiles",queryName:"view-mode",tilesSizeDefault:2,tilesSizeMax:6,tilesSizeQueryName:"tiles-size"},ZE=140,eD=84,Bm=()=>{const e=H(ZE),t=H(eD),n=s=>a(e)+(s-1)*a(t);return{calculateTileSizePixels:n,calculateTileSizeRem:s=>{const o=parseFloat(getComputedStyle(document.documentElement).fontSize);return n(s)/o}}};function tD(e){if(e)return T(()=>a(e));const t=Xn({name:Et.queryName,defaultValue:Et.defaultModeName});return T(()=>ot(a(t)))}function nD(e){if(e)return T(()=>parseInt(a(e)));const t=Xn({name:Et.tilesSizeQueryName,defaultValue:Et.tilesSizeDefault.toString()});return T(()=>parseInt(ot(a(t))))}const rD=H(Et.tilesSizeMax);function lc(){return rD}const cc=e=>{const t=Lm(),{updateResourceField:n}=Re(),{httpAuthenticated:r}=Ee(),s=Ue(),{defaultSpaceImageBlobURL:o}=ve.storeToRefs(s),i=Qe(),{serverUrl:l}=ve.storeToRefs(i),u=new sr({concurrency:4}),d=T(()=>a(e)===Et.name.tiles),c=T(()=>a(d)?bi.enum.fit:bi.enum.thumbnail),f=T(()=>a(d)?fo.Tile:fo.Thumbnail),p=Ft.useTask(function*(b,{space:S,resource:k,dimensions:w,processor:C,updateStore:A=!0}){const I=z.isProjectSpaceResource(k)?z.buildSpaceImageResource(k):k,N=I.id===S.spaceImageData?.id;N&&s.addToImagesLoading(S.id);const _=yield u.add(()=>t.loadPreview({space:S,resource:I,processor:C||a(c),dimensions:w||a(f)},!0,!0,b));return _&&A&&n({id:k.id,field:"thumbnail",value:_}),N&&s.removeFromImagesLoading(S.id),_}),h=async b=>{const{resource:S,cancelRunning:k}=b;if(k&&m(),z.isProjectSpaceResource(S)&&(!S.spaceImageData||S.disabled)){a(o)&&s.updateSpaceField({id:S.id,field:"thumbnail",value:a(o)});try{const w=await r.get(`${a(l)}images/default-space-icon.png`,{responseType:"blob"});return s.setDefaultSpaceImageBlobURL(URL.createObjectURL(w.data)),s.updateSpaceField({id:S.id,field:"thumbnail",value:a(o)}),a(o)}catch{return null}}try{return await p.perform(b)}catch(w){w!=="cancel"&&console.error(w)}},g=T(()=>p.isRunning),m=()=>{p.cancelAll(),u.clear(),s.purgeImagesLoading()};return zo(m),{loadPreview:h,previewsLoading:g}},jm=({showSizeInformation:e=!0}={})=>{const t=Re(),{current:n,$gettext:r,$ngettext:s}=de.useGettext(),o=Ae(),{resources:i,totalResourcesCount:l,areHiddenFilesShown:u,currentFolder:d}=ve.storeToRefs(t),c=T(()=>{if(!a(d)?.size||a(d)?.size==="0"){const p=a(i).map(h=>h.size?parseInt(h.size.toString()):0).reduce((h,g)=>h+g,0);return zt(p,n)}return zt(a(d).size,n)});return{resourceContentsText:T(()=>{let p=s("%{ filesCount } file","%{ filesCount } files",a(l).files,{filesCount:a(l).files.toString()});!a(u)&&a(l).hiddenFiles&&(p=s("%{ filesCount } file including %{ filesHiddenCount } hidden","%{ filesCount } files including %{ filesHiddenCount } hidden",a(l).files,{filesCount:a(l).files.toString(),filesHiddenCount:a(l).hiddenFiles.toString()}));let h=s("%{ foldersCount } folder","%{ foldersCount } folders",a(l).folders,{foldersCount:a(l).folders.toString()});!a(u)&&a(l).hiddenFolders&&(h=s("%{ foldersCount } folder including %{ foldersHiddenCount } hidden","%{ foldersCount } folders including %{ foldersHiddenCount } hidden",a(l).folders,{foldersCount:a(l).folders.toString(),foldersHiddenCount:a(l).hiddenFolders.toString()}));const g=s("%{ spacesCount } space","%{ spacesCount } spaces",a(l).spaces,{spacesCount:a(l).spaces.toString()}),m=a(l).files+a(l).folders+a(l).spaces,b=e&&parseFloat(a(c))>0,S=pt(o,"files-shares-via-link"),k=r(b?"%{ itemsCount } item with %{ itemSize } in total":"%{ itemsCount } item in total"),w=r(b?"%{ itemsCount } items with %{ itemSize } in total":"%{ itemsCount } items in total"),C=S?"(%{ filesStr}, %{ foldersStr}, %{ spacesStr})":"(%{ filesStr}, %{ foldersStr})",A=`${k} ${C}`,I=`${w} ${C}`;return s(A,I,m,{itemsCount:m.toString(),itemSize:a(c),filesStr:p,foldersStr:h,spacesStr:g})})}},zm=()=>{const{$gettext:e}=de.useGettext(),{interceptModifierClick:t}=Vr(),{openSideBarPanel:n}=Pt(),r=Re(),s=Ze(),o=k=>z.ShareTypes.containsAnyValue(z.ShareTypes.authenticated,k??[]),i=k=>z.ShareTypes.containsAnyValue(z.ShareTypes.unauthenticated,k??[]),l=({isDirect:k})=>e(k?"This item is directly shared with others.":"This item is shared with others through one of the parent folders."),u=({isDirect:k})=>e(k?"This item is directly shared via links.":"This item is shared via links through one of the parent folders."),d=({resource:k,isDirect:w})=>({id:`files-sharing-${k.getDomSelector()}`,accessibleDescription:l({isDirect:w}),label:e("Show invited people"),icon:"group",category:"sharing",type:w?"user-direct":"user-indirect",fillType:"line",handler:(C,A)=>{A&&t(A,C)||n("sharing")}}),c=({resource:k})=>({id:`files-sharing-synced-${k.getDomSelector()}`,accessibleDescription:e("This item is synced with your devices"),label:e("Synced with your devices"),icon:"loop-right",category:"sharing",type:"resource-synced",fillType:"line"}),f=({resource:k})=>k.shareRoles?.length?{id:`files-sharing-role-${k.getDomSelector()}`,accessibleDescription:e(k.shareRoles[0].description),label:e(k.shareRoles[0].displayName),icon:k.shareRoles[0].icon,category:"sharing",type:"share-role",fillType:"line"}:{id:`files-sharing-role-${k.getDomSelector()}`,accessibleDescription:z.ShareTypes.remote.label,label:z.ShareTypes.remote.label,icon:z.ShareTypes.remote.icon,category:"sharing",type:"share-role",fillType:"line"},p=({resource:k,isDirect:w})=>({id:`file-link-${k.getDomSelector()}`,accessibleDescription:u({isDirect:w}),label:e("Show links"),icon:"link",category:"sharing",type:w?"link-direct":"link-indirect",fillType:"line",handler:()=>n("sharing")}),h=({resource:k})=>({id:`resource-locked-${k.getDomSelector()}`,accessibleDescription:e("Item locked"),label:e("This item is locked"),icon:"lock",category:"system",type:"resource-locked",fillType:"line"}),g=({resource:k})=>({id:`resource-processing-${k.getDomSelector()}`,accessibleDescription:e("Item in processing"),label:e("This item is in processing"),icon:"loop-right",category:"system",type:"resource-processing",fillType:"line"}),m=({resource:k})=>({id:`resource-space-enabled-${k.getDomSelector()}`,accessibleDescription:e("Space is enabled"),label:e("This space is enabled"),icon:"play-circle",category:"space",type:"resource-space-enabled",fillType:"line"}),b=({resource:k})=>({id:`resource-space-disabled-${k.getDomSelector()}`,accessibleDescription:e("Space is disabled"),label:e("This space is disabled"),icon:"stop-circle",category:"space",type:"resource-space-disabled",fillType:"line"});return{getIndicators:({space:k,resource:w})=>{const C=[];if(w.locked&&C.push(h({resource:w})),w.processing&&C.push(g({resource:w})),z.isProjectSpaceResource(w)&&!w.disabled&&C.push(m({resource:w})),z.isProjectSpaceResource(w)&&w.disabled&&C.push(b({resource:w})),z.isIncomingShareResource(w)&&(w.shareTypes.includes(z.ShareTypes.remote.value)||w.shareRoles?.length)&&C.push(f({resource:w})),z.isIncomingShareResource(w)&&w.syncEnabled&&C.push(c({resource:w})),z.isProjectSpaceResource(k)||z.isPersonalSpaceResource(k)&&k.isOwner(s.user)){const N=Object.values(r.ancestorMetaData).flatMap(({shareTypes:V})=>V),_=o(w.shareTypes);(_||o(N))&&C.push(d({resource:w,isDirect:_}));const F=i(w.shareTypes);(F||i(N))&&C.push(p({resource:w,isDirect:F}))}return C}}},Vm=({isResourceSelected:e,isResourceDisabled:t,emit:n})=>{const r=Sr(),{interceptModifierClick:s}=Vr(),o=c=>{r.publish("app.files.list.clicked"),n("update:selectedIds",c)},i=vn(jt,"files-trash-overview");return{shouldShowContextDrop:c=>a(i)&&z.isProjectSpaceResource(c)&&c.disabled?!1:!t(c),showContextMenuOnBtnClick:(c,f,p)=>{c instanceof MouseEvent&&s(c,f)||t(f)||p?.show({event:c})},showContextMenuOnRightClick:(c,f,p)=>{c instanceof MouseEvent&&s(c,f)||(c.preventDefault(),!t(f)&&(e(f)||o([f.id]),p?.show({event:c,useMouseAnchor:!0})))}}},Um=({selectedIds:e,selectedResources:t,emit:n})=>{const r=Re(),s=H(),o=qt("ghostElement"),i=async(p,h)=>{s.value=p,await St(),a(o).$el.ariaHidden="true",a(o).$el.style.left="-99999px",a(o).$el.style.top="-99999px",h.dataTransfer.setDragImage(a(o).$el,0,0),h.dataTransfer.dropEffect="move",h.dataTransfer.effectAllowed="move"},l=async(p,h)=>{a(e).includes(p.id)||(r.toggleSelection(p.id),n("update:selectedIds",[...r.selectedIds])),await i(p,h)},u=T(()=>a(t).filter(({id:p})=>p!==a(s)?.id)),d=p=>(p.dataTransfer.types||[]).some(h=>h==="Files"),c=(p,h)=>{d(h)||(s.value=null,f(p,!0,h),n("fileDropped",p.id))},f=(p,h,g)=>{if(d(g)||g.currentTarget?.contains(g.relatedTarget)||a(e).includes(p.id)||p.type!=="folder")return;const m=document.querySelectorAll(`[data-item-id='${p.id}']`)?.[0];if(!m)return;const b="!bg-role-secondary-container";h?m.classList.remove(b):m.classList.add(b)};return{ghostElement:o,dragItem:s,dragSelection:u,dragStart:l,fileDropped:c,setDropStyling:f}},qm=({resources:e,disabledResources:t,selectedIds:n,emit:r})=>{const s=Sr(),{$gettext:o}=de.useGettext(),i=f=>{s.publish("app.files.list.clicked"),r("update:selectedIds",f)},l=f=>{switch(f.type){case"folder":return o("Select folder");case"space":return o("Select space");default:return o("Select file")}},u=T(()=>{const f=a(t).length===a(e).length,p=a(n).length===a(e).length-a(t).length;return!f&&p}),d=T(()=>a(u)?o("Clear selection"):o("Select all"));return{getResourceCheckboxLabel:l,areAllResourcesSelected:u,selectAllCheckboxLabel:d,toggleSelectionAll:()=>{if(a(u))return i([]);i(a(e).filter(f=>!a(t).includes(f.id)).map(f=>f.id))}}},uc=({space:e,resources:t,selectedIds:n,emit:r})=>{const s=Re(),o=Ae(),i=Sr(),{interceptModifierClick:l}=Vr(),{getMatchingSpace:u}=Rt(),{canBeOpenedWithSecureView:d}=_m(),{getDefaultAction:c}=bn(),{isEnabled:f,fileTypes:p,isFilePicker:h,postMessage:g}=wr(),m=Zs(),{resources:b,action:S}=ve.storeToRefs(m),k=T(()=>a(t).filter($=>a(n).includes($.id))),w=$=>a(n).includes($.id),C=$=>s.deleteQueue.includes($),A=$=>a(f)&&a(p)?.length?!a(p).includes($.extension)&&!a(p).includes($.mimeType)&&!$.isFolder:C($.id)?!0:$.processing===!0,I=T(()=>a(t)?.filter(A)?.map($=>$.id)||[]);return{selectedResources:k,disabledResources:I,isResourceSelected:w,isResourceInDeleteQueue:C,isResourceDisabled:A,isResourceClickable:($,L)=>!L||z.isProjectSpaceResource($)&&$.disabled||!$.isFolder&&!$.canDownload()&&!d($)?!1:!A($),isResourceCut:$=>a(S)!==Js.Cut?!1:a(b).some(L=>L.id===$.id),fileContainerClicked:({resource:$,event:L})=>{if(A($))return;if(a(f)&&a(h)&&!$.isFolder)return g("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify($)),locationQuery:JSON.parse(JSON.stringify(Ai(a(o.currentRoute))))});!L.shiftKey&&!L.metaKey&&!L.ctrlKey&&i.publish("app.files.shiftAnchor.reset");const M=L?.target;if(M?.closest("div")?.id==="oc-files-context-menu")return;if(L&&L.metaKey)return i.publish("app.files.list.clicked.meta",$);if(L&&L.shiftKey)return i.publish("app.files.list.clicked.shift",{resource:$,skipTargetSelection:!1});M.getAttribute("type")!=="checkbox"&&(w($)||(i.publish("app.files.list.clicked"),r("update:selectedIds",[$.id])))},fileNameClicked:({resource:$,event:L})=>{if(!l(L,$)){if(a(f))return a(h)||r("update:selectedIds",[$.id]),a(h)&&!$.isFolder?g("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify($)),locationQuery:JSON.parse(JSON.stringify(Ai(a(o.currentRoute))))}):void 0;r("fileClick",{space:u($),resources:[$]})}},fileCheckboxClicked:({resource:$,event:L})=>{l(L,$)||(s.toggleSelection($.id),i.publish("app.files.list.clicked"),r("update:selectedIds",[...s.selectedIds]))},getResourceLink:$=>{let L=a(e);L||(L=u($));const M=c({resources:[$],space:L});if(M?.route)return M.route({space:L,resources:[$]})},...Um({selectedIds:n,selectedResources:k,emit:r}),...Vm({isResourceDisabled:A,isResourceSelected:w,emit:r}),...qm({resources:t,disabledResources:I,selectedIds:n,emit:r})}},dc=()=>{const{getMatchingSpace:e}=Rt(),t=Re(),n=T({get(){return t.selectedResources},set(i){t.setSelection(i.map(({id:l})=>l))}}),r=T({get(){return t.selectedIds},set(i){t.setSelection(i)}}),s=i=>a(r).includes(i.id),o=T(()=>{if(a(n).length!==1)return null;const i=a(n)[0];return e(i)});return{selectedResources:n,selectedResourcesIds:r,isResourceInSelection:s,selectedResourceSpace:o}};class yo{static sortByQueryName="sort-by";static sortDirQueryName="sort-dir"}function sD(e){const t=Ae(),n=oD(e),r=iD(e),s=T(()=>Wm(a(n))||a(fc(a(i))?.name)),o=T(()=>lD(a(r))||aD(a(s),a(i))),i=e.fields;return{items:T(()=>{const d=a(e.items);return a(s)?Hm(d,a(i),a(s),a(o)):d}),sortBy:s,sortDir:o,handleSort:({sortBy:d,sortDir:c})=>t.replace({query:{...a(t.currentRoute).query,[a(e.sortByQueryName)||yo.sortByQueryName]:d,[a(e.sortDirQueryName)||yo.sortDirQueryName]:c}})}}function oD(e){return e.sortBy?ct(e.sortBy)?e.sortBy:H(e.sortBy):Xn({name:a(e.sortByQueryName)||yo.sortByQueryName,defaultValue:a(fc(a(e.fields))?.name),storagePrefix:a(e.routeName)||a(Pl())})}function iD(e){return e.sortDir?ct(e.sortDir)?e.sortDir:H(e.sortDir):Xn({name:a(e.sortDirQueryName)||yo.sortDirQueryName,defaultValue:a(fc(a(e.fields))?.sortDir),storagePrefix:a(e.routeName)||a(Pl())})}const fc=e=>{const t=e.filter(n=>n.sortable);return t?t[0]:null},aD=(e,t)=>{const n=t.find(r=>r.name===e);return n&&n.sortDir?a(n.sortDir):Je.Desc},Hm=(e,t,n,r)=>{const s=t.find(l=>l.name===n);if(!s)return e;const{sortable:o}=s,i=new Intl.Collator(navigator.language,{sensitivity:"base",numeric:!0});if(n==="name"){const l=c=>c.type==="folder"&&!c.extension,u=[...e.filter(c=>l(c))].sort((c,f)=>pc(c,f,i,n,r,o)),d=[...e.filter(c=>!l(c))].sort((c,f)=>pc(c,f,i,n,r,o));return r===Je.Asc?u.concat(d):d.concat(u)}return[...e].sort((l,u)=>pc(l,u,i,s.prop||s.name,r,o))},pc=(e,t,n,r,s,o)=>{let i=Sl(e,r),l=Sl(t,r);const u=s===Je.Asc?1:-1;if(o)if(typeof o=="string"){const c=f=>f.map(p=>p[o]).join("");i=c(i),l=c(l)}else typeof o=="function"&&(i=o(i),l=o(l));return!isNaN(i)&&!isNaN(l)?(i-l)*u:n.compare((i||"").toString(),(l||"").toString())*u},Wm=e=>Array.isArray(e)?e[0]:e,lD=e=>{switch(Wm(e)){case Je.Asc:return Je.Asc;case Je.Desc:return Je.Desc}return null};function cD(e){const t=Ct(),n=yr(),r=Ee(),s=de.useGettext(),o=T(()=>t.tusMaxChunkSize>0),i=()=>{const d={};return n.publicLinkPassword?d.Authorization="Basic "+di.from(["public",n.publicLinkPassword].join(":")).toString("base64"):n.accessToken&&!n.publicLinkPassword&&(d.Authorization="Bearer "+n.accessToken),d["X-Request-ID"]=wt.v4(),d["Accept-Language"]=s.current,d["Initiator-ID"]=r.initiatorId,d},l=T(()=>{const d={onBeforeRequest:(c,f)=>new Promise(p=>{const h=i();c.setHeader("Authorization",h.Authorization),c.setHeader("X-Request-ID",h["X-Request-ID"]),c.setHeader("Accept-Language",h["Accept-Language"]),c.setHeader("Initiator-ID",h["Initiator-ID"]),f?.isRemote&&c.setHeader("x-oc-mtime",(f?.data?.lastModified/1e3).toFixed(0)),p()}),chunkSize:t.tusMaxChunkSize||1/0,overridePatchMethod:t.tusHttpMethodOverride,uploadDataDuringCreation:t.tusExtension.includes("creation-with-upload")};return d.headers=c=>{if(c.xhrUpload||c?.isRemote)return{"x-oc-mtime":(c?.data?.lastModified/1e3).toFixed(0),...i()}},d}),u=T(()=>({timeout:6e4,endpoint:"",headers:d=>({"x-oc-mtime":(d?.data?.lastModified/1e3).toFixed(0),...i()})}));ze([l,u],()=>{if(a(o)){e.uppyService.useTus(a(l));return}e.uppyService.useXhr(a(u))},{immediate:!0})}const Qm=()=>{const e=Ee(),{addAvatar:t,getAvatar:n,avatarsQueue:r,pendingAvatarsRequests:s}=ai(),o=async l=>{try{const u=await e.graphAuthenticated.photos.getUserPhoto(l,{responseType:"blob"});t(l,URL.createObjectURL(u))}catch(u){u.response?.status===404&&t(l,null)}return n(l)};return{enqueueAvatar:l=>{if(n(l)!==void 0||s.has(l))return;const u=r.add(()=>o(l));s.set(l,u),u.finally(()=>s.delete(l))}}},uD=ge({name:"ActionMenuItem",props:{action:{type:Object,required:!0},actionOptions:{type:Object,required:!0},size:{type:String,required:!1,default:"medium"},appearance:{type:String,default:"raw"},shortcutHint:{type:Boolean,default:!0,required:!1},showTooltip:{type:Boolean,default:!1,required:!1},buttonClasses:{type:Array,default:()=>[]}},setup(e){const t=Qe(),{options:n}=ve.storeToRefs(t),r=T(()=>Object.hasOwn(e.action,"route")?"router-link":Object.hasOwn(e.action,"href")?"a":(Object.hasOwn(e.action,"handler")||console.warn("ActionMenuItem: No handler, route or href callback found in action",e.action),"button")),s=T(()=>({...{appearance:e.action.appearance||e.appearance,...e.action.isDisabled&&{disabled:e.action.isDisabled(e.actionOptions)},...e.action.id&&{id:e.action.id}},...a(r)==="router-link"&&{to:e.action.route(e.actionOptions)},...a(r)==="a"&&{href:e.action.href(e.actionOptions)},...["router-link","a"].includes(a(r))&&{target:n.value.cernFeatures?"_blank":"_self"}})),o=T(()=>typeof e.action.icon=="function"?e.action.icon(e.actionOptions):e.action.icon);return{componentType:r,componentProps:s,actionIcon:o}},computed:{hasExternalImageIcon(){return this.actionIcon&&/^https?:\/\//i.test(this.actionIcon)},componentListeners(){if(typeof this.action.handler!="function")return{};const e=()=>this.action.handler({...this.actionOptions});return this.action.keepOpen?{click:t=>{t.stopPropagation(),e()}}:{click:e}}}}),dD={key:3,class:"oc-files-context-action-label flex flex-col","data-testid":"action-label"},fD=["textContent"],pD=["textContent"];function hD(e,t,n,r,s,o){const i=te("oc-image"),l=te("oc-icon"),u=te("oc-button"),d=Bt("oc-tooltip");return je((D(),K("li",null,[je((D(),ee(u,at({type:e.componentType},e.componentProps,{class:[e.action.class,"action-menu-item","align-middle","w-full",...e.buttonClasses],"aria-label":e.componentProps.disabled?e.action.disabledTooltip?.(e.actionOptions)??e.action.label(e.actionOptions):e.action.label(e.actionOptions),"data-testid":"action-handler",size:e.size,"justify-content":"left"},Uo(e.componentListeners)),{default:X(()=>[e.action.img?(D(),ee(i,{key:0,"data-testid":"action-img",src:e.action.img,alt:"",class:"oc-icon oc-icon-m w-[22px]"},null,8,["src"])):e.hasExternalImageIcon?(D(),ee(i,{key:1,"data-testid":"action-img",src:e.actionIcon,alt:"",class:"oc-icon oc-icon-m w-[22px]"},null,8,["src"])):e.actionIcon?(D(),ee(l,{key:2,"data-testid":"action-icon",name:e.actionIcon,"fill-type":e.action.iconFillType||"line",size:e.size},null,8,["name","fill-type","size"])):ie("",!0),e.action.hideLabel?ie("",!0):(D(),K("span",dD,[W("span",{class:"text-left",textContent:R.toDisplayString(e.action.label(e.actionOptions))},null,8,fD)])),e.action.shortcut&&e.shortcutHint?(D(),K("span",{key:4,class:"text-sm flex-row-reverse",textContent:R.toDisplayString(e.action.shortcut)},null,8,pD)):ie("",!0)]),_:1},16,["type","class","aria-label","size"])),[[d,e.showTooltip||e.action.hideLabel?e.action.label(e.actionOptions):""]])])),[[d,e.componentProps.disabled?e.action.disabledTooltip?.(e.actionOptions):""]])}const ea=Le(uD,[["render",hD]]),mD=ge({name:"BatchActions",components:{ActionMenuItem:ea},props:{actions:{type:Array,required:!0},actionOptions:{type:Object,required:!0},limitedScreenSpace:{type:Boolean,default:!1,required:!1}}});function gD(e,t,n,r,s,o){const i=te("action-menu-item"),l=te("oc-list");return D(),K("div",null,[Q(l,{id:"oc-appbar-batch-actions",class:R.normalizeClass(["block xl:flex xl:items-center",{"oc-appbar-batch-actions-squashed [&_.oc-files-context-action-label]:hidden":e.limitedScreenSpace}])},{default:X(()=>[(D(!0),K(ke,null,Ge(e.actions,(u,d)=>(D(),ee(i,{key:`action-${d}`,action:u,"action-options":e.actionOptions,appearance:"raw",class:"batch-actions mr-2 float-left [&_.action-menu-item]:p-2 [&_.action-menu-item]:gap-1","shortcut-hint":!1,"show-tooltip":e.limitedScreenSpace},null,8,["action","action-options","show-tooltip"]))),128))]),_:1},8,["class"])])}const Km=Le(mD,[["render",gD]]),yD={class:"context-menu px-2"},vD={class:"inline-flex gap-2"},bD={class:"flex oc-files-context-action-label"},wD=["textContent"],Gm=ge({__name:"ActionMenuDropItem",props:{menuSectionDrop:{},appearance:{},actionOptions:{}},setup(e){const t=Mr(`oc-files-context-actions-${e.menuSectionDrop.name}-drop-`),n=Mr(`oc-files-context-actions-${e.menuSectionDrop.name}-toggle-`);return(r,s)=>{const o=te("oc-icon"),i=te("oc-button"),l=te("oc-list");return D(),K("li",yD,[Q(i,{id:a(n),appearance:"raw","justify-content":"space-between","gap-size":"medium",class:"w-full flex justify-between","aria-expanded":"false"},{default:X(()=>[W("span",vD,[Q(o,{name:e.menuSectionDrop.icon,size:"medium","fill-type":"line"},null,8,["name"]),W("span",bD,[W("span",{textContent:R.toDisplayString(e.menuSectionDrop.label)},null,8,wD)])]),Q(o,{name:"arrow-right-s",size:"small","fill-type":"line"})]),_:1},8,["id"]),Q(a(Hh),{title:e.menuSectionDrop.label,"drop-id":a(t),toggle:`#${a(n)}`,mode:"hover",class:"w-3xs oc-files-context-action-drop","padding-size":"small",position:"bottom-start","close-on-click":""},{default:X(()=>[e.menuSectionDrop.items.length?(D(),ee(l,{key:0},{default:X(()=>[(D(!0),K(ke,null,Ge(e.menuSectionDrop.items,(u,d)=>(D(),ee(ea,{key:`section-${e.menuSectionDrop.label}-action-${d}`,action:u,appearance:e.appearance,"action-options":e.actionOptions},null,8,["action","appearance","action-options"]))),128))]),_:1})):ie("",!0)]),_:1},8,["title","drop-id","toggle"])])}}}),SD=ge({name:"ContextActionMenu",components:{ActionMenuDropItem:Gm,ActionMenuItem:ea},props:{menuSections:{type:Array,required:!0},appearance:{type:String,default:"raw"},actionOptions:{type:Object,required:!0}},methods:{getSectionClasses(e){const t=[];return this.menuSections.length&&(e<this.menuSections.length-1&&t.push("pb-2"),e>0&&t.push("pt-2"),e<this.menuSections.length-1&&t.push("border-b")),t}}}),kD={id:"oc-files-context-menu"};function CD(e,t,n,r,s,o){const i=te("action-menu-item"),l=te("action-menu-drop-item"),u=te("oc-list");return D(),K("div",kD,[(D(!0),K(ke,null,Ge(e.menuSections,(d,c)=>(D(),ee(u,{id:`oc-files-context-actions-${d.name}`,key:`section-${d.name}-list`,class:R.normalizeClass(["[&_li]:px-0",e.getSectionClasses(c)])},{default:X(()=>[d.items?(D(!0),K(ke,{key:0},Ge(d.items,(f,p)=>(D(),ee(i,{key:`section-${d.name}-action-${p}`,action:f,appearance:e.appearance,"action-options":e.actionOptions,class:"context-menu"},null,8,["action","appearance","action-options"]))),128)):ie("",!0),(D(!0),K(ke,null,Ge(d.dropItems,f=>(D(),K(ke,null,[f.items.length?(D(),ee(l,{key:f.name,"menu-section-drop":f,appearance:e.appearance,"action-options":e.actionOptions},null,8,["menu-section-drop","appearance","action-options"])):ie("",!0)],64))),256))]),_:2},1032,["id","class"]))),128))])}const ta=Le(SD,[["render",CD]]),TD=ge({name:"ContextActions",components:{ContextActionMenu:ta},props:{actionOptions:{type:Object,required:!0}},setup(e){const{getAllOpenWithActions:t}=bn(),{$gettext:n}=de.useGettext(),{actions:r}=am(),{actions:s}=Gi(),{actions:o}=Yi(),{actions:i}=Di(),{actions:l}=jl(),{actions:u}=Qi(),{actions:d}=mo(),{actions:c}=Ki(),{actions:f}=ws(),{actions:p}=rc(),{actions:h}=Ji(),{actions:g}=dm(),{actions:m}=Xi(),{actions:b}=go(),{actions:S}=mm(),{actions:k}=oc(),{actions:w}=tc(),{actions:C}=ic(),A=br(),I=T(()=>A.requestExtensions({id:"global.files.context-actions",extensionType:"action"}).map(B=>B.action)),N=T(()=>A.requestExtensions({id:"global.files.batch-actions",extensionType:"action"}).map(B=>B.action)),_=oy(e,"actionOptions"),F=T(()=>[...a(s),...a(u),...a(c),...a(h),...a(i),...a(d),...a(b),...a(w),...a(N).filter(B=>B.category==="actions"||et.isNil(B.category))].filter(B=>B.isVisible(a(_)))),V=T(()=>[...a(k),...a(N).filter(B=>B.category==="sidebar")].filter(B=>B.isVisible(a(_)))),Z=T(()=>a(r).filter(B=>B.isVisible(a(_))).sort((B,q)=>Number(q.hasPriority)-Number(B.hasPriority))),P=T(()=>t({...a(_),omitSystemActions:!0}).filter(B=>B.isVisible(a(_))).sort((B,q)=>Number(q.hasPriority)-Number(B.hasPriority))),$=T(()=>[...a(C),...a(l),...a(I).filter(B=>B.category==="share")].filter(B=>B.isVisible(a(_)))),L=T(()=>[...a(c),...a(f),...a(d),...a(h),...a(i),...a(g),...a(m),...a(w),...a(b),...a(s),...a(u),...a(o),...a(S),...a(I).filter(B=>B.category==="actions"||et.isNil(B.category))].filter(B=>B.isVisible(a(_)))),M=T(()=>[...a(p).map(B=>(B.keepOpen=!0,B)),...a(k),...a(I).filter(B=>B.category==="sidebar")].filter(B=>B.isVisible(a(_))));return{menuSections:T(()=>{const B=[];return a(_).resources.length>1?(a(F).length&&B.push({name:"batch-actions",items:[...a(F)]}),B.push({name:"batch-details",items:[...a(V)]}),B):([...a(Z),...a(P)].length&&B.push({name:"context",items:[...a(Z)],dropItems:[{label:n("Open with..."),name:"open-with",icon:"apps",items:[...a(P)]}]}),a($).length&&B.push({name:"share",items:a($)}),a(L).length&&B.push({name:"actions",items:a(L)}),a(M).length&&B.push({name:"sidebar",items:a(M)}),B)})}}});function xD(e,t,n,r,s,o){const i=te("context-action-menu");return D(),ee(i,{"menu-sections":e.menuSections,"action-options":e.actionOptions},null,8,["menu-sections","action-options"])}const Jm=Le(TD,[["render",xD]]),AD={class:"flex items-center"},RD={class:"flex justify-between w-full"},ED={class:"flex items-center"},DD=["textContent"],FD={key:0,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},ID={key:1,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},PD={key:2,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},$D={key:3,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},OD={key:4,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},LD={key:5,class:"mt-2 mb-4 last:mb-0 flex justify-between items-center [&>*]:flex [&>*]:justify-between"},_D=["textContent"],MD=["max"],Xm=Le(ge({__name:"ViewOptions",props:{perPageStoragePrefix:{},hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},paginationOptions:{default:()=>Ss.options},perPageQueryName:{default:()=>Ss.perPageQueryName},perPageDefault:{default:()=>Ss.perPageDefault},viewModeDefault:{default:()=>Et.defaultModeName},viewModes:{default:()=>[]}},setup(e){const t=Ae(),n=yt(),{$gettext:r}=de.useGettext(),s=Pt(),{isSideBarOpen:o}=ve.storeToRefs(s),i=Re(),{setAreHiddenFilesShown:l,setAreFileExtensionsShown:u,setAreDisabledSpacesShown:d,setAreEmptyTrashesShown:c}=i,{areHiddenFilesShown:f,areFileExtensionsShown:p,areDisabledSpacesShown:h,areEmptyTrashesShown:g}=ve.storeToRefs(i),m=H(!1),b=vn(rt,"files-spaces-projects"),S=vn(jt,"files-trash-overview"),k=At("page"),w=T(()=>a(k)?parseInt(ot(a(k))):1),C=Xn({name:e.perPageQueryName,defaultValue:e.perPageDefault,storagePrefix:e.perPageStoragePrefix}),A=Xn({name:Et.queryName,defaultValue:e.viewModeDefault}),I=Xn({name:Et.tilesSizeQueryName,defaultValue:Et.tilesSizeDefault.toString()}),N=q=>t.replace({query:{...a(n).query,[e.perPageQueryName]:q.toString(),...a(w)>1&&{page:"1"}}}),_=q=>{A.value=q.name};ze([C,A,I],q=>{m.value=q.some(re=>!re)},{immediate:!0,deep:!0});const F=lc(),V=T({get(){return a(f)},set(q){l(q)}}),Z=T({get(){return a(p)},set(q){u(q)}}),P=T({get(){return a(h)},set(q){d(q)}}),$=T({get(){return a(g)},set(q){c(q)}}),L=q=>{V.value=q},M=q=>{Z.value=q},j=q=>{P.value=q},B=q=>{$.value=q};return(q,re)=>{const J=te("oc-icon"),oe=te("oc-button"),ne=te("oc-list"),pe=te("oc-drop"),fe=te("oc-switch"),we=te("oc-page-size"),$e=Bt("oc-tooltip");return D(),K("div",AD,[e.viewModes.length?(D(),K(ke,{key:0},[je((D(),ee(oe,{id:"mobile-viewmode-switch-toggle","aria-label":a(r)("Switch view mode"),appearance:"raw",class:R.normalizeClass(["my-2 mx-1 p-1 align-middle",{"sm:hidden":!a(o),"md:hidden":a(o)}])},{default:X(()=>[Q(J,{name:"list-view","fill-type":"none"})]),_:1},8,["aria-label","class"])),[[$e,a(r)("Switch view mode")]]),Q(pe,{title:a(r)("View mode"),"drop-id":"mobile-viewmode-switch-drop",toggle:"#mobile-viewmode-switch-toggle",class:"w-auto","padding-size":"medium","close-on-click":""},{default:X(()=>[Q(ne,null,{default:X(()=>[(D(!0),K(ke,null,Ge(e.viewModes,he=>(D(),K("li",{key:he.name},[Q(oe,{appearance:a(A)===he.name?"filled":"raw","color-role":a(A)===he.name?"secondaryContainer":"secondary","justify-content":"left",onClick:ae=>_(he)},{default:X(()=>[W("div",RD,[W("span",ED,[Q(J,{name:he.icon.name,"fill-type":he.icon.fillType,size:"medium",class:"mr-1"},null,8,["name","fill-type"]),W("span",{textContent:R.toDisplayString(he.label)},null,8,DD)]),a(A)===he.name?(D(),ee(J,{key:0,name:"check",size:"medium"})):ie("",!0)])]),_:2},1032,["appearance","color-role","onClick"])]))),128))]),_:1})]),_:1},8,["title"])],64)):ie("",!0),e.viewModes.length>1?(D(),K("div",{key:1,class:R.normalizeClass(["viewmode-switch-buttons oc-button-group hidden mr-2",{"sm:inline-flex":!a(o),"md:inline-flex":a(o)}])},[(D(!0),K(ke,null,Ge(e.viewModes,he=>je((D(),ee(oe,{key:he.name,"no-hover":a(A)===he.name,class:R.normalizeClass([he.name]),appearance:a(A)===he.name?"filled":"outline","color-role":a(A)===he.name?"secondaryContainer":"secondary","aria-label":a(r)("Switch to %{viewMode}",{viewMode:he.label}),onClick:ae=>_(he)},{default:X(()=>[Q(J,{name:he.icon.name,"fill-type":he.icon.fillType,size:"small"},null,8,["name","fill-type"])]),_:2},1032,["no-hover","class","appearance","color-role","aria-label","onClick"])),[[$e,a(r)("Switch to %{viewMode}",{viewMode:he.label})]])),128))],2)):ie("",!0),je((D(),ee(oe,{id:"files-view-options-btn",key:"files-view-options-btn","data-testid":"files-view-options-btn","aria-label":a(r)("Display customization options of the files list"),appearance:"raw",class:"my-2 mx-1 p-1 align-middle"},{default:X(()=>[Q(J,{name:"settings-3","fill-type":"line"})]),_:1},8,["aria-label"])),[[$e,a(r)("Display customization options of the files list")]]),Q(pe,{title:a(r)("View options"),"drop-id":"files-view-options-drop",toggle:"#files-view-options-btn",mode:"click",class:"w-auto","padding-size":"medium"},{default:X(()=>[Q(ne,null,{default:X(()=>[e.hasHiddenFiles?(D(),K("li",FD,[Q(fe,{checked:V.value,"onUpdate:checked":[re[0]||(re[0]=he=>V.value=he),L],"data-testid":"files-switch-hidden-files",label:a(r)("Show hidden files")},null,8,["checked","label"])])):ie("",!0),e.hasFileExtensions?(D(),K("li",ID,[Q(fe,{checked:Z.value,"onUpdate:checked":[re[1]||(re[1]=he=>Z.value=he),M],"data-testid":"files-switch-files-extensions-files",label:a(r)("Show file extensions")},null,8,["checked","label"])])):ie("",!0),e.hasPagination?(D(),K("li",PD,[m.value?ie("",!0):(D(),ee(we,{key:0,selected:a(ot)(a(C)),"data-testid":"files-pagination-size",label:a(r)("Items per page"),options:e.paginationOptions,class:"files-pagination-size",onChange:N},null,8,["selected","label","options"]))])):ie("",!0),a(b)?(D(),K("li",$D,[Q(fe,{checked:P.value,"onUpdate:checked":[re[2]||(re[2]=he=>P.value=he),j],"data-testid":"files-switch-projects-show-disabled",label:a(r)("Show disabled Spaces")},null,8,["checked","label"])])):ie("",!0),a(S)?(D(),K("li",OD,[Q(fe,{checked:$.value,"onUpdate:checked":[re[3]||(re[3]=he=>$.value=he),B],"data-testid":"files-switch-projects-show-disabled",label:a(r)("Show empty trash bins")},null,8,["checked","label"])])):ie("",!0),a(A)===a(Et).name.tiles?(D(),K("li",LD,[W("label",{for:"tiles-size-slider",textContent:R.toDisplayString(a(r)("Tile size"))},null,8,_D),je(W("input",{id:"tiles-size-slider","onUpdate:modelValue":re[4]||(re[4]=he=>ct(I)?I.value=he:null),type:"range",min:1,max:a(F),class:"oc-range bg-role-surface-container-high rounded-sm outline-0 w-full max-w-[50%] h-1.5 hover:opacity-100 appearance-none","data-testid":"files-tiles-size-slider"},null,8,MD),[[_a,a(I)]])])):ie("",!0)]),_:1})]),_:1},8,["title"])])}}}),[["__scopeId","data-v-17fa8a66"]]),ND={key:0,id:"mobile-nav"},BD=["aria-current"],jD={class:"flex"},zD=["textContent"],VD={class:"versions flex flex-col items-center justify-center py-2 mt-4 bg-role-surface-container text-xs text-role-on-surface-variant"},UD=["textContent"],Ym=ge({__name:"MobileNav",setup(e){const t=Ct(),{isMobile:n}=to(),{navItems:r}=$m(),s=T(()=>vp({capabilityStore:t})),o=T(()=>a(r).find(i=>i.active)||a(r)[0]);return(i,l)=>{const u=te("oc-icon"),d=te("oc-button"),c=te("oc-list"),f=te("version-check"),p=te("oc-drop");return a(n)?(D(),K("nav",ND,[Q(d,{id:"mobile-nav-button",class:"p-1",appearance:"raw","aria-current":"page"},{default:X(()=>[it(R.toDisplayString(o.value.name)+" ",1),Q(u,{name:"arrow-drop-down"})]),_:1}),Q(p,{title:i.$gettext("Navigation"),"drop-id":"mobile-nav-drop",toggle:"#mobile-nav-button",mode:"click","padding-size":"small","close-on-click":""},{default:X(()=>[Q(c,null,{default:X(()=>[(D(!0),K(ke,null,Ge(a(r),(h,g)=>(D(),K("li",{key:g,class:"mobile-nav-item w-full","aria-current":h.active?"page":null},[Q(d,{type:"router-link",appearance:h.active?"filled":"raw-inverse","color-role":h.active?"secondaryContainer":"surface","justify-content":"left","no-hover":h.active,to:h.route,class:R.normalizeClass(["block p-2",{"router-link-active":h.active}])},{default:X(()=>[W("span",jD,[Q(u,{name:h.icon},null,8,["name"]),W("span",{class:"ml-4 text",textContent:R.toDisplayString(h.name)},null,8,zD)])]),_:2},1032,["appearance","color-role","no-hover","to","class"])],8,BD))),128))]),_:1}),W("div",VD,[W("div",{textContent:R.toDisplayString(s.value)},null,8,UD),Q(f)])]),_:1},8,["title"])])):ie("",!0)}}}),qD=ge({name:"AppBar",components:{BatchActions:Km,ContextActions:Jm,ViewOptions:Xm,MobileNav:Ym},props:{viewModeDefault:{type:String,required:!1,default:()=>Et.defaultModeName},breadcrumbs:{type:Array,default:()=>[]},breadcrumbsContextActionsItems:{type:Array,default:()=>[]},viewModes:{type:Array,default:()=>[]},hasBulkActions:{type:Boolean,default:!1},hasViewOptions:{type:Boolean,default:!0},hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},showActionsOnSelection:{type:Boolean,default:!1},batchActionsLoading:{type:Boolean,default:!1},space:{type:Object,required:!1,default:null}},setup(e,{emit:t}){const n=Ue(),{$gettext:r}=de.useGettext(),{can:s}=Lt(),o=Ae(),{requestExtensions:i}=br(),{isSticky:l}=ac(),u=Pt(),{isSideBarOpen:d}=ve.storeToRefs(u),c=Re(),{selectedResources:f}=ve.storeToRefs(c),p=T(()=>e.space),{actions:h}=Gi(),{actions:g}=Yi(),{actions:m}=Di(),{actions:b}=Cm(),{actions:S}=Qi(),{actions:k}=mo(),{actions:w}=Ki(),{actions:C}=ws(),{actions:A}=Ji(),{actions:I}=go(),{actions:N}=Sm(),{actions:_}=km(),{actions:F}=Am(),{actions:V}=Dm(),Z=H(0),P=vn(mt,"files-common-search"),$=T(()=>Object.hasOwn(Cu(),"navigation")&&s("create-all","Share")),L=T(()=>{let fe=[...a(g),...a(h),...a(S),...a(w),...a(C),...a(A),...a(m),...a(k),...a(I)];P.value||(fe=[...fe,...a(b),...a(F),...a(V),...a(N),...a(_)]);const we=i({id:"global.files.batch-actions",extensionType:"action"});return we.length&&(fe=[...fe,...we.map($e=>$e.action)]),fe.filter($e=>$e.isVisible({space:a(p),resources:c.selectedResources}))}),M=T(()=>n.spaces.filter(fe=>z.isPersonalSpaceResource(fe)||z.isProjectSpaceResource(fe))),j=Un("isMobileWidth"),B=vn(jt,"files-trash-generic"),q=T(()=>!a(j)&&e.breadcrumbs.length?!0:a(B)&&a(M).length===1?!1:e.breadcrumbs.length>1),re=T(()=>a(B)&&a(M).length===1?e.breadcrumbs.length<=2:e.breadcrumbs.length<=1),J=T(()=>a(p)&&(z.isProjectSpaceResource(a(p))||z.isShareSpaceResource(a(p)))?3:2),oe=fe=>{t(tf,fe)},ne=Zp("title"),pe=T(()=>a(ne)?r(a(ne)):a(p)?.name||"");return{router:o,hasSharesNavigation:$,batchActions:L,showBreadcrumb:q,showMobileNav:re,breadcrumbMaxWidth:Z,breadcrumbTruncationOffset:J,fileDroppedBreadcrumb:oe,pageTitle:pe,selectedResources:f,isSticky:l,isSideBarOpen:d}},data:function(){return{resizeObserver:new ResizeObserver(this.onResize),limitedScreenSpace:!1}},computed:{showContextActions(){return Rc(this.breadcrumbs).allowContextActions},showBatchActions(){return this.hasBulkActions&&(this.selectedResources.length>=1||jt(this.router,"files-trash-generic"))},selectedResourcesAnnouncement(){return this.selectedResources.length===0?this.$gettext("No items selected."):this.$ngettext("%{ amount } item selected. Actions are available above the table.","%{ amount } items selected. Actions are available above the table.",this.selectedResources.length,{amount:this.selectedResources.length.toString()})}},mounted(){this.resizeObserver.observe(this.$refs.filesAppBar),window.addEventListener("resize",this.onResize)},beforeUnmount(){this.resizeObserver.unobserve(this.$refs.filesAppBar),window.removeEventListener("resize",this.onResize)},methods:{onResize(){const e=document.getElementById("web-content-main")?.getBoundingClientRect().width||0,t=document.getElementById("web-nav-sidebar")?.getBoundingClientRect().width||0,n=document.getElementById("app-sidebar")?.getBoundingClientRect().width||0,r=document.getElementById("files-app-bar-controls-right")?.clientWidth;this.breadcrumbMaxWidth=e-t-n-r,this.limitedScreenSpace=this.isSideBarOpen?window.innerWidth<=1280:window.innerWidth<=1e3}}}),HD={class:"files-topbar py-2 w-full"},WD=["textContent"],QD={key:3,id:"files-app-bar-controls-right",class:"flex"},KD={class:"files-app-bar-actions flex items-center justify-end mt-1 min-h-10 gap-2"},GD={class:"flex-1 flex justify-start items-center"},JD={key:1};function XD(e,t,n,r,s,o){const i=te("oc-hidden-announcer"),l=te("context-actions"),u=te("oc-breadcrumb"),d=te("mobile-nav"),c=te("view-options"),f=te("batch-actions"),p=te("oc-spinner");return D(),K("div",{id:"files-app-bar",ref:"filesAppBar",class:R.normalizeClass(["px-4 bg-role-surface rounded-t-xl [display:inherit] top-0 z-20",{"files-app-bar-squashed":e.isSideBarOpen,sticky:e.isSticky}])},[W("div",HD,[W("h1",{class:"sr-only",textContent:R.toDisplayString(e.pageTitle)},null,8,WD),Q(i,{announcement:e.selectedResourcesAnnouncement,level:"polite"},null,8,["announcement"]),W("div",{class:R.normalizeClass(["flex items-center files-app-bar-controls min-h-12",{"justify-between":e.breadcrumbs.length||e.hasSharesNavigation,"justify-end":!e.breadcrumbs.length&&!e.hasSharesNavigation}])},[e.showBreadcrumb?(D(),ee(u,{key:0,id:"files-breadcrumb","context-menu-padding":"small","show-context-actions":e.showContextActions,items:e.breadcrumbs,"max-width":e.breadcrumbMaxWidth,"truncation-offset":e.breadcrumbTruncationOffset,"mobile-breakpoint":e.isSideBarOpen?"md":"sm",onItemDroppedBreadcrumb:e.fileDroppedBreadcrumb},{contextMenu:X(()=>[Q(l,{"action-options":{space:e.space,resources:e.breadcrumbsContextActionsItems.filter(Boolean)}},null,8,["action-options"])]),_:1},8,["show-context-actions","items","max-width","truncation-offset","mobile-breakpoint","onItemDroppedBreadcrumb"])):ie("",!0),e.showMobileNav?(D(),ee(d,{key:1})):ie("",!0),e.hasSharesNavigation?Se(e.$slots,"navigation",{key:2}):ie("",!0),e.hasViewOptions?(D(),K("div",QD,[Q(c,{"view-modes":e.viewModes,"has-hidden-files":e.hasHiddenFiles,"has-file-extensions":e.hasFileExtensions,"has-pagination":e.hasPagination,"per-page-storage-prefix":"files","view-mode-default":e.viewModeDefault},null,8,["view-modes","has-hidden-files","has-file-extensions","has-pagination","view-mode-default"])])):ie("",!0)],2),W("div",KD,[W("div",GD,[Se(e.$slots,"actions",{limitedScreenSpace:e.limitedScreenSpace}),e.showBatchActions&&!e.batchActionsLoading?(D(),ee(f,{key:0,actions:e.batchActions,"action-options":{space:e.space,resources:e.selectedResources},"limited-screen-space":e.limitedScreenSpace},null,8,["actions","action-options","limited-screen-space"])):e.showBatchActions&&e.batchActionsLoading?(D(),K("div",JD,[Q(p,{"aria-label":e.$gettext("Loading actions")},null,8,["aria-label"])])):ie("",!0)])]),Se(e.$slots,"content")])],2)}const YD=Le(qD,[["render",XD]]),ZD={class:"oc-app-top-bar self-center flex col-[1/4] row-2 sm:col-2 sm:row-1 [&_.parent-folder]:text-role-on-chrome"},eF={class:"pl-4 pr-1 my-2 mx-auto sm:m-0 inline-flex items-center justify-between bg-role-chrome border border-role-on-chrome rounded-lg h-10 gap-4 w-full sm:w-fit"},tF={class:"open-file-bar flex"},nF={class:"flex"},rF={key:1,class:"flex items-center","data-testid":"autosave-indicator"},Zm=ge({__name:"AppTopBar",props:{dropDownMenuSections:{default:()=>[]},dropDownActionOptions:{default:()=>({space:null,resources:[]})},mainActions:{default:()=>[]},hasAutoSave:{type:Boolean,default:!0},isEditor:{type:Boolean,default:!1},resource:{default:null},isReadOnly:{type:Boolean,default:!0}},emits:["close"],setup(e){const{$gettext:t,current:n}=de.useGettext(),r=Re(),s=Qe(),{getMatchingSpace:o}=Rt(),{getParentFolderName:i,getPathPrefix:l,getParentFolderLinkIconAdditionalAttributes:u}=Tr(),d=T(()=>r.areFileExtensionsShown),c=T(()=>t("Show context menu")),f=T(()=>e.isEditor&&e.hasAutoSave&&s.options.editor.autosaveEnabled),p=T(()=>{const m=ht.Duration.fromObject({seconds:s.options.editor.autosaveInterval},{locale:n});return t("Autosave (every %{ duration })",{duration:m.toHuman()})}),h=T(()=>o(e.resource)),g=T(()=>!z.isPublicSpaceResource(a(h)));return(m,b)=>{const S=te("oc-icon"),k=te("oc-button"),w=te("oc-drop"),C=Bt("oc-tooltip");return D(),K("div",ZD,[W("div",eF,[W("div",tF,[e.resource?(D(),ee(ho,{key:0,id:"app-top-bar-resource",class:"[&_.oc-resource-name]:max-w-60 xs:[&_.oc-resource-name]:max-w-full sm:[&_.oc-resource-name]:max-w-20 md:[&_.oc-resource-name]:max-w-60 [&_svg]:!fill-role-on-chrome [&_span]:text-role-on-chrome","is-thumbnail-displayed":!1,"is-extension-displayed":d.value,"path-prefix":a(l)(e.resource),resource:e.resource,"parent-folder-name":a(i)(e.resource),"parent-folder-link-icon-additional-attributes":a(u)(e.resource),"is-path-displayed":g.value,"is-resource-clickable":!1},null,8,["is-extension-displayed","path-prefix","resource","parent-folder-name","parent-folder-link-icon-additional-attributes","is-path-displayed"])):ie("",!0)]),W("div",nF,[e.dropDownMenuSections.length?(D(),K(ke,{key:0},[je((D(),ee(k,{id:"oc-openfile-contextmenu-trigger","aria-label":c.value,appearance:"raw-inverse","color-role":"chrome",class:"p-1"},{default:X(()=>[Q(S,{name:"more-2"})]),_:1},8,["aria-label"])),[[C,c.value]]),Q(w,{"drop-id":"oc-openfile-contextmenu",mode:"click","padding-size":"small",toggle:"#oc-openfile-contextmenu-trigger","close-on-click":"",title:e.resource.name,onClick:b[0]||(b[0]=kt(()=>{},["stop","prevent"]))},{default:X(()=>[Q(ta,{"menu-sections":e.dropDownMenuSections,"action-options":e.dropDownActionOptions},null,8,["menu-sections","action-options"])]),_:1},8,["title"])],64)):ie("",!0),f.value&&!e.isReadOnly?(D(),K("span",rF,[je(Q(S,{"accessible-label":p.value,name:"refresh",color:"white",class:"ox-p-xs mx-1"},null,8,["accessible-label"]),[[C,p.value]])])):ie("",!0),e.mainActions.length&&e.resource?(D(),ee(ta,{key:2,"menu-sections":[{name:"main-actions",items:e.mainActions.filter(A=>A.isVisible()).map(A=>({...A,class:"p-1 text-role-on-chrome [&_svg]:!fill-role-on-chrome [&:hover:not(:disabled)_svg]:!fill-role-chrome",hideLabel:!0}))}],"action-options":{resources:[e.resource]},appearance:"raw-inverse","color-role":"chrome"},null,8,["menu-sections","action-options"])):ie("",!0),Q(k,{id:"app-top-bar-close",appearance:"raw-inverse","color-role":"chrome",class:"p-1","aria-label":a(t)("Close"),onClick:b[1]||(b[1]=A=>m.$emit("close"))},{default:X(()=>[Q(S,{name:"close"})]),_:1},8,["aria-label"])])])])}}}),sF=ge({name:"ErrorScreen",props:{message:{default:"",type:String,required:!1}}}),oF={class:"text-center flex justify-center items-center h-full"},iF={key:0,class:"text-xl"};function aF(e,t,n,r,s,o){const i=te("oc-icon");return D(),K("div",oF,[Q(i,{size:"xxlarge",name:"error-warning","fill-type":"line"}),e.message?(D(),K("p",iF,R.toDisplayString(e.message),1)):ie("",!0)])}const lF=Le(sF,[["render",aF]]),cF=ge({name:"LoadingScreen"}),uF={class:"text-center flex justify-center items-center h-full"},dF=["textContent"];function fF(e,t,n,r,s,o){const i=te("oc-spinner");return D(),K("div",uF,[Q(i,{size:"xlarge"}),W("p",{class:"sr-only",textContent:R.toDisplayString(e.$gettext("Loading app"))},null,8,dF)])}const pF=Le(cF,[["render",fF]]),hF=["id","data-testid","tabindex","inert"],mF={key:0,class:"sidebar-panel__header header grid grid-cols-[auto_1fr_auto] items-center pt-2 px-2"},gF={class:"col-start-2 text-center my-0 text-lg"},yF={key:0,class:"mt-4"},eg=Le(ge({__name:"SideBarPanels",props:{loading:{type:Boolean},availablePanels:{},panelContext:{},activePanel:{default:""}},emits:["selectPanel","close","closePanel"],setup(e,{emit:t}){const n=t,{$gettext:r}=de.useGettext(),s=T(()=>e.availablePanels.filter(w=>w.isVisible(e.panelContext)&&w.isRoot?.(e.panelContext))),o=T(()=>e.availablePanels.filter(w=>w.isVisible(e.panelContext)&&!w.isRoot?.(e.panelContext))),i=T(()=>a(s).length?[a(s)[0],...a(o)]:a(o)),l=T(()=>{const w=e.activePanel?.split("#")[0];return!w||!a(o).map(C=>C.name).includes(w)?null:w}),u=T(()=>a(l)!==null),d=T(()=>a(l)===null),c=H(null),f=w=>{c.value=w},p=T(()=>a(u)?a(l):a(s)[0].name),h=T(()=>a(s).length===1?r("Back to %{panel} panel",{panel:a(s)[0].title(e.panelContext)}):r("Back to main panels")),g=w=>{n("selectPanel",w)},m=()=>{n("selectPanel",null)},b=()=>{n("close")},S=w=>{f(a(p)),g(w)},k=()=>{f(a(p)),m(),n("closePanel")};return(w,C)=>{const A=te("oc-spinner"),I=te("oc-icon"),N=te("oc-button"),_=Bt("oc-tooltip");return e.loading?(D(),ee(A,{key:0,"aria-label":a(r)("Loading sidebar content")},null,8,["aria-label"])):(D(!0),K(ke,{key:1},Ge(i.value,F=>(D(),K("div",{id:`sidebar-panel-${F.name}`,key:`panel-${F.name}`,"data-testid":`sidebar-panel-${F.name}`,tabindex:p.value===F.name?-1:null,class:R.normalizeClass(["sidebar-panel absolute top-0 grid grid-rows-[auto_auto_1fr] bg-role-surface w-full size-full max-w-full max-h-full motion-reduce:transition-none",{"is-root-panel transition-[right] duration-[0.4s,0s]":F.isRoot?.(e.panelContext),"is-active-sub-panel":u.value&&l.value===F.name,"is-active-root-panel transition-[right] duration-[0.4s,0s]":d.value&&F.isRoot?.(e.panelContext)}]),inert:p.value!==F.name},[[p.value,c.value].includes(F.name)?(D(),K("div",mF,[F.isRoot?.(e.panelContext)?ie("",!0):je((D(),ee(N,{key:0,class:"header__back col-start-1 p-1",appearance:"raw","aria-label":h.value,onClick:k},{default:X(()=>[Q(I,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"])),[[_,h.value]]),W("h2",gF,R.toDisplayString(F.title(e.panelContext)),1),Q(N,{appearance:"raw",class:"header__close col-start-3 p-1","aria-label":a(r)("Close file sidebar"),onClick:b},{default:X(()=>[Q(I,{name:"close"})]),_:1},8,["aria-label"])])):ie("",!0),W("div",null,[F.isRoot?.(e.panelContext)?Se(w.$slots,"rootHeader",{key:0},void 0,!0):Se(w.$slots,"subHeader",{key:1},void 0,!0)]),W("div",{class:R.normalizeClass(["sidebar-panel__body flex flex-col p-2 overflow-y-auto overflow-x-hidden",[`sidebar-panel__body-${F.name}`]])},[W("div",{class:R.normalizeClass(["sidebar-panel__body-content",{"flex-1 ":!F.isRoot?.(e.panelContext)}])},[Se(w.$slots,"body",{},()=>[(D(!0),K(ke,null,Ge(F.isRoot?.(e.panelContext)?s.value:[F],(V,Z)=>(D(),K("div",{key:`sidebar-panel-${V.name}`},[(d.value?V.isRoot?.(e.panelContext):[p.value,c.value].includes(V.name))?(D(),ee(Yt(V.component),at({key:0,class:[{"multi-root-panel-separator mt-4 pt-2 border-t":Z>0},"rounded-sm"]},{ref_for:!0},V.componentAttrs?.(e.panelContext)||{}),null,16,["class"])):ie("",!0)]))),128))],!0)],2),F.isRoot?.(e.panelContext)&&o.value.length>0?(D(),K("div",yF,[(D(!0),K(ke,null,Ge(o.value,V=>(D(),ee(N,{id:`sidebar-panel-${V.name}-select`,key:`panel-select-${V.name}`,"data-testid":`sidebar-panel-${V.name}-select`,appearance:"raw-inverse","color-role":"surface",class:"!grid !grid-cols-[auto_1fr_auto] text-left px-2 w-full h-12",onClick:Z=>S(V.name)},{default:X(()=>[Q(I,{name:V.icon,"fill-type":V.iconFillType},null,8,["name","fill-type"]),it(" "+R.toDisplayString(V.title(e.panelContext))+" ",1),Q(I,{name:"arrow-right-s","fill-type":"line"})]),_:2},1032,["id","data-testid","onClick"]))),128))])):ie("",!0)],2)],10,hF))),128))}}}),[["__scopeId","data-v-839c4e7a"]]),tg=ge({inheritAttrs:!1,__name:"SideBar",props:{loading:{type:Boolean},availablePanels:{},panelContext:{}},emits:["selectPanel","close"],setup(e,{emit:t}){const n=t,r=qo(),{isMobile:s}=to(),o=Pt(),{focusSidebar:i}=o,{sideBarActivePanel:l}=ve.storeToRefs(o),u=T(()=>{if(a(s))return{...a(r),isFocusTrapActive:!e.loading,hasFullHeight:!0,maxHeight:"max-h-[80vh]",class:"z-100",onClicked:d};const p=["border-l","focus:outline-0","focus-visible:outline-0","w-[360px]","min-w-[360px]","overflow-hidden","relative","focus:shadow-none","focus-visible:shadow-none",...a(r)?.class?[a(r).class]:[]];return e.loading&&p.push("flex","justify-center","items-center"),{...a(r),class:p}}),d=p=>{if(!p.target)return;const h=p.target===p.currentTarget,g=p.target instanceof HTMLAnchorElement,m=p.target.closest("ul.sidebar-actions-panel");(h||g||m)&&c()},c=()=>{o.closeSideBar(),n("close")},f=p=>{o.openSideBarPanel(p),n("selectPanel",p)};return zo(()=>{a(s)&&c()}),(p,h)=>(D(),ee(Ps,{to:"#mobile-right-sidebar",disabled:!a(s)},[(D(),ee(Yt(a(s)?"oc-bottom-drawer":"div"),at({id:"app-sidebar",tabindex:"-1"},u.value),{default:X(()=>[Q(eg,{loading:e.loading,"available-panels":e.availablePanels,"panel-context":e.panelContext,"active-panel":a(l),onSelectPanel:f,onClose:c,onClosePanel:a(i)},{body:X(()=>[Se(p.$slots,"body")]),rootHeader:X(()=>[Se(p.$slots,"rootHeader")]),subHeader:X(()=>[Se(p.$slots,"subHeader")]),_:3},8,["loading","available-panels","panel-context","active-panel","onClosePanel"])]),_:3},16))],8,["disabled"]))}}),vF={class:"grid items-center p-2"},bF={class:"flex items-center text-sm"},wF=["textContent"],SF=["textContent"],hc=ge({__name:"SpaceInfo",setup(e){const t=Un("resource");return(n,r)=>{const s=te("oc-icon");return D(),K("div",vF,[W("div",bF,[Q(s,{name:"layout-grid",size:a(t).description?"large":"medium",class:"block mr-2"},null,8,["size"]),W("div",null,[W("h3",{"data-testid":"space-info-name",class:"font-semibold m-0 text-base break-all",textContent:R.toDisplayString(a(t).name)},null,8,wF),W("span",{"data-testid":"space-info-subtitle",textContent:R.toDisplayString(a(t).description)},null,8,SF)])])])}}}),kF={class:"flex justify-between p-2"},CF={class:"flex items-center"},TF={"data-testid":"files-info-name",class:"font-semibold m-0 text-base break-all"},mc=ge({__name:"FileInfo",props:{isSubPanelActive:{type:Boolean,default:!0}},setup(e){const t=Re(),{isPersonalSpaceRoot:n}=Rt(),r=Un("resource"),s=Un("space"),o=T(()=>t.areFileExtensionsShown),i=T(()=>n(a(r))?a(s).name:a(r).name);return(l,u)=>(D(),K("div",kF,[W("div",CF,[e.isSubPanelActive?(D(),ee(po,{key:0,resource:a(r),size:"large",class:"mr-2 relative"},null,8,["resource"])):ie("",!0),W("div",null,[W("h3",TF,[Q(ec,{name:i.value,extension:a(r).extension,type:a(r).type,"full-path":a(r).webDavPath,"is-extension-displayed":o.value,"is-path-displayed":!1,"truncate-name":!1,class:"[&_span]:break-all"},null,8,["name","extension","type","full-path","is-extension-displayed"])])])])]))}}),ng=ge({__name:"FileSideBar",props:{space:{default:()=>{}}},setup(e){const t=Ae(),n=Ee(),r=br(),s=Ue(),o=Jn(),i=Qe(),l=Pn(),{canListShares:u}=gm(),{canListVersions:d}=Mm(),c=Re(),{currentFolder:f}=ve.storeToRefs(c),p=Pt(),{isSideBarOpen:h,sideBarActivePanel:g}=ve.storeToRefs(p),m=H(),b=H([]),S=H([]),k=H([]),{selectedResources:w}=dc(),C=H(!1),A=T(()=>a(C)),I=T(()=>a(w).length===0?{root:e.space,parent:null,items:a(f)?.id?[a(f)]:[]}:{root:e.space,parent:a(f),items:a(w)}),N=vn(pt,"files-shares-with-me"),_=vn(pt,"files-shares-with-others"),F=vn(pt,"files-shares-via-link"),V=rt(t,"files-spaces-projects"),Z=vn(mt,"files-common-favorites"),P=vn(mt,"files-common-search"),$=T(()=>a(I).items?.length===1&&!z.isProjectSpaceResource(a(I).items[0])),L=T(()=>a(I).items?.length===1&&z.isProjectSpaceResource(a(I).items[0])),M=T(()=>a(N)||a(_)||a(F)),j=T(()=>a(M)||a(P)||a(Z)),B=T(()=>r.requestExtensions({id:"global.files.sidebar",extensionType:"sidebarPanel"}).map(ne=>ne.panel)),q=Ft.useTask(function*(ne,pe){b.value=yield n.webdav.listFileVersions(pe.id,{signal:ne})}),re=Ft.useTask(function*(ne,pe){o.setLoading(!0),o.removeOrphanedShares();const{collaboratorShares:fe,linkShares:we}=o,$e=n.graphAuthenticated.permissions;let he=e.space?.id;if(z.isShareSpaceResource(e.space)){const Ve=yield s.getMountPointForSpace({graphClient:n.graphAuthenticated,space:e.space,signal:ne});Ve&&(he=Ve.root.remoteItem.rootId)}const{shares:ae,allowedRoles:ue}=yield*z.call($e.listPermissions(he,pe.fileId,o.graphRoles,{},{signal:ne})),be=ae.filter(z.isCollaboratorShare),me=ae.filter(z.isLinkShare),De=Object.values(o.graphRoles);if(S.value=ue?.map(Ve=>({...Ve,icon:De.find(ye=>ye.id===Ve.id)?.icon}))||[],l.isAppEnabled("open-cloud-mesh")){const{allowedRoles:Ve}=yield*z.call($e.listPermissions(he,pe.fileId,o.graphRoles,{filter:`@libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition, '@Subject.UserType=="Federated"'))`,select:[Gp.LibreGraphPermissionsRolesAllowedValues]},{signal:ne}));k.value=Ve?.map(ye=>({...ye,icon:De.find(Fe=>Fe.id===ye.id)?.icon}))||[]}!a(j)&&!a(V)&&(fe.forEach(Ve=>{be.some(ye=>ye.id===Ve.id)||be.push({...Ve,indirect:!0})}),we.forEach(Ve=>{me.some(ye=>ye.id===Ve.id)||me.push({...Ve,indirect:!0})})),mt(t,"files-common-search")&&(yield c.loadAncestorMetaData({folder:a(pe),space:e.space,client:n.webdav,signal:ne}));const ut=[...fe,...we].map(({resourceId:Ve})=>Ve),Kt=Object.values(c.ancestorMetaData).filter(({id:Ve,path:ye})=>Ve===pe.id||ut.includes(Ve)||z.isIncomingShareResource(pe)?!1:z.isPersonalSpaceResource(e.space)?ye!=="/":!0).map(({id:Ve})=>Ve);a(j)&&z.isProjectSpaceResource(e.space)&&!z.isProjectSpaceResource(pe)&&Kt.push(e.space.id);const vt=new sr({concurrency:i.options.concurrentRequests.shares.list}),Dt=[...new Set(Kt)].map(Ve=>vt.add(()=>n.graphAuthenticated.permissions.listPermissions(he,Ve,o.graphRoles,{},{signal:ne}).then(ye=>{const Fe=ye.shares.map(gt=>({...gt,indirect:!0}));be.push(...Fe.filter(z.isCollaboratorShare)),me.push(...Fe.filter(z.isLinkShare))})));yield Promise.allSettled(Dt),o.setCollaboratorShares(be),o.setLinkShares(me),o.setLoading(!1)}).restartable(),J=H();ze(()=>[...a(I).items,h],async(ne,pe)=>{if(a(I).items?.length!==1)return;if(!a(h)){J.value=void 0,b.value=[];return}const fe=ne?.[0],we=pe?.[0];if(fe?.id===we?.id&&fe?.mdate===a(J))return;const $e=a(I).items[0];if(J.value=$e.mdate,q.isRunning&&q.cancelAll(),!!d({space:e.space,resource:$e}))try{await q.perform($e)}catch(he){console.error(he)}},{immediate:!0,deep:!0});const oe=T(()=>a(I).items.map(ne=>ne.id));return ze(()=>[oe,h],async()=>{if(!a(h)||!a(I).items?.length){o.pruneShares(),m.value=null;return}if(a(I).items?.length!==1)return;const ne=a(I).items[0];if(C.value=!0,z.isProjectSpaceResource(ne)&&await s.loadGraphPermissions({ids:[ne.id],graphClient:n.graphAuthenticated}),u({space:e.space,resource:ne}))try{re.isRunning&&re.cancelAll(),re.perform(ne)}catch(pe){console.error(pe)}if(!z.isOutgoingShareResource(ne)&&!z.isIncomingShareResource(ne)){m.value=ne,C.value=!1;return}try{const pe=await n.webdav.getFileInfo(e.space,{path:ne.path}),fe={...pe,...ne,tags:pe.tags};m.value=fe}catch(pe){m.value=ne,console.error(pe)}C.value=!1},{deep:!0,immediate:!0}),ns("resource",ar(m)),ns("versions",ar(b)),ns("space",T(()=>e.space)),ns("availableInternalShareRoles",ar(S)),ns("availableExternalShareRoles",ar(k)),ns("versionsLoading",T(()=>q.isRunning)),(ne,pe)=>a(h)?(D(),ee(tg,at({key:0,ref:"sidebar",class:"files-side-bar z-30","available-panels":B.value,"panel-context":I.value,loading:A.value},ne.$attrs,{"data-custom-key-bindings-disabled":"true"}),{rootHeader:X(()=>[$.value?(D(),ee(mc,{key:0,class:"px-2 pt-2","is-sub-panel-active":!1})):L.value?(D(),ee(hc,{key:1})):ie("",!0)]),subHeader:X(()=>[$.value?(D(),ee(mc,{key:0,class:"px-2 pt-2","is-sub-panel-active":!0})):L.value?(D(),ee(hc,{key:1})):ie("",!0)]),_:1},16,["available-panels","panel-context","loading"])):ie("",!0)}}),xF=ge({name:"DatePickerModal",props:{modal:{type:Object,required:!0},currentDate:{type:Object,required:!1,default:null},minDate:{type:Object,required:!1,default:null},isClearable:{type:Boolean,default:!0}},emits:["confirm","cancel"],setup(){const e=On(),{currentTheme:t}=ve.storeToRefs(e),n=H(),r=H(!0);return{confirmDisabled:r,onDateChanged:({date:o,error:i})=>{r.value=i||!o,n.value=o},currentTheme:t,dateTime:n}}}),AF={class:"flex justify-end items-center mt-2"};function RF(e,t,n,r,s,o){const i=te("oc-datepicker"),l=te("oc-button");return D(),K(ke,null,[Q(i,{label:e.$gettext("Expiration date"),type:"date","min-date":e.minDate,"current-date":e.currentDate,"is-clearable":e.isClearable,"is-dark":e.currentTheme.isDark,"required-mark":"",onDateChanged:e.onDateChanged},null,8,["label","min-date","current-date","is-clearable","is-dark","onDateChanged"]),W("div",AF,[Q(l,{class:"oc-modal-body-actions-cancel ml-2",onClick:t[0]||(t[0]=u=>e.$emit("cancel"))},{default:X(()=>[it(R.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),Q(l,{disabled:e.confirmDisabled,class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:t[1]||(t[1]=u=>e.$emit("confirm",e.dateTime))},{default:X(()=>[it(R.toDisplayString(e.$gettext("Confirm")),1)]),_:1},8,["disabled"])])],64)}const EF=Le(xF,[["render",RF]]),DF=ge({name:"UnsavedChangesModal",props:{modal:{type:Object,required:!0},closeCallback:{type:Function,required:!0}},emits:["cancel","confirm"],setup(e){const{removeModal:t}=Ke();return{onClose:()=>{t(e.modal.id),e.closeCallback()}}}}),FF=["textContent"],IF={class:"flex justify-end items-center mt-4"},PF={class:"oc-modal-body-actions-grid"};function $F(e,t,n,r,s,o){const i=te("oc-button");return D(),K(ke,null,[W("span",{class:"inline-block mb-4",textContent:R.toDisplayString(e.$gettext("Your changes were not saved. Do you want to save them?"))},null,8,FF),t[2]||(t[2]=W("div",{class:"my-4"},null,-1)),W("div",IF,[W("div",PF,[Q(i,{class:"oc-modal-body-actions-cancel ml-2",onClick:t[0]||(t[0]=l=>e.$emit("cancel"))},{default:X(()=>[it(R.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),Q(i,{class:"oc-modal-body-actions-secondary ml-2",onClick:e.onClose},{default:X(()=>[it(R.toDisplayString(e.$gettext("Don't Save")),1)]),_:1},8,["onClick"]),Q(i,{class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:t[1]||(t[1]=l=>e.$emit("confirm"))},{default:X(()=>[it(R.toDisplayString(e.$gettext("Save")),1)]),_:1})])])],64)}const rg=Le(DF,[["render",$F]]);var OF=/\s/;function LF(e){for(var t=e.length;t--&&OF.test(e.charAt(t)););return t}var _F=/^\s+/;function MF(e){return e&&e.slice(0,LF(e)+1).replace(_F,"")}var sg=NaN,NF=/^[-+]0x[0-9a-f]+$/i,BF=/^0b[01]+$/i,jF=/^0o[0-7]+$/i,zF=parseInt;function VF(e){if(typeof e=="number")return e;if(hi(e))return sg;if(En(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=En(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=MF(e);var n=BF.test(e);return n||jF.test(e)?zF(e.slice(2),n?2:8):NF.test(e)?sg:+e}const UF=["id"],qF=["textContent"],HF={key:2,class:"flex size-full"},gc="app.app-wrapper.app-top-bar",og=ge({__name:"AppWrapper",props:{applicationId:{},urlForResourceOptions:{default:null},fileContentOptions:{default:null},wrappedComponent:{default:null},importResourceWithExtension:{type:Function,default:()=>null},disableAutoSave:{type:Boolean,default:!1}},setup(e){const{$gettext:t,current:n}=de.useGettext(),r=Pn(),{showMessage:s,showErrorMessage:o}=Me(),i=Kr.useRouter(),l=yt(),u=Ee(),d=Nt(),{getResourceContext:c}=Nm(),{selectedResources:f}=dc(),{dispatchModal:p}=Ke(),h=Ue(),g=Qe(),m=Re(),b=Jn(),S=Sr(),{isMobile:k}=to(),w=Pt(),{isSideBarOpen:C}=ve.storeToRefs(w),{actions:A}=um({appId:e.applicationId}),{actions:I}=jl(),{actions:N}=ws(),{actions:_}=oc(),{actions:F}=ic(),{actions:V}=mo(),Z=T(()=>!!e.wrappedComponent.emits?.includes("update:resource")),P=H(),$=H(),L=H(""),M=H(""),j=H(!a(Z)),B=H(),q=H(!1),re=H(),J=H();let oe="",ne=null;const{registerExtensions:pe,unregisterExtensions:fe}=br(),we=T(()=>a(j)||a(B)||!a(P)?[]:[{id:gc,type:"customComponent",extensionPointIds:["app.runtime.header.left"],content:Zm,componentProps:()=>({resource:a(P),isReadOnly:a(q),isEditor:a(he),hasAutoSave:!e.disableAutoSave,mainActions:a(F$),dropDownMenuSections:a(D$),dropDownActionOptions:a(xe),onClose:()=>{De(),fe([gc])}})}]);pe(we);const{actions:$e}=pm({content:J}),he=T(()=>!!e.wrappedComponent.emits?.includes("update:currentContent")),ae=Ce=>!!Object.keys(e.wrappedComponent.props).includes(Ce),ue=T(()=>a(J)!==a(re)),be=Ce=>{Ce.preventDefault()};ze(ue,Ce=>{Ce?window.addEventListener("beforeunload",be):window.removeEventListener("beforeunload",be)});const{applicationConfig:me,closeApp:De,currentFileContext:_e,getFileContents:ut,getFileInfo:Kt,getUrlForResource:vt,putFileContents:Dt,replaceInvalidFileRoute:Ve,revokeUrl:ye,activeFiles:Fe,loadFolderForFileContext:gt,isFolderLoading:Qr}=lh({applicationId:e.applicationId}),{applicationMeta:xr}=Nl({applicationId:e.applicationId,appsStore:r}),kn=T(()=>a(xr).meta?.fileSizeLimit),bt=T(()=>{const{name:Ce}=a(xr);return t("%{appName} for %{fileName}",{appName:t(Ce),fileName:a(a(_e).fileName)})}),ln=Ti("driveAliasAndItem"),vo=At("fileId"),cn=T(()=>ot(a(vo))),bo=async()=>{const Ce=a(cn),{space:Oe,path:lt}=await c(Ce),Mn=Oe.getDriveAliasAndItem({path:lt});return z.isPersonalSpaceResource(Oe)?i.push({params:{...a(l).params,driveAliasAndItem:Mn},query:{...a(l).query,fileId:Ce,contextRouteName:"files-spaces-generic",contextRouteParams:{driveAliasAndItem:We.dirname(Mn)}}}):i.push({params:{...a(l).params,driveAliasAndItem:Mn},query:{...a(l).query,fileId:Ce,contextRouteName:lt==="/"?"files-shares-with-me":"files-spaces-generic",...z.isShareSpaceResource(Oe)&&{shareId:Oe.id},contextRouteParams:{driveAliasAndItem:We.dirname(Mn)},contextRouteQuery:{...z.isShareSpaceResource(Oe)&&{shareId:Oe.id}}}})},E=Ft.useTask(function*(Ce){try{a(ln)||(yield bo()),$.value=a(a(_e).space);const Oe=yield Kt(a(_e),{signal:Ce});if(P.value=Oe,z.isShareSpaceResource(a($))&&(a(P).remoteItemId=a($).id,a(P).id===a(P).remoteItemId)){const lt=yield*z.call(li({graphClient:u.graphAuthenticated,spacesStore:h,space:a($)}));lt&&(P.value={...Oe,...z.buildIncomingShareResource({graphRoles:b.graphRoles,driveItem:lt,serverUrl:g.serverUrl}),tags:Oe.tags})}m.initResourceList({currentFolder:null,resources:[a(P)]}),f.value=[a(P)]}catch(Oe){console.error(Oe),B.value=Oe,j.value=!1}}).restartable(),y=Ft.useTask(function*(Ce){try{const Oe=e.importResourceWithExtension(a(P));if(Oe){const lt=ht.DateTime.local().toFormat("yyyyMMddHHmmss"),Mn=`${a(P).name}_${lt}.${Oe}`;if(!(yield u.webdav.copyFiles(a($),a(P),a($),{path:Mn},{signal:Ce})))throw new Error(t("Importing failed"));P.value={path:Mn}}if(Ve(_e,a(P)))return;if(q.value=![uf.Updateable,uf.FileUpdateable].some(lt=>(a(P).permissions||"").indexOf(lt)>-1),a(ae("currentContent"))){const lt=yield*z.call(ut(_e,{...e.fileContentOptions,signal:Ce}));re.value=J.value=lt.body,L.value=lt.headers["OC-ETag"]}a(ae("url"))&&(M.value=yield vt(a($),a(P),{...e.urlForResourceOptions,signal:Ce}))}catch(Oe){console.error(Oe),B.value=Oe}finally{j.value=!1}}).restartable();ze(_e,async()=>{a(Z)?$.value=a(a(_e).space):(await E.perform(),a(kn)&&VF(a(P).size)>a(kn)?p({title:t("File exceeds %{threshold}",{threshold:zt(a(kn),n)}),message:t("%{resource} exceeds the recommended size of %{threshold} for editing, and may cause performance issues.",{resource:a(P).name,threshold:zt(a(kn),n)}),confirmText:t("Continue"),onCancel:()=>{De()},onConfirm:()=>{y.perform()}}):y.perform())},{immediate:!0});const v=Ce=>{console.error(Ce),o({title:t("An error occurred"),desc:Ce.message,errors:[Ce]})},O=()=>{s({title:t("File autosaved")})},U=Ft.useTask(function*(){const Ce=a(J);try{const Oe=yield Dt(_e,{content:Ce,previousEntityTag:a(L)});re.value=Ce,L.value=Oe.etag,m.upsertResource(Oe)}catch(Oe){switch(Oe.statusCode){case 401:case 403:v(new z.HttpError(t("You're not authorized to save this file"),Oe.response));break;case 409:case 412:v(new z.HttpError(t("This file was updated outside this window. Please copy your changes or save the file under a new name (»Save As...«)."),Oe.response));break;case 507:const lt=h.spaces.find(Mn=>Mn.id===a(P).storageId&&z.isProjectSpaceResource(Mn));if(lt){v(new z.HttpError(t('Insufficient quota on "%{spaceName}" to save this file',{spaceName:lt.name}),Oe.response));break}v(new z.HttpError(t("Insufficient quota for saving this file"),Oe.response));break;default:v(new z.HttpError("",Oe.response))}}}).drop(),Y=async()=>{await U.perform()};let se=null;ft(()=>{if(oe=S.subscribe("runtime.resource.deleted",Be),m.ancestorMetaData?.["/"]&&a($)&&m.ancestorMetaData["/"].spaceId!==a($).id&&m.setAncestorMetaData({}),!a(he))return;const Ce=g.options.editor;Ce.autosaveEnabled&&!e.disableAutoSave&&(se=setInterval(async()=>{ue.value&&(await Y(),O())},(Ce.autosaveInterval||120)*1e3))}),Xt(()=>{S.unsubscribe("runtime.resource.deleted",oe),fe([gc]),d.isLoading||window.removeEventListener("beforeunload",be),a(ae("url"))&&ye(M.value),a(he)&&(clearInterval(se),se=null)});const{bindKeyAction:Ie}=Ii({skipDisabledKeyBindingsCheck:!0});Ie({modifier:Fi.Ctrl,primary:Ln.S},()=>{a(ue)&&Y()});const le=T(()=>[{name:"save-file",disabledTooltip:()=>"",isVisible:()=>a(he)&&!a(q),isDisabled:()=>!a(ue),icon:"save",id:"app-save-action",label:()=>t("Save"),handler:Y}]),xe=T(()=>({space:a($),resources:[a(P)]})),qe=async(Ce,Oe)=>{a(ue)&&(await Y(),O()),Oe(Ce)},Be=Ce=>{if(Ce.find(lt=>lt.id===a(P).id)){if(ne)return ne();De()}},fg=T(()=>[...a(A),...a(le),...a($e).map(Ce=>({...Ce,isVisible:Oe=>he.value&&Ce.isVisible(Oe)}))].filter(Ce=>Ce.isVisible(a(xe)))),pg=T(()=>[...a(F),...a(I)].filter(Ce=>Ce.isVisible(a(xe)))),hg=T(()=>[...a(N).map(Ce=>({...Ce,handler:Oe=>qe(Oe,Ce.handler)})),...a(V)].filter(Ce=>Ce.isVisible(a(xe)))),mg=T(()=>[...a(_)].filter(Ce=>Ce.isVisible(a(xe)))),D$=T(()=>{const Ce=[];return a(fg).length&&Ce.push({name:"context",items:a(fg)}),a(pg).length&&Ce.push({name:"share",items:a(pg)}),a(hg).length&&Ce.push({name:"actions",items:a(hg)}),a(mg).length&&Ce.push({name:"sidebar",items:a(mg)}),Ce}),F$=T(()=>[...a(le)]);Kr.onBeforeRouteLeave((Ce,Oe,lt)=>{a(ue)?p({title:t("Unsaved changes"),customComponent:rg,focusTrapInitial:".oc-modal-body-actions-confirm",hideActions:!0,customComponentAttrs:()=>({closeCallback:()=>{lt()}}),async onConfirm(){await Y(),lt()}}):lt()});const I$=T(()=>({url:a(M),space:a(a(_e).space),resource:a(P),activeFiles:a(Fe),isDirty:a(ue),isReadOnly:a(q),applicationConfig:a(me),currentFileContext:a(_e),currentContent:a(J),isFolderLoading:a(Qr),"onUpdate:resource":Ce=>{$.value=a(a(_e).space),P.value={...Ce,...z.isShareSpaceResource(a($))&&{remoteItemId:a($).id}},f.value=[a(P)]},"onUpdate:currentContent":Ce=>{J.value=Ce},"onRegister:onDeleteResourceCallback":Ce=>{ne=Ce},"onDelete:resource":()=>{a(V)[0].isVisible({space:a($),resources:[a(P)]})&&a(V)[0].handler({space:a($),resources:[a(P)]})},onSave:Y,onClose:De,loadFolderForFileContext:gt,revokeUrl:ye,getUrlForResource:vt}));return(Ce,Oe)=>(D(),K("main",{id:e.applicationId,class:"app-wrapper h-full",onKeydown:Oe[0]||(Oe[0]=Ns((...lt)=>a(De)&&a(De)(...lt),["esc"]))},[W("h1",{class:"sr-only",textContent:R.toDisplayString(bt.value)},null,8,qF),j.value?(D(),ee(pF,{key:0})):B.value?(D(),ee(lF,{key:1,message:B.value.message},null,8,["message"])):(D(),K("div",HF,[Se(Ce.$slots,"default",at({class:["app-wrapper-content size-full",{"w-[calc(100%-360px)]":a(C)&&!a(k)}]},I$.value)),Q(ng,{space:$.value},null,8,["space"])]))],40,UF))}});function WF(e,t){return ge({render(){return Xo(og,{wrappedComponent:e,...t},{default:n=>Xo(e,n)})}})}const yc=ge({__name:"ContextMenuQuickAction",props:{item:{},resourceDomSelector:{type:Function,default:e=>z.extractDomSelector(e.id)},title:{default:""}},emits:["quickActionClicked"],setup(e,{expose:t}){const{$gettext:n}=de.useGettext(),r=qt("drop");t({drop:r});const s=T(()=>n("Show context menu"));return(o,i)=>{const l=te("oc-icon"),u=te("oc-button"),d=Bt("oc-tooltip");return D(),K(ke,null,[je((D(),ee(u,{id:`context-menu-trigger-${e.resourceDomSelector(e.item)}`,"data-test-context-menu-resource-name":e.item.name,"aria-label":s.value,appearance:"raw",class:R.normalizeClass(["quick-action-button ml-1 p-1",o.$attrs.class]),onClick:i[0]||(i[0]=c=>o.$emit("quickActionClicked",c))},{default:X(()=>[Q(l,{name:"more-2"})]),_:1},8,["id","data-test-context-menu-resource-name","aria-label","class"])),[[d,s.value]]),Q(a(Hh),{ref_key:"drop",ref:r,"drop-id":`context-menu-drop-${e.resourceDomSelector(e.item)}`,toggle:`#context-menu-trigger-${e.resourceDomSelector(e.item)}`,title:e.title,position:"left-start",mode:"manual","padding-size":"small","close-on-click":""},{default:X(()=>[Se(o.$slots,"contextMenu",{item:e.item})]),_:3},8,["drop-id","toggle","title"])],64)}}}),QF=ge({name:"ResourceGhostElement",components:{ResourceIcon:po},props:{previewItems:{type:Array,required:!0}},computed:{layerCount(){return Math.min(this.previewItems.length,3)},showSecondLayer(){return this.layerCount>1},showThirdLayer(){return this.layerCount>2},itemCount(){return this.previewItems.length}}}),KF={id:"ghost-element",class:"z-[var(--z-index-modal)] absolute pt-1 pl-4 bg-transparent"},GF={class:"relative rounded-sm bg-role-surface-container-high"},JF={key:0,class:"-z-10 absolute top-[3px] left-[3px] right-[-3px] bottom-[-3px] rounded-sm bg-role-surface-container-high brightness-82"},XF={key:1,class:"-z-20 absolute top-[6px] left-[6px] right-[-6px] bottom-[-6px] rounded-sm bg-role-surface-container-high brightness-72"},YF={class:"badge absolute top-[-2px] right-[-8px] p-1 text-sm text-center leading-2 bg-red-600 text-white rounded-4xl box-content min-w-2 h-2"};function ZF(e,t,n,r,s,o){const i=te("resource-icon");return D(),K("div",KF,[W("div",GF,[Q(i,{class:"p-1",resource:e.previewItems[0]},null,8,["resource"]),e.showSecondLayer?(D(),K("div",JF)):ie("",!0),e.showThirdLayer?(D(),K("div",XF)):ie("",!0)]),W("span",YF,R.toDisplayString(e.itemCount),1)])}const vc=Le(QF,[["render",ZF]]),eI=ge({name:"ResourceSize",props:{size:{type:[String,Number],required:!0}},setup:e=>{const{current:t}=de.useGettext();return{formattedSize:T(()=>zt(e.size,t))}}}),tI=["textContent"];function nI(e,t,n,r,s,o){return D(),K("span",{textContent:R.toDisplayString(e.formattedSize)},null,8,tI)}const ig=Le(eI,[["render",nI]]),ag=ge({__name:"ResourceStatusIndicators",props:{resource:{},space:{default:()=>{}},filter:{type:Function,default:void 0}},setup(e){const t=qo(),{getIndicators:n}=zm(),r=T(()=>{const s=n({space:e.space,resource:e.resource});return e.filter?s.filter(e.filter):s});return(s,o)=>r.value.length>0?(D(),ee(a(QA),at({key:0},a(t),{indicators:r.value,resource:e.resource}),null,16,["indicators","resource"])):ie("",!0)}}),na=ge({__name:"UserAvatar",props:{userId:{},userName:{}},setup(e){const t=ai(),{avatarMap:n}=ve.storeToRefs(t),{enqueueAvatar:r}=Qm(),s=T(()=>a(n)[e.userId]);return ft(()=>{r(e.userId)}),(o,i)=>{const l=te("oc-avatar");return D(),ee(l,{"user-name":e.userName,src:s.value,width:36},null,8,["user-name","src"])}}}),rI={class:R.normalizeClass(["[&_.cropper-crop-box]:!outline-1","[&_.cropper-crop-box]:!outline-role-outline","[&_.cropper-view-box]:!rounded-[50%]","[&_.cropper-crop-box]:!rounded-[50%]","[&_.cropper-line]:!bg-role-outline","[&_.cropper-point]:!bg-role-outline"])},sI={class:"flex flex-col items-center"},oI={class:"oc-button-group"},iI={key:0},aI=["src"],lI={class:"text-sm text-role-on-surface-variant flex items-center mt-1"},cI=["textContent"],uI=ge({__name:"AvatarUpload",setup(e){const t=Ze(),n=ai(),{avatarMap:r}=ve.storeToRefs(n),{user:s}=ve.storeToRefs(t),{$gettext:o}=de.useGettext(),{showErrorMessage:i,showMessage:l}=Me(),{graphAuthenticated:u}=Ee(),{setCropperInstance:d}=Bl(),c=H(null),f=H(null),p=H(null),h=H(!1),g=H(!1),m=H(!1),b=H(null),S=Yl*1024*1024,k=T(()=>!!a(r)[a(s).id]),w=Z=>{const $=Z.target.files?.[0];if($){if($.size>S){i({title:o("File size exceeds the limit of %{size}MB",{size:Yl.toString()})});return}c.value=URL.createObjectURL($),g.value=!0}};ze(c,async Z=>{Z&&(await St(),p.value&&p.value.destroy(),f.value&&(p.value=new ra(f.value,{aspectRatio:1,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1,ready(){h.value=!0}}),d(p)))});const C=()=>p.value.getCroppedCanvas({width:256,height:256,imageSmoothingQuality:"high"}),A=async Z=>await new Promise(P=>{Z.toBlob($=>P($),"image/png")}),I=()=>{b.value?.click()},N=()=>{g.value=!1,V()},_=async()=>{const Z=C(),P=await A(Z),$=URL.createObjectURL(P),L=new File([P],"avatar.png",{type:"image/png",lastModified:Date.now()});try{await u.photos.updateOwnUserPhotoPatch(L),n.addAvatar(a(s).id,$),l({title:o("Profile picture was set successfully")})}catch(M){i({title:o("Failed to set profile picture"),errors:[M]})}g.value=!1,V()},F=async()=>{try{await u.photos.deleteOwnUserPhoto(),n.removeAvatar(a(s).id),l({title:o("Profile picture was removed successfully")})}catch(Z){i({title:o("Failed to remove profile picture"),errors:[Z]})}m.value=!1},V=()=>{p.value?.destroy(),p.value=null,b.value&&(b.value.value=""),c.value=null};return(Z,P)=>{const $=te("oc-button"),L=te("oc-icon"),M=te("oc-modal");return D(),K("div",rI,[W("input",{ref_key:"fileInputRef",ref:b,class:"invisible avatar-file-input",type:"file",accept:"image/jpeg, image/png",onChange:w},null,544),W("div",sI,[Q(na,{class:"mb-4",width:128,"user-id":a(s).id,"user-name":a(s).displayName},null,8,["user-id","user-name"]),W("div",null,[W("div",oI,[Q($,{size:"small",onClick:I},{default:X(()=>[it(R.toDisplayString(a(o)("Upload")),1)]),_:1}),k.value?(D(),ee($,{key:0,class:"avatar-upload-remove-button",size:"small",onClick:P[0]||(P[0]=j=>m.value=!0)},{default:X(()=>[it(R.toDisplayString(a(o)("Remove")),1)]),_:1})):ie("",!0)])])]),g.value?(D(),ee(M,{key:0,title:a(o)("Crop your new profile picture"),"button-cancel-text":a(o)("Cancel"),"button-confirm-text":a(o)("Set"),"button-confirm-disabled":!h.value,"focus-trap-initial":!1,onCancel:N,onConfirm:_},{content:X(()=>[c.value?(D(),K("div",iI,[W("img",{ref_key:"imageRef",ref:f,class:"max-h-[400px]",src:c.value},null,8,aI),W("div",lI,[Q(L,{class:"mr-1",name:"information",size:"small","fill-type":"line"}),W("span",{textContent:R.toDisplayString(a(o)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:a(o)("+-"),panKeys:a(o)("↑↓←→")}))},null,8,cI)])])):ie("",!0)]),_:1},8,["title","button-cancel-text","button-confirm-text","button-confirm-disabled"])):ie("",!0),m.value?(D(),ee(M,{key:1,message:a(o)("Are you sure you want to remove your profile picture?"),title:a(o)("Remove profile picture"),"button-cancel-text":a(o)("Cancel"),"button-confirm-text":a(o)("Remove"),onCancel:P[1]||(P[1]=j=>m.value=!1),onConfirm:F},null,8,["message","title","button-cancel-text","button-confirm-text"])):ie("",!0)])}}}),dI={class:"resource-table-select-all flex justify-center items-center"},fI={class:"truncate"},pI=["textContent"],hI=["textContent"],mI=["textContent"],gI={key:0,class:"flex items-center justify-end flex-row flex-nowrap"},yI=850,vI=ge({__name:"ResourceTable",props:{resources:{},resourceDomSelector:{type:Function,default:e=>z.extractDomSelector(e.id)},arePathsDisplayed:{type:Boolean,default:!1},selectedIds:{default:()=>[]},hasActions:{type:Boolean,default:!0},showRenameQuickAction:{type:Boolean,default:!0},areResourcesClickable:{type:Boolean,default:!0},headerPosition:{default:0},isSelectable:{type:Boolean,default:!0},dragDrop:{type:Boolean,default:!1},viewMode:{default:()=>Et.defaultModeName},hover:{type:Boolean,default:!0},sortBy:{default:()=>{}},fieldsDisplayed:{default:()=>{}},sortDir:{default:()=>{}},space:{default:()=>{}},resourceType:{default:"file"},lazy:{type:Boolean,default:!0}},emits:["fileClick","sort","fileDropped","update:selectedIds","update:modelValue"],setup(e,{emit:t}){const n=t,r=Ae(),s=Ct(),{getMatchingSpace:o}=Rt(),{interceptModifierClick:i}=Vr(),{getParentFolderLink:l,getParentFolderLinkIconAdditionalAttributes:u,getParentFolderName:d,getPathPrefix:c}=Tr({space:H(e.space)}),{isSticky:f}=ac(),{$gettext:p,$ngettext:h,current:g}=de.useGettext(),{isLocationPicker:m,isFilePicker:b}=wr(),{selectedResources:S,disabledResources:k,isResourceSelected:w,fileContainerClicked:C,fileNameClicked:A,fileCheckboxClicked:I,isResourceDisabled:N,isResourceInDeleteQueue:_,isResourceClickable:F,isResourceCut:V,getResourceLink:Z,dragItem:P,dragSelection:$,dragStart:L,fileDropped:M,setDropStyling:j,shouldShowContextDrop:B,showContextMenuOnRightClick:q,showContextMenuOnBtnClick:re,selectAllCheckboxLabel:J,getResourceCheckboxLabel:oe,toggleSelectionAll:ne,areAllResourcesSelected:pe}=uc({space:T(()=>e.space),resources:T(()=>e.resources),selectedIds:T(()=>e.selectedIds),emit:n}),fe=Pt(),{isSideBarOpen:we}=ve.storeToRefs(fe),$e=yr(),{userContextReady:he}=ve.storeToRefs($e),ae=Re(),{areFileExtensionsShown:ue,latestSelectedId:be}=ve.storeToRefs(ae),{width:me}=Cn.useWindowSize(),De=T(()=>s.filesTags&&me.value>=yI),{actions:_e}=Xi(),{actions:ut}=Em(),Kt=T(()=>a(_e)[0].handler),vt=T(()=>a(ut)[0].handler),Dt=H({}),Ve=y=>p("Search for tag %{tag}",{tag:y}),ye=T(()=>{if(e.resources.length===0)return[];const y=e.resources[0],v=[];e.isSelectable&&v.push({name:"select",title:"",type:"slot",headerType:"slot",width:"shrink"});const O=rf(y);return v.push(...[{name:"name",title:p("Name"),type:"slot",width:"expand",wrap:"truncate"},{name:"manager",prop:"members",title:p("Manager"),type:"slot"},{name:"members",title:p("Members"),prop:"members",type:"slot"},{name:"totalQuota",prop:"spaceQuota.total",title:p("Total quota"),type:"slot",sortable:!0},{name:"usedQuota",prop:"spaceQuota.used",title:p("Used quota"),type:"slot",sortable:!0},{name:"remainingQuota",prop:"spaceQuota.remaining",title:p("Remaining quota"),type:"slot",sortable:!0},{name:"indicators",title:p("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"size",title:p("Size"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"syncEnabled",title:p("Info"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"tags",title:p("Tags"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedBy",title:p("Shared by"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedWith",title:p("Shared with"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"mdate",title:p("Modified"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:U=>ln(U.mdate)+" ("+bt(U.mdate)+")"},{name:"sdate",title:p("Shared on"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:U=>ln(U.sdate)+" ("+bt(U.sdate)+")"},{name:"ddate",title:p("Deleted"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:U=>ln(U.ddate)+" ("+bt(U.ddate)+")"}].filter(U=>{if(U.name==="tags"&&!a(De))return!1;if(U.name==="indicators")return!0;let Y;return U.prop?Y=Sl(y,U.prop)!==void 0:Y=Object.prototype.hasOwnProperty.call(y,U.name),e.fieldsDisplayed?Y&&e.fieldsDisplayed.includes(U.name):Y}).map(U=>{const Y=O.find(se=>se.name===U.name);return Y&&Object.assign(U,{sortable:Y.sortable,sortDir:Y.sortDir}),U})),e.hasActions&&v.push({name:"actions",title:p("Actions"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"}),v}),Fe=y=>{const v=a(r.currentRoute).query?.term;return cs("files-common-search",{query:{provider:"files.sdk",q_tags:y,...v&&{term:v}}})},gt=y=>a(he)?{to:Fe(y)}:{},Qr=y=>y.id===a(be),xr=y=>e.showRenameQuickAction?z.isProjectSpaceResource(y)?a(ut).filter(v=>v.isVisible({resources:[y]})).length:a(_e).filter(v=>v.isVisible({space:e.space,resources:[y]})).length:!1,kn=y=>{if(z.isProjectSpaceResource(y))return a(vt)({resources:[y]});a(Kt)({space:o(y),resources:[y]})},bt=y=>fp(new Date(y),g),ln=y=>hp(new Date(y),g),vo=y=>{if(!z.isShareResource(y))return;const v=y.type==="folder"?p("folder"):p("file"),O=y.sharedWith.filter(({shareType:U})=>z.ShareTypes.authenticated.includes(z.ShareTypes.getByValue(U))).length;return O?h("This %{ resourceType } is shared via %{ shareCount } invite","This %{ resourceType } is shared via %{ shareCount } invites",O,{resourceType:v,shareCount:O.toString()}):""},cn=y=>{if(!z.isShareResource(y))return"";const v=y.type==="folder"?p("folder"):p("file");return p("This %{ resourceType } is shared by %{ user }",{resourceType:v,user:y.sharedBy.map(({displayName:O})=>O).join(", ")})},bo=y=>z.isShareResource(y)?y.sharedBy.map(v=>({displayName:v.displayName,name:v.displayName,avatarType:z.ShareTypes.user.key,username:v.id,userId:v.id})):[],E=y=>z.isShareResource(y)?y.sharedWith.filter(({shareType:v})=>z.ShareTypes.authenticated.includes(z.ShareTypes.getByValue(v))).map(v=>({displayName:v.displayName,name:v.displayName,avatarType:z.ShareTypes.getByValue(v.shareType).key,username:v.id,userId:v.id})):[];return(y,v)=>{const O=te("oc-checkbox"),U=te("oc-icon"),Y=te("oc-tag"),se=te("oc-avatars"),Ie=Bt("oc-tooltip");return D(),K(ke,null,[Q(a(iR),at(y.$attrs,{id:"files-space-table",class:[{condensed:e.viewMode===a(Et).name.condensedTable,"files-table":e.resourceType==="file","files-table-squashed":e.resourceType==="file"&&a(we),"spaces-table":e.resourceType==="space","spaces-table-squashed":e.resourceType==="space"&&a(we)}],data:e.resources,fields:ye.value,highlighted:e.selectedIds,disabled:a(k),sticky:a(f),"header-position":e.headerPosition,"drag-drop":e.dragDrop,hover:e.hover,"item-dom-selector":e.resourceDomSelector,selection:a(S),"sort-by":e.sortBy,"sort-dir":e.sortDir,lazy:e.lazy,"padding-x":"medium",onHighlight:v[1]||(v[1]=le=>a(C)({resource:le[0],event:le[1]})),onContextmenuClicked:v[2]||(v[2]=(le,xe,qe)=>a(q)(xe,qe,Dt.value[qe.id])),onItemDropped:v[3]||(v[3]=le=>a(M)(le[0],le[1])),onItemDragged:v[4]||(v[4]=le=>a(L)(le[0],le[1])),onDropRowStyling:a(j),onSort:v[5]||(v[5]=le=>y.$emit("sort",le)),"onUpdate:modelValue":v[6]||(v[6]=le=>y.$emit("update:modelValue",le))}),Su({name:X(({item:le})=>[W("div",{class:R.normalizeClass(["resource-table-resource-wrapper flex items-center",[{"resource-table-resource-wrapper-limit-max-width":xr(le)}]])},[Se(y.$slots,"image",{resource:le}),(D(),ee(ho,{key:`${le.path}-${e.resourceDomSelector(le)}-${le.thumbnail}`,resource:le,"path-prefix":a(c)(le),"is-path-displayed":e.arePathsDisplayed,"parent-folder-name":a(d)(le),"is-icon-displayed":!y.$slots.image,"is-extension-displayed":a(ue),"is-resource-clickable":a(F)(le,e.areResourcesClickable),link:a(Z)(le),"parent-folder-link":a(l)(le),"parent-folder-link-icon-additional-attributes":a(u)(le),class:R.normalizeClass({"opacity-60":a(V)(le)}),onClick:kt(xe=>a(A)({resource:le,event:xe}),["stop"])},null,8,["resource","path-prefix","is-path-displayed","parent-folder-name","is-icon-displayed","is-extension-displayed","is-resource-clickable","link","parent-folder-link","parent-folder-link-icon-additional-attributes","class","onClick"])),xr(le)?(D(),ee(a(Ut),{key:0,class:"resource-table-edit-name inline-flex raw-hover-surface p-1 ml-1",appearance:"raw","aria-label":a(p)("Rename file »%{name}«",{name:le.name}),title:a(p)("Rename"),onClick:kt(xe=>{a(i)(xe,le)||kn(le)},["stop"])},{default:X(()=>[Q(U,{name:"edit-2","fill-type":"line",size:"small",color:"var(--oc-role-on-surface)"})]),_:1},8,["aria-label","title","onClick"])):ie("",!0)],2),Se(y.$slots,"additionalResourceContent",{resource:le})]),syncEnabled:X(({item:le})=>[Se(y.$slots,"syncEnabled",{resource:le})]),size:X(({item:le})=>[Q(ig,{size:le.size||Number.NaN},null,8,["size"])]),tags:X(({item:le})=>[(D(!0),K(ke,null,Ge(le.tags.slice(0,2),xe=>(D(),ee(Yt(a(he)?"router-link":"span"),at({key:xe},{ref_for:!0},gt(xe),{class:"resource-table-tag-wrapper"}),{default:X(()=>[je((D(),ee(Y,{class:"resource-table-tag ml-1 max-w-20",rounded:!0,size:"small"},{default:X(()=>[Q(U,{name:"price-tag-3",size:"small"}),W("span",fI,R.toDisplayString(xe),1)]),_:2},1024)),[[Ie,Ve(xe)]])]),_:2},1040))),128)),le.tags.length>2?(D(),ee(Y,{key:0,size:"small",class:"resource-table-tag-more align-text-bottom cursor-pointer",onClick:v[0]||(v[0]=xe=>a(fe).openSideBar())},{default:X(()=>[it(" + "+R.toDisplayString(le.tags.length-2),1)]),_:2},1024)):ie("",!0)]),manager:X(({item:le})=>[Se(y.$slots,"manager",{resource:le})]),members:X(({item:le})=>[Se(y.$slots,"members",{resource:le})]),totalQuota:X(({item:le})=>[Se(y.$slots,"totalQuota",{resource:le})]),usedQuota:X(({item:le})=>[Se(y.$slots,"usedQuota",{resource:le})]),remainingQuota:X(({item:le})=>[Se(y.$slots,"remainingQuota",{resource:le})]),mdate:X(({item:le})=>[je(W("span",{tabindex:"0",textContent:R.toDisplayString(ln(le.mdate))},null,8,pI),[[Ie,bt(le.mdate)]])]),indicators:X(({item:le})=>[Q(ag,{space:e.space,resource:le,"disable-handler":a(N)(le)},null,8,["space","resource","disable-handler"])]),sdate:X(({item:le})=>[je(W("span",{tabindex:"0",textContent:R.toDisplayString(ln(le.sdate))},null,8,hI),[[Ie,bt(le.sdate)]])]),ddate:X(({item:le})=>[je(W("p",{tabindex:"0",class:"m-0",textContent:R.toDisplayString(ln(le.ddate))},null,8,mI),[[Ie,bt(le.ddate)]])]),sharedBy:X(({item:le})=>[Q(se,{class:"flex items-center justify-end flex-row flex-nowrap","is-tooltip-displayed":!0,items:bo(le),"accessible-description":cn(le),"hover-effect":""},{userAvatars:X(({avatars:xe,width:qe})=>[(D(!0),K(ke,null,Ge(xe,Be=>(D(),ee(a(na),{key:Be.userId,"user-id":Be.userId,"user-name":Be.displayName,width:qe},null,8,["user-id","user-name","width"]))),128))]),_:1},8,["items","accessible-description"])]),sharedWith:X(({item:le})=>[Q(se,{class:"flex items-center justify-end flex-row flex-nowrap","data-testid":"resource-table-shared-with",items:E(le),stacked:!0,"max-displayed":3,"is-tooltip-displayed":!0,"accessible-description":vo(le),"hover-effect":""},{userAvatars:X(({avatars:xe,width:qe})=>[(D(!0),K(ke,null,Ge(xe,Be=>(D(),ee(a(na),{key:Be.userId,"user-id":Be.userId,"user-name":Be.displayName,width:qe},null,8,["user-id","user-name","width"]))),128))]),_:1},8,["items","accessible-description"])]),actions:X(({item:le})=>[a(B)(le)?(D(),K("div",gI,[Se(y.$slots,"quickActions",{resource:le}),Q(yc,{ref:xe=>Dt.value[le.id]=xe?.drop,title:le.name,item:le,"resource-dom-selector":e.resourceDomSelector,class:"resource-table-btn-action-dropdown",onQuickActionClicked:xe=>a(re)(xe,le,Dt.value[le.id])},{contextMenu:X(()=>[Se(y.$slots,"contextMenu",{resource:le})]),_:2},1032,["title","item","resource-dom-selector","onQuickActionClicked"])])):ie("",!0)]),_:2},[!a(m)&&!a(b)?{name:"selectHeader",fn:X(()=>[W("div",dI,[je(Q(O,{id:"resource-table-select-all",size:"large",label:a(J),disabled:e.resources.length===a(k).length,"label-hidden":!0,"model-value":a(pe),onClick:kt(a(ne),["stop"])},null,8,["label","disabled","model-value","onClick"]),[[Ie,a(J)]])])]),key:"0"}:void 0,!a(m)&&!a(b)?{name:"select",fn:X(({item:le})=>[a(_)(le.id)?(D(),ee(a(qA),{key:0,class:"inline-flex ml-1",size:"medium","aria-label":a(p)("File is being processed")},null,8,["aria-label"])):(D(),ee(O,{key:1,id:`resource-table-select-${e.resourceDomSelector(le)}`,label:a(oe)(le),"label-hidden":!0,size:"large",disabled:a(N)(le),"model-value":a(w)(le),outline:Qr(le),"data-test-selection-resource-name":le.name,"data-test-selection-resource-path":le.path,onClick:kt(xe=>a(I)({resource:le,event:xe}),["stop"])},null,8,["id","label","disabled","model-value","outline","data-test-selection-resource-name","data-test-selection-resource-path","onClick"]))]),key:"1"}:void 0,y.$slots.footer?{name:"footer",fn:X(()=>[Se(y.$slots,"footer")]),key:"2"}:void 0]),1040,["class","data","fields","highlighted","disabled","sticky","header-position","drag-drop","hover","item-dom-selector","selection","sort-by","sort-dir","lazy","onDropRowStyling"]),a(P)?(D(),ee(Ps,{key:0,to:"body"},[Q(vc,{ref:"ghostElement","preview-items":[a(P),...a($)]},null,8,["preview-items"])])):ie("",!0)],64)}}}),bI={key:0,class:"oc-tile-card-lazy-shimmer h-30 overflow-hidden relative after:absolute after:inset-0 after:transform-[translateX(-100%)] opacity-20 after:animate-shimmer"},wI={class:"z-10 absolute top-0 left-0 [&_input]:not-[.oc-checkbox-checked]:bg-role-surface-container"},SI={key:0,class:"oc-tile-card-loading-spinner z-990 m-2"},kI=["textContent"],CI=["aria-label"],TI={class:"flex justify-between items-center"},xI={class:"flex items-center truncate resource-name-wrapper text-role-on-surface overflow-hidden"},AI={class:"flex items-center"},RI={key:0,class:"text-left my-0 truncate"},EI=["textContent"],lg=ge({__name:"ResourceTile",props:{resource:{},resourceRoute:{},space:{},isResourceSelected:{type:Boolean,default:!1},isResourceClickable:{type:Boolean,default:!0},isResourceDisabled:{type:Boolean,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},isPathDisplayed:{type:Boolean,default:!1},resourceIconSize:{default:"xlarge"},lazy:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1}},emits:["fileNameClicked","contextmenu","itemVisible","tileClicked"],setup(e,{emit:t}){const n=t,{$gettext:r}=de.useGettext(),{getParentFolderName:s,getParentFolderLink:o}=Tr({space:H(e.space)}),i=qt("observerTarget"),l=T(()=>a(i)?.$el),u=T(()=>e.resource.locked||e.resource.processing),d=T(()=>e.resource.locked?{name:"lock",fillType:"fill"}:e.resource.processing?{name:"loop-right",fillType:"line"}:{}),c=T(()=>e.resource.locked?r("This item is locked"):null),f=T(()=>z.isSpaceResource(e.resource)?e.resource.description:""),{isVisible:p}=e.lazy?Xp({target:l,onVisibleCallback:()=>n("itemVisible")}):{isVisible:H(!0)},h=T(()=>!a(p));return e.lazy||n("itemVisible"),(g,m)=>{const b=te("oc-spinner"),S=te("oc-tag"),k=te("oc-image"),w=te("oc-icon"),C=Bt("oc-tooltip");return D(),ee(a(Jl),{ref_key:"observerTarget",ref:i,"body-class":"p-0",class:R.normalizeClass(["oc-tile-card flex flex-col h-full shadow-none [&.item-accentuated]:bg-role-secondary-container",{"oc-tile-card-selected bg-role-secondary-container outline-2 outline-role-outline":e.isResourceSelected,"bg-role-surface-container hover:bg-role-surface-container-highest outline outline-role-surface-container-highest":!e.isResourceSelected,"oc-tile-card-disabled opacity-70 grayscale-60 pointer-events-none":e.isResourceDisabled&&!a(z.isProjectSpaceResource)(e.resource),"state-trashed [&_.tile-preview]:opacity-80 [&_.tile-default-image_svg]:opacity-80 [&_.tile-preview]:grayscale [&_.tile-default-image_svg]:grayscale":e.isResourceDisabled&&a(z.isProjectSpaceResource)(e.resource)}]),"data-item-id":e.resource.id,onContextmenu:m[4]||(m[4]=A=>g.$emit("contextmenu",A))},{default:X(()=>[h.value?(D(),K("div",bI)):(D(),K(ke,{key:1},[Q(Wi,{class:"oc-card-media-top flex justify-center items-center m-0 w-full relative aspect-[16/9]",resource:e.resource,link:e.resourceRoute,"is-resource-clickable":e.isResourceClickable,tabindex:"-1",onClick:m[1]||(m[1]=A=>g.$emit("fileNameClicked",A))},{default:X(()=>[W("div",wI,[e.isLoading?(D(),K("div",SI,[Q(b,{"aria-label":a(r)("File is being processed")},null,8,["aria-label"])])):Se(g.$slots,"selection",{key:1,item:e.resource})]),e.isResourceDisabled&&a(z.isProjectSpaceResource)(e.resource)?(D(),ee(S,{key:0,class:"z-10 absolute text-role-on-surface",type:"span"},{default:X(()=>[W("span",{textContent:R.toDisplayString(a(r)("Disabled"))},null,8,kI)]),_:1})):ie("",!0),je((D(),K("div",{class:R.normalizeClass(["oc-tile-card-preview flex items-center justify-center text-center size-full absolute",{"p-2":e.isResourceSelected,"hover:p-2":!e.isResourceSelected}]),"aria-label":c.value},[Se(g.$slots,"imageField",{item:e.resource},()=>[e.resource.thumbnail?(D(),ee(k,{key:0,class:R.normalizeClass(["tile-preview rounded-t-sm size-full object-cover aspect-[16/9] pointer-events-none",{"rounded-sm":e.isResourceSelected}]),src:e.resource.thumbnail,"data-test-thumbnail-resource-name":e.resource.name,onClick:m[0]||(m[0]=kt(A=>g.$emit("tileClicked",[e.resource,A]),["stop"]))},null,8,["class","src","data-test-thumbnail-resource-name"])):(D(),ee(po,{key:1,resource:e.resource,size:e.resourceIconSize,class:"tile-default-image pt-1 relative"},Su({_:2},[u.value?{name:"status",fn:X(()=>[Q(w,at(d.value,{size:"xsmall"}),null,16)]),key:"0"}:void 0]),1032,["resource","size"]))])],10,CI)),[[C,c.value]])]),_:3},8,["resource","link","is-resource-clickable"]),W("div",{class:"p-2",onClick:m[3]||(m[3]=kt(A=>g.$emit("tileClicked",[e.resource,A]),["stop"]))},[W("div",TI,[W("div",xI,[Q(ho,{resource:e.resource,"is-icon-displayed":!1,"is-extension-displayed":e.isExtensionDisplayed,"is-resource-clickable":e.isResourceClickable,"is-path-displayed":e.isPathDisplayed,"parent-folder-name":a(s)(e.resource),"parent-folder-link":a(o)(e.resource),link:e.resourceRoute,onClick:m[2]||(m[2]=kt(A=>g.$emit("fileNameClicked",A),["stop"]))},null,8,["resource","is-extension-displayed","is-resource-clickable","is-path-displayed","parent-folder-name","parent-folder-link","link"])]),W("div",AI,[Se(g.$slots,"indicators",{item:e.resource,class:"resource-indicators"}),Se(g.$slots,"actions",{item:e.resource}),Se(g.$slots,"contextMenu",{item:e.resource})])]),f.value?(D(),K("p",RI,[W("span",{class:"text-sm",textContent:R.toDisplayString(f.value)},null,8,EI)])):ie("",!0),Se(g.$slots,"additionalResourceContent",{item:e.resource})])],64))]),_:3},8,["data-item-id","class"])}}}),DI={id:"tiles-view",class:"px-4 pt-2"},FI={class:"flex items-center mb-2 pb-2 oc-tiles-controls"},II={key:1,class:"oc-tiles-sort"},PI={key:0,class:"flex"},$I={class:"p-1 text-sm"},OI=Le(ge({__name:"ResourceTiles",props:{resources:{default:()=>[]},selectedIds:{default:()=>[]},isSelectable:{type:Boolean,default:!0},space:{},sortFields:{default:()=>[]},sortBy:{},sortDir:{},viewSize:{default:()=>Et.tilesSizeDefault},dragDrop:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0},areResourcesClickable:{type:Boolean,default:!0},arePathsDisplayed:{type:Boolean,default:!1}},emits:["fileClick","fileDropped","sort","itemVisible","update:selectedIds"],setup(e,{emit:t}){const n=t,{$gettext:r}=de.useGettext(),s=Re(),{areFileExtensionsShown:o}=ve.storeToRefs(s),{isLocationPicker:i,isFilePicker:l}=wr(),u=lc(),d=T(()=>Math.min(a(u),e.viewSize)),c=Pt(),{isSideBarOpen:f}=ve.storeToRefs(c),{disabledResources:p,isResourceSelected:h,fileContainerClicked:g,fileNameClicked:m,fileCheckboxClicked:b,isResourceDisabled:S,isResourceInDeleteQueue:k,isResourceClickable:w,isResourceCut:C,getResourceLink:A,dragItem:I,dragSelection:N,dragStart:_,fileDropped:F,setDropStyling:V,shouldShowContextDrop:Z,showContextMenuOnRightClick:P,showContextMenuOnBtnClick:$,selectAllCheckboxLabel:L,getResourceCheckboxLabel:M,toggleSelectionAll:j,areAllResourcesSelected:B}=uc({space:T(()=>e.space),resources:T(()=>e.resources),selectedIds:T(()=>e.selectedIds),emit:n}),q=H({}),re=window.__E2E__===!0?!1:e.lazy,J=T(()=>e.sortFields.find(me=>me.name===e.sortBy&&me.sortDir===e.sortDir)||e.sortFields[0]),oe=me=>{n("sort",{sortBy:me.name,sortDir:a(me.sortDir)})},ne=T(()=>{const me={1:"xlarge",2:"xlarge",3:"xxlarge",4:"xxlarge",5:"xxxlarge",6:"xxxlarge"},De=a(d);return me[De]??"xxlarge"}),pe=H(0),fe=()=>{const me=document.getElementById("tiles-view"),De=getComputedStyle(me),_e=parseInt(De.getPropertyValue("padding-left"),10)|0,ut=parseInt(De.getPropertyValue("padding-right"),10)|0;pe.value=me.clientWidth-_e-ut},we=T(()=>parseFloat(getComputedStyle(document.documentElement).fontSize)),{calculateTileSizePixels:$e}=Bm(),he=T(()=>{const me=[...Array(Et.tilesSizeMax).keys()].map(De=>De+1);return[...new Set(me.map(De=>{const _e=$e(De);return _e?Math.round(a(pe)/(_e+a(we))):0}))]}),ae=T(()=>{const me=a(he);return me.length<a(d)?me[me.length-1]:me[a(d)-1]}),ue=T(()=>{const me=a(ae)?e.resources.length%a(ae):0;return me?a(ae)-me:0}),be=T(()=>a(pe)/a(ae)-a(we));return ze(be,me=>{me&&!isNaN(me)&&document.documentElement.style.setProperty("--oc-size-tiles-actual",`${me}px`)},{immediate:!0}),ze(he,me=>{u.value=Math.max(me.length,1)}),ze(f,()=>{fe()}),ft(()=>{window.addEventListener("resize",fe),fe()}),Xt(()=>{window.removeEventListener("resize",fe)}),(me,De)=>{const _e=te("oc-checkbox"),ut=te("oc-icon"),Kt=te("oc-button"),vt=te("oc-list"),Dt=te("oc-filter-chip"),Ve=Bt("oc-tooltip");return D(),K("div",DI,[W("div",FI,[e.isSelectable&&!a(l)?je((D(),ee(_e,{key:0,id:"tiles-view-select-all",class:"ml-2",size:"large",label:a(L),"label-hidden":!0,disabled:e.resources.length===a(p).length,"model-value":a(B),onClick:kt(a(j),["stop"])},null,8,["label","disabled","model-value","onClick"])),[[Ve,a(L)]]):ie("",!0),e.sortFields.length?(D(),K("div",II,[Q(Dt,{class:"[&_.oc-filter-chip-label]:text-sm","filter-label":a(r)("Sort by"),"selected-item-names":[J.value.label],"has-active-state":!1,"close-on-click":"",raw:""},{default:X(()=>[Q(vt,null,{default:X(()=>[(D(!0),K(ke,null,Ge(e.sortFields,(ye,Fe)=>(D(),K("li",{key:Fe},[Q(Kt,{appearance:J.value===ye?"filled":"raw-inverse","color-role":J.value===ye?"secondaryContainer":"surface","no-hover":J.value===ye,"justify-content":"space-between",class:"oc-tiles-sort-filter-chip-item",onClick:gt=>oe(ye)},{default:X(()=>[W("span",null,R.toDisplayString(ye.label),1),ye===J.value?(D(),K("div",PI,[Q(ut,{name:"check"})])):ie("",!0)]),_:2},1032,["appearance","color-role","no-hover","onClick"])]))),128))]),_:1})]),_:1},8,["filter-label","selected-item-names"])])):ie("",!0)]),Q(vt,{class:"oc-tiles grid justify-start gap-3"},{default:X(()=>[(D(!0),K(ke,null,Ge(e.resources,ye=>(D(),K("li",{key:ye.id,class:"oc-tiles-item has-item-context-menu"},[Q(lg,{resource:ye,space:e.space,"resource-route":a(A)(ye),"is-resource-selected":a(h)(ye),"is-resource-clickable":a(w)(ye,e.areResourcesClickable),"is-resource-disabled":a(S)(ye),"is-extension-displayed":a(o),"is-path-displayed":e.arePathsDisplayed,"resource-icon-size":ne.value,draggable:e.dragDrop,lazy:a(re),"is-loading":a(k)(ye.id),class:R.normalizeClass({"opacity-60":a(C)(ye)}),onContextmenu:Fe=>a(P)(Fe,ye,q.value[ye.id]),onFileNameClicked:kt(Fe=>a(m)({resource:ye,event:Fe}),["stop"]),onDragstart:Fe=>a(_)(ye,Fe),onDragenter:kt(Fe=>a(V)(ye,!1,Fe),["prevent"]),onDragleave:kt(Fe=>a(V)(ye,!0,Fe),["prevent"]),onDrop:Fe=>a(F)(ye,Fe),onDragover:De[0]||(De[0]=Fe=>Fe.preventDefault()),onItemVisible:Fe=>me.$emit("itemVisible",ye),onTileClicked:Fe=>a(g)({resource:ye,event:Fe[1]})},{selection:X(()=>[e.isSelectable&&!a(i)&&!a(l)?(D(),ee(_e,{key:0,label:a(M)(ye),"label-hidden":!0,size:"large",class:"inline-flex p-2.5",disabled:a(S)(ye),"model-value":a(h)(ye),"data-test-selection-resource-name":ye.name,"data-test-selection-resource-path":ye.path,onClick:kt(Fe=>a(b)({resource:ye,event:Fe}),["stop","prevent"])},null,8,["label","disabled","model-value","data-test-selection-resource-name","data-test-selection-resource-path","onClick"])):ie("",!0)]),imageField:X(()=>[Se(me.$slots,"image",{resource:ye},void 0,!0)]),indicators:X(()=>[Q(ag,{space:e.space,class:"ml-2",resource:ye,filter:Fe=>["system","sharing"].includes(Fe.category),"disable-handler":a(S)(ye)},null,8,["space","resource","filter","disable-handler"])]),actions:X(()=>[Se(me.$slots,"actions",{resource:ye},void 0,!0)]),contextMenu:X(()=>[a(Z)(ye)?(D(),ee(a(yc),{key:0,ref_for:!0,ref:Fe=>q.value[ye.id]=Fe?.drop,item:ye,title:ye.name,class:"resource-tiles-btn-action-dropdown",onQuickActionClicked:Fe=>a($)(Fe,ye,q.value[ye.id])},{contextMenu:X(()=>[Se(me.$slots,"contextMenu",{resource:ye},void 0,!0)]),_:2},1032,["item","title","onQuickActionClicked"])):ie("",!0)]),additionalResourceContent:X(()=>[Se(me.$slots,"additionalResourceContent",{resource:ye},void 0,!0)]),_:2},1032,["resource","space","resource-route","is-resource-selected","is-resource-clickable","is-resource-disabled","is-extension-displayed","is-path-displayed","resource-icon-size","draggable","lazy","is-loading","class","onContextmenu","onFileNameClicked","onDragstart","onDragenter","onDragleave","onDrop","onItemVisible","onTileClicked"])]))),128)),(D(!0),K(ke,null,Ge(ue.value,ye=>(D(),K("li",{key:`ghost-tile-${ye}`,class:"list-item","aria-hidden":!0}))),128))]),_:3}),a(I)?(D(),ee(Ps,{key:0,to:"body"},[Q(vc,{ref:"ghostElement","preview-items":[a(I),...a(N)]},null,8,["preview-items"])])):ie("",!0),W("div",$I,[Se(me.$slots,"footer",{},void 0,!0)])])}}}),[["__scopeId","data-v-8798a647"]]),LI=ge({name:"DateFilter",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0},items:{type:Array,required:!0},idAttribute:{type:String,required:!1,default:"id"},displayNameAttribute:{type:String,required:!1,default:"name"}},emits:["selectionChange"],setup:function(e,{emit:t,expose:n}){const r=Ae(),{current:s}=de.useGettext(),o=yt(),i=On(),{currentTheme:l}=ve.storeToRefs(i),u=H(),d=H(e.items),c=H(),f=H(),p=H(!1),h=H(),g=`q_${e.filterName}`,m=At(g),b=L=>L[e.idAttribute],S=()=>r.push({query:{...ps(a(o).query,[g]),...a(u)&&{[g]:b(a(u))}}}),k=L=>a(u)&&b(a(u))===b(L),w=()=>{c.value=void 0,f.value=void 0},C=async L=>{w(),k(L)?u.value=void 0:(u.value=L,a(h).hideDrop()),await S(),t("selectionChange",a(u))},A=()=>{u.value=void 0,p.value=!1,w(),t("selectionChange",a(u)),S()},I=()=>{d.value=e.items},N=()=>{p.value=!1},_=()=>{const L=ot(a(m));if(!L)return;const M=e.items.find(j=>b(j)===L);if(M){u.value=M;return}if(a(F)){const j=L.replace("range:",""),B=Number(j.split(" - ")[0]),q=Number(j.split(" - ")[1]);c.value=ht.DateTime.fromMillis(B),f.value=ht.DateTime.fromMillis(q),u.value=a(Z)}},F=T(()=>ot(a(m))?.startsWith("range:")),V=T(()=>!a(c)||!a(f)?!1:a(c)<=a(f)),Z=T(()=>{if(!a(c)||!a(f))return null;const L=Nr(a(c),s,ht.DateTime.DATE_SHORT),M=Nr(a(f),s,ht.DateTime.DATE_SHORT),j=a(c).toMillis(),B=a(f).toMillis();return{[e.idAttribute]:`range:${j} - ${B}`,[e.displayNameAttribute]:`${L} - ${M}`}}),P=async()=>{u.value=a(Z),await S(),a(h).hideDrop(),t("selectionChange",a(u))},$=({date:L,error:M},j)=>{if(M){console.error("date could not be set");return}const B=j==="from"?c:f;if(!L){B.value=void 0;return}const q=j==="from"?L.startOf("day"):L.endOf("day");B.value=q};return n({setSelectedItemsBasedOnQuery:_}),ft(()=>{_()}),{clearFilter:A,displayedItems:d,isItemSelected:k,selectedItem:u,onShowDrop:I,onHideDrop:N,filterChip:h,toggleItemSelection:C,setSelectedItemsBasedOnQuery:_,fromDate:c,toDate:f,dateRangeValid:V,applyDateRangeFilter:P,dateRangeApplied:F,setDateRangeDate:$,dateRangeClicked:p,currentTheme:l,queryParam:g}}}),_I={class:"flex items-center truncate"},MI={class:"truncate ml-2"},NI={class:"flex"},BI={class:"my-1"},jI={class:"flex items-center truncate"},zI={class:"truncate ml-2"},VI=["textContent"],UI={class:"flex"},qI={class:"flex items-center justify-between mb-4"},HI=["textContent"],WI={class:"mt-2"},QI={class:"date-filter-apply-btn text-end"};function KI(e,t,n,r,s,o){const i=te("oc-icon"),l=te("oc-button"),u=te("oc-list"),d=te("oc-datepicker"),c=te("oc-filter-chip");return D(),K("div",{class:R.normalizeClass(["date-filter flex overflow-hidden [&_label]:text-sm",`date-filter-${e.filterName}`])},[Q(c,{ref:"filterChip","filter-label":e.filterLabel,"selected-item-names":e.selectedItem?[e.selectedItem[e.displayNameAttribute]]:void 0,onClearFilter:e.clearFilter,onShowDrop:e.onShowDrop,onHideDrop:e.onHideDrop},{default:X(()=>[Q(u,{class:R.normalizeClass({"invisible min-h-[225px] transition-[visibility] duration-[0.4s,0s]":e.dateRangeClicked})},{default:X(()=>[(D(!0),K(ke,null,Ge(e.displayedItems,(f,p)=>(D(),K("li",{key:p,class:"my-1 first:mt-0 last:mb-0"},[Q(l,{class:R.normalizeClass(["date-filter-list-item flex justify-between items-center w-full p-1",{"date-filter-list-item-active":e.isItemSelected(f)}]),"justify-content":"space-between",appearance:"raw","data-testid":f[e.displayNameAttribute],onClick:h=>e.toggleItemSelection(f)},{default:X(()=>[W("div",_I,[W("div",MI,[Se(e.$slots,"item",{item:f},void 0,!0)])]),W("div",NI,[e.isItemSelected(f)?(D(),ee(i,{key:0,name:"check"})):ie("",!0)])]),_:2},1032,["class","data-testid","onClick"])]))),128)),W("li",BI,[Q(l,{class:R.normalizeClass(["date-filter-list-item flex justify-between items-center w-full p-1",{"date-filter-list-item-active":e.dateRangeApplied}]),"justify-content":"space-between",appearance:"raw","data-testid":"custom-date-range",onClick:t[0]||(t[0]=f=>e.dateRangeClicked=!0)},{default:X(()=>[W("div",jI,[W("div",zI,[W("span",{textContent:R.toDisplayString(e.$gettext("Custom date range"))},null,8,VI)])]),W("div",UI,[e.dateRangeApplied?(D(),ee(i,{key:0,name:"check"})):ie("",!0)])]),_:1},8,["class"])])]),_:3},8,["class"]),W("div",{class:R.normalizeClass(["date-filter-range-panel absolute top-0 p-2 bg-role-surface",{"transform-[translateX(0)] visible":e.dateRangeClicked,"transform-[translateX(100%)] invisible":!e.dateRangeClicked}])},[W("div",qI,[Q(l,{appearance:"raw",class:"date-filter-range-panel-back","aria-label":e.$gettext("Go back to filter options"),onClick:t[1]||(t[1]=f=>e.dateRangeClicked=!1)},{default:X(()=>[Q(i,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"]),W("span",{textContent:R.toDisplayString(e.$gettext("Custom date range"))},null,8,HI),Q(l,{appearance:"raw",class:"date-filter-range-panel-close","aria-label":e.$gettext("Close filter"),onClick:t[2]||(t[2]=f=>e.filterChip.hideDrop())},{default:X(()=>[Q(i,{name:"close"})]),_:1},8,["aria-label"])]),W("div",WI,[Q(d,{label:e.$gettext("From"),"is-clearable":!0,"current-date":e.fromDate,"is-dark":e.currentTheme.isDark,onDateChanged:t[3]||(t[3]=f=>e.setDateRangeDate(f,"from"))},null,8,["label","current-date","is-dark"]),Q(d,{label:e.$gettext("To"),"is-clearable":!0,"current-date":e.toDate,"min-date":e.fromDate?e.fromDate:void 0,"is-dark":e.currentTheme.isDark,onDateChanged:t[4]||(t[4]=f=>e.setDateRangeDate(f,"to"))},null,8,["label","current-date","min-date","is-dark"])]),W("div",QI,[Q(l,{size:"small",disabled:!e.dateRangeValid,onClick:e.applyDateRangeFilter},{default:X(()=>[it(R.toDisplayString(e.$gettext("Apply")),1)]),_:1},8,["disabled","onClick"])])],2)]),_:3},8,["filter-label","selected-item-names","onClearFilter","onShowDrop","onHideDrop"])],2)}const GI=Le(LI,[["render",KI],["__scopeId","data-v-80ea8301"]]),JI=ge({name:"ItemFilterInline",props:{filterName:{type:String,required:!0},filterOptions:{type:Array,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=Ae(),r=yt(),s=H(e.filterOptions[0].name),o=`q_${e.filterName}`,i=At(o),l=d=>n.push({query:{...ps(a(r).query,[o]),[o]:d}}),u=async d=>{s.value=d.name,await l(d.name),t("toggleFilter",d)};return ft(()=>{const d=ot(a(i));d&&e.filterOptions.some(({name:c})=>c===d)&&(s.value=d,t("toggleFilter",e.filterOptions.find(({name:c})=>c===d)))}),{queryParam:o,activeOption:s,toggleFilter:u}}}),XI=["textContent"];function YI(e,t,n,r,s,o){const i=te("oc-button");return D(),K("div",null,[W("div",{class:R.normalizeClass(["item-inline-filter inline-flex outline outline-role-secondary outline-offset-[-1px] rounded-full",`item-inline-filter-${e.filterName}`])},[(D(!0),K(ke,null,Ge(e.filterOptions,(l,u)=>(D(),ee(i,{id:l.name,key:u,class:R.normalizeClass(["item-inline-filter-option py-1 px-2 text-xs first:rounded-l-full last:rounded-r-full h-[26px]",{"item-inline-filter-option-selected":e.activeOption===l.name}]),appearance:e.activeOption===l.name?"filled":"raw-inverse","color-role":e.activeOption===l.name?"secondaryContainer":"surface","no-hover":e.activeOption===l.name,onClick:d=>e.toggleFilter(l)},{default:X(()=>[W("span",{class:"truncate item-inline-filter-option-label",textContent:R.toDisplayString(l.label)},null,8,XI)]),_:2},1032,["id","class","appearance","color-role","no-hover","onClick"]))),128))],2)])}const ZI=Le(JI,[["render",YI]]),eP={class:"space-quota"},tP=["textContent"],cg=ge({__name:"SpaceQuota",props:{spaceQuota:{}},setup(e){const{$gettext:t,current:n}=de.useGettext(),r=T(()=>e.spaceQuota.total?t("%{used} of %{total} used (%{percentage}% used)",{used:a(o),total:a(s),percentage:a(i).toString()}):t("%{used} used (no restriction)",{used:a(o)})),s=T(()=>zt(e.spaceQuota.total,n)),o=T(()=>zt(e.spaceQuota.used,n)),i=T(()=>parseFloat((e.spaceQuota.used/e.spaceQuota.total*100).toFixed(2))),l=T(()=>e.spaceQuota.state==="normal"?"var(--oc-role-secondary)":"var(--oc-role-error)");return(u,d)=>{const c=te("oc-progress");return D(),K("div",eP,[W("p",{class:"mb-2 mt-0",textContent:R.toDisplayString(r.value)},null,8,tP),Q(c,{value:i.value,max:100,size:"small",color:l.value,"background-color":"var(--oc-role-surface)"},null,8,["value","color"])])}}}),nP=ge({name:"WebDavDetails",props:{space:{type:Object,required:!0}},setup(e){const t=Un("resource"),n="check",r="file-copy",s=H(r),o=H(r),i=T(()=>dl(a(t).webDavPath)),l=T(()=>e.space?.getWebDavUrl({path:a(t).path}));return{copyWebDAVPathIcon:s,copyWebDAVPathToClipboard:()=>{navigator.clipboard.writeText(a(i)),s.value=n,setTimeout(()=>s.value=r,1500)},copyWebDAVUrlIcon:o,copyWebDAVUrlToClipboard:()=>{navigator.clipboard.writeText(a(l)),o.value=n,setTimeout(()=>o.value=r,1500)},webDavPath:i,webDavUrl:l}}}),rP={class:"flex"},sP=["textContent"],oP={class:"flex"},iP=["textContent"];function aP(e,t,n,r,s,o){const i=te("oc-icon"),l=te("oc-button"),u=Bt("oc-tooltip");return D(),K(ke,null,[W("dt",null,R.toDisplayString(e.$gettext("WebDAV path")),1),W("dd",rP,[je(W("div",{class:"truncate",textContent:R.toDisplayString(e.webDavPath)},null,8,sP),[[u,e.webDavPath]]),je((D(),ee(l,{class:"ml-2",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV path to clipboard"),"no-hover":"",onClick:e.copyWebDAVPathToClipboard},{default:X(()=>[Q(i,{name:e.copyWebDAVPathIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[u,e.$gettext("Copy WebDAV path")]])]),W("dt",null,R.toDisplayString(e.$gettext("WebDAV URL")),1),W("dd",oP,[je(W("div",{class:"truncate",textContent:R.toDisplayString(e.webDavUrl)},null,8,iP),[[u,e.webDavUrl]]),je((D(),ee(l,{class:"ml-2",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV URL to clipboard"),"no-hover":"",onClick:e.copyWebDAVUrlToClipboard},{default:X(()=>[Q(i,{name:e.copyWebDAVUrlIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[u,e.$gettext("Copy WebDAV URL")]])])],64)}const ug=Le(nP,[["render",aP]]),dg=ge({__name:"CustomComponentTarget",props:{extensionPoint:{}},setup(e){const t=e,n=br(),r=bp(),s=T(()=>n.requestExtensions(t.extensionPoint)),o=r.extractDefaultExtensionIds(t.extensionPoint,a(s)),i=T(()=>{if(t.extensionPoint.multiple||a(s).length<=1)return a(s);const l=r.getExtensionPreference(t.extensionPoint.id,o);return l.selectedExtensionIds.length?[a(s).find(u=>l.selectedExtensionIds.includes(u.id))||a(s)[0]]:[a(s)[0]]});return(l,u)=>(D(!0),K(ke,null,Ge(i.value,d=>(D(),ee(Yt(d.content),at({key:`custom-component-${d.id}`},{ref_for:!0},d.componentProps?d.componentProps():void 0),null,16))),128))}}),bc={id:"app.files.sidebar.space-details.table",extensionType:"customComponent"},lP=()=>T(()=>[bc]),cP={id:"oc-space-details-sidebar",class:"p-4 bg-role-surface-container rounded-sm"},uP={class:"text-center"},dP={key:1,class:"relative mb-2"},fP=["src"],pP={key:0,class:"flex items-center oc-space-details-sidebar-members mb-2 text-sm gap-2"},hP=["textContent"],mP=["textContent"],gP=["aria-label"],yP=ge({__name:"SpaceDetails",props:{showShareIndicators:{type:Boolean,default:!0}},setup(e){const t=Ze(),n=Re(),{resourceContentsText:r}=jm({showSizeInformation:!1}),s=Ae(),{$gettext:o,$ngettext:i,current:l}=de.useGettext(),{loadPreview:u}=cc(),{openSideBarPanel:d}=Pt(),c=Ue(),{imagesLoading:f}=ve.storeToRefs(c),p=Jn(),h=Un("resource"),g=H(""),{user:m}=ve.storeToRefs(t),b=T(()=>c.getSpaceMembers(a(h))),S=T(()=>p.linkShares.length),k=T(()=>n.areWebDavDetailsShown),w=T(()=>!rt(s,"files-spaces-projects")),C=T(()=>`${zt(a(h).size,l)}, ${a(r)}`);ze(()=>a(h).spaceImageData,async()=>{g.value=await u({space:a(h),resource:a(h).spaceImageData?z.buildSpaceImageResource(a(h)):a(h),dimensions:fo.Tile,processor:bi.enum.fit,cancelRunning:!0,updateStore:!1})},{immediate:!0});const A=T(()=>a(b).length?a(b).filter(z.isManager).map(({sharedWith:q})=>q.id===a(m)?.id?o("%{displayName} (me)",{displayName:q.displayName}):q.displayName).join(", "):z.getSpaceManagers(a(h),p.graphRoles)?.map(({grantedToV2:re})=>re.user?.id===a(m)?.id?o("%{displayName} (me)",{displayName:re.user.displayName}):re.user?.displayName||re.group?.displayName).join(", ")),I=T(()=>pp(a(h).mdate,l)),N=T(()=>a(P)||a($)),_=T(()=>a(P)&&!a($)?a(M):!a(P)&&a($)?a(j):a(L)===1?i("This space has one member and %{linkShareCount} link.","This space has one member and %{linkShareCount} links.",a(S),{linkShareCount:a(S).toString()}):a(S)===1?o("This space has %{memberShareCount} members and one link.",{memberShareCount:a(L).toString()}):o("This space has %{memberShareCount} members and %{linkShareCount} links.",{memberShareCount:a(L).toString(),linkShareCount:a(S).toString()})),F=T(()=>o("Open share panel")),V=T(()=>o("Open link list in share panel")),Z=T(()=>o("Open member list in share panel")),P=T(()=>a(L)>0),$=T(()=>a(S)>0),L=T(()=>a(b).length),M=T(()=>i("This space has %{memberShareCount} member.","This space has %{memberShareCount} members.",a(L),{memberShareCount:a(L).toString()})),j=T(()=>i("%{linkShareCount} link giving access.","%{linkShareCount} links giving access.",a(S),{linkShareCount:a(S).toString()}));return(B,q)=>{const re=te("oc-spinner"),J=te("oc-icon"),oe=te("oc-button");return D(),K("div",cP,[W("div",uP,[a(f).includes(a(h).id)?(D(),ee(re,{key:0,"aria-label":a(o)("Space image is loading")},null,8,["aria-label"])):g.value?(D(),K("div",dP,[W("img",{src:g.value,alt:"",class:"size-full object-cover aspect-[16/9]"},null,8,fP)])):(D(),ee(J,{key:2,name:"layout-grid",size:"xxlarge",class:"space-default-image px-4 py-4"}))]),e.showShareIndicators&&N.value&&!a(h).disabled?(D(),K("div",pP,[P.value?(D(),ee(oe,{key:0,appearance:"raw","aria-label":Z.value,"no-hover":"",onClick:q[0]||(q[0]=ne=>a(d)("space-share"))},{default:X(()=>[Q(J,{name:"group",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):ie("",!0),$.value?(D(),ee(oe,{key:1,appearance:"raw","aria-label":V.value,"no-hover":"",onClick:q[1]||(q[1]=ne=>a(d)("space-share"))},{default:X(()=>[Q(J,{name:"link",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):ie("",!0),W("p",{textContent:R.toDisplayString(_.value)},null,8,hP),Q(oe,{appearance:"raw","aria-label":F.value,size:"small","no-hover":"",onClick:q[2]||(q[2]=ne=>a(d)("space-share"))},{default:X(()=>[W("span",{class:"text-sm",textContent:R.toDisplayString(a(o)("Show"))},null,8,mP)]),_:1},8,["aria-label"])])):ie("",!0),W("dl",{class:"details-list grid grid-cols-[auto_minmax(0,1fr)] m-0","aria-label":a(o)("Overview of the information about the selected space")},[W("dt",null,R.toDisplayString(a(o)("Last activity")),1),W("dd",null,R.toDisplayString(I.value),1),a(h).description?(D(),K(ke,{key:0},[W("dt",null,R.toDisplayString(a(o)("Subtitle")),1),W("dd",null,R.toDisplayString(a(h).description),1)],64)):ie("",!0),W("dt",null,R.toDisplayString(a(o)("Manager")),1),W("dd",null,R.toDisplayString(A.value),1),a(h).disabled?ie("",!0):(D(),K(ke,{key:1},[W("dt",null,R.toDisplayString(a(o)("Quota")),1),W("dd",null,[Q(cg,{"space-quota":a(h).spaceQuota},null,8,["space-quota"])])],64)),w.value?(D(),K(ke,{key:2},[W("dt",null,R.toDisplayString(a(o)("Size")),1),W("dd",null,R.toDisplayString(C.value),1)],64)):ie("",!0),k.value?(D(),ee(ug,{key:3,space:a(h)},null,8,["space"])):ie("",!0),Q(dg,{"extension-point":a(bc)},null,8,["extension-point"])],8,gP)])}}}),vP={id:"oc-spaces-details-multiple-sidebar",class:"p-4 bg-role-surface-container rounded-sm"},bP={class:"text-center mb-6 rounded-sm"},wP=["textContent"],SP=ge({__name:"SpaceDetailsMultiple",props:{selectedSpaces:{}},setup(e){const t=de.useGettext(),{$gettext:n,$ngettext:r}=t,s=T(()=>{let p=0;return e.selectedSpaces.forEach(h=>{p+=h.spaceQuota.total}),zt(p,t.current)}),o=T(()=>{let p=0;return e.selectedSpaces.forEach(h=>{h.disabled||(p+=h.spaceQuota.remaining)}),zt(p,t.current)}),i=T(()=>{let p=0;return e.selectedSpaces.forEach(h=>{h.disabled||(p+=h.spaceQuota.used)}),zt(p,t.current)}),l=T(()=>e.selectedSpaces.filter(p=>!p.disabled).length),u=T(()=>e.selectedSpaces.filter(p=>p.disabled).length),d=T(()=>n("Overview of the information about the selected spaces")),c=T(()=>r("%{ itemCount } space selected","%{ itemCount } spaces selected",e.selectedSpaces.length,{itemCount:e.selectedSpaces.length.toString()})),f=T(()=>[{term:n("Total quota:"),definition:a(s).toString()},{term:n("Remaining quota:"),definition:a(o).toString()},{term:n("Used quota:"),definition:a(i).toString()},{term:n("Enabled:"),definition:a(l).toString()},{term:n("Disabled:"),definition:a(u).toString()}]);return(p,h)=>{const g=te("oc-icon"),m=te("oc-definition-list");return D(),K("div",vP,[W("div",bP,[W("div",null,[Q(g,{size:"xxlarge",name:"layout-grid"}),W("p",{textContent:R.toDisplayString(c.value)},null,8,wP)])]),Q(m,{"aria-label":d.value,items:f.value,class:"m-0"},null,8,["aria-label","items"])])}}}),kP=ge({name:"SpaceNoSelection"}),CP={class:"mt-12"},TP={class:"flex flex-col items-center space-info text-center"},xP=["textContent"];function AP(e,t,n,r,s,o){const i=te("oc-icon");return D(),K("div",CP,[W("div",TP,[Q(i,{name:"layout-grid",size:"xxlarge"}),W("p",{textContent:R.toDisplayString(e.$gettext("Select a space to view details"))},null,8,xP)])])}const RP=Le(kP,[["render",AP]]),EP=ge({name:"CompareSaveDialog",props:{originalObject:{type:Object,required:!0},compareObject:{type:Object,required:!0},confirmButtonDisabled:{type:Boolean,default:()=>!1}},emits:["confirm","revert"],setup(){const e=H(!1);let t;return ft(()=>{t=Xe.subscribe("sidebar.entity.saved",()=>{e.value=!0})}),Xt(()=>{Xe.unsubscribe("sidebar.entity.saved",t)}),{saved:e}},computed:{unsavedChanges(){return!Yf(this.originalObject,this.compareObject)},unsavedChangesText(){return this.unsavedChanges?this.$gettext("Unsaved changes"):this.$gettext("No changes")}},watch:{unsavedChanges(){this.unsavedChanges&&(this.saved=!1)},"originalObject.id":function(){this.saved=!1}}}),DP={class:"w-full flex flex-row flex-wrap justify-between items-center"},FP={key:0,class:"flex items-center"},IP=["textContent"],PP={key:1},$P=["textContent"],OP=["textContent"];function LP(e,t,n,r,s,o){const i=te("oc-icon"),l=te("oc-button");return D(),K("div",DP,[e.saved?(D(),K("span",FP,[Q(i,{name:"checkbox-circle"}),W("span",{class:"ml-2",textContent:R.toDisplayString(e.$gettext("Changes saved"))},null,8,IP)])):(D(),K("span",PP,R.toDisplayString(e.unsavedChangesText),1)),W("div",null,[Q(l,{disabled:!e.unsavedChanges,class:"compare-save-dialog-revert-btn",onClick:t[0]||(t[0]=u=>e.$emit("revert"))},{default:X(()=>[W("span",{textContent:R.toDisplayString(e.$gettext("Revert"))},null,8,$P)]),_:1},8,["disabled"]),Q(l,{appearance:"filled",class:"compare-save-dialog-confirm-btn",disabled:!e.unsavedChanges||e.confirmButtonDisabled,onClick:t[1]||(t[1]=u=>e.$emit("confirm"))},{default:X(()=>[W("span",{textContent:R.toDisplayString(e.$gettext("Save"))},null,8,OP)]),_:1},8,["disabled"])])])}const _P=Le(EP,[["render",LP]]),MP=Uy(async()=>(await Promise.resolve().then(()=>E$)).default),NP={class:"flex items-center truncate"},BP={class:"truncate"},jP={class:"flex"},zP=ge({__name:"ItemFilter",props:{filterLabel:{},filterName:{},items:{},optionFilterLabel:{default:""},showOptionFilter:{type:Boolean,default:!1},allowMultiple:{type:Boolean,default:!1},idAttribute:{default:"id"},displayNameAttribute:{default:"name"},filterableAttributes:{default:()=>[]},closeOnClick:{type:Boolean,default:!1}},emits:["selectionChange"],setup(e,{expose:t,emit:n}){const r=n,s=Ae(),o=yt(),i=qt("filterInputRef"),l=H([]),u=H(e.items),d=qt("itemFilterListRef"),c=`q_${e.filterName}`,f=At(c),p=N=>N[e.idAttribute],h=()=>s.push({query:{...ps(a(o).query,[c]),...!!a(l).length&&{[c]:a(l).reduce((N,_)=>(N+=`${p(_)}+`,N),"").slice(0,-1)}}}),g=N=>!!a(l).find(_=>p(_)===p(N)),m=async N=>{g(N)?l.value=a(l).filter(_=>p(_)!==p(N)):(e.allowMultiple||(l.value=[]),l.value.push(N)),await h(),r("selectionChange",a(l))},b=H(),S=(N,_)=>{if(!(_||"").trim())return N;const V=new Sc(N,{...ja,keys:e.filterableAttributes}).search(_).map(Z=>Z.item);return N.filter(Z=>V.includes(Z))},k=()=>{l.value=[],r("selectionChange",a(l)),h()},w=N=>{u.value=N},C=async()=>{w(e.items),await St(),a(i)?.focus()};let A;ze(b,()=>{w(S(e.items,a(b))),a(d)&&(A=new xc(a(d)),A.unmark(),A.mark(a(b),{element:"span",className:"mark-highlight"}))});const I=()=>{const N=ot(a(f));if(N){const _=N.split("+");l.value=e.items.filter(F=>_.includes(p(F)))}};return t({setSelectedItemsBasedOnQuery:I}),ft(()=>{I()}),(N,_)=>{const F=te("oc-checkbox"),V=te("oc-icon"),Z=te("oc-button"),P=te("oc-list"),$=te("oc-filter-chip");return D(),K("div",{class:R.normalizeClass(["item-filter flex",`item-filter-${e.filterName}`])},[Q($,{"filter-label":e.filterLabel,"selected-item-names":l.value.map(L=>L[e.displayNameAttribute]),"close-on-click":e.closeOnClick,onClearFilter:k,onShowDrop:C},{default:X(()=>[e.showOptionFilter&&e.filterableAttributes.length?(D(),ee(a(RA),{key:0,ref_key:"filterInputRef",ref:i,modelValue:b.value,"onUpdate:modelValue":_[0]||(_[0]=L=>b.value=L),class:"item-filter-input mb-4 mt-2",autocomplete:"off",label:e.optionFilterLabel===""?N.$gettext("Filter list"):e.optionFilterLabel},null,8,["modelValue","label"])):ie("",!0),W("div",{ref_key:"itemFilterListRef",ref:d},[Q(P,{class:"item-filter-list"},{default:X(()=>[(D(!0),K(ke,null,Ge(u.value,(L,M)=>(D(),K("li",{key:M,class:"my-1"},[Q(Z,{class:R.normalizeClass(["item-filter-list-item flex items-center w-full",{"item-filter-list-item-active":!e.allowMultiple&&g(L),"justify-start":e.allowMultiple,"justify-between":!e.allowMultiple}]),"justify-content":"space-between",appearance:"raw","data-test-value":L[e.displayNameAttribute],onClick:j=>m(L)},{default:X(()=>[W("div",NP,[e.allowMultiple?(D(),ee(F,{key:0,size:"large",class:"mr-2",label:N.$gettext("Toggle selection"),"model-value":g(L),"label-hidden":!0,"onUpdate:modelValue":j=>m(L),onClick:_[1]||(_[1]=kt(()=>{},["stop"]))},null,8,["label","model-value","onUpdate:modelValue"])):ie("",!0),W("div",null,[Se(N.$slots,"image",{item:L})]),W("div",BP,[Se(N.$slots,"item",{item:L})])]),W("div",jP,[!e.allowMultiple&&g(L)?(D(),ee(V,{key:0,name:"check"})):ie("",!0)])]),_:2},1032,["class","data-test-value","onClick"])]))),128))]),_:3})],512)]),_:3},8,["filter-label","selected-item-names","close-on-click"])],2)}}}),VP=ge({name:"ItemFilterToggle",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=Ae(),r=yt(),s=H(!1),o=`q_${e.filterName}`,i=At(o),l=()=>n.push({query:{...ps(a(r).query,[o]),...a(s)&&{[o]:"true"}}}),u=async()=>{s.value=!a(s),await l(),t("toggleFilter",a(s))};return ft(()=>{ot(a(i))==="true"&&(s.value=!0)}),{queryParam:o,filterActive:s,toggleFilter:u}}});function UP(e,t,n,r,s,o){const i=te("oc-filter-chip");return D(),K("div",{class:R.normalizeClass(["item-filter flex",`item-filter-${e.filterName}`])},[Q(i,{"is-toggle":!0,"filter-label":e.filterLabel,"is-toggle-active":e.filterActive,onToggleFilter:e.toggleFilter,onClearFilter:e.toggleFilter},null,8,["filter-label","is-toggle-active","onToggleFilter","onClearFilter"])],2)}const qP=Le(VP,[["render",UP]]),HP=ge({name:"LoadingIndicator",setup(){const e=Nt();let t,n,r;const s=H(e.isLoading),o=H(e.currentProgress),i=()=>{o.value=e.currentProgress,s.value=e.isLoading},l=()=>{o.value=e.currentProgress};return ft(()=>{t=Xe.subscribe(vr.add,i),n=Xe.subscribe(vr.remove,i),r=Xe.subscribe(vr.setProgress,l)}),Xt(()=>{Xe.unsubscribe(vr.add,t),Xe.unsubscribe(vr.remove,n),Xe.unsubscribe(vr.setProgress,r)}),{isLoading:s,currentProgress:o}}}),WP={key:0,id:"oc-loading-indicator",class:"w-full"};function QP(e,t,n,r,s,o){const i=te("oc-progress");return e.isLoading?(D(),K("div",WP,[Q(i,{max:100,indeterminate:e.currentProgress===null,value:e.currentProgress,size:"xsmall"},null,8,["indeterminate","value"])])):ie("",!0)}const KP=Le(HP,[["render",QP]]),GP={class:"no-content-message flex flex-col justify-center items-center text-center"},JP={class:"text-role-on-surface-variant text-xl"},XP={class:"text-role-on-surface-variant mt-1"},YP=Le(ge({__name:"NoContentMessage",props:{icon:{default:""},iconFillType:{default:"fill"},imgSrc:{default:""}},setup(e){return(t,n)=>{const r=te("oc-image"),s=te("oc-icon");return D(),K("div",GP,[e.imgSrc?(D(),ee(r,{key:0,width:"120",height:"120",class:"mb-4",src:e.imgSrc,alt:t.$gettext("No content image")},null,8,["src","alt"])):ie("",!0),e.icon?(D(),ee(s,{key:1,name:e.icon,type:"div",size:"xxlarge","fill-type":e.iconFillType,class:"mb-4"},null,8,["name","fill-type"])):ie("",!0),W("div",JP,[Se(t.$slots,"message",{},void 0,!0)]),W("div",XP,[Se(t.$slots,"callToAction",{},void 0,!0)])])}}}),[["__scopeId","data-v-02a07e27"]]),ZP=ge({props:{pages:{type:Number,required:!0},currentPage:{type:Number,required:!0}},watch:{currentPage:{handler:function(){document.getElementsByClassName("files-view-wrapper")[0]?.scrollTo(0,0)}}}});function e$(e,t,n,r,s,o){const i=te("oc-pagination");return e.pages>1?(D(),ee(i,{key:0,pages:e.pages,"current-page":e.currentPage,"max-displayed":3,"current-route":e.$route,class:"files-pagination flex justify-center my-2"},null,8,["pages","current-page","current-route"])):ie("",!0)}const t$=Le(ZP,[["render",e$]]),n$=ge({name:"SearchBarFilter",props:{currentFolderAvailable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=de.useGettext(),r=At("useScope"),s=H(),o=H(),i=T(()=>n(s.value?.title)),l=T(()=>[{id:zr.currentFolder,title:n("Current folder"),enabled:e.currentFolderAvailable},{id:zr.allFiles,title:n("All files"),enabled:!0}]);return ze(()=>e.currentFolderAvailable,()=>{if(a(r)){if(a(r).toString()==="true"){s.value=a(l).find(({id:c})=>c===zr.currentFolder);return}s.value=a(l).find(({id:c})=>c===zr.allFiles);return}if(!e.currentFolderAvailable){s.value=a(l).find(({id:d})=>d===zr.allFiles);return}if(a(o)){s.value=a(l).find(({id:d})=>d===a(o).id);return}s.value=a(l).find(({id:d})=>d===zr.allFiles)},{immediate:!0}),{currentSelection:s,currentSelectionTitle:i,onOptionSelected:d=>{o.value=d,s.value=d,t("update:modelValue",{value:d})},locationOptions:l}}}),r$={key:0},s$={key:0,class:"flex"};function o$(e,t,n,r,s,o){const i=te("oc-icon"),l=te("oc-button"),u=te("oc-list"),d=te("oc-filter-chip");return D(),K("div",{class:"z-[var(--z-index-modal)] absolute top-[50%] transform-[translateY(-50%)] right-0 ml-4 mb-4 mt-0 mr-[34px] float-right","data-testid":"search-bar-filter",onClick:t[0]||(t[0]=kt(()=>{},["stop"]))},[e.currentSelection?(D(),K("div",r$,[Q(d,{"is-toggle":!1,"is-toggle-active":!1,"filter-label":e.$gettext("Location filter"),"selected-item-names":[e.currentSelectionTitle],class:"oc-search-bar-filter [&_button]:items-center [&_.oc-drop]:w-45","has-active-state":!1,raw:"","close-on-click":""},{default:X(()=>[Q(u,null,{default:X(()=>[(D(!0),K(ke,null,Ge(e.locationOptions,(c,f)=>(D(),K("li",{key:f},[Q(l,{appearance:c.id===e.currentSelection.id?"filled":"raw-inverse","color-role":c.id===e.currentSelection.id?"secondaryContainer":"surface","no-hover":c.id===e.currentSelection.id,size:"medium",class:"flex items-center w-full py-1 px-2","justify-content":"space-between",disabled:!c.enabled,"data-test-id":c.id,onClick:p=>e.onOptionSelected(c)},{default:X(()=>[W("span",null,R.toDisplayString(c.title),1),c.id===e.currentSelection.id?(D(),K("div",s$,[Q(i,{name:"check"})])):ie("",!0)]),_:2},1032,["appearance","color-role","no-hover","disabled","data-test-id","onClick"])]))),128))]),_:1})]),_:1},8,["filter-label","selected-item-names"])])):ie("",!0)])}const i$=Le(n$,[["render",o$]]),a$={key:0},l$={key:0,class:"version-check-loading flex items-center"},c$=["textContent"],u$={key:0,class:"version-check-no-updates flex items-center"},d$=["textContent"],f$=["textContent"],p$=ge({__name:"VersionCheck",setup(e){const{$gettext:t}=de.useGettext(),n=Ct(),r=Yp(),s=n.capabilities.core["check-for-updates"],{updates:o,isLoading:i,hasError:l}=ve.storeToRefs(r),u=T(()=>s&&!a(l)),d=H(!1),c=H(),f=n.status.edition||"rolling",h=n.status.productversion.split("+")[0];return ze(()=>o,()=>{if(!a(o))return;const g=a(o).channels[f].current_version;pl(g,h)>0&&(d.value=!0,c.value=a(o).channels[f])},{immediate:!0,deep:!0}),(g,m)=>{const b=te("oc-spinner"),S=te("oc-icon"),k=te("oc-button");return u.value?(D(),K("div",a$,[a(i)?(D(),K("div",l$,[W("span",{textContent:R.toDisplayString(a(t)("Checking for updates"))},null,8,c$),Q(b,{class:"ml-1",size:"xsmall"})])):(D(),K(ke,{key:1},[d.value?(D(),ee(k,{key:1,class:"version-check-update text-role-on-surface-variant",size:"small",type:"a",href:c.value.url,target:"_blank","gap-size":"small",appearance:"raw","no-hover":""},{default:X(()=>[W("span",{class:"text-xs",textContent:R.toDisplayString(a(t)("Version %{version} available",{version:c.value.current_version}))},null,8,f$),Q(S,{name:"refresh",size:"xsmall","fill-type":"line"})]),_:1},8,["href"])):(D(),K("div",u$,[W("span",{textContent:R.toDisplayString(a(t)("Up to date"))},null,8,d$),Q(S,{class:"ml-0.5",name:"checkbox-circle",size:"xsmall","fill-type":"line"})]))],64))])):ie("",!0)}}}),h$={toolbarTips:{bold:"Gras",underline:"Souligné",italic:"Italique",strikeThrough:"Barré",title:"Titre",sub:"Indice",sup:"Exposant",quote:"Citation",unorderedList:"Liste",orderedList:"Liste numérique",task:"Liste de tâche",codeRow:"Code intégré",code:"Bloc de code",link:"Lien",image:"Image",table:"Table",mermaid:"Organigramme",katex:"Formule",revoke:"Annuler",next:"Refaire",save:"Sauvegarder",prettier:"Sublimer",pageFullscreen:"Passer en pleine page",fullscreen:"Passer en plein écran",preview:"Prévisualiser",htmlPreview:"Prévisualiser le HTML",catalog:"Table des matières",github:"Code source de l'editeur"},titleItem:{h1:"Titre niveau 1",h2:"Titre niveau 2",h3:"Titre niveau 3",h4:"Titre niveau 4",h5:"Titre niveau 5",h6:"Titre niveau 6"},imgTitleItem:{link:"Ajouter depuis une url",upload:"Télécharger une image",clip2upload:"Télécharger et recadrer"},linkModalTips:{linkTitle:"Ajouter un lien",imageTitle:"Ajouter une image depuis une url",descLabel:"Texte : ",descLabelPlaceHolder:"Entrez un texte...",urlLabel:"Url : ",urlLabelPlaceHolder:"Entrez une url...",buttonOK:"Valider"},clipModalTips:{title:"Télécharger et recadrer une image",buttonUpload:"Valider"},copyCode:{text:"Copier le code",successTips:"Copié",failTips:"La copie a échoué!"},mermaid:{flow:"Organigramme",sequence:"Chronogramme",gantt:"Diagramme de Gantt",class:"Diagramme de classes",state:"Diagramme d'état",pie:"Diagramme circulaire",relationship:"Diagramme de relation",journey:"Diagramme de tâches"},katex:{inline:"Formule en ligne",block:"Formule en bloc"},footer:{markdownTotal:"Nombre de mots",scrollAuto:"Défilement synchronisé"}},m$={toolbarTips:{bold:"Fett",underline:"Unterstrichen",italic:"Kursiv",strikeThrough:"Durchgestrichen",title:"Titel",sub:"Tiefgestellt",sup:"Hochgestellt",quote:"Zitat",unorderedList:"Ungeordnete Liste",orderedList:"Geordnete Liste",task:"Aufgabenliste",codeRow:"Eingebetteter Code",code:"Codeblock",link:"Link",image:"Bild",table:"Tabelle",mermaid:"Flussdiagramm",katex:"Formel",revoke:"Rückgängig machen",next:"Wiederherstellen",save:"Speichern",prettier:"Verschönern",pageFullscreen:"Vollbildmodus",fullscreen:"Vollbild",preview:"Vorschau",htmlPreview:"HTML Vorschau",catalog:"Inhaltsverzeichnis",github:"Quellcode des Editors"},titleItem:{h1:"Überschrift Ebene 1",h2:"Überschrift Ebene 2",h3:"Überschrift Ebene 3",h4:"Überschrift Ebene 4",h5:"Überschrift Ebene 5",h6:"Überschrift Ebene 6"},imgTitleItem:{link:"Bildlink hinzufügen",upload:"Bild hochladen",clip2upload:"Bild zuschneiden und hochladen"},linkModalTips:{linkTitle:"Link hinzufügen",imageTitle:"Bild von URL hinzufügen",descLabel:"Text: ",descLabelPlaceHolder:"Text eingeben...",urlLabel:"URL: ",urlLabelPlaceHolder:"URL eingeben...",buttonOK:"Bestätigen"},clipModalTips:{title:"Bild zuschneiden und hochladen",buttonUpload:"Hochladen"},copyCode:{text:"Code kopieren",successTips:"Kopiert!",failTips:"Kopieren fehlgeschlagen!"},mermaid:{flow:"Flussdiagramm",sequence:"Sequenzdiagramm",gantt:"Gantt-Diagramm",class:"Klassendiagramm",state:"Zustandsdiagramm",pie:"Kreisdiagramm",relationship:"Beziehungsdiagramm",journey:"Reisediagramm"},katex:{inline:"Inline-Formel",block:"Blockformel"},footer:{markdownTotal:"Zeichenanzahl",scrollAuto:"Automatisches Scrollen"}},g$={toolbarTips:{bold:"Grassetto",underline:"Sottolineato",italic:"Corsivo",strikeThrough:"Barrato",title:"Titolo",sub:"Indice",sup:"Esponente",quote:"Citazione",unorderedList:"Elenco non ordinato",orderedList:"Elenco ordinato",task:"Lista di compiti",codeRow:"Codice incorporato",code:"Blocco di codice",link:"Link",image:"Immagine",table:"Tabella",mermaid:"Diagramma",katex:"Formula",revoke:"Annulla",next:"Ripristina",save:"Salva",prettier:"Formatta",pageFullscreen:"Pagina a schermo intero",fullscreen:"Schermo intero",preview:"Anteprima",htmlPreview:"Anteprima HTML",catalog:"Indice",github:"Codice sorgente dell'editor"},titleItem:{h1:"Intestazione Livello 1",h2:"Intestazione Livello 2",h3:"Intestazione Livello 3",h4:"Intestazione Livello 4",h5:"Intestazione Livello 5",h6:"Intestazione Livello 6"},imgTitleItem:{link:"Aggiungi link immagine",upload:"Carica immagine",clip2upload:"Ritaglia e carica immagine"},linkModalTips:{linkTitle:"Aggiungi link",imageTitle:"Aggiungi immagine da URL",descLabel:"Testo: ",descLabelPlaceHolder:"Inserisci il testo...",urlLabel:"URL: ",urlLabelPlaceHolder:"Inserisci l'URL...",buttonOK:"Conferma"},clipModalTips:{title:"Ritaglia e carica immagine",buttonUpload:"Carica"},copyCode:{text:"Copia codice",successTips:"Copiato!",failTips:"Copia fallita!"},mermaid:{flow:"Diagramma di flusso",sequence:"Diagramma di sequenza",gantt:"Diagramma di Gantt",class:"Diagramma di classe",state:"Diagramma di stato",pie:"Diagramma a torta",relationship:"Diagramma di relazione",journey:"Diagramma di viaggio"},katex:{inline:"Formula in linea",block:"Formula a blocco"},footer:{markdownTotal:"Conteggio parole",scrollAuto:"Scorrimento automatico"}},y$={toolbarTips:{bold:"Negrita",underline:"Subrayado",italic:"Cursiva",strikeThrough:"Tachado",title:"Título",sub:"Subíndice",sup:"Superíndice",quote:"Cita",unorderedList:"Lista desordenada",orderedList:"Lista ordenada",task:"Lista de tareas",codeRow:"Código en línea",code:"Bloque de código",link:"Enlace",image:"Imagen",table:"Tabla",mermaid:"Diagrama",katex:"Fórmula",revoke:"Deshacer",next:"Rehacer",save:"Guardar",prettier:"Formatear",pageFullscreen:"Página en pantalla completa",fullscreen:"Pantalla completa",preview:"Vista previa",htmlPreview:"Vista previa del HTML",catalog:"Índice",github:"Código fuente del editor"},titleItem:{h1:"Encabezado de nivel 1",h2:"Encabezado de nivel 2",h3:"Encabezado de nivel 3",h4:"Encabezado de nivel 4",h5:"Encabezado de nivel 5",h6:"Encabezado de nivel 6"},imgTitleItem:{link:"Agregar enlace de imagen",upload:"Subir imagen",clip2upload:"Recortar y subir imagen"},linkModalTips:{linkTitle:"Agregar enlace",imageTitle:"Agregar imagen desde URL",descLabel:"Texto: ",descLabelPlaceHolder:"Introduce el texto...",urlLabel:"Enlace: ",urlLabelPlaceHolder:"Introduce el enlace...",buttonOK:"Confirmar"},clipModalTips:{title:"Recortar y subir imagen",buttonUpload:"Subir"},copyCode:{text:"Copiar código",successTips:"¡Copiado!",failTips:"¡Copia fallida!"},mermaid:{flow:"Diagrama de flujo",sequence:"Diagrama de secuencia",gantt:"Diagrama de Gantt",class:"Diagrama de clase",state:"Diagrama de estado",pie:"Diagrama de pastel",relationship:"Diagrama de relación",journey:"Diagrama de viaje"},katex:{inline:"Fórmula en línea",block:"Fórmula de bloque"},footer:{markdownTotal:"Conteo de letras",scrollAuto:"Desplazamiento automático"}},v$={toolbarTips:{bold:"Pogrubienie",underline:"Podkreślenie",italic:"Kursywa",strikeThrough:"Przekreślenie",title:"Tytuł",sub:"Indeks dolny",sup:"Indeks górny",quote:"Cytat",unorderedList:"Lista nieuporządkowana",orderedList:"Lista uporządkowana",task:"Lista zadań",codeRow:"Wbudowany kod",code:"Blok kodu",link:"Link",image:"Obraz",table:"Tabela",mermaid:"Schemat przepływu",katex:"Formuła",revoke:"Cofnij",next:"Przywróć",save:"Zapisz",prettier:"Upiększ",pageFullscreen:"Pełny ekran strony",fullscreen:"Pełny ekran",preview:"Podgląd",htmlPreview:"Podgląd HTML",catalog:"Spis treści",github:"Kod źródłowy edytora"},titleItem:{h1:"Nagłówek poziom 1",h2:"Nagłówek poziom 2",h3:"Nagłówek poziom 3",h4:"Nagłówek poziom 4",h5:"Nagłówek poziom 5",h6:"Nagłówek poziom 6"},imgTitleItem:{link:"Dodaj link do obrazu",upload:"Prześlij obraz",clip2upload:"Przytnij i prześlij obraz"},linkModalTips:{linkTitle:"Dodaj link",imageTitle:"Dodaj obraz z URL",descLabel:"Tekst: ",descLabelPlaceHolder:"Wpisz tekst...",urlLabel:"URL: ",urlLabelPlaceHolder:"Wpisz URL...",buttonOK:"Potwierdź"},clipModalTips:{title:"Przytnij i prześlij obraz",buttonUpload:"Prześlij"},copyCode:{text:"Skopiuj kod",successTips:"Skopiowano!",failTips:"Nie udało się skopiować!"},mermaid:{flow:"Schemat przepływu",sequence:"Schemat sekwencji",gantt:"Wykres Gantta",class:"Diagram klas",state:"Diagram stanów",pie:"Diagram kołowy",relationship:"Diagram relacji",journey:"Diagram podróży"},katex:{inline:"Formuła inline",block:"Formuła blokowa"},footer:{markdownTotal:"Liczba znaków",scrollAuto:"Automatyczne przewijanie"}},b$={toolbarTips:{bold:"жирный",underline:"подчёркнутый",italic:"курсив",strikeThrough:"зачёркнутый",title:"заголовок",sub:"нижний индекс",sup:"верхний индекс",quote:"цитата",unorderedList:"неупорядоченный список",orderedList:"упорядоченный список",task:"список задач",codeRow:"встроенный код",code:"блочный код",link:"ссылка",image:"изображение",table:"таблица",mermaid:"диаграмма",katex:"формула",revoke:"отмена",next:"вернуть",save:"сохранить",prettier:"форматировать",pageFullscreen:"на всю страницу",fullscreen:"на весь экран",preview:"превью",previewOnly:"только превью",htmlPreview:"превью html",catalog:"каталог",github:"исходный код"},titleItem:{h1:"Заголовок 1-го ур.",h2:"Заголовок 2-го ур.",h3:"Заголовок 3-го ур.",h4:"Заголовок 4-го ур.",h5:"Заголовок 5-го ур.",h6:"Заголовок 6-го ур."},imgTitleItem:{link:"Добавить ссылку на изображение",upload:"Загрузить изображение",clip2upload:"Из буфера обмена"},linkModalTips:{linkTitle:"Добавить ссылку",imageTitle:"Добавить изображение",descLabel:"Описание:",descLabelPlaceHolder:"Введите описание...",urlLabel:"Ссылка:",urlLabelPlaceHolder:"Введите ссылку...",buttonOK:"ОК"},clipModalTips:{title:"Обрезать изображение",buttonUpload:"Загрузить"},copyCode:{text:"Скопировать",successTips:"Скопировано!",failTips:"Не удалось скопировать!"},mermaid:{flow:"цепная",sequence:"последовательная",gantt:"временная",class:"структурная",state:"статусная",pie:"круговая",relationship:"реляционная",journey:"путешествия"},katex:{inline:"встроенная",block:"блочная"},footer:{markdownTotal:"Кол-во символов",scrollAuto:"Автопрокрутка"}},w$={toolbarTips:{bold:"太字",underline:"下線",italic:"斜体",strikeThrough:"取り消し線",title:"タイトル",sub:"下付き文字",sup:"上付き文字",quote:"引用",unorderedList:"番号なし箇条書き",orderedList:"番号付の箇条書き",task:"タスクリスト",codeRow:"インラインコード",code:"ブロックコード",link:"リンク",image:"イメージ",table:"テーブル",mermaid:"mermaid図",katex:"katex数式",revoke:"後退",next:"前進",save:"保存",prettier:"フォーマット",pageFullscreen:"ブラウザのフルスクリーン",fullscreen:"フルスクリーン",preview:"プレビュー",htmlPreview:"htmlプレビュー",catalog:"目次",github:"ギットハブ"},titleItem:{h1:"見出し1",h2:"見出し2",h3:"見出し3",h4:"見出し4",h5:"見出し5",h6:"見出し6"},imgTitleItem:{link:"リンク",upload:"アップロード",clip2upload:"トリミングアップロード"},linkModalTips:{linkTitle:"追加",imageTitle:"イメージ追加",descLabel:"リンクの説明:",descLabelPlaceHolder:"説明を入力してください...",urlLabel:"リンクアドレス:",urlLabelPlaceHolder:"リンクを入力してください...",buttonOK:"確定"},clipModalTips:{title:"トリミング画像のアップロード",buttonUpload:"アップロード"},copyCode:{text:"コードをコピー",successTips:"コピー成功!",failTips:"コピー失敗!"},mermaid:{flow:"フローチャート",sequence:"タイミング図",gantt:"ガントチャート",class:"クラス図",state:"状態図",pie:"円グラフ",relationship:"関係図",journey:"旅路図"},katex:{inline:"インライン数式",block:"ブロック数式"},footer:{markdownTotal:"単語数",scrollAuto:"同期スクロール"}},S$={toolbarTips:{bold:"tebal",underline:"garis bawah",italic:"miring",strikeThrough:"coret sambung",title:"judul",sub:"subscript",sup:"superscript",quote:"quote",unorderedList:"daftar tak berurutan",orderedList:"daftar berurutan",task:"daftar tugas",codeRow:"kode inline",code:"kode blok",link:"tautan",image:"gambar",table:"tabel",mermaid:"mermaid",katex:"rumus",revoke:"membatalkan",next:"membatalkan pembatalan",save:"simpan",prettier:"penataan",pageFullscreen:"layar penuh di halaman",fullscreen:"layar penuh",preview:"pratinjau",htmlPreview:"pratinjau html",catalog:"daftar isi",github:"kode sumber"},titleItem:{h1:"Judul 1",h2:"Judul 2",h3:"Judul 3",h4:"Judul 4",h5:"Judul 5",h6:"Judul 6"},imgTitleItem:{link:"Tambahkan Tautan Gambar",upload:"Unggah Gambar",clip2upload:"Potong dan Unggah"},linkModalTips:{linkTitle:"Tambahkan Tautan",imageTitle:"Tambahkan Gambar",descLabel:"Deskripsi:",descLabelPlaceHolder:"Masukkan deskripsi...",urlLabel:"Tautan:",urlLabelPlaceHolder:"Masukkan tautan...",buttonOK:"OK"},clipModalTips:{title:"Potong dan Unggah Gambar",buttonUpload:"Unggah"},copyCode:{text:"Salin",successTips:"Tersalin!",failTips:"Gagal menyalin!"},mermaid:{flow:"diagram aliran",sequence:"diagram urutan",gantt:"diagram gantt",class:"diagram kelas",state:"diagram status",pie:"diagram pie",relationship:"diagram hubungan",journey:"diagram perjalanan"},katex:{inline:"rumus inline",block:"rumus blok"},footer:{markdownTotal:"Jumlah Kata",scrollAuto:"Gulir Otomatis"}},k$={zh:"zh-CN",fr:"fr-FR",ja:"jp-JP",id:"id-ID",ru:"ru",de:"de-DE",it:"it-IT",es:"es-ES",pl:"pl-PL",en:"en-US"},C$={"fr-FR":h$,"de-DE":m$,"it-IT":g$,"es-ES":y$,"pl-PL":v$,ru:b$,"jp-JP":w$,"id-ID":S$},T$=ge({name:"TextEditor",components:{MdEditor:ks.MdEditor,MdPreview:ks.MdPreview,NormalToolbar:ks.NormalToolbar},props:{applicationConfig:{type:Object,required:!1},currentContent:{type:String,required:!0},markdownMode:{type:Boolean,required:!1,default:!1},isReadOnly:{type:Boolean,required:!1,default:!1},resource:{type:Object,required:!1}},emits:["update:currentContent"],setup(e,{emit:t}){const n=de.useGettext(),{currentTheme:r}=On(),s=H(!0),o=T(()=>{const{showPreviewOnlyMd:c=!0}=e.applicationConfig;return{showPreviewOnlyMd:c}}),i=T(()=>e.markdownMode||["md","markdown"].includes(e.resource?.extension)||!a(o).showPreviewOnlyMd),l=T(()=>a(r).isDark?"dark":"light"),u=T(()=>a(i)?["bold","underline","italic","-","title","strikeThrough","sub","sup","quote","unorderedList","orderedList","task","-","codeRow","code","link","image","table","-","revoke","next","=",0,"preview","previewOnly"]:["revoke","next","=",0]);return ks.config({editorConfig:{languageUserDefined:C$},editorExtensions:{screenfull:{instance:Tg},cropper:{instance:ra}},markdownItPlugins(c){return[...c,{type:"xss",plugin:ks.XSSPlugin,options:{}}]},codeMirrorExtensions(c){const f=[...c,{type:"lineNumbers",extension:xg.lineNumbers()}],p=f.find(h=>h.type==="linkShortener");return p&&(p.options.maxLength=120),a(i)?f:f.filter(h=>["lineWrapping","keymap","floatingToolbar","lineNumbers"].includes(h.type))}}),{isMarkdown:i,theme:l,toolbars:u,language:n,languages:k$,onUploadImg:async c=>{const p=(await Promise.all([...c].map(g=>new Promise((m,b)=>{const S=new FileReader;S.onload=()=>m(S.result),S.onerror=b,S.readAsDataURL(g)})))).map(g=>`![image](${g})`),h=`${a(e.currentContent)}
13
+ ${p.join(`
34
14
 
35
15
  `)}
36
- `;t("update:currentContent",h)},showLineNumbers:o}}}),AO={id:"text-editor-container",class:"h-full [&_.md-editor-preview]:!font-(family-name:--oc-font-family)"},EO={key:0};function RO(e,t,n,r,o,s){const i=oe("md-preview"),l=oe("oc-icon"),u=oe("NormalToolbar"),d=oe("md-editor");return I(),G("div",AO,[e.isReadOnly?(I(),G("article",EO,[J(i,{id:"text-editor-preview-component","model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-upload-img":"","no-highlight":"","no-echarts":"",language:e.languages[e.language.current]||"en-US",theme:e.theme,"auto-focus":"","read-only":""},null,8,["model-value","language","theme"])])):(I(),re(d,{key:1,id:"text-editor-component",class:R.normalizeClass([{"no-line-numbers":!e.showLineNumbers},"[&_.cm-content]:!font-(family-name:--oc-font-family)"]),"model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-highlight":"","no-echarts":"","on-upload-img":e.onUploadImg,language:e.languages[e.language.current]||"en-US",theme:e.theme,preview:e.isMarkdown,toolbars:e.toolbars,"auto-focus":"",onOnChange:t[1]||(t[1]=c=>e.$emit("update:currentContent",c))},{defToolbars:Z(()=>[J(u,{title:e.showLineNumbers?e.$gettext("hide line numbers"):e.$gettext("show line numbers"),onOnClick:t[0]||(t[0]=c=>e.showLineNumbers=!e.showLineNumbers)},{default:Z(()=>[J(l,{class:"!flex items-center justify-center size-6",size:"small",name:"hashtag","fill-type":"none"})]),_:1},8,["title"])]),_:1},8,["class","model-value","on-upload-img","language","theme","preview","toolbars"]))])}const DO=Object.freeze(Object.defineProperty({__proto__:null,default:Le(xO,[["render",RO]])},Symbol.toStringTag,{value:"Module"}));x.AVATAR_UPLOAD_MAX_FILE_SIZE_MB=vc,x.AccountCapabilitiesSchema=Cp,x.AccountSchema=Ap,x.AccountsSchema=Rp,x.ActionMenuDropItem=mg,x.ActionMenuItem=ia,x.ApiError=ZS,x.AppBar=QP,x.AppLoadingSpinner=kc,x.AppProviderService=qS,x.AppTopBar=yg,x.AppWrapper=Cg,x.AppWrapperRoute=HI,x.ArchiverService=t0,x.Auth=Sl,x.AvatarUpload=cF,x.BatchActions=hg,x.Cache=nf,x.ClientService=c0,x.ClipboardActions=Zo,x.CompareSaveDialog=$$,x.ConflictDialog=Ha,x.ContextActionMenu=aa,x.ContextActions=gg,x.ContextMenuQuickAction=_c,x.CreateLinkModal=km,x.CreateShortcutModal=Em,x.CreateSpace=XP,x.CustomComponentTarget=M$,x.DateFilter=KF,x.DatePickerModal=EI,x.EVENT_FILE_DROPPED=IR,x.EVENT_TROW_CONTEXTMENU=FR,x.EVENT_TROW_MOUNTED=PR,x.EmojiPickerModal=Zm,x.EventBus=ff,x.FileInfo=Lc,x.FilePickerModal=Im,x.FileSideBar=Sg,x.FolderLoaderFavorites=Ff,x.FolderLoaderSharedViaLink=$f,x.FolderLoaderSharedWithMe=Of,x.FolderLoaderSharedWithOthers=Lf,x.FolderLoaderSpace=If,x.FolderLoaderTrashbin=_f,x.FolderService=Mf,x.FolderViewModeConstants=Ft,x.HttpClient=Tl,x.IdentitySchema=xp,x.ImageDimension=bs,x.ImageType=$R,x.ItemFilter=z$,x.ItemFilterInline=YF,x.ItemFilterToggle=q$,x.Key=jn,x.LimitsSchema=Ep,x.LinkRoleDropdown=Tm,x.LoadingEventTopics=Sr,x.LoadingIndicator=K$,x.LoadingService=r1,x.MailCapabilitiesSchema=Tp,x.MimeTypesToAppsSchema=cf,x.Modifier=Li,x.NoContentMessage=Y$,x.Pagination=tO,x.PaginationConstants=Ao,x.PasswordPolicyService=tT,x.PortalTarget=aO,x.PortalTargetEventTopics=sa,x.PreviewService=K1,x.PrimaryAccountsSchema=Dp,x.ProcessorType=Ci,x.QuotaModal=Km,x.QuotaSelect=Qm,x.RESOURCE_MAX_CHARACTER_LENGTH=OR,x.RESOURCE_NAME_MAX_BYTES=yc,x.RawConfigSchema=AS,x.RawGroupwareConfigSchema=Mk,x.ResolveStrategy=Sn,x.ResourceConflictModal=fd,x.ResourceGhostElement=Mc,x.ResourceIcon=ws,x.ResourceLink=Xi,x.ResourceListItem=Ss,x.ResourceName=bc,x.ResourcePreview=Am,x.ResourceSize=xg,x.ResourceTable=vF,x.ResourceTile=Eg,x.ResourceTiles=$F,x.ResourceTransfer=hd,x.RuntimeError=fo,x.SaveAsModal=Lm,x.SearchBarFilter=iO,x.SearchLocationFilterConstants=jr,x.SideBar=wg,x.SideBarEventTopics=eh,x.SideBarPanels=bg,x.SieveCapabilitiesSchema=kp,x.SortConstants=Cs,x.SpaceDetails=m$,x.SpaceDetailsMultiple=b$,x.SpaceImageModal=Mm,x.SpaceInfo=Oc,x.SpaceMoveInfoModal=dd,x.SpaceNoSelection=C$,x.SpaceQuota=Rg,x.TextEditor=O$,x.ThemeConfig=DC,x.TransferType=Xn,x.UnsavedChangesModal=Tg,x.UppyService=aT,x.UserAvatar=la,x.VersionCheck=hO,x.ViewOptions=vg,x.VisibilityObserver=xm,x.WebDavDetails=Dg,x.WebThemeConfig=Jp,x.activeApp=pl,x.authContextValues=mS,x.blobToArrayBuffer=bp,x.breadcrumbsFromPath=Ek,x.buildRoutes=BC,x.buildUrl=vS,x.cacheService=wl,x.canvasToBlob=wp,x.cloneStateObject=cd,x.compareVersions=bl,x.concatBreadcrumbs=Rk,x.contextQueryToFileContextProps=oh,x.contextRouteNameKey=Pi,x.contextRouteParamsKey=zl,x.contextRouteQueryKey=Ul,x.convertToMinimalUppyFile=rp,x.createDefaultFileIconMapping=gd,x.createFileRouteOptions=_n,x.createFolderDummyFile=np,x.createLocation=ao,x.createLocationCommon=lo,x.createLocationPublic=co,x.createLocationShares=an,x.createLocationSpaces=kn,x.createLocationTrash=wr,x.defaultFuseOptions=Wa,x.defineWebApplication=zg,x.determineResourceTableSortFields=af,x.determineResourceTilesSortFields=jS,x.dirname=Ke.dirname,x.displayPositionedDropdown=Ml,x.encodePath=vl,x.eventBus=ze,x.filterResources=Hy,x.focusCheckbox=DS,x.folderService=Nf,x.formatDateFromDateTime=Mr,x.formatDateFromHTTP=Dk,x.formatDateFromISO=gp,x.formatDateFromJSDate=mp,x.formatDateFromRFC=Pk,x.formatFileSize=Ht,x.formatRelativeDateFromDateTime=es,x.formatRelativeDateFromHTTP=Ik,x.formatRelativeDateFromISO=Fk,x.formatRelativeDateFromJSDate=vp,x.formatRelativeDateFromRFC=$k,x.getIndicators=Lk,x.getLocaleFromLanguage=Ei,x.getParentPaths=yp,x.getSharedAncestorRoute=RS,x.getSharedDriveItem=pi,x.getSpacesByType=rs,x.getTextByteSize=Nl,x.isItemInCurrentFolder=vd,x.isLocationActive=MC,x.isLocationActiveDirector=io,x.isLocationCommonActive=bt,x.isLocationPublicActive=ln,x.isLocationSharesActive=mt,x.isLocationSpacesActive=st,x.isLocationTrashActive=qt,x.isMacOs=ts,x.isPromiseFulfilled=Nr,x.isPromiseRejected=Br,x.isResourceBeeingMovedToSameLocation=pd,x.isSameResource=Uo,x.locationPublicLink=dl,x.locationPublicUpload=fl,x.locationSharesViaLink=ul,x.locationSharesWithMe=di,x.locationSharesWithOthers=cl,x.locationSpacesGeneric=ll,x.objectKeys=e0,x.parseVersion=yl,x.queryItemAsString=at,x.renameResource=Qa,x.resolveFileNameDuplicate=wn,x.resourceIconMappingInjectionKey=md,x.routeToContextQuery=Ii,x.setCurrentUserShareSpacePermissions=rf,x.sortFields=lf,x.sortHelper=dg,x.sortSpaceMembers=Yp,x.translateSortFields=zS,x.triggerDownloadWithFilename=gl,x.useAbility=Bt,x.useActionsShowDetails=HD,x.useActiveApp=gS,x.useActiveLocation=xn,x.useAppConfig=Zd,x.useAppDefaults=dh,x.useAppFileHandling=Vl,x.useAppFolderHandling=ih,x.useAppMeta=Wl,x.useAppNavigation=sh,x.useAppProviderService=QD,x.useAppsStore=Mn,x.useArchiverService=Rm,x.useAuthService=ql,x.useAuthStore=Lr,x.useAvatarsStore=fi,x.useBreadcrumbsFromPath=KD,x.useCanBeOpenedWithSecureView=rg,x.useCanListShares=Bm,x.useCanListVersions=og,x.useCanShare=jm,x.useCapabilityStore=Dt,x.useClientService=Pe,x.useClipboardStore=ns,x.useConfigStore=Ge,x.useCopyLink=gc,x.useCreateSpace=go,x.useCropperKeyboardActions=Ql,x.useDeleteWorker=fh,x.useDocumentTitle=ah,x.useDownloadFile=Sc,x.useDriveResolver=uh,x.useEmbedMode=Tr,x.useEventBus=rr,x.useExtensionPreferencesStore=Sp,x.useExtensionRegistry=ho,x.useFileActionFallbackToDownload=Um,x.useFileActions=An,x.useFileActionsCopy=Oi,x.useFileActionsCopyPermanentLink=Kl,x.useFileActionsCreateLink=ER,x.useFileActionsCreateNewFile=RR,x.useFileActionsCreateNewFolder=DR,x.useFileActionsCreateNewShortcut=sD,x.useFileActionsCreateSpaceFromResource=wc,x.useFileActionsDelete=Ts,x.useFileActionsDeleteResources=Vm,x.useFileActionsDisableSync=Yi,x.useFileActionsDownloadArchive=Zi,x.useFileActionsDownloadFile=xo,x.useFileActionsEmptyTrashBin=iD,x.useFileActionsEnableSync=ea,x.useFileActionsFavorite=Tc,x.useFileActionsMove=ta,x.useFileActionsNavigate=Dm,x.useFileActionsOpenShortcut=lD,x.useFileActionsOpenWithApp=$m,x.useFileActionsOpenWithDefault=Pm,x.useFileActionsPaste=Om,x.useFileActionsRename=na,x.useFileActionsRestore=ks,x.useFileActionsSaveAs=_m,x.useFileActionsSetImage=Nm,x.useFileActionsShowActions=xD,x.useFileActionsShowDetails=Cc,x.useFileActionsShowShares=xc,x.useFileActionsToggleHideShare=ra,x.useFileActionsUndoDelete=zm,x.useFileListHeaderPosition=GD,x.useFileRouteReplace=Ri,x.useFolderLink=Cr,x.useGetMatchingSpace=It,x.useGetResourceContext=sg,x.useGroupwareConfigStore=_k,x.useInterceptModifierClick=zr,x.useIsAppActive=AD,x.useIsFilesAppActive=lr,x.useIsResourceNameValid=Qr,x.useIsSearchActive=oa,x.useIsTopBarSticky=Ac,x.useKeyboardActions=_i,x.useLinkTypes=Ji,x.useLoadAvatars=pg,x.useLoadPreview=Rc,x.useLoadingService=Ut,x.useLocalStorage=Bl,x.useMessages=Me,x.useModals=Je,x.useOpenEmptyEditor=WD,x.useOpenWithDefaultApp=Jm,x.usePagination=JD,x.usePasswordPolicyService=tg,x.usePasteWorker=ph,x.usePortalTarget=ZD,x.usePreviewService=ng,x.useRequest=lh,x.useRequestHeaders=$i,x.useResourceContents=ag,x.useResourceIndicators=Dc,x.useResourceRouteResolver=Fm,x.useResourceViewContextMenu=lg,x.useResourceViewDrag=cg,x.useResourceViewHelpers=Pc,x.useResourceViewSelection=ug,x.useResourcesStore=De,x.useRestoreWorker=hh,x.useRoute=St,x.useRouteMeta=nh,x.useRouteName=jl,x.useRouteParam=Di,x.useRouteQuery=Pt,x.useRouteQueryPersisted=nr,x.useRouter=Re,x.useScrollTo=Cm,x.useSearch=Hl,x.useSelectedResources=Ic,x.useService=er,x.useSharesStore=tr,x.useSideBar=_t,x.useSort=sP,x.useSpaceActionsDelete=qm,x.useSpaceActionsDeleteImage=qD,x.useSpaceActionsDisable=Hm,x.useSpaceActionsDuplicate=Wm,x.useSpaceActionsEditDescription=RD,x.useSpaceActionsEditQuota=Gm,x.useSpaceActionsEditReadmeContent=ND,x.useSpaceActionsNavigateToTrash=jD,x.useSpaceActionsRename=Xm,x.useSpaceActionsRestore=Ym,x.useSpaceActionsSetIcon=VD,x.useSpaceActionsShowMembers=BD,x.useSpaceHelpers=Fi,x.useSpacesLoading=ch,x.useSpacesStore=He,x.useThemeStore=Bn,x.useTileSize=ig,x.useTokenTimerWorker=qC,x.useUpdatesStore=th,x.useUpload=uP,x.useUserStore=et,x.useViewMode=nP,x.useViewSize=rP,x.useViewSizeMax=Ec,x.useWebWorkersStore=ss,x.useWindowOpen=eg,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})}));
16
+ `;t("update:currentContent",h)},showLineNumbers:s}}}),x$={id:"text-editor-container",class:"h-full [&_.md-editor-preview]:!font-(family-name:--oc-font-family)"},A$={key:0};function R$(e,t,n,r,s,o){const i=te("md-preview"),l=te("oc-icon"),u=te("NormalToolbar"),d=te("md-editor");return D(),K("div",x$,[e.isReadOnly?(D(),K("article",A$,[Q(i,{id:"text-editor-preview-component","model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-upload-img":"","no-highlight":"","no-echarts":"",language:e.languages[e.language.current]||"en-US",theme:e.theme,"auto-focus":"","read-only":""},null,8,["model-value","language","theme"])])):(D(),ee(d,{key:1,id:"text-editor-component",class:R.normalizeClass([{"no-line-numbers":!e.showLineNumbers},"[&_.cm-content]:!font-(family-name:--oc-font-family)"]),"model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-highlight":"","no-echarts":"","on-upload-img":e.onUploadImg,language:e.languages[e.language.current]||"en-US",theme:e.theme,preview:e.isMarkdown,toolbars:e.toolbars,"auto-focus":"",onOnChange:t[1]||(t[1]=c=>e.$emit("update:currentContent",c))},{defToolbars:X(()=>[Q(u,{title:e.showLineNumbers?e.$gettext("hide line numbers"):e.$gettext("show line numbers"),onOnClick:t[0]||(t[0]=c=>e.showLineNumbers=!e.showLineNumbers)},{default:X(()=>[Q(l,{class:"!flex items-center justify-center size-6",size:"small",name:"hashtag","fill-type":"none"})]),_:1},8,["title"])]),_:1},8,["class","model-value","on-upload-img","language","theme","preview","toolbars"]))])}const E$=Object.freeze(Object.defineProperty({__proto__:null,default:Le(T$,[["render",R$]])},Symbol.toStringTag,{value:"Module"}));x.AVATAR_UPLOAD_MAX_FILE_SIZE_MB=Yl,x.AccountCapabilitiesSchema=kp,x.AccountSchema=Tp,x.AccountsSchema=Ap,x.ActionMenuDropItem=Gm,x.ActionMenuItem=ea,x.ApiError=QS,x.AppBar=YD,x.AppLoadingSpinner=sc,x.AppProviderService=NS,x.AppTopBar=Zm,x.AppWrapper=og,x.AppWrapperRoute=WF,x.ArchiverService=GS,x.Auth=ml,x.AvatarUpload=uI,x.BatchActions=Km,x.Cache=Zd,x.ClientService=r0,x.ClipboardActions=Js,x.CompareSaveDialog=_P,x.ConflictDialog=Ba,x.ContextActionMenu=ta,x.ContextActions=Jm,x.ContextMenuQuickAction=yc,x.CreateLinkModal=em,x.CreateShortcutModal=sm,x.CustomComponentTarget=dg,x.DateFilter=GI,x.DatePickerModal=EF,x.EmojiPickerModal=Fm,x.EventBus=cf,x.FileInfo=mc,x.FilePickerModal=lm,x.FileSideBar=ng,x.FolderLoaderFavorites=Df,x.FolderLoaderSharedViaLink=Ff,x.FolderLoaderSharedWithMe=If,x.FolderLoaderSharedWithOthers=Pf,x.FolderLoaderSpace=Ef,x.FolderLoaderTrashbin=$f,x.FolderService=Of,x.FolderViewModeConstants=Et,x.HttpClient=gl,x.IdentitySchema=Cp,x.ImageDimension=fo,x.ImageType=PR,x.ItemFilter=zP,x.ItemFilterInline=ZI,x.ItemFilterToggle=qP,x.Key=Ln,x.LimitsSchema=xp,x.LinkRoleDropdown=Zh,x.LoadingEventTopics=vr,x.LoadingIndicator=KP,x.LoadingService=X0,x.MailCapabilitiesSchema=wp,x.MimeTypesToAppsSchema=of,x.MobileNav=Ym,x.Modifier=Fi,x.NoContentMessage=YP,x.Pagination=t$,x.PaginationConstants=Ss,x.PasswordPolicyService=G1,x.PreviewService=V1,x.PrimaryAccountsSchema=Rp,x.ProcessorType=bi,x.QuotaModal=xm,x.QuotaSelect=Tm,x.RESOURCE_MAX_CHARACTER_LENGTH=$R,x.RESOURCE_NAME_MAX_BYTES=Zl,x.RawConfigSchema=wS,x.RawGroupwareConfigSchema=IC,x.ResolveStrategy=hn,x.ResourceConflictModal=ld,x.ResourceGhostElement=vc,x.ResourceIcon=po,x.ResourceLink=Wi,x.ResourceListItem=ho,x.ResourceName=ec,x.ResourcePreview=rm,x.ResourceSize=ig,x.ResourceTable=vI,x.ResourceTile=lg,x.ResourceTiles=OI,x.ResourceTransfer=ud,x.RuntimeError=fs,x.SaveAsModal=fm,x.SearchBarFilter=i$,x.SearchLocationFilterConstants=zr,x.SideBar=tg,x.SideBarPanels=eg,x.SieveCapabilitiesSchema=Sp,x.SortConstants=yo,x.SpaceDetails=yP,x.SpaceDetailsMultiple=SP,x.SpaceImageModal=hm,x.SpaceInfo=hc,x.SpaceMoveInfoModal=ad,x.SpaceNoSelection=RP,x.SpaceQuota=cg,x.TextEditor=MP,x.ThemeConfig=CT,x.TransferType=Wn,x.UnsavedChangesModal=rg,x.UppyService=tk,x.UserAvatar=na,x.VersionCheck=p$,x.ViewOptions=Xm,x.VisibilityObserver=nm,x.WebDavDetails=ug,x.WebThemeConfig=Kp,x.activeApp=al,x.authContextValues=uS,x.blobToArrayBuffer=gp,x.breadcrumbsFromPath=SC,x.buildRoutes=$T,x.buildUrl=dS,x.cacheService=hl,x.canvasToBlob=yp,x.cloneStateObject=od,x.compareVersions=pl,x.concatBreadcrumbs=kC,x.contextQueryToFileContextProps=th,x.contextRouteNameKey=xi,x.contextRouteParamsKey=$l,x.contextRouteQueryKey=Ol,x.convertToMinimalUppyFile=ep,x.createDefaultFileIconMapping=fd,x.createFileRouteOptions=In,x.createFolderDummyFile=Zf,x.createLocation=ls,x.createLocationCommon=cs,x.createLocationPublic=us,x.createLocationShares=tn,x.createLocationSpaces=gn,x.createLocationTrash=gr,x.defaultFuseOptions=ja,x.defineWebApplication=Ag,x.determineResourceTableSortFields=rf,x.determineResourceTilesSortFields=OS,x.dirname=We.dirname,x.encodePath=dl,x.eventBus=Xe,x.extensionPoints=lP,x.fileSideBarSpaceDetailsTableExtensionPoint=bc,x.filterResources=jv,x.focusCheckbox=CS,x.folderService=Lf,x.formatDateFromDateTime=Nr,x.formatDateFromHTTP=CC,x.formatDateFromISO=pp,x.formatDateFromJSDate=fp,x.formatDateFromRFC=TC,x.formatFileSize=zt,x.formatRelativeDateFromDateTime=Xs,x.formatRelativeDateFromHTTP=xC,x.formatRelativeDateFromISO=AC,x.formatRelativeDateFromJSDate=hp,x.formatRelativeDateFromRFC=RC,x.getBackendVersion=vp,x.getExtensionNavItems=Pm,x.getLocaleFromLanguage=ki,x.getParentPaths=mp,x.getSharedAncestorRoute=kS,x.getSharedDriveItem=li,x.getSpacesByType=eo,x.getTextByteSize=Fl,x.getWebVersion=DC,x.isItemInCurrentFolder=pd,x.isLocationActive=IT,x.isLocationActiveDirector=as,x.isLocationCommonActive=mt,x.isLocationPublicActive=nn,x.isLocationSharesActive=pt,x.isLocationSpacesActive=rt,x.isLocationTrashActive=jt,x.isMacOs=Ys,x.isPromiseFulfilled=Br,x.isPromiseRejected=jr,x.isResourceBeeingMovedToSameLocation=cd,x.isSameResource=Bs,x.locationPublicLink=ol,x.locationPublicUpload=il,x.locationSharesViaLink=sl,x.locationSharesWithMe=ii,x.locationSharesWithOthers=rl,x.locationSpacesGeneric=nl,x.objectKeys=KS,x.parseVersion=fl,x.queryItemAsString=ot,x.renameResource=za,x.resolveFileNameDuplicate=pn,x.resourceIconMappingInjectionKey=dd,x.routeToContextQuery=Ai,x.setCurrentUserShareSpacePermissions=ef,x.sortFields=sf,x.sortHelper=Hm,x.sortSpaceMembers=Jp,x.translateSortFields=LS,x.triggerDownloadWithFilename=ul,x.useAbility=Lt,x.useActionsShowDetails=HE,x.useActiveApp=Jd,x.useActiveLocation=vn,x.useAppConfig=Gd,x.useAppDefaults=lh,x.useAppFileHandling=Ll,x.useAppFolderHandling=rh,x.useAppMeta=Nl,x.useAppNavigation=nh,x.useAppProviderService=QE,x.useAppsStore=Pn,x.useArchiverService=om,x.useAuthService=_l,x.useAuthStore=yr,x.useAvatarsStore=ai,x.useBreadcrumbsFromPath=KE,x.useCanBeOpenedWithSecureView=_m,x.useCanListShares=gm,x.useCanListVersions=Mm,x.useCanShare=ym,x.useCapabilityStore=Ct,x.useClientService=Ee,x.useClipboardStore=Zs,x.useConfigStore=Qe,x.useCopyLink=Xl,x.useCreateSpace=ms,x.useCropperKeyboardActions=Bl,x.useDeleteWorker=ch,x.useDocumentTitle=sh,x.useDownloadFile=nc,x.useDriveResolver=ah,x.useEmbedMode=wr,x.useEventBus=Sr,x.useExtensionPreferencesStore=bp,x.useExtensionRegistry=br,x.useFileActionFallbackToDownload=bm,x.useFileActions=bn,x.useFileActionsCopy=Di,x.useFileActionsCopyPermanentLink=jl,x.useFileActionsCreateLink=DR,x.useFileActionsCreateNewFile=FR,x.useFileActionsCreateNewFolder=IR,x.useFileActionsCreateNewShortcut=sE,x.useFileActionsCreateSpaceFromResource=tc,x.useFileActionsDelete=mo,x.useFileActionsDeleteResources=wm,x.useFileActionsDisableSync=Qi,x.useFileActionsDownloadArchive=Ki,x.useFileActionsDownloadFile=ws,x.useFileActionsEmptyTrashBin=oE,x.useFileActionsEnableSync=Gi,x.useFileActionsFavorite=rc,x.useFileActionsMove=Ji,x.useFileActionsNavigate=im,x.useFileActionsOpenShortcut=aE,x.useFileActionsOpenWithApp=um,x.useFileActionsOpenWithDefault=am,x.useFileActionsPaste=dm,x.useFileActionsRename=Xi,x.useFileActionsRestore=go,x.useFileActionsSaveAs=pm,x.useFileActionsSetImage=mm,x.useFileActionsShowActions=TE,x.useFileActionsShowDetails=oc,x.useFileActionsShowShares=ic,x.useFileActionsToggleHideShare=Yi,x.useFileActionsUndoDelete=vm,x.useFileListHeaderPosition=GE,x.useFileRouteReplace=Ci,x.useFolderLink=Tr,x.useGetMatchingSpace=Rt,x.useGetResourceContext=Nm,x.useGroupwareConfigStore=FC,x.useInterceptModifierClick=Vr,x.useIsAppActive=xE,x.useIsFilesAppActive=rr,x.useIsResourceNameValid=Wr,x.useIsSearchActive=Zi,x.useIsTopBarSticky=ac,x.useKeyboardActions=Ii,x.useLinkTypes=Hi,x.useLoadAvatars=Qm,x.useLoadPreview=cc,x.useLoadingService=Nt,x.useLocalStorage=Il,x.useMessages=Me,x.useModals=Ke,x.useNavItems=$m,x.useOpenEmptyEditor=WE,x.useOpenWithDefaultApp=Rm,x.usePagination=JE,x.usePasswordPolicyService=Om,x.usePasteWorker=uh,x.usePreviewService=Lm,x.useRequest=oh,x.useRequestHeaders=Ei,x.useResourceContents=jm,x.useResourceIndicators=zm,x.useResourceRouteResolver=cm,x.useResourceViewContextMenu=Vm,x.useResourceViewDrag=Um,x.useResourceViewHelpers=uc,x.useResourceViewSelection=qm,x.useResourcesStore=Re,x.useRestoreWorker=dh,x.useRoute=yt,x.useRouteMeta=Zp,x.useRouteName=Pl,x.useRouteParam=Ti,x.useRouteQuery=At,x.useRouteQueryPersisted=Xn,x.useRouter=Ae,x.useScrollTo=tm,x.useSearch=Ml,x.useSelectedResources=dc,x.useService=Gn,x.useSharesStore=Jn,x.useSideBar=Pt,x.useSort=sD,x.useSpaceActionsCreate=qE,x.useSpaceActionsDelete=Sm,x.useSpaceActionsDeleteImage=UE,x.useSpaceActionsDisable=km,x.useSpaceActionsDuplicate=Cm,x.useSpaceActionsEditDescription=RE,x.useSpaceActionsEditQuota=Am,x.useSpaceActionsEditReadmeContent=ME,x.useSpaceActionsNavigateToTrash=BE,x.useSpaceActionsRename=Em,x.useSpaceActionsRestore=Dm,x.useSpaceActionsSetIcon=VE,x.useSpaceActionsShowMembers=NE,x.useSpaceHelpers=Ri,x.useSpacesLoading=ih,x.useSpacesStore=Ue,x.useThemeStore=On,x.useTileSize=Bm,x.useTokenTimerWorker=NT,x.useUpdatesStore=Yp,x.useUpload=cD,x.useUserStore=Ze,x.useViewMode=tD,x.useViewSize=nD,x.useViewSizeMax=lc,x.useWebWorkersStore=no,x.useWindowOpen=Im,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})}));