@opencloud-eu/web-pkg 5.0.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 (70) hide show
  1. package/dist/{TextEditor-CJgYG8Kl.js → TextEditor-D-HQDUkm.js} +3 -5
  2. package/dist/assets/worker-CVwKToFD.js +21 -0
  3. package/dist/assets/worker-DJbU-qfq.js +21 -0
  4. package/dist/assets/worker-DyU7W9CZ.js +21 -0
  5. package/dist/index-OU30YA6H.js +25032 -0
  6. package/dist/src/apps/types.d.ts +0 -3
  7. package/dist/src/components/AppBar/AppBar.vue.d.ts +2 -9
  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/FilesList/ResourceStatusIndicators.vue.d.ts +1 -1
  15. package/dist/src/components/FilesList/ResourceTable.vue.d.ts +0 -1
  16. package/dist/src/components/Filters/DateFilter.vue.d.ts +500 -0
  17. package/dist/src/components/Navigation/MobileNav.vue.d.ts +2 -0
  18. package/dist/src/components/Navigation/index.d.ts +1 -0
  19. package/dist/src/components/NoContentMessage.vue.d.ts +3 -2
  20. package/dist/src/components/SideBar/FileSideBar.vue.d.ts +4 -13
  21. package/dist/src/components/SideBar/SideBar.vue.d.ts +3 -9
  22. package/dist/src/components/SideBar/SideBarPanels.vue.d.ts +38 -0
  23. package/dist/src/components/SideBar/index.d.ts +1 -0
  24. package/dist/src/components/index.d.ts +1 -1
  25. package/dist/src/composables/actions/files/index.d.ts +1 -0
  26. package/dist/src/composables/actions/files/useFileActionFallbackToDownload.d.ts +4 -0
  27. package/dist/src/composables/actions/spaces/index.d.ts +1 -0
  28. package/dist/src/composables/actions/spaces/useSpaceActionsCreate.d.ts +7 -0
  29. package/dist/src/composables/folderLink/useFolderLink.d.ts +1 -1
  30. package/dist/src/composables/index.d.ts +1 -2
  31. package/dist/src/composables/navItems/index.d.ts +1 -0
  32. package/dist/src/composables/navItems/useNavItems.d.ts +13 -0
  33. package/dist/src/composables/piniaStores/auth.d.ts +8 -2
  34. package/dist/src/composables/piniaStores/avatars.d.ts +1 -1
  35. package/dist/src/composables/piniaStores/extensionRegistry/types.d.ts +14 -1
  36. package/dist/src/composables/piniaStores/index.d.ts +4 -3
  37. package/dist/src/composables/piniaStores/sideBar.d.ts +32 -0
  38. package/dist/src/composables/piniaStores/user.d.ts +1 -1
  39. package/dist/src/composables/resources/index.d.ts +1 -0
  40. package/dist/src/composables/resources/useResourceIndicators.d.ts +19 -0
  41. package/dist/src/composables/resources/useResourceViewContextMenu.d.ts +4 -3
  42. package/dist/src/composables/resources/useResourceViewHelpers.d.ts +2 -2
  43. package/dist/src/composables/spaces/useCreateSpace.d.ts +1 -0
  44. package/dist/src/constants.d.ts +0 -6
  45. package/dist/src/extensionPoints.d.ts +3 -0
  46. package/dist/src/helpers/filesize.d.ts +0 -7
  47. package/dist/src/helpers/index.d.ts +1 -2
  48. package/dist/src/helpers/versions.d.ts +5 -0
  49. package/dist/src/index.d.ts +1 -0
  50. package/dist/web-pkg.js +301 -300
  51. package/dist/web-pkg.umd.cjs +14 -66
  52. package/package.json +5 -7
  53. package/src/index.ts +1 -0
  54. package/dist/assets/worker-Bc2UmjVr.js +0 -40
  55. package/dist/assets/worker-BeDmEhWu.js +0 -40
  56. package/dist/assets/worker-DWoO7i6z.js +0 -40
  57. package/dist/index-D-EuklHo.js +0 -33782
  58. package/dist/src/components/AppBar/CreateSpace.vue.d.ts +0 -18
  59. package/dist/src/components/PortalTarget.vue.d.ts +0 -41
  60. package/dist/src/components/TextEditor/TextEditor.vue.d.ts +0 -165
  61. package/dist/src/components/TextEditor/index.d.ts +0 -161
  62. package/dist/src/composables/portalTarget/eventTopics.d.ts +0 -3
  63. package/dist/src/composables/portalTarget/index.d.ts +0 -2
  64. package/dist/src/composables/portalTarget/usePortalTarget.d.ts +0 -4
  65. package/dist/src/composables/sideBar/eventTopics.d.ts +0 -7
  66. package/dist/src/composables/sideBar/index.d.ts +0 -2
  67. package/dist/src/composables/sideBar/useSideBar.d.ts +0 -12
  68. package/dist/src/helpers/contextMenuDropdown.d.ts +0 -7
  69. package/dist/src/helpers/statusIndicators.d.ts +0 -23
  70. package/dist/src/services/passwordPolicy/rules.d.ts +0 -69
@@ -1,68 +1,16 @@
1
- (function($,re){typeof exports=="object"&&typeof module<"u"?re(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"],re):($=typeof globalThis<"u"?globalThis:$||self,re($["web-pkg"]={},$.webClient,$.vue,$.vue3Gettext,$.Fuse,$.lodashEs,$.globalAxios,$.uuid,$.fetchEventSource,$.vueConcurrency,$.luxon,$.filesize,$.qs,$.passwordSheriff,$.Uppy,$.Tus,$.XHRUpload,$.utils,$.pinia,$.oidcClientTs,$.core,$.merge$1,$.portalVue,$.DOMPurify,$.Mark,$.PQueue,$.Cropper,$.vueRouter,$.shared,$.mdEditorV3,$.zod,$.vue$1,$.screenfull,$.view))})(this,(function($,re,wS,Ie,zd,Tt,us,Xt,SS,rn,Ut,ES,TS,AS,Wd,xS,RS,Hd,Me,CS,Yn,Kd,fs,Gd,Qd,Lr,il,ds,z,oo,de,kS,PS,IS){"use strict";const OS=e=>e;function Xd(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function FS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yd={exports:{}},Nt=Yd.exports={},Jn,Zn;function ol(){throw new Error("setTimeout has not been defined")}function sl(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Jn=setTimeout:Jn=ol}catch{Jn=ol}try{typeof clearTimeout=="function"?Zn=clearTimeout:Zn=sl}catch{Zn=sl}})();function Jd(e){if(Jn===setTimeout)return setTimeout(e,0);if((Jn===ol||!Jn)&&setTimeout)return Jn=setTimeout,setTimeout(e,0);try{return Jn(e,0)}catch{try{return Jn.call(null,e,0)}catch{return Jn.call(this,e,0)}}}function _S(e){if(Zn===clearTimeout)return clearTimeout(e);if((Zn===sl||!Zn)&&clearTimeout)return Zn=clearTimeout,clearTimeout(e);try{return Zn(e)}catch{try{return Zn.call(null,e)}catch{return Zn.call(this,e)}}}var mr=[],Ti=!1,Jr,ps=-1;function DS(){!Ti||!Jr||(Ti=!1,Jr.length?mr=Jr.concat(mr):ps=-1,mr.length&&Zd())}function Zd(){if(!Ti){var e=Jd(DS);Ti=!0;for(var t=mr.length;t;){for(Jr=mr,mr=[];++ps<t;)Jr&&Jr[ps].run();ps=-1,t=mr.length}Jr=null,Ti=!1,_S(e)}}Nt.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];mr.push(new ep(e,t)),mr.length===1&&!Ti&&Jd(Zd)};function ep(e,t){this.fun=e,this.array=t}ep.prototype.run=function(){this.fun.apply(null,this.array)},Nt.title="browser",Nt.browser=!0,Nt.env={},Nt.argv=[],Nt.version="",Nt.versions={};function gr(){}Nt.on=gr,Nt.addListener=gr,Nt.once=gr,Nt.off=gr,Nt.removeListener=gr,Nt.removeAllListeners=gr,Nt.emit=gr,Nt.prependListener=gr,Nt.prependOnceListener=gr,Nt.listeners=function(e){return[]},Nt.binding=function(e){throw new Error("process.binding is not supported")},Nt.cwd=function(){return"/"},Nt.chdir=function(e){throw new Error("process.chdir is not supported")},Nt.umask=function(){return 0};var NS=Yd.exports;const be=FS(NS);function er(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let ut;const al=new WeakSet;class LS{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,al.has(this)&&(al.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||np(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ap(this),rp(this);const t=ut,n=Un;ut=this,Un=!0;try{return this.fn()}finally{be.env.NODE_ENV!=="production"&&ut!==this&&er("Active effect was not restored correctly - this is likely a Vue internal bug."),ip(this),ut=t,Un=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)fl(t);this.deps=this.depsTail=void 0,ap(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?al.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ul(this)&&this.run()}get dirty(){return ul(this)}}let tp=0,so,ao;function np(e,t=!1){if(e.flags|=8,t){e.next=ao,ao=e;return}e.next=so,so=e}function ll(){tp++}function cl(){if(--tp>0)return;if(ao){let t=ao;for(ao=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;so;){let t=so;for(so=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 rp(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ip(e){let t,n=e.depsTail,r=n;for(;r;){const i=r.prevDep;r.version===-1?(r===n&&(n=i),fl(r),$S(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function ul(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(op(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function op(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===lo)||(e.globalVersion=lo,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ul(e))))return;e.flags|=2;const t=e.dep,n=ut,r=Un;ut=e,Un=!0;try{rp(e);const i=e.fn(e._value);(t.version===0||z.hasChanged(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{ut=n,Un=r,ip(e),e.flags&=-3}}function fl(e,t=!1){const{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),be.env.NODE_ENV!=="production"&&n.subsHead===e&&(n.subsHead=i),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)fl(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function $S(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 sp=[];function Ai(){sp.push(Un),Un=!1}function xi(){const e=sp.pop();Un=e===void 0?!0:e}function ap(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ut;ut=void 0;try{t()}finally{ut=n}}}let lo=0;class MS{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 hs{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,be.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){if(!ut||!Un||ut===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ut)n=this.activeLink=new MS(ut,this),ut.deps?(n.prevDep=ut.depsTail,ut.depsTail.nextDep=n,ut.depsTail=n):ut.deps=ut.depsTail=n,lp(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=ut.depsTail,n.nextDep=void 0,ut.depsTail.nextDep=n,ut.depsTail=n,ut.deps===n&&(ut.deps=r)}return be.env.NODE_ENV!=="production"&&ut.onTrack&&ut.onTrack(z.extend({effect:ut},t)),n}trigger(t){this.version++,lo++,this.notify(t)}notify(t){ll();try{if(be.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(z.extend({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{cl()}}}function lp(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)lp(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),be.env.NODE_ENV!=="production"&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}const ms=new WeakMap,Zr=Symbol(be.env.NODE_ENV!=="production"?"Object iterate":""),dl=Symbol(be.env.NODE_ENV!=="production"?"Map keys iterate":""),co=Symbol(be.env.NODE_ENV!=="production"?"Array iterate":"");function Jt(e,t,n){if(Un&&ut){let r=ms.get(e);r||ms.set(e,r=new Map);let i=r.get(n);i||(r.set(n,i=new hs),i.map=r,i.key=n),be.env.NODE_ENV!=="production"?i.track({target:e,type:t,key:n}):i.track()}}function $r(e,t,n,r,i,o){const s=ms.get(e);if(!s){lo++;return}const a=l=>{l&&(be.env.NODE_ENV!=="production"?l.trigger({target:e,type:t,key:n,newValue:r,oldValue:i,oldTarget:o}):l.trigger())};if(ll(),t==="clear")s.forEach(a);else{const l=z.isArray(e),u=l&&z.isIntegerKey(n);if(l&&n==="length"){const c=Number(r);s.forEach((p,d)=>{(d==="length"||d===co||!z.isSymbol(d)&&d>=c)&&a(p)})}else switch((n!==void 0||s.has(void 0))&&a(s.get(n)),u&&a(s.get(co)),t){case"add":l?u&&a(s.get("length")):(a(s.get(Zr)),z.isMap(e)&&a(s.get(dl)));break;case"delete":l||(a(s.get(Zr)),z.isMap(e)&&a(s.get(dl)));break;case"set":z.isMap(e)&&a(s.get(Zr));break}}cl()}function BS(e,t){const n=ms.get(e);return n&&n.get(t)}function Ri(e){const t=it(e);return t===e?t:(Jt(t,"iterate",co),on(e)?t:t.map(qn))}function gs(e){return Jt(e=it(e),"iterate",co),e}function Mr(e,t){return Vn(e)?Ci(Br(e)?qn(t):t):qn(t)}const jS={__proto__:null,[Symbol.iterator](){return pl(this,Symbol.iterator,e=>Mr(this,e))},concat(...e){return Ri(this).concat(...e.map(t=>z.isArray(t)?Ri(t):t))},entries(){return pl(this,"entries",e=>(e[1]=Mr(this,e[1]),e))},every(e,t){return yr(this,"every",e,t,void 0,arguments)},filter(e,t){return yr(this,"filter",e,t,n=>n.map(r=>Mr(this,r)),arguments)},find(e,t){return yr(this,"find",e,t,n=>Mr(this,n),arguments)},findIndex(e,t){return yr(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return yr(this,"findLast",e,t,n=>Mr(this,n),arguments)},findLastIndex(e,t){return yr(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return yr(this,"forEach",e,t,void 0,arguments)},includes(...e){return hl(this,"includes",e)},indexOf(...e){return hl(this,"indexOf",e)},join(e){return Ri(this).join(e)},lastIndexOf(...e){return hl(this,"lastIndexOf",e)},map(e,t){return yr(this,"map",e,t,void 0,arguments)},pop(){return uo(this,"pop")},push(...e){return uo(this,"push",e)},reduce(e,...t){return cp(this,"reduce",e,t)},reduceRight(e,...t){return cp(this,"reduceRight",e,t)},shift(){return uo(this,"shift")},some(e,t){return yr(this,"some",e,t,void 0,arguments)},splice(...e){return uo(this,"splice",e)},toReversed(){return Ri(this).toReversed()},toSorted(e){return Ri(this).toSorted(e)},toSpliced(...e){return Ri(this).toSpliced(...e)},unshift(...e){return uo(this,"unshift",e)},values(){return pl(this,"values",e=>Mr(this,e))}};function pl(e,t,n){const r=gs(e),i=r[t]();return r!==e&&!on(e)&&(i._next=i.next,i.next=()=>{const o=i._next();return o.done||(o.value=n(o.value)),o}),i}const US=Array.prototype;function yr(e,t,n,r,i,o){const s=gs(e),a=s!==e&&!on(e),l=s[t];if(l!==US[t]){const p=l.apply(e,o);return a?qn(p):p}let u=n;s!==e&&(a?u=function(p,d){return n.call(this,Mr(e,p),d,e)}:n.length>2&&(u=function(p,d){return n.call(this,p,d,e)}));const c=l.call(s,u,r);return a&&i?i(c):c}function cp(e,t,n,r){const i=gs(e);let o=n;return i!==e&&(on(e)?n.length>3&&(o=function(s,a,l){return n.call(this,s,a,l,e)}):o=function(s,a,l){return n.call(this,s,Mr(e,a),l,e)}),i[t](o,...r)}function hl(e,t,n){const r=it(e);Jt(r,"iterate",co);const i=r[t](...n);return(i===-1||i===!1)&&fo(n[0])?(n[0]=it(n[0]),r[t](...n)):i}function uo(e,t,n=[]){Ai(),ll();const r=it(e)[t].apply(e,n);return cl(),xi(),r}const VS=z.makeMap("__proto__,__v_isRef,__isVue"),up=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(z.isSymbol));function qS(e){z.isSymbol(e)||(e=String(e));const t=it(this);return Jt(t,"has",e),t.hasOwnProperty(e)}class fp{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const i=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(i?o?gp:mp:o?ZS:hp).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const s=z.isArray(t);if(!i){let l;if(s&&(l=jS[n]))return l;if(n==="hasOwnProperty")return qS}const a=Reflect.get(t,n,Ft(t)?t:r);if((z.isSymbol(n)?up.has(n):VS(n))||(i||Jt(t,"get",n),o))return a;if(Ft(a)){const l=s&&z.isIntegerKey(n)?a:a.value;return i&&z.isObject(l)?tr(l):l}return z.isObject(a)?i?tr(a):yl(a):a}}class zS extends fp{constructor(t=!1){super(!1,t)}set(t,n,r,i){let o=t[n];const s=z.isArray(t)&&z.isIntegerKey(n);if(!this._isShallow){const u=Vn(o);if(!on(r)&&!Vn(r)&&(o=it(o),r=it(r)),!s&&Ft(o)&&!Ft(r))return u?(be.env.NODE_ENV!=="production"&&er(`Set operation on key "${String(n)}" failed: target is readonly.`,t[n]),!0):(o.value=r,!0)}const a=s?Number(n)<t.length:z.hasOwn(t,n),l=Reflect.set(t,n,r,Ft(t)?t:i);return t===it(i)&&(a?z.hasChanged(r,o)&&$r(t,"set",n,r,o):$r(t,"add",n,r)),l}deleteProperty(t,n){const r=z.hasOwn(t,n),i=t[n],o=Reflect.deleteProperty(t,n);return o&&r&&$r(t,"delete",n,void 0,i),o}has(t,n){const r=Reflect.has(t,n);return(!z.isSymbol(n)||!up.has(n))&&Jt(t,"has",n),r}ownKeys(t){return Jt(t,"iterate",z.isArray(t)?"length":Zr),Reflect.ownKeys(t)}}class dp extends fp{constructor(t=!1){super(!0,t)}set(t,n){return be.env.NODE_ENV!=="production"&&er(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return be.env.NODE_ENV!=="production"&&er(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const WS=new zS,HS=new dp,KS=new dp(!0),ml=e=>e,ys=e=>Reflect.getPrototypeOf(e);function GS(e,t,n){return function(...r){const i=this.__v_raw,o=it(i),s=z.isMap(o),a=e==="entries"||e===Symbol.iterator&&s,l=e==="keys"&&s,u=i[e](...r),c=n?ml:t?Ci:qn;return!t&&Jt(o,"iterate",l?dl:Zr),z.extend(Object.create(u),{next(){const{value:p,done:d}=u.next();return d?{value:p,done:d}:{value:a?[c(p[0]),c(p[1])]:c(p),done:d}}})}}function vs(e){return function(...t){if(be.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";er(`${z.capitalize(e)} operation ${n}failed: target is readonly.`,it(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function QS(e,t){const n={get(i){const o=this.__v_raw,s=it(o),a=it(i);e||(z.hasChanged(i,a)&&Jt(s,"get",i),Jt(s,"get",a));const{has:l}=ys(s),u=t?ml:e?Ci:qn;if(l.call(s,i))return u(o.get(i));if(l.call(s,a))return u(o.get(a));o!==s&&o.get(i)},get size(){const i=this.__v_raw;return!e&&Jt(it(i),"iterate",Zr),i.size},has(i){const o=this.__v_raw,s=it(o),a=it(i);return e||(z.hasChanged(i,a)&&Jt(s,"has",i),Jt(s,"has",a)),i===a?o.has(i):o.has(i)||o.has(a)},forEach(i,o){const s=this,a=s.__v_raw,l=it(a),u=t?ml:e?Ci:qn;return!e&&Jt(l,"iterate",Zr),a.forEach((c,p)=>i.call(o,u(c),u(p),s))}};return z.extend(n,e?{add:vs("add"),set:vs("set"),delete:vs("delete"),clear:vs("clear")}:{add(i){!t&&!on(i)&&!Vn(i)&&(i=it(i));const o=it(this);return ys(o).has.call(o,i)||(o.add(i),$r(o,"add",i,i)),this},set(i,o){!t&&!on(o)&&!Vn(o)&&(o=it(o));const s=it(this),{has:a,get:l}=ys(s);let u=a.call(s,i);u?be.env.NODE_ENV!=="production"&&pp(s,a,i):(i=it(i),u=a.call(s,i));const c=l.call(s,i);return s.set(i,o),u?z.hasChanged(o,c)&&$r(s,"set",i,o,c):$r(s,"add",i,o),this},delete(i){const o=it(this),{has:s,get:a}=ys(o);let l=s.call(o,i);l?be.env.NODE_ENV!=="production"&&pp(o,s,i):(i=it(i),l=s.call(o,i));const u=a?a.call(o,i):void 0,c=o.delete(i);return l&&$r(o,"delete",i,void 0,u),c},clear(){const i=it(this),o=i.size!==0,s=be.env.NODE_ENV!=="production"?z.isMap(i)?new Map(i):new Set(i):void 0,a=i.clear();return o&&$r(i,"clear",void 0,void 0,s),a}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=GS(i,e,t)}),n}function gl(e,t){const n=QS(e,t);return(r,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?r:Reflect.get(z.hasOwn(n,i)&&i in r?n:r,i,o)}const XS={get:gl(!1,!1)},YS={get:gl(!0,!1)},JS={get:gl(!0,!0)};function pp(e,t,n){const r=it(n);if(r!==n&&t.call(e,r)){const i=z.toRawType(e);er(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="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 hp=new WeakMap,ZS=new WeakMap,mp=new WeakMap,gp=new WeakMap;function e1(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function t1(e){return e.__v_skip||!Object.isExtensible(e)?0:e1(z.toRawType(e))}function yl(e){return Vn(e)?e:vl(e,!1,WS,XS,hp)}function tr(e){return vl(e,!0,HS,YS,mp)}function bs(e){return vl(e,!0,KS,JS,gp)}function vl(e,t,n,r,i){if(!z.isObject(e))return be.env.NODE_ENV!=="production"&&er(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=t1(e);if(o===0)return e;const s=i.get(e);if(s)return s;const a=new Proxy(e,o===2?r:n);return i.set(e,a),a}function Br(e){return Vn(e)?Br(e.__v_raw):!!(e&&e.__v_isReactive)}function Vn(e){return!!(e&&e.__v_isReadonly)}function on(e){return!!(e&&e.__v_isShallow)}function fo(e){return e?!!e.__v_raw:!1}function it(e){const t=e&&e.__v_raw;return t?it(t):e}function yp(e){return!z.hasOwn(e,"__v_skip")&&Object.isExtensible(e)&&z.def(e,"__v_skip",!0),e}const qn=e=>z.isObject(e)?yl(e):e,Ci=e=>z.isObject(e)?tr(e):e;function Ft(e){return e?e.__v_isRef===!0:!1}function le(e){return vp(e,!1)}function n1(e){return vp(e,!0)}function vp(e,t){return Ft(e)?e:new r1(e,t)}class r1{constructor(t,n){this.dep=new hs,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:it(t),this._value=n?t:qn(t),this.__v_isShallow=n}get value(){return be.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||on(t)||Vn(t);t=r?t:it(t),z.hasChanged(t,n)&&(this._rawValue=t,this._value=r?t:qn(t),be.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:n}):this.dep.trigger())}}function f(e){return Ft(e)?e.value:e}const i1={get:(e,t,n)=>t==="__v_raw"?e:f(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const i=e[t];return Ft(i)&&!Ft(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function o1(e){return Br(e)?e:new Proxy(e,i1)}class s1{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new hs,{get:r,set:i}=t(n.track.bind(n),n.trigger.bind(n));this._get=r,this._set=i}get value(){return this._value=this._get()}set value(t){this._set(t)}}function a1(e){return new s1(e)}class l1{constructor(t,n,r){this._object=t,this._key=n,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0,this._raw=it(t);let i=!0,o=t;if(!z.isArray(t)||!z.isIntegerKey(String(n)))do i=!fo(o)||on(o);while(i&&(o=o.__v_raw));this._shallow=i}get value(){let t=this._object[this._key];return this._shallow&&(t=f(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 BS(this._raw,this._key)}}class c1{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 u1(e,t,n){return Ft(e)?e:z.isFunction(e)?new c1(e):z.isObject(e)&&arguments.length>1?f1(e,t,n):le(e)}function f1(e,t,n){return new l1(e,t,n)}class d1{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new hs(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=lo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ut!==this)return np(this,!0),!0;be.env.NODE_ENV}get value(){const t=be.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return op(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter?this.setter(t):be.env.NODE_ENV!=="production"&&er("Write operation failed: computed value is readonly")}}function p1(e,t,n=!1){let r,i;z.isFunction(e)?r=e:(r=e.get,i=e.set);const o=new d1(r,i,n);return be.env.NODE_ENV,o}const ws={},Ss=new WeakMap;let ei;function h1(e,t=!1,n=ei){if(n){let r=Ss.get(n);r||Ss.set(n,r=[]),r.push(e)}else be.env.NODE_ENV!=="production"&&!t&&er("onWatcherCleanup() was called when there was no active watcher to associate with.")}function m1(e,t,n=z.EMPTY_OBJ){const{immediate:r,deep:i,once:o,scheduler:s,augmentJob:a,call:l}=n,u=h=>{(n.onWarn||er)("Invalid watch source: ",h,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},c=h=>i?h:on(h)||i===!1||i===0?vr(h,1):vr(h);let p,d,m,b,w=!1,S=!1;if(Ft(e)?(d=()=>e.value,w=on(e)):Br(e)?(d=()=>c(e),w=!0):z.isArray(e)?(S=!0,w=e.some(h=>Br(h)||on(h)),d=()=>e.map(h=>{if(Ft(h))return h.value;if(Br(h))return c(h);if(z.isFunction(h))return l?l(h,2):h();be.env.NODE_ENV!=="production"&&u(h)})):z.isFunction(e)?t?d=l?()=>l(e,2):e:d=()=>{if(m){Ai();try{m()}finally{xi()}}const h=ei;ei=p;try{return l?l(e,3,[b]):e(b)}finally{ei=h}}:(d=z.NOOP,be.env.NODE_ENV!=="production"&&u(e)),t&&i){const h=d,E=i===!0?1/0:i;d=()=>vr(h(),E)}const y=()=>{p.stop()};if(o&&t){const h=t;t=(...E)=>{h(...E),y()}}let g=S?new Array(e.length).fill(ws):ws;const v=h=>{if(!(!(p.flags&1)||!p.dirty&&!h))if(t){const E=p.run();if(i||w||(S?E.some((T,R)=>z.hasChanged(T,g[R])):z.hasChanged(E,g))){m&&m();const T=ei;ei=p;try{const R=[E,g===ws?void 0:S&&g[0]===ws?[]:g,b];g=E,l?l(t,3,R):t(...R)}finally{ei=T}}}else p.run()};return a&&a(v),p=new LS(d),p.scheduler=s?()=>s(v,!1):v,b=h=>h1(h,!1,p),m=p.onStop=()=>{const h=Ss.get(p);if(h){if(l)l(h,4);else for(const E of h)E();Ss.delete(p)}},be.env.NODE_ENV!=="production"&&(p.onTrack=n.onTrack,p.onTrigger=n.onTrigger),t?r?v(!0):g=p.run():s?s(v.bind(null,!0),!0):p.run(),y.pause=p.pause.bind(p),y.resume=p.resume.bind(p),y.stop=y,y}function vr(e,t=1/0,n){if(t<=0||!z.isObject(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Ft(e))vr(e.value,t,n);else if(z.isArray(e))for(let r=0;r<e.length;r++)vr(e[r],t,n);else if(z.isSet(e)||z.isMap(e))e.forEach(r=>{vr(r,t,n)});else if(z.isPlainObject(e)){for(const r in e)vr(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&vr(e[r],t,n)}return e}const ti=[];function g1(e){ti.push(e)}function y1(){ti.pop()}let bl=!1;function tt(e,...t){if(bl)return;bl=!0,Ai();const n=ti.length?ti[ti.length-1].component:null,r=n&&n.appContext.config.warnHandler,i=v1();if(r)Es(r,n,11,[e+t.map(o=>{var s,a;return(a=(s=o.toString)==null?void 0:s.call(o))!=null?a:JSON.stringify(o)}).join(""),n&&n.proxy,i.map(({vnode:o})=>`at <${oh(n,o.type)}>`).join(`
2
- `),i]);else{const o=[`[Vue warn]: ${e}`,...t];i.length&&o.push(`
3
- `,...b1(i)),console.warn(...o)}xi(),bl=!1}function v1(){let e=ti[ti.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 b1(e){const t=[];return e.forEach((n,r)=>{t.push(...r===0?[]:[`
4
- `],...w1(n))}),t}function w1({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",r=e.component?e.component.parent==null:!1,i=` at <${oh(e.component,e.type,r)}`,o=">"+n;return e.props?[i,...S1(e.props),o]:[i+o]}function S1(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(r=>{t.push(...bp(r,e[r]))}),n.length>3&&t.push(" ..."),t}function bp(e,t,n){return z.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=bp(e,it(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):z.isFunction(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=it(t),n?t:[`${e}=`,t])}const wl={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 Es(e,t,n,r){try{return r?e(...r):e()}catch(i){Ts(i,t,n)}}function Sl(e,t,n,r){if(z.isFunction(e)){const i=Es(e,t,n,r);return i&&z.isPromise(i)&&i.catch(o=>{Ts(o,t,n)}),i}if(z.isArray(e)){const i=[];for(let o=0;o<e.length;o++)i.push(Sl(e[o],t,n,r));return i}else be.env.NODE_ENV!=="production"&&tt(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function Ts(e,t,n,r=!0){const i=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||z.EMPTY_OBJ;if(t){let a=t.parent;const l=t.proxy,u=be.env.NODE_ENV!=="production"?wl[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let p=0;p<c.length;p++)if(c[p](e,l,u)===!1)return}a=a.parent}if(o){Ai(),Es(o,null,10,[e,l,u]),xi();return}}E1(e,n,i,r,s)}function E1(e,t,n,r=!0,i=!1){if(be.env.NODE_ENV!=="production"){const o=wl[t];if(n&&g1(n),tt(`Unhandled error${o?` during execution of ${o}`:""}`),n&&y1(),r)throw e;console.error(e)}else{if(i)throw e;console.error(e)}}const kn=[];let br=-1;const ki=[];let jr=null,Pi=0;const wp=Promise.resolve();let As=null;const T1=100;function zt(e){const t=As||wp;return e?t.then(this?e.bind(this):e):t}function A1(e){let t=br+1,n=kn.length;for(;t<n;){const r=t+n>>>1,i=kn[r],o=po(i);o<e||o===e&&i.flags&2?t=r+1:n=r}return t}function El(e){if(!(e.flags&1)){const t=po(e),n=kn[kn.length-1];!n||!(e.flags&2)&&t>=po(n)?kn.push(e):kn.splice(A1(t),0,e),e.flags|=1,Sp()}}function Sp(){As||(As=wp.then(Tp))}function Ep(e){z.isArray(e)?ki.push(...e):jr&&e.id===-1?jr.splice(Pi+1,0,e):e.flags&1||(ki.push(e),e.flags|=1),Sp()}function x1(e){if(ki.length){const t=[...new Set(ki)].sort((n,r)=>po(n)-po(r));if(ki.length=0,jr){jr.push(...t);return}for(jr=t,be.env.NODE_ENV!=="production"&&(e=e||new Map),Pi=0;Pi<jr.length;Pi++){const n=jr[Pi];be.env.NODE_ENV!=="production"&&Ap(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}jr=null,Pi=0}}const po=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Tp(e){be.env.NODE_ENV!=="production"&&(e=e||new Map);const t=be.env.NODE_ENV!=="production"?n=>Ap(e,n):z.NOOP;try{for(br=0;br<kn.length;br++){const n=kn[br];if(n&&!(n.flags&8)){if(be.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),Es(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;br<kn.length;br++){const n=kn[br];n&&(n.flags&=-2)}br=-1,kn.length=0,x1(e),As=null,(kn.length||ki.length)&&Tp(e)}}function Ap(e,t){const n=e.get(t)||0;if(n>T1){const r=t.i,i=r&&Ms(r.type);return Ts(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. 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 ho=!1;const Tl=new Map;be.env.NODE_ENV!=="production"&&(z.getGlobalThis().__VUE_HMR_RUNTIME__={createRecord:Al(R1),rerender:Al(C1),reload:Al(k1)});const xs=new Map;function R1(e,t){return xs.has(e)?!1:(xs.set(e,{initialDef:Rs(t),instances:new Set}),!0)}function Rs(e){return sh(e)?e.__vccOpts:e}function C1(e,t){const n=xs.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(r=>{t&&(r.render=t,Rs(r.type).render=t),r.renderCache=[],ho=!0,r.job.flags&8||r.update(),ho=!1}))}function k1(e,t){const n=xs.get(e);if(!n)return;t=Rs(t),xp(n.initialDef,t);const r=[...n.instances];for(let i=0;i<r.length;i++){const o=r[i],s=Rs(o.type);let a=Tl.get(s);a||(s!==n.initialDef&&xp(s,t),Tl.set(s,a=new Set)),a.add(o),o.appContext.propsCache.delete(o.type),o.appContext.emitsCache.delete(o.type),o.appContext.optionsCache.delete(o.type),o.ceReload?(a.add(o),o.ceReload(t.styles),a.delete(o)):o.parent?El(()=>{o.job.flags&8||(ho=!0,o.parent.update(),ho=!1,a.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(s)}Ep(()=>{Tl.clear()})}function xp(e,t){z.extend(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function Al(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,mo=[],xl=!1;function P1(e,...t){Ur?Ur.emit(e,...t):xl||mo.push({event:e,args:t})}function Rp(e,t){var n,r;Ur=e,Ur?(Ur.enabled=!0,mo.forEach(({event:i,args:o})=>Ur.emit(i,...o)),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(o=>{Rp(o,t)}),setTimeout(()=>{Ur||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,xl=!0,mo=[])},3e3)):(xl=!0,mo=[])}const I1=O1("component:updated");function O1(e){return t=>{P1(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let Zt=null,Cp=null;function kp(e){const t=Zt;return Zt=e,Cp=e&&e.type.__scopeId||null,t}function ve(e,t=Zt,n){if(!t||e._n)return e;const r=(...i)=>{r._d&&Ds(-1);const o=kp(t);let s;try{s=e(...i)}finally{kp(o),r._d&&Ds(1)}return be.env.NODE_ENV!=="production"&&I1(t),s};return r._n=!0,r._c=!0,r._d=!0,r}function ot(e,t){if(Zt===null)return be.env.NODE_ENV!=="production"&&tt("withDirectives can only be used inside render functions."),e;const n=ih(Zt),r=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[o,s,a,l=z.EMPTY_OBJ]=t[i];o&&(z.isFunction(o)&&(o={mounted:o,updated:o}),o.deep&&vr(s),r.push({dir:o,instance:n,value:s,oldValue:void 0,arg:a,modifiers:l}))}return e}function ni(e,t){if(be.env.NODE_ENV!=="production"&&(!un||un.isMounted)&&tt("provide() can only be used inside setup()."),un){let n=un.provides;const r=un.parent&&un.parent.provides;r===n&&(n=un.provides=Object.create(r)),n[e]=t}}function wr(e,t,n=!1){const r=$s();if(r||J1){let i=r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&z.isFunction(t)?t.call(r&&r.proxy):t;be.env.NODE_ENV!=="production"&&tt(`injection "${String(e)}" not found.`)}else be.env.NODE_ENV!=="production"&&tt("inject() can only be used inside setup() or functional components.")}const F1=Symbol.for("v-scx"),_1=()=>{{const e=wr(F1);return e||be.env.NODE_ENV!=="production"&&tt("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function st(e,t,n){return be.env.NODE_ENV!=="production"&&!z.isFunction(t)&&tt("`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."),Pp(e,t,n)}function Pp(e,t,n=z.EMPTY_OBJ){const{immediate:r,deep:i,flush:o,once:s}=n;be.env.NODE_ENV!=="production"&&!t&&(r!==void 0&&tt('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&tt('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),s!==void 0&&tt('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const a=z.extend({},n);be.env.NODE_ENV!=="production"&&(a.onWarn=tt);const l=t&&r||!t&&o!=="post";let u;if(Fi){if(o==="sync"){const m=_1();u=m.__watcherHandles||(m.__watcherHandles=[])}else if(!l){const m=()=>{};return m.stop=z.NOOP,m.resume=z.NOOP,m.pause=z.NOOP,m}}const c=un;a.call=(m,b,w)=>Sl(m,c,b,w);let p=!1;o==="post"?a.scheduler=m=>{_l(m,c&&c.suspense)}:o!=="sync"&&(p=!0,a.scheduler=(m,b)=>{b?m():El(m)}),a.augmentJob=m=>{t&&(m.flags|=4),p&&(m.flags|=2,c&&(m.id=c.uid,m.i=c))};const d=m1(e,t,a);return Fi&&(u?u.push(d):l&&d()),d}function D1(e,t,n){const r=this.proxy,i=z.isString(e)?e.includes(".")?N1(r,e):()=>r[e]:e.bind(r,r);let o;z.isFunction(t)?o=t:(o=t.handler,n=t);const s=nh(this),a=Pp(i,o.bind(r),n);return s(),a}function N1(e,t){const n=t.split(".");return()=>{let r=e;for(let i=0;i<n.length&&r;i++)r=r[n[i]];return r}}const L1=Symbol("_vte"),$1=e=>e.__isTeleport,ri=e=>e&&(e.disabled||e.disabled===""),Ip=e=>e&&(e.defer||e.defer===""),Op=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Fp=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Rl=(e,t)=>{const n=e&&e.to;if(z.isString(n))if(t){const r=t(n);return be.env.NODE_ENV!=="production"&&!r&&!ri(e)&&tt(`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 be.env.NODE_ENV!=="production"&&tt("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"),null;else return be.env.NODE_ENV!=="production"&&!n&&!ri(e)&&tt(`Invalid Teleport target: ${n}`),n},_p={name:"Teleport",__isTeleport:!0,process(e,t,n,r,i,o,s,a,l,u){const{mc:c,pc:p,pbc:d,o:{insert:m,querySelector:b,createText:w,createComment:S}}=u,y=ri(t.props);let{shapeFlag:g,children:v,dynamicChildren:h}=t;if(be.env.NODE_ENV!=="production"&&ho&&(l=!1,h=null),e==null){const E=t.el=be.env.NODE_ENV!=="production"?S("teleport start"):w(""),T=t.anchor=be.env.NODE_ENV!=="production"?S("teleport end"):w("");m(E,n,r),m(T,n,r);const R=(A,N)=>{g&16&&c(v,A,N,i,o,s,a,l)},x=()=>{const A=t.target=Rl(t.props,b),N=Np(A,t,w,m);A?(s!=="svg"&&Op(A)?s="svg":s!=="mathml"&&Fp(A)&&(s="mathml"),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(A),y||(R(A,N),ks(t,!1))):be.env.NODE_ENV!=="production"&&!y&&tt("Invalid Teleport target on mount:",A,`(${typeof A})`)};y&&(R(n,T),ks(t,!0)),Ip(t.props)?(t.el.__isMounted=!1,_l(()=>{x(),delete t.el.__isMounted},o)):x()}else{if(Ip(t.props)&&e.el.__isMounted===!1){_l(()=>{_p.process(e,t,n,r,i,o,s,a,l,u)},o);return}t.el=e.el,t.targetStart=e.targetStart;const E=t.anchor=e.anchor,T=t.target=e.target,R=t.targetAnchor=e.targetAnchor,x=ri(e.props),A=x?n:T,N=x?E:R;if(s==="svg"||Op(T)?s="svg":(s==="mathml"||Fp(T))&&(s="mathml"),h?(d(e.dynamicChildren,h,A,i,o,s,a),Qp(e,t,be.env.NODE_ENV==="production")):l||p(e,t,A,N,i,o,s,a,!1),y)x?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Cs(t,n,E,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const W=t.target=Rl(t.props,b);W?Cs(t,W,null,u,0):be.env.NODE_ENV!=="production"&&tt("Invalid Teleport target on update:",T,`(${typeof T})`)}else x&&Cs(t,T,R,u,1);ks(t,y)}},remove(e,t,n,{um:r,o:{remove:i}},o){const{shapeFlag:s,children:a,anchor:l,targetStart:u,targetAnchor:c,target:p,props:d}=e;if(p&&(i(u),i(c)),o&&i(l),s&16){const m=o||!ri(d);for(let b=0;b<a.length;b++){const w=a[b];r(w,t,n,m,!!w.dynamicChildren)}}},move:Cs,hydrate:M1};function Cs(e,t,n,{o:{insert:r},m:i},o=2){o===0&&r(e.targetAnchor,t,n);const{el:s,anchor:a,shapeFlag:l,children:u,props:c}=e,p=o===2;if(p&&r(s,t,n),(!p||ri(c))&&l&16)for(let d=0;d<u.length;d++)i(u[d],t,n,2);p&&r(a,t,n)}function M1(e,t,n,r,i,o,{o:{nextSibling:s,parentNode:a,querySelector:l,insert:u,createText:c}},p){function d(w,S,y,g){S.anchor=p(s(w),S,a(w),n,r,i,o),S.targetStart=y,S.targetAnchor=g}const m=t.target=Rl(t.props,l),b=ri(t.props);if(m){const w=m._lpa||m.firstChild;if(t.shapeFlag&16)if(b)d(e,t,w,w&&s(w));else{t.anchor=s(e);let S=w;for(;S;){if(S&&S.nodeType===8){if(S.data==="teleport start anchor")t.targetStart=S;else if(S.data==="teleport anchor"){t.targetAnchor=S,m._lpa=t.targetAnchor&&s(t.targetAnchor);break}}S=s(S)}t.targetAnchor||Np(m,t,c,u),p(w&&s(w),t,m,n,r,i,o)}ks(t,b)}else b&&t.shapeFlag&16&&d(e,t,e,s(e));return t.anchor&&s(t.anchor)}const Dp=_p;function ks(e,t){const n=e.ctx;if(n&&n.ut){let r,i;for(t?(r=e.el,i=e.anchor):(r=e.targetStart,i=e.targetAnchor);r&&r!==i;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function Np(e,t,n,r){const i=t.targetStart=n(""),o=t.targetAnchor=n("");return i[L1]=o,e&&(r(i,e),r(o,e)),o}function Lp(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Lp(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 _e(e,t){return z.isFunction(e)?z.extend({name:e.name},t,{setup:e}):e}function B1(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const j1=new WeakSet;function Tn(e){const t=$s(),n=n1(null);if(t){const i=t.refs===z.EMPTY_OBJ?t.refs={}:t.refs;let o;be.env.NODE_ENV!=="production"&&(o=Object.getOwnPropertyDescriptor(i,e))&&!o.configurable?tt(`useTemplateRef('${e}') already exists.`):Object.defineProperty(i,e,{enumerable:!0,get:()=>n.value,set:s=>n.value=s})}else be.env.NODE_ENV!=="production"&&tt("useTemplateRef() is called when there is no active component instance to be associated with.");const r=be.env.NODE_ENV!=="production"?tr(n):n;return be.env.NODE_ENV!=="production"&&j1.add(r),r}const $p=e=>e.nodeType===8;z.getGlobalThis().requestIdleCallback,z.getGlobalThis().cancelIdleCallback;function U1(e,t){if($p(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if($p(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const V1=e=>!!e.type.__asyncLoader;function q1(e){z.isFunction(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:o,timeout:s,suspensible:a=!0,onError:l}=e;let u=null,c,p=0;const d=()=>(p++,u=null,m()),m=()=>{let b;return u||(b=u=t().catch(w=>{if(w=w instanceof Error?w:new Error(String(w)),l)return new Promise((S,y)=>{l(w,()=>S(d()),()=>y(w),p+1)});throw w}).then(w=>{if(b!==u&&u)return u;if(be.env.NODE_ENV!=="production"&&!w&&tt("Async component loader resolved to undefined. If you are using retry(), make sure to return its return value."),w&&(w.__esModule||w[Symbol.toStringTag]==="Module")&&(w=w.default),be.env.NODE_ENV!=="production"&&w&&!z.isObject(w)&&!z.isFunction(w))throw new Error(`Invalid async component load result: ${w}`);return c=w,w}))};return _e({name:"AsyncComponentWrapper",__asyncLoader:m,__asyncHydrate(b,w,S){let y=!1;(w.bu||(w.bu=[])).push(()=>y=!0);const g=()=>{if(y){be.env.NODE_ENV!=="production"&&tt(`Skipping lazy hydration for component '${Ms(c)||c.__file}': it was updated before lazy hydration performed.`);return}S()},v=o?()=>{const h=o(g,E=>U1(b,E));h&&(w.bum||(w.bum=[])).push(h)}:g;c?v():m().then(()=>!w.isUnmounted&&v())},get __asyncResolved(){return c},setup(){const b=un;if(B1(b),c)return()=>Ps(c,b);const w=v=>{u=null,Ts(v,b,13,!r)};if(a&&b.suspense||Fi)return m().then(v=>()=>Ps(v,b)).catch(v=>(w(v),()=>r?me(r,{error:v}):null));const S=le(!1),y=le(),g=le(!!i);return i&&setTimeout(()=>{g.value=!1},i),s!=null&&setTimeout(()=>{if(!S.value&&!y.value){const v=new Error(`Async component timed out after ${s}ms.`);w(v),y.value=v}},s),m().then(()=>{S.value=!0,b.parent&&z1(b.parent.vnode)&&b.parent.update()}).catch(v=>{w(v),y.value=v}),()=>{if(S.value&&c)return Ps(c,b);if(y.value&&r)return me(r,{error:y.value});if(n&&!g.value)return Ps(n,b)}}})}function Ps(e,t){const{ref:n,props:r,children:i,ce:o}=t.vnode,s=me(e,r,i);return s.ref=n,s.ce=o,delete t.vnode.ce,s}const z1=e=>e.type.__isKeepAlive;function W1(e,t,n=un,r=!1){if(n){const i=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...s)=>{Ai();const a=nh(n),l=Sl(t,n,e,s);return a(),xi(),l});return r?i.unshift(o):i.push(o),o}else if(be.env.NODE_ENV!=="production"){const i=z.toHandlerKey(wl[e].replace(/ hook$/,""));tt(`${i} 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 Cl=e=>(t,n=un)=>{(!Fi||e==="sp")&&W1(e,(...r)=>t(...r),n)},Lt=Cl("m"),An=Cl("bum"),kl=Cl("um"),Is="components",H1="directives";function Ee(e,t){return Pl(Is,e,!0,t)||e}const Mp=Symbol.for("v-ndc");function Pn(e){return z.isString(e)?Pl(Is,e,!1)||e:e||Mp}function sn(e){return Pl(H1,e)}function Pl(e,t,n=!0,r=!1){const i=Zt||un;if(i){const o=i.type;if(e===Is){const a=Ms(o,!1);if(a&&(a===t||a===z.camelize(t)||a===z.capitalize(z.camelize(t))))return o}const s=Bp(i[e]||o[e],t)||Bp(i.appContext[e],t);if(!s&&r)return o;if(be.env.NODE_ENV!=="production"&&n&&!s){const a=e===Is?`
5
- If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`:"";tt(`Failed to resolve ${e.slice(0,-1)}: ${t}${a}`)}return s}else be.env.NODE_ENV!=="production"&&tt(`resolve${z.capitalize(e.slice(0,-1))} can only be used in render() or setup().`)}function Bp(e,t){return e&&(e[t]||e[z.camelize(t)]||e[z.capitalize(z.camelize(t))])}function mt(e,t,n,r){let i;const o=n,s=z.isArray(e);if(s||z.isString(e)){const a=s&&Br(e);let l=!1,u=!1;a&&(l=!on(e),u=Vn(e),e=gs(e)),i=new Array(e.length);for(let c=0,p=e.length;c<p;c++)i[c]=t(l?u?Ci(qn(e[c])):qn(e[c]):e[c],c,void 0,o)}else if(typeof e=="number"){be.env.NODE_ENV!=="production"&&!Number.isInteger(e)&&tt(`The v-for range expect an integer value but got ${e}.`),i=new Array(e);for(let a=0;a<e;a++)i[a]=t(a+1,a,void 0,o)}else if(z.isObject(e))if(e[Symbol.iterator])i=Array.from(e,(a,l)=>t(a,l,void 0,o));else{const a=Object.keys(e);i=new Array(a.length);for(let l=0,u=a.length;l<u;l++){const c=a[l];i[l]=t(e[c],c,l,o)}}else i=[];return i}function jp(e,t){for(let n=0;n<t.length;n++){const r=t[n];if(z.isArray(r))for(let i=0;i<r.length;i++)e[r[i].name]=r[i].fn;else r&&(e[r.name]=r.key?(...i)=>{const o=r.fn(...i);return o&&(o.key=r.key),o}:r.fn)}return e}function Ue(e,t,n={},r,i){if(Zt.ce||Zt.parent&&V1(Zt.parent)&&Zt.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),X(),Te(Be,null,[me("slot",n,r&&r())],u?-2:64)}let o=e[t];be.env.NODE_ENV!=="production"&&o&&o.length>1&&(tt("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),X();const s=o&&Up(o(n)),a=n.key||s&&s.key,l=Te(Be,{key:(a&&!z.isSymbol(a)?a:`_${t}`)+(!s&&r?"_fb":"")},s||(r?r():[]),s&&e._===1?64:-2);return!i&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),o&&o._c&&(o._d=!0),l}function Up(e){return e.some(t=>Ns(t)?!(t.type===Ii||t.type===Be&&!Up(t.children)):!0)?e:null}function Os(e,t){const n={};if(be.env.NODE_ENV!=="production"&&!z.isObject(e))return tt("v-on with no argument expects an object value."),n;for(const r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:z.toHandlerKey(r)]=e[r];return n}const Il=e=>e?oE(e)?ih(e):Il(e.parent):null,Ol=z.extend(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>be.env.NODE_ENV!=="production"?bs(e.props):e.props,$attrs:e=>be.env.NODE_ENV!=="production"?bs(e.attrs):e.attrs,$slots:e=>be.env.NODE_ENV!=="production"?bs(e.slots):e.slots,$refs:e=>be.env.NODE_ENV!=="production"?bs(e.refs):e.refs,$parent:e=>Il(e.parent),$root:e=>Il(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>G1(e),$forceUpdate:e=>e.f||(e.f=()=>{El(e.update)}),$nextTick:e=>e.n||(e.n=zt.bind(e.proxy)),$watch:e=>D1.bind(e)}),K1={};be.env.NODE_ENV!=="production"&&(K1.ownKeys=e=>(tt("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 Vp(){return qp("useSlots").slots}function Fl(){return qp("useAttrs").attrs}function qp(e){const t=$s();return be.env.NODE_ENV!=="production"&&!t&&tt(`${e}() called without active instance.`),t.setupContext||(t.setupContext=aE(t))}function zp(e){return z.isArray(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function G1(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:o,config:{optionMergeStrategies:s}}=e.appContext,a=o.get(t);let l;return a?l=a:!i.length&&!n&&!r?l=t:(l={},i.length&&i.forEach(u=>Fs(l,u,s,!0)),Fs(l,t,s)),z.isObject(t)&&o.set(t,l),l}function Fs(e,t,n,r=!1){const{mixins:i,extends:o}=t;o&&Fs(e,o,n,!0),i&&i.forEach(s=>Fs(e,s,n,!0));for(const s in t)if(r&&s==="expose")be.env.NODE_ENV!=="production"&&tt('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const a=Q1[s]||n&&n[s];e[s]=a?a(e[s],t[s]):t[s]}return e}const Q1={data:Wp,props:Kp,emits:Kp,methods:go,computed:go,beforeCreate:cn,created:cn,beforeMount:cn,mounted:cn,beforeUpdate:cn,updated:cn,beforeDestroy:cn,beforeUnmount:cn,destroyed:cn,unmounted:cn,activated:cn,deactivated:cn,errorCaptured:cn,serverPrefetch:cn,components:go,directives:go,watch:Y1,provide:Wp,inject:X1};function Wp(e,t){return t?e?function(){return z.extend(z.isFunction(e)?e.call(this,this):e,z.isFunction(t)?t.call(this,this):t)}:t:e}function X1(e,t){return go(Hp(e),Hp(t))}function Hp(e){if(z.isArray(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function cn(e,t){return e?[...new Set([].concat(e,t))]:t}function go(e,t){return e?z.extend(Object.create(null),e,t):t}function Kp(e,t){return e?z.isArray(e)&&z.isArray(t)?[...new Set([...e,...t])]:z.extend(Object.create(null),zp(e),zp(t??{})):t}function Y1(e,t){if(!e)return t;if(!t)return e;const n=z.extend(Object.create(null),e);for(const r in t)n[r]=cn(e[r],t[r]);return n}let J1=null;const Z1={},Gp=e=>Object.getPrototypeOf(e)===Z1,_l=tE;function Qp(e,t,n=!1){const r=e.children,i=t.children;if(z.isArray(r)&&z.isArray(i))for(let o=0;o<r.length;o++){const s=r[o];let a=i[o];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[o]=iE(i[o]),a.el=s.el),!n&&a.patchFlag!==-2&&Qp(s,a)),a.type===Xp&&(a.patchFlag!==-1?a.el=s.el:a.__elIndex=o+(e.type===Be?1:0)),a.type===Ii&&!a.el&&(a.el=s.el),be.env.NODE_ENV!=="production"&&a.el&&(a.el.__vnode=a)}}const eE=e=>e.__isSuspense;function tE(e,t){t&&t.pendingBranch?z.isArray(e)?t.effects.push(...e):t.effects.push(e):Ep(e)}const Be=Symbol.for("v-fgt"),Xp=Symbol.for("v-txt"),Ii=Symbol.for("v-cmt"),_s=[];let xn=null;function X(e=!1){_s.push(xn=e?null:[])}function nE(){_s.pop(),xn=_s[_s.length-1]||null}let yo=1;function Ds(e,t=!1){yo+=e,e<0&&xn&&t&&(xn.hasOnce=!0)}function Yp(e){return e.dynamicChildren=yo>0?xn||z.EMPTY_ARR:null,nE(),yo>0&&xn&&xn.push(e),e}function pe(e,t,n,r,i,o){return Yp(fe(e,t,n,r,i,o,!0))}function Te(e,t,n,r,i){return Yp(me(e,t,n,r,i,!0))}function Ns(e){return e?e.__v_isVNode===!0:!1}const rE=(...e)=>Zp(...e),Jp=({key:e})=>e??null,Ls=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?z.isString(e)||Ft(e)||z.isFunction(e)?{i:Zt,r:e,k:t,f:!!n}:e:null);function fe(e,t=null,n=null,r=0,i=null,o=e===Be?0:1,s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Jp(t),ref:t&&Ls(t),scopeId:Cp,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:i,dynamicChildren:null,appContext:null,ctx:Zt};return a?(Dl(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=z.isString(n)?8:16),be.env.NODE_ENV!=="production"&&l.key!==l.key&&tt("VNode created with invalid key (NaN). VNode type:",l.type),yo>0&&!s&&xn&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&xn.push(l),l}const me=be.env.NODE_ENV!=="production"?rE:Zp;function Zp(e,t=null,n=null,r=0,i=null,o=!1){if((!e||e===Mp)&&(be.env.NODE_ENV!=="production"&&!e&&tt(`Invalid vnode type when creating vnode: ${e}.`),e=Ii),Ns(e)){const a=Oi(e,t,!0);return n&&Dl(a,n),yo>0&&!o&&xn&&(a.shapeFlag&6?xn[xn.indexOf(e)]=a:xn.push(a)),a.patchFlag=-2,a}if(sh(e)&&(e=e.__vccOpts),t){t=eh(t);let{class:a,style:l}=t;a&&!z.isString(a)&&(t.class=z.normalizeClass(a)),z.isObject(l)&&(fo(l)&&!z.isArray(l)&&(l=z.extend({},l)),t.style=z.normalizeStyle(l))}const s=z.isString(e)?1:eE(e)?128:$1(e)?64:z.isObject(e)?4:z.isFunction(e)?2:0;return be.env.NODE_ENV!=="production"&&s&4&&fo(e)&&(e=it(e),tt("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)),fe(e,t,n,r,i,s,o,!0)}function eh(e){return e?fo(e)||Gp(e)?z.extend({},e):e:null}function Oi(e,t,n=!1,r=!1){const{props:i,ref:o,patchFlag:s,children:a,transition:l}=e,u=t?$t(i||{},t):i,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Jp(u),ref:t&&t.ref?n&&o?z.isArray(o)?o.concat(Ls(t)):[o,Ls(t)]:Ls(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:be.env.NODE_ENV!=="production"&&s===-1&&z.isArray(a)?a.map(th):a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Be?s===-1?16:s|16:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Oi(e.ssContent),ssFallback:e.ssFallback&&Oi(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Lp(c,l.clone(c)),c}function th(e){const t=Oi(e);return z.isArray(e.children)&&(t.children=e.children.map(th)),t}function kt(e=" ",t=0){return me(Xp,null,e,t)}function Re(e="",t=!1){return t?(X(),Te(Ii,null,e)):me(Ii,null,e)}function iE(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Oi(e)}function Dl(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(z.isArray(t))n=16;else if(typeof t=="object")if(r&65){const i=t.default;i&&(i._c&&(i._d=!1),Dl(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!Gp(t)?t._ctx=Zt:i===3&&Zt&&(Zt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else z.isFunction(t)?(t={default:t,_ctx:Zt},n=32):(t=String(t),r&64?(n=16,t=[kt(t)]):n=8);e.children=t,e.shapeFlag|=n}function $t(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const i in r)if(i==="class")t.class!==r.class&&(t.class=z.normalizeClass([t.class,r.class]));else if(i==="style")t.style=z.normalizeStyle([t.style,r.style]);else if(z.isOn(i)){const o=t[i],s=r[i];s&&o!==s&&!(z.isArray(o)&&o.includes(s))&&(t[i]=o?[].concat(o,s):s)}else i!==""&&(t[i]=r[i])}return t}let un=null;const $s=()=>un||Zt;let Nl;{const e=z.getGlobalThis(),t=(n,r)=>{let i;return(i=e[n])||(i=e[n]=[]),i.push(r),o=>{i.length>1?i.forEach(s=>s(o)):i[0](o)}};Nl=t("__VUE_INSTANCE_SETTERS__",n=>un=n),t("__VUE_SSR_SETTERS__",n=>Fi=n)}const nh=e=>{const t=un;return Nl(e),e.scope.on(),()=>{e.scope.off(),Nl(t)}};function oE(e){return e.vnode.shapeFlag&4}let Fi=!1;const rh=be.env.NODE_ENV!=="production"?{get(e,t){return Jt(e,"get",""),e[t]},set(){return tt("setupContext.attrs is readonly."),!1},deleteProperty(){return tt("setupContext.attrs is readonly."),!1}}:{get(e,t){return Jt(e,"get",""),e[t]}};function sE(e){return new Proxy(e.slots,{get(t,n){return Jt(e,"get","$slots"),t[n]}})}function aE(e){const t=n=>{if(be.env.NODE_ENV!=="production"&&(e.exposed&&tt("expose() should be called only once per setup()."),n!=null)){let r=typeof n;r==="object"&&(z.isArray(n)?r="array":Ft(n)&&(r="ref")),r!=="object"&&tt(`expose() should be passed a plain object, received ${r}.`)}e.exposed=n||{}};if(be.env.NODE_ENV!=="production"){let n,r;return Object.freeze({get attrs(){return n||(n=new Proxy(e.attrs,rh))},get slots(){return r||(r=sE(e))},get emit(){return(i,...o)=>e.emit(i,...o)},expose:t})}else return{attrs:new Proxy(e.attrs,rh),slots:e.slots,emit:e.emit,expose:t}}function ih(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(o1(yp(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ol)return Ol[n](e)},has(t,n){return n in t||n in Ol}})):e.proxy}const lE=/(?:^|[-_])\w/g,cE=e=>e.replace(lE,t=>t.toUpperCase()).replace(/[-_]/g,"");function Ms(e,t=!0){return z.isFunction(e)?e.displayName||e.name:e.name||t&&e.__name}function oh(e,t,n=!1){let r=Ms(t);if(!r&&t.__file){const i=t.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&e){const i=o=>{for(const s in o)if(o[s]===t)return s};r=i(e.components)||e.parent&&i(e.parent.type.components)||i(e.appContext.components)}return r?cE(r):n?"App":"Anonymous"}function sh(e){return z.isFunction(e)&&"__vccOpts"in e}const B=(e,t)=>{const n=p1(e,t,Fi);if(be.env.NODE_ENV!=="production"){const r=$s();r&&r.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function Ll(e,t,n){try{Ds(-1);const r=arguments.length;return r===2?z.isObject(t)&&!z.isArray(t)?Ns(t)?me(e,null,[t]):me(e,t):me(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ns(n)&&(n=[n]),me(e,t,n))}finally{Ds(1)}}function uE(){if(be.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"},i={__vue_custom_formatter:!0,header(p){if(!z.isObject(p))return null;if(p.__isVue)return["div",e,"VueInstance"];if(Ft(p)){Ai();const d=p.value;return xi(),["div",{},["span",e,c(p)],"<",a(d),">"]}else{if(Br(p))return["div",{},["span",e,on(p)?"ShallowReactive":"Reactive"],"<",a(p),`>${Vn(p)?" (readonly)":""}`];if(Vn(p))return["div",{},["span",e,on(p)?"ShallowReadonly":"Readonly"],"<",a(p),">"]}return null},hasBody(p){return p&&p.__isVue},body(p){if(p&&p.__isVue)return["div",{},...o(p.$)]}};function o(p){const d=[];p.type.props&&p.props&&d.push(s("props",it(p.props))),p.setupState!==z.EMPTY_OBJ&&d.push(s("setup",p.setupState)),p.data!==z.EMPTY_OBJ&&d.push(s("data",it(p.data)));const m=l(p,"computed");m&&d.push(s("computed",m));const b=l(p,"inject");return b&&d.push(s("injected",b)),d.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:p}]]),d}function s(p,d){return d=z.extend({},d),Object.keys(d).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},p],["div",{style:"padding-left:1.25em"},...Object.keys(d).map(m=>["div",{},["span",r,m+": "],a(d[m],!1)])]]:["span",{}]}function a(p,d=!0){return typeof p=="number"?["span",t,p]:typeof p=="string"?["span",n,JSON.stringify(p)]:typeof p=="boolean"?["span",r,p]:z.isObject(p)?["object",{object:d?it(p):p}]:["span",n,String(p)]}function l(p,d){const m=p.type;if(z.isFunction(m))return;const b={};for(const w in p.ctx)u(m,w,d)&&(b[w]=p.ctx[w]);return b}function u(p,d,m){const b=p[m];if(z.isArray(b)&&b.includes(d)||z.isObject(b)&&d in b||p.extends&&u(p.extends,d,m)||p.mixins&&p.mixins.some(w=>u(w,d,m)))return!0}function c(p){return on(p)?"ShallowRef":p.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}const ah=be.env.NODE_ENV!=="production"?tt:z.NOOP;be.env.NODE_ENV,be.env.NODE_ENV;let fE;const lh=typeof window<"u"&&window.trustedTypes;if(lh)try{fE=lh.createPolicy("vue",{createHTML:e=>e})}catch(e){be.env.NODE_ENV!=="production"&&ah(`Error creating trusted types policy: ${e}`)}const ch=Symbol("_vod"),dE=Symbol("_vsh"),uh={name:"show",beforeMount(e,{value:t},{transition:n}){e[ch]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):vo(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),vo(e,!0),r.enter(e)):r.leave(e,()=>{vo(e,!1)}):vo(e,t))},beforeUnmount(e,{value:t}){vo(e,t)}};function vo(e,t){e.style.display=t?e[ch]:"none",e[dE]=!t}be.env.NODE_ENV;function Vr(e,t,n,r){e.addEventListener(t,n,r)}const qr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return z.isArray(t)?n=>z.invokeArrayFns(t,n):t};function pE(e){e.target.composing=!0}function fh(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const In=Symbol("_assign");function dh(e,t,n){return t&&(e=e.trim()),n&&(e=z.looseToNumber(e)),e}const $l={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[In]=qr(i);const o=r||i.props&&i.props.type==="number";Vr(e,t?"change":"input",s=>{s.target.composing||e[In](dh(e.value,n,o))}),(n||o)&&Vr(e,"change",()=>{e.value=dh(e.value,n,o)}),t||(Vr(e,"compositionstart",pE),Vr(e,"compositionend",fh),Vr(e,"change",fh))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:o}},s){if(e[In]=qr(s),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?z.looseToNumber(e.value):e.value,l=t??"";a!==l&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||i&&e.value.trim()===l)||(e.value=l))}},hE={deep:!0,created(e,t,n){e[In]=qr(n),Vr(e,"change",()=>{const r=e._modelValue,i=_i(e),o=e.checked,s=e[In];if(z.isArray(r)){const a=z.looseIndexOf(r,i),l=a!==-1;if(o&&!l)s(r.concat(i));else if(!o&&l){const u=[...r];u.splice(a,1),s(u)}}else if(z.isSet(r)){const a=new Set(r);o?a.add(i):a.delete(i),s(a)}else s(mh(e,o))})},mounted:ph,beforeUpdate(e,t,n){e[In]=qr(n),ph(e,t,n)}};function ph(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(z.isArray(t))i=z.looseIndexOf(t,r.props.value)>-1;else if(z.isSet(t))i=t.has(r.props.value);else{if(t===n)return;i=z.looseEqual(t,mh(e,!0))}e.checked!==i&&(e.checked=i)}const mE={created(e,{value:t},n){e.checked=z.looseEqual(t,n.props.value),e[In]=qr(n),Vr(e,"change",()=>{e[In](_i(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[In]=qr(r),t!==n&&(e.checked=z.looseEqual(t,r.props.value))}},gE={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const i=z.isSet(t);Vr(e,"change",()=>{const o=Array.prototype.filter.call(e.options,s=>s.selected).map(s=>n?z.looseToNumber(_i(s)):_i(s));e[In](e.multiple?i?new Set(o):o:o[0]),e._assigning=!0,zt(()=>{e._assigning=!1})}),e[In]=qr(r)},mounted(e,{value:t}){hh(e,t)},beforeUpdate(e,t,n){e[In]=qr(n)},updated(e,{value:t}){e._assigning||hh(e,t)}};function hh(e,t){const n=e.multiple,r=z.isArray(t);if(n&&!r&&!z.isSet(t)){be.env.NODE_ENV!=="production"&&ah(`<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 i=0,o=e.options.length;i<o;i++){const s=e.options[i],a=_i(s);if(n)if(r){const l=typeof a;l==="string"||l==="number"?s.selected=t.some(u=>String(u)===String(a)):s.selected=z.looseIndexOf(t,a)>-1}else s.selected=t.has(a);else if(z.looseEqual(_i(s),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}function _i(e){return"_value"in e?e._value:e.value}function mh(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const yE={created(e,t,n){Bs(e,t,n,null,"created")},mounted(e,t,n){Bs(e,t,n,null,"mounted")},beforeUpdate(e,t,n,r){Bs(e,t,n,r,"beforeUpdate")},updated(e,t,n,r){Bs(e,t,n,r,"updated")}};function vE(e,t){switch(e){case"SELECT":return gE;case"TEXTAREA":return $l;default:switch(t){case"checkbox":return hE;case"radio":return mE;default:return $l}}}function Bs(e,t,n,r,i){const s=vE(e.tagName,n.props&&n.props.type)[i];s&&s(e,t,n,r)}const bE=["ctrl","shift","alt","meta"],wE={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)=>bE.some(n=>e[`${n}Key`]&&!t.includes(n))},Wt=(e,t)=>{const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((i,...o)=>{for(let s=0;s<t.length;s++){const a=wE[t[s]];if(a&&a(i,t))return}return e(i,...o)}))},SE={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},bo=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(i=>{if(!("key"in i))return;const o=z.hyphenate(i.key);if(t.some(s=>s===o||SE[s]===o))return e(i)}))};function EE(){uE()}be.env.NODE_ENV!=="production"&&EE();const fn=()=>wS.useAbility();function gh(e){if(e===void 0)throw new Error('cloneStateObject: cannot clone "undefined"');return JSON.parse(JSON.stringify(e))}const wo=(e,t)=>!e||!t?!1:e.id===t.id;var zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function TE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ml,yh;function AE(){if(yh)return Ml;yh=1;function e(i){if(typeof i!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(i))}function t(i,o){for(var s="",a=0,l=-1,u=0,c,p=0;p<=i.length;++p){if(p<i.length)c=i.charCodeAt(p);else{if(c===47)break;c=47}if(c===47){if(!(l===p-1||u===1))if(l!==p-1&&u===2){if(s.length<2||a!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var d=s.lastIndexOf("/");if(d!==s.length-1){d===-1?(s="",a=0):(s=s.slice(0,d),a=s.length-1-s.lastIndexOf("/")),l=p,u=0;continue}}else if(s.length===2||s.length===1){s="",a=0,l=p,u=0;continue}}o&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+i.slice(l+1,p):s=i.slice(l+1,p),a=p-l-1;l=p,u=0}else c===46&&u!==-1?++u:u=-1}return s}function n(i,o){var s=o.dir||o.root,a=o.base||(o.name||"")+(o.ext||"");return s?s===o.root?s+a:s+i+a:a}var r={resolve:function(){for(var o="",s=!1,a,l=arguments.length-1;l>=-1&&!s;l--){var u;l>=0?u=arguments[l]:(a===void 0&&(a=be.cwd()),u=a),e(u),u.length!==0&&(o=u+"/"+o,s=u.charCodeAt(0)===47)}return o=t(o,!s),s?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(o){if(e(o),o.length===0)return".";var s=o.charCodeAt(0)===47,a=o.charCodeAt(o.length-1)===47;return o=t(o,!s),o.length===0&&!s&&(o="."),o.length>0&&a&&(o+="/"),s?"/"+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,s=0;s<arguments.length;++s){var a=arguments[s];e(a),a.length>0&&(o===void 0?o=a:o+="/"+a)}return o===void 0?".":r.normalize(o)},relative:function(o,s){if(e(o),e(s),o===s||(o=r.resolve(o),s=r.resolve(s),o===s))return"";for(var a=1;a<o.length&&o.charCodeAt(a)===47;++a);for(var l=o.length,u=l-a,c=1;c<s.length&&s.charCodeAt(c)===47;++c);for(var p=s.length,d=p-c,m=u<d?u:d,b=-1,w=0;w<=m;++w){if(w===m){if(d>m){if(s.charCodeAt(c+w)===47)return s.slice(c+w+1);if(w===0)return s.slice(c+w)}else u>m&&(o.charCodeAt(a+w)===47?b=w:w===0&&(b=0));break}var S=o.charCodeAt(a+w),y=s.charCodeAt(c+w);if(S!==y)break;S===47&&(b=w)}var g="";for(w=a+b+1;w<=l;++w)(w===l||o.charCodeAt(w)===47)&&(g.length===0?g+="..":g+="/..");return g.length>0?g+s.slice(c+b):(c+=b,s.charCodeAt(c)===47&&++c,s.slice(c))},_makeLong:function(o){return o},dirname:function(o){if(e(o),o.length===0)return".";for(var s=o.charCodeAt(0),a=s===47,l=-1,u=!0,c=o.length-1;c>=1;--c)if(s=o.charCodeAt(c),s===47){if(!u){l=c;break}}else u=!1;return l===-1?a?"/":".":a&&l===1?"//":o.slice(0,l)},basename:function(o,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');e(o);var a=0,l=-1,u=!0,c;if(s!==void 0&&s.length>0&&s.length<=o.length){if(s.length===o.length&&s===o)return"";var p=s.length-1,d=-1;for(c=o.length-1;c>=0;--c){var m=o.charCodeAt(c);if(m===47){if(!u){a=c+1;break}}else d===-1&&(u=!1,d=c+1),p>=0&&(m===s.charCodeAt(p)?--p===-1&&(l=c):(p=-1,l=d))}return a===l?l=d:l===-1&&(l=o.length),o.slice(a,l)}else{for(c=o.length-1;c>=0;--c)if(o.charCodeAt(c)===47){if(!u){a=c+1;break}}else l===-1&&(u=!1,l=c+1);return l===-1?"":o.slice(a,l)}},extname:function(o){e(o);for(var s=-1,a=0,l=-1,u=!0,c=0,p=o.length-1;p>=0;--p){var d=o.charCodeAt(p);if(d===47){if(!u){a=p+1;break}continue}l===-1&&(u=!1,l=p+1),d===46?s===-1?s=p:c!==1&&(c=1):s!==-1&&(c=-1)}return s===-1||l===-1||c===0||c===1&&s===l-1&&s===a+1?"":o.slice(s,l)},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 s={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return s;var a=o.charCodeAt(0),l=a===47,u;l?(s.root="/",u=1):u=0;for(var c=-1,p=0,d=-1,m=!0,b=o.length-1,w=0;b>=u;--b){if(a=o.charCodeAt(b),a===47){if(!m){p=b+1;break}continue}d===-1&&(m=!1,d=b+1),a===46?c===-1?c=b:w!==1&&(w=1):c!==-1&&(w=-1)}return c===-1||d===-1||w===0||w===1&&c===d-1&&c===p+1?d!==-1&&(p===0&&l?s.base=s.name=o.slice(1,d):s.base=s.name=o.slice(p,d)):(p===0&&l?(s.name=o.slice(1,c),s.base=o.slice(1,d)):(s.name=o.slice(p,c),s.base=o.slice(p,d)),s.ext=o.slice(c,d)),p>0?s.dir=o.slice(0,p-1):l&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return r.posix=r,Ml=r,Ml}var ft=AE();const Bl=TE(ft),xE=_e({name:"SpaceMoveInfoModal",props:{modal:{type:Object,required:!0}}}),Ye=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},RE=["textContent"],CE=["textContent"];function kE(e,t,n,r,i,o){return X(),pe(Be,null,[fe("p",{class:"mt-0",textContent:z.toDisplayString(e.$gettext("Moving files from one space to another is not possible. Do you want to copy instead?"))},null,8,RE),fe("p",{class:"mb-0",textContent:z.toDisplayString(e.$gettext("Note: Links and shares of the original file are not copied."))},null,8,CE)],64)}const vh=Ye(xE,[["render",kE]]),PE=_e({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}=ht(),{$gettext:n}=Ie.useGettext(),r=le(!1),i=B(()=>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)),o=B(()=>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)),s=B(()=>e.confirmSecondaryTextOverwrite||n("Replace"));return{message:o,checkboxValue:r,checkboxLabel:i,confirmSecondaryText:s,onConfirm:()=>{t(e.modal.id),e.callbackFn({strategy:Wn.KEEP_BOTH,doForAllConflicts:f(r)})},onConfirmSecondary:()=>{t(e.modal.id);const c=e.suggestMerge?Wn.MERGE:Wn.REPLACE;e.callbackFn({strategy:c,doForAllConflicts:f(r)})},onCancel:()=>{t(e.modal.id),e.callbackFn({strategy:Wn.SKIP,doForAllConflicts:f(r)})}}}}),IE=["textContent"],OE={class:"my-4"},FE={class:"flex justify-end items-center mt-4"},_E={class:"oc-modal-body-actions-grid"};function DE(e,t,n,r,i,o){const s=Ee("oc-checkbox"),a=Ee("oc-button");return X(),pe(Be,null,[fe("span",{class:"inline-block mb-4",textContent:z.toDisplayString(e.message)},null,8,IE),fe("div",OE,[e.conflictCount>1?(X(),Te(s,{key:0,modelValue:e.checkboxValue,"onUpdate:modelValue":t[0]||(t[0]=l=>e.checkboxValue=l),size:"medium",label:e.checkboxLabel,"aria-label":e.checkboxLabel},null,8,["modelValue","label","aria-label"])):Re("",!0)]),fe("div",FE,[fe("div",_E,[me(a,{class:"oc-modal-body-actions-cancel ml-2",onClick:e.onCancel},{default:ve(()=>[kt(z.toDisplayString(e.$gettext("Skip")),1)]),_:1},8,["onClick"]),me(a,{class:"oc-modal-body-actions-secondary ml-2",onClick:e.onConfirmSecondary},{default:ve(()=>[kt(z.toDisplayString(e.confirmSecondaryText),1)]),_:1},8,["onClick"]),me(a,{class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:e.onConfirm},{default:ve(()=>[kt(z.toDisplayString(e.$gettext("Keep both")),1)]),_:1},8,["onClick"])])])],64)}const bh=Ye(PE,[["render",DE]]);class jl{constructor(t,n){this.$gettext=t,this.$ngettext=n}async resolveAllConflicts(t,n,r){const i=[];for(const u of t){const c=ft.join(n.path,u.name);r.some(d=>d.path===c)&&i.push({resource:u,strategy:null})}let o=0,s=!1,a=null;const l=[];for(const u of i){if(s){u.strategy=a,l.push(u);continue}const c=i.length-o,p=await this.resolveFileExists(u.resource,c);u.strategy=p.strategy,l.push(u),o+=1,p.doForAllConflicts&&(s=!0,a=p.strategy)}return l}resolveFileExists(t,n,r=!1,i=!1){const{dispatchModal:o}=ht();return new Promise(s=>{o({title:t.isFolder?this.$gettext("Folder already exists"):this.$gettext("File already exists"),hideActions:!0,customComponent:bh,customComponentAttrs:()=>({resource:t,conflictCount:n,suggestMerge:r,separateSkipHandling:i,callbackFn:a=>{s(a)}})})})}resolveDoCopyInsteadOfMoveForSpaces(){const{dispatchModal:t}=ht();return new Promise(n=>{t({title:this.$gettext("Copy here?"),customComponent:vh,confirmText:this.$gettext("Copy here"),onCancel:()=>{n(!1)},onConfirm:()=>Promise.resolve(n(!0))})})}}const zn=(e,t,n,r=1)=>{let i;return t?i=`${re.extractNameWithoutExtension({name:e,extension:t})} (${r}).${t}`:i=`${e} (${r})`,n.some(s=>s.name===i)?zn(e,t,n,r+1):i},wh=(e,t,n,r)=>e.id===n.id&&ft.dirname(t.path)===r.path;var Wn=(e=>(e[e.SKIP=0]="SKIP",e[e.REPLACE=1]="REPLACE",e[e.KEEP_BOTH=2]="KEEP_BOTH",e[e.MERGE=3]="MERGE",e))(Wn||{}),Sr=(e=>(e[e.COPY=0]="COPY",e[e.MOVE=1]="MOVE",e))(Sr||{});class Sh extends jl{constructor(t,n,r,i,o,s,a,l){super(a,l),this.sourceSpace=t,this.resourcesToMove=n,this.targetSpace=r,this.targetFolder=i,this.currentFolder=o,this.clientService=s}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);nt().showErrorMessage({title:n})}showResultMessage(t,n,r){if(t.length===0){const a=n.length;if(a===0)return;const l=r===Sr.COPY?this.$ngettext("%{count} item was copied successfully","%{count} items were copied successfully",a,{count:a.toString()},!0):this.$ngettext("%{count} item was moved successfully","%{count} items were moved successfully",a,{count:a.toString()},!0);nt().showMessage({title:l,status:"success"});return}let i=r===Sr.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&&(i=r===Sr.COPY?this.$gettext("Failed to copy »%{name}«",{name:t[0]?.resourceName},!0):this.$gettext("Failed to move »%{name}«",{name:t[0]?.resourceName},!0));let o="";t.some(({error:a})=>a instanceof re.HttpError&&a.statusCode===507)&&(o=this.$gettext("Insufficient quota")),nt().showErrorMessage({title:i,...o&&{desc:o},errors:t.map(({error:a})=>a)})}async getTransferData(t){if(this.hasRecursion())return this.showRecursionErrorMessage(),[];if(this.sourceSpace.id!==this.targetSpace.id&&t===Sr.MOVE){if(!await this.resolveDoCopyInsteadOfMoveForSpaces())return[];t=Sr.COPY}const n=(await this.clientService.webdav.listFiles(this.targetSpace,this.targetFolder)).children,r=await this.resolveAllConflicts(this.resourcesToMove,this.targetFolder,n),i=[];for(const o of this.resourcesToMove){const s={...o},{id:a,name:l,extension:u}=s,c=r.some(m=>m.resource.id===a);let p=l,d=!1;if(c){const m=r.find(b=>b.resource.id===a)?.strategy;if(m===Wn.SKIP)continue;if(m===Wn.REPLACE){if(this.isOverwritingParentFolder(s,this.targetFolder,n)){const b=new Error;this.showResultMessage([{error:b,resourceName:l}],[],t);continue}d=!0}m===Wn.KEEP_BOTH&&(p=zn(l,u,n),s.name=p)}wh(this.sourceSpace,s,this.targetSpace,this.targetFolder)&&d||i.push({resource:s,sourceSpace:this.sourceSpace,targetSpace:this.targetSpace,targetFolder:this.targetFolder,path:ft.join(this.targetFolder.path,p),overwrite:d,transferType:t})}return i}isOverwritingParentFolder(t,n,r){if(t.type!=="folder")return!1;const i=f(this.currentFolder)?.path;if(!i||n.path===i)return!1;const o=ft.basename(t.path),s=ft.join(n.path,o);return i.split("/").length<s.split("/").length?!1:r.some(a=>a.path===s)}}const Ul={ignoreLocation:!0,threshold:0,useExtendedSearch:!0},NE=(e,t,n)=>new zd(e,{...Ul,keys:["name","type","icon","extension","tags"]}).search(t,{limit:n}).map(i=>i.item),Eh="oc-resource-icon-mapping",LE={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 Th(){const e={};return Object.values(LE).forEach(t=>{t.extensions.forEach(n=>{e[n]=t.icon})}),e}const Ah=({resourcesStore:e,parentFolderId:t})=>{const n=e.currentFolder;if(!n||!n.id)return!1;if(re.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 Vl(e,t,n){return t.name=ft.basename(n),t.path=n,t.webDavPath=ft.join(e.webDavPath,n),t.extension=re.extractExtensionFromFile(t),t}function $E(){this.__data__=[],this.size=0}function So(e,t){return e===t||e!==e&&t!==t}function js(e,t){for(var n=e.length;n--;)if(So(e[n][0],t))return n;return-1}var ME=Array.prototype,BE=ME.splice;function jE(e){var t=this.__data__,n=js(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():BE.call(t,n,1),--this.size,!0}function UE(e){var t=this.__data__,n=js(t,e);return n<0?void 0:t[n][1]}function VE(e){return js(this.__data__,e)>-1}function qE(e,t){var n=this.__data__,r=js(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Er(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])}}Er.prototype.clear=$E,Er.prototype.delete=jE,Er.prototype.get=UE,Er.prototype.has=VE,Er.prototype.set=qE;function zE(){this.__data__=new Er,this.size=0}function WE(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function HE(e){return this.__data__.get(e)}function KE(e){return this.__data__.has(e)}const Wr=globalThis||void 0||self;var xh=typeof Wr=="object"&&Wr&&Wr.Object===Object&&Wr,GE=typeof self=="object"&&self&&self.Object===Object&&self,nr=xh||GE||Function("return this")(),On=nr.Symbol,Rh=Object.prototype,QE=Rh.hasOwnProperty,XE=Rh.toString,Eo=On?On.toStringTag:void 0;function YE(e){var t=QE.call(e,Eo),n=e[Eo];try{e[Eo]=void 0;var r=!0}catch{}var i=XE.call(e);return r&&(t?e[Eo]=n:delete e[Eo]),i}var JE=Object.prototype,ZE=JE.toString;function eT(e){return ZE.call(e)}var tT="[object Null]",nT="[object Undefined]",Ch=On?On.toStringTag:void 0;function ii(e){return e==null?e===void 0?nT:tT:Ch&&Ch in Object(e)?YE(e):eT(e)}function rr(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var rT="[object AsyncFunction]",iT="[object Function]",oT="[object GeneratorFunction]",sT="[object Proxy]";function ql(e){if(!rr(e))return!1;var t=ii(e);return t==iT||t==oT||t==rT||t==sT}var zl=nr["__core-js_shared__"],kh=(function(){var e=/[^.]+$/.exec(zl&&zl.keys&&zl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function aT(e){return!!kh&&kh in e}var lT=Function.prototype,cT=lT.toString;function oi(e){if(e!=null){try{return cT.call(e)}catch{}try{return e+""}catch{}}return""}var uT=/[\\^$.*+?()[\]{}|]/g,fT=/^\[object .+?Constructor\]$/,dT=Function.prototype,pT=Object.prototype,hT=dT.toString,mT=pT.hasOwnProperty,gT=RegExp("^"+hT.call(mT).replace(uT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yT(e){if(!rr(e)||aT(e))return!1;var t=ql(e)?gT:fT;return t.test(oi(e))}function vT(e,t){return e?.[t]}function si(e,t){var n=vT(e,t);return yT(n)?n:void 0}var To=si(nr,"Map"),Ao=si(Object,"create");function bT(){this.__data__=Ao?Ao(null):{},this.size=0}function wT(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var ST="__lodash_hash_undefined__",ET=Object.prototype,TT=ET.hasOwnProperty;function AT(e){var t=this.__data__;if(Ao){var n=t[e];return n===ST?void 0:n}return TT.call(t,e)?t[e]:void 0}var xT=Object.prototype,RT=xT.hasOwnProperty;function CT(e){var t=this.__data__;return Ao?t[e]!==void 0:RT.call(t,e)}var kT="__lodash_hash_undefined__";function PT(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ao&&t===void 0?kT:t,this}function ai(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])}}ai.prototype.clear=bT,ai.prototype.delete=wT,ai.prototype.get=AT,ai.prototype.has=CT,ai.prototype.set=PT;function IT(){this.size=0,this.__data__={hash:new ai,map:new(To||Er),string:new ai}}function OT(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Us(e,t){var n=e.__data__;return OT(t)?n[typeof t=="string"?"string":"hash"]:n.map}function FT(e){var t=Us(this,e).delete(e);return this.size-=t?1:0,t}function _T(e){return Us(this,e).get(e)}function DT(e){return Us(this,e).has(e)}function NT(e,t){var n=Us(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Tr(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])}}Tr.prototype.clear=IT,Tr.prototype.delete=FT,Tr.prototype.get=_T,Tr.prototype.has=DT,Tr.prototype.set=NT;var LT=200;function $T(e,t){var n=this.__data__;if(n instanceof Er){var r=n.__data__;if(!To||r.length<LT-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Tr(r)}return n.set(e,t),this.size=n.size,this}function ir(e){var t=this.__data__=new Er(e);this.size=t.size}ir.prototype.clear=zE,ir.prototype.delete=WE,ir.prototype.get=HE,ir.prototype.has=KE,ir.prototype.set=$T;var Vs=(function(){try{var e=si(Object,"defineProperty");return e({},"",{}),e}catch{}})();function Wl(e,t,n){t=="__proto__"&&Vs?Vs(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Hl(e,t,n){(n!==void 0&&!So(e[t],n)||n===void 0&&!(t in e))&&Wl(e,t,n)}function MT(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),a=s.length;a--;){var l=s[++i];if(n(o[l],l,o)===!1)break}return t}}var BT=MT(),Ph=typeof $=="object"&&$&&!$.nodeType&&$,Ih=Ph&&typeof module=="object"&&module&&!module.nodeType&&module,jT=Ih&&Ih.exports===Ph,Oh=jT?nr.Buffer:void 0,Fh=Oh?Oh.allocUnsafe:void 0;function _h(e,t){if(t)return e.slice();var n=e.length,r=Fh?Fh(n):new e.constructor(n);return e.copy(r),r}var qs=nr.Uint8Array;function Kl(e){var t=new e.constructor(e.byteLength);return new qs(t).set(new qs(e)),t}function Dh(e,t){var n=t?Kl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function UT(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Nh=Object.create,VT=(function(){function e(){}return function(t){if(!rr(t))return{};if(Nh)return Nh(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function Lh(e,t){return function(n){return e(t(n))}}var Gl=Lh(Object.getPrototypeOf,Object),qT=Object.prototype;function Ql(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||qT;return e===n}function zT(e){return typeof e.constructor=="function"&&!Ql(e)?VT(Gl(e)):{}}function or(e){return e!=null&&typeof e=="object"}var WT="[object Arguments]";function $h(e){return or(e)&&ii(e)==WT}var Mh=Object.prototype,HT=Mh.hasOwnProperty,KT=Mh.propertyIsEnumerable,zs=$h((function(){return arguments})())?$h:function(e){return or(e)&&HT.call(e,"callee")&&!KT.call(e,"callee")},Hn=Array.isArray,GT=9007199254740991;function Bh(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=GT}function Ws(e){return e!=null&&Bh(e.length)&&!ql(e)}function QT(e){return or(e)&&Ws(e)}function XT(){return!1}var jh=typeof $=="object"&&$&&!$.nodeType&&$,Uh=jh&&typeof module=="object"&&module&&!module.nodeType&&module,YT=Uh&&Uh.exports===jh,Vh=YT?nr.Buffer:void 0,JT=Vh?Vh.isBuffer:void 0,xo=JT||XT,ZT="[object Object]",eA=Function.prototype,tA=Object.prototype,qh=eA.toString,nA=tA.hasOwnProperty,rA=qh.call(Object);function Xl(e){if(!or(e)||ii(e)!=ZT)return!1;var t=Gl(e);if(t===null)return!0;var n=nA.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&qh.call(n)==rA}var iA="[object Arguments]",oA="[object Array]",sA="[object Boolean]",aA="[object Date]",lA="[object Error]",cA="[object Function]",uA="[object Map]",fA="[object Number]",dA="[object Object]",pA="[object RegExp]",hA="[object Set]",mA="[object String]",gA="[object WeakMap]",yA="[object ArrayBuffer]",vA="[object DataView]",bA="[object Float32Array]",wA="[object Float64Array]",SA="[object Int8Array]",EA="[object Int16Array]",TA="[object Int32Array]",AA="[object Uint8Array]",xA="[object Uint8ClampedArray]",RA="[object Uint16Array]",CA="[object Uint32Array]",At={};At[bA]=At[wA]=At[SA]=At[EA]=At[TA]=At[AA]=At[xA]=At[RA]=At[CA]=!0,At[iA]=At[oA]=At[yA]=At[sA]=At[vA]=At[aA]=At[lA]=At[cA]=At[uA]=At[fA]=At[dA]=At[pA]=At[hA]=At[mA]=At[gA]=!1;function kA(e){return or(e)&&Bh(e.length)&&!!At[ii(e)]}function Yl(e){return function(t){return e(t)}}var zh=typeof $=="object"&&$&&!$.nodeType&&$,Ro=zh&&typeof module=="object"&&module&&!module.nodeType&&module,PA=Ro&&Ro.exports===zh,Jl=PA&&xh.process,Di=(function(){try{var e=Ro&&Ro.require&&Ro.require("util").types;return e||Jl&&Jl.binding&&Jl.binding("util")}catch{}})(),Wh=Di&&Di.isTypedArray,Zl=Wh?Yl(Wh):kA;function ec(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var IA=Object.prototype,OA=IA.hasOwnProperty;function Hh(e,t,n){var r=e[t];(!(OA.call(e,t)&&So(r,n))||n===void 0&&!(t in e))&&Wl(e,t,n)}function Kh(e,t,n,r){var i=!n;n||(n={});for(var o=-1,s=t.length;++o<s;){var a=t[o],l=void 0;l===void 0&&(l=e[a]),i?Wl(n,a,l):Hh(n,a,l)}return n}function FA(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var _A=9007199254740991,DA=/^(?:0|[1-9]\d*)$/;function Gh(e,t){var n=typeof e;return t=t??_A,!!t&&(n=="number"||n!="symbol"&&DA.test(e))&&e>-1&&e%1==0&&e<t}var NA=Object.prototype,LA=NA.hasOwnProperty;function Qh(e,t){var n=Hn(e),r=!n&&zs(e),i=!n&&!r&&xo(e),o=!n&&!r&&!i&&Zl(e),s=n||r||i||o,a=s?FA(e.length,String):[],l=a.length;for(var u in e)(t||LA.call(e,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Gh(u,l)))&&a.push(u);return a}function $A(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var MA=Object.prototype,BA=MA.hasOwnProperty;function jA(e){if(!rr(e))return $A(e);var t=Ql(e),n=[];for(var r in e)r=="constructor"&&(t||!BA.call(e,r))||n.push(r);return n}function tc(e){return Ws(e)?Qh(e,!0):jA(e)}function UA(e){return Kh(e,tc(e))}function VA(e,t,n,r,i,o,s){var a=ec(e,n),l=ec(t,n),u=s.get(l);if(u){Hl(e,n,u);return}var c=o?o(a,l,n+"",e,t,s):void 0,p=c===void 0;if(p){var d=Hn(l),m=!d&&xo(l),b=!d&&!m&&Zl(l);c=l,d||m||b?Hn(a)?c=a:QT(a)?c=UT(a):m?(p=!1,c=_h(l,!0)):b?(p=!1,c=Dh(l,!0)):c=[]:Xl(l)||zs(l)?(c=a,zs(a)?c=UA(a):(!rr(a)||ql(a))&&(c=zT(l))):p=!1}p&&(s.set(l,c),i(c,l,r,o,s),s.delete(l)),Hl(e,n,c)}function Xh(e,t,n,r,i){e!==t&&BT(t,function(o,s){if(i||(i=new ir),rr(o))VA(e,t,s,n,Xh,r,i);else{var a=r?r(ec(e,s),o,s+"",e,t,i):void 0;a===void 0&&(a=o),Hl(e,s,a)}},tc)}function Yh(e){return e}function qA(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 Jh=Math.max;function Zh(e,t,n){return t=Jh(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=Jh(r.length-t,0),s=Array(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),qA(e,this,a)}}function zA(e){return function(){return e}}var WA=Vs?function(e,t){return Vs(e,"toString",{configurable:!0,enumerable:!1,value:zA(t),writable:!0})}:Yh,HA=800,KA=16,GA=Date.now;function QA(e){var t=0,n=0;return function(){var r=GA(),i=KA-(r-n);if(n=r,i>0){if(++t>=HA)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var em=QA(WA);function XA(e,t){return em(Zh(e,t,Yh),e+"")}function YA(e,t,n){if(!rr(n))return!1;var r=typeof t;return(r=="number"?Ws(n)&&Gh(t,n.length):r=="string"&&t in n)?So(n[t],e):!1}function JA(e){return XA(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,s&&YA(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var a=n[r];a&&e(t,a,r,o)}return t})}var Co=JA(function(e,t,n){Xh(e,t,n)});const nc=(e,...t)=>{const{href:n}=e.resolve(f(e.currentRoute));return t.map(r=>{const{href:i}=e.resolve({...r});return i==="/"||i==="#/"?!1:n.startsWith(i)}).some(Boolean)},Ni=(...e)=>(t,...n)=>{if(!n.length)return nc(t,...e);const[r,...i]=n.map(o=>{const s=e.find(a=>a.name===o);if(!s)throw new Error(`unknown comparative '${o}'`);return s});return nc(t,r,...i)};function m8(e){return e}const Li=(e,...t)=>Co({},{name:e},...t.map(n=>({...n.params&&{params:n.params},...n.query&&{query:n.query}}))),$i=(e,t={})=>Li(e,t),tm=$i("files-common-favorites"),nm=$i("files-common-search"),Vt=Ni(tm,nm),ZA=e=>[{path:"/search",component:e.App,children:[{name:nm.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"]}}]},{path:"/favorites",component:e.App,children:[{name:tm.name,path:"",component:e.Favorites,meta:{authContext:"user",title:"Favorite files"}}]}],Kn=(e,t={})=>Li(e,t),rm=Kn("files-spaces-projects"),rc=Kn("files-spaces-generic"),xt=Ni(rm,rc),ex=e=>[{path:"/spaces",component:e.App,children:[{path:"projects",name:rm.name,component:e.Spaces.Projects,meta:{authContext:"user",title:"Spaces"}},{path:":driveAliasAndItem(.*)?",name:rc.name,component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0,contextQueryItems:["sort-by","sort-dir"]}}]}],Fn=(e,t={})=>Li(e,t),tx=Fn("files-shares"),Hs=Fn("files-shares-with-me"),ic=Fn("files-shares-with-others"),oc=Fn("files-shares-via-link"),Mt=Ni(Hs,ic,oc),nx=e=>[{name:tx.name,path:"/shares",component:e.App,redirect:Hs,children:[{name:Hs.name,path:"with-me",component:e.Shares.SharedWithMe,meta:{authContext:"user",title:"Files shared with me"}},{name:ic.name,path:"with-others",component:e.Shares.SharedWithOthers,meta:{authContext:"user",title:"Files shared with others"}},{name:oc.name,path:"via-link",component:e.Shares.SharedViaLink,meta:{authContext:"user",title:"Files shared via link"}}]}],Mi=(e,t={})=>Li(e,t),sc=Mi("files-public-link"),ac=Mi("files-public-upload"),_n=Ni(sc,ac),rx=e=>[{path:"/link",component:e.App,meta:{auth:!1},children:[{name:sc.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"publicLink",patchCleanPath:!0}}]},{path:"/upload",component:e.App,meta:{auth:!1},children:[{name:ac.name,path:":token?",component:e.FilesDrop,meta:{authContext:"publicLink",title:"Public file upload"}}]}],Hr=(e,t={})=>Li(e,t),im=Hr("files-trash-generic"),om=Hr("files-trash-overview"),yn=Ni(im,om),ix=e=>[{path:"/trash",component:e.App,children:[{path:"overview",name:om.name,component:e.Trash.Overview,meta:{authContext:"user",title:"Trash overview"}},{name:im.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0}}]}];function sm(e){return{applicationConfig:B(()=>e.appsStore.externalAppConfig[e.applicationId]||{})}}const ox=["anonymous","user","idp","publicLink","hybrid"],Ar=e=>wr(e),He=()=>Ar("$router"),Ht=()=>He().currentRoute,lc=e=>e.path.split("/")[1],sx=()=>{const e=Ht();return B(()=>lc(f(e)))},sr=(e,t={},n)=>{const r=n?.configStore||dt();return{params:{driveAliasAndItem:e.getDriveAliasAndItem({path:t.path||""})},query:{...re.isShareSpaceResource(e)&&{shareId:e.id},...r?.options?.routing?.idBased&&!Tt.isUndefined(t.fileId)&&{fileId:`${t.fileId}`}}}},ax=(e,t)=>{const n=document.querySelector("base"),r=!!n,i=new URL(window.location.href.split("#")[0]);return i.search="",r?i.pathname=new URL(n.href).pathname:i.pathname.endsWith("/index.html")&&(i.pathname=i.pathname.split("/").slice(0,-1).filter(Boolean).join("/")),/\.(html?)$/i.test(t)?i.pathname=[...i.pathname.split("/"),...t.split("/")].filter(Boolean).join("/"):i[r?"pathname":"hash"]=e.resolve(t).href,i.href},ar=Me.defineStore("apps",()=>{const e=le({}),t=le({}),n=le([]),r=B(()=>Object.keys(f(e))),i=(l,u)=>{l.id&&(l.extensions&&l.extensions.forEach(c=>{o({appId:l.id,data:c})}),f(e)[l.id]={defaultExtension:l.defaultExtension||"",icon:"check_box_outline_blank",name:l.name||l.id,translations:u,...l})},o=({appId:l,data:u})=>{f(n).push({...u,app:l,hasPriority:u.hasPriority||f(t)?.[l]?.priorityExtensions?.includes(u.extension)||!1,secureView:u.secureView||!1})};return{apps:e,externalAppConfig:t,appIds:r,fileExtensions:n,registerApp:i,registerFileExtension:o,loadExternalAppConfig:({appId:l,config:u})=>{t.value={...f(t),[l]:u}},isAppEnabled:l=>f(r).includes(l)}}),li=Me.defineStore("auth",()=>{const e=le(),t=le(!1),n=le(!1),r=le(),i=le(),o=le(),s=le(!1),a=m=>{e.value=m},l=m=>{t.value=m},u=m=>{n.value=m},c=m=>{r.value=m.publicLinkToken,i.value=m.publicLinkPassword,o.value=m.publicLinkType,s.value=m.publicLinkContextReady};return{accessToken:e,idpContextReady:t,userContextReady:n,publicLinkToken:r,publicLinkPassword:i,publicLinkType:o,publicLinkContextReady:s,setAccessToken:a,setIdpContextReady:l,setUserContextReady:u,setPublicLinkContext:c,clearUserContext:()=>{a(null),l(null),u(null)},clearPublicLinkContext:()=>{c({publicLinkToken:null,publicLinkPassword:null,publicLinkType:null,publicLinkContextReady:!1})}}}),am={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:re.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}},en=Me.defineStore("capabilities",()=>{const e=le(!1),t=le(am),n=ee=>{t.value=Co({...am},ee.capabilities),e.value=!0},r=B(()=>f(t).core["support-sse"]),i=B(()=>f(t).core["support-radicale"]),o=B(()=>f(t).graph["personal-data-export"]),s=B(()=>f(t).core.status),a=B(()=>f(t).dav.reports),l=B(()=>f(t).dav.trashbin),u=B(()=>f(t).spaces.max_quota),c=B(()=>f(t).spaces.projects),p=B(()=>f(t).graph.users.create_disabled),d=B(()=>f(t).graph.users.delete_disabled),m=B(()=>f(t).graph.users.change_password_self_disabled),b=B(()=>f(t).graph.users.read_only_attributes),w=B(()=>f(t).graph.users.edit_login_allowed_disabled),S=B(()=>f(t).files.app_providers),y=B(()=>f(t).files.favorites),g=B(()=>f(t).files.archivers),v=B(()=>f(t).files.privateLinks),h=B(()=>f(t).files.permanent_deletion),E=B(()=>f(t).files.tags),T=B(()=>f(t).files.undelete),R=B(()=>f(t).files_sharing.api_enabled),x=B(()=>f(t).files_sharing.can_rename),A=B(()=>f(t).files_sharing.allow_custom),N=B(()=>f(t).files_sharing.public?.enabled),W=B(()=>f(t).files_sharing.public?.can_edit),O=B(()=>f(t).files_sharing.public?.can_contribute),D=B(()=>f(t).files_sharing.public?.alias),V=B(()=>f(t).files_sharing.public?.default_permissions),L=B(()=>f(t).files_sharing.public?.password.enforced_for),te=B(()=>f(t).files_sharing.search_min_length),Y=B(()=>f(t).files_sharing.user?.profile_picture),se=B(()=>f(t).files.tus_support?.max_chunk_size),he=B(()=>f(t).files.tus_support?.extension),ae=B(()=>f(t).files.tus_support?.http_method_override),we=B(()=>f(t).notifications["ocs-endpoints"]),Q=B(()=>f(t).password_policy),ie=B(()=>f(t).search.property?.mtime),ce=B(()=>f(t).search.property?.mediatype),Ae=B(()=>f(t).search.property?.content);return{isInitialized:e,capabilities:t,setCapabilities:n,status:s,supportSSE:r,supportRadicale:i,personalDataExport:o,davReports:a,davTrashbin:l,spacesMaxQuota:u,spacesProjects:c,graphUsersCreateDisabled:p,graphUsersDeleteDisabled:d,graphUsersChangeSelfPasswordDisabled:m,graphUsersEditLoginAllowedDisabled:w,graphUsersReadOnlyAttributes:b,filesAppProviders:S,filesFavorites:y,filesArchivers:g,filesPrivateLinks:v,filesPermanentDeletion:h,filesTags:E,filesUndelete:T,sharingApiEnabled:R,sharingCanRename:x,sharingAllowCustom:A,sharingPublicEnabled:N,sharingPublicCanEdit:W,sharingPublicCanContribute:O,sharingPublicAlias:D,sharingPublicDefaultPermissions:V,sharingPublicPasswordEnforcedFor:L,sharingSearchMinLength:te,sharingUserProfilePicture:Y,tusMaxChunkSize:se,tusExtension:he,tusHttpMethodOverride:ae,notificationsOcsEndpoints:we,passwordPolicy:Q,searchLastMofifiedDate:ie,searchMediaType:ce,searchContent:Ae}});class lx{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 lm{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 lx(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 Ks=async({graphClient:e,spacesStore:t,space:n,signal:r})=>{const i=await t.getMountPointForSpace({graphClient:e,space:n,signal:r});if(!i)return null;const{id:o}=i;return e.driveItems.getDriveItem(o.split("!")[0],o)},cx=({sharedAncestor:e,matchingSpace:t})=>t?Kn("files-spaces-generic",sr(t,{path:e.path,fileId:e.id})):{},cm=({sharesStore:e,spacesStore:t,space:n,sharedDriveItem:r})=>{const i=r?.remoteItem?.permissions||[];if(!i.length)return;const o=[];i.forEach(s=>{if(s["@libre.graph.permissions.actions"]){o.push(...s["@libre.graph.permissions.actions"]);return}const a=e.graphRoles[s.roles[0]];if(!a)return;const l=a.rolePermissions.flatMap(u=>u.allowedResourceActions);o.push(...l)}),t.updateSpaceField({id:n.id,field:"graphPermissions",value:[...new Set(o)]})},ux=e=>{const t=document.querySelectorAll(`[data-item-id="${e}"] input[type=checkbox]`)?.[0];t&&t.focus()},Gs=(e,t)=>{t!==void 0&&document.querySelector(":root").style.setProperty("--oc-"+e,t)},fx="thead-clicked",dx="highlight",px="rowMounted",hx="contextmenuClicked",um="itemDropped",mx="itemDragged";let gx="";const yx=()=>gx,vx=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"}),bx=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"}),wx=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 pt=(e=>(e.Desc="desc",e.Asc="asc",e))(pt||{});let fm=0;const ci=(e="")=>(e=e||"",fm+=1,e+fm),dm=e=>e?[{name:"name",sortable:!0,sortDir:pt.Asc},{name:"size",sortable:!0,sortDir:pt.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:pt.Asc},{name:"owner",sortable:"displayName",sortDir:pt.Asc},{name:"mdate",sortable:t=>new Date(t).valueOf(),sortDir:pt.Desc},{name:"sdate",sortable:t=>new Date(t).valueOf(),sortDir:pt.Desc},{name:"ddate",sortable:t=>new Date(t).valueOf(),sortDir:pt.Desc}].filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[];function g8(e){return e}const pm=[{label:"A-Z",name:"name",sortable:!0,sortDir:pt.Asc},{label:"Z-A",name:"name",sortable:!0,sortDir:pt.Desc},{label:"Newest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:pt.Desc},{label:"Oldest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:pt.Asc},{label:"Largest",name:"size",sortable:!0,sortDir:pt.Desc},{label:"Smallest",name:"size",sortable:!0,sortDir:pt.Asc},{label:"Remaining quota",name:"remainingQuota",prop:"spaceQuota.remaining",sortable:!0,sortDir:pt.Desc},{label:"Total quota",name:"totalQuota",prop:"spaceQuota.total",sortable:!0,sortDir:pt.Desc},{label:"Used quota",name:"usedQuota",prop:"spaceQuota.used",sortable:!0,sortDir:pt.Desc}],Sx=e=>e?pm.filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[],Ex=(e,{$gettext:t})=>e.map(n=>({...n,label:t(n.label)})),Tx=de.z.object({icon:de.z.string(),name:de.z.string(),secure_view:de.z.boolean().optional().default(!1),target_ext:de.z.string().optional()}),Ax=de.z.object({allow_creation:de.z.boolean().optional(),app_providers:de.z.array(Tx),default_application:de.z.string().optional(),description:de.z.string().optional(),ext:de.z.string().optional(),mime_type:de.z.string(),name:de.z.string().optional()}),hm=de.z.object({"mime-types":de.z.array(Ax)});class xx{_mimeTypes=le([]);serverUrl;clientService;constructor(t,n){this.serverUrl=t,this.clientService=n}async loadData(){const t=re.urlJoin(this.serverUrl,"app","list"),{data:{"mime-types":n}}=await this.clientService.httpUnAuthenticated.get(t,{schema:hm});this._mimeTypes.value=n}set mimeTypes(t){this._mimeTypes.value=t}get mimeTypes(){return f(this._mimeTypes)}get templateMimeTypes(){return f(this._mimeTypes).filter(t=>!!t.app_providers.some(n=>!!n.target_ext))}get appNames(){return[...new Set(f(this._mimeTypes).flatMap(t=>t.app_providers.map(n=>n.name)))]}getMimeTypesByAppName(t){return f(this._mimeTypes).filter(n=>n.app_providers.some(r=>r.name===t))}}var mm={},Qs={};Qs.byteLength=kx,Qs.toByteArray=Ix,Qs.fromByteArray=_x;for(var lr=[],Dn=[],Rx=typeof Uint8Array<"u"?Uint8Array:Array,cc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bi=0,Cx=cc.length;Bi<Cx;++Bi)lr[Bi]=cc[Bi],Dn[cc.charCodeAt(Bi)]=Bi;Dn[45]=62,Dn[95]=63;function gm(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 kx(e){var t=gm(e),n=t[0],r=t[1];return(n+r)*3/4-r}function Px(e,t,n){return(t+n)*3/4-n}function Ix(e){var t,n=gm(e),r=n[0],i=n[1],o=new Rx(Px(e,r,i)),s=0,a=i>0?r-4:r,l;for(l=0;l<a;l+=4)t=Dn[e.charCodeAt(l)]<<18|Dn[e.charCodeAt(l+1)]<<12|Dn[e.charCodeAt(l+2)]<<6|Dn[e.charCodeAt(l+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=t&255;return i===2&&(t=Dn[e.charCodeAt(l)]<<2|Dn[e.charCodeAt(l+1)]>>4,o[s++]=t&255),i===1&&(t=Dn[e.charCodeAt(l)]<<10|Dn[e.charCodeAt(l+1)]<<4|Dn[e.charCodeAt(l+2)]>>2,o[s++]=t>>8&255,o[s++]=t&255),o}function Ox(e){return lr[e>>18&63]+lr[e>>12&63]+lr[e>>6&63]+lr[e&63]}function Fx(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),i.push(Ox(r));return i.join("")}function _x(e){for(var t,n=e.length,r=n%3,i=[],o=16383,s=0,a=n-r;s<a;s+=o)i.push(Fx(e,s,s+o>a?a:s+o));return r===1?(t=e[n-1],i.push(lr[t>>2]+lr[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],i.push(lr[t>>10]+lr[t>>4&63]+lr[t<<2&63]+"=")),i.join("")}var uc={};uc.read=function(e,t,n,r,i){var o,s,a=i*8-r-1,l=(1<<a)-1,u=l>>1,c=-7,p=n?i-1:0,d=n?-1:1,m=e[t+p];for(p+=d,o=m&(1<<-c)-1,m>>=-c,c+=a;c>0;o=o*256+e[t+p],p+=d,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=r;c>0;s=s*256+e[t+p],p+=d,c-=8);if(o===0)o=1-u;else{if(o===l)return s?NaN:(m?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-u}return(m?-1:1)*s*Math.pow(2,o-r)},uc.write=function(e,t,n,r,i,o){var s,a,l,u=o*8-i-1,c=(1<<u)-1,p=c>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:o-1,b=r?1:-1,w=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+p>=1?t+=d/l:t+=d*Math.pow(2,1-p),t*l>=2&&(s++,l/=2),s+p>=c?(a=0,s=c):s+p>=1?(a=(t*l-1)*Math.pow(2,i),s=s+p):(a=t*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;e[n+m]=a&255,m+=b,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[n+m]=s&255,m+=b,s/=256,u-=8);e[n+m-b]|=w*128};(function(e){const t=Qs,n=uc,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 i=2147483647;e.kMaxLength=i;const{Uint8Array:o,ArrayBuffer:s,SharedArrayBuffer:a}=globalThis;c.TYPED_ARRAY_SUPPORT=l(),!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 l(){try{const M=new o(1),k={foo:function(){return 42}};return Object.setPrototypeOf(k,o.prototype),Object.setPrototypeOf(M,k),M.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 u(M){if(M>i)throw new RangeError('The value "'+M+'" is invalid for option "size"');const k=new o(M);return Object.setPrototypeOf(k,c.prototype),k}function c(M,k,I){if(typeof M=="number"){if(typeof k=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return b(M)}return p(M,k,I)}c.poolSize=8192;function p(M,k,I){if(typeof M=="string")return w(M,k);if(s.isView(M))return y(M);if(M==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof M);if(Et(M,s)||M&&Et(M.buffer,s)||typeof a<"u"&&(Et(M,a)||M&&Et(M.buffer,a)))return g(M,k,I);if(typeof M=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const J=M.valueOf&&M.valueOf();if(J!=null&&J!==M)return c.from(J,k,I);const G=v(M);if(G)return G;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof M[Symbol.toPrimitive]=="function")return c.from(M[Symbol.toPrimitive]("string"),k,I);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof M)}c.from=function(M,k,I){return p(M,k,I)},Object.setPrototypeOf(c.prototype,o.prototype),Object.setPrototypeOf(c,o);function d(M){if(typeof M!="number")throw new TypeError('"size" argument must be of type number');if(M<0)throw new RangeError('The value "'+M+'" is invalid for option "size"')}function m(M,k,I){return d(M),M<=0?u(M):k!==void 0?typeof I=="string"?u(M).fill(k,I):u(M).fill(k):u(M)}c.alloc=function(M,k,I){return m(M,k,I)};function b(M){return d(M),u(M<0?0:h(M)|0)}c.allocUnsafe=function(M){return b(M)},c.allocUnsafeSlow=function(M){return b(M)};function w(M,k){if((typeof k!="string"||k==="")&&(k="utf8"),!c.isEncoding(k))throw new TypeError("Unknown encoding: "+k);const I=T(M,k)|0;let J=u(I);const G=J.write(M,k);return G!==I&&(J=J.slice(0,G)),J}function S(M){const k=M.length<0?0:h(M.length)|0,I=u(k);for(let J=0;J<k;J+=1)I[J]=M[J]&255;return I}function y(M){if(Et(M,o)){const k=new o(M);return g(k.buffer,k.byteOffset,k.byteLength)}return S(M)}function g(M,k,I){if(k<0||M.byteLength<k)throw new RangeError('"offset" is outside of buffer bounds');if(M.byteLength<k+(I||0))throw new RangeError('"length" is outside of buffer bounds');let J;return k===void 0&&I===void 0?J=new o(M):I===void 0?J=new o(M,k):J=new o(M,k,I),Object.setPrototypeOf(J,c.prototype),J}function v(M){if(c.isBuffer(M)){const k=h(M.length)|0,I=u(k);return I.length===0||M.copy(I,0,0,k),I}if(M.length!==void 0)return typeof M.length!="number"||Bt(M.length)?u(0):S(M);if(M.type==="Buffer"&&Array.isArray(M.data))return S(M.data)}function h(M){if(M>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return M|0}function E(M){return+M!=M&&(M=0),c.alloc(+M)}c.isBuffer=function(k){return k!=null&&k._isBuffer===!0&&k!==c.prototype},c.compare=function(k,I){if(Et(k,o)&&(k=c.from(k,k.offset,k.byteLength)),Et(I,o)&&(I=c.from(I,I.offset,I.byteLength)),!c.isBuffer(k)||!c.isBuffer(I))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(k===I)return 0;let J=k.length,G=I.length;for(let oe=0,ne=Math.min(J,G);oe<ne;++oe)if(k[oe]!==I[oe]){J=k[oe],G=I[oe];break}return J<G?-1:G<J?1:0},c.isEncoding=function(k){switch(String(k).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(k,I){if(!Array.isArray(k))throw new TypeError('"list" argument must be an Array of Buffers');if(k.length===0)return c.alloc(0);let J;if(I===void 0)for(I=0,J=0;J<k.length;++J)I+=k[J].length;const G=c.allocUnsafe(I);let oe=0;for(J=0;J<k.length;++J){let ne=k[J];if(Et(ne,o))oe+ne.length>G.length?(c.isBuffer(ne)||(ne=c.from(ne)),ne.copy(G,oe)):o.prototype.set.call(G,ne,oe);else if(c.isBuffer(ne))ne.copy(G,oe);else throw new TypeError('"list" argument must be an Array of Buffers');oe+=ne.length}return G};function T(M,k){if(c.isBuffer(M))return M.length;if(s.isView(M)||Et(M,s))return M.byteLength;if(typeof M!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof M);const I=M.length,J=arguments.length>2&&arguments[2]===!0;if(!J&&I===0)return 0;let G=!1;for(;;)switch(k){case"ascii":case"latin1":case"binary":return I;case"utf8":case"utf-8":return We(M).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I*2;case"hex":return I>>>1;case"base64":return Xe(M).length;default:if(G)return J?-1:We(M).length;k=(""+k).toLowerCase(),G=!0}}c.byteLength=T;function R(M,k,I){let J=!1;if((k===void 0||k<0)&&(k=0),k>this.length||((I===void 0||I>this.length)&&(I=this.length),I<=0)||(I>>>=0,k>>>=0,I<=k))return"";for(M||(M="utf8");;)switch(M){case"hex":return Q(this,k,I);case"utf8":case"utf-8":return Y(this,k,I);case"ascii":return ae(this,k,I);case"latin1":case"binary":return we(this,k,I);case"base64":return te(this,k,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie(this,k,I);default:if(J)throw new TypeError("Unknown encoding: "+M);M=(M+"").toLowerCase(),J=!0}}c.prototype._isBuffer=!0;function x(M,k,I){const J=M[k];M[k]=M[I],M[I]=J}c.prototype.swap16=function(){const k=this.length;if(k%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let I=0;I<k;I+=2)x(this,I,I+1);return this},c.prototype.swap32=function(){const k=this.length;if(k%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let I=0;I<k;I+=4)x(this,I,I+3),x(this,I+1,I+2);return this},c.prototype.swap64=function(){const k=this.length;if(k%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let I=0;I<k;I+=8)x(this,I,I+7),x(this,I+1,I+6),x(this,I+2,I+5),x(this,I+3,I+4);return this},c.prototype.toString=function(){const k=this.length;return k===0?"":arguments.length===0?Y(this,0,k):R.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(k){if(!c.isBuffer(k))throw new TypeError("Argument must be a Buffer");return this===k?!0:c.compare(this,k)===0},c.prototype.inspect=function(){let k="";const I=e.INSPECT_MAX_BYTES;return k=this.toString("hex",0,I).replace(/(.{2})/g,"$1 ").trim(),this.length>I&&(k+=" ... "),"<Buffer "+k+">"},r&&(c.prototype[r]=c.prototype.inspect),c.prototype.compare=function(k,I,J,G,oe){if(Et(k,o)&&(k=c.from(k,k.offset,k.byteLength)),!c.isBuffer(k))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof k);if(I===void 0&&(I=0),J===void 0&&(J=k?k.length:0),G===void 0&&(G=0),oe===void 0&&(oe=this.length),I<0||J>k.length||G<0||oe>this.length)throw new RangeError("out of range index");if(G>=oe&&I>=J)return 0;if(G>=oe)return-1;if(I>=J)return 1;if(I>>>=0,J>>>=0,G>>>=0,oe>>>=0,this===k)return 0;let ne=oe-G,Pe=J-I;const Le=Math.min(ne,Pe),qe=this.slice(G,oe),Ze=k.slice(I,J);for(let et=0;et<Le;++et)if(qe[et]!==Ze[et]){ne=qe[et],Pe=Ze[et];break}return ne<Pe?-1:Pe<ne?1:0};function A(M,k,I,J,G){if(M.length===0)return-1;if(typeof I=="string"?(J=I,I=0):I>2147483647?I=2147483647:I<-2147483648&&(I=-2147483648),I=+I,Bt(I)&&(I=G?0:M.length-1),I<0&&(I=M.length+I),I>=M.length){if(G)return-1;I=M.length-1}else if(I<0)if(G)I=0;else return-1;if(typeof k=="string"&&(k=c.from(k,J)),c.isBuffer(k))return k.length===0?-1:N(M,k,I,J,G);if(typeof k=="number")return k=k&255,typeof o.prototype.indexOf=="function"?G?o.prototype.indexOf.call(M,k,I):o.prototype.lastIndexOf.call(M,k,I):N(M,[k],I,J,G);throw new TypeError("val must be string, number or Buffer")}function N(M,k,I,J,G){let oe=1,ne=M.length,Pe=k.length;if(J!==void 0&&(J=String(J).toLowerCase(),J==="ucs2"||J==="ucs-2"||J==="utf16le"||J==="utf-16le")){if(M.length<2||k.length<2)return-1;oe=2,ne/=2,Pe/=2,I/=2}function Le(Ze,et){return oe===1?Ze[et]:Ze.readUInt16BE(et*oe)}let qe;if(G){let Ze=-1;for(qe=I;qe<ne;qe++)if(Le(M,qe)===Le(k,Ze===-1?0:qe-Ze)){if(Ze===-1&&(Ze=qe),qe-Ze+1===Pe)return Ze*oe}else Ze!==-1&&(qe-=qe-Ze),Ze=-1}else for(I+Pe>ne&&(I=ne-Pe),qe=I;qe>=0;qe--){let Ze=!0;for(let et=0;et<Pe;et++)if(Le(M,qe+et)!==Le(k,et)){Ze=!1;break}if(Ze)return qe}return-1}c.prototype.includes=function(k,I,J){return this.indexOf(k,I,J)!==-1},c.prototype.indexOf=function(k,I,J){return A(this,k,I,J,!0)},c.prototype.lastIndexOf=function(k,I,J){return A(this,k,I,J,!1)};function W(M,k,I,J){I=Number(I)||0;const G=M.length-I;J?(J=Number(J),J>G&&(J=G)):J=G;const oe=k.length;J>oe/2&&(J=oe/2);let ne;for(ne=0;ne<J;++ne){const Pe=parseInt(k.substr(ne*2,2),16);if(Bt(Pe))return ne;M[I+ne]=Pe}return ne}function O(M,k,I,J){return lt(We(k,M.length-I),M,I,J)}function D(M,k,I,J){return lt(Ge(k),M,I,J)}function V(M,k,I,J){return lt(Xe(k),M,I,J)}function L(M,k,I,J){return lt(Qe(k,M.length-I),M,I,J)}c.prototype.write=function(k,I,J,G){if(I===void 0)G="utf8",J=this.length,I=0;else if(J===void 0&&typeof I=="string")G=I,J=this.length,I=0;else if(isFinite(I))I=I>>>0,isFinite(J)?(J=J>>>0,G===void 0&&(G="utf8")):(G=J,J=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const oe=this.length-I;if((J===void 0||J>oe)&&(J=oe),k.length>0&&(J<0||I<0)||I>this.length)throw new RangeError("Attempt to write outside buffer bounds");G||(G="utf8");let ne=!1;for(;;)switch(G){case"hex":return W(this,k,I,J);case"utf8":case"utf-8":return O(this,k,I,J);case"ascii":case"latin1":case"binary":return D(this,k,I,J);case"base64":return V(this,k,I,J);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,k,I,J);default:if(ne)throw new TypeError("Unknown encoding: "+G);G=(""+G).toLowerCase(),ne=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function te(M,k,I){return k===0&&I===M.length?t.fromByteArray(M):t.fromByteArray(M.slice(k,I))}function Y(M,k,I){I=Math.min(M.length,I);const J=[];let G=k;for(;G<I;){const oe=M[G];let ne=null,Pe=oe>239?4:oe>223?3:oe>191?2:1;if(G+Pe<=I){let Le,qe,Ze,et;switch(Pe){case 1:oe<128&&(ne=oe);break;case 2:Le=M[G+1],(Le&192)===128&&(et=(oe&31)<<6|Le&63,et>127&&(ne=et));break;case 3:Le=M[G+1],qe=M[G+2],(Le&192)===128&&(qe&192)===128&&(et=(oe&15)<<12|(Le&63)<<6|qe&63,et>2047&&(et<55296||et>57343)&&(ne=et));break;case 4:Le=M[G+1],qe=M[G+2],Ze=M[G+3],(Le&192)===128&&(qe&192)===128&&(Ze&192)===128&&(et=(oe&15)<<18|(Le&63)<<12|(qe&63)<<6|Ze&63,et>65535&&et<1114112&&(ne=et))}}ne===null?(ne=65533,Pe=1):ne>65535&&(ne-=65536,J.push(ne>>>10&1023|55296),ne=56320|ne&1023),J.push(ne),G+=Pe}return he(J)}const se=4096;function he(M){const k=M.length;if(k<=se)return String.fromCharCode.apply(String,M);let I="",J=0;for(;J<k;)I+=String.fromCharCode.apply(String,M.slice(J,J+=se));return I}function ae(M,k,I){let J="";I=Math.min(M.length,I);for(let G=k;G<I;++G)J+=String.fromCharCode(M[G]&127);return J}function we(M,k,I){let J="";I=Math.min(M.length,I);for(let G=k;G<I;++G)J+=String.fromCharCode(M[G]);return J}function Q(M,k,I){const J=M.length;(!k||k<0)&&(k=0),(!I||I<0||I>J)&&(I=J);let G="";for(let oe=k;oe<I;++oe)G+=jt[M[oe]];return G}function ie(M,k,I){const J=M.slice(k,I);let G="";for(let oe=0;oe<J.length-1;oe+=2)G+=String.fromCharCode(J[oe]+J[oe+1]*256);return G}c.prototype.slice=function(k,I){const J=this.length;k=~~k,I=I===void 0?J:~~I,k<0?(k+=J,k<0&&(k=0)):k>J&&(k=J),I<0?(I+=J,I<0&&(I=0)):I>J&&(I=J),I<k&&(I=k);const G=this.subarray(k,I);return Object.setPrototypeOf(G,c.prototype),G};function ce(M,k,I){if(M%1!==0||M<0)throw new RangeError("offset is not uint");if(M+k>I)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(k,I,J){k=k>>>0,I=I>>>0,J||ce(k,I,this.length);let G=this[k],oe=1,ne=0;for(;++ne<I&&(oe*=256);)G+=this[k+ne]*oe;return G},c.prototype.readUintBE=c.prototype.readUIntBE=function(k,I,J){k=k>>>0,I=I>>>0,J||ce(k,I,this.length);let G=this[k+--I],oe=1;for(;I>0&&(oe*=256);)G+=this[k+--I]*oe;return G},c.prototype.readUint8=c.prototype.readUInt8=function(k,I){return k=k>>>0,I||ce(k,1,this.length),this[k]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(k,I){return k=k>>>0,I||ce(k,2,this.length),this[k]|this[k+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(k,I){return k=k>>>0,I||ce(k,2,this.length),this[k]<<8|this[k+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(k,I){return k=k>>>0,I||ce(k,4,this.length),(this[k]|this[k+1]<<8|this[k+2]<<16)+this[k+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(k,I){return k=k>>>0,I||ce(k,4,this.length),this[k]*16777216+(this[k+1]<<16|this[k+2]<<8|this[k+3])},c.prototype.readBigUInt64LE=ct(function(k){k=k>>>0,Oe(k,"offset");const I=this[k],J=this[k+7];(I===void 0||J===void 0)&&Ce(k,this.length-8);const G=I+this[++k]*2**8+this[++k]*2**16+this[++k]*2**24,oe=this[++k]+this[++k]*2**8+this[++k]*2**16+J*2**24;return BigInt(G)+(BigInt(oe)<<BigInt(32))}),c.prototype.readBigUInt64BE=ct(function(k){k=k>>>0,Oe(k,"offset");const I=this[k],J=this[k+7];(I===void 0||J===void 0)&&Ce(k,this.length-8);const G=I*2**24+this[++k]*2**16+this[++k]*2**8+this[++k],oe=this[++k]*2**24+this[++k]*2**16+this[++k]*2**8+J;return(BigInt(G)<<BigInt(32))+BigInt(oe)}),c.prototype.readIntLE=function(k,I,J){k=k>>>0,I=I>>>0,J||ce(k,I,this.length);let G=this[k],oe=1,ne=0;for(;++ne<I&&(oe*=256);)G+=this[k+ne]*oe;return oe*=128,G>=oe&&(G-=Math.pow(2,8*I)),G},c.prototype.readIntBE=function(k,I,J){k=k>>>0,I=I>>>0,J||ce(k,I,this.length);let G=I,oe=1,ne=this[k+--G];for(;G>0&&(oe*=256);)ne+=this[k+--G]*oe;return oe*=128,ne>=oe&&(ne-=Math.pow(2,8*I)),ne},c.prototype.readInt8=function(k,I){return k=k>>>0,I||ce(k,1,this.length),this[k]&128?(255-this[k]+1)*-1:this[k]},c.prototype.readInt16LE=function(k,I){k=k>>>0,I||ce(k,2,this.length);const J=this[k]|this[k+1]<<8;return J&32768?J|4294901760:J},c.prototype.readInt16BE=function(k,I){k=k>>>0,I||ce(k,2,this.length);const J=this[k+1]|this[k]<<8;return J&32768?J|4294901760:J},c.prototype.readInt32LE=function(k,I){return k=k>>>0,I||ce(k,4,this.length),this[k]|this[k+1]<<8|this[k+2]<<16|this[k+3]<<24},c.prototype.readInt32BE=function(k,I){return k=k>>>0,I||ce(k,4,this.length),this[k]<<24|this[k+1]<<16|this[k+2]<<8|this[k+3]},c.prototype.readBigInt64LE=ct(function(k){k=k>>>0,Oe(k,"offset");const I=this[k],J=this[k+7];(I===void 0||J===void 0)&&Ce(k,this.length-8);const G=this[k+4]+this[k+5]*2**8+this[k+6]*2**16+(J<<24);return(BigInt(G)<<BigInt(32))+BigInt(I+this[++k]*2**8+this[++k]*2**16+this[++k]*2**24)}),c.prototype.readBigInt64BE=ct(function(k){k=k>>>0,Oe(k,"offset");const I=this[k],J=this[k+7];(I===void 0||J===void 0)&&Ce(k,this.length-8);const G=(I<<24)+this[++k]*2**16+this[++k]*2**8+this[++k];return(BigInt(G)<<BigInt(32))+BigInt(this[++k]*2**24+this[++k]*2**16+this[++k]*2**8+J)}),c.prototype.readFloatLE=function(k,I){return k=k>>>0,I||ce(k,4,this.length),n.read(this,k,!0,23,4)},c.prototype.readFloatBE=function(k,I){return k=k>>>0,I||ce(k,4,this.length),n.read(this,k,!1,23,4)},c.prototype.readDoubleLE=function(k,I){return k=k>>>0,I||ce(k,8,this.length),n.read(this,k,!0,52,8)},c.prototype.readDoubleBE=function(k,I){return k=k>>>0,I||ce(k,8,this.length),n.read(this,k,!1,52,8)};function Ae(M,k,I,J,G,oe){if(!c.isBuffer(M))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>G||k<oe)throw new RangeError('"value" argument is out of bounds');if(I+J>M.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(k,I,J,G){if(k=+k,I=I>>>0,J=J>>>0,!G){const Pe=Math.pow(2,8*J)-1;Ae(this,k,I,J,Pe,0)}let oe=1,ne=0;for(this[I]=k&255;++ne<J&&(oe*=256);)this[I+ne]=k/oe&255;return I+J},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(k,I,J,G){if(k=+k,I=I>>>0,J=J>>>0,!G){const Pe=Math.pow(2,8*J)-1;Ae(this,k,I,J,Pe,0)}let oe=J-1,ne=1;for(this[I+oe]=k&255;--oe>=0&&(ne*=256);)this[I+oe]=k/ne&255;return I+J},c.prototype.writeUint8=c.prototype.writeUInt8=function(k,I,J){return k=+k,I=I>>>0,J||Ae(this,k,I,1,255,0),this[I]=k&255,I+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(k,I,J){return k=+k,I=I>>>0,J||Ae(this,k,I,2,65535,0),this[I]=k&255,this[I+1]=k>>>8,I+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(k,I,J){return k=+k,I=I>>>0,J||Ae(this,k,I,2,65535,0),this[I]=k>>>8,this[I+1]=k&255,I+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(k,I,J){return k=+k,I=I>>>0,J||Ae(this,k,I,4,4294967295,0),this[I+3]=k>>>24,this[I+2]=k>>>16,this[I+1]=k>>>8,this[I]=k&255,I+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(k,I,J){return k=+k,I=I>>>0,J||Ae(this,k,I,4,4294967295,0),this[I]=k>>>24,this[I+1]=k>>>16,this[I+2]=k>>>8,this[I+3]=k&255,I+4};function ee(M,k,I,J,G){De(k,J,G,M,I,7);let oe=Number(k&BigInt(4294967295));M[I++]=oe,oe=oe>>8,M[I++]=oe,oe=oe>>8,M[I++]=oe,oe=oe>>8,M[I++]=oe;let ne=Number(k>>BigInt(32)&BigInt(4294967295));return M[I++]=ne,ne=ne>>8,M[I++]=ne,ne=ne>>8,M[I++]=ne,ne=ne>>8,M[I++]=ne,I}function F(M,k,I,J,G){De(k,J,G,M,I,7);let oe=Number(k&BigInt(4294967295));M[I+7]=oe,oe=oe>>8,M[I+6]=oe,oe=oe>>8,M[I+5]=oe,oe=oe>>8,M[I+4]=oe;let ne=Number(k>>BigInt(32)&BigInt(4294967295));return M[I+3]=ne,ne=ne>>8,M[I+2]=ne,ne=ne>>8,M[I+1]=ne,ne=ne>>8,M[I]=ne,I+8}c.prototype.writeBigUInt64LE=ct(function(k,I=0){return ee(this,k,I,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=ct(function(k,I=0){return F(this,k,I,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(k,I,J,G){if(k=+k,I=I>>>0,!G){const Le=Math.pow(2,8*J-1);Ae(this,k,I,J,Le-1,-Le)}let oe=0,ne=1,Pe=0;for(this[I]=k&255;++oe<J&&(ne*=256);)k<0&&Pe===0&&this[I+oe-1]!==0&&(Pe=1),this[I+oe]=(k/ne>>0)-Pe&255;return I+J},c.prototype.writeIntBE=function(k,I,J,G){if(k=+k,I=I>>>0,!G){const Le=Math.pow(2,8*J-1);Ae(this,k,I,J,Le-1,-Le)}let oe=J-1,ne=1,Pe=0;for(this[I+oe]=k&255;--oe>=0&&(ne*=256);)k<0&&Pe===0&&this[I+oe+1]!==0&&(Pe=1),this[I+oe]=(k/ne>>0)-Pe&255;return I+J},c.prototype.writeInt8=function(k,I,J){return k=+k,I=I>>>0,J||Ae(this,k,I,1,127,-128),k<0&&(k=255+k+1),this[I]=k&255,I+1},c.prototype.writeInt16LE=function(k,I,J){return k=+k,I=I>>>0,J||Ae(this,k,I,2,32767,-32768),this[I]=k&255,this[I+1]=k>>>8,I+2},c.prototype.writeInt16BE=function(k,I,J){return k=+k,I=I>>>0,J||Ae(this,k,I,2,32767,-32768),this[I]=k>>>8,this[I+1]=k&255,I+2},c.prototype.writeInt32LE=function(k,I,J){return k=+k,I=I>>>0,J||Ae(this,k,I,4,2147483647,-2147483648),this[I]=k&255,this[I+1]=k>>>8,this[I+2]=k>>>16,this[I+3]=k>>>24,I+4},c.prototype.writeInt32BE=function(k,I,J){return k=+k,I=I>>>0,J||Ae(this,k,I,4,2147483647,-2147483648),k<0&&(k=4294967295+k+1),this[I]=k>>>24,this[I+1]=k>>>16,this[I+2]=k>>>8,this[I+3]=k&255,I+4},c.prototype.writeBigInt64LE=ct(function(k,I=0){return ee(this,k,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=ct(function(k,I=0){return F(this,k,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function C(M,k,I,J,G,oe){if(I+J>M.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("Index out of range")}function q(M,k,I,J,G){return k=+k,I=I>>>0,G||C(M,k,I,4),n.write(M,k,I,J,23,4),I+4}c.prototype.writeFloatLE=function(k,I,J){return q(this,k,I,!0,J)},c.prototype.writeFloatBE=function(k,I,J){return q(this,k,I,!1,J)};function K(M,k,I,J,G){return k=+k,I=I>>>0,G||C(M,k,I,8),n.write(M,k,I,J,52,8),I+8}c.prototype.writeDoubleLE=function(k,I,J){return K(this,k,I,!0,J)},c.prototype.writeDoubleBE=function(k,I,J){return K(this,k,I,!1,J)},c.prototype.copy=function(k,I,J,G){if(!c.isBuffer(k))throw new TypeError("argument should be a Buffer");if(J||(J=0),!G&&G!==0&&(G=this.length),I>=k.length&&(I=k.length),I||(I=0),G>0&&G<J&&(G=J),G===J||k.length===0||this.length===0)return 0;if(I<0)throw new RangeError("targetStart out of bounds");if(J<0||J>=this.length)throw new RangeError("Index out of range");if(G<0)throw new RangeError("sourceEnd out of bounds");G>this.length&&(G=this.length),k.length-I<G-J&&(G=k.length-I+J);const oe=G-J;return this===k&&typeof o.prototype.copyWithin=="function"?this.copyWithin(I,J,G):o.prototype.set.call(k,this.subarray(J,G),I),oe},c.prototype.fill=function(k,I,J,G){if(typeof k=="string"){if(typeof I=="string"?(G=I,I=0,J=this.length):typeof J=="string"&&(G=J,J=this.length),G!==void 0&&typeof G!="string")throw new TypeError("encoding must be a string");if(typeof G=="string"&&!c.isEncoding(G))throw new TypeError("Unknown encoding: "+G);if(k.length===1){const ne=k.charCodeAt(0);(G==="utf8"&&ne<128||G==="latin1")&&(k=ne)}}else typeof k=="number"?k=k&255:typeof k=="boolean"&&(k=Number(k));if(I<0||this.length<I||this.length<J)throw new RangeError("Out of range index");if(J<=I)return this;I=I>>>0,J=J===void 0?this.length:J>>>0,k||(k=0);let oe;if(typeof k=="number")for(oe=I;oe<J;++oe)this[oe]=k;else{const ne=c.isBuffer(k)?k:c.from(k,G),Pe=ne.length;if(Pe===0)throw new TypeError('The value "'+k+'" is invalid for argument "value"');for(oe=0;oe<J-I;++oe)this[oe+I]=ne[oe%Pe]}return this};const j={};function H(M,k,I){j[M]=class extends I{constructor(){super(),Object.defineProperty(this,"message",{value:k.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${M}]`,this.stack,delete this.name}get code(){return M}set code(G){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:G,writable:!0})}toString(){return`${this.name} [${M}]: ${this.message}`}}}H("ERR_BUFFER_OUT_OF_BOUNDS",function(M){return M?`${M} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),H("ERR_INVALID_ARG_TYPE",function(M,k){return`The "${M}" argument must be of type number. Received type ${typeof k}`},TypeError),H("ERR_OUT_OF_RANGE",function(M,k,I){let J=`The value of "${M}" is out of range.`,G=I;return Number.isInteger(I)&&Math.abs(I)>2**32?G=ge(String(I)):typeof I=="bigint"&&(G=String(I),(I>BigInt(2)**BigInt(32)||I<-(BigInt(2)**BigInt(32)))&&(G=ge(G)),G+="n"),J+=` It must be ${k}. Received ${G}`,J},RangeError);function ge(M){let k="",I=M.length;const J=M[0]==="-"?1:0;for(;I>=J+4;I-=3)k=`_${M.slice(I-3,I)}${k}`;return`${M.slice(0,I)}${k}`}function xe(M,k,I){Oe(k,"offset"),(M[k]===void 0||M[k+I]===void 0)&&Ce(k,M.length-(I+1))}function De(M,k,I,J,G,oe){if(M>I||M<k){const ne=typeof k=="bigint"?"n":"";let Pe;throw k===0||k===BigInt(0)?Pe=`>= 0${ne} and < 2${ne} ** ${(oe+1)*8}${ne}`:Pe=`>= -(2${ne} ** ${(oe+1)*8-1}${ne}) and < 2 ** ${(oe+1)*8-1}${ne}`,new j.ERR_OUT_OF_RANGE("value",Pe,M)}xe(J,G,oe)}function Oe(M,k){if(typeof M!="number")throw new j.ERR_INVALID_ARG_TYPE(k,"number",M)}function Ce(M,k,I){throw Math.floor(M)!==M?(Oe(M,I),new j.ERR_OUT_OF_RANGE("offset","an integer",M)):k<0?new j.ERR_BUFFER_OUT_OF_BOUNDS:new j.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${k}`,M)}const Fe=/[^+/0-9A-Za-z-_]/g;function ye(M){if(M=M.split("=")[0],M=M.trim().replace(Fe,""),M.length<2)return"";for(;M.length%4!==0;)M=M+"=";return M}function We(M,k){k=k||1/0;let I;const J=M.length;let G=null;const oe=[];for(let ne=0;ne<J;++ne){if(I=M.charCodeAt(ne),I>55295&&I<57344){if(!G){if(I>56319){(k-=3)>-1&&oe.push(239,191,189);continue}else if(ne+1===J){(k-=3)>-1&&oe.push(239,191,189);continue}G=I;continue}if(I<56320){(k-=3)>-1&&oe.push(239,191,189),G=I;continue}I=(G-55296<<10|I-56320)+65536}else G&&(k-=3)>-1&&oe.push(239,191,189);if(G=null,I<128){if((k-=1)<0)break;oe.push(I)}else if(I<2048){if((k-=2)<0)break;oe.push(I>>6|192,I&63|128)}else if(I<65536){if((k-=3)<0)break;oe.push(I>>12|224,I>>6&63|128,I&63|128)}else if(I<1114112){if((k-=4)<0)break;oe.push(I>>18|240,I>>12&63|128,I>>6&63|128,I&63|128)}else throw new Error("Invalid code point")}return oe}function Ge(M){const k=[];for(let I=0;I<M.length;++I)k.push(M.charCodeAt(I)&255);return k}function Qe(M,k){let I,J,G;const oe=[];for(let ne=0;ne<M.length&&!((k-=2)<0);++ne)I=M.charCodeAt(ne),J=I>>8,G=I%256,oe.push(G),oe.push(J);return oe}function Xe(M){return t.toByteArray(ye(M))}function lt(M,k,I,J){let G;for(G=0;G<J&&!(G+I>=k.length||G>=M.length);++G)k[G+I]=M[G];return G}function Et(M,k){return M instanceof k||M!=null&&M.constructor!=null&&M.constructor.name!=null&&M.constructor.name===k.name}function Bt(M){return M!==M}const jt=(function(){const M="0123456789abcdef",k=new Array(256);for(let I=0;I<16;++I){const J=I*16;for(let G=0;G<16;++G)k[J+G]=M[I]+M[G]}return k})();function ct(M){return typeof BigInt>"u"?Ne:M}function Ne(){throw new Error("BigInt not supported")}})(mm);const Kr=mm.Buffer;class ji extends Error{name="RuntimeError";constructor(t,...n){super([t,...n].filter(Boolean).join(", ")),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class Dx extends ji{name="ApiError"}const fc=(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)},dc=(e="")=>e.split("/").map(encodeURIComponent).join("/"),Nx=e=>{const t=[],n=(r,i="")=>Object.keys(r).forEach(o=>{Xl(r[o])?n(r[o],`${i}${o}.`):t.push(`${i}${o}`)});return n(e),t},pc=e=>{const t=e.startsWith("v")?e.slice(1):e,[n,r]=t.split("-"),[i,o,s]=n.split(".").map(Number);return{major:i,minor:o,patch:s,pre:r}},hc=(e,t)=>{const n=pc(e),r=pc(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 Lx{clientService;userStore;serverUrl;capability;available;constructor(t,n,r,i=le([])){this.clientService=t,this.userStore=n,this.serverUrl=r,this.capability=B(()=>{const o=f(i).filter(s=>s.enabled).sort((s,a)=>hc(a.version,s.version));return o.length?o[0]:null}),this.available=B(()=>!!f(this.capability)?.version)}async triggerDownload(t){if(!f(this.available))throw new ji("no archiver available");if((t.fileIds?.length||0)+(t.files?.length||0)===0)throw new ji("requested archive with empty list of resources");const n=this.buildDownloadUrl({...t});if(!n)throw new ji("download url could not be built");let r=t.publicToken?n:await this.clientService.ocs.signUrl(n,this.userStore.user?.onPremisesSamAccountName),i;if(t.publicLinkPassword)try{const o=await fetch(r,{headers:{...this.clientService.getRequestHeaders({useAuth:!1}),Authorization:"Basic "+Kr.from(["public",t.publicLinkPassword].join(":")).toString("base64")}});if(!o.ok)throw new re.HttpError("",o);const s=await o.blob();r=URL.createObjectURL(s),i=decodeURI(o.headers.get("content-disposition")?.split('"')[1])}catch{throw new Error("archive could not be fetched")}return fc(r,i),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 ji("no archiver available");const t=f(this.capability);return/^https?:\/\//i.test(t.archiver_url)?t.archiver_url:re.urlJoin(this.serverUrl,t.archiver_url)}}const $x=new lm({ttl:10*1e3,capacity:250});class Mx{get filePreview(){return $x}}const mc=new Mx;class gc{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 "+Kr.from(["public",this.publicLinkPassword].join(":")).toString("base64")},...this.accessToken&&!this.publicLinkPassword&&!this.publicLinkToken&&{Authorization:"Bearer "+this.accessToken}}}}class yc{instance;cancelToken;constructor(t,n){this.cancelToken=us.CancelToken.source(),this.instance=us.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 Co({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 i=await this.instance[t](n,this.obtainConfig(r));return this.processResponse(i,r)}async internalRequestWithData(t,n,r,i){const o=await this.instance[t](n,r,this.obtainConfig(i));return this.processResponse(o,i)}}class Bx extends Error{name="RetriableError"}const jx=15e3;class Ux{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 SS.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 Bx},onerror:t=>{console.error(t);const n=new CustomEvent("error",{detail:t});return this.onerror?.bind(this)(n),3e4+Math.floor(Math.random()*jx)}})}fetchProvider(...t){const[n,r]=t,i={...r,...this.fetchOptions};return window.fetch(n,i)}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 vc=null;const Vx=(e,t)=>(vc||(vc=new Ux(new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse",e).href,t)),vc),qx=(e,t)=>({headers:{Authorization:`Bearer ${e.accessToken}`,"Accept-Language":t,"X-Request-ID":Xt.v4(),"X-Requested-With":"XMLHttpRequest"}});class zx{configStore;language;authStore;httpAuthenticatedClient;httpUnAuthenticatedClient;graphClient;ocsClient;webDavClient;initiatorId=Xt.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 yc({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.httpUnAuthenticatedClient=new yc({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 Vx(this.configStore.serverUrl,qx({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=us.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.graphClient=re.graph(this.configStore.serverUrl,t)}initOcsClient(){const t=us.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.ocsClient=re.ocs(this.configStore.serverUrl,t)}initWebDavClient(){this.webDavClient=re.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 "+Kr.from(["public",this.authStore.publicLinkPassword].join(":")).toString("base64")),t})}getDynamicHeaders({useAuth:t=!0}={}){return{"Accept-Language":this.currentLanguage,"X-Request-ID":Xt.v4(),...t&&{Authorization:"Bearer "+this.authStore.accessToken}}}}class ym{topics;constructor(){this.topics=new Map}subscribe(t,n){const r={token:Xt.v4(),callback:n},i=[r,...this.topics.get(t)||[]];return this.topics.set(t,i),r.token}publish(t,n){(this.topics.get(t)||[]).forEach(i=>i.callback(n))}unsubscribe(t,n){this.topics.has(t)&&this.topics.set(t,this.topics.get(t).filter(r=>r.token!==n))}}const Je=new ym;class vm{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 Xs=e=>({value:e,type:null}),Wx=e=>Xs(e),gt=e=>Xs(e),Ys=e=>Xs(e),Hx=e=>Xs(e),Kx={Permissions:gt("permissions"),IsFavorite:Ys("favorite"),FileId:gt("fileid"),FileParent:gt("file-parent"),Name:gt("name"),OwnerId:gt("owner-id"),OwnerDisplayName:gt("owner-display-name"),PrivateLink:gt("privatelink"),ContentLength:Ys("getcontentlength"),ContentSize:Ys("size"),LastModifiedDate:gt("getlastmodified"),Tags:Wx("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:gt("getetag"),MimeType:gt("getcontenttype"),ResourceType:Hx("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:gt("owner"),LockTime:gt("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:gt("downloadURL"),Highlights:gt("highlights"),MetaPathForUser:gt("meta-path-for-user"),RemoteItemId:gt("remote-item-id"),HasPreview:Ys("has-preview"),ShareId:gt("shareid"),ShareRoot:gt("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:gt("share-permissions"),TrashbinOriginalFilename:gt("trashbin-original-filename"),TrashbinOriginalLocation:gt("trashbin-original-location"),TrashbinDeletedDate:gt("trashbin-delete-datetime"),PublicLinkItemType:gt("public-link-item-type"),PublicLinkPermission:gt("public-link-permission"),PublicLinkExpiration:gt("public-link-expiration"),PublicLinkShareDate:gt("public-link-share-datetime"),PublicLinkShareOwner:gt("public-link-share-owner")},Ve=Object.fromEntries(Object.entries(Kx).map(([e,t])=>[e,t.value]));class ko{static Default=[Ve.Permissions,Ve.IsFavorite,Ve.FileId,Ve.FileParent,Ve.Name,Ve.LockDiscovery,Ve.ActiveLock,Ve.OwnerId,Ve.OwnerDisplayName,Ve.RemoteItemId,Ve.ShareRoot,Ve.ShareTypes,Ve.PrivateLink,Ve.ContentLength,Ve.ContentSize,Ve.LastModifiedDate,Ve.ETag,Ve.MimeType,Ve.ResourceType,Ve.Tags,Ve.Audio,Ve.Location,Ve.Image,Ve.Photo,Ve.HasPreview];static PublicLink=ko.Default.concat([Ve.PublicLinkItemType,Ve.PublicLinkPermission,Ve.PublicLinkExpiration,Ve.PublicLinkShareDate,Ve.PublicLinkShareOwner]);static Trashbin=[Ve.ContentLength,Ve.ResourceType,Ve.TrashbinOriginalLocation,Ve.TrashbinOriginalFilename,Ve.TrashbinDeletedDate,Ve.Permissions,Ve.FileParent];static DavNamespace=[Ve.ContentLength,Ve.LastModifiedDate,Ve.ETag,Ve.MimeType,Ve.ResourceType,Ve.LockDiscovery,Ve.ActiveLock]}var Gx="[object Symbol]";function Js(e){return typeof e=="symbol"||or(e)&&ii(e)==Gx}var Qx=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xx=/^\w*$/;function Yx(e,t){if(Hn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Js(e)?!0:Xx.test(e)||!Qx.test(e)||t!=null&&e in Object(t)}var Jx="Expected a function";function bc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Jx);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(bc.Cache||Tr),n}bc.Cache=Tr;var Zx=500;function eR(e){var t=bc(e,function(r){return n.size===Zx&&n.clear(),r}),n=t.cache;return t}var tR=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nR=/\\(\\)?/g,rR=eR(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(tR,function(n,r,i,o){t.push(i?o.replace(nR,"$1"):r||n)}),t});function bm(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var wm=On?On.prototype:void 0,Sm=wm?wm.toString:void 0;function Em(e){if(typeof e=="string")return e;if(Hn(e))return bm(e,Em)+"";if(Js(e))return Sm?Sm.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function wc(e){return e==null?"":Em(e)}function Sc(e,t){return Hn(e)?e:Yx(e,t)?[e]:rR(wc(e))}function Tm(e){if(typeof e=="string"||Js(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Am(e,t){t=Sc(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Tm(t[n++])];return n&&n==r?e:void 0}function Ec(e,t,n){var r=e==null?void 0:Am(e,t);return r===void 0?n:r}var Tc={},Zs={exports:{}},xm;function Ac(){if(xm)return Zs.exports;xm=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(E,T,R){return Function.prototype.apply.call(E,T,R)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(E){return Object.getOwnPropertyNames(E).concat(Object.getOwnPropertySymbols(E))}:n=function(E){return Object.getOwnPropertyNames(E)};function r(h){console&&console.warn&&console.warn(h)}var i=Number.isNaN||function(E){return E!==E};function o(){o.init.call(this)}Zs.exports=o,Zs.exports.once=y,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(h){if(typeof h!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof h)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(h){if(typeof h!="number"||h<0||i(h))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+h+".");s=h}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(E){if(typeof E!="number"||E<0||i(E))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+E+".");return this._maxListeners=E,this};function l(h){return h._maxListeners===void 0?o.defaultMaxListeners:h._maxListeners}o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(E){for(var T=[],R=1;R<arguments.length;R++)T.push(arguments[R]);var x=E==="error",A=this._events;if(A!==void 0)x=x&&A.error===void 0;else if(!x)return!1;if(x){var N;if(T.length>0&&(N=T[0]),N instanceof Error)throw N;var W=new Error("Unhandled error."+(N?" ("+N.message+")":""));throw W.context=N,W}var O=A[E];if(O===void 0)return!1;if(typeof O=="function")t(O,this,T);else for(var D=O.length,V=b(O,D),R=0;R<D;++R)t(V[R],this,T);return!0};function u(h,E,T,R){var x,A,N;if(a(T),A=h._events,A===void 0?(A=h._events=Object.create(null),h._eventsCount=0):(A.newListener!==void 0&&(h.emit("newListener",E,T.listener?T.listener:T),A=h._events),N=A[E]),N===void 0)N=A[E]=T,++h._eventsCount;else if(typeof N=="function"?N=A[E]=R?[T,N]:[N,T]:R?N.unshift(T):N.push(T),x=l(h),x>0&&N.length>x&&!N.warned){N.warned=!0;var W=new Error("Possible EventEmitter memory leak detected. "+N.length+" "+String(E)+" listeners added. Use emitter.setMaxListeners() to increase limit");W.name="MaxListenersExceededWarning",W.emitter=h,W.type=E,W.count=N.length,r(W)}return h}o.prototype.addListener=function(E,T){return u(this,E,T,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(E,T){return u(this,E,T,!0)};function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(h,E,T){var R={fired:!1,wrapFn:void 0,target:h,type:E,listener:T},x=c.bind(R);return x.listener=T,R.wrapFn=x,x}o.prototype.once=function(E,T){return a(T),this.on(E,p(this,E,T)),this},o.prototype.prependOnceListener=function(E,T){return a(T),this.prependListener(E,p(this,E,T)),this},o.prototype.removeListener=function(E,T){var R,x,A,N,W;if(a(T),x=this._events,x===void 0)return this;if(R=x[E],R===void 0)return this;if(R===T||R.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete x[E],x.removeListener&&this.emit("removeListener",E,R.listener||T));else if(typeof R!="function"){for(A=-1,N=R.length-1;N>=0;N--)if(R[N]===T||R[N].listener===T){W=R[N].listener,A=N;break}if(A<0)return this;A===0?R.shift():w(R,A),R.length===1&&(x[E]=R[0]),x.removeListener!==void 0&&this.emit("removeListener",E,W||T)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(E){var T,R,x;if(R=this._events,R===void 0)return this;if(R.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):R[E]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete R[E]),this;if(arguments.length===0){var A=Object.keys(R),N;for(x=0;x<A.length;++x)N=A[x],N!=="removeListener"&&this.removeAllListeners(N);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=R[E],typeof T=="function")this.removeListener(E,T);else if(T!==void 0)for(x=T.length-1;x>=0;x--)this.removeListener(E,T[x]);return this};function d(h,E,T){var R=h._events;if(R===void 0)return[];var x=R[E];return x===void 0?[]:typeof x=="function"?T?[x.listener||x]:[x]:T?S(x):b(x,x.length)}o.prototype.listeners=function(E){return d(this,E,!0)},o.prototype.rawListeners=function(E){return d(this,E,!1)},o.listenerCount=function(h,E){return typeof h.listenerCount=="function"?h.listenerCount(E):m.call(h,E)},o.prototype.listenerCount=m;function m(h){var E=this._events;if(E!==void 0){var T=E[h];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function b(h,E){for(var T=new Array(E),R=0;R<E;++R)T[R]=h[R];return T}function w(h,E){for(;E+1<h.length;E++)h[E]=h[E+1];h.pop()}function S(h){for(var E=new Array(h.length),T=0;T<E.length;++T)E[T]=h[T].listener||h[T];return E}function y(h,E){return new Promise(function(T,R){function x(N){h.removeListener(E,A),R(N)}function A(){typeof h.removeListener=="function"&&h.removeListener("error",x),T([].slice.call(arguments))}v(h,E,A,{once:!0}),E!=="error"&&g(h,x,{once:!0})})}function g(h,E,T){typeof h.on=="function"&&v(h,"error",E,T)}function v(h,E,T,R){if(typeof h.on=="function")R.once?h.once(E,T):h.on(E,T);else if(typeof h.addEventListener=="function")h.addEventListener(E,function x(A){R.once&&h.removeEventListener(E,x),T(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof h)}return Zs.exports}var ea={exports:{}},Rm;function ui(){return Rm||(Rm=1,typeof Object.create=="function"?ea.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:ea.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}}),ea.exports}var xc,Cm;function km(){return Cm||(Cm=1,xc=Ac().EventEmitter),xc}var Rc={},Pm;function ta(){return Pm||(Pm=1,(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},n={};n.byteLength=c,n.toByteArray=d,n.fromByteArray=w;for(var r=[],i=[],o=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a<l;++a)r[a]=s[a],i[s.charCodeAt(a)]=a;i[45]=62,i[95]=63;function u(g){var v=g.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var h=g.indexOf("=");h===-1&&(h=v);var E=h===v?0:4-h%4;return[h,E]}function c(g){var v=u(g),h=v[0],E=v[1];return(h+E)*3/4-E}function p(g,v,h){return(v+h)*3/4-h}function d(g){var v,h=u(g),E=h[0],T=h[1],R=new o(p(g,E,T)),x=0,A=T>0?E-4:E,N;for(N=0;N<A;N+=4)v=i[g.charCodeAt(N)]<<18|i[g.charCodeAt(N+1)]<<12|i[g.charCodeAt(N+2)]<<6|i[g.charCodeAt(N+3)],R[x++]=v>>16&255,R[x++]=v>>8&255,R[x++]=v&255;return T===2&&(v=i[g.charCodeAt(N)]<<2|i[g.charCodeAt(N+1)]>>4,R[x++]=v&255),T===1&&(v=i[g.charCodeAt(N)]<<10|i[g.charCodeAt(N+1)]<<4|i[g.charCodeAt(N+2)]>>2,R[x++]=v>>8&255,R[x++]=v&255),R}function m(g){return r[g>>18&63]+r[g>>12&63]+r[g>>6&63]+r[g&63]}function b(g,v,h){for(var E,T=[],R=v;R<h;R+=3)E=(g[R]<<16&16711680)+(g[R+1]<<8&65280)+(g[R+2]&255),T.push(m(E));return T.join("")}function w(g){for(var v,h=g.length,E=h%3,T=[],R=16383,x=0,A=h-E;x<A;x+=R)T.push(b(g,x,x+R>A?A:x+R));return E===1?(v=g[h-1],T.push(r[v>>2]+r[v<<4&63]+"==")):E===2&&(v=(g[h-2]<<8)+g[h-1],T.push(r[v>>10]+r[v>>4&63]+r[v<<2&63]+"=")),T.join("")}var S={};S.read=function(g,v,h,E,T){var R,x,A=T*8-E-1,N=(1<<A)-1,W=N>>1,O=-7,D=h?T-1:0,V=h?-1:1,L=g[v+D];for(D+=V,R=L&(1<<-O)-1,L>>=-O,O+=A;O>0;R=R*256+g[v+D],D+=V,O-=8);for(x=R&(1<<-O)-1,R>>=-O,O+=E;O>0;x=x*256+g[v+D],D+=V,O-=8);if(R===0)R=1-W;else{if(R===N)return x?NaN:(L?-1:1)*(1/0);x=x+Math.pow(2,E),R=R-W}return(L?-1:1)*x*Math.pow(2,R-E)},S.write=function(g,v,h,E,T,R){var x,A,N,W=R*8-T-1,O=(1<<W)-1,D=O>>1,V=T===23?Math.pow(2,-24)-Math.pow(2,-77):0,L=E?0:R-1,te=E?1:-1,Y=v<0||v===0&&1/v<0?1:0;for(v=Math.abs(v),isNaN(v)||v===1/0?(A=isNaN(v)?1:0,x=O):(x=Math.floor(Math.log(v)/Math.LN2),v*(N=Math.pow(2,-x))<1&&(x--,N*=2),x+D>=1?v+=V/N:v+=V*Math.pow(2,1-D),v*N>=2&&(x++,N/=2),x+D>=O?(A=0,x=O):x+D>=1?(A=(v*N-1)*Math.pow(2,T),x=x+D):(A=v*Math.pow(2,D-1)*Math.pow(2,T),x=0));T>=8;g[h+L]=A&255,L+=te,A/=256,T-=8);for(x=x<<T|A,W+=T;W>0;g[h+L]=x&255,L+=te,x/=256,W-=8);g[h+L-te]|=Y*128};(function(g){const v=n,h=S,E=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;g.Buffer=O,g.SlowBuffer=ie,g.INSPECT_MAX_BYTES=50;const T=2147483647;g.kMaxLength=T;const{Uint8Array:R,ArrayBuffer:x,SharedArrayBuffer:A}=globalThis;O.TYPED_ARRAY_SUPPORT=N(),!O.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 N(){try{const U=new R(1),P={foo:function(){return 42}};return Object.setPrototypeOf(P,R.prototype),Object.setPrototypeOf(U,P),U.foo()===42}catch{return!1}}Object.defineProperty(O.prototype,"parent",{enumerable:!0,get:function(){if(O.isBuffer(this))return this.buffer}}),Object.defineProperty(O.prototype,"offset",{enumerable:!0,get:function(){if(O.isBuffer(this))return this.byteOffset}});function W(U){if(U>T)throw new RangeError('The value "'+U+'" is invalid for option "size"');const P=new R(U);return Object.setPrototypeOf(P,O.prototype),P}function O(U,P,_){if(typeof U=="number"){if(typeof P=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return te(U)}return D(U,P,_)}O.poolSize=8192;function D(U,P,_){if(typeof U=="string")return Y(U,P);if(x.isView(U))return he(U);if(U==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U);if(qt(U,x)||U&&qt(U.buffer,x)||typeof A<"u"&&(qt(U,A)||U&&qt(U.buffer,A)))return ae(U,P,_);if(typeof U=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Z=U.valueOf&&U.valueOf();if(Z!=null&&Z!==U)return O.from(Z,P,_);const ue=we(U);if(ue)return ue;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof U[Symbol.toPrimitive]=="function")return O.from(U[Symbol.toPrimitive]("string"),P,_);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U)}O.from=function(U,P,_){return D(U,P,_)},Object.setPrototypeOf(O.prototype,R.prototype),Object.setPrototypeOf(O,R);function V(U){if(typeof U!="number")throw new TypeError('"size" argument must be of type number');if(U<0)throw new RangeError('The value "'+U+'" is invalid for option "size"')}function L(U,P,_){return V(U),U<=0?W(U):P!==void 0?typeof _=="string"?W(U).fill(P,_):W(U).fill(P):W(U)}O.alloc=function(U,P,_){return L(U,P,_)};function te(U){return V(U),W(U<0?0:Q(U)|0)}O.allocUnsafe=function(U){return te(U)},O.allocUnsafeSlow=function(U){return te(U)};function Y(U,P){if((typeof P!="string"||P==="")&&(P="utf8"),!O.isEncoding(P))throw new TypeError("Unknown encoding: "+P);const _=ce(U,P)|0;let Z=W(_);const ue=Z.write(U,P);return ue!==_&&(Z=Z.slice(0,ue)),Z}function se(U){const P=U.length<0?0:Q(U.length)|0,_=W(P);for(let Z=0;Z<P;Z+=1)_[Z]=U[Z]&255;return _}function he(U){if(qt(U,R)){const P=new R(U);return ae(P.buffer,P.byteOffset,P.byteLength)}return se(U)}function ae(U,P,_){if(P<0||U.byteLength<P)throw new RangeError('"offset" is outside of buffer bounds');if(U.byteLength<P+(_||0))throw new RangeError('"length" is outside of buffer bounds');let Z;return P===void 0&&_===void 0?Z=new R(U):_===void 0?Z=new R(U,P):Z=new R(U,P,_),Object.setPrototypeOf(Z,O.prototype),Z}function we(U){if(O.isBuffer(U)){const P=Q(U.length)|0,_=W(P);return _.length===0||U.copy(_,0,0,P),_}if(U.length!==void 0)return typeof U.length!="number"||Nr(U.length)?W(0):se(U);if(U.type==="Buffer"&&Array.isArray(U.data))return se(U.data)}function Q(U){if(U>=T)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+T.toString(16)+" bytes");return U|0}function ie(U){return+U!=U&&(U=0),O.alloc(+U)}O.isBuffer=function(P){return P!=null&&P._isBuffer===!0&&P!==O.prototype},O.compare=function(P,_){if(qt(P,R)&&(P=O.from(P,P.offset,P.byteLength)),qt(_,R)&&(_=O.from(_,_.offset,_.byteLength)),!O.isBuffer(P)||!O.isBuffer(_))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(P===_)return 0;let Z=P.length,ue=_.length;for(let Se=0,ke=Math.min(Z,ue);Se<ke;++Se)if(P[Se]!==_[Se]){Z=P[Se],ue=_[Se];break}return Z<ue?-1:ue<Z?1:0},O.isEncoding=function(P){switch(String(P).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}},O.concat=function(P,_){if(!Array.isArray(P))throw new TypeError('"list" argument must be an Array of Buffers');if(P.length===0)return O.alloc(0);let Z;if(_===void 0)for(_=0,Z=0;Z<P.length;++Z)_+=P[Z].length;const ue=O.allocUnsafe(_);let Se=0;for(Z=0;Z<P.length;++Z){let ke=P[Z];if(qt(ke,R))Se+ke.length>ue.length?(O.isBuffer(ke)||(ke=O.from(ke)),ke.copy(ue,Se)):R.prototype.set.call(ue,ke,Se);else if(O.isBuffer(ke))ke.copy(ue,Se);else throw new TypeError('"list" argument must be an Array of Buffers');Se+=ke.length}return ue};function ce(U,P){if(O.isBuffer(U))return U.length;if(x.isView(U)||qt(U,x))return U.byteLength;if(typeof U!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof U);const _=U.length,Z=arguments.length>2&&arguments[2]===!0;if(!Z&&_===0)return 0;let ue=!1;for(;;)switch(P){case"ascii":case"latin1":case"binary":return _;case"utf8":case"utf-8":return Le(U).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _*2;case"hex":return _>>>1;case"base64":return et(U).length;default:if(ue)return Z?-1:Le(U).length;P=(""+P).toLowerCase(),ue=!0}}O.byteLength=ce;function Ae(U,P,_){let Z=!1;if((P===void 0||P<0)&&(P=0),P>this.length||((_===void 0||_>this.length)&&(_=this.length),_<=0)||(_>>>=0,P>>>=0,_<=P))return"";for(U||(U="utf8");;)switch(U){case"hex":return We(this,P,_);case"utf8":case"utf-8":return De(this,P,_);case"ascii":return Fe(this,P,_);case"latin1":case"binary":return ye(this,P,_);case"base64":return xe(this,P,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ge(this,P,_);default:if(Z)throw new TypeError("Unknown encoding: "+U);U=(U+"").toLowerCase(),Z=!0}}O.prototype._isBuffer=!0;function ee(U,P,_){const Z=U[P];U[P]=U[_],U[_]=Z}O.prototype.swap16=function(){const P=this.length;if(P%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let _=0;_<P;_+=2)ee(this,_,_+1);return this},O.prototype.swap32=function(){const P=this.length;if(P%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let _=0;_<P;_+=4)ee(this,_,_+3),ee(this,_+1,_+2);return this},O.prototype.swap64=function(){const P=this.length;if(P%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let _=0;_<P;_+=8)ee(this,_,_+7),ee(this,_+1,_+6),ee(this,_+2,_+5),ee(this,_+3,_+4);return this},O.prototype.toString=function(){const P=this.length;return P===0?"":arguments.length===0?De(this,0,P):Ae.apply(this,arguments)},O.prototype.toLocaleString=O.prototype.toString,O.prototype.equals=function(P){if(!O.isBuffer(P))throw new TypeError("Argument must be a Buffer");return this===P?!0:O.compare(this,P)===0},O.prototype.inspect=function(){let P="";const _=g.INSPECT_MAX_BYTES;return P=this.toString("hex",0,_).replace(/(.{2})/g,"$1 ").trim(),this.length>_&&(P+=" ... "),"<Buffer "+P+">"},E&&(O.prototype[E]=O.prototype.inspect),O.prototype.compare=function(P,_,Z,ue,Se){if(qt(P,R)&&(P=O.from(P,P.offset,P.byteLength)),!O.isBuffer(P))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof P);if(_===void 0&&(_=0),Z===void 0&&(Z=P?P.length:0),ue===void 0&&(ue=0),Se===void 0&&(Se=this.length),_<0||Z>P.length||ue<0||Se>this.length)throw new RangeError("out of range index");if(ue>=Se&&_>=Z)return 0;if(ue>=Se)return-1;if(_>=Z)return 1;if(_>>>=0,Z>>>=0,ue>>>=0,Se>>>=0,this===P)return 0;let ke=Se-ue,rt=Z-_;const _t=Math.min(ke,rt),Pt=this.slice(ue,Se),Dt=P.slice(_,Z);for(let wt=0;wt<_t;++wt)if(Pt[wt]!==Dt[wt]){ke=Pt[wt],rt=Dt[wt];break}return ke<rt?-1:rt<ke?1:0};function F(U,P,_,Z,ue){if(U.length===0)return-1;if(typeof _=="string"?(Z=_,_=0):_>2147483647?_=2147483647:_<-2147483648&&(_=-2147483648),_=+_,Nr(_)&&(_=ue?0:U.length-1),_<0&&(_=U.length+_),_>=U.length){if(ue)return-1;_=U.length-1}else if(_<0)if(ue)_=0;else return-1;if(typeof P=="string"&&(P=O.from(P,Z)),O.isBuffer(P))return P.length===0?-1:C(U,P,_,Z,ue);if(typeof P=="number")return P=P&255,typeof R.prototype.indexOf=="function"?ue?R.prototype.indexOf.call(U,P,_):R.prototype.lastIndexOf.call(U,P,_):C(U,[P],_,Z,ue);throw new TypeError("val must be string, number or Buffer")}function C(U,P,_,Z,ue){let Se=1,ke=U.length,rt=P.length;if(Z!==void 0&&(Z=String(Z).toLowerCase(),Z==="ucs2"||Z==="ucs-2"||Z==="utf16le"||Z==="utf-16le")){if(U.length<2||P.length<2)return-1;Se=2,ke/=2,rt/=2,_/=2}function _t(Dt,wt){return Se===1?Dt[wt]:Dt.readUInt16BE(wt*Se)}let Pt;if(ue){let Dt=-1;for(Pt=_;Pt<ke;Pt++)if(_t(U,Pt)===_t(P,Dt===-1?0:Pt-Dt)){if(Dt===-1&&(Dt=Pt),Pt-Dt+1===rt)return Dt*Se}else Dt!==-1&&(Pt-=Pt-Dt),Dt=-1}else for(_+rt>ke&&(_=ke-rt),Pt=_;Pt>=0;Pt--){let Dt=!0;for(let wt=0;wt<rt;wt++)if(_t(U,Pt+wt)!==_t(P,wt)){Dt=!1;break}if(Dt)return Pt}return-1}O.prototype.includes=function(P,_,Z){return this.indexOf(P,_,Z)!==-1},O.prototype.indexOf=function(P,_,Z){return F(this,P,_,Z,!0)},O.prototype.lastIndexOf=function(P,_,Z){return F(this,P,_,Z,!1)};function q(U,P,_,Z){_=Number(_)||0;const ue=U.length-_;Z?(Z=Number(Z),Z>ue&&(Z=ue)):Z=ue;const Se=P.length;Z>Se/2&&(Z=Se/2);let ke;for(ke=0;ke<Z;++ke){const rt=parseInt(P.substr(ke*2,2),16);if(Nr(rt))return ke;U[_+ke]=rt}return ke}function K(U,P,_,Z){return Dr(Le(P,U.length-_),U,_,Z)}function j(U,P,_,Z){return Dr(qe(P),U,_,Z)}function H(U,P,_,Z){return Dr(et(P),U,_,Z)}function ge(U,P,_,Z){return Dr(Ze(P,U.length-_),U,_,Z)}O.prototype.write=function(P,_,Z,ue){if(_===void 0)ue="utf8",Z=this.length,_=0;else if(Z===void 0&&typeof _=="string")ue=_,Z=this.length,_=0;else if(isFinite(_))_=_>>>0,isFinite(Z)?(Z=Z>>>0,ue===void 0&&(ue="utf8")):(ue=Z,Z=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Se=this.length-_;if((Z===void 0||Z>Se)&&(Z=Se),P.length>0&&(Z<0||_<0)||_>this.length)throw new RangeError("Attempt to write outside buffer bounds");ue||(ue="utf8");let ke=!1;for(;;)switch(ue){case"hex":return q(this,P,_,Z);case"utf8":case"utf-8":return K(this,P,_,Z);case"ascii":case"latin1":case"binary":return j(this,P,_,Z);case"base64":return H(this,P,_,Z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ge(this,P,_,Z);default:if(ke)throw new TypeError("Unknown encoding: "+ue);ue=(""+ue).toLowerCase(),ke=!0}},O.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function xe(U,P,_){return P===0&&_===U.length?v.fromByteArray(U):v.fromByteArray(U.slice(P,_))}function De(U,P,_){_=Math.min(U.length,_);const Z=[];let ue=P;for(;ue<_;){const Se=U[ue];let ke=null,rt=Se>239?4:Se>223?3:Se>191?2:1;if(ue+rt<=_){let _t,Pt,Dt,wt;switch(rt){case 1:Se<128&&(ke=Se);break;case 2:_t=U[ue+1],(_t&192)===128&&(wt=(Se&31)<<6|_t&63,wt>127&&(ke=wt));break;case 3:_t=U[ue+1],Pt=U[ue+2],(_t&192)===128&&(Pt&192)===128&&(wt=(Se&15)<<12|(_t&63)<<6|Pt&63,wt>2047&&(wt<55296||wt>57343)&&(ke=wt));break;case 4:_t=U[ue+1],Pt=U[ue+2],Dt=U[ue+3],(_t&192)===128&&(Pt&192)===128&&(Dt&192)===128&&(wt=(Se&15)<<18|(_t&63)<<12|(Pt&63)<<6|Dt&63,wt>65535&&wt<1114112&&(ke=wt))}}ke===null?(ke=65533,rt=1):ke>65535&&(ke-=65536,Z.push(ke>>>10&1023|55296),ke=56320|ke&1023),Z.push(ke),ue+=rt}return Ce(Z)}const Oe=4096;function Ce(U){const P=U.length;if(P<=Oe)return String.fromCharCode.apply(String,U);let _="",Z=0;for(;Z<P;)_+=String.fromCharCode.apply(String,U.slice(Z,Z+=Oe));return _}function Fe(U,P,_){let Z="";_=Math.min(U.length,_);for(let ue=P;ue<_;++ue)Z+=String.fromCharCode(U[ue]&127);return Z}function ye(U,P,_){let Z="";_=Math.min(U.length,_);for(let ue=P;ue<_;++ue)Z+=String.fromCharCode(U[ue]);return Z}function We(U,P,_){const Z=U.length;(!P||P<0)&&(P=0),(!_||_<0||_>Z)&&(_=Z);let ue="";for(let Se=P;Se<_;++Se)ue+=$e[U[Se]];return ue}function Ge(U,P,_){const Z=U.slice(P,_);let ue="";for(let Se=0;Se<Z.length-1;Se+=2)ue+=String.fromCharCode(Z[Se]+Z[Se+1]*256);return ue}O.prototype.slice=function(P,_){const Z=this.length;P=~~P,_=_===void 0?Z:~~_,P<0?(P+=Z,P<0&&(P=0)):P>Z&&(P=Z),_<0?(_+=Z,_<0&&(_=0)):_>Z&&(_=Z),_<P&&(_=P);const ue=this.subarray(P,_);return Object.setPrototypeOf(ue,O.prototype),ue};function Qe(U,P,_){if(U%1!==0||U<0)throw new RangeError("offset is not uint");if(U+P>_)throw new RangeError("Trying to access beyond buffer length")}O.prototype.readUintLE=O.prototype.readUIntLE=function(P,_,Z){P=P>>>0,_=_>>>0,Z||Qe(P,_,this.length);let ue=this[P],Se=1,ke=0;for(;++ke<_&&(Se*=256);)ue+=this[P+ke]*Se;return ue},O.prototype.readUintBE=O.prototype.readUIntBE=function(P,_,Z){P=P>>>0,_=_>>>0,Z||Qe(P,_,this.length);let ue=this[P+--_],Se=1;for(;_>0&&(Se*=256);)ue+=this[P+--_]*Se;return ue},O.prototype.readUint8=O.prototype.readUInt8=function(P,_){return P=P>>>0,_||Qe(P,1,this.length),this[P]},O.prototype.readUint16LE=O.prototype.readUInt16LE=function(P,_){return P=P>>>0,_||Qe(P,2,this.length),this[P]|this[P+1]<<8},O.prototype.readUint16BE=O.prototype.readUInt16BE=function(P,_){return P=P>>>0,_||Qe(P,2,this.length),this[P]<<8|this[P+1]},O.prototype.readUint32LE=O.prototype.readUInt32LE=function(P,_){return P=P>>>0,_||Qe(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+this[P+3]*16777216},O.prototype.readUint32BE=O.prototype.readUInt32BE=function(P,_){return P=P>>>0,_||Qe(P,4,this.length),this[P]*16777216+(this[P+1]<<16|this[P+2]<<8|this[P+3])},O.prototype.readBigUInt64LE=je(function(P){P=P>>>0,G(P,"offset");const _=this[P],Z=this[P+7];(_===void 0||Z===void 0)&&oe(P,this.length-8);const ue=_+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24,Se=this[++P]+this[++P]*2**8+this[++P]*2**16+Z*2**24;return BigInt(ue)+(BigInt(Se)<<BigInt(32))}),O.prototype.readBigUInt64BE=je(function(P){P=P>>>0,G(P,"offset");const _=this[P],Z=this[P+7];(_===void 0||Z===void 0)&&oe(P,this.length-8);const ue=_*2**24+this[++P]*2**16+this[++P]*2**8+this[++P],Se=this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+Z;return(BigInt(ue)<<BigInt(32))+BigInt(Se)}),O.prototype.readIntLE=function(P,_,Z){P=P>>>0,_=_>>>0,Z||Qe(P,_,this.length);let ue=this[P],Se=1,ke=0;for(;++ke<_&&(Se*=256);)ue+=this[P+ke]*Se;return Se*=128,ue>=Se&&(ue-=Math.pow(2,8*_)),ue},O.prototype.readIntBE=function(P,_,Z){P=P>>>0,_=_>>>0,Z||Qe(P,_,this.length);let ue=_,Se=1,ke=this[P+--ue];for(;ue>0&&(Se*=256);)ke+=this[P+--ue]*Se;return Se*=128,ke>=Se&&(ke-=Math.pow(2,8*_)),ke},O.prototype.readInt8=function(P,_){return P=P>>>0,_||Qe(P,1,this.length),this[P]&128?(255-this[P]+1)*-1:this[P]},O.prototype.readInt16LE=function(P,_){P=P>>>0,_||Qe(P,2,this.length);const Z=this[P]|this[P+1]<<8;return Z&32768?Z|4294901760:Z},O.prototype.readInt16BE=function(P,_){P=P>>>0,_||Qe(P,2,this.length);const Z=this[P+1]|this[P]<<8;return Z&32768?Z|4294901760:Z},O.prototype.readInt32LE=function(P,_){return P=P>>>0,_||Qe(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},O.prototype.readInt32BE=function(P,_){return P=P>>>0,_||Qe(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},O.prototype.readBigInt64LE=je(function(P){P=P>>>0,G(P,"offset");const _=this[P],Z=this[P+7];(_===void 0||Z===void 0)&&oe(P,this.length-8);const ue=this[P+4]+this[P+5]*2**8+this[P+6]*2**16+(Z<<24);return(BigInt(ue)<<BigInt(32))+BigInt(_+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24)}),O.prototype.readBigInt64BE=je(function(P){P=P>>>0,G(P,"offset");const _=this[P],Z=this[P+7];(_===void 0||Z===void 0)&&oe(P,this.length-8);const ue=(_<<24)+this[++P]*2**16+this[++P]*2**8+this[++P];return(BigInt(ue)<<BigInt(32))+BigInt(this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+Z)}),O.prototype.readFloatLE=function(P,_){return P=P>>>0,_||Qe(P,4,this.length),h.read(this,P,!0,23,4)},O.prototype.readFloatBE=function(P,_){return P=P>>>0,_||Qe(P,4,this.length),h.read(this,P,!1,23,4)},O.prototype.readDoubleLE=function(P,_){return P=P>>>0,_||Qe(P,8,this.length),h.read(this,P,!0,52,8)},O.prototype.readDoubleBE=function(P,_){return P=P>>>0,_||Qe(P,8,this.length),h.read(this,P,!1,52,8)};function Xe(U,P,_,Z,ue,Se){if(!O.isBuffer(U))throw new TypeError('"buffer" argument must be a Buffer instance');if(P>ue||P<Se)throw new RangeError('"value" argument is out of bounds');if(_+Z>U.length)throw new RangeError("Index out of range")}O.prototype.writeUintLE=O.prototype.writeUIntLE=function(P,_,Z,ue){if(P=+P,_=_>>>0,Z=Z>>>0,!ue){const rt=Math.pow(2,8*Z)-1;Xe(this,P,_,Z,rt,0)}let Se=1,ke=0;for(this[_]=P&255;++ke<Z&&(Se*=256);)this[_+ke]=P/Se&255;return _+Z},O.prototype.writeUintBE=O.prototype.writeUIntBE=function(P,_,Z,ue){if(P=+P,_=_>>>0,Z=Z>>>0,!ue){const rt=Math.pow(2,8*Z)-1;Xe(this,P,_,Z,rt,0)}let Se=Z-1,ke=1;for(this[_+Se]=P&255;--Se>=0&&(ke*=256);)this[_+Se]=P/ke&255;return _+Z},O.prototype.writeUint8=O.prototype.writeUInt8=function(P,_,Z){return P=+P,_=_>>>0,Z||Xe(this,P,_,1,255,0),this[_]=P&255,_+1},O.prototype.writeUint16LE=O.prototype.writeUInt16LE=function(P,_,Z){return P=+P,_=_>>>0,Z||Xe(this,P,_,2,65535,0),this[_]=P&255,this[_+1]=P>>>8,_+2},O.prototype.writeUint16BE=O.prototype.writeUInt16BE=function(P,_,Z){return P=+P,_=_>>>0,Z||Xe(this,P,_,2,65535,0),this[_]=P>>>8,this[_+1]=P&255,_+2},O.prototype.writeUint32LE=O.prototype.writeUInt32LE=function(P,_,Z){return P=+P,_=_>>>0,Z||Xe(this,P,_,4,4294967295,0),this[_+3]=P>>>24,this[_+2]=P>>>16,this[_+1]=P>>>8,this[_]=P&255,_+4},O.prototype.writeUint32BE=O.prototype.writeUInt32BE=function(P,_,Z){return P=+P,_=_>>>0,Z||Xe(this,P,_,4,4294967295,0),this[_]=P>>>24,this[_+1]=P>>>16,this[_+2]=P>>>8,this[_+3]=P&255,_+4};function lt(U,P,_,Z,ue){J(P,Z,ue,U,_,7);let Se=Number(P&BigInt(4294967295));U[_++]=Se,Se=Se>>8,U[_++]=Se,Se=Se>>8,U[_++]=Se,Se=Se>>8,U[_++]=Se;let ke=Number(P>>BigInt(32)&BigInt(4294967295));return U[_++]=ke,ke=ke>>8,U[_++]=ke,ke=ke>>8,U[_++]=ke,ke=ke>>8,U[_++]=ke,_}function Et(U,P,_,Z,ue){J(P,Z,ue,U,_,7);let Se=Number(P&BigInt(4294967295));U[_+7]=Se,Se=Se>>8,U[_+6]=Se,Se=Se>>8,U[_+5]=Se,Se=Se>>8,U[_+4]=Se;let ke=Number(P>>BigInt(32)&BigInt(4294967295));return U[_+3]=ke,ke=ke>>8,U[_+2]=ke,ke=ke>>8,U[_+1]=ke,ke=ke>>8,U[_]=ke,_+8}O.prototype.writeBigUInt64LE=je(function(P,_=0){return lt(this,P,_,BigInt(0),BigInt("0xffffffffffffffff"))}),O.prototype.writeBigUInt64BE=je(function(P,_=0){return Et(this,P,_,BigInt(0),BigInt("0xffffffffffffffff"))}),O.prototype.writeIntLE=function(P,_,Z,ue){if(P=+P,_=_>>>0,!ue){const _t=Math.pow(2,8*Z-1);Xe(this,P,_,Z,_t-1,-_t)}let Se=0,ke=1,rt=0;for(this[_]=P&255;++Se<Z&&(ke*=256);)P<0&&rt===0&&this[_+Se-1]!==0&&(rt=1),this[_+Se]=(P/ke>>0)-rt&255;return _+Z},O.prototype.writeIntBE=function(P,_,Z,ue){if(P=+P,_=_>>>0,!ue){const _t=Math.pow(2,8*Z-1);Xe(this,P,_,Z,_t-1,-_t)}let Se=Z-1,ke=1,rt=0;for(this[_+Se]=P&255;--Se>=0&&(ke*=256);)P<0&&rt===0&&this[_+Se+1]!==0&&(rt=1),this[_+Se]=(P/ke>>0)-rt&255;return _+Z},O.prototype.writeInt8=function(P,_,Z){return P=+P,_=_>>>0,Z||Xe(this,P,_,1,127,-128),P<0&&(P=255+P+1),this[_]=P&255,_+1},O.prototype.writeInt16LE=function(P,_,Z){return P=+P,_=_>>>0,Z||Xe(this,P,_,2,32767,-32768),this[_]=P&255,this[_+1]=P>>>8,_+2},O.prototype.writeInt16BE=function(P,_,Z){return P=+P,_=_>>>0,Z||Xe(this,P,_,2,32767,-32768),this[_]=P>>>8,this[_+1]=P&255,_+2},O.prototype.writeInt32LE=function(P,_,Z){return P=+P,_=_>>>0,Z||Xe(this,P,_,4,2147483647,-2147483648),this[_]=P&255,this[_+1]=P>>>8,this[_+2]=P>>>16,this[_+3]=P>>>24,_+4},O.prototype.writeInt32BE=function(P,_,Z){return P=+P,_=_>>>0,Z||Xe(this,P,_,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),this[_]=P>>>24,this[_+1]=P>>>16,this[_+2]=P>>>8,this[_+3]=P&255,_+4},O.prototype.writeBigInt64LE=je(function(P,_=0){return lt(this,P,_,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),O.prototype.writeBigInt64BE=je(function(P,_=0){return Et(this,P,_,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Bt(U,P,_,Z,ue,Se){if(_+Z>U.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("Index out of range")}function jt(U,P,_,Z,ue){return P=+P,_=_>>>0,ue||Bt(U,P,_,4),h.write(U,P,_,Z,23,4),_+4}O.prototype.writeFloatLE=function(P,_,Z){return jt(this,P,_,!0,Z)},O.prototype.writeFloatBE=function(P,_,Z){return jt(this,P,_,!1,Z)};function ct(U,P,_,Z,ue){return P=+P,_=_>>>0,ue||Bt(U,P,_,8),h.write(U,P,_,Z,52,8),_+8}O.prototype.writeDoubleLE=function(P,_,Z){return ct(this,P,_,!0,Z)},O.prototype.writeDoubleBE=function(P,_,Z){return ct(this,P,_,!1,Z)},O.prototype.copy=function(P,_,Z,ue){if(!O.isBuffer(P))throw new TypeError("argument should be a Buffer");if(Z||(Z=0),!ue&&ue!==0&&(ue=this.length),_>=P.length&&(_=P.length),_||(_=0),ue>0&&ue<Z&&(ue=Z),ue===Z||P.length===0||this.length===0)return 0;if(_<0)throw new RangeError("targetStart out of bounds");if(Z<0||Z>=this.length)throw new RangeError("Index out of range");if(ue<0)throw new RangeError("sourceEnd out of bounds");ue>this.length&&(ue=this.length),P.length-_<ue-Z&&(ue=P.length-_+Z);const Se=ue-Z;return this===P&&typeof R.prototype.copyWithin=="function"?this.copyWithin(_,Z,ue):R.prototype.set.call(P,this.subarray(Z,ue),_),Se},O.prototype.fill=function(P,_,Z,ue){if(typeof P=="string"){if(typeof _=="string"?(ue=_,_=0,Z=this.length):typeof Z=="string"&&(ue=Z,Z=this.length),ue!==void 0&&typeof ue!="string")throw new TypeError("encoding must be a string");if(typeof ue=="string"&&!O.isEncoding(ue))throw new TypeError("Unknown encoding: "+ue);if(P.length===1){const ke=P.charCodeAt(0);(ue==="utf8"&&ke<128||ue==="latin1")&&(P=ke)}}else typeof P=="number"?P=P&255:typeof P=="boolean"&&(P=Number(P));if(_<0||this.length<_||this.length<Z)throw new RangeError("Out of range index");if(Z<=_)return this;_=_>>>0,Z=Z===void 0?this.length:Z>>>0,P||(P=0);let Se;if(typeof P=="number")for(Se=_;Se<Z;++Se)this[Se]=P;else{const ke=O.isBuffer(P)?P:O.from(P,ue),rt=ke.length;if(rt===0)throw new TypeError('The value "'+P+'" is invalid for argument "value"');for(Se=0;Se<Z-_;++Se)this[Se+_]=ke[Se%rt]}return this};const Ne={};function M(U,P,_){Ne[U]=class extends _{constructor(){super(),Object.defineProperty(this,"message",{value:P.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${U}]`,this.stack,delete this.name}get code(){return U}set code(ue){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ue,writable:!0})}toString(){return`${this.name} [${U}]: ${this.message}`}}}M("ERR_BUFFER_OUT_OF_BOUNDS",function(U){return U?`${U} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),M("ERR_INVALID_ARG_TYPE",function(U,P){return`The "${U}" argument must be of type number. Received type ${typeof P}`},TypeError),M("ERR_OUT_OF_RANGE",function(U,P,_){let Z=`The value of "${U}" is out of range.`,ue=_;return Number.isInteger(_)&&Math.abs(_)>2**32?ue=k(String(_)):typeof _=="bigint"&&(ue=String(_),(_>BigInt(2)**BigInt(32)||_<-(BigInt(2)**BigInt(32)))&&(ue=k(ue)),ue+="n"),Z+=` It must be ${P}. Received ${ue}`,Z},RangeError);function k(U){let P="",_=U.length;const Z=U[0]==="-"?1:0;for(;_>=Z+4;_-=3)P=`_${U.slice(_-3,_)}${P}`;return`${U.slice(0,_)}${P}`}function I(U,P,_){G(P,"offset"),(U[P]===void 0||U[P+_]===void 0)&&oe(P,U.length-(_+1))}function J(U,P,_,Z,ue,Se){if(U>_||U<P){const ke=typeof P=="bigint"?"n":"";let rt;throw P===0||P===BigInt(0)?rt=`>= 0${ke} and < 2${ke} ** ${(Se+1)*8}${ke}`:rt=`>= -(2${ke} ** ${(Se+1)*8-1}${ke}) and < 2 ** ${(Se+1)*8-1}${ke}`,new Ne.ERR_OUT_OF_RANGE("value",rt,U)}I(Z,ue,Se)}function G(U,P){if(typeof U!="number")throw new Ne.ERR_INVALID_ARG_TYPE(P,"number",U)}function oe(U,P,_){throw Math.floor(U)!==U?(G(U,_),new Ne.ERR_OUT_OF_RANGE("offset","an integer",U)):P<0?new Ne.ERR_BUFFER_OUT_OF_BOUNDS:new Ne.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${P}`,U)}const ne=/[^+/0-9A-Za-z-_]/g;function Pe(U){if(U=U.split("=")[0],U=U.trim().replace(ne,""),U.length<2)return"";for(;U.length%4!==0;)U=U+"=";return U}function Le(U,P){P=P||1/0;let _;const Z=U.length;let ue=null;const Se=[];for(let ke=0;ke<Z;++ke){if(_=U.charCodeAt(ke),_>55295&&_<57344){if(!ue){if(_>56319){(P-=3)>-1&&Se.push(239,191,189);continue}else if(ke+1===Z){(P-=3)>-1&&Se.push(239,191,189);continue}ue=_;continue}if(_<56320){(P-=3)>-1&&Se.push(239,191,189),ue=_;continue}_=(ue-55296<<10|_-56320)+65536}else ue&&(P-=3)>-1&&Se.push(239,191,189);if(ue=null,_<128){if((P-=1)<0)break;Se.push(_)}else if(_<2048){if((P-=2)<0)break;Se.push(_>>6|192,_&63|128)}else if(_<65536){if((P-=3)<0)break;Se.push(_>>12|224,_>>6&63|128,_&63|128)}else if(_<1114112){if((P-=4)<0)break;Se.push(_>>18|240,_>>12&63|128,_>>6&63|128,_&63|128)}else throw new Error("Invalid code point")}return Se}function qe(U){const P=[];for(let _=0;_<U.length;++_)P.push(U.charCodeAt(_)&255);return P}function Ze(U,P){let _,Z,ue;const Se=[];for(let ke=0;ke<U.length&&!((P-=2)<0);++ke)_=U.charCodeAt(ke),Z=_>>8,ue=_%256,Se.push(ue),Se.push(Z);return Se}function et(U){return v.toByteArray(Pe(U))}function Dr(U,P,_,Z){let ue;for(ue=0;ue<Z&&!(ue+_>=P.length||ue>=U.length);++ue)P[ue+_]=U[ue];return ue}function qt(U,P){return U instanceof P||U!=null&&U.constructor!=null&&U.constructor.name!=null&&U.constructor.name===P.name}function Nr(U){return U!==U}const $e=(function(){const U="0123456789abcdef",P=new Array(256);for(let _=0;_<16;++_){const Z=_*16;for(let ue=0;ue<16;++ue)P[Z+ue]=U[_]+U[ue]}return P})();function je(U){return typeof BigInt>"u"?bt:U}function bt(){throw new Error("BigInt not supported")}})(t);const y=t.Buffer;e.Blob=t.Blob,e.BlobOptions=t.BlobOptions,e.Buffer=t.Buffer,e.File=t.File,e.FileOptions=t.FileOptions,e.INSPECT_MAX_BYTES=t.INSPECT_MAX_BYTES,e.SlowBuffer=t.SlowBuffer,e.TranscodeEncoding=t.TranscodeEncoding,e.atob=t.atob,e.btoa=t.btoa,e.constants=t.constants,e.default=y,e.isAscii=t.isAscii,e.isUtf8=t.isUtf8,e.kMaxLength=t.kMaxLength,e.kStringMaxLength=t.kStringMaxLength,e.resolveObjectURL=t.resolveObjectURL,e.transcode=t.transcode})(Rc)),Rc}var Cc={},kc={},Pc,Im;function Om(){return Im||(Im=1,Pc=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;t[n]=i;for(var o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,n);if(a.value!==i||a.enumerable!==!0)return!1}return!0}),Pc}var Ic,Fm;function na(){if(Fm)return Ic;Fm=1;var e=Om();return Ic=function(){return e()&&!!Symbol.toStringTag},Ic}var Oc,_m;function Dm(){return _m||(_m=1,Oc=Object),Oc}var Fc,Nm;function iR(){return Nm||(Nm=1,Fc=Error),Fc}var _c,Lm;function oR(){return Lm||(Lm=1,_c=EvalError),_c}var Dc,$m;function sR(){return $m||($m=1,Dc=RangeError),Dc}var Nc,Mm;function aR(){return Mm||(Mm=1,Nc=ReferenceError),Nc}var Lc,Bm;function jm(){return Bm||(Bm=1,Lc=SyntaxError),Lc}var $c,Um;function Po(){return Um||(Um=1,$c=TypeError),$c}var Mc,Vm;function lR(){return Vm||(Vm=1,Mc=URIError),Mc}var Bc,qm;function cR(){return qm||(qm=1,Bc=Math.abs),Bc}var jc,zm;function uR(){return zm||(zm=1,jc=Math.floor),jc}var Uc,Wm;function fR(){return Wm||(Wm=1,Uc=Math.max),Uc}var Vc,Hm;function dR(){return Hm||(Hm=1,Vc=Math.min),Vc}var qc,Km;function pR(){return Km||(Km=1,qc=Math.pow),qc}var zc,Gm;function hR(){return Gm||(Gm=1,zc=Math.round),zc}var Wc,Qm;function mR(){return Qm||(Qm=1,Wc=Number.isNaN||function(t){return t!==t}),Wc}var Hc,Xm;function gR(){if(Xm)return Hc;Xm=1;var e=mR();return Hc=function(n){return e(n)||n===0?n:n<0?-1:1},Hc}var Kc,Ym;function yR(){return Ym||(Ym=1,Kc=Object.getOwnPropertyDescriptor),Kc}var Gc,Jm;function Ui(){if(Jm)return Gc;Jm=1;var e=yR();if(e)try{e([],"length")}catch{e=null}return Gc=e,Gc}var Qc,Zm;function ra(){if(Zm)return Qc;Zm=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Qc=e,Qc}var Xc,eg;function vR(){if(eg)return Xc;eg=1;var e=typeof Symbol<"u"&&Symbol,t=Om();return Xc=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Xc}var Yc,tg;function ng(){return tg||(tg=1,Yc=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Yc}var Jc,rg;function ig(){if(rg)return Jc;rg=1;var e=Dm();return Jc=e.getPrototypeOf||null,Jc}var Zc,og;function bR(){if(og)return Zc;og=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,n=Math.max,r="[object Function]",i=function(l,u){for(var c=[],p=0;p<l.length;p+=1)c[p]=l[p];for(var d=0;d<u.length;d+=1)c[d+l.length]=u[d];return c},o=function(l,u){for(var c=[],p=u,d=0;p<l.length;p+=1,d+=1)c[d]=l[p];return c},s=function(a,l){for(var u="",c=0;c<a.length;c+=1)u+=a[c],c+1<a.length&&(u+=l);return u};return Zc=function(l){var u=this;if(typeof u!="function"||t.apply(u)!==r)throw new TypeError(e+u);for(var c=o(arguments,1),p,d=function(){if(this instanceof p){var y=u.apply(this,i(c,arguments));return Object(y)===y?y:this}return u.apply(l,i(c,arguments))},m=n(0,u.length-c.length),b=[],w=0;w<m;w++)b[w]="$"+w;if(p=Function("binder","return function ("+s(b,",")+"){ return binder.apply(this,arguments); }")(d),u.prototype){var S=function(){};S.prototype=u.prototype,p.prototype=new S,S.prototype=null}return p},Zc}var eu,sg;function Io(){if(sg)return eu;sg=1;var e=bR();return eu=Function.prototype.bind||e,eu}var tu,ag;function nu(){return ag||(ag=1,tu=Function.prototype.call),tu}var ru,lg;function iu(){return lg||(lg=1,ru=Function.prototype.apply),ru}var ou,cg;function wR(){return cg||(cg=1,ou=typeof Reflect<"u"&&Reflect&&Reflect.apply),ou}var su,ug;function fg(){if(ug)return su;ug=1;var e=Io(),t=iu(),n=nu(),r=wR();return su=r||e.call(n,t),su}var au,dg;function lu(){if(dg)return au;dg=1;var e=Io(),t=Po(),n=nu(),r=fg();return au=function(o){if(o.length<1||typeof o[0]!="function")throw new t("a function is required");return r(e,n,o)},au}var cu,pg;function SR(){if(pg)return cu;pg=1;var e=lu(),t=Ui(),n;try{n=[].__proto__===Array.prototype}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ERR_PROTO_ACCESS")throw s}var r=!!n&&t&&t(Object.prototype,"__proto__"),i=Object,o=i.getPrototypeOf;return cu=r&&typeof r.get=="function"?e([r.get]):typeof o=="function"?function(a){return o(a==null?a:i(a))}:!1,cu}var uu,hg;function fu(){if(hg)return uu;hg=1;var e=ng(),t=ig(),n=SR();return uu=e?function(i){return e(i)}:t?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return t(i)}:n?function(i){return n(i)}:null,uu}var du,mg;function gg(){if(mg)return du;mg=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,n=Io();return du=n.call(e,t),du}var pu,yg;function vg(){if(yg)return pu;yg=1;var e,t=Dm(),n=iR(),r=oR(),i=sR(),o=aR(),s=jm(),a=Po(),l=lR(),u=cR(),c=uR(),p=fR(),d=dR(),m=pR(),b=hR(),w=gR(),S=Function,y=function(q){try{return S('"use strict"; return ('+q+").constructor;")()}catch{}},g=Ui(),v=ra(),h=function(){throw new a},E=g?(function(){try{return arguments.callee,h}catch{try{return g(arguments,"callee").get}catch{return h}}})():h,T=vR()(),R=fu(),x=ig(),A=ng(),N=iu(),W=nu(),O={},D=typeof Uint8Array>"u"||!R?e:R(Uint8Array),V={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":T&&R?R([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":O,"%AsyncGenerator%":O,"%AsyncGeneratorFunction%":O,"%AsyncIteratorPrototype%":O,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":r,"%Float16Array%":typeof Float16Array>"u"?e:Float16Array,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":S,"%GeneratorFunction%":O,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":T&&R?R(R([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!T||!R?e:R(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":g,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":i,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!T||!R?e:R(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":T&&R?R(""[Symbol.iterator]()):e,"%Symbol%":T?Symbol:e,"%SyntaxError%":s,"%ThrowTypeError%":E,"%TypedArray%":D,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":W,"%Function.prototype.apply%":N,"%Object.defineProperty%":v,"%Object.getPrototypeOf%":x,"%Math.abs%":u,"%Math.floor%":c,"%Math.max%":p,"%Math.min%":d,"%Math.pow%":m,"%Math.round%":b,"%Math.sign%":w,"%Reflect.getPrototypeOf%":A};if(R)try{null.error}catch(q){var L=R(R(q));V["%Error.prototype%"]=L}var te=function q(K){var j;if(K==="%AsyncFunction%")j=y("async function () {}");else if(K==="%GeneratorFunction%")j=y("function* () {}");else if(K==="%AsyncGeneratorFunction%")j=y("async function* () {}");else if(K==="%AsyncGenerator%"){var H=q("%AsyncGeneratorFunction%");H&&(j=H.prototype)}else if(K==="%AsyncIteratorPrototype%"){var ge=q("%AsyncGenerator%");ge&&R&&(j=R(ge.prototype))}return V[K]=j,j},Y={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},se=Io(),he=gg(),ae=se.call(W,Array.prototype.concat),we=se.call(N,Array.prototype.splice),Q=se.call(W,String.prototype.replace),ie=se.call(W,String.prototype.slice),ce=se.call(W,RegExp.prototype.exec),Ae=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ee=/\\(\\)?/g,F=function(K){var j=ie(K,0,1),H=ie(K,-1);if(j==="%"&&H!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(H==="%"&&j!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var ge=[];return Q(K,Ae,function(xe,De,Oe,Ce){ge[ge.length]=Oe?Q(Ce,ee,"$1"):De||xe}),ge},C=function(K,j){var H=K,ge;if(he(Y,H)&&(ge=Y[H],H="%"+ge[0]+"%"),he(V,H)){var xe=V[H];if(xe===O&&(xe=te(H)),typeof xe>"u"&&!j)throw new a("intrinsic "+K+" exists, but is not available. Please file an issue!");return{alias:ge,name:H,value:xe}}throw new s("intrinsic "+K+" does not exist!")};return pu=function(K,j){if(typeof K!="string"||K.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof j!="boolean")throw new a('"allowMissing" argument must be a boolean');if(ce(/^%?[^%]*%?$/,K)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var H=F(K),ge=H.length>0?H[0]:"",xe=C("%"+ge+"%",j),De=xe.name,Oe=xe.value,Ce=!1,Fe=xe.alias;Fe&&(ge=Fe[0],we(H,ae([0,1],Fe)));for(var ye=1,We=!0;ye<H.length;ye+=1){var Ge=H[ye],Qe=ie(Ge,0,1),Xe=ie(Ge,-1);if((Qe==='"'||Qe==="'"||Qe==="`"||Xe==='"'||Xe==="'"||Xe==="`")&&Qe!==Xe)throw new s("property names with quotes must have matching quotes");if((Ge==="constructor"||!We)&&(Ce=!0),ge+="."+Ge,De="%"+ge+"%",he(V,De))Oe=V[De];else if(Oe!=null){if(!(Ge in Oe)){if(!j)throw new a("base intrinsic for "+K+" exists, but the property is not available.");return}if(g&&ye+1>=H.length){var lt=g(Oe,Ge);We=!!lt,We&&"get"in lt&&!("originalValue"in lt.get)?Oe=lt.get:Oe=Oe[Ge]}else We=he(Oe,Ge),Oe=Oe[Ge];We&&!Ce&&(V[De]=Oe)}}return Oe},pu}var hu,bg;function Oo(){if(bg)return hu;bg=1;var e=vg(),t=lu(),n=t([e("%String.prototype.indexOf%")]);return hu=function(i,o){var s=e(i,!!o);return typeof s=="function"&&n(i,".prototype.")>-1?t([s]):s},hu}var mu,wg;function ER(){if(wg)return mu;wg=1;var e=na()(),t=Oo(),n=t("Object.prototype.toString"),r=function(a){return e&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:n(a)==="[object Arguments]"},i=function(a){return r(a)?!0:a!==null&&typeof a=="object"&&"length"in a&&typeof a.length=="number"&&a.length>=0&&n(a)!=="[object Array]"&&"callee"in a&&n(a.callee)==="[object Function]"},o=(function(){return r(arguments)})();return r.isLegacyArguments=i,mu=o?r:i,mu}var gu,Sg;function TR(){if(Sg)return gu;Sg=1;var e=Oo(),t=na()(),n=gg(),r=Ui(),i;if(t){var o=e("RegExp.prototype.exec"),s={},a=function(){throw s},l={toString:a,valueOf:a};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=a),i=function(d){if(!d||typeof d!="object")return!1;var m=r(d,"lastIndex"),b=m&&n(m,"value");if(!b)return!1;try{o(d,l)}catch(w){return w===s}}}else{var u=e("Object.prototype.toString"),c="[object RegExp]";i=function(d){return!d||typeof d!="object"&&typeof d!="function"?!1:u(d)===c}}return gu=i,gu}var yu,Eg;function AR(){if(Eg)return yu;Eg=1;var e=Oo(),t=TR(),n=e("RegExp.prototype.exec"),r=Po();return yu=function(o){if(!t(o))throw new r("`regex` must be a RegExp");return function(a){return n(o,a)!==null}},yu}var vu,Tg;function xR(){if(Tg)return vu;Tg=1;var e=Oo(),t=AR(),n=t(/^\s*(?:function)?\*/),r=na()(),i=fu(),o=e("Object.prototype.toString"),s=e("Function.prototype.toString"),a=function(){if(!r)return!1;try{return Function("return function*() {}")()}catch{}},l;return vu=function(c){if(typeof c!="function")return!1;if(n(s(c)))return!0;if(!r){var p=o(c);return p==="[object GeneratorFunction]"}if(!i)return!1;if(typeof l>"u"){var d=a();l=d?i(d):!1}return i(c)===l},vu}var bu,Ag;function RR(){if(Ag)return bu;Ag=1;var e=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,n,r;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{n=Object.defineProperty({},"length",{get:function(){throw r}}),r={},t(function(){throw 42},null,n)}catch(g){g!==r&&(t=null)}else t=null;var i=/^\s*class\b/,o=function(v){try{var h=e.call(v);return i.test(h)}catch{return!1}},s=function(v){try{return o(v)?!1:(e.call(v),!0)}catch{return!1}},a=Object.prototype.toString,l="[object Object]",u="[object Function]",c="[object GeneratorFunction]",p="[object HTMLAllCollection]",d="[object HTML document.all class]",m="[object HTMLCollection]",b=typeof Symbol=="function"&&!!Symbol.toStringTag,w=!(0 in[,]),S=function(){return!1};if(typeof document=="object"){var y=document.all;a.call(y)===a.call(document.all)&&(S=function(v){if((w||!v)&&(typeof v>"u"||typeof v=="object"))try{var h=a.call(v);return(h===p||h===d||h===m||h===l)&&v("")==null}catch{}return!1})}return bu=t?function(v){if(S(v))return!0;if(!v||typeof v!="function"&&typeof v!="object")return!1;try{t(v,null,n)}catch(h){if(h!==r)return!1}return!o(v)&&s(v)}:function(v){if(S(v))return!0;if(!v||typeof v!="function"&&typeof v!="object")return!1;if(b)return s(v);if(o(v))return!1;var h=a.call(v);return h!==u&&h!==c&&!/^\[object HTML/.test(h)?!1:s(v)},bu}var wu,xg;function CR(){if(xg)return wu;xg=1;var e=RR(),t=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(l,u,c){for(var p=0,d=l.length;p<d;p++)n.call(l,p)&&(c==null?u(l[p],p,l):u.call(c,l[p],p,l))},i=function(l,u,c){for(var p=0,d=l.length;p<d;p++)c==null?u(l.charAt(p),p,l):u.call(c,l.charAt(p),p,l)},o=function(l,u,c){for(var p in l)n.call(l,p)&&(c==null?u(l[p],p,l):u.call(c,l[p],p,l))};function s(a){return t.call(a)==="[object Array]"}return wu=function(l,u,c){if(!e(u))throw new TypeError("iterator must be a function");var p;arguments.length>=3&&(p=c),s(l)?r(l,u,p):typeof l=="string"?i(l,u,p):o(l,u,p)},wu}var Su,Rg;function kR(){return Rg||(Rg=1,Su=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Su}var Eu,Cg;function PR(){if(Cg)return Eu;Cg=1;var e=kR(),t=typeof globalThis>"u"?zr:globalThis;return Eu=function(){for(var r=[],i=0;i<e.length;i++)typeof t[e[i]]=="function"&&(r[r.length]=e[i]);return r},Eu}var Tu={exports:{}},Au,kg;function IR(){if(kg)return Au;kg=1;var e=ra(),t=jm(),n=Po(),r=Ui();return Au=function(o,s,a){if(!o||typeof o!="object"&&typeof o!="function")throw new n("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,d=!!r&&r(o,s);if(e)e(o,s,{configurable:c===null&&d?d.configurable:!c,enumerable:l===null&&d?d.enumerable:!l,value:a,writable:u===null&&d?d.writable:!u});else if(p||!l&&!u&&!c)o[s]=a;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Au}var xu,Pg;function OR(){if(Pg)return xu;Pg=1;var e=ra(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},xu=t,xu}var Ru,Ig;function FR(){if(Ig)return Ru;Ig=1;var e=vg(),t=IR(),n=OR()(),r=Ui(),i=Po(),o=e("%Math.floor%");return Ru=function(a,l){if(typeof a!="function")throw new i("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||o(l)!==l)throw new i("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],c=!0,p=!0;if("length"in a&&r){var d=r(a,"length");d&&!d.configurable&&(c=!1),d&&!d.writable&&(p=!1)}return(c||p||!u)&&(n?t(a,"length",l,!0,!0):t(a,"length",l)),a},Ru}var Cu,Og;function _R(){if(Og)return Cu;Og=1;var e=Io(),t=iu(),n=fg();return Cu=function(){return n(e,t,arguments)},Cu}var Fg;function DR(){return Fg||(Fg=1,(function(e){var t=FR(),n=ra(),r=lu(),i=_R();e.exports=function(s){var a=r(arguments),l=s.length-(arguments.length-1);return t(a,1+(l>0?l:0),!0)},n?n(e.exports,"apply",{value:i}):e.exports.apply=i})(Tu)),Tu.exports}var ku,_g;function Dg(){if(_g)return ku;_g=1;var e=CR(),t=PR(),n=DR(),r=Oo(),i=Ui(),o=fu(),s=r("Object.prototype.toString"),a=na()(),l=typeof globalThis>"u"?zr:globalThis,u=t(),c=r("String.prototype.slice"),p=r("Array.prototype.indexOf",!0)||function(S,y){for(var g=0;g<S.length;g+=1)if(S[g]===y)return g;return-1},d={__proto__:null};a&&i&&o?e(u,function(w){var S=new l[w];if(Symbol.toStringTag in S&&o){var y=o(S),g=i(y,Symbol.toStringTag);if(!g&&y){var v=o(y);g=i(v,Symbol.toStringTag)}d["$"+w]=n(g.get)}}):e(u,function(w){var S=new l[w],y=S.slice||S.set;y&&(d["$"+w]=n(y))});var m=function(S){var y=!1;return e(d,function(g,v){if(!y)try{"$"+g(S)===v&&(y=c(v,1))}catch{}}),y},b=function(S){var y=!1;return e(d,function(g,v){if(!y)try{g(S),y=c(v,1)}catch{}}),y};return ku=function(S){if(!S||typeof S!="object")return!1;if(!a){var y=c(s(S),8,-1);return p(u,y)>-1?y:y!=="Object"?!1:b(S)}return i?m(S):null},ku}var Pu,Ng;function NR(){if(Ng)return Pu;Ng=1;var e=Dg();return Pu=function(n){return!!e(n)},Pu}var Lg;function LR(){return Lg||(Lg=1,(function(e){var t=ER(),n=xR(),r=Dg(),i=NR();function o(ye){return ye.call.bind(ye)}var s=typeof BigInt<"u",a=typeof Symbol<"u",l=o(Object.prototype.toString),u=o(Number.prototype.valueOf),c=o(String.prototype.valueOf),p=o(Boolean.prototype.valueOf);if(s)var d=o(BigInt.prototype.valueOf);if(a)var m=o(Symbol.prototype.valueOf);function b(ye,We){if(typeof ye!="object")return!1;try{return We(ye),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=n,e.isTypedArray=i;function w(ye){return typeof Promise<"u"&&ye instanceof Promise||ye!==null&&typeof ye=="object"&&typeof ye.then=="function"&&typeof ye.catch=="function"}e.isPromise=w;function S(ye){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(ye):i(ye)||ie(ye)}e.isArrayBufferView=S;function y(ye){return r(ye)==="Uint8Array"}e.isUint8Array=y;function g(ye){return r(ye)==="Uint8ClampedArray"}e.isUint8ClampedArray=g;function v(ye){return r(ye)==="Uint16Array"}e.isUint16Array=v;function h(ye){return r(ye)==="Uint32Array"}e.isUint32Array=h;function E(ye){return r(ye)==="Int8Array"}e.isInt8Array=E;function T(ye){return r(ye)==="Int16Array"}e.isInt16Array=T;function R(ye){return r(ye)==="Int32Array"}e.isInt32Array=R;function x(ye){return r(ye)==="Float32Array"}e.isFloat32Array=x;function A(ye){return r(ye)==="Float64Array"}e.isFloat64Array=A;function N(ye){return r(ye)==="BigInt64Array"}e.isBigInt64Array=N;function W(ye){return r(ye)==="BigUint64Array"}e.isBigUint64Array=W;function O(ye){return l(ye)==="[object Map]"}O.working=typeof Map<"u"&&O(new Map);function D(ye){return typeof Map>"u"?!1:O.working?O(ye):ye instanceof Map}e.isMap=D;function V(ye){return l(ye)==="[object Set]"}V.working=typeof Set<"u"&&V(new Set);function L(ye){return typeof Set>"u"?!1:V.working?V(ye):ye instanceof Set}e.isSet=L;function te(ye){return l(ye)==="[object WeakMap]"}te.working=typeof WeakMap<"u"&&te(new WeakMap);function Y(ye){return typeof WeakMap>"u"?!1:te.working?te(ye):ye instanceof WeakMap}e.isWeakMap=Y;function se(ye){return l(ye)==="[object WeakSet]"}se.working=typeof WeakSet<"u"&&se(new WeakSet);function he(ye){return se(ye)}e.isWeakSet=he;function ae(ye){return l(ye)==="[object ArrayBuffer]"}ae.working=typeof ArrayBuffer<"u"&&ae(new ArrayBuffer);function we(ye){return typeof ArrayBuffer>"u"?!1:ae.working?ae(ye):ye instanceof ArrayBuffer}e.isArrayBuffer=we;function Q(ye){return l(ye)==="[object DataView]"}Q.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Q(new DataView(new ArrayBuffer(1),0,1));function ie(ye){return typeof DataView>"u"?!1:Q.working?Q(ye):ye instanceof DataView}e.isDataView=ie;var ce=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Ae(ye){return l(ye)==="[object SharedArrayBuffer]"}function ee(ye){return typeof ce>"u"?!1:(typeof Ae.working>"u"&&(Ae.working=Ae(new ce)),Ae.working?Ae(ye):ye instanceof ce)}e.isSharedArrayBuffer=ee;function F(ye){return l(ye)==="[object AsyncFunction]"}e.isAsyncFunction=F;function C(ye){return l(ye)==="[object Map Iterator]"}e.isMapIterator=C;function q(ye){return l(ye)==="[object Set Iterator]"}e.isSetIterator=q;function K(ye){return l(ye)==="[object Generator]"}e.isGeneratorObject=K;function j(ye){return l(ye)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=j;function H(ye){return b(ye,u)}e.isNumberObject=H;function ge(ye){return b(ye,c)}e.isStringObject=ge;function xe(ye){return b(ye,p)}e.isBooleanObject=xe;function De(ye){return s&&b(ye,d)}e.isBigIntObject=De;function Oe(ye){return a&&b(ye,m)}e.isSymbolObject=Oe;function Ce(ye){return H(ye)||ge(ye)||xe(ye)||De(ye)||Oe(ye)}e.isBoxedPrimitive=Ce;function Fe(ye){return typeof Uint8Array<"u"&&(we(ye)||ee(ye))}e.isAnyArrayBuffer=Fe,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(ye){Object.defineProperty(e,ye,{enumerable:!1,value:function(){throw new Error(ye+" is not supported in userland")}})})})(kc)),kc}var Iu,$g;function $R(){return $g||($g=1,Iu=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),Iu}var Mg;function Bg(){return Mg||(Mg=1,(function(e){var t=Object.getOwnPropertyDescriptors||function(ie){for(var ce=Object.keys(ie),Ae={},ee=0;ee<ce.length;ee++)Ae[ce[ee]]=Object.getOwnPropertyDescriptor(ie,ce[ee]);return Ae},n=/%[sdj%]/g;e.format=function(Q){if(!E(Q)){for(var ie=[],ce=0;ce<arguments.length;ce++)ie.push(s(arguments[ce]));return ie.join(" ")}for(var ce=1,Ae=arguments,ee=Ae.length,F=String(Q).replace(n,function(q){if(q==="%%")return"%";if(ce>=ee)return q;switch(q){case"%s":return String(Ae[ce++]);case"%d":return Number(Ae[ce++]);case"%j":try{return JSON.stringify(Ae[ce++])}catch{return"[Circular]"}default:return q}}),C=Ae[ce];ce<ee;C=Ae[++ce])g(C)||!A(C)?F+=" "+C:F+=" "+s(C);return F},e.deprecate=function(Q,ie){if(typeof be<"u"&&be.noDeprecation===!0)return Q;if(typeof be>"u")return function(){return e.deprecate(Q,ie).apply(this,arguments)};var ce=!1;function Ae(){if(!ce){if(be.throwDeprecation)throw new Error(ie);be.traceDeprecation?console.trace(ie):console.error(ie),ce=!0}return Q.apply(this,arguments)}return Ae};var r={},i=/^$/;if(be.env.NODE_DEBUG){var o=be.env.NODE_DEBUG;o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),i=new RegExp("^"+o+"$","i")}e.debuglog=function(Q){if(Q=Q.toUpperCase(),!r[Q])if(i.test(Q)){var ie=be.pid;r[Q]=function(){var ce=e.format.apply(e,arguments);console.error("%s %d: %s",Q,ie,ce)}}else r[Q]=function(){};return r[Q]};function s(Q,ie){var ce={seen:[],stylize:l};return arguments.length>=3&&(ce.depth=arguments[2]),arguments.length>=4&&(ce.colors=arguments[3]),y(ie)?ce.showHidden=ie:ie&&e._extend(ce,ie),R(ce.showHidden)&&(ce.showHidden=!1),R(ce.depth)&&(ce.depth=2),R(ce.colors)&&(ce.colors=!1),R(ce.customInspect)&&(ce.customInspect=!0),ce.colors&&(ce.stylize=a),c(ce,Q,ce.depth)}e.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function a(Q,ie){var ce=s.styles[ie];return ce?"\x1B["+s.colors[ce][0]+"m"+Q+"\x1B["+s.colors[ce][1]+"m":Q}function l(Q,ie){return Q}function u(Q){var ie={};return Q.forEach(function(ce,Ae){ie[ce]=!0}),ie}function c(Q,ie,ce){if(Q.customInspect&&ie&&O(ie.inspect)&&ie.inspect!==e.inspect&&!(ie.constructor&&ie.constructor.prototype===ie)){var Ae=ie.inspect(ce,Q);return E(Ae)||(Ae=c(Q,Ae,ce)),Ae}var ee=p(Q,ie);if(ee)return ee;var F=Object.keys(ie),C=u(F);if(Q.showHidden&&(F=Object.getOwnPropertyNames(ie)),W(ie)&&(F.indexOf("message")>=0||F.indexOf("description")>=0))return d(ie);if(F.length===0){if(O(ie)){var q=ie.name?": "+ie.name:"";return Q.stylize("[Function"+q+"]","special")}if(x(ie))return Q.stylize(RegExp.prototype.toString.call(ie),"regexp");if(N(ie))return Q.stylize(Date.prototype.toString.call(ie),"date");if(W(ie))return d(ie)}var K="",j=!1,H=["{","}"];if(S(ie)&&(j=!0,H=["[","]"]),O(ie)){var ge=ie.name?": "+ie.name:"";K=" [Function"+ge+"]"}if(x(ie)&&(K=" "+RegExp.prototype.toString.call(ie)),N(ie)&&(K=" "+Date.prototype.toUTCString.call(ie)),W(ie)&&(K=" "+d(ie)),F.length===0&&(!j||ie.length==0))return H[0]+K+H[1];if(ce<0)return x(ie)?Q.stylize(RegExp.prototype.toString.call(ie),"regexp"):Q.stylize("[Object]","special");Q.seen.push(ie);var xe;return j?xe=m(Q,ie,ce,C,F):xe=F.map(function(De){return b(Q,ie,ce,C,De,j)}),Q.seen.pop(),w(xe,K,H)}function p(Q,ie){if(R(ie))return Q.stylize("undefined","undefined");if(E(ie)){var ce="'"+JSON.stringify(ie).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Q.stylize(ce,"string")}if(h(ie))return Q.stylize(""+ie,"number");if(y(ie))return Q.stylize(""+ie,"boolean");if(g(ie))return Q.stylize("null","null")}function d(Q){return"["+Error.prototype.toString.call(Q)+"]"}function m(Q,ie,ce,Ae,ee){for(var F=[],C=0,q=ie.length;C<q;++C)se(ie,String(C))?F.push(b(Q,ie,ce,Ae,String(C),!0)):F.push("");return ee.forEach(function(K){K.match(/^\d+$/)||F.push(b(Q,ie,ce,Ae,K,!0))}),F}function b(Q,ie,ce,Ae,ee,F){var C,q,K;if(K=Object.getOwnPropertyDescriptor(ie,ee)||{value:ie[ee]},K.get?K.set?q=Q.stylize("[Getter/Setter]","special"):q=Q.stylize("[Getter]","special"):K.set&&(q=Q.stylize("[Setter]","special")),se(Ae,ee)||(C="["+ee+"]"),q||(Q.seen.indexOf(K.value)<0?(g(ce)?q=c(Q,K.value,null):q=c(Q,K.value,ce-1),q.indexOf(`
7
- `)>-1&&(F?q=q.split(`
8
- `).map(function(j){return" "+j}).join(`
9
- `).slice(2):q=`
10
- `+q.split(`
11
- `).map(function(j){return" "+j}).join(`
12
- `))):q=Q.stylize("[Circular]","special")),R(C)){if(F&&ee.match(/^\d+$/))return q;C=JSON.stringify(""+ee),C.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(C=C.slice(1,-1),C=Q.stylize(C,"name")):(C=C.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),C=Q.stylize(C,"string"))}return C+": "+q}function w(Q,ie,ce){var Ae=Q.reduce(function(ee,F){return F.indexOf(`
13
- `)>=0,ee+F.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Ae>60?ce[0]+(ie===""?"":ie+`
14
- `)+" "+Q.join(`,
15
- `)+" "+ce[1]:ce[0]+ie+" "+Q.join(", ")+" "+ce[1]}e.types=LR();function S(Q){return Array.isArray(Q)}e.isArray=S;function y(Q){return typeof Q=="boolean"}e.isBoolean=y;function g(Q){return Q===null}e.isNull=g;function v(Q){return Q==null}e.isNullOrUndefined=v;function h(Q){return typeof Q=="number"}e.isNumber=h;function E(Q){return typeof Q=="string"}e.isString=E;function T(Q){return typeof Q=="symbol"}e.isSymbol=T;function R(Q){return Q===void 0}e.isUndefined=R;function x(Q){return A(Q)&&V(Q)==="[object RegExp]"}e.isRegExp=x,e.types.isRegExp=x;function A(Q){return typeof Q=="object"&&Q!==null}e.isObject=A;function N(Q){return A(Q)&&V(Q)==="[object Date]"}e.isDate=N,e.types.isDate=N;function W(Q){return A(Q)&&(V(Q)==="[object Error]"||Q instanceof Error)}e.isError=W,e.types.isNativeError=W;function O(Q){return typeof Q=="function"}e.isFunction=O;function D(Q){return Q===null||typeof Q=="boolean"||typeof Q=="number"||typeof Q=="string"||typeof Q=="symbol"||typeof Q>"u"}e.isPrimitive=D,e.isBuffer=$R();function V(Q){return Object.prototype.toString.call(Q)}function L(Q){return Q<10?"0"+Q.toString(10):Q.toString(10)}var te=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Y(){var Q=new Date,ie=[L(Q.getHours()),L(Q.getMinutes()),L(Q.getSeconds())].join(":");return[Q.getDate(),te[Q.getMonth()],ie].join(" ")}e.log=function(){console.log("%s - %s",Y(),e.format.apply(e,arguments))},e.inherits=ui(),e._extend=function(Q,ie){if(!ie||!A(ie))return Q;for(var ce=Object.keys(ie),Ae=ce.length;Ae--;)Q[ce[Ae]]=ie[ce[Ae]];return Q};function se(Q,ie){return Object.prototype.hasOwnProperty.call(Q,ie)}var he=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(ie){if(typeof ie!="function")throw new TypeError('The "original" argument must be of type Function');if(he&&ie[he]){var ce=ie[he];if(typeof ce!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ce,he,{value:ce,enumerable:!1,writable:!1,configurable:!0}),ce}function ce(){for(var Ae,ee,F=new Promise(function(K,j){Ae=K,ee=j}),C=[],q=0;q<arguments.length;q++)C.push(arguments[q]);C.push(function(K,j){K?ee(K):Ae(j)});try{ie.apply(this,C)}catch(K){ee(K)}return F}return Object.setPrototypeOf(ce,Object.getPrototypeOf(ie)),he&&Object.defineProperty(ce,he,{value:ce,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(ce,t(ie))},e.promisify.custom=he;function ae(Q,ie){if(!Q){var ce=new Error("Promise was rejected with a falsy value");ce.reason=Q,Q=ce}return ie(Q)}function we(Q){if(typeof Q!="function")throw new TypeError('The "original" argument must be of type Function');function ie(){for(var ce=[],Ae=0;Ae<arguments.length;Ae++)ce.push(arguments[Ae]);var ee=ce.pop();if(typeof ee!="function")throw new TypeError("The last argument must be of type Function");var F=this,C=function(){return ee.apply(F,arguments)};Q.apply(this,ce).then(function(q){be.nextTick(C.bind(null,null,q))},function(q){be.nextTick(ae.bind(null,q,C))})}return Object.setPrototypeOf(ie,Object.getPrototypeOf(Q)),Object.defineProperties(ie,t(Q)),ie}e.callbackify=we})(Cc)),Cc}var Ou,jg;function MR(){if(jg)return Ou;jg=1;function e(b,w){var S=Object.keys(b);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(b);w&&(y=y.filter(function(g){return Object.getOwnPropertyDescriptor(b,g).enumerable})),S.push.apply(S,y)}return S}function t(b){for(var w=1;w<arguments.length;w++){var S=arguments[w]!=null?arguments[w]:{};w%2?e(Object(S),!0).forEach(function(y){n(b,y,S[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(S)):e(Object(S)).forEach(function(y){Object.defineProperty(b,y,Object.getOwnPropertyDescriptor(S,y))})}return b}function n(b,w,S){return w=s(w),w in b?Object.defineProperty(b,w,{value:S,enumerable:!0,configurable:!0,writable:!0}):b[w]=S,b}function r(b,w){if(!(b instanceof w))throw new TypeError("Cannot call a class as a function")}function i(b,w){for(var S=0;S<w.length;S++){var y=w[S];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(b,s(y.key),y)}}function o(b,w,S){return w&&i(b.prototype,w),Object.defineProperty(b,"prototype",{writable:!1}),b}function s(b){var w=a(b,"string");return typeof w=="symbol"?w:String(w)}function a(b,w){if(typeof b!="object"||b===null)return b;var S=b[Symbol.toPrimitive];if(S!==void 0){var y=S.call(b,w);if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(b)}var l=ta(),u=l.Buffer,c=Bg(),p=c.inspect,d=p&&p.custom||"inspect";function m(b,w,S){u.prototype.copy.call(b,w,S)}return Ou=(function(){function b(){r(this,b),this.head=null,this.tail=null,this.length=0}return o(b,[{key:"push",value:function(S){var y={data:S,next:null};this.length>0?this.tail.next=y:this.head=y,this.tail=y,++this.length}},{key:"unshift",value:function(S){var y={data:S,next:this.head};this.length===0&&(this.tail=y),this.head=y,++this.length}},{key:"shift",value:function(){if(this.length!==0){var S=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,S}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(S){if(this.length===0)return"";for(var y=this.head,g=""+y.data;y=y.next;)g+=S+y.data;return g}},{key:"concat",value:function(S){if(this.length===0)return u.alloc(0);for(var y=u.allocUnsafe(S>>>0),g=this.head,v=0;g;)m(g.data,y,v),v+=g.data.length,g=g.next;return y}},{key:"consume",value:function(S,y){var g;return S<this.head.data.length?(g=this.head.data.slice(0,S),this.head.data=this.head.data.slice(S)):S===this.head.data.length?g=this.shift():g=y?this._getString(S):this._getBuffer(S),g}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(S){var y=this.head,g=1,v=y.data;for(S-=v.length;y=y.next;){var h=y.data,E=S>h.length?h.length:S;if(E===h.length?v+=h:v+=h.slice(0,S),S-=E,S===0){E===h.length?(++g,y.next?this.head=y.next:this.head=this.tail=null):(this.head=y,y.data=h.slice(E));break}++g}return this.length-=g,v}},{key:"_getBuffer",value:function(S){var y=u.allocUnsafe(S),g=this.head,v=1;for(g.data.copy(y),S-=g.data.length;g=g.next;){var h=g.data,E=S>h.length?h.length:S;if(h.copy(y,y.length-S,0,E),S-=E,S===0){E===h.length?(++v,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=h.slice(E));break}++v}return this.length-=v,y}},{key:d,value:function(S,y){return p(this,t(t({},y),{},{depth:0,customInspect:!1}))}}]),b})(),Ou}var Fu,Ug;function Vg(){if(Ug)return Fu;Ug=1;function e(s,a){var l=this,u=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return u||c?(a?a(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,be.nextTick(i,this,s)):be.nextTick(i,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(p){!a&&p?l._writableState?l._writableState.errorEmitted?be.nextTick(n,l):(l._writableState.errorEmitted=!0,be.nextTick(t,l,p)):be.nextTick(t,l,p):a?(be.nextTick(n,l),a(p)):be.nextTick(n,l)}),this)}function t(s,a){i(s,a),n(s)}function n(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function r(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function i(s,a){s.emit("error",a)}function o(s,a){var l=s._readableState,u=s._writableState;l&&l.autoDestroy||u&&u.autoDestroy?s.destroy(a):s.emit("error",a)}return Fu={destroy:e,undestroy:r,errorOrDestroy:o},Fu}var _u={},qg;function Vi(){if(qg)return _u;qg=1;function e(a,l){a.prototype=Object.create(l.prototype),a.prototype.constructor=a,a.__proto__=l}var t={};function n(a,l,u){u||(u=Error);function c(d,m,b){return typeof l=="string"?l:l(d,m,b)}var p=(function(d){e(m,d);function m(b,w,S){return d.call(this,c(b,w,S))||this}return m})(u);p.prototype.name=u.name,p.prototype.code=a,t[a]=p}function r(a,l){if(Array.isArray(a)){var u=a.length;return a=a.map(function(c){return String(c)}),u>2?"one of ".concat(l," ").concat(a.slice(0,u-1).join(", "),", or ")+a[u-1]:u===2?"one of ".concat(l," ").concat(a[0]," or ").concat(a[1]):"of ".concat(l," ").concat(a[0])}else return"of ".concat(l," ").concat(String(a))}function i(a,l,u){return a.substr(0,l.length)===l}function o(a,l,u){return(u===void 0||u>a.length)&&(u=a.length),a.substring(u-l.length,u)===l}function s(a,l,u){return typeof u!="number"&&(u=0),u+l.length>a.length?!1:a.indexOf(l,u)!==-1}return n("ERR_INVALID_OPT_VALUE",function(a,l){return'The value "'+l+'" is invalid for option "'+a+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(a,l,u){var c;typeof l=="string"&&i(l,"not ")?(c="must not be",l=l.replace(/^not /,"")):c="must be";var p;if(o(a," argument"))p="The ".concat(a," ").concat(c," ").concat(r(l,"type"));else{var d=s(a,".")?"property":"argument";p='The "'.concat(a,'" ').concat(d," ").concat(c," ").concat(r(l,"type"))}return p+=". Received type ".concat(typeof u),p},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(a){return"The "+a+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(a){return"Cannot call "+a+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(a){return"Unknown encoding: "+a},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),_u.codes=t,_u}var Du,zg;function Wg(){if(zg)return Du;zg=1;var e=Vi().codes.ERR_INVALID_OPT_VALUE;function t(r,i,o){return r.highWaterMark!=null?r.highWaterMark:i?r[o]:null}function n(r,i,o,s){var a=t(i,s,o);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var l=s?o:"highWaterMark";throw new e(l,a)}return Math.floor(a)}return r.objectMode?16:16*1024}return Du={getHighWaterMark:n},Du}var Nu,Hg;function BR(){if(Hg)return Nu;Hg=1,Nu=e;function e(n,r){if(t("noDeprecation"))return n;var i=!1;function o(){if(!i){if(t("throwDeprecation"))throw new Error(r);t("traceDeprecation")?console.trace(r):console.warn(r),i=!0}return n.apply(this,arguments)}return o}function t(n){try{if(!zr.localStorage)return!1}catch{return!1}var r=zr.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return Nu}var Lu,Kg;function Gg(){if(Kg)return Lu;Kg=1,Lu=x;function e(ee){var F=this;this.next=null,this.entry=null,this.finish=function(){Ae(F,ee)}}var t;x.WritableState=T;var n={deprecate:BR()},r=km(),i=ta().Buffer,o=(typeof zr<"u"?zr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(ee){return i.from(ee)}function a(ee){return i.isBuffer(ee)||ee instanceof o}var l=Vg(),u=Wg(),c=u.getHighWaterMark,p=Vi().codes,d=p.ERR_INVALID_ARG_TYPE,m=p.ERR_METHOD_NOT_IMPLEMENTED,b=p.ERR_MULTIPLE_CALLBACK,w=p.ERR_STREAM_CANNOT_PIPE,S=p.ERR_STREAM_DESTROYED,y=p.ERR_STREAM_NULL_VALUES,g=p.ERR_STREAM_WRITE_AFTER_END,v=p.ERR_UNKNOWN_ENCODING,h=l.errorOrDestroy;ui()(x,r);function E(){}function T(ee,F,C){t=t||qi(),ee=ee||{},typeof C!="boolean"&&(C=F instanceof t),this.objectMode=!!ee.objectMode,C&&(this.objectMode=this.objectMode||!!ee.writableObjectMode),this.highWaterMark=c(this,ee,"writableHighWaterMark",C),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var q=ee.decodeStrings===!1;this.decodeStrings=!q,this.defaultEncoding=ee.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(K){te(F,K)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=ee.emitClose!==!1,this.autoDestroy=!!ee.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}T.prototype.getBuffer=function(){for(var F=this.bufferedRequest,C=[];F;)C.push(F),F=F.next;return C},(function(){try{Object.defineProperty(T.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var R;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(R=Function.prototype[Symbol.hasInstance],Object.defineProperty(x,Symbol.hasInstance,{value:function(F){return R.call(this,F)?!0:this!==x?!1:F&&F._writableState instanceof T}})):R=function(F){return F instanceof this};function x(ee){t=t||qi();var F=this instanceof t;if(!F&&!R.call(x,this))return new x(ee);this._writableState=new T(ee,this,F),this.writable=!0,ee&&(typeof ee.write=="function"&&(this._write=ee.write),typeof ee.writev=="function"&&(this._writev=ee.writev),typeof ee.destroy=="function"&&(this._destroy=ee.destroy),typeof ee.final=="function"&&(this._final=ee.final)),r.call(this)}x.prototype.pipe=function(){h(this,new w)};function A(ee,F){var C=new g;h(ee,C),be.nextTick(F,C)}function N(ee,F,C,q){var K;return C===null?K=new y:typeof C!="string"&&!F.objectMode&&(K=new d("chunk",["string","Buffer"],C)),K?(h(ee,K),be.nextTick(q,K),!1):!0}x.prototype.write=function(ee,F,C){var q=this._writableState,K=!1,j=!q.objectMode&&a(ee);return j&&!i.isBuffer(ee)&&(ee=s(ee)),typeof F=="function"&&(C=F,F=null),j?F="buffer":F||(F=q.defaultEncoding),typeof C!="function"&&(C=E),q.ending?A(this,C):(j||N(this,q,ee,C))&&(q.pendingcb++,K=O(this,q,j,ee,F,C)),K},x.prototype.cork=function(){this._writableState.corked++},x.prototype.uncork=function(){var ee=this._writableState;ee.corked&&(ee.corked--,!ee.writing&&!ee.corked&&!ee.bufferProcessing&&ee.bufferedRequest&&he(this,ee))},x.prototype.setDefaultEncoding=function(F){if(typeof F=="string"&&(F=F.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((F+"").toLowerCase())>-1))throw new v(F);return this._writableState.defaultEncoding=F,this},Object.defineProperty(x.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function W(ee,F,C){return!ee.objectMode&&ee.decodeStrings!==!1&&typeof F=="string"&&(F=i.from(F,C)),F}Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function O(ee,F,C,q,K,j){if(!C){var H=W(F,q,K);q!==H&&(C=!0,K="buffer",q=H)}var ge=F.objectMode?1:q.length;F.length+=ge;var xe=F.length<F.highWaterMark;if(xe||(F.needDrain=!0),F.writing||F.corked){var De=F.lastBufferedRequest;F.lastBufferedRequest={chunk:q,encoding:K,isBuf:C,callback:j,next:null},De?De.next=F.lastBufferedRequest:F.bufferedRequest=F.lastBufferedRequest,F.bufferedRequestCount+=1}else D(ee,F,!1,ge,q,K,j);return xe}function D(ee,F,C,q,K,j,H){F.writelen=q,F.writecb=H,F.writing=!0,F.sync=!0,F.destroyed?F.onwrite(new S("write")):C?ee._writev(K,F.onwrite):ee._write(K,j,F.onwrite),F.sync=!1}function V(ee,F,C,q,K){--F.pendingcb,C?(be.nextTick(K,q),be.nextTick(ie,ee,F),ee._writableState.errorEmitted=!0,h(ee,q)):(K(q),ee._writableState.errorEmitted=!0,h(ee,q),ie(ee,F))}function L(ee){ee.writing=!1,ee.writecb=null,ee.length-=ee.writelen,ee.writelen=0}function te(ee,F){var C=ee._writableState,q=C.sync,K=C.writecb;if(typeof K!="function")throw new b;if(L(C),F)V(ee,C,q,F,K);else{var j=ae(C)||ee.destroyed;!j&&!C.corked&&!C.bufferProcessing&&C.bufferedRequest&&he(ee,C),q?be.nextTick(Y,ee,C,j,K):Y(ee,C,j,K)}}function Y(ee,F,C,q){C||se(ee,F),F.pendingcb--,q(),ie(ee,F)}function se(ee,F){F.length===0&&F.needDrain&&(F.needDrain=!1,ee.emit("drain"))}function he(ee,F){F.bufferProcessing=!0;var C=F.bufferedRequest;if(ee._writev&&C&&C.next){var q=F.bufferedRequestCount,K=new Array(q),j=F.corkedRequestsFree;j.entry=C;for(var H=0,ge=!0;C;)K[H]=C,C.isBuf||(ge=!1),C=C.next,H+=1;K.allBuffers=ge,D(ee,F,!0,F.length,K,"",j.finish),F.pendingcb++,F.lastBufferedRequest=null,j.next?(F.corkedRequestsFree=j.next,j.next=null):F.corkedRequestsFree=new e(F),F.bufferedRequestCount=0}else{for(;C;){var xe=C.chunk,De=C.encoding,Oe=C.callback,Ce=F.objectMode?1:xe.length;if(D(ee,F,!1,Ce,xe,De,Oe),C=C.next,F.bufferedRequestCount--,F.writing)break}C===null&&(F.lastBufferedRequest=null)}F.bufferedRequest=C,F.bufferProcessing=!1}x.prototype._write=function(ee,F,C){C(new m("_write()"))},x.prototype._writev=null,x.prototype.end=function(ee,F,C){var q=this._writableState;return typeof ee=="function"?(C=ee,ee=null,F=null):typeof F=="function"&&(C=F,F=null),ee!=null&&this.write(ee,F),q.corked&&(q.corked=1,this.uncork()),q.ending||ce(this,q,C),this},Object.defineProperty(x.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ae(ee){return ee.ending&&ee.length===0&&ee.bufferedRequest===null&&!ee.finished&&!ee.writing}function we(ee,F){ee._final(function(C){F.pendingcb--,C&&h(ee,C),F.prefinished=!0,ee.emit("prefinish"),ie(ee,F)})}function Q(ee,F){!F.prefinished&&!F.finalCalled&&(typeof ee._final=="function"&&!F.destroyed?(F.pendingcb++,F.finalCalled=!0,be.nextTick(we,ee,F)):(F.prefinished=!0,ee.emit("prefinish")))}function ie(ee,F){var C=ae(F);if(C&&(Q(ee,F),F.pendingcb===0&&(F.finished=!0,ee.emit("finish"),F.autoDestroy))){var q=ee._readableState;(!q||q.autoDestroy&&q.endEmitted)&&ee.destroy()}return C}function ce(ee,F,C){F.ending=!0,ie(ee,F),C&&(F.finished?be.nextTick(C):ee.once("finish",C)),F.ended=!0,ee.writable=!1}function Ae(ee,F,C){var q=ee.entry;for(ee.entry=null;q;){var K=q.callback;F.pendingcb--,K(C),q=q.next}F.corkedRequestsFree.next=ee}return Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(F){this._writableState&&(this._writableState.destroyed=F)}}),x.prototype.destroy=l.destroy,x.prototype._undestroy=l.undestroy,x.prototype._destroy=function(ee,F){F(ee)},Lu}var $u,Qg;function qi(){if(Qg)return $u;Qg=1;var e=Object.keys||function(u){var c=[];for(var p in u)c.push(p);return c};$u=s;var t=ny(),n=Gg();ui()(s,t);for(var r=e(n.prototype),i=0;i<r.length;i++){var o=r[i];s.prototype[o]||(s.prototype[o]=n.prototype[o])}function s(u){if(!(this instanceof s))return new s(u);t.call(this,u),n.call(this,u),this.allowHalfOpen=!0,u&&(u.readable===!1&&(this.readable=!1),u.writable===!1&&(this.writable=!1),u.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a)))}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function a(){this._writableState.ended||be.nextTick(l,this)}function l(u){u.end()}return Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(c){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=c,this._writableState.destroyed=c)}}),$u}var Mu={},ia={exports:{}};var Xg;function jR(){return Xg||(Xg=1,(function(e,t){var n=ta(),r=n.Buffer;function i(s,a){for(var l in s)a[l]=s[l]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=o);function o(s,a,l){return r(s,a,l)}o.prototype=Object.create(r.prototype),i(r,o),o.from=function(s,a,l){if(typeof s=="number")throw new TypeError("Argument must not be a number");return r(s,a,l)},o.alloc=function(s,a,l){if(typeof s!="number")throw new TypeError("Argument must be a number");var u=r(s);return a!==void 0?typeof l=="string"?u.fill(a,l):u.fill(a):u.fill(0),u},o.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r(s)},o.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(s)}})(ia,ia.exports)),ia.exports}var Yg;function Bu(){if(Yg)return Mu;Yg=1;var e=jR().Buffer,t=e.isEncoding||function(y){switch(y=""+y,y&&y.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(y){if(!y)return"utf8";for(var g;;)switch(y){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return y;default:if(g)return;y=(""+y).toLowerCase(),g=!0}}function r(y){var g=n(y);if(typeof g!="string"&&(e.isEncoding===t||!t(y)))throw new Error("Unknown encoding: "+y);return g||y}Mu.StringDecoder=i;function i(y){this.encoding=r(y);var g;switch(this.encoding){case"utf16le":this.text=p,this.end=d,g=4;break;case"utf8":this.fillLast=l,g=4;break;case"base64":this.text=m,this.end=b,g=3;break;default:this.write=w,this.end=S;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(g)}i.prototype.write=function(y){if(y.length===0)return"";var g,v;if(this.lastNeed){if(g=this.fillLast(y),g===void 0)return"";v=this.lastNeed,this.lastNeed=0}else v=0;return v<y.length?g?g+this.text(y,v):this.text(y,v):g||""},i.prototype.end=c,i.prototype.text=u,i.prototype.fillLast=function(y){if(this.lastNeed<=y.length)return y.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);y.copy(this.lastChar,this.lastTotal-this.lastNeed,0,y.length),this.lastNeed-=y.length};function o(y){return y<=127?0:y>>5===6?2:y>>4===14?3:y>>3===30?4:y>>6===2?-1:-2}function s(y,g,v){var h=g.length-1;if(h<v)return 0;var E=o(g[h]);return E>=0?(E>0&&(y.lastNeed=E-1),E):--h<v||E===-2?0:(E=o(g[h]),E>=0?(E>0&&(y.lastNeed=E-2),E):--h<v||E===-2?0:(E=o(g[h]),E>=0?(E>0&&(E===2?E=0:y.lastNeed=E-3),E):0))}function a(y,g,v){if((g[0]&192)!==128)return y.lastNeed=0,"�";if(y.lastNeed>1&&g.length>1){if((g[1]&192)!==128)return y.lastNeed=1,"�";if(y.lastNeed>2&&g.length>2&&(g[2]&192)!==128)return y.lastNeed=2,"�"}}function l(y){var g=this.lastTotal-this.lastNeed,v=a(this,y);if(v!==void 0)return v;if(this.lastNeed<=y.length)return y.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);y.copy(this.lastChar,g,0,y.length),this.lastNeed-=y.length}function u(y,g){var v=s(this,y,g);if(!this.lastNeed)return y.toString("utf8",g);this.lastTotal=v;var h=y.length-(v-this.lastNeed);return y.copy(this.lastChar,0,h),y.toString("utf8",g,h)}function c(y){var g=y&&y.length?this.write(y):"";return this.lastNeed?g+"�":g}function p(y,g){if((y.length-g)%2===0){var v=y.toString("utf16le",g);if(v){var h=v.charCodeAt(v.length-1);if(h>=55296&&h<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=y[y.length-2],this.lastChar[1]=y[y.length-1],v.slice(0,-1)}return v}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=y[y.length-1],y.toString("utf16le",g,y.length-1)}function d(y){var g=y&&y.length?this.write(y):"";if(this.lastNeed){var v=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,v)}return g}function m(y,g){var v=(y.length-g)%3;return v===0?y.toString("base64",g):(this.lastNeed=3-v,this.lastTotal=3,v===1?this.lastChar[0]=y[y.length-1]:(this.lastChar[0]=y[y.length-2],this.lastChar[1]=y[y.length-1]),y.toString("base64",g,y.length-v))}function b(y){var g=y&&y.length?this.write(y):"";return this.lastNeed?g+this.lastChar.toString("base64",0,3-this.lastNeed):g}function w(y){return y.toString(this.encoding)}function S(y){return y&&y.length?this.write(y):""}return Mu}var ju,Jg;function Uu(){if(Jg)return ju;Jg=1;var e=Vi().codes.ERR_STREAM_PREMATURE_CLOSE;function t(o){var s=!1;return function(){if(!s){s=!0;for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];o.apply(this,l)}}}function n(){}function r(o){return o.setHeader&&typeof o.abort=="function"}function i(o,s,a){if(typeof s=="function")return i(o,null,s);s||(s={}),a=t(a||n);var l=s.readable||s.readable!==!1&&o.readable,u=s.writable||s.writable!==!1&&o.writable,c=function(){o.writable||d()},p=o._writableState&&o._writableState.finished,d=function(){u=!1,p=!0,l||a.call(o)},m=o._readableState&&o._readableState.endEmitted,b=function(){l=!1,m=!0,u||a.call(o)},w=function(v){a.call(o,v)},S=function(){var v;if(l&&!m)return(!o._readableState||!o._readableState.ended)&&(v=new e),a.call(o,v);if(u&&!p)return(!o._writableState||!o._writableState.ended)&&(v=new e),a.call(o,v)},y=function(){o.req.on("finish",d)};return r(o)?(o.on("complete",d),o.on("abort",S),o.req?y():o.on("request",y)):u&&!o._writableState&&(o.on("end",c),o.on("close",c)),o.on("end",b),o.on("finish",d),s.error!==!1&&o.on("error",w),o.on("close",S),function(){o.removeListener("complete",d),o.removeListener("abort",S),o.removeListener("request",y),o.req&&o.req.removeListener("finish",d),o.removeListener("end",c),o.removeListener("close",c),o.removeListener("finish",d),o.removeListener("end",b),o.removeListener("error",w),o.removeListener("close",S)}}return ju=i,ju}var Vu,Zg;function UR(){if(Zg)return Vu;Zg=1;var e;function t(v,h,E){return h=n(h),h in v?Object.defineProperty(v,h,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[h]=E,v}function n(v){var h=r(v,"string");return typeof h=="symbol"?h:String(h)}function r(v,h){if(typeof v!="object"||v===null)return v;var E=v[Symbol.toPrimitive];if(E!==void 0){var T=E.call(v,h);if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(v)}var i=Uu(),o=Symbol("lastResolve"),s=Symbol("lastReject"),a=Symbol("error"),l=Symbol("ended"),u=Symbol("lastPromise"),c=Symbol("handlePromise"),p=Symbol("stream");function d(v,h){return{value:v,done:h}}function m(v){var h=v[o];if(h!==null){var E=v[p].read();E!==null&&(v[u]=null,v[o]=null,v[s]=null,h(d(E,!1)))}}function b(v){be.nextTick(m,v)}function w(v,h){return function(E,T){v.then(function(){if(h[l]){E(d(void 0,!0));return}h[c](E,T)},T)}}var S=Object.getPrototypeOf(function(){}),y=Object.setPrototypeOf((e={get stream(){return this[p]},next:function(){var h=this,E=this[a];if(E!==null)return Promise.reject(E);if(this[l])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise(function(A,N){be.nextTick(function(){h[a]?N(h[a]):A(d(void 0,!0))})});var T=this[u],R;if(T)R=new Promise(w(T,this));else{var x=this[p].read();if(x!==null)return Promise.resolve(d(x,!1));R=new Promise(this[c])}return this[u]=R,R}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var h=this;return new Promise(function(E,T){h[p].destroy(null,function(R){if(R){T(R);return}E(d(void 0,!0))})})}),e),S),g=function(h){var E,T=Object.create(y,(E={},t(E,p,{value:h,writable:!0}),t(E,o,{value:null,writable:!0}),t(E,s,{value:null,writable:!0}),t(E,a,{value:null,writable:!0}),t(E,l,{value:h._readableState.endEmitted,writable:!0}),t(E,c,{value:function(x,A){var N=T[p].read();N?(T[u]=null,T[o]=null,T[s]=null,x(d(N,!1))):(T[o]=x,T[s]=A)},writable:!0}),E));return T[u]=null,i(h,function(R){if(R&&R.code!=="ERR_STREAM_PREMATURE_CLOSE"){var x=T[s];x!==null&&(T[u]=null,T[o]=null,T[s]=null,x(R)),T[a]=R;return}var A=T[o];A!==null&&(T[u]=null,T[o]=null,T[s]=null,A(d(void 0,!0))),T[l]=!0}),h.on("readable",b.bind(null,T)),T};return Vu=g,Vu}var qu,ey;function VR(){return ey||(ey=1,qu=function(){throw new Error("Readable.from is not available in the browser")}),qu}var zu,ty;function ny(){if(ty)return zu;ty=1,zu=A;var e;A.ReadableState=x,Ac().EventEmitter;var t=function(H,ge){return H.listeners(ge).length},n=km(),r=ta().Buffer,i=(typeof zr<"u"?zr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(j){return r.from(j)}function s(j){return r.isBuffer(j)||j instanceof i}var a=Bg(),l;a&&a.debuglog?l=a.debuglog("stream"):l=function(){};var u=MR(),c=Vg(),p=Wg(),d=p.getHighWaterMark,m=Vi().codes,b=m.ERR_INVALID_ARG_TYPE,w=m.ERR_STREAM_PUSH_AFTER_EOF,S=m.ERR_METHOD_NOT_IMPLEMENTED,y=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,g,v,h;ui()(A,n);var E=c.errorOrDestroy,T=["error","close","destroy","pause","resume"];function R(j,H,ge){if(typeof j.prependListener=="function")return j.prependListener(H,ge);!j._events||!j._events[H]?j.on(H,ge):Array.isArray(j._events[H])?j._events[H].unshift(ge):j._events[H]=[ge,j._events[H]]}function x(j,H,ge){e=e||qi(),j=j||{},typeof ge!="boolean"&&(ge=H instanceof e),this.objectMode=!!j.objectMode,ge&&(this.objectMode=this.objectMode||!!j.readableObjectMode),this.highWaterMark=d(this,j,"readableHighWaterMark",ge),this.buffer=new u,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=j.emitClose!==!1,this.autoDestroy=!!j.autoDestroy,this.destroyed=!1,this.defaultEncoding=j.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,j.encoding&&(g||(g=Bu().StringDecoder),this.decoder=new g(j.encoding),this.encoding=j.encoding)}function A(j){if(e=e||qi(),!(this instanceof A))return new A(j);var H=this instanceof e;this._readableState=new x(j,this,H),this.readable=!0,j&&(typeof j.read=="function"&&(this._read=j.read),typeof j.destroy=="function"&&(this._destroy=j.destroy)),n.call(this)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(H){this._readableState&&(this._readableState.destroyed=H)}}),A.prototype.destroy=c.destroy,A.prototype._undestroy=c.undestroy,A.prototype._destroy=function(j,H){H(j)},A.prototype.push=function(j,H){var ge=this._readableState,xe;return ge.objectMode?xe=!0:typeof j=="string"&&(H=H||ge.defaultEncoding,H!==ge.encoding&&(j=r.from(j,H),H=""),xe=!0),N(this,j,H,!1,xe)},A.prototype.unshift=function(j){return N(this,j,null,!0,!1)};function N(j,H,ge,xe,De){l("readableAddChunk",H);var Oe=j._readableState;if(H===null)Oe.reading=!1,te(j,Oe);else{var Ce;if(De||(Ce=O(Oe,H)),Ce)E(j,Ce);else if(Oe.objectMode||H&&H.length>0)if(typeof H!="string"&&!Oe.objectMode&&Object.getPrototypeOf(H)!==r.prototype&&(H=o(H)),xe)Oe.endEmitted?E(j,new y):W(j,Oe,H,!0);else if(Oe.ended)E(j,new w);else{if(Oe.destroyed)return!1;Oe.reading=!1,Oe.decoder&&!ge?(H=Oe.decoder.write(H),Oe.objectMode||H.length!==0?W(j,Oe,H,!1):he(j,Oe)):W(j,Oe,H,!1)}else xe||(Oe.reading=!1,he(j,Oe))}return!Oe.ended&&(Oe.length<Oe.highWaterMark||Oe.length===0)}function W(j,H,ge,xe){H.flowing&&H.length===0&&!H.sync?(H.awaitDrain=0,j.emit("data",ge)):(H.length+=H.objectMode?1:ge.length,xe?H.buffer.unshift(ge):H.buffer.push(ge),H.needReadable&&Y(j)),he(j,H)}function O(j,H){var ge;return!s(H)&&typeof H!="string"&&H!==void 0&&!j.objectMode&&(ge=new b("chunk",["string","Buffer","Uint8Array"],H)),ge}A.prototype.isPaused=function(){return this._readableState.flowing===!1},A.prototype.setEncoding=function(j){g||(g=Bu().StringDecoder);var H=new g(j);this._readableState.decoder=H,this._readableState.encoding=this._readableState.decoder.encoding;for(var ge=this._readableState.buffer.head,xe="";ge!==null;)xe+=H.write(ge.data),ge=ge.next;return this._readableState.buffer.clear(),xe!==""&&this._readableState.buffer.push(xe),this._readableState.length=xe.length,this};var D=1073741824;function V(j){return j>=D?j=D:(j--,j|=j>>>1,j|=j>>>2,j|=j>>>4,j|=j>>>8,j|=j>>>16,j++),j}function L(j,H){return j<=0||H.length===0&&H.ended?0:H.objectMode?1:j!==j?H.flowing&&H.length?H.buffer.head.data.length:H.length:(j>H.highWaterMark&&(H.highWaterMark=V(j)),j<=H.length?j:H.ended?H.length:(H.needReadable=!0,0))}A.prototype.read=function(j){l("read",j),j=parseInt(j,10);var H=this._readableState,ge=j;if(j!==0&&(H.emittedReadable=!1),j===0&&H.needReadable&&((H.highWaterMark!==0?H.length>=H.highWaterMark:H.length>0)||H.ended))return l("read: emitReadable",H.length,H.ended),H.length===0&&H.ended?C(this):Y(this),null;if(j=L(j,H),j===0&&H.ended)return H.length===0&&C(this),null;var xe=H.needReadable;l("need readable",xe),(H.length===0||H.length-j<H.highWaterMark)&&(xe=!0,l("length less than watermark",xe)),H.ended||H.reading?(xe=!1,l("reading or ended",xe)):xe&&(l("do read"),H.reading=!0,H.sync=!0,H.length===0&&(H.needReadable=!0),this._read(H.highWaterMark),H.sync=!1,H.reading||(j=L(ge,H)));var De;return j>0?De=F(j,H):De=null,De===null?(H.needReadable=H.length<=H.highWaterMark,j=0):(H.length-=j,H.awaitDrain=0),H.length===0&&(H.ended||(H.needReadable=!0),ge!==j&&H.ended&&C(this)),De!==null&&this.emit("data",De),De};function te(j,H){if(l("onEofChunk"),!H.ended){if(H.decoder){var ge=H.decoder.end();ge&&ge.length&&(H.buffer.push(ge),H.length+=H.objectMode?1:ge.length)}H.ended=!0,H.sync?Y(j):(H.needReadable=!1,H.emittedReadable||(H.emittedReadable=!0,se(j)))}}function Y(j){var H=j._readableState;l("emitReadable",H.needReadable,H.emittedReadable),H.needReadable=!1,H.emittedReadable||(l("emitReadable",H.flowing),H.emittedReadable=!0,be.nextTick(se,j))}function se(j){var H=j._readableState;l("emitReadable_",H.destroyed,H.length,H.ended),!H.destroyed&&(H.length||H.ended)&&(j.emit("readable"),H.emittedReadable=!1),H.needReadable=!H.flowing&&!H.ended&&H.length<=H.highWaterMark,ee(j)}function he(j,H){H.readingMore||(H.readingMore=!0,be.nextTick(ae,j,H))}function ae(j,H){for(;!H.reading&&!H.ended&&(H.length<H.highWaterMark||H.flowing&&H.length===0);){var ge=H.length;if(l("maybeReadMore read 0"),j.read(0),ge===H.length)break}H.readingMore=!1}A.prototype._read=function(j){E(this,new S("_read()"))},A.prototype.pipe=function(j,H){var ge=this,xe=this._readableState;switch(xe.pipesCount){case 0:xe.pipes=j;break;case 1:xe.pipes=[xe.pipes,j];break;default:xe.pipes.push(j);break}xe.pipesCount+=1,l("pipe count=%d opts=%j",xe.pipesCount,H);var De=(!H||H.end!==!1)&&j!==be.stdout&&j!==be.stderr,Oe=De?Fe:Bt;xe.endEmitted?be.nextTick(Oe):ge.once("end",Oe),j.on("unpipe",Ce);function Ce(jt,ct){l("onunpipe"),jt===ge&&ct&&ct.hasUnpiped===!1&&(ct.hasUnpiped=!0,Ge())}function Fe(){l("onend"),j.end()}var ye=we(ge);j.on("drain",ye);var We=!1;function Ge(){l("cleanup"),j.removeListener("close",lt),j.removeListener("finish",Et),j.removeListener("drain",ye),j.removeListener("error",Xe),j.removeListener("unpipe",Ce),ge.removeListener("end",Fe),ge.removeListener("end",Bt),ge.removeListener("data",Qe),We=!0,xe.awaitDrain&&(!j._writableState||j._writableState.needDrain)&&ye()}ge.on("data",Qe);function Qe(jt){l("ondata");var ct=j.write(jt);l("dest.write",ct),ct===!1&&((xe.pipesCount===1&&xe.pipes===j||xe.pipesCount>1&&K(xe.pipes,j)!==-1)&&!We&&(l("false write response, pause",xe.awaitDrain),xe.awaitDrain++),ge.pause())}function Xe(jt){l("onerror",jt),Bt(),j.removeListener("error",Xe),t(j,"error")===0&&E(j,jt)}R(j,"error",Xe);function lt(){j.removeListener("finish",Et),Bt()}j.once("close",lt);function Et(){l("onfinish"),j.removeListener("close",lt),Bt()}j.once("finish",Et);function Bt(){l("unpipe"),ge.unpipe(j)}return j.emit("pipe",ge),xe.flowing||(l("pipe resume"),ge.resume()),j};function we(j){return function(){var ge=j._readableState;l("pipeOnDrain",ge.awaitDrain),ge.awaitDrain&&ge.awaitDrain--,ge.awaitDrain===0&&t(j,"data")&&(ge.flowing=!0,ee(j))}}A.prototype.unpipe=function(j){var H=this._readableState,ge={hasUnpiped:!1};if(H.pipesCount===0)return this;if(H.pipesCount===1)return j&&j!==H.pipes?this:(j||(j=H.pipes),H.pipes=null,H.pipesCount=0,H.flowing=!1,j&&j.emit("unpipe",this,ge),this);if(!j){var xe=H.pipes,De=H.pipesCount;H.pipes=null,H.pipesCount=0,H.flowing=!1;for(var Oe=0;Oe<De;Oe++)xe[Oe].emit("unpipe",this,{hasUnpiped:!1});return this}var Ce=K(H.pipes,j);return Ce===-1?this:(H.pipes.splice(Ce,1),H.pipesCount-=1,H.pipesCount===1&&(H.pipes=H.pipes[0]),j.emit("unpipe",this,ge),this)},A.prototype.on=function(j,H){var ge=n.prototype.on.call(this,j,H),xe=this._readableState;return j==="data"?(xe.readableListening=this.listenerCount("readable")>0,xe.flowing!==!1&&this.resume()):j==="readable"&&!xe.endEmitted&&!xe.readableListening&&(xe.readableListening=xe.needReadable=!0,xe.flowing=!1,xe.emittedReadable=!1,l("on readable",xe.length,xe.reading),xe.length?Y(this):xe.reading||be.nextTick(ie,this)),ge},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(j,H){var ge=n.prototype.removeListener.call(this,j,H);return j==="readable"&&be.nextTick(Q,this),ge},A.prototype.removeAllListeners=function(j){var H=n.prototype.removeAllListeners.apply(this,arguments);return(j==="readable"||j===void 0)&&be.nextTick(Q,this),H};function Q(j){var H=j._readableState;H.readableListening=j.listenerCount("readable")>0,H.resumeScheduled&&!H.paused?H.flowing=!0:j.listenerCount("data")>0&&j.resume()}function ie(j){l("readable nexttick read 0"),j.read(0)}A.prototype.resume=function(){var j=this._readableState;return j.flowing||(l("resume"),j.flowing=!j.readableListening,ce(this,j)),j.paused=!1,this};function ce(j,H){H.resumeScheduled||(H.resumeScheduled=!0,be.nextTick(Ae,j,H))}function Ae(j,H){l("resume",H.reading),H.reading||j.read(0),H.resumeScheduled=!1,j.emit("resume"),ee(j),H.flowing&&!H.reading&&j.read(0)}A.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function ee(j){var H=j._readableState;for(l("flow",H.flowing);H.flowing&&j.read()!==null;);}A.prototype.wrap=function(j){var H=this,ge=this._readableState,xe=!1;j.on("end",function(){if(l("wrapped end"),ge.decoder&&!ge.ended){var Ce=ge.decoder.end();Ce&&Ce.length&&H.push(Ce)}H.push(null)}),j.on("data",function(Ce){if(l("wrapped data"),ge.decoder&&(Ce=ge.decoder.write(Ce)),!(ge.objectMode&&Ce==null)&&!(!ge.objectMode&&(!Ce||!Ce.length))){var Fe=H.push(Ce);Fe||(xe=!0,j.pause())}});for(var De in j)this[De]===void 0&&typeof j[De]=="function"&&(this[De]=(function(Fe){return function(){return j[Fe].apply(j,arguments)}})(De));for(var Oe=0;Oe<T.length;Oe++)j.on(T[Oe],this.emit.bind(this,T[Oe]));return this._read=function(Ce){l("wrapped _read",Ce),xe&&(xe=!1,j.resume())},this},typeof Symbol=="function"&&(A.prototype[Symbol.asyncIterator]=function(){return v===void 0&&(v=UR()),v(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(H){this._readableState&&(this._readableState.flowing=H)}}),A._fromList=F,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function F(j,H){if(H.length===0)return null;var ge;return H.objectMode?ge=H.buffer.shift():!j||j>=H.length?(H.decoder?ge=H.buffer.join(""):H.buffer.length===1?ge=H.buffer.first():ge=H.buffer.concat(H.length),H.buffer.clear()):ge=H.buffer.consume(j,H.decoder),ge}function C(j){var H=j._readableState;l("endReadable",H.endEmitted),H.endEmitted||(H.ended=!0,be.nextTick(q,H,j))}function q(j,H){if(l("endReadableNT",j.endEmitted,j.length),!j.endEmitted&&j.length===0&&(j.endEmitted=!0,H.readable=!1,H.emit("end"),j.autoDestroy)){var ge=H._writableState;(!ge||ge.autoDestroy&&ge.finished)&&H.destroy()}}typeof Symbol=="function"&&(A.from=function(j,H){return h===void 0&&(h=VR()),h(A,j,H)});function K(j,H){for(var ge=0,xe=j.length;ge<xe;ge++)if(j[ge]===H)return ge;return-1}return zu}var Wu,ry;function iy(){if(ry)return Wu;ry=1,Wu=a;var e=Vi().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,n=e.ERR_MULTIPLE_CALLBACK,r=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=e.ERR_TRANSFORM_WITH_LENGTH_0,o=qi();ui()(a,o);function s(c,p){var d=this._transformState;d.transforming=!1;var m=d.writecb;if(m===null)return this.emit("error",new n);d.writechunk=null,d.writecb=null,p!=null&&this.push(p),m(c);var b=this._readableState;b.reading=!1,(b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}function a(c){if(!(this instanceof a))return new a(c);o.call(this,c),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,c&&(typeof c.transform=="function"&&(this._transform=c.transform),typeof c.flush=="function"&&(this._flush=c.flush)),this.on("prefinish",l)}function l(){var c=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(p,d){u(c,p,d)}):u(this,null,null)}a.prototype.push=function(c,p){return this._transformState.needTransform=!1,o.prototype.push.call(this,c,p)},a.prototype._transform=function(c,p,d){d(new t("_transform()"))},a.prototype._write=function(c,p,d){var m=this._transformState;if(m.writecb=d,m.writechunk=c,m.writeencoding=p,!m.transforming){var b=this._readableState;(m.needTransform||b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}},a.prototype._read=function(c){var p=this._transformState;p.writechunk!==null&&!p.transforming?(p.transforming=!0,this._transform(p.writechunk,p.writeencoding,p.afterTransform)):p.needTransform=!0},a.prototype._destroy=function(c,p){o.prototype._destroy.call(this,c,function(d){p(d)})};function u(c,p,d){if(p)return c.emit("error",p);if(d!=null&&c.push(d),c._writableState.length)throw new i;if(c._transformState.transforming)throw new r;return c.push(null)}return Wu}var Hu,oy;function qR(){if(oy)return Hu;oy=1,Hu=t;var e=iy();ui()(t,e);function t(n){if(!(this instanceof t))return new t(n);e.call(this,n)}return t.prototype._transform=function(n,r,i){i(null,n)},Hu}var Ku,sy;function zR(){if(sy)return Ku;sy=1;var e;function t(d){var m=!1;return function(){m||(m=!0,d.apply(void 0,arguments))}}var n=Vi().codes,r=n.ERR_MISSING_ARGS,i=n.ERR_STREAM_DESTROYED;function o(d){if(d)throw d}function s(d){return d.setHeader&&typeof d.abort=="function"}function a(d,m,b,w){w=t(w);var S=!1;d.on("close",function(){S=!0}),e===void 0&&(e=Uu()),e(d,{readable:m,writable:b},function(g){if(g)return w(g);S=!0,w()});var y=!1;return function(g){if(!S&&!y){if(y=!0,s(d))return d.abort();if(typeof d.destroy=="function")return d.destroy();w(g||new i("pipe"))}}}function l(d){d()}function u(d,m){return d.pipe(m)}function c(d){return!d.length||typeof d[d.length-1]!="function"?o:d.pop()}function p(){for(var d=arguments.length,m=new Array(d),b=0;b<d;b++)m[b]=arguments[b];var w=c(m);if(Array.isArray(m[0])&&(m=m[0]),m.length<2)throw new r("streams");var S,y=m.map(function(g,v){var h=v<m.length-1,E=v>0;return a(g,h,E,function(T){S||(S=T),T&&y.forEach(l),!h&&(y.forEach(l),w(S))})});return m.reduce(u)}return Ku=p,Ku}var Gu,ay;function WR(){if(ay)return Gu;ay=1,Gu=n;var e=Ac().EventEmitter,t=ui();t(n,e),n.Readable=ny(),n.Writable=Gg(),n.Duplex=qi(),n.Transform=iy(),n.PassThrough=qR(),n.finished=Uu(),n.pipeline=zR(),n.Stream=n;function n(){e.call(this)}return n.prototype.pipe=function(r,i){var o=this;function s(m){r.writable&&r.write(m)===!1&&o.pause&&o.pause()}o.on("data",s);function a(){o.readable&&o.resume&&o.resume()}r.on("drain",a),!r._isStdio&&(!i||i.end!==!1)&&(o.on("end",u),o.on("close",c));var l=!1;function u(){l||(l=!0,r.end())}function c(){l||(l=!0,typeof r.destroy=="function"&&r.destroy())}function p(m){if(d(),e.listenerCount(this,"error")===0)throw m}o.on("error",p),r.on("error",p);function d(){o.removeListener("data",s),r.removeListener("drain",a),o.removeListener("end",u),o.removeListener("close",c),o.removeListener("error",p),r.removeListener("error",p),o.removeListener("end",d),o.removeListener("close",d),r.removeListener("close",d)}return o.on("end",d),o.on("close",d),r.on("close",d),r.emit("pipe",o),r},Gu}var ly;function HR(){return ly||(ly=1,(function(e){(function(t){t.parser=function(F,C){return new r(F,C)},t.SAXParser=r,t.SAXStream=c,t.createStream=u,t.MAX_BUFFER_LENGTH=64*1024;var n=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function r(F,C){if(!(this instanceof r))return new r(F,C);var q=this;o(q),q.q=q.c="",q.bufferCheckPosition=t.MAX_BUFFER_LENGTH,q.opt=C||{},q.opt.lowercase=q.opt.lowercase||q.opt.lowercasetags,q.looseCase=q.opt.lowercase?"toLowerCase":"toUpperCase",q.tags=[],q.closed=q.closedRoot=q.sawRoot=!1,q.tag=q.error=null,q.strict=!!F,q.noscript=!!(F||q.opt.noscript),q.state=A.BEGIN,q.strictEntities=q.opt.strictEntities,q.ENTITIES=q.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),q.attribList=[],q.opt.xmlns&&(q.ns=Object.create(w)),q.opt.unquotedAttributeValues===void 0&&(q.opt.unquotedAttributeValues=!F),q.trackPosition=q.opt.position!==!1,q.trackPosition&&(q.position=q.line=q.column=0),W(q,"onready")}Object.create||(Object.create=function(F){function C(){}C.prototype=F;var q=new C;return q}),Object.keys||(Object.keys=function(F){var C=[];for(var q in F)F.hasOwnProperty(q)&&C.push(q);return C});function i(F){for(var C=Math.max(t.MAX_BUFFER_LENGTH,10),q=0,K=0,j=n.length;K<j;K++){var H=F[n[K]].length;if(H>C)switch(n[K]){case"textNode":D(F);break;case"cdata":O(F,"oncdata",F.cdata),F.cdata="";break;case"script":O(F,"onscript",F.script),F.script="";break;default:L(F,"Max buffer length exceeded: "+n[K])}q=Math.max(q,H)}var ge=t.MAX_BUFFER_LENGTH-q;F.bufferCheckPosition=ge+F.position}function o(F){for(var C=0,q=n.length;C<q;C++)F[n[C]]=""}function s(F){D(F),F.cdata!==""&&(O(F,"oncdata",F.cdata),F.cdata=""),F.script!==""&&(O(F,"onscript",F.script),F.script="")}r.prototype={end:function(){te(this)},write:ee,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){s(this)}};var a;try{a=WR().Stream}catch{a=function(){}}a||(a=function(){});var l=t.EVENTS.filter(function(F){return F!=="error"&&F!=="end"});function u(F,C){return new c(F,C)}function c(F,C){if(!(this instanceof c))return new c(F,C);a.apply(this),this._parser=new r(F,C),this.writable=!0,this.readable=!0;var q=this;this._parser.onend=function(){q.emit("end")},this._parser.onerror=function(K){q.emit("error",K),q._parser.error=null},this._decoder=null,l.forEach(function(K){Object.defineProperty(q,"on"+K,{get:function(){return q._parser["on"+K]},set:function(j){if(!j)return q.removeAllListeners(K),q._parser["on"+K]=j,j;q.on(K,j)},enumerable:!0,configurable:!1})})}c.prototype=Object.create(a.prototype,{constructor:{value:c}}),c.prototype.write=function(F){if(typeof Kr=="function"&&typeof Kr.isBuffer=="function"&&Kr.isBuffer(F)){if(!this._decoder){var C=Bu().StringDecoder;this._decoder=new C("utf8")}F=this._decoder.write(F)}return this._parser.write(F.toString()),this.emit("data",F),!0},c.prototype.end=function(F){return F&&F.length&&this.write(F),this._parser.end(),!0},c.prototype.on=function(F,C){var q=this;return!q._parser["on"+F]&&l.indexOf(F)!==-1&&(q._parser["on"+F]=function(){var K=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);K.splice(0,0,F),q.emit.apply(q,K)}),a.prototype.on.call(q,F,C)};var p="[CDATA[",d="DOCTYPE",m="http://www.w3.org/XML/1998/namespace",b="http://www.w3.org/2000/xmlns/",w={xml:m,xmlns:b},S=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,y=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,g=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,v=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function h(F){return F===" "||F===`
16
- `||F==="\r"||F===" "}function E(F){return F==='"'||F==="'"}function T(F){return F===">"||h(F)}function R(F,C){return F.test(C)}function x(F,C){return!R(F,C)}var A=0;t.STATE={BEGIN:A++,BEGIN_WHITESPACE:A++,TEXT:A++,TEXT_ENTITY:A++,OPEN_WAKA:A++,SGML_DECL:A++,SGML_DECL_QUOTED:A++,DOCTYPE:A++,DOCTYPE_QUOTED:A++,DOCTYPE_DTD:A++,DOCTYPE_DTD_QUOTED:A++,COMMENT_STARTING:A++,COMMENT:A++,COMMENT_ENDING:A++,COMMENT_ENDED:A++,CDATA:A++,CDATA_ENDING:A++,CDATA_ENDING_2:A++,PROC_INST:A++,PROC_INST_BODY:A++,PROC_INST_ENDING:A++,OPEN_TAG:A++,OPEN_TAG_SLASH:A++,ATTRIB:A++,ATTRIB_NAME:A++,ATTRIB_NAME_SAW_WHITE:A++,ATTRIB_VALUE:A++,ATTRIB_VALUE_QUOTED:A++,ATTRIB_VALUE_CLOSED:A++,ATTRIB_VALUE_UNQUOTED:A++,ATTRIB_VALUE_ENTITY_Q:A++,ATTRIB_VALUE_ENTITY_U:A++,CLOSE_TAG:A++,CLOSE_TAG_SAW_WHITE:A++,SCRIPT:A++,SCRIPT_ENDING:A++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(F){var C=t.ENTITIES[F],q=typeof C=="number"?String.fromCharCode(C):C;t.ENTITIES[F]=q});for(var N in t.STATE)t.STATE[t.STATE[N]]=N;A=t.STATE;function W(F,C,q){F[C]&&F[C](q)}function O(F,C,q){F.textNode&&D(F),W(F,C,q)}function D(F){F.textNode=V(F.opt,F.textNode),F.textNode&&W(F,"ontext",F.textNode),F.textNode=""}function V(F,C){return F.trim&&(C=C.trim()),F.normalize&&(C=C.replace(/\s+/g," ")),C}function L(F,C){return D(F),F.trackPosition&&(C+=`
17
- Line: `+F.line+`
18
- Column: `+F.column+`
19
- Char: `+F.c),C=new Error(C),F.error=C,W(F,"onerror",C),F}function te(F){return F.sawRoot&&!F.closedRoot&&Y(F,"Unclosed root tag"),F.state!==A.BEGIN&&F.state!==A.BEGIN_WHITESPACE&&F.state!==A.TEXT&&L(F,"Unexpected end"),D(F),F.c="",F.closed=!0,W(F,"onend"),r.call(F,F.strict,F.opt),F}function Y(F,C){if(typeof F!="object"||!(F instanceof r))throw new Error("bad call to strictFail");F.strict&&L(F,C)}function se(F){F.strict||(F.tagName=F.tagName[F.looseCase]());var C=F.tags[F.tags.length-1]||F,q=F.tag={name:F.tagName,attributes:{}};F.opt.xmlns&&(q.ns=C.ns),F.attribList.length=0,O(F,"onopentagstart",q)}function he(F,C){var q=F.indexOf(":"),K=q<0?["",F]:F.split(":"),j=K[0],H=K[1];return C&&F==="xmlns"&&(j="xmlns",H=""),{prefix:j,local:H}}function ae(F){if(F.strict||(F.attribName=F.attribName[F.looseCase]()),F.attribList.indexOf(F.attribName)!==-1||F.tag.attributes.hasOwnProperty(F.attribName)){F.attribName=F.attribValue="";return}if(F.opt.xmlns){var C=he(F.attribName,!0),q=C.prefix,K=C.local;if(q==="xmlns")if(K==="xml"&&F.attribValue!==m)Y(F,"xml: prefix must be bound to "+m+`
20
- Actual: `+F.attribValue);else if(K==="xmlns"&&F.attribValue!==b)Y(F,"xmlns: prefix must be bound to "+b+`
21
- Actual: `+F.attribValue);else{var j=F.tag,H=F.tags[F.tags.length-1]||F;j.ns===H.ns&&(j.ns=Object.create(H.ns)),j.ns[K]=F.attribValue}F.attribList.push([F.attribName,F.attribValue])}else F.tag.attributes[F.attribName]=F.attribValue,O(F,"onattribute",{name:F.attribName,value:F.attribValue});F.attribName=F.attribValue=""}function we(F,C){if(F.opt.xmlns){var q=F.tag,K=he(F.tagName);q.prefix=K.prefix,q.local=K.local,q.uri=q.ns[K.prefix]||"",q.prefix&&!q.uri&&(Y(F,"Unbound namespace prefix: "+JSON.stringify(F.tagName)),q.uri=K.prefix);var j=F.tags[F.tags.length-1]||F;q.ns&&j.ns!==q.ns&&Object.keys(q.ns).forEach(function(Qe){O(F,"onopennamespace",{prefix:Qe,uri:q.ns[Qe]})});for(var H=0,ge=F.attribList.length;H<ge;H++){var xe=F.attribList[H],De=xe[0],Oe=xe[1],Ce=he(De,!0),Fe=Ce.prefix,ye=Ce.local,We=Fe===""?"":q.ns[Fe]||"",Ge={name:De,value:Oe,prefix:Fe,local:ye,uri:We};Fe&&Fe!=="xmlns"&&!We&&(Y(F,"Unbound namespace prefix: "+JSON.stringify(Fe)),Ge.uri=Fe),F.tag.attributes[De]=Ge,O(F,"onattribute",Ge)}F.attribList.length=0}F.tag.isSelfClosing=!!C,F.sawRoot=!0,F.tags.push(F.tag),O(F,"onopentag",F.tag),C||(!F.noscript&&F.tagName.toLowerCase()==="script"?F.state=A.SCRIPT:F.state=A.TEXT,F.tag=null,F.tagName=""),F.attribName=F.attribValue="",F.attribList.length=0}function Q(F){if(!F.tagName){Y(F,"Weird empty close tag."),F.textNode+="</>",F.state=A.TEXT;return}if(F.script){if(F.tagName!=="script"){F.script+="</"+F.tagName+">",F.tagName="",F.state=A.SCRIPT;return}O(F,"onscript",F.script),F.script=""}var C=F.tags.length,q=F.tagName;F.strict||(q=q[F.looseCase]());for(var K=q;C--;){var j=F.tags[C];if(j.name!==K)Y(F,"Unexpected close tag");else break}if(C<0){Y(F,"Unmatched closing tag: "+F.tagName),F.textNode+="</"+F.tagName+">",F.state=A.TEXT;return}F.tagName=q;for(var H=F.tags.length;H-- >C;){var ge=F.tag=F.tags.pop();F.tagName=F.tag.name,O(F,"onclosetag",F.tagName);var xe={};for(var De in ge.ns)xe[De]=ge.ns[De];var Oe=F.tags[F.tags.length-1]||F;F.opt.xmlns&&ge.ns!==Oe.ns&&Object.keys(ge.ns).forEach(function(Ce){var Fe=ge.ns[Ce];O(F,"onclosenamespace",{prefix:Ce,uri:Fe})})}C===0&&(F.closedRoot=!0),F.tagName=F.attribValue=F.attribName="",F.attribList.length=0,F.state=A.TEXT}function ie(F){var C=F.entity,q=C.toLowerCase(),K,j="";return F.ENTITIES[C]?F.ENTITIES[C]:F.ENTITIES[q]?F.ENTITIES[q]:(C=q,C.charAt(0)==="#"&&(C.charAt(1)==="x"?(C=C.slice(2),K=parseInt(C,16),j=K.toString(16)):(C=C.slice(1),K=parseInt(C,10),j=K.toString(10))),C=C.replace(/^0+/,""),isNaN(K)||j.toLowerCase()!==C?(Y(F,"Invalid character entity"),"&"+F.entity+";"):String.fromCodePoint(K))}function ce(F,C){C==="<"?(F.state=A.OPEN_WAKA,F.startTagPosition=F.position):h(C)||(Y(F,"Non-whitespace before first tag."),F.textNode=C,F.state=A.TEXT)}function Ae(F,C){var q="";return C<F.length&&(q=F.charAt(C)),q}function ee(F){var C=this;if(this.error)throw this.error;if(C.closed)return L(C,"Cannot write after close. Assign an onready handler.");if(F===null)return te(C);typeof F=="object"&&(F=F.toString());for(var q=0,K="";K=Ae(F,q++),C.c=K,!!K;)switch(C.trackPosition&&(C.position++,K===`
22
- `?(C.line++,C.column=0):C.column++),C.state){case A.BEGIN:if(C.state=A.BEGIN_WHITESPACE,K==="\uFEFF")continue;ce(C,K);continue;case A.BEGIN_WHITESPACE:ce(C,K);continue;case A.TEXT:if(C.sawRoot&&!C.closedRoot){for(var j=q-1;K&&K!=="<"&&K!=="&";)K=Ae(F,q++),K&&C.trackPosition&&(C.position++,K===`
23
- `?(C.line++,C.column=0):C.column++);C.textNode+=F.substring(j,q-1)}K==="<"&&!(C.sawRoot&&C.closedRoot&&!C.strict)?(C.state=A.OPEN_WAKA,C.startTagPosition=C.position):(!h(K)&&(!C.sawRoot||C.closedRoot)&&Y(C,"Text data outside of root node."),K==="&"?C.state=A.TEXT_ENTITY:C.textNode+=K);continue;case A.SCRIPT:K==="<"?C.state=A.SCRIPT_ENDING:C.script+=K;continue;case A.SCRIPT_ENDING:K==="/"?C.state=A.CLOSE_TAG:(C.script+="<"+K,C.state=A.SCRIPT);continue;case A.OPEN_WAKA:if(K==="!")C.state=A.SGML_DECL,C.sgmlDecl="";else if(!h(K))if(R(S,K))C.state=A.OPEN_TAG,C.tagName=K;else if(K==="/")C.state=A.CLOSE_TAG,C.tagName="";else if(K==="?")C.state=A.PROC_INST,C.procInstName=C.procInstBody="";else{if(Y(C,"Unencoded <"),C.startTagPosition+1<C.position){var H=C.position-C.startTagPosition;K=new Array(H).join(" ")+K}C.textNode+="<"+K,C.state=A.TEXT}continue;case A.SGML_DECL:if(C.sgmlDecl+K==="--"){C.state=A.COMMENT,C.comment="",C.sgmlDecl="";continue}C.doctype&&C.doctype!==!0&&C.sgmlDecl?(C.state=A.DOCTYPE_DTD,C.doctype+="<!"+C.sgmlDecl+K,C.sgmlDecl=""):(C.sgmlDecl+K).toUpperCase()===p?(O(C,"onopencdata"),C.state=A.CDATA,C.sgmlDecl="",C.cdata=""):(C.sgmlDecl+K).toUpperCase()===d?(C.state=A.DOCTYPE,(C.doctype||C.sawRoot)&&Y(C,"Inappropriately located doctype declaration"),C.doctype="",C.sgmlDecl=""):K===">"?(O(C,"onsgmldeclaration",C.sgmlDecl),C.sgmlDecl="",C.state=A.TEXT):(E(K)&&(C.state=A.SGML_DECL_QUOTED),C.sgmlDecl+=K);continue;case A.SGML_DECL_QUOTED:K===C.q&&(C.state=A.SGML_DECL,C.q=""),C.sgmlDecl+=K;continue;case A.DOCTYPE:K===">"?(C.state=A.TEXT,O(C,"ondoctype",C.doctype),C.doctype=!0):(C.doctype+=K,K==="["?C.state=A.DOCTYPE_DTD:E(K)&&(C.state=A.DOCTYPE_QUOTED,C.q=K));continue;case A.DOCTYPE_QUOTED:C.doctype+=K,K===C.q&&(C.q="",C.state=A.DOCTYPE);continue;case A.DOCTYPE_DTD:K==="]"?(C.doctype+=K,C.state=A.DOCTYPE):K==="<"?(C.state=A.OPEN_WAKA,C.startTagPosition=C.position):E(K)?(C.doctype+=K,C.state=A.DOCTYPE_DTD_QUOTED,C.q=K):C.doctype+=K;continue;case A.DOCTYPE_DTD_QUOTED:C.doctype+=K,K===C.q&&(C.state=A.DOCTYPE_DTD,C.q="");continue;case A.COMMENT:K==="-"?C.state=A.COMMENT_ENDING:C.comment+=K;continue;case A.COMMENT_ENDING:K==="-"?(C.state=A.COMMENT_ENDED,C.comment=V(C.opt,C.comment),C.comment&&O(C,"oncomment",C.comment),C.comment=""):(C.comment+="-"+K,C.state=A.COMMENT);continue;case A.COMMENT_ENDED:K!==">"?(Y(C,"Malformed comment"),C.comment+="--"+K,C.state=A.COMMENT):C.doctype&&C.doctype!==!0?C.state=A.DOCTYPE_DTD:C.state=A.TEXT;continue;case A.CDATA:K==="]"?C.state=A.CDATA_ENDING:C.cdata+=K;continue;case A.CDATA_ENDING:K==="]"?C.state=A.CDATA_ENDING_2:(C.cdata+="]"+K,C.state=A.CDATA);continue;case A.CDATA_ENDING_2:K===">"?(C.cdata&&O(C,"oncdata",C.cdata),O(C,"onclosecdata"),C.cdata="",C.state=A.TEXT):K==="]"?C.cdata+="]":(C.cdata+="]]"+K,C.state=A.CDATA);continue;case A.PROC_INST:K==="?"?C.state=A.PROC_INST_ENDING:h(K)?C.state=A.PROC_INST_BODY:C.procInstName+=K;continue;case A.PROC_INST_BODY:if(!C.procInstBody&&h(K))continue;K==="?"?C.state=A.PROC_INST_ENDING:C.procInstBody+=K;continue;case A.PROC_INST_ENDING:K===">"?(O(C,"onprocessinginstruction",{name:C.procInstName,body:C.procInstBody}),C.procInstName=C.procInstBody="",C.state=A.TEXT):(C.procInstBody+="?"+K,C.state=A.PROC_INST_BODY);continue;case A.OPEN_TAG:R(y,K)?C.tagName+=K:(se(C),K===">"?we(C):K==="/"?C.state=A.OPEN_TAG_SLASH:(h(K)||Y(C,"Invalid character in tag name"),C.state=A.ATTRIB));continue;case A.OPEN_TAG_SLASH:K===">"?(we(C,!0),Q(C)):(Y(C,"Forward-slash in opening tag not followed by >"),C.state=A.ATTRIB);continue;case A.ATTRIB:if(h(K))continue;K===">"?we(C):K==="/"?C.state=A.OPEN_TAG_SLASH:R(S,K)?(C.attribName=K,C.attribValue="",C.state=A.ATTRIB_NAME):Y(C,"Invalid attribute name");continue;case A.ATTRIB_NAME:K==="="?C.state=A.ATTRIB_VALUE:K===">"?(Y(C,"Attribute without value"),C.attribValue=C.attribName,ae(C),we(C)):h(K)?C.state=A.ATTRIB_NAME_SAW_WHITE:R(y,K)?C.attribName+=K:Y(C,"Invalid attribute name");continue;case A.ATTRIB_NAME_SAW_WHITE:if(K==="=")C.state=A.ATTRIB_VALUE;else{if(h(K))continue;Y(C,"Attribute without value"),C.tag.attributes[C.attribName]="",C.attribValue="",O(C,"onattribute",{name:C.attribName,value:""}),C.attribName="",K===">"?we(C):R(S,K)?(C.attribName=K,C.state=A.ATTRIB_NAME):(Y(C,"Invalid attribute name"),C.state=A.ATTRIB)}continue;case A.ATTRIB_VALUE:if(h(K))continue;E(K)?(C.q=K,C.state=A.ATTRIB_VALUE_QUOTED):(C.opt.unquotedAttributeValues||L(C,"Unquoted attribute value"),C.state=A.ATTRIB_VALUE_UNQUOTED,C.attribValue=K);continue;case A.ATTRIB_VALUE_QUOTED:if(K!==C.q){K==="&"?C.state=A.ATTRIB_VALUE_ENTITY_Q:C.attribValue+=K;continue}ae(C),C.q="",C.state=A.ATTRIB_VALUE_CLOSED;continue;case A.ATTRIB_VALUE_CLOSED:h(K)?C.state=A.ATTRIB:K===">"?we(C):K==="/"?C.state=A.OPEN_TAG_SLASH:R(S,K)?(Y(C,"No whitespace between attributes"),C.attribName=K,C.attribValue="",C.state=A.ATTRIB_NAME):Y(C,"Invalid attribute name");continue;case A.ATTRIB_VALUE_UNQUOTED:if(!T(K)){K==="&"?C.state=A.ATTRIB_VALUE_ENTITY_U:C.attribValue+=K;continue}ae(C),K===">"?we(C):C.state=A.ATTRIB;continue;case A.CLOSE_TAG:if(C.tagName)K===">"?Q(C):R(y,K)?C.tagName+=K:C.script?(C.script+="</"+C.tagName,C.tagName="",C.state=A.SCRIPT):(h(K)||Y(C,"Invalid tagname in closing tag"),C.state=A.CLOSE_TAG_SAW_WHITE);else{if(h(K))continue;x(S,K)?C.script?(C.script+="</"+K,C.state=A.SCRIPT):Y(C,"Invalid tagname in closing tag."):C.tagName=K}continue;case A.CLOSE_TAG_SAW_WHITE:if(h(K))continue;K===">"?Q(C):Y(C,"Invalid characters in closing tag");continue;case A.TEXT_ENTITY:case A.ATTRIB_VALUE_ENTITY_Q:case A.ATTRIB_VALUE_ENTITY_U:var ge,xe;switch(C.state){case A.TEXT_ENTITY:ge=A.TEXT,xe="textNode";break;case A.ATTRIB_VALUE_ENTITY_Q:ge=A.ATTRIB_VALUE_QUOTED,xe="attribValue";break;case A.ATTRIB_VALUE_ENTITY_U:ge=A.ATTRIB_VALUE_UNQUOTED,xe="attribValue";break}if(K===";"){var De=ie(C);C.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(De)?(C.entity="",C.state=ge,C.write(De)):(C[xe]+=De,C.entity="",C.state=ge)}else R(C.entity.length?v:g,K)?C.entity+=K:(Y(C,"Invalid character in entity name"),C[xe]+="&"+C.entity+K,C.entity="",C.state=ge);continue;default:throw new Error(C,"Unknown state: "+C.state)}return C.position>=C.bufferCheckPosition&&i(C),C}String.fromCodePoint||(function(){var F=String.fromCharCode,C=Math.floor,q=function(){var K=16384,j=[],H,ge,xe=-1,De=arguments.length;if(!De)return"";for(var Oe="";++xe<De;){var Ce=Number(arguments[xe]);if(!isFinite(Ce)||Ce<0||Ce>1114111||C(Ce)!==Ce)throw RangeError("Invalid code point: "+Ce);Ce<=65535?j.push(Ce):(Ce-=65536,H=(Ce>>10)+55296,ge=Ce%1024+56320,j.push(H,ge)),(xe+1===De||j.length>K)&&(Oe+=F.apply(null,j),j.length=0)}return Oe};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:q,configurable:!0,writable:!0}):String.fromCodePoint=q})()})(e)})(Tc)),Tc}var Qu,cy;function Xu(){return cy||(cy=1,Qu={isArray:function(e){return Array.isArray?Array.isArray(e):Object.prototype.toString.call(e)==="[object Array]"}}),Qu}var Yu,uy;function Ju(){if(uy)return Yu;uy=1;var e=Xu().isArray;return Yu={copyOptions:function(t){var n,r={};for(n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);return r},ensureFlagExists:function(t,n){(!(t in n)||typeof n[t]!="boolean")&&(n[t]=!1)},ensureSpacesExists:function(t){(!("spaces"in t)||typeof t.spaces!="number"&&typeof t.spaces!="string")&&(t.spaces=0)},ensureAlwaysArrayExists:function(t){(!("alwaysArray"in t)||typeof t.alwaysArray!="boolean"&&!e(t.alwaysArray))&&(t.alwaysArray=!1)},ensureKeyExists:function(t,n){(!(t+"Key"in n)||typeof n[t+"Key"]!="string")&&(n[t+"Key"]=n.compact?"_"+t:t)},checkFnExists:function(t,n){return t+"Fn"in n}},Yu}var Zu,fy;function dy(){if(fy)return Zu;fy=1;var e=HR(),t=Ju(),n=Xu().isArray,r,i;function o(y){return r=t.copyOptions(y),t.ensureFlagExists("ignoreDeclaration",r),t.ensureFlagExists("ignoreInstruction",r),t.ensureFlagExists("ignoreAttributes",r),t.ensureFlagExists("ignoreText",r),t.ensureFlagExists("ignoreComment",r),t.ensureFlagExists("ignoreCdata",r),t.ensureFlagExists("ignoreDoctype",r),t.ensureFlagExists("compact",r),t.ensureFlagExists("alwaysChildren",r),t.ensureFlagExists("addParent",r),t.ensureFlagExists("trim",r),t.ensureFlagExists("nativeType",r),t.ensureFlagExists("nativeTypeAttributes",r),t.ensureFlagExists("sanitize",r),t.ensureFlagExists("instructionHasAttributes",r),t.ensureFlagExists("captureSpacesBetweenElements",r),t.ensureAlwaysArrayExists(r),t.ensureKeyExists("declaration",r),t.ensureKeyExists("instruction",r),t.ensureKeyExists("attributes",r),t.ensureKeyExists("text",r),t.ensureKeyExists("comment",r),t.ensureKeyExists("cdata",r),t.ensureKeyExists("doctype",r),t.ensureKeyExists("type",r),t.ensureKeyExists("name",r),t.ensureKeyExists("elements",r),t.ensureKeyExists("parent",r),t.checkFnExists("doctype",r),t.checkFnExists("instruction",r),t.checkFnExists("cdata",r),t.checkFnExists("comment",r),t.checkFnExists("text",r),t.checkFnExists("instructionName",r),t.checkFnExists("elementName",r),t.checkFnExists("attributeName",r),t.checkFnExists("attributeValue",r),t.checkFnExists("attributes",r),r}function s(y){var g=Number(y);if(!isNaN(g))return g;var v=y.toLowerCase();return v==="true"?!0:v==="false"?!1:y}function a(y,g){var v;if(r.compact){if(!i[r[y+"Key"]]&&(n(r.alwaysArray)?r.alwaysArray.indexOf(r[y+"Key"])!==-1:r.alwaysArray)&&(i[r[y+"Key"]]=[]),i[r[y+"Key"]]&&!n(i[r[y+"Key"]])&&(i[r[y+"Key"]]=[i[r[y+"Key"]]]),y+"Fn"in r&&typeof g=="string"&&(g=r[y+"Fn"](g,i)),y==="instruction"&&("instructionFn"in r||"instructionNameFn"in r)){for(v in g)if(g.hasOwnProperty(v))if("instructionFn"in r)g[v]=r.instructionFn(g[v],v,i);else{var h=g[v];delete g[v],g[r.instructionNameFn(v,h,i)]=h}}n(i[r[y+"Key"]])?i[r[y+"Key"]].push(g):i[r[y+"Key"]]=g}else{i[r.elementsKey]||(i[r.elementsKey]=[]);var E={};if(E[r.typeKey]=y,y==="instruction"){for(v in g)if(g.hasOwnProperty(v))break;E[r.nameKey]="instructionNameFn"in r?r.instructionNameFn(v,g,i):v,r.instructionHasAttributes?(E[r.attributesKey]=g[v][r.attributesKey],"instructionFn"in r&&(E[r.attributesKey]=r.instructionFn(E[r.attributesKey],v,i))):("instructionFn"in r&&(g[v]=r.instructionFn(g[v],v,i)),E[r.instructionKey]=g[v])}else y+"Fn"in r&&(g=r[y+"Fn"](g,i)),E[r[y+"Key"]]=g;r.addParent&&(E[r.parentKey]=i),i[r.elementsKey].push(E)}}function l(y){if("attributesFn"in r&&y&&(y=r.attributesFn(y,i)),(r.trim||"attributeValueFn"in r||"attributeNameFn"in r||r.nativeTypeAttributes)&&y){var g;for(g in y)if(y.hasOwnProperty(g)&&(r.trim&&(y[g]=y[g].trim()),r.nativeTypeAttributes&&(y[g]=s(y[g])),"attributeValueFn"in r&&(y[g]=r.attributeValueFn(y[g],g,i)),"attributeNameFn"in r)){var v=y[g];delete y[g],y[r.attributeNameFn(g,y[g],i)]=v}}return y}function u(y){var g={};if(y.body&&(y.name.toLowerCase()==="xml"||r.instructionHasAttributes)){for(var v=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,h;(h=v.exec(y.body))!==null;)g[h[1]]=h[2]||h[3]||h[4];g=l(g)}if(y.name.toLowerCase()==="xml"){if(r.ignoreDeclaration)return;i[r.declarationKey]={},Object.keys(g).length&&(i[r.declarationKey][r.attributesKey]=g),r.addParent&&(i[r.declarationKey][r.parentKey]=i)}else{if(r.ignoreInstruction)return;r.trim&&(y.body=y.body.trim());var E={};r.instructionHasAttributes&&Object.keys(g).length?(E[y.name]={},E[y.name][r.attributesKey]=g):E[y.name]=y.body,a("instruction",E)}}function c(y,g){var v;if(typeof y=="object"&&(g=y.attributes,y=y.name),g=l(g),"elementNameFn"in r&&(y=r.elementNameFn(y,i)),r.compact){if(v={},!r.ignoreAttributes&&g&&Object.keys(g).length){v[r.attributesKey]={};var h;for(h in g)g.hasOwnProperty(h)&&(v[r.attributesKey][h]=g[h])}!(y in i)&&(n(r.alwaysArray)?r.alwaysArray.indexOf(y)!==-1:r.alwaysArray)&&(i[y]=[]),i[y]&&!n(i[y])&&(i[y]=[i[y]]),n(i[y])?i[y].push(v):i[y]=v}else i[r.elementsKey]||(i[r.elementsKey]=[]),v={},v[r.typeKey]="element",v[r.nameKey]=y,!r.ignoreAttributes&&g&&Object.keys(g).length&&(v[r.attributesKey]=g),r.alwaysChildren&&(v[r.elementsKey]=[]),i[r.elementsKey].push(v);v[r.parentKey]=i,i=v}function p(y){r.ignoreText||!y.trim()&&!r.captureSpacesBetweenElements||(r.trim&&(y=y.trim()),r.nativeType&&(y=s(y)),r.sanitize&&(y=y.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")),a("text",y))}function d(y){r.ignoreComment||(r.trim&&(y=y.trim()),a("comment",y))}function m(y){var g=i[r.parentKey];r.addParent||delete i[r.parentKey],i=g}function b(y){r.ignoreCdata||(r.trim&&(y=y.trim()),a("cdata",y))}function w(y){r.ignoreDoctype||(y=y.replace(/^ /,""),r.trim&&(y=y.trim()),a("doctype",y))}function S(y){y.note=y}return Zu=function(y,g){var v=e.parser(!0,{}),h={};if(i=h,r=o(g),v.opt={strictEntities:!0},v.onopentag=c,v.ontext=p,v.oncomment=d,v.onclosetag=m,v.onerror=S,v.oncdata=b,v.ondoctype=w,v.onprocessinginstruction=u,v.write(y).close(),h[r.elementsKey]){var E=h[r.elementsKey];delete h[r.elementsKey],h[r.elementsKey]=E,delete h.text}return h},Zu}var ef,py;function KR(){if(py)return ef;py=1;var e=Ju(),t=dy();function n(r){var i=e.copyOptions(r);return e.ensureSpacesExists(i),i}return ef=function(r,i){var o,s,a,l;return o=n(i),s=t(r,o),l="compact"in o&&o.compact?"_parent":"parent","addParent"in o&&o.addParent?a=JSON.stringify(s,function(u,c){return u===l?"_":c},o.spaces):a=JSON.stringify(s,null,o.spaces),a.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")},ef}var tf,hy;function my(){if(hy)return tf;hy=1;var e=Ju(),t=Xu().isArray,n,r;function i(v){var h=e.copyOptions(v);return e.ensureFlagExists("ignoreDeclaration",h),e.ensureFlagExists("ignoreInstruction",h),e.ensureFlagExists("ignoreAttributes",h),e.ensureFlagExists("ignoreText",h),e.ensureFlagExists("ignoreComment",h),e.ensureFlagExists("ignoreCdata",h),e.ensureFlagExists("ignoreDoctype",h),e.ensureFlagExists("compact",h),e.ensureFlagExists("indentText",h),e.ensureFlagExists("indentCdata",h),e.ensureFlagExists("indentAttributes",h),e.ensureFlagExists("indentInstruction",h),e.ensureFlagExists("fullTagEmptyElement",h),e.ensureFlagExists("noQuotesForNativeAttributes",h),e.ensureSpacesExists(h),typeof h.spaces=="number"&&(h.spaces=Array(h.spaces+1).join(" ")),e.ensureKeyExists("declaration",h),e.ensureKeyExists("instruction",h),e.ensureKeyExists("attributes",h),e.ensureKeyExists("text",h),e.ensureKeyExists("comment",h),e.ensureKeyExists("cdata",h),e.ensureKeyExists("doctype",h),e.ensureKeyExists("type",h),e.ensureKeyExists("name",h),e.ensureKeyExists("elements",h),e.checkFnExists("doctype",h),e.checkFnExists("instruction",h),e.checkFnExists("cdata",h),e.checkFnExists("comment",h),e.checkFnExists("text",h),e.checkFnExists("instructionName",h),e.checkFnExists("elementName",h),e.checkFnExists("attributeName",h),e.checkFnExists("attributeValue",h),e.checkFnExists("attributes",h),e.checkFnExists("fullTagEmptyElement",h),h}function o(v,h,E){return(!E&&v.spaces?`
24
- `:"")+Array(h+1).join(v.spaces)}function s(v,h,E){if(h.ignoreAttributes)return"";"attributesFn"in h&&(v=h.attributesFn(v,r,n));var T,R,x,A,N=[];for(T in v)v.hasOwnProperty(T)&&v[T]!==null&&v[T]!==void 0&&(A=h.noQuotesForNativeAttributes&&typeof v[T]!="string"?"":'"',R=""+v[T],R=R.replace(/"/g,"&quot;"),x="attributeNameFn"in h?h.attributeNameFn(T,R,r,n):T,N.push(h.spaces&&h.indentAttributes?o(h,E+1,!1):" "),N.push(x+"="+A+("attributeValueFn"in h?h.attributeValueFn(R,T,r,n):R)+A));return v&&Object.keys(v).length&&h.spaces&&h.indentAttributes&&N.push(o(h,E,!1)),N.join("")}function a(v,h,E){return n=v,r="xml",h.ignoreDeclaration?"":"<?xml"+s(v[h.attributesKey],h,E)+"?>"}function l(v,h,E){if(h.ignoreInstruction)return"";var T;for(T in v)if(v.hasOwnProperty(T))break;var R="instructionNameFn"in h?h.instructionNameFn(T,v[T],r,n):T;if(typeof v[T]=="object")return n=v,r=R,"<?"+R+s(v[T][h.attributesKey],h,E)+"?>";var x=v[T]?v[T]:"";return"instructionFn"in h&&(x=h.instructionFn(x,T,r,n)),"<?"+R+(x?" "+x:"")+"?>"}function u(v,h){return h.ignoreComment?"":"<!--"+("commentFn"in h?h.commentFn(v,r,n):v)+"-->"}function c(v,h){return h.ignoreCdata?"":"<![CDATA["+("cdataFn"in h?h.cdataFn(v,r,n):v.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function p(v,h){return h.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in h?h.doctypeFn(v,r,n):v)+">"}function d(v,h){return h.ignoreText?"":(v=""+v,v=v.replace(/&amp;/g,"&"),v=v.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"textFn"in h?h.textFn(v,r,n):v)}function m(v,h){var E;if(v.elements&&v.elements.length)for(E=0;E<v.elements.length;++E)switch(v.elements[E][h.typeKey]){case"text":if(h.indentText)return!0;break;case"cdata":if(h.indentCdata)return!0;break;case"instruction":if(h.indentInstruction)return!0;break;case"doctype":case"comment":case"element":return!0;default:return!0}return!1}function b(v,h,E){n=v,r=v.name;var T=[],R="elementNameFn"in h?h.elementNameFn(v.name,v):v.name;T.push("<"+R),v[h.attributesKey]&&T.push(s(v[h.attributesKey],h,E));var x=v[h.elementsKey]&&v[h.elementsKey].length||v[h.attributesKey]&&v[h.attributesKey]["xml:space"]==="preserve";return x||("fullTagEmptyElementFn"in h?x=h.fullTagEmptyElementFn(v.name,v):x=h.fullTagEmptyElement),x?(T.push(">"),v[h.elementsKey]&&v[h.elementsKey].length&&(T.push(w(v[h.elementsKey],h,E+1)),n=v,r=v.name),T.push(h.spaces&&m(v,h)?`
25
- `+Array(E+1).join(h.spaces):""),T.push("</"+R+">")):T.push("/>"),T.join("")}function w(v,h,E,T){return v.reduce(function(R,x){var A=o(h,E,T&&!R);switch(x.type){case"element":return R+A+b(x,h,E);case"comment":return R+A+u(x[h.commentKey],h);case"doctype":return R+A+p(x[h.doctypeKey],h);case"cdata":return R+(h.indentCdata?A:"")+c(x[h.cdataKey],h);case"text":return R+(h.indentText?A:"")+d(x[h.textKey],h);case"instruction":var N={};return N[x[h.nameKey]]=x[h.attributesKey]?x:x[h.instructionKey],R+(h.indentInstruction?A:"")+l(N,h,E)}},"")}function S(v,h,E){var T;for(T in v)if(v.hasOwnProperty(T))switch(T){case h.parentKey:case h.attributesKey:break;case h.textKey:if(h.indentText||E)return!0;break;case h.cdataKey:if(h.indentCdata||E)return!0;break;case h.instructionKey:if(h.indentInstruction||E)return!0;break;case h.doctypeKey:case h.commentKey:return!0;default:return!0}return!1}function y(v,h,E,T,R){n=v,r=h;var x="elementNameFn"in E?E.elementNameFn(h,v):h;if(typeof v>"u"||v===null||v==="")return"fullTagEmptyElementFn"in E&&E.fullTagEmptyElementFn(h,v)||E.fullTagEmptyElement?"<"+x+"></"+x+">":"<"+x+"/>";var A=[];if(h){if(A.push("<"+x),typeof v!="object")return A.push(">"+d(v,E)+"</"+x+">"),A.join("");v[E.attributesKey]&&A.push(s(v[E.attributesKey],E,T));var N=S(v,E,!0)||v[E.attributesKey]&&v[E.attributesKey]["xml:space"]==="preserve";if(N||("fullTagEmptyElementFn"in E?N=E.fullTagEmptyElementFn(h,v):N=E.fullTagEmptyElement),N)A.push(">");else return A.push("/>"),A.join("")}return A.push(g(v,E,T+1,!1)),n=v,r=h,h&&A.push((R?o(E,T,!1):"")+"</"+x+">"),A.join("")}function g(v,h,E,T){var R,x,A,N=[];for(x in v)if(v.hasOwnProperty(x))for(A=t(v[x])?v[x]:[v[x]],R=0;R<A.length;++R){switch(x){case h.declarationKey:N.push(a(A[R],h,E));break;case h.instructionKey:N.push((h.indentInstruction?o(h,E,T):"")+l(A[R],h,E));break;case h.attributesKey:case h.parentKey:break;case h.textKey:N.push((h.indentText?o(h,E,T):"")+d(A[R],h));break;case h.cdataKey:N.push((h.indentCdata?o(h,E,T):"")+c(A[R],h));break;case h.doctypeKey:N.push(o(h,E,T)+p(A[R],h));break;case h.commentKey:N.push(o(h,E,T)+u(A[R],h));break;default:N.push(o(h,E,T)+y(A[R],x,h,E,S(A[R],h)))}T=T&&!N.length}return N.join("")}return tf=function(v,h){h=i(h);var E=[];return n=v,r="_root_",h.compact?E.push(g(v,h,0,!0)):(v[h.declarationKey]&&E.push(a(v[h.declarationKey],h,0)),v[h.elementsKey]&&v[h.elementsKey].length&&E.push(w(v[h.elementsKey],h,0,!E.length))),E.join("")},tf}var nf,gy;function GR(){if(gy)return nf;gy=1;var e=my();return nf=function(t,n){t instanceof Kr&&(t=t.toString());var r=null;if(typeof t=="string")try{r=JSON.parse(t)}catch{throw new Error("The JSON structure is invalid")}else r=t;return e(r,n)},nf}var rf,yy;function QR(){if(yy)return rf;yy=1;var e=dy(),t=KR(),n=my(),r=GR();return rf={xml2js:e,xml2json:t,js2xml:n,json2xml:r},rf}QR();var XR={2:e=>{function t(i,o,s){i instanceof RegExp&&(i=n(i,s)),o instanceof RegExp&&(o=n(o,s));var a=r(i,o,s);return a&&{start:a[0],end:a[1],pre:s.slice(0,a[0]),body:s.slice(a[0]+i.length,a[1]),post:s.slice(a[1]+o.length)}}function n(i,o){var s=o.match(i);return s?s[0]:null}function r(i,o,s){var a,l,u,c,p,d=s.indexOf(i),m=s.indexOf(o,d+1),b=d;if(d>=0&&m>0){for(a=[],u=s.length;b>=0&&!p;)b==d?(a.push(b),d=s.indexOf(i,b+1)):a.length==1?p=[a.pop(),m]:((l=a.pop())<u&&(u=l,c=m),m=s.indexOf(o,b+1)),b=d<m&&d>=0?d:m;a.length&&(p=[u,c])}return p}e.exports=t,t.range=r},101:function(e,t,n){var r;e=n.nmd(e),(function(i){var o=(e&&e.exports,typeof Wr=="object"&&Wr);o.global!==o&&o.window;var s=function(p){this.message=p};(s.prototype=new Error).name="InvalidCharacterError";var a=function(p){throw new s(p)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,c={encode:function(p){p=String(p),/[^\0-\xFF]/.test(p)&&a("The string to be encoded contains characters outside of the Latin1 range.");for(var d,m,b,w,S=p.length%3,y="",g=-1,v=p.length-S;++g<v;)d=p.charCodeAt(g)<<16,m=p.charCodeAt(++g)<<8,b=p.charCodeAt(++g),y+=l.charAt((w=d+m+b)>>18&63)+l.charAt(w>>12&63)+l.charAt(w>>6&63)+l.charAt(63&w);return S==2?(d=p.charCodeAt(g)<<8,m=p.charCodeAt(++g),y+=l.charAt((w=d+m)>>10)+l.charAt(w>>4&63)+l.charAt(w<<2&63)+"="):S==1&&(w=p.charCodeAt(g),y+=l.charAt(w>>2)+l.charAt(w<<4&63)+"=="),y},decode:function(p){var d=(p=String(p).replace(u,"")).length;d%4==0&&(d=(p=p.replace(/==?$/,"")).length),(d%4==1||/[^+a-zA-Z0-9/]/.test(p))&&a("Invalid character: the string to be decoded is not correctly encoded.");for(var m,b,w=0,S="",y=-1;++y<d;)b=l.indexOf(p.charAt(y)),m=w%4?64*m+b:b,w++%4&&(S+=String.fromCharCode(255&m>>(-2*w&6)));return S},version:"1.0.0"};(r=(function(){return c}).call(t,n,t,e))===void 0||(e.exports=r)})()},172:(e,t)=>{t.d=function(n){if(!n)return 0;for(var r=(n=n.toString()).length,i=n.length;i--;){var o=n.charCodeAt(i);56320<=o&&o<=57343&&i--,127<o&&o<=2047?r++:2047<o&&o<=65535&&(r+=2)}return r}},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=[],i=0;i<n.length;i++)r.push(255&n.charCodeAt(i));return r},bytesToString:function(n){for(var r=[],i=0;i<n.length;i++)r.push(String.fromCharCode(n[i]));return r.join("")}}};e.exports=t},298:e=>{var t,n;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(r,i){return r<<i|r>>>32-i},rotr:function(r,i){return r<<32-i|r>>>i},endian:function(r){if(r.constructor==Number)return 16711935&n.rotl(r,8)|4278255360&n.rotl(r,24);for(var i=0;i<r.length;i++)r[i]=n.endian(r[i]);return r},randomBytes:function(r){for(var i=[];r>0;r--)i.push(Math.floor(256*Math.random()));return i},bytesToWords:function(r){for(var i=[],o=0,s=0;o<r.length;o++,s+=8)i[s>>>5]|=r[o]<<24-s%32;return i},wordsToBytes:function(r){for(var i=[],o=0;o<32*r.length;o+=8)i.push(r[o>>>5]>>>24-o%32&255);return i},bytesToHex:function(r){for(var i=[],o=0;o<r.length;o++)i.push((r[o]>>>4).toString(16)),i.push((15&r[o]).toString(16));return i.join("")},hexToBytes:function(r){for(var i=[],o=0;o<r.length;o+=2)i.push(parseInt(r.substr(o,2),16));return i},bytesToBase64:function(r){for(var i=[],o=0;o<r.length;o+=3)for(var s=r[o]<<16|r[o+1]<<8|r[o+2],a=0;a<4;a++)8*o+6*a<=8*r.length?i.push(t.charAt(s>>>6*(3-a)&63)):i.push("=");return i.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/gi,"");for(var i=[],o=0,s=0;o<r.length;s=++o%4)s!=0&&i.push((t.indexOf(r.charAt(o-1))&Math.pow(2,-2*s+8)-1)<<2*s|t.indexOf(r.charAt(o))>>>6-2*s);return i}},e.exports=n},635:(e,t,n)=>{const r=n(31),i=n(338),o=n(221);e.exports={XMLParser:i,XMLValidator:r,XMLBuilder:o}},118:e=>{e.exports=function(t){return typeof t=="function"?t:Array.isArray(t)?n=>{for(const r of t)if(typeof r=="string"&&n===r||r instanceof RegExp&&r.test(n))return!0}:()=>!1}},705:(e,t)=>{const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",r="["+n+"]["+n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",i=new RegExp("^"+r+"$");t.isExist=function(o){return o!==void 0},t.isEmptyObject=function(o){return Object.keys(o).length===0},t.merge=function(o,s,a){if(s){const l=Object.keys(s),u=l.length;for(let c=0;c<u;c++)o[l[c]]=a==="strict"?[s[l[c]]]:s[l[c]]}},t.getValue=function(o){return t.isExist(o)?o:""},t.isName=function(o){return i.exec(o)!=null},t.getAllMatches=function(o,s){const a=[];let l=s.exec(o);for(;l;){const u=[];u.startIndex=s.lastIndex-l[0].length;const c=l.length;for(let p=0;p<c;p++)u.push(l[p]);a.push(u),l=s.exec(o)}return a},t.nameRegexp=r},31:(e,t,n)=>{const r=n(705),i={allowBooleanAttributes:!1,unpairedTags:[]};function o(g){return g===" "||g===" "||g===`
26
- `||g==="\r"}function s(g,v){const h=v;for(;v<g.length;v++)if(!(g[v]!="?"&&g[v]!=" ")){const E=g.substr(h,v-h);if(v>5&&E==="xml")return b("InvalidXml","XML declaration allowed only at the start of the document.",S(g,v));if(g[v]=="?"&&g[v+1]==">"){v++;break}}return v}function a(g,v){if(g.length>v+5&&g[v+1]==="-"&&g[v+2]==="-"){for(v+=3;v<g.length;v++)if(g[v]==="-"&&g[v+1]==="-"&&g[v+2]===">"){v+=2;break}}else if(g.length>v+8&&g[v+1]==="D"&&g[v+2]==="O"&&g[v+3]==="C"&&g[v+4]==="T"&&g[v+5]==="Y"&&g[v+6]==="P"&&g[v+7]==="E"){let h=1;for(v+=8;v<g.length;v++)if(g[v]==="<")h++;else if(g[v]===">"&&(h--,h===0))break}else if(g.length>v+9&&g[v+1]==="["&&g[v+2]==="C"&&g[v+3]==="D"&&g[v+4]==="A"&&g[v+5]==="T"&&g[v+6]==="A"&&g[v+7]==="["){for(v+=8;v<g.length;v++)if(g[v]==="]"&&g[v+1]==="]"&&g[v+2]===">"){v+=2;break}}return v}t.validate=function(g,v){v=Object.assign({},i,v);const h=[];let E=!1,T=!1;g[0]==="\uFEFF"&&(g=g.substr(1));for(let x=0;x<g.length;x++)if(g[x]==="<"&&g[x+1]==="?"){if(x+=2,x=s(g,x),x.err)return x}else{if(g[x]!=="<"){if(o(g[x]))continue;return b("InvalidChar","char '"+g[x]+"' is not expected.",S(g,x))}{let A=x;if(x++,g[x]==="!"){x=a(g,x);continue}{let N=!1;g[x]==="/"&&(N=!0,x++);let W="";for(;x<g.length&&g[x]!==">"&&g[x]!==" "&&g[x]!==" "&&g[x]!==`
27
- `&&g[x]!=="\r";x++)W+=g[x];if(W=W.trim(),W[W.length-1]==="/"&&(W=W.substring(0,W.length-1),x--),R=W,!r.isName(R)){let V;return V=W.trim().length===0?"Invalid space after '<'.":"Tag '"+W+"' is an invalid name.",b("InvalidTag",V,S(g,x))}const O=c(g,x);if(O===!1)return b("InvalidAttr","Attributes for '"+W+"' have open quote.",S(g,x));let D=O.value;if(x=O.index,D[D.length-1]==="/"){const V=x-D.length;D=D.substring(0,D.length-1);const L=d(D,v);if(L!==!0)return b(L.err.code,L.err.msg,S(g,V+L.err.line));E=!0}else if(N){if(!O.tagClosed)return b("InvalidTag","Closing tag '"+W+"' doesn't have proper closing.",S(g,x));if(D.trim().length>0)return b("InvalidTag","Closing tag '"+W+"' can't have attributes or invalid starting.",S(g,A));if(h.length===0)return b("InvalidTag","Closing tag '"+W+"' has not been opened.",S(g,A));{const V=h.pop();if(W!==V.tagName){let L=S(g,V.tagStartPos);return b("InvalidTag","Expected closing tag '"+V.tagName+"' (opened in line "+L.line+", col "+L.col+") instead of closing tag '"+W+"'.",S(g,A))}h.length==0&&(T=!0)}}else{const V=d(D,v);if(V!==!0)return b(V.err.code,V.err.msg,S(g,x-D.length+V.err.line));if(T===!0)return b("InvalidXml","Multiple possible root nodes found.",S(g,x));v.unpairedTags.indexOf(W)!==-1||h.push({tagName:W,tagStartPos:A}),E=!0}for(x++;x<g.length;x++)if(g[x]==="<"){if(g[x+1]==="!"){x++,x=a(g,x);continue}if(g[x+1]!=="?")break;if(x=s(g,++x),x.err)return x}else if(g[x]==="&"){const V=m(g,x);if(V==-1)return b("InvalidChar","char '&' is not expected.",S(g,x));x=V}else if(T===!0&&!o(g[x]))return b("InvalidXml","Extra text at the end",S(g,x));g[x]==="<"&&x--}}}var R;return E?h.length==1?b("InvalidTag","Unclosed tag '"+h[0].tagName+"'.",S(g,h[0].tagStartPos)):!(h.length>0)||b("InvalidXml","Invalid '"+JSON.stringify(h.map((x=>x.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):b("InvalidXml","Start tag expected.",1)};const l='"',u="'";function c(g,v){let h="",E="",T=!1;for(;v<g.length;v++){if(g[v]===l||g[v]===u)E===""?E=g[v]:E!==g[v]||(E="");else if(g[v]===">"&&E===""){T=!0;break}h+=g[v]}return E===""&&{value:h,index:v,tagClosed:T}}const p=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function d(g,v){const h=r.getAllMatches(g,p),E={};for(let T=0;T<h.length;T++){if(h[T][1].length===0)return b("InvalidAttr","Attribute '"+h[T][2]+"' has no space in starting.",y(h[T]));if(h[T][3]!==void 0&&h[T][4]===void 0)return b("InvalidAttr","Attribute '"+h[T][2]+"' is without value.",y(h[T]));if(h[T][3]===void 0&&!v.allowBooleanAttributes)return b("InvalidAttr","boolean attribute '"+h[T][2]+"' is not allowed.",y(h[T]));const R=h[T][2];if(!w(R))return b("InvalidAttr","Attribute '"+R+"' is an invalid name.",y(h[T]));if(E.hasOwnProperty(R))return b("InvalidAttr","Attribute '"+R+"' is repeated.",y(h[T]));E[R]=1}return!0}function m(g,v){if(g[++v]===";")return-1;if(g[v]==="#")return(function(E,T){let R=/\d/;for(E[T]==="x"&&(T++,R=/[\da-fA-F]/);T<E.length;T++){if(E[T]===";")return T;if(!E[T].match(R))break}return-1})(g,++v);let h=0;for(;v<g.length;v++,h++)if(!(g[v].match(/\w/)&&h<20)){if(g[v]===";")break;return-1}return v}function b(g,v,h){return{err:{code:g,msg:v,line:h.line||h,col:h.col}}}function w(g){return r.isName(g)}function S(g,v){const h=g.substring(0,v).split(/\r?\n/);return{line:h.length,col:h[h.length-1].length+1}}function y(g){return g.startIndex+g[1].length}},221:(e,t,n)=>{const r=n(87),i=n(118),o={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(c,p){return p},attributeValueProcessor:function(c,p){return p},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function s(c){this.options=Object.assign({},o,c),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=i(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=u),this.processTextOrObjNode=a,this.options.format?(this.indentate=l,this.tagEndChar=`>
28
- `,this.newLine=`
29
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function a(c,p,d,m){const b=this.j2x(c,d+1,m.concat(p));return c[this.options.textNodeName]!==void 0&&Object.keys(c).length===1?this.buildTextValNode(c[this.options.textNodeName],p,b.attrStr,d):this.buildObjectNode(b.val,p,b.attrStr,d)}function l(c){return this.options.indentBy.repeat(c)}function u(c){return!(!c.startsWith(this.options.attributeNamePrefix)||c===this.options.textNodeName)&&c.substr(this.attrPrefixLen)}s.prototype.build=function(c){return this.options.preserveOrder?r(c,this.options):(Array.isArray(c)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(c={[this.options.arrayNodeName]:c}),this.j2x(c,0,[]).val)},s.prototype.j2x=function(c,p,d){let m="",b="";const w=d.join(".");for(let S in c)if(Object.prototype.hasOwnProperty.call(c,S))if(c[S]===void 0)this.isAttribute(S)&&(b+="");else if(c[S]===null)this.isAttribute(S)?b+="":S[0]==="?"?b+=this.indentate(p)+"<"+S+"?"+this.tagEndChar:b+=this.indentate(p)+"<"+S+"/"+this.tagEndChar;else if(c[S]instanceof Date)b+=this.buildTextValNode(c[S],S,"",p);else if(typeof c[S]!="object"){const y=this.isAttribute(S);if(y&&!this.ignoreAttributesFn(y,w))m+=this.buildAttrPairStr(y,""+c[S]);else if(!y)if(S===this.options.textNodeName){let g=this.options.tagValueProcessor(S,""+c[S]);b+=this.replaceEntitiesValue(g)}else b+=this.buildTextValNode(c[S],S,"",p)}else if(Array.isArray(c[S])){const y=c[S].length;let g="",v="";for(let h=0;h<y;h++){const E=c[S][h];if(E!==void 0)if(E===null)S[0]==="?"?b+=this.indentate(p)+"<"+S+"?"+this.tagEndChar:b+=this.indentate(p)+"<"+S+"/"+this.tagEndChar;else if(typeof E=="object")if(this.options.oneListGroup){const T=this.j2x(E,p+1,d.concat(S));g+=T.val,this.options.attributesGroupName&&E.hasOwnProperty(this.options.attributesGroupName)&&(v+=T.attrStr)}else g+=this.processTextOrObjNode(E,S,p,d);else if(this.options.oneListGroup){let T=this.options.tagValueProcessor(S,E);T=this.replaceEntitiesValue(T),g+=T}else g+=this.buildTextValNode(E,S,"",p)}this.options.oneListGroup&&(g=this.buildObjectNode(g,S,v,p)),b+=g}else if(this.options.attributesGroupName&&S===this.options.attributesGroupName){const y=Object.keys(c[S]),g=y.length;for(let v=0;v<g;v++)m+=this.buildAttrPairStr(y[v],""+c[S][y[v]])}else b+=this.processTextOrObjNode(c[S],S,p,d);return{attrStr:m,val:b}},s.prototype.buildAttrPairStr=function(c,p){return p=this.options.attributeValueProcessor(c,""+p),p=this.replaceEntitiesValue(p),this.options.suppressBooleanAttributes&&p==="true"?" "+c:" "+c+'="'+p+'"'},s.prototype.buildObjectNode=function(c,p,d,m){if(c==="")return p[0]==="?"?this.indentate(m)+"<"+p+d+"?"+this.tagEndChar:this.indentate(m)+"<"+p+d+this.closeTag(p)+this.tagEndChar;{let b="</"+p+this.tagEndChar,w="";return p[0]==="?"&&(w="?",b=""),!d&&d!==""||c.indexOf("<")!==-1?this.options.commentPropName!==!1&&p===this.options.commentPropName&&w.length===0?this.indentate(m)+`<!--${c}-->`+this.newLine:this.indentate(m)+"<"+p+d+w+this.tagEndChar+c+this.indentate(m)+b:this.indentate(m)+"<"+p+d+w+">"+c+b}},s.prototype.closeTag=function(c){let p="";return this.options.unpairedTags.indexOf(c)!==-1?this.options.suppressUnpairedNode||(p="/"):p=this.options.suppressEmptyNode?"/":`></${c}`,p},s.prototype.buildTextValNode=function(c,p,d,m){if(this.options.cdataPropName!==!1&&p===this.options.cdataPropName)return this.indentate(m)+`<![CDATA[${c}]]>`+this.newLine;if(this.options.commentPropName!==!1&&p===this.options.commentPropName)return this.indentate(m)+`<!--${c}-->`+this.newLine;if(p[0]==="?")return this.indentate(m)+"<"+p+d+"?"+this.tagEndChar;{let b=this.options.tagValueProcessor(p,c);return b=this.replaceEntitiesValue(b),b===""?this.indentate(m)+"<"+p+d+this.closeTag(p)+this.tagEndChar:this.indentate(m)+"<"+p+d+">"+b+"</"+p+this.tagEndChar}},s.prototype.replaceEntitiesValue=function(c){if(c&&c.length>0&&this.options.processEntities)for(let p=0;p<this.options.entities.length;p++){const d=this.options.entities[p];c=c.replace(d.regex,d.val)}return c},e.exports=s},87:e=>{function t(s,a,l,u){let c="",p=!1;for(let d=0;d<s.length;d++){const m=s[d],b=n(m);if(b===void 0)continue;let w="";if(w=l.length===0?b:`${l}.${b}`,b===a.textNodeName){let v=m[b];i(w,a)||(v=a.tagValueProcessor(b,v),v=o(v,a)),p&&(c+=u),c+=v,p=!1;continue}if(b===a.cdataPropName){p&&(c+=u),c+=`<![CDATA[${m[b][0][a.textNodeName]}]]>`,p=!1;continue}if(b===a.commentPropName){c+=u+`<!--${m[b][0][a.textNodeName]}-->`,p=!0;continue}if(b[0]==="?"){const v=r(m[":@"],a),h=b==="?xml"?"":u;let E=m[b][0][a.textNodeName];E=E.length!==0?" "+E:"",c+=h+`<${b}${E}${v}?>`,p=!0;continue}let S=u;S!==""&&(S+=a.indentBy);const y=u+`<${b}${r(m[":@"],a)}`,g=t(m[b],a,w,S);a.unpairedTags.indexOf(b)!==-1?a.suppressUnpairedNode?c+=y+">":c+=y+"/>":g&&g.length!==0||!a.suppressEmptyNode?g&&g.endsWith(">")?c+=y+`>${g}${u}</${b}>`:(c+=y+">",g&&u!==""&&(g.includes("/>")||g.includes("</"))?c+=u+a.indentBy+g+u:c+=g,c+=`</${b}>`):c+=y+"/>",p=!0}return c}function n(s){const a=Object.keys(s);for(let l=0;l<a.length;l++){const u=a[l];if(s.hasOwnProperty(u)&&u!==":@")return u}}function r(s,a){let l="";if(s&&!a.ignoreAttributes)for(let u in s){if(!s.hasOwnProperty(u))continue;let c=a.attributeValueProcessor(u,s[u]);c=o(c,a),c===!0&&a.suppressBooleanAttributes?l+=` ${u.substr(a.attributeNamePrefix.length)}`:l+=` ${u.substr(a.attributeNamePrefix.length)}="${c}"`}return l}function i(s,a){let l=(s=s.substr(0,s.length-a.textNodeName.length-1)).substr(s.lastIndexOf(".")+1);for(let u in a.stopNodes)if(a.stopNodes[u]===s||a.stopNodes[u]==="*."+l)return!0;return!1}function o(s,a){if(s&&s.length>0&&a.processEntities)for(let l=0;l<a.entities.length;l++){const u=a.entities[l];s=s.replace(u.regex,u.val)}return s}e.exports=function(s,a){let l="";return a.format&&a.indentBy.length>0&&(l=`
30
- `),t(s,a,"",l)}},193:(e,t,n)=>{const r=n(705);function i(p,d){let m="";for(;d<p.length&&p[d]!=="'"&&p[d]!=='"';d++)m+=p[d];if(m=m.trim(),m.indexOf(" ")!==-1)throw new Error("External entites are not supported");const b=p[d++];let w="";for(;d<p.length&&p[d]!==b;d++)w+=p[d];return[m,w,d]}function o(p,d){return p[d+1]==="!"&&p[d+2]==="-"&&p[d+3]==="-"}function s(p,d){return p[d+1]==="!"&&p[d+2]==="E"&&p[d+3]==="N"&&p[d+4]==="T"&&p[d+5]==="I"&&p[d+6]==="T"&&p[d+7]==="Y"}function a(p,d){return p[d+1]==="!"&&p[d+2]==="E"&&p[d+3]==="L"&&p[d+4]==="E"&&p[d+5]==="M"&&p[d+6]==="E"&&p[d+7]==="N"&&p[d+8]==="T"}function l(p,d){return p[d+1]==="!"&&p[d+2]==="A"&&p[d+3]==="T"&&p[d+4]==="T"&&p[d+5]==="L"&&p[d+6]==="I"&&p[d+7]==="S"&&p[d+8]==="T"}function u(p,d){return p[d+1]==="!"&&p[d+2]==="N"&&p[d+3]==="O"&&p[d+4]==="T"&&p[d+5]==="A"&&p[d+6]==="T"&&p[d+7]==="I"&&p[d+8]==="O"&&p[d+9]==="N"}function c(p){if(r.isName(p))return p;throw new Error(`Invalid entity name ${p}`)}e.exports=function(p,d){const m={};if(p[d+3]!=="O"||p[d+4]!=="C"||p[d+5]!=="T"||p[d+6]!=="Y"||p[d+7]!=="P"||p[d+8]!=="E")throw new Error("Invalid Tag instead of DOCTYPE");{d+=9;let b=1,w=!1,S=!1,y="";for(;d<p.length;d++)if(p[d]!=="<"||S)if(p[d]===">"){if(S?p[d-1]==="-"&&p[d-2]==="-"&&(S=!1,b--):b--,b===0)break}else p[d]==="["?w=!0:y+=p[d];else{if(w&&s(p,d)){let g,v;d+=7,[g,v,d]=i(p,d+1),v.indexOf("&")===-1&&(m[c(g)]={regx:RegExp(`&${g};`,"g"),val:v})}else if(w&&a(p,d))d+=8;else if(w&&l(p,d))d+=8;else if(w&&u(p,d))d+=9;else{if(!o)throw new Error("Invalid DOCTYPE");S=!0}b++,y=""}if(b!==0)throw new Error("Unclosed DOCTYPE")}return{entities:m,i:d}}},63:(e,t)=>{const n={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(r,i){return i},attributeValueProcessor:function(r,i){return i},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(r,i,o){return r}};t.buildOptions=function(r){return Object.assign({},n,r)},t.defaultOptions=n},299:(e,t,n)=>{const r=n(705),i=n(365),o=n(193),s=n(494),a=n(118);function l(T){const R=Object.keys(T);for(let x=0;x<R.length;x++){const A=R[x];this.lastEntities[A]={regex:new RegExp("&"+A+";","g"),val:T[A]}}}function u(T,R,x,A,N,W,O){if(T!==void 0&&(this.options.trimValues&&!A&&(T=T.trim()),T.length>0)){O||(T=this.replaceEntitiesValue(T));const D=this.options.tagValueProcessor(R,T,x,N,W);return D==null?T:typeof D!=typeof T||D!==T?D:this.options.trimValues||T.trim()===T?E(T,this.options.parseTagValue,this.options.numberParseOptions):T}}function c(T){if(this.options.removeNSPrefix){const R=T.split(":"),x=T.charAt(0)==="/"?"/":"";if(R[0]==="xmlns")return"";R.length===2&&(T=x+R[1])}return T}const p=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function d(T,R,x){if(this.options.ignoreAttributes!==!0&&typeof T=="string"){const A=r.getAllMatches(T,p),N=A.length,W={};for(let O=0;O<N;O++){const D=this.resolveNameSpace(A[O][1]);if(this.ignoreAttributesFn(D,R))continue;let V=A[O][4],L=this.options.attributeNamePrefix+D;if(D.length)if(this.options.transformAttributeName&&(L=this.options.transformAttributeName(L)),L==="__proto__"&&(L="#__proto__"),V!==void 0){this.options.trimValues&&(V=V.trim()),V=this.replaceEntitiesValue(V);const te=this.options.attributeValueProcessor(D,V,R);W[L]=te==null?V:typeof te!=typeof V||te!==V?te:E(V,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(W[L]=!0)}if(!Object.keys(W).length)return;if(this.options.attributesGroupName){const O={};return O[this.options.attributesGroupName]=W,O}return W}}const m=function(T){T=T.replace(/\r\n?/g,`
31
- `);const R=new i("!xml");let x=R,A="",N="";for(let W=0;W<T.length;W++)if(T[W]==="<")if(T[W+1]==="/"){const O=g(T,">",W,"Closing Tag is not closed.");let D=T.substring(W+2,O).trim();if(this.options.removeNSPrefix){const te=D.indexOf(":");te!==-1&&(D=D.substr(te+1))}this.options.transformTagName&&(D=this.options.transformTagName(D)),x&&(A=this.saveTextToParentTag(A,x,N));const V=N.substring(N.lastIndexOf(".")+1);if(D&&this.options.unpairedTags.indexOf(D)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${D}>`);let L=0;V&&this.options.unpairedTags.indexOf(V)!==-1?(L=N.lastIndexOf(".",N.lastIndexOf(".")-1),this.tagsNodeStack.pop()):L=N.lastIndexOf("."),N=N.substring(0,L),x=this.tagsNodeStack.pop(),A="",W=O}else if(T[W+1]==="?"){let O=v(T,W,!1,"?>");if(!O)throw new Error("Pi Tag is not closed.");if(A=this.saveTextToParentTag(A,x,N),!(this.options.ignoreDeclaration&&O.tagName==="?xml"||this.options.ignorePiTags)){const D=new i(O.tagName);D.add(this.options.textNodeName,""),O.tagName!==O.tagExp&&O.attrExpPresent&&(D[":@"]=this.buildAttributesMap(O.tagExp,N,O.tagName)),this.addChild(x,D,N)}W=O.closeIndex+1}else if(T.substr(W+1,3)==="!--"){const O=g(T,"-->",W+4,"Comment is not closed.");if(this.options.commentPropName){const D=T.substring(W+4,O-2);A=this.saveTextToParentTag(A,x,N),x.add(this.options.commentPropName,[{[this.options.textNodeName]:D}])}W=O}else if(T.substr(W+1,2)==="!D"){const O=o(T,W);this.docTypeEntities=O.entities,W=O.i}else if(T.substr(W+1,2)==="!["){const O=g(T,"]]>",W,"CDATA is not closed.")-2,D=T.substring(W+9,O);A=this.saveTextToParentTag(A,x,N);let V=this.parseTextData(D,x.tagname,N,!0,!1,!0,!0);V==null&&(V=""),this.options.cdataPropName?x.add(this.options.cdataPropName,[{[this.options.textNodeName]:D}]):x.add(this.options.textNodeName,V),W=O+2}else{let O=v(T,W,this.options.removeNSPrefix),D=O.tagName;const V=O.rawTagName;let L=O.tagExp,te=O.attrExpPresent,Y=O.closeIndex;this.options.transformTagName&&(D=this.options.transformTagName(D)),x&&A&&x.tagname!=="!xml"&&(A=this.saveTextToParentTag(A,x,N,!1));const se=x;if(se&&this.options.unpairedTags.indexOf(se.tagname)!==-1&&(x=this.tagsNodeStack.pop(),N=N.substring(0,N.lastIndexOf("."))),D!==R.tagname&&(N+=N?"."+D:D),this.isItStopNode(this.options.stopNodes,N,D)){let he="";if(L.length>0&&L.lastIndexOf("/")===L.length-1)D[D.length-1]==="/"?(D=D.substr(0,D.length-1),N=N.substr(0,N.length-1),L=D):L=L.substr(0,L.length-1),W=O.closeIndex;else if(this.options.unpairedTags.indexOf(D)!==-1)W=O.closeIndex;else{const we=this.readStopNodeData(T,V,Y+1);if(!we)throw new Error(`Unexpected end of ${V}`);W=we.i,he=we.tagContent}const ae=new i(D);D!==L&&te&&(ae[":@"]=this.buildAttributesMap(L,N,D)),he&&(he=this.parseTextData(he,D,N,!0,te,!0,!0)),N=N.substr(0,N.lastIndexOf(".")),ae.add(this.options.textNodeName,he),this.addChild(x,ae,N)}else{if(L.length>0&&L.lastIndexOf("/")===L.length-1){D[D.length-1]==="/"?(D=D.substr(0,D.length-1),N=N.substr(0,N.length-1),L=D):L=L.substr(0,L.length-1),this.options.transformTagName&&(D=this.options.transformTagName(D));const he=new i(D);D!==L&&te&&(he[":@"]=this.buildAttributesMap(L,N,D)),this.addChild(x,he,N),N=N.substr(0,N.lastIndexOf("."))}else{const he=new i(D);this.tagsNodeStack.push(x),D!==L&&te&&(he[":@"]=this.buildAttributesMap(L,N,D)),this.addChild(x,he,N),x=he}A="",W=Y}}else A+=T[W];return R.child};function b(T,R,x){const A=this.options.updateTag(R.tagname,x,R[":@"]);A===!1||(typeof A=="string"&&(R.tagname=A),T.addChild(R))}const w=function(T){if(this.options.processEntities){for(let R in this.docTypeEntities){const x=this.docTypeEntities[R];T=T.replace(x.regx,x.val)}for(let R in this.lastEntities){const x=this.lastEntities[R];T=T.replace(x.regex,x.val)}if(this.options.htmlEntities)for(let R in this.htmlEntities){const x=this.htmlEntities[R];T=T.replace(x.regex,x.val)}T=T.replace(this.ampEntity.regex,this.ampEntity.val)}return T};function S(T,R,x,A){return T&&(A===void 0&&(A=Object.keys(R.child).length===0),(T=this.parseTextData(T,R.tagname,x,!1,!!R[":@"]&&Object.keys(R[":@"]).length!==0,A))!==void 0&&T!==""&&R.add(this.options.textNodeName,T),T=""),T}function y(T,R,x){const A="*."+x;for(const N in T){const W=T[N];if(A===W||R===W)return!0}return!1}function g(T,R,x,A){const N=T.indexOf(R,x);if(N===-1)throw new Error(A);return N+R.length-1}function v(T,R,x){const A=(function(te,Y){let se,he=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",ae="";for(let we=Y;we<te.length;we++){let Q=te[we];if(se)Q===se&&(se="");else if(Q==='"'||Q==="'")se=Q;else if(Q===he[0]){if(!he[1])return{data:ae,index:we};if(te[we+1]===he[1])return{data:ae,index:we}}else Q===" "&&(Q=" ");ae+=Q}})(T,R+1,arguments.length>3&&arguments[3]!==void 0?arguments[3]:">");if(!A)return;let N=A.data;const W=A.index,O=N.search(/\s/);let D=N,V=!0;O!==-1&&(D=N.substring(0,O),N=N.substring(O+1).trimStart());const L=D;if(x){const te=D.indexOf(":");te!==-1&&(D=D.substr(te+1),V=D!==A.data.substr(te+1))}return{tagName:D,tagExp:N,closeIndex:W,attrExpPresent:V,rawTagName:L}}function h(T,R,x){const A=x;let N=1;for(;x<T.length;x++)if(T[x]==="<")if(T[x+1]==="/"){const W=g(T,">",x,`${R} is not closed`);if(T.substring(x+2,W).trim()===R&&(N--,N===0))return{tagContent:T.substring(A,x),i:W};x=W}else if(T[x+1]==="?")x=g(T,"?>",x+1,"StopNode is not closed.");else if(T.substr(x+1,3)==="!--")x=g(T,"-->",x+3,"StopNode is not closed.");else if(T.substr(x+1,2)==="![")x=g(T,"]]>",x,"StopNode is not closed.")-2;else{const W=v(T,x,">");W&&((W&&W.tagName)===R&&W.tagExp[W.tagExp.length-1]!=="/"&&N++,x=W.closeIndex)}}function E(T,R,x){if(R&&typeof T=="string"){const A=T.trim();return A==="true"||A!=="false"&&s(T,x)}return r.isExist(T)?T:""}e.exports=class{constructor(T){this.options=T,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(R,x)=>String.fromCharCode(Number.parseInt(x,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(R,x)=>String.fromCharCode(Number.parseInt(x,16))}},this.addExternalEntities=l,this.parseXml=m,this.parseTextData=u,this.resolveNameSpace=c,this.buildAttributesMap=d,this.isItStopNode=y,this.replaceEntitiesValue=w,this.readStopNodeData=h,this.saveTextToParentTag=S,this.addChild=b,this.ignoreAttributesFn=a(this.options.ignoreAttributes)}}},338:(e,t,n)=>{const{buildOptions:r}=n(63),i=n(299),{prettify:o}=n(728),s=n(31);e.exports=class{constructor(a){this.externalEntities={},this.options=r(a)}parse(a,l){if(typeof a!="string"){if(!a.toString)throw new Error("XML data is accepted in String or Bytes[] form.");a=a.toString()}if(l){l===!0&&(l={});const p=s.validate(a,l);if(p!==!0)throw Error(`${p.err.msg}:${p.err.line}:${p.err.col}`)}const u=new i(this.options);u.addExternalEntities(this.externalEntities);const c=u.parseXml(a);return this.options.preserveOrder||c===void 0?c:o(c,this.options)}addEntity(a,l){if(l.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(a.indexOf("&")!==-1||a.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(l==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[a]=l}}},728:(e,t)=>{function n(s,a,l){let u;const c={};for(let p=0;p<s.length;p++){const d=s[p],m=r(d);let b="";if(b=l===void 0?m:l+"."+m,m===a.textNodeName)u===void 0?u=d[m]:u+=""+d[m];else{if(m===void 0)continue;if(d[m]){let w=n(d[m],a,b);const S=o(w,a);d[":@"]?i(w,d[":@"],b,a):Object.keys(w).length!==1||w[a.textNodeName]===void 0||a.alwaysCreateTextNode?Object.keys(w).length===0&&(a.alwaysCreateTextNode?w[a.textNodeName]="":w=""):w=w[a.textNodeName],c[m]!==void 0&&c.hasOwnProperty(m)?(Array.isArray(c[m])||(c[m]=[c[m]]),c[m].push(w)):a.isArray(m,b,S)?c[m]=[w]:c[m]=w}}}return typeof u=="string"?u.length>0&&(c[a.textNodeName]=u):u!==void 0&&(c[a.textNodeName]=u),c}function r(s){const a=Object.keys(s);for(let l=0;l<a.length;l++){const u=a[l];if(u!==":@")return u}}function i(s,a,l,u){if(a){const c=Object.keys(a),p=c.length;for(let d=0;d<p;d++){const m=c[d];u.isArray(m,l+"."+m,!0,!0)?s[m]=[a[m]]:s[m]=a[m]}}}function o(s,a){const{textNodeName:l}=a,u=Object.keys(s).length;return u===0||!(u!==1||!s[l]&&typeof s[l]!="boolean"&&s[l]!==0)}t.prettify=function(s,a){return n(s,a)}},365:e=>{e.exports=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,n){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:n})}addChild(t){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}},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)}},542:(e,t,n)=>{(function(){var r=n(298),i=n(526).utf8,o=n(135),s=n(526).bin,a=function(l,u){l.constructor==String?l=u&&u.encoding==="binary"?s.stringToBytes(l):i.stringToBytes(l):o(l)?l=Array.prototype.slice.call(l,0):Array.isArray(l)||l.constructor===Uint8Array||(l=l.toString());for(var c=r.bytesToWords(l),p=8*l.length,d=1732584193,m=-271733879,b=-1732584194,w=271733878,S=0;S<c.length;S++)c[S]=16711935&(c[S]<<8|c[S]>>>24)|4278255360&(c[S]<<24|c[S]>>>8);c[p>>>5]|=128<<p%32,c[14+(p+64>>>9<<4)]=p;var y=a._ff,g=a._gg,v=a._hh,h=a._ii;for(S=0;S<c.length;S+=16){var E=d,T=m,R=b,x=w;d=y(d,m,b,w,c[S+0],7,-680876936),w=y(w,d,m,b,c[S+1],12,-389564586),b=y(b,w,d,m,c[S+2],17,606105819),m=y(m,b,w,d,c[S+3],22,-1044525330),d=y(d,m,b,w,c[S+4],7,-176418897),w=y(w,d,m,b,c[S+5],12,1200080426),b=y(b,w,d,m,c[S+6],17,-1473231341),m=y(m,b,w,d,c[S+7],22,-45705983),d=y(d,m,b,w,c[S+8],7,1770035416),w=y(w,d,m,b,c[S+9],12,-1958414417),b=y(b,w,d,m,c[S+10],17,-42063),m=y(m,b,w,d,c[S+11],22,-1990404162),d=y(d,m,b,w,c[S+12],7,1804603682),w=y(w,d,m,b,c[S+13],12,-40341101),b=y(b,w,d,m,c[S+14],17,-1502002290),d=g(d,m=y(m,b,w,d,c[S+15],22,1236535329),b,w,c[S+1],5,-165796510),w=g(w,d,m,b,c[S+6],9,-1069501632),b=g(b,w,d,m,c[S+11],14,643717713),m=g(m,b,w,d,c[S+0],20,-373897302),d=g(d,m,b,w,c[S+5],5,-701558691),w=g(w,d,m,b,c[S+10],9,38016083),b=g(b,w,d,m,c[S+15],14,-660478335),m=g(m,b,w,d,c[S+4],20,-405537848),d=g(d,m,b,w,c[S+9],5,568446438),w=g(w,d,m,b,c[S+14],9,-1019803690),b=g(b,w,d,m,c[S+3],14,-187363961),m=g(m,b,w,d,c[S+8],20,1163531501),d=g(d,m,b,w,c[S+13],5,-1444681467),w=g(w,d,m,b,c[S+2],9,-51403784),b=g(b,w,d,m,c[S+7],14,1735328473),d=v(d,m=g(m,b,w,d,c[S+12],20,-1926607734),b,w,c[S+5],4,-378558),w=v(w,d,m,b,c[S+8],11,-2022574463),b=v(b,w,d,m,c[S+11],16,1839030562),m=v(m,b,w,d,c[S+14],23,-35309556),d=v(d,m,b,w,c[S+1],4,-1530992060),w=v(w,d,m,b,c[S+4],11,1272893353),b=v(b,w,d,m,c[S+7],16,-155497632),m=v(m,b,w,d,c[S+10],23,-1094730640),d=v(d,m,b,w,c[S+13],4,681279174),w=v(w,d,m,b,c[S+0],11,-358537222),b=v(b,w,d,m,c[S+3],16,-722521979),m=v(m,b,w,d,c[S+6],23,76029189),d=v(d,m,b,w,c[S+9],4,-640364487),w=v(w,d,m,b,c[S+12],11,-421815835),b=v(b,w,d,m,c[S+15],16,530742520),d=h(d,m=v(m,b,w,d,c[S+2],23,-995338651),b,w,c[S+0],6,-198630844),w=h(w,d,m,b,c[S+7],10,1126891415),b=h(b,w,d,m,c[S+14],15,-1416354905),m=h(m,b,w,d,c[S+5],21,-57434055),d=h(d,m,b,w,c[S+12],6,1700485571),w=h(w,d,m,b,c[S+3],10,-1894986606),b=h(b,w,d,m,c[S+10],15,-1051523),m=h(m,b,w,d,c[S+1],21,-2054922799),d=h(d,m,b,w,c[S+8],6,1873313359),w=h(w,d,m,b,c[S+15],10,-30611744),b=h(b,w,d,m,c[S+6],15,-1560198380),m=h(m,b,w,d,c[S+13],21,1309151649),d=h(d,m,b,w,c[S+4],6,-145523070),w=h(w,d,m,b,c[S+11],10,-1120210379),b=h(b,w,d,m,c[S+2],15,718787259),m=h(m,b,w,d,c[S+9],21,-343485551),d=d+E>>>0,m=m+T>>>0,b=b+R>>>0,w=w+x>>>0}return r.endian([d,m,b,w])};a._ff=function(l,u,c,p,d,m,b){var w=l+(u&c|~u&p)+(d>>>0)+b;return(w<<m|w>>>32-m)+u},a._gg=function(l,u,c,p,d,m,b){var w=l+(u&p|c&~p)+(d>>>0)+b;return(w<<m|w>>>32-m)+u},a._hh=function(l,u,c,p,d,m,b){var w=l+(u^c^p)+(d>>>0)+b;return(w<<m|w>>>32-m)+u},a._ii=function(l,u,c,p,d,m,b){var w=l+(c^(u|~p))+(d>>>0)+b;return(w<<m|w>>>32-m)+u},a._blocksize=16,a._digestsize=16,e.exports=function(l,u){if(l==null)throw new Error("Illegal argument "+l);var c=r.wordsToBytes(a(l,u));return u&&u.asBytes?c:u&&u.asString?s.bytesToString(c):r.bytesToHex(c)}})()},285:(e,t,n)=>{var r=n(2);e.exports=function(y){return y?(y.substr(0,2)==="{}"&&(y="\\{\\}"+y.substr(2)),S((function(g){return g.split("\\\\").join(i).split("\\{").join(o).split("\\}").join(s).split("\\,").join(a).split("\\.").join(l)})(y),!0).map(c)):[]};var i="\0SLASH"+Math.random()+"\0",o="\0OPEN"+Math.random()+"\0",s="\0CLOSE"+Math.random()+"\0",a="\0COMMA"+Math.random()+"\0",l="\0PERIOD"+Math.random()+"\0";function u(y){return parseInt(y,10)==y?parseInt(y,10):y.charCodeAt(0)}function c(y){return y.split(i).join("\\").split(o).join("{").split(s).join("}").split(a).join(",").split(l).join(".")}function p(y){if(!y)return[""];var g=[],v=r("{","}",y);if(!v)return y.split(",");var h=v.pre,E=v.body,T=v.post,R=h.split(",");R[R.length-1]+="{"+E+"}";var x=p(T);return T.length&&(R[R.length-1]+=x.shift(),R.push.apply(R,x)),g.push.apply(g,R),g}function d(y){return"{"+y+"}"}function m(y){return/^-?0\d/.test(y)}function b(y,g){return y<=g}function w(y,g){return y>=g}function S(y,g){var v=[],h=r("{","}",y);if(!h)return[y];var E=h.pre,T=h.post.length?S(h.post,!1):[""];if(/\$$/.test(h.pre))for(var R=0;R<T.length;R++){var x=E+"{"+h.body+"}"+T[R];v.push(x)}else{var A,N,W=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(h.body),O=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(h.body),D=W||O,V=h.body.indexOf(",")>=0;if(!D&&!V)return h.post.match(/,.*\}/)?S(y=h.pre+"{"+h.body+s+h.post):[y];if(D)A=h.body.split(/\.\./);else if((A=p(h.body)).length===1&&(A=S(A[0],!1).map(d)).length===1)return T.map((function(ee){return h.pre+A[0]+ee}));if(D){var L=u(A[0]),te=u(A[1]),Y=Math.max(A[0].length,A[1].length),se=A.length==3?Math.abs(u(A[2])):1,he=b;te<L&&(se*=-1,he=w);var ae=A.some(m);N=[];for(var we=L;he(we,te);we+=se){var Q;if(O)(Q=String.fromCharCode(we))==="\\"&&(Q="");else if(Q=String(we),ae){var ie=Y-Q.length;if(ie>0){var ce=new Array(ie+1).join("0");Q=we<0?"-"+ce+Q.slice(1):ce+Q}}N.push(Q)}}else{N=[];for(var Ae=0;Ae<A.length;Ae++)N.push.apply(N,S(A[Ae],!1))}for(Ae=0;Ae<N.length;Ae++)for(R=0;R<T.length;R++)x=E+N[Ae]+T[R],(!g||D||x)&&v.push(x)}return v}},829:e=>{function t(u){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(u)}function n(u){var c=typeof Map=="function"?new Map:void 0;return n=function(p){if(p===null||(d=p,Function.toString.call(d).indexOf("[native code]")===-1))return p;var d;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,m)}function m(){return r(p,arguments,o(this).constructor)}return m.prototype=Object.create(p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),i(m,p)},n(u)}function r(u,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(d,m,b){var w=[null];w.push.apply(w,m);var S=new(Function.bind.apply(d,w));return b&&i(S,b.prototype),S},r.apply(null,arguments)}function i(u,c){return i=Object.setPrototypeOf||function(p,d){return p.__proto__=d,p},i(u,c)}function o(u){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(c){return c.__proto__||Object.getPrototypeOf(c)},o(u)}var s=(function(u){function c(p){var d;return(function(m,b){if(!(m instanceof b))throw new TypeError("Cannot call a class as a function")})(this,c),(d=(function(m,b){return!b||t(b)!=="object"&&typeof b!="function"?(function(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w})(m):b})(this,o(c).call(this,p))).name="ObjectPrototypeMutationError",d}return(function(p,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(d&&d.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),d&&i(p,d)})(c,u),c})(n(Error));function a(u,c){for(var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},d=c.split("."),m=d.length,b=function(y){var g=d[y];if(!u)return{v:void 0};if(g==="+"){if(Array.isArray(u))return{v:u.map((function(h,E){var T=d.slice(y+1);return T.length>0?a(h,T.join("."),p):p(u,E,d,y)}))};var v=d.slice(0,y).join(".");throw new Error("Object at wildcard (".concat(v,") is not an array"))}u=p(u,g,d,y)},w=0;w<m;w++){var S=b(w);if(t(S)==="object")return S.v}return u}function l(u,c){return u.length===c+1}e.exports={set:function(u,c,p){if(t(u)!="object"||u===null||c===void 0)return u;if(typeof c=="number")return u[c]=p,u[c];try{return a(u,c,(function(d,m,b,w){if(d===Reflect.getPrototypeOf({}))throw new s("Attempting to mutate Object.prototype");if(!d[m]){var S=Number.isInteger(Number(b[w+1])),y=b[w+1]==="+";d[m]=S||y?[]:{}}return l(b,w)&&(d[m]=p),d[m]}))}catch(d){if(d instanceof s)throw d;return u}},get:function(u,c){if(t(u)!="object"||u===null||c===void 0)return u;if(typeof c=="number")return u[c];try{return a(u,c,(function(p,d){return p[d]}))}catch{return u}},has:function(u,c){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t(u)!="object"||u===null||c===void 0)return!1;if(typeof c=="number")return c in u;try{var d=!1;return a(u,c,(function(m,b,w,S){if(!l(w,S))return m&&m[b];d=p.own?m.hasOwnProperty(b):b in m})),d}catch{return!1}},hasOwn:function(u,c,p){return this.has(u,c,p||{own:!0})},isIn:function(u,c,p){var d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(u)!="object"||u===null||c===void 0)return!1;try{var m=!1,b=!1;return a(u,c,(function(w,S,y,g){return m=m||w===p||!!w&&w[S]===p,b=l(y,g)&&t(w)==="object"&&S in w,w&&w[S]})),d.validPath?m&&b:m}catch{return!1}},ObjectPrototypeMutationError:s}},47:(e,t,n)=>{var r=n(410),i=function(u){return typeof u=="string"};function o(u,c){for(var p=[],d=0;d<u.length;d++){var m=u[d];m&&m!=="."&&(m===".."?p.length&&p[p.length-1]!==".."?p.pop():c&&p.push(".."):p.push(m))}return p}var s=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a={};function l(u){return s.exec(u).slice(1)}a.resolve=function(){for(var u="",c=!1,p=arguments.length-1;p>=-1&&!c;p--){var d=p>=0?arguments[p]:be.cwd();if(!i(d))throw new TypeError("Arguments to path.resolve must be strings");d&&(u=d+"/"+u,c=d.charAt(0)==="/")}return(c?"/":"")+(u=o(u.split("/"),!c).join("/"))||"."},a.normalize=function(u){var c=a.isAbsolute(u),p=u.substr(-1)==="/";return(u=o(u.split("/"),!c).join("/"))||c||(u="."),u&&p&&(u+="/"),(c?"/":"")+u},a.isAbsolute=function(u){return u.charAt(0)==="/"},a.join=function(){for(var u="",c=0;c<arguments.length;c++){var p=arguments[c];if(!i(p))throw new TypeError("Arguments to path.join must be strings");p&&(u+=u?"/"+p:p)}return a.normalize(u)},a.relative=function(u,c){function p(g){for(var v=0;v<g.length&&g[v]==="";v++);for(var h=g.length-1;h>=0&&g[h]==="";h--);return v>h?[]:g.slice(v,h+1)}u=a.resolve(u).substr(1),c=a.resolve(c).substr(1);for(var d=p(u.split("/")),m=p(c.split("/")),b=Math.min(d.length,m.length),w=b,S=0;S<b;S++)if(d[S]!==m[S]){w=S;break}var y=[];for(S=w;S<d.length;S++)y.push("..");return(y=y.concat(m.slice(w))).join("/")},a._makeLong=function(u){return u},a.dirname=function(u){var c=l(u),p=c[0],d=c[1];return p||d?(d&&(d=d.substr(0,d.length-1)),p+d):"."},a.basename=function(u,c){var p=l(u)[2];return c&&p.substr(-1*c.length)===c&&(p=p.substr(0,p.length-c.length)),p},a.extname=function(u){return l(u)[3]},a.format=function(u){if(!r.isObject(u))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof u);var c=u.root||"";if(!i(c))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof u.root);return(u.dir?u.dir+a.sep:"")+(u.base||"")},a.parse=function(u){if(!i(u))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof u);var c=l(u);if(!c||c.length!==4)throw new TypeError("Invalid path '"+u+"'");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)}},a.sep="/",a.delimiter=":",e.exports=a},647:(e,t)=>{var n=Object.prototype.hasOwnProperty;function r(o){try{return decodeURIComponent(o.replace(/\+/g," "))}catch{return null}}function i(o){try{return encodeURIComponent(o)}catch{return null}}t.stringify=function(o,s){s=s||"";var a,l,u=[];for(l in typeof s!="string"&&(s="?"),o)if(n.call(o,l)){if((a=o[l])||a!=null&&!isNaN(a)||(a=""),l=i(l),a=i(a),l===null||a===null)continue;u.push(l+"="+a)}return u.length?s+u.join("&"):""},t.parse=function(o){for(var s,a=/([^=?#&]+)=?([^&]*)/g,l={};s=a.exec(o);){var u=r(s[1]),c=r(s[2]);u===null||c===null||u in l||(l[u]=c)}return l}},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}},494:e=>{const t=/^[-+]?0x[a-fA-F0-9]+$/,n=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const r={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};e.exports=function(i){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(o=Object.assign({},r,o),!i||typeof i!="string")return i;let s=i.trim();if(o.skipLike!==void 0&&o.skipLike.test(s))return i;if(o.hex&&t.test(s))return Number.parseInt(s,16);{const l=n.exec(s);if(l){const u=l[1],c=l[2];let p=((a=l[3])&&a.indexOf(".")!==-1&&((a=a.replace(/0+$/,""))==="."?a="0":a[0]==="."?a="0"+a:a[a.length-1]==="."&&(a=a.substr(0,a.length-1))),a);const d=l[4]||l[6];if(!o.leadingZeros&&c.length>0&&u&&s[2]!=="."||!o.leadingZeros&&c.length>0&&!u&&s[1]!==".")return i;{const m=Number(s),b=""+m;return b.search(/[eE]/)!==-1||d?o.eNotation?m:i:s.indexOf(".")!==-1?b==="0"&&p===""||b===p||u&&b==="-"+p?m:i:c?p===b||u+p===b?m:i:s===b||s===u+b?m:i}}return i}var a}},737:(e,t,n)=>{var r=n(670),i=n(647),o=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,l=/:\d+$/,u=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,c=/^[a-zA-Z]:/;function p(g){return(g||"").toString().replace(o,"")}var d=[["#","hash"],["?","query"],function(g,v){return w(v.protocol)?g.replace(/\\/g,"/"):g},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],m={hash:1,query:1};function b(g){var v,h=(typeof window<"u"?window:typeof Wr<"u"?Wr:typeof self<"u"?self:{}).location||{},E={},T=typeof(g=g||h);if(g.protocol==="blob:")E=new y(unescape(g.pathname),{});else if(T==="string")for(v in E=new y(g,{}),m)delete E[v];else if(T==="object"){for(v in g)v in m||(E[v]=g[v]);E.slashes===void 0&&(E.slashes=a.test(g.href))}return E}function w(g){return g==="file:"||g==="ftp:"||g==="http:"||g==="https:"||g==="ws:"||g==="wss:"}function S(g,v){g=(g=p(g)).replace(s,""),v=v||{};var h,E=u.exec(g),T=E[1]?E[1].toLowerCase():"",R=!!E[2],x=!!E[3],A=0;return R?x?(h=E[2]+E[3]+E[4],A=E[2].length+E[3].length):(h=E[2]+E[4],A=E[2].length):x?(h=E[3]+E[4],A=E[3].length):h=E[4],T==="file:"?A>=2&&(h=h.slice(2)):w(T)?h=E[4]:T?R&&(h=h.slice(2)):A>=2&&w(v.protocol)&&(h=E[4]),{protocol:T,slashes:R||w(T),slashesCount:A,rest:h}}function y(g,v,h){if(g=(g=p(g)).replace(s,""),!(this instanceof y))return new y(g,v,h);var E,T,R,x,A,N,W=d.slice(),O=typeof v,D=this,V=0;for(O!=="object"&&O!=="string"&&(h=v,v=null),h&&typeof h!="function"&&(h=i.parse),E=!(T=S(g||"",v=b(v))).protocol&&!T.slashes,D.slashes=T.slashes||E&&v.slashes,D.protocol=T.protocol||v.protocol||"",g=T.rest,(T.protocol==="file:"&&(T.slashesCount!==2||c.test(g))||!T.slashes&&(T.protocol||T.slashesCount<2||!w(D.protocol)))&&(W[3]=[/(.*)/,"pathname"]);V<W.length;V++)typeof(x=W[V])!="function"?(R=x[0],N=x[1],R!=R?D[N]=g:typeof R=="string"?~(A=R==="@"?g.lastIndexOf(R):g.indexOf(R))&&(typeof x[2]=="number"?(D[N]=g.slice(0,A),g=g.slice(A+x[2])):(D[N]=g.slice(A),g=g.slice(0,A))):(A=R.exec(g))&&(D[N]=A[1],g=g.slice(0,A.index)),D[N]=D[N]||E&&x[3]&&v[N]||"",x[4]&&(D[N]=D[N].toLowerCase())):g=x(g,D);h&&(D.query=h(D.query)),E&&v.slashes&&D.pathname.charAt(0)!=="/"&&(D.pathname!==""||v.pathname!=="")&&(D.pathname=(function(L,te){if(L==="")return te;for(var Y=(te||"/").split("/").slice(0,-1).concat(L.split("/")),se=Y.length,he=Y[se-1],ae=!1,we=0;se--;)Y[se]==="."?Y.splice(se,1):Y[se]===".."?(Y.splice(se,1),we++):we&&(se===0&&(ae=!0),Y.splice(se,1),we--);return ae&&Y.unshift(""),he!=="."&&he!==".."||Y.push(""),Y.join("/")})(D.pathname,v.pathname)),D.pathname.charAt(0)!=="/"&&w(D.protocol)&&(D.pathname="/"+D.pathname),r(D.port,D.protocol)||(D.host=D.hostname,D.port=""),D.username=D.password="",D.auth&&(~(A=D.auth.indexOf(":"))?(D.username=D.auth.slice(0,A),D.username=encodeURIComponent(decodeURIComponent(D.username)),D.password=D.auth.slice(A+1),D.password=encodeURIComponent(decodeURIComponent(D.password))):D.username=encodeURIComponent(decodeURIComponent(D.auth)),D.auth=D.password?D.username+":"+D.password:D.username),D.origin=D.protocol!=="file:"&&w(D.protocol)&&D.host?D.protocol+"//"+D.host:"null",D.href=D.toString()}y.prototype={set:function(g,v,h){var E=this;switch(g){case"query":typeof v=="string"&&v.length&&(v=(h||i.parse)(v)),E[g]=v;break;case"port":E[g]=v,r(v,E.protocol)?v&&(E.host=E.hostname+":"+v):(E.host=E.hostname,E[g]="");break;case"hostname":E[g]=v,E.port&&(v+=":"+E.port),E.host=v;break;case"host":E[g]=v,l.test(v)?(v=v.split(":"),E.port=v.pop(),E.hostname=v.join(":")):(E.hostname=v,E.port="");break;case"protocol":E.protocol=v.toLowerCase(),E.slashes=!h;break;case"pathname":case"hash":if(v){var T=g==="pathname"?"/":"#";E[g]=v.charAt(0)!==T?T+v:v}else E[g]=v;break;case"username":case"password":E[g]=encodeURIComponent(v);break;case"auth":var R=v.indexOf(":");~R?(E.username=v.slice(0,R),E.username=encodeURIComponent(decodeURIComponent(E.username)),E.password=v.slice(R+1),E.password=encodeURIComponent(decodeURIComponent(E.password))):E.username=encodeURIComponent(decodeURIComponent(v))}for(var x=0;x<d.length;x++){var A=d[x];A[4]&&(E[A[1]]=E[A[1]].toLowerCase())}return E.auth=E.password?E.username+":"+E.password:E.username,E.origin=E.protocol!=="file:"&&w(E.protocol)&&E.host?E.protocol+"//"+E.host:"null",E.href=E.toString(),E},toString:function(g){g&&typeof g=="function"||(g=i.stringify);var v,h=this,E=h.host,T=h.protocol;T&&T.charAt(T.length-1)!==":"&&(T+=":");var R=T+(h.protocol&&h.slashes||w(h.protocol)?"//":"");return h.username?(R+=h.username,h.password&&(R+=":"+h.password),R+="@"):h.password?(R+=":"+h.password,R+="@"):h.protocol!=="file:"&&w(h.protocol)&&!E&&h.pathname!=="/"&&(R+="@"),(E[E.length-1]===":"||l.test(h.hostname)&&!h.port)&&(E+=":"),R+=E+h.pathname,(v=typeof h.query=="object"?g(h.query):h.query)&&(R+=v.charAt(0)!=="?"?"?"+v:v),h.hash&&(R+=h.hash),R}},y.extractProtocol=S,y.location=b,y.trimLeft=p,y.qs=i,e.exports=y},410:()=>{},388:()=>{},805:()=>{},345:()=>{},800:()=>{}},vy={};function yt(e){var t=vy[e];if(t!==void 0)return t.exports;var n=vy[e]={id:e,loaded:!1,exports:{}};return XR[e].call(n.exports,n,n.exports,yt),n.loaded=!0,n.exports}yt.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return yt.d(t,{a:t}),t},yt.d=(e,t)=>{for(var n in t)yt.o(t,n)&&!yt.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},yt.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),yt.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var Nn={};yt.d(Nn,{hT:()=>pn,O4:()=>xr,Kd:()=>oC,YK:()=>sC,UU:()=>dk,Gu:()=>Py,ky:()=>Wy,h4:()=>Lo,ch:()=>da,hq:()=>fi,i5:()=>Hy});var YR=yt(737),JR=yt.n(YR);function of(e){if(!sf(e))throw new Error("Parameter was not an error")}function sf(e){return!!e&&typeof e=="object"&&(t=e,Object.prototype.toString.call(t)==="[object Error]")||e instanceof Error;var t}class dn extends Error{constructor(t,n){const r=[...arguments],{options:i,shortMessage:o}=(function(a){let l,u="";if(a.length===0)l={};else if(sf(a[0]))l={cause:a[0]},u=a.slice(1).join(" ")||"";else if(a[0]&&typeof a[0]=="object")l=Object.assign({},a[0]),u=a.slice(1).join(" ")||"";else{if(typeof a[0]!="string")throw new Error("Invalid arguments passed to Layerr");l={},u=u=a.join(" ")||""}return{options:l,shortMessage:u}})(r);let s=o;if(i.cause&&(s=`${s}: ${i.cause.message}`),super(s),this.message=s,i.name&&typeof i.name=="string"?this.name=i.name:this.name="Layerr",i.cause&&Object.defineProperty(this,"_cause",{value:i.cause}),Object.defineProperty(this,"_info",{value:{}}),i.info&&typeof i.info=="object"&&Object.assign(this._info,i.info),Error.captureStackTrace){const a=i.constructorOpt||this.constructor;Error.captureStackTrace(this,a)}}static cause(t){return of(t),t._cause&&sf(t._cause)?t._cause:null}static fullStack(t){of(t);const n=dn.cause(t);return n?`${t.stack}
32
- caused by: ${dn.fullStack(n)}`:t.stack??""}static info(t){of(t);const n={},r=dn.cause(t);return r&&Object.assign(n,dn.info(r)),t._info&&Object.assign(n,t._info),n}toString(){let t=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t=`${t}: ${this.message}`),t}}var ZR=yt(47),oa=yt.n(ZR);const by="__PATH_SEPARATOR_POSIX__",wy="__PATH_SEPARATOR_WINDOWS__";function It(e){try{const t=e.replace(/\//g,by).replace(/\\\\/g,wy);return encodeURIComponent(t).split(wy).join("\\\\").split(by).join("/")}catch(t){throw new dn(t,"Failed encoding path")}}function Sy(e){return e.startsWith("/")?e:"/"+e}function Fo(e){let t=e;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function eC(e){let t=new(JR())(e).pathname;return t.length<=0&&(t="/"),Fo(t)}function Ot(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(function(){return(function(r){var i=[];if(r.length===0)return"";if(typeof r[0]!="string")throw new TypeError("Url must be a string. Received "+r[0]);if(r[0].match(/^[^/:]+:\/*$/)&&r.length>1){var o=r.shift();r[0]=o+r[0]}r[0].match(/^file:\/\/\//)?r[0]=r[0].replace(/^([^/:]+):\/*/,"$1:///"):r[0]=r[0].replace(/^([^/:]+):\/*/,"$1://");for(var s=0;s<r.length;s++){var a=r[s];if(typeof a!="string")throw new TypeError("Url must be a string. Received "+a);a!==""&&(s>0&&(a=a.replace(/^[\/]+/,"")),a=s<r.length-1?a.replace(/[\/]+$/,""):a.replace(/[\/]+$/,"/"),i.push(a))}var l=i.join("/"),u=(l=l.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return u.shift()+(u.length>0?"?":"")+u.join("&")})(typeof arguments[0]=="object"?arguments[0]:[].slice.call(arguments))})(t.reduce(((r,i,o)=>((o===0||i!=="/"||i==="/"&&r[r.length-1]!=="/")&&r.push(i),r)),[]))}var tC=yt(542),_o=yt.n(tC);const nC="abcdef0123456789";function Ey(e,t){const n=e.url.replace("//",""),r=n.indexOf("/")==-1?"/":n.slice(n.indexOf("/")),i=e.method?e.method.toUpperCase():"GET",o=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&"auth",s=`00000000${t.nc}`.slice(-8),a=(function(d,m,b,w,S,y,g){const v=g||_o()(`${m}:${b}:${w}`);return d&&d.toLowerCase()==="md5-sess"?_o()(`${v}:${S}:${y}`):v})(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),l=_o()(`${i}:${r}`),u=o?_o()(`${a}:${t.nonce}:${s}:${t.cnonce}:${o}:${l}`):_o()(`${a}:${t.nonce}:${l}`),c={username:t.username,realm:t.realm,nonce:t.nonce,uri:r,qop:o,response:u,nc:s,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},p=[];for(const d in c)c[d]&&(d==="qop"||d==="nc"||d==="algorithm"?p.push(`${d}=${c[d]}`):p.push(`${d}="${c[d]}"`));return`Digest ${p.join(", ")}`}function Ty(e){return(e.headers&&e.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var rC=yt(101),Ay=yt.n(rC);function xy(e){return Ay().decode(e)}function Ry(e,t){var n;return`Basic ${n=`${e}:${t}`,Ay().encode(n)}`}const sa=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,iC=sa.fetch.bind(sa),oC=sa.Request,sC=sa.Response;let pn=(function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e})({}),xr=(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})({});function Cy(e,t,n,r,i){switch(e.authType){case pn.Auto:t&&n&&(e.headers.Authorization=Ry(t,n));break;case pn.Digest:e.digest=(function(s,a,l){return{username:s,password:a,ha1:l,nc:0,algorithm:"md5",hasDigestAuth:!1}})(t,n,i);break;case pn.None:break;case pn.Password:e.headers.Authorization=Ry(t,n);break;case pn.Token:e.headers.Authorization=`${(o=r).token_type} ${o.access_token}`;break;default:throw new dn({info:{code:xr.InvalidAuthType}},`Invalid auth type: ${e.authType}`)}var o}yt(345),yt(800);const ky="@@HOTPATCHER",aC=()=>{};function af(e){return{original:e,methods:[e],final:!1}}class lC{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=ky}get configuration(){return this._configuration}get getEmptyAction(){return this.configuration.getEmptyAction}set getEmptyAction(t){this.configuration.getEmptyAction=t}control(t){let n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!t||t.__type__!==ky)throw new Error("Failed taking control of target HotPatcher instance: Invalid type or object");return Object.keys(t.configuration.registry).forEach((r=>{this.configuration.registry.hasOwnProperty(r)?n&&(this.configuration.registry[r]=Object.assign({},t.configuration.registry[r])):this.configuration.registry[r]=Object.assign({},t.configuration.registry[r])})),t._configuration=this.configuration,this}execute(t){const n=this.get(t)||aC;for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return n(...i)}get(t){const n=this.configuration.registry[t];if(!n)switch(this.getEmptyAction){case"null":return null;case"throw":throw new Error(`Failed handling method request: No method provided for override: ${t}`);default:throw new Error(`Failed handling request which resulted in an empty method: Invalid empty-action specified: ${this.getEmptyAction}`)}return(function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];if(i.length===0)throw new Error("Failed creating sequence: No functions provided");return function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];let u=a;const c=this;for(;i.length>0;)u=[i.shift().apply(c,u)];return u[0]}})(...n.methods)}isPatched(t){return!!this.configuration.registry[t]}patch(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{chain:i=!1}=r;if(this.configuration.registry[t]&&this.configuration.registry[t].final)throw new Error(`Failed patching '${t}': Method marked as being final`);if(typeof n!="function")throw new Error(`Failed patching '${t}': Provided method is not a function`);if(i)this.configuration.registry[t]?this.configuration.registry[t].methods.push(n):this.configuration.registry[t]=af(n);else if(this.isPatched(t)){const{original:o}=this.configuration.registry[t];this.configuration.registry[t]=Object.assign(af(n),{original:o})}else this.configuration.registry[t]=af(n);return this}patchInline(t,n){this.isPatched(t)||this.patch(t,n);for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return this.execute(t,...i)}plugin(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.forEach((o=>{this.patch(t,o,{chain:!0})})),this}restore(t){if(!this.isPatched(t))throw new Error(`Failed restoring method: No method present for key: ${t}`);if(typeof this.configuration.registry[t].original!="function")throw new Error(`Failed restoring method: Original method not found or of invalid type for key: ${t}`);return this.configuration.registry[t].methods=[this.configuration.registry[t].original],this}setFinal(t){if(!this.configuration.registry.hasOwnProperty(t))throw new Error(`Failed marking '${t}' as final: No method found for key`);return this.configuration.registry[t].final=!0,this}}let lf=null;function Py(){return lf||(lf=new lC),lf}function aa(e){return(function(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let n=t;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n})(e)?Object.assign({},e):Object.setPrototypeOf(Object.assign({},e),Object.getPrototypeOf(e))}function Iy(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];let r=null,i=[...t];for(;i.length>0;){const o=i.shift();r=r?Oy(r,o):aa(o)}return r}function Oy(e,t){const n=aa(e);return Object.keys(t).forEach((r=>{n.hasOwnProperty(r)?Array.isArray(t[r])?n[r]=Array.isArray(n[r])?[...n[r],...t[r]]:[...t[r]]:typeof t[r]=="object"&&t[r]?n[r]=typeof n[r]=="object"&&n[r]?Oy(n[r],t[r]):aa(t[r]):n[r]=t[r]:n[r]=t[r]})),n}function cC(e){const t={};for(const n of e.keys())t[n]=e.get(n);return t}function cf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t.length===0)return{};const r={};return t.reduce(((i,o)=>(Object.keys(o).forEach((s=>{const a=s.toLowerCase();r.hasOwnProperty(a)?i[r[a]]=o[s]:(r[a]=s,i[s]=o[s])})),i)),{})}yt(805);const uC=typeof ArrayBuffer=="function",{toString:fC}=Object.prototype;function Fy(e){return uC&&(e instanceof ArrayBuffer||fC.call(e)==="[object ArrayBuffer]")}function _y(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function uf(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}function ff(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const Dy=uf((function(e){const t=e._digest;return delete e._digest,t.hasDigestAuth&&(e=Iy(e,{headers:{Authorization:Ey(e,t)}})),ff(la(e),(function(n){let r=!1;return i=function(s){return r?s:n},(o=(function(){if(n.status==401)return t.hasDigestAuth=(function(s,a){if(!Ty(s))return!1;const l=/([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;for(;;){const u=s.headers&&s.headers.get("www-authenticate")||"",c=l.exec(u);if(!c)break;a[c[1]]=c[2]||c[3]}return a.nc+=1,a.cnonce=(function(){let u="";for(let c=0;c<32;++c)u=`${u}${nC[Math.floor(16*Math.random())]}`;return u})(),!0})(n,t),(function(){if(t.hasDigestAuth)return ff(la(e=Iy(e,{headers:{Authorization:Ey(e,t)}})),(function(s){return s.status==401?t.hasDigestAuth=!1:t.nc++,r=!0,s}))})();t.nc++})())&&o.then?o.then(i):i(o);var i,o}))})),dC=uf((function(e,t){return ff(la(e),(function(n){return n.ok?(t.authType=pn.Password,n):n.status==401&&Ty(n)?(t.authType=pn.Digest,Cy(t,t.username,t.password,void 0,void 0),e._digest=t.digest,Dy(e)):n}))})),Kt=uf((function(e,t){return t.authType===pn.Auto?dC(e,t):e._digest?Dy(e):la(e)}));function Gt(e,t,n){const r=aa(e);return r.headers=cf(t.headers,r.headers||{},n.headers||{}),n.data!==void 0&&(r.data=n.data),n.signal&&(r.signal=n.signal),t.httpAgent&&(r.httpAgent=t.httpAgent),t.httpsAgent&&(r.httpsAgent=t.httpsAgent),t.digest&&(r._digest=t.digest),typeof t.withCredentials=="boolean"&&(r.withCredentials=t.withCredentials),r}function la(e){const t=Py();return t.patchInline("request",(n=>t.patchInline("fetch",iC,n.url,(function(r){let i={};const o={method:r.method};if(r.headers&&(i=cf(i,r.headers)),r.data!==void 0){const[s,a]=(function(l){if(typeof l=="string")return[l,{}];if(_y(l))return[l,{}];if(Fy(l))return[l,{}];if(l&&typeof l=="object")return[JSON.stringify(l),{"content-type":"application/json"}];throw new Error("Unable to convert request body: Unexpected body type: "+typeof l)})(r.data);o.body=s,i=cf(i,a)}return r.signal&&(o.signal=r.signal),r.withCredentials&&(o.credentials="include"),o.headers=i,o})(n))),e)}var pC=yt(285);const ca=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},hC={"[: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]},Do=e=>e.replace(/[[\]\\-]/g,"\\$&"),Ny=e=>e.join(""),mC=(e,t)=>{const n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");const r=[],i=[];let o=n+1,s=!1,a=!1,l=!1,u=!1,c=n,p="";e:for(;o<e.length;){const w=e.charAt(o);if(w!=="!"&&w!=="^"||o!==n+1){if(w==="]"&&s&&!l){c=o+1;break}if(s=!0,w!=="\\"||l){if(w==="["&&!l){for(const[S,[y,g,v]]of Object.entries(hC))if(e.startsWith(S,o)){if(p)return["$.",!1,e.length-n,!0];o+=S.length,v?i.push(y):r.push(y),a=a||g;continue e}}l=!1,p?(w>p?r.push(Do(p)+"-"+Do(w)):w===p&&r.push(Do(w)),p="",o++):e.startsWith("-]",o+1)?(r.push(Do(w+"-")),o+=2):e.startsWith("-",o+1)?(p=w,o+=2):(r.push(Do(w)),o++)}else l=!0,o++}else u=!0,o++}if(c<o)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u)return[(d=r[0].length===2?r[0].slice(-1):r[0],d.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,c-n,!1];var d;const m="["+(u?"^":"")+Ny(r)+"]",b="["+(u?"":"^")+Ny(i)+"]";return[r.length&&i.length?"("+m+"|"+b+")":r.length?m:b,a,c-n,!0]},No=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")},gC=new Set(["!","?","+","*","@"]),Ly=e=>gC.has(e),df="(?!\\.)",yC=new Set(["[","."]),vC=new Set(["..","."]),bC=new Set("().*{}+?[]^$\\!"),pf="[^/]",$y=pf+"*?",My=pf+"+?";class hn{type;#n;#r;#o=!1;#e=[];#t;#s;#l;#a=!1;#i;#c;#f=!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.#i=this.#n===this?r:this.#n.#i,this.#l=this.#n===this?[]:this.#n.#l,t!=="!"||this.#n.#a||this.#l.push(this),this.#s=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 i=n.#s+1;!r.type&&i<r.#e.length;i++)for(const o of t.#e){if(typeof o=="string")throw new Error("string part in extglob AST??");o.copyIn(r.#e[i])}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 i of n)if(i!==""){if(typeof i!="string"&&!(i instanceof hn&&i.#t===this))throw new Error("invalid part: "+i);this.#e.push(i)}}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.#s===0)return!0;const t=this.#t;for(let n=0;n<this.#s;n++){const r=t.#e[n];if(!(r instanceof hn&&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.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const n=new hn(this.type,t);for(const r of this.#e)n.copyIn(r);return n}static#u(t,n,r,i){let o=!1,s=!1,a=-1,l=!1;if(n.type===null){let m=r,b="";for(;m<t.length;){const w=t.charAt(m++);if(o||w==="\\")o=!o,b+=w;else if(s)m===a+1?w!=="^"&&w!=="!"||(l=!0):w!=="]"||m===a+2&&l||(s=!1),b+=w;else if(w!=="[")if(i.noext||!Ly(w)||t.charAt(m)!=="(")b+=w;else{n.push(b),b="";const S=new hn(w,n);m=hn.#u(t,S,m,i),n.push(S)}else s=!0,a=m,l=!1,b+=w}return n.push(b),m}let u=r+1,c=new hn(null,n);const p=[];let d="";for(;u<t.length;){const m=t.charAt(u++);if(o||m==="\\")o=!o,d+=m;else if(s)u===a+1?m!=="^"&&m!=="!"||(l=!0):m!=="]"||u===a+2&&l||(s=!1),d+=m;else if(m!=="[")if(Ly(m)&&t.charAt(u)==="("){c.push(d),d="";const b=new hn(m,c);c.push(b),u=hn.#u(t,b,u,i)}else if(m!=="|"){if(m===")")return d===""&&n.#e.length===0&&(n.#f=!0),c.push(d),d="",n.push(...p,c),u;d+=m}else c.push(d),d="",p.push(c),c=new hn(null,n);else s=!0,a=u,l=!1,d+=m}return n.type=null,n.#r=void 0,n.#e=[t.substring(r-1)],u}static fromGlob(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=new hn(null,void 0,n);return hn.#u(t,r,0,n),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();const t=this.toString(),[n,r,i,o]=this.toRegExpSource();if(!(i||this.#r||this.#i.nocase&&!this.#i.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;const s=(this.#i.nocase?"i":"")+(o?"u":"");return Object.assign(new RegExp(`^${n}$`,s),{_src:n,_glob:t})}get options(){return this.#i}toRegExpSource(t){const n=t??!!this.#i.dot;if(this.#n===this&&this.#p(),!this.type){const l=this.isStart()&&this.isEnd(),u=this.#e.map((d=>{const[m,b,w,S]=typeof d=="string"?hn.#h(d,this.#r,l):d.toRegExpSource(t);return this.#r=this.#r||w,this.#o=this.#o||S,m})).join("");let c="";if(this.isStart()&&typeof this.#e[0]=="string"&&(this.#e.length!==1||!vC.has(this.#e[0]))){const d=yC,m=n&&d.has(u.charAt(0))||u.startsWith("\\.")&&d.has(u.charAt(2))||u.startsWith("\\.\\.")&&d.has(u.charAt(4)),b=!n&&!t&&d.has(u.charAt(0));c=m?"(?!(?:^|/)\\.\\.?(?:$|/))":b?df:""}let p="";return this.isEnd()&&this.#n.#a&&this.#t?.type==="!"&&(p="(?:$|\\/)"),[c+u+p,No(u),this.#r=!!this.#r,this.#o]}const r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:";let o=this.#d(n);if(this.isStart()&&this.isEnd()&&!o&&this.type!=="!"){const l=this.toString();return this.#e=[l],this.type=null,this.#r=void 0,[l,No(this.toString()),!1,!1]}let s=!r||t||n?"":this.#d(!0);s===o&&(s=""),s&&(o=`(?:${o})(?:${s})*?`);let a="";return a=this.type==="!"&&this.#f?(this.isStart()&&!n?df:"")+My:i+o+(this.type==="!"?"))"+(!this.isStart()||n||t?"":df)+$y+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`),[a,No(o),this.#r=!!this.#r,this.#o]}#d(t){return this.#e.map((n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");const[r,i,o,s]=n.toRegExpSource(t);return this.#o=this.#o||s,r})).filter((n=>!(this.isStart()&&this.isEnd()&&!n))).join("|")}static#h(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],i=!1,o="",s=!1;for(let a=0;a<t.length;a++){const l=t.charAt(a);if(i)i=!1,o+=(bC.has(l)?"\\":"")+l;else if(l!=="\\"){if(l==="["){const[u,c,p,d]=mC(t,a);if(p){o+=u,s=s||c,a+=p-1,n=n||d;continue}}l!=="*"?l!=="?"?o+=l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(o+=pf,n=!0):(o+=r&&t==="*"?My:$y,n=!0)}else a===t.length-1?o+="\\\\":i=!0}return[o,No(t),!!n,s]}}const an=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return ca(t),!(!n.nocomment&&t.charAt(0)==="#")&&new ua(t,n).match(e)},wC=/^\*+([^+@!?\*\[\(]*)$/,SC=e=>t=>!t.startsWith(".")&&t.endsWith(e),EC=e=>t=>t.endsWith(e),TC=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),AC=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),xC=/^\*+\.\*+$/,RC=e=>!e.startsWith(".")&&e.includes("."),CC=e=>e!=="."&&e!==".."&&e.includes("."),kC=/^\.\*+$/,PC=e=>e!=="."&&e!==".."&&e.startsWith("."),IC=/^\*+$/,OC=e=>e.length!==0&&!e.startsWith("."),FC=e=>e.length!==0&&e!=="."&&e!=="..",_C=/^\?+([^+@!?\*\[\(]*)?$/,DC=e=>{let[t,n=""]=e;const r=By([t]);return n?(n=n.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(n)):r},NC=e=>{let[t,n=""]=e;const r=jy([t]);return n?(n=n.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(n)):r},LC=e=>{let[t,n=""]=e;const r=jy([t]);return n?i=>r(i)&&i.endsWith(n):r},$C=e=>{let[t,n=""]=e;const r=By([t]);return n?i=>r(i)&&i.endsWith(n):r},By=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&!r.startsWith(".")},jy=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&r!=="."&&r!==".."},Uy=typeof be=="object"&&be?typeof be.env=="object"&&be.env&&be.env.__MINIMATCH_TESTING_PLATFORM__||be.platform:"posix";an.sep=Uy==="win32"?"\\":"/";const Ln=Symbol("globstar **");an.GLOBSTAR=Ln,an.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>an(n,e,t)};const $n=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};an.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return an;const t=an;return Object.assign((function(n,r){return t(n,r,$n(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}),{Minimatch:class extends t.Minimatch{constructor(n){super(n,$n(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(n){return t.defaults($n(e,n)).Minimatch}},AST:class extends t.AST{constructor(n,r){super(n,r,$n(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,$n(e,r))}},unescape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(n,$n(e,r))},escape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(n,$n(e,r))},filter:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(n,$n(e,r))},defaults:n=>t.defaults($n(e,n)),makeRe:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(n,$n(e,r))},braceExpand:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(n,$n(e,r))},match:function(n,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(n,r,$n(e,i))},sep:t.sep,GLOBSTAR:Ln})};const Vy=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ca(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:pC(e)};an.braceExpand=Vy,an.makeRe=function(e){return new ua(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},an.match=function(e,t){const n=new ua(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 qy=/[?*]|[+@!]\(.*?\)|\[|\]/;class ua{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]:{};ca(t),n=n||{},this.options=n,this.pattern=t,this.platform=n.platform||Uy,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 i=this.globParts.map(((o,s,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){const l=!(o[0]!==""||o[1]!==""||o[2]!=="?"&&qy.test(o[2])||qy.test(o[3])),u=/^[a-z]:/i.test(o[0]);if(l)return[...o.slice(0,4),...o.slice(4).map((c=>this.parse(c)))];if(u)return[o[0],...o.slice(1).map((c=>this.parse(c)))]}return o.map((l=>this.parse(l)))}));if(this.debug(this.pattern,i),this.set=i.filter((o=>o.indexOf(!1)===-1)),this.isWindows)for(let o=0;o<this.set.length;o++){const s=this.set[o];s[0]===""&&s[1]===""&&this.globParts[o][2]==="?"&&typeof s[3]=="string"&&/^[a-z]:$/i.test(s[3])&&(s[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let r=0;r<t.length;r++)for(let i=0;i<t[r].length;i++)t[r][i]==="**"&&(t[r][i]="*");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 i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n}))}levelOneOptimize(t){return t.map((n=>(n=n.reduce(((r,i)=>{const o=r[r.length-1];return i==="**"&&o==="**"?r:i===".."&&o&&o!==".."&&o!=="."&&o!=="**"?(r.pop(),r):(r.push(i),r)}),[])).length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){const o=t[i];i===1&&o===""&&t[0]===""||o!=="."&&o!==""||(n=!0,t.splice(i,1),i--)}t[0]!=="."||t.length!==2||t[1]!=="."&&t[1]!==""||(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){const i=t[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(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 i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let s=i;for(;r[s+1]==="**";)s++;s>i&&r.splice(i+1,s-i);let a=r[i+1];const l=r[i+2],u=r[i+3];if(a!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;n=!0,r.splice(i,1);const c=r.slice(0);c[i]="**",t.push(c),i--}if(!this.preserveMultipleSlashes){for(let s=1;s<r.length-1;s++){const a=r[s];s===1&&a===""&&r[0]===""||a!=="."&&a!==""||(n=!0,r.splice(s,1),s--)}r[0]!=="."||r.length!==2||r[1]!=="."&&r[1]!==""||(n=!0,r.pop())}let o=0;for(;(o=r.indexOf("..",o+1))!==-1;){const s=r[o-1];if(s&&s!=="."&&s!==".."&&s!=="**"){n=!0;const a=o===1&&r[o+1]==="**"?["."]:[];r.splice(o-1,2,...a),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 i=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(i){t[n]=[],t[r]=i;break}}return t.filter((n=>n.length))}partsMatch(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],i=0,o=0,s=[],a="";for(;i<t.length&&o<n.length;)if(t[i]===n[o])s.push(a==="b"?n[o]:t[i]),i++,o++;else if(r&&t[i]==="**"&&n[o]===t[i+1])s.push(t[i]),i++;else if(r&&n[o]==="**"&&t[i]===n[o+1])s.push(n[o]),o++;else if(t[i]!=="*"||!n[o]||!this.options.dot&&n[o].startsWith(".")||n[o]==="**"){if(n[o]!=="*"||!t[i]||!this.options.dot&&t[i].startsWith(".")||t[i]==="**"||a==="a")return!1;a="b",s.push(n[o]),i++,o++}else{if(a==="b")return!1;a="a",s.push(t[i]),i++,o++}return t.length===n.length&&s}parseNegate(){if(this.nonegate)return;const t=this.pattern;let n=!1,r=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)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 i=this.options;if(this.isWindows){const w=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),S=!w&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),y=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),g=S?3:w?0:void 0,v=!y&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])?3:y?0:void 0;if(typeof g=="number"&&typeof v=="number"){const[h,E]=[t[g],n[v]];h.toLowerCase()===E.toLowerCase()&&(n[v]=h,v>g?n=n.slice(v):g>v&&(t=t.slice(g)))}}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 s=0,a=0,l=t.length,u=n.length;s<l&&a<u;s++,a++){this.debug("matchOne loop");var c=n[a],p=t[s];if(this.debug(n,c,p),c===!1)return!1;if(c===Ln){this.debug("GLOBSTAR",[n,c,p]);var d=s,m=a+1;if(m===u){for(this.debug("** at the end");s<l;s++)if(t[s]==="."||t[s]===".."||!i.dot&&t[s].charAt(0)===".")return!1;return!0}for(;d<l;){var b=t[d];if(this.debug(`
33
- globstar while`,t,d,n,m,b),this.matchOne(t.slice(d),n.slice(m),r))return this.debug("globstar found match!",d,l,b),!0;if(b==="."||b===".."||!i.dot&&b.charAt(0)==="."){this.debug("dot detected!",t,d,n,m);break}this.debug("globstar swallow a segment, and continue"),d++}return!(!r||(this.debug(`
34
- >>> no match, partial?`,t,d,n,m),d!==l))}let w;if(typeof c=="string"?(w=p===c,this.debug("string match",c,p,w)):(w=c.test(p),this.debug("pattern match",c,p,w)),!w)return!1}if(s===l&&a===u)return!0;if(s===l)return r;if(a===u)return s===l-1&&t[s]==="";throw new Error("wtf?")}braceExpand(){return Vy(this.pattern,this.options)}parse(t){ca(t);const n=this.options;if(t==="**")return Ln;if(t==="")return"";let r,i=null;(r=t.match(IC))?i=n.dot?FC:OC:(r=t.match(wC))?i=(n.nocase?n.dot?AC:TC:n.dot?EC:SC)(r[1]):(r=t.match(_C))?i=(n.nocase?n.dot?NC:DC:n.dot?LC:$C)(r):(r=t.match(xC))?i=n.dot?CC:RC:(r=t.match(kC))&&(i=PC);const o=hn.fromGlob(t,this.options).toMMPattern();return i&&typeof o=="object"&&Reflect.defineProperty(o,"test",{value:i}),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})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",i=new Set(n.nocase?["i"]:[]);let o=t.map((l=>{const u=l.map((c=>{if(c instanceof RegExp)for(const p of c.flags.split(""))i.add(p);return typeof c=="string"?c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):c===Ln?Ln:c._src}));return u.forEach(((c,p)=>{const d=u[p+1],m=u[p-1];c===Ln&&m!==Ln&&(m===void 0?d!==void 0&&d!==Ln?u[p+1]="(?:\\/|"+r+"\\/)?"+d:u[p]=r:d===void 0?u[p-1]=m+"(?:\\/|"+r+")?":d!==Ln&&(u[p-1]=m+"(?:\\/|\\/"+r+"\\/)"+d,u[p+1]=Ln))})),u.filter((c=>c!==Ln)).join("/")})).join("|");const[s,a]=t.length>1?["(?:",")"]:["",""];o="^"+s+o+a+"$",this.negate&&(o="^(?!"+o+").+$");try{this.regexp=new RegExp(o,[...i].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 i=this.slashSplit(t);this.debug(this.pattern,"split",i);const o=this.set;this.debug(this.pattern,"set",o);let s=i[i.length-1];if(!s)for(let a=i.length-2;!s&&a>=0;a--)s=i[a];for(let a=0;a<o.length;a++){const l=o[a];let u=i;if(r.matchBase&&l.length===1&&(u=[s]),this.matchOne(u,l,n))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate}static defaults(t){return an.defaults(t).Minimatch}}function hf(e){const t=new Error(`${arguments.length>1&&arguments[1]!==void 0?arguments[1]:""}Invalid response: ${e.status} ${e.statusText}`);return t.status=e.status,t.response=e,t}function Qt(e,t){const{status:n}=t;if(n===401&&e.digest)return t;if(n>=400)throw hf(t);return t}function fi(e,t){return arguments.length>2&&arguments[2]!==void 0&&arguments[2]?{data:t,headers:e.headers?cC(e.headers):{},status:e.status,statusText:e.statusText}:t}an.AST=hn,an.Minimatch=ua,an.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},an.unescape=No;const MC=(zy=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=Gt({url:Ot(e.remoteURL,It(t)),method:"COPY",headers:{Destination:Ot(e.remoteURL,It(n)),Overwrite:r.overwrite===!1?"F":"T",Depth:r.shallow?"0":"infinity"}},e,r);return s=function(a){Qt(e,a)},(o=Kt(i,e))&&o.then||(o=Promise.resolve(o)),s?o.then(s):o;var o,s},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(zy.apply(this,e))}catch(n){return Promise.reject(n)}});var zy,mf=yt(635),BC=yt(829),Rr=yt.n(BC),zi=(function(e){return e.Array="array",e.Object="object",e.Original="original",e})(zi||{});function fa(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zi.Original;const r=Rr().get(e,t);return n==="array"&&Array.isArray(r)===!1?[r]:n==="object"&&Array.isArray(r)?r[0]:r}function Lo(e){return new Promise((t=>{t((function(n){const{multistatus:r}=n;if(r==="")return{multistatus:{response:[]}};if(!r)throw new Error("Invalid response: No root multistatus found");const i={multistatus:Array.isArray(r)?r[0]:r};return Rr().set(i,"multistatus.response",fa(i,"multistatus.response",zi.Array)),Rr().set(i,"multistatus.response",Rr().get(i,"multistatus.response").map((o=>(function(s){const a=Object.assign({},s);return a.status?Rr().set(a,"status",fa(a,"status",zi.Object)):(Rr().set(a,"propstat",fa(a,"propstat",zi.Object)),Rr().set(a,"propstat.prop",fa(a,"propstat.prop",zi.Object))),a})(o)))),i})(new mf.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",textNodeName:"text",ignoreAttributes:!1,removeNSPrefix:!0,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor:(n,r,i)=>r==="true"||r==="false"?r==="true":r,tagValueProcessor(n,r,i){if(!i.endsWith("propstat.prop.displayname"))return r}}).parse(e)))}))}function da(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const{getlastmodified:r=null,getcontentlength:i="0",resourcetype:o=null,getcontenttype:s=null,getetag:a=null}=e,l=o&&typeof o=="object"&&o.collection!==void 0?"directory":"file",u={filename:t,basename:oa().basename(t),lastmod:r,size:parseInt(i,10),type:l,etag:typeof a=="string"?a.replace(/"/g,""):null};return l==="file"&&(u.mime=s&&typeof s=="string"?s.split(";")[0]:""),n&&(e.displayname!==void 0&&(e.displayname=String(e.displayname)),u.props=e),u}function Wy(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=null;try{e.multistatus.response[0].propstat&&(r=e.multistatus.response[0])}catch{}if(!r)throw new Error("Failed getting item stat: bad response");const{propstat:{prop:i,status:o}}=r,[s,a,l]=o.split(" ",3),u=parseInt(a,10);if(u>=400){const c=new Error(`Invalid response: ${u} ${l}`);throw c.status=u,c}return da(i,Fo(t),n)}function Hy(e){switch(String(e)){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(String(e),10)}}function gf(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const yf=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{details:r=!1}=n,i=Gt({url:Ot(e.remoteURL,It(t)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,n);return gf(Kt(i,e),(function(o){return Qt(e,o),gf(o.text(),(function(s){return gf(Lo(s),(function(a){const l=Wy(a,t,r);return fi(o,l,r)}))}))}))}));function Ky(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const jC=Gy((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=(function(o){if(!o||o==="/")return[];let s=o;const a=[];do a.push(s),s=oa().dirname(s);while(s&&s!=="/");return a})(Fo(t));r.sort(((o,s)=>o.length>s.length?1:s.length>o.length?-1:0));let i=!1;return(function(o,s,a){if(typeof o[Xy]=="function"){let w=function(S){try{for(;!(l=p.next()).done;)if((S=s(l.value))&&S.then){if(!Yy(S))return void S.then(w,c||(c=mn.bind(null,u=new Wi,2)));S=S.v}u?mn(u,1,S):u=S}catch(y){mn(u||(u=new Wi),2,y)}};var l,u,c,p=o[Xy]();if(w(),p.return){var d=function(S){try{l.done||p.return()}catch{}return S};if(u&&u.then)return u.then(d,(function(S){throw d(S)}));d()}return u}if(!("length"in o))throw new TypeError("Object is not iterable");for(var m=[],b=0;b<o.length;b++)m.push(o[b]);return(function(w,S,y){var g,v,h=-1;return(function E(T){try{for(;++h<w.length&&(!y||!y());)if((T=S(h))&&T.then){if(!Yy(T))return void T.then(E,v||(v=mn.bind(null,g=new Wi,2)));T=T.v}g?mn(g,1,T):g=T}catch(R){mn(g||(g=new Wi),2,R)}})(),g})(m,(function(w){return s(m[w])}),a)})(r,(function(o){return s=function(){return(function(l,u){try{var c=Ky(yf(e,o),(function(p){if(p.type!=="directory")throw new Error(`Path includes a file: ${t}`)}))}catch(p){return u(p)}return c&&c.then?c.then(void 0,u):c})(0,(function(l){const u=l;return(function(){if(u.status===404)return i=!0,Qy(vf(e,o,{...n,recursive:!1}));throw l})()}))},(a=(function(){if(i)return Qy(vf(e,o,{...n,recursive:!1}))})())&&a.then?a.then(s):s();var s,a}),(function(){return!1}))}));function Gy(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}function UC(){}function Qy(e,t){return e&&e.then?e.then(UC):Promise.resolve()}const Xy=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function mn(e,t,n){if(!e.s){if(n instanceof Wi){if(!n.s)return void(n.o=mn.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(mn.bind(null,e,t),mn.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const Wi=(function(){function e(){}return e.prototype.then=function(t,n){const r=new e,i=this.s;if(i){const o=1&i?t:n;if(o){try{mn(r,1,o(this.v))}catch(s){mn(r,2,s)}return r}return this}return this.o=function(o){try{const s=o.v;1&o.s?mn(r,1,t?t(s):s):n?mn(r,1,n(s)):mn(r,2,s)}catch(s){mn(r,2,s)}},r},e})();function Yy(e){return e instanceof Wi&&1&e.s}const vf=Gy((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(n.recursive===!0)return jC(e,t,n);const r=Gt({url:Ot(e.remoteURL,(i=It(t),i.endsWith("/")?i:i+"/")),method:"MKCOL"},e,n);var i;return Ky(Kt(r,e),(function(o){Qt(e,o)}))}));var VC=yt(388),Jy=yt.n(VC);const qC=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r={};if(typeof n.range=="object"&&typeof n.range.start=="number"){let a=`bytes=${n.range.start}-`;typeof n.range.end=="number"&&(a=`${a}${n.range.end}`),r.Range=a}const i=Gt({url:Ot(e.remoteURL,It(t)),method:"GET",headers:r},e,n);return s=function(a){if(Qt(e,a),r.Range&&a.status!==206){const l=new Error(`Invalid response code for partial request: ${a.status}`);throw l.status=a.status,l}return n.callback&&setTimeout((()=>{n.callback(a)}),0),a.body},(o=Kt(i,e))&&o.then||(o=Promise.resolve(o)),s?o.then(s):o;var o,s})),zC=()=>{},WC=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t,n){n.url||(n.url=Ot(e.remoteURL,It(t)));const r=Gt(n,e,{});return o=function(s){return Qt(e,s),s},(i=Kt(r,e))&&i.then||(i=Promise.resolve(i)),o?i.then(o):i;var i,o})),HC=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Gt({url:Ot(e.remoteURL,It(t)),method:"DELETE"},e,n);return o=function(s){Qt(e,s)},(i=Kt(r,e))&&i.then||(i=Promise.resolve(i)),o?i.then(o):i;var i,o})),KC=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return(function(r,i){try{var o=(s=yf(e,t,n),a=function(){return!0},l?a?a(s):s:(s&&s.then||(s=Promise.resolve(s)),a?s.then(a):s))}catch(u){return i(u)}var s,a,l;return o&&o.then?o.then(void 0,i):o})(0,(function(r){if(r.status===404)return!1;throw r}))}));function bf(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const GC=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Gt({url:Ot(e.remoteURL,It(t),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:n.deep?"infinity":"1"}},e,n);return bf(Kt(r,e),(function(i){return Qt(e,i),bf(i.text(),(function(o){if(!o)throw new Error("Failed parsing directory contents: Empty response");return bf(Lo(o),(function(s){const a=Sy(t);let l=(function(u,c,p){let d=arguments.length>3&&arguments[3]!==void 0&&arguments[3],m=arguments.length>4&&arguments[4]!==void 0&&arguments[4];const b=oa().join(c,"/"),{multistatus:{response:w}}=u,S=w.map((y=>{const g=(function(h){try{return h.replace(/^https?:\/\/[^\/]+/,"")}catch(E){throw new dn(E,"Failed normalising HREF")}})(y.href),{propstat:{prop:v}}=y;return da(v,b==="/"?decodeURIComponent(Fo(g)):Fo(oa().relative(decodeURIComponent(b),decodeURIComponent(g))),d)}));return m?S:S.filter((y=>y.basename&&(y.type==="file"||y.filename!==p.replace(/\/$/,""))))})(s,Sy(e.remoteBasePath||e.remotePath),a,n.details,n.includeSelf);return n.glob&&(l=(function(u,c){return u.filter((p=>an(p.filename,c,{matchBase:!0})))})(l,n.glob)),fi(i,l,n.details)}))}))}))}));function wf(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}const QC=wf((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Gt({url:Ot(e.remoteURL,It(t)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[JC]},e,n);return pa(Kt(r,e),(function(i){return Qt(e,i),pa(i.text(),(function(o){return fi(i,o,n.details)}))}))}));function pa(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const XC=wf((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Gt({url:Ot(e.remoteURL,It(t)),method:"GET"},e,n);return pa(Kt(r,e),(function(i){let o;return Qt(e,i),(function(s,a){var l=s();return l&&l.then?l.then(a):a()})((function(){return pa(i.arrayBuffer(),(function(s){o=s}))}),(function(){return fi(i,o,n.details)}))}))})),YC=wf((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{format:r="binary"}=n;if(r!=="binary"&&r!=="text")throw new dn({info:{code:xr.InvalidOutputFormat}},`Invalid output format: ${r}`);return r==="text"?QC(e,t,n):XC(e,t,n)})),JC=e=>e;function ZC(e){return new mf.XMLBuilder({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(Zy({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:e}}},"d"))}function Zy(e,t){const n={...e};for(const r in n)n.hasOwnProperty(r)&&(n[r]&&typeof n[r]=="object"&&r.indexOf(":")===-1?(n[`${t}:${r}`]=Zy(n[r],t),delete n[r]):/^@_/.test(r)===!1&&(n[`${t}:${r}`]=n[r],delete n[r]));return n}function Sf(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function ev(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}const ek=ev((function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=Gt({url:Ot(e.remoteURL,It(t)),method:"UNLOCK",headers:{"Lock-Token":n}},e,r);return Sf(Kt(i,e),(function(o){if(Qt(e,o),o.status!==204&&o.status!==200)throw hf(o)}))})),tk=ev((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{refreshToken:r,timeout:i=nk}=n,o={Accept:"text/plain,application/xml",Timeout:i};r&&(o.If=r);const s=Gt({url:Ot(e.remoteURL,It(t)),method:"LOCK",headers:o,data:ZC(e.contactHref)},e,n);return Sf(Kt(s,e),(function(a){return Qt(e,a),Sf(a.text(),(function(l){const u=(d=l,new mf.XMLParser({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(d)),c=Rr().get(u,"prop.lockdiscovery.activelock.locktoken.href"),p=Rr().get(u,"prop.lockdiscovery.activelock.timeout");var d;if(!c)throw hf(a,"No lock token received: ");return{token:c,serverTimeout:p}}))}))})),nk="Infinite, Second-4100000000";function Ef(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const rk=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=t.path||"/",r=Gt({url:Ot(e.remoteURL,n),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,t);return Ef(Kt(r,e),(function(i){return Qt(e,i),Ef(i.text(),(function(o){return Ef(Lo(o),(function(s){const a=(function(l){try{const[u]=l.multistatus.response,{propstat:{prop:{"quota-used-bytes":c,"quota-available-bytes":p}}}=u;return c!==void 0&&p!==void 0?{used:parseInt(String(c),10),available:Hy(p)}:null}catch{}return null})(s);return fi(i,a,t.details)}))}))}))}));function Tf(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const ik=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{details:r=!1}=n,i=Gt({url:Ot(e.remoteURL,It(t)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":e.headers["Content-Type"]||"application/xml; charset=utf-8"}},e,n);return Tf(Kt(i,e),(function(o){return Qt(e,o),Tf(o.text(),(function(s){return Tf(Lo(s),(function(a){const l=(function(u,c,p){const d={truncated:!1,results:[]};return d.truncated=u.multistatus.response.some((m=>(m.status||m.propstat?.status).split(" ",3)?.[1]==="507"&&m.href.replace(/\/$/,"").endsWith(It(c).replace(/\/$/,"")))),u.multistatus.response.forEach((m=>{if(m.propstat===void 0)return;const b=m.href.split("/").map(decodeURIComponent).join("/");d.results.push(da(m.propstat.prop,b,p))})),d})(a,t,r);return fi(o,l,r)}))}))}))})),ok=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=Gt({url:Ot(e.remoteURL,It(t)),method:"MOVE",headers:{Destination:Ot(e.remoteURL,It(n)),Overwrite:r.overwrite===!1?"F":"T"}},e,r);return s=function(a){Qt(e,a)},(o=Kt(i,e))&&o.then||(o=Promise.resolve(o)),s?o.then(s):o;var o,s}));var sk=yt(172);const ak=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const{contentLength:i=!0,overwrite:o=!0}=r,s={"Content-Type":"application/octet-stream"};i===!1||(s["Content-Length"]=typeof i=="number"?`${i}`:`${(function(c){if(Fy(c))return c.byteLength;if(_y(c))return c.length;if(typeof c=="string")return(0,sk.d)(c);throw new dn({info:{code:xr.DataTypeNoLength}},"Cannot calculate data length: Invalid type")})(n)}`),o||(s["If-None-Match"]="*");const a=Gt({url:Ot(e.remoteURL,It(t)),method:"PUT",headers:s,data:n},e,r);return u=function(c){try{Qt(e,c)}catch(p){const d=p;if(d.status!==412||o)throw d;return!1}return!0},(l=Kt(a,e))&&l.then||(l=Promise.resolve(l)),u?l.then(u):l;var l,u})),tv=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Gt({url:Ot(e.remoteURL,It(t)),method:"OPTIONS"},e,n);return o=function(s){try{Qt(e,s)}catch(a){throw a}return{compliance:(s.headers.get("DAV")??"").split(",").map((a=>a.trim())),server:s.headers.get("Server")??""}},(i=Kt(r,e))&&i.then||(i=Promise.resolve(i)),o?i.then(o):i;var i,o}));function $o(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const lk=Af((function(e,t,n,r,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new dn({info:{code:xr.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);const s={"Content-Type":"application/octet-stream","Content-Length":""+(r-n+1),"Content-Range":`bytes ${n}-${r}/*`},a=Gt({url:Ot(e.remoteURL,It(t)),method:"PUT",headers:s,data:i},e,o);return $o(Kt(a,e),(function(l){Qt(e,l)}))}));function nv(e,t){var n=e();return n&&n.then?n.then(t):t(n)}const ck=Af((function(e,t,n,r,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new dn({info:{code:xr.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);const s={"Content-Type":"application/x-sabredav-partialupdate","Content-Length":""+(r-n+1),"X-Update-Range":`bytes=${n}-${r}`},a=Gt({url:Ot(e.remoteURL,It(t)),method:"PATCH",headers:s,data:i},e,o);return $o(Kt(a,e),(function(l){Qt(e,l)}))}));function Af(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}const uk=Af((function(e,t,n,r,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};return $o(tv(e,t,o),(function(s){let a=!1;return nv((function(){if(s.compliance.includes("sabredav-partialupdate"))return $o(ck(e,t,n,r,i,o),(function(l){return a=!0,l}))}),(function(l){let u=!1;return a?l:nv((function(){if(s.server.includes("Apache")&&s.compliance.includes("<http://apache.org/dav/propset/fs/1>"))return $o(lk(e,t,n,r,i,o),(function(c){return u=!0,c}))}),(function(c){if(u)return c;throw new dn({info:{code:xr.NotSupported}},"Not supported")}))}))}))})),fk="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function dk(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{authType:n=null,remoteBasePath:r,contactHref:i=fk,ha1:o,headers:s={},httpAgent:a,httpsAgent:l,password:u,token:c,username:p,withCredentials:d}=t;let m=n;m||(m=p||u?pn.Password:pn.None);const b={authType:m,remoteBasePath:r,contactHref:i,ha1:o,headers:Object.assign({},s),httpAgent:a,httpsAgent:l,password:u,remotePath:eC(e),remoteURL:e,token:c,username:p,withCredentials:d};return Cy(b,p,u,c,o),{copyFile:(w,S,y)=>MC(b,w,S,y),createDirectory:(w,S)=>vf(b,w,S),createReadStream:(w,S)=>(function(y,g){let v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const h=new(Jy()).PassThrough;return qC(y,g,v).then((E=>{E.pipe(h)})).catch((E=>{h.emit("error",E)})),h})(b,w,S),createWriteStream:(w,S,y)=>(function(g,v){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:zC;const T=new(Jy()).PassThrough,R={};h.overwrite===!1&&(R["If-None-Match"]="*");const x=Gt({url:Ot(g.remoteURL,It(v)),method:"PUT",headers:R,data:T,maxRedirects:0},g,h);return Kt(x,g).then((A=>Qt(g,A))).then((A=>{setTimeout((()=>{E(A)}),0)})).catch((A=>{T.emit("error",A)})),T})(b,w,S,y),customRequest:(w,S)=>WC(b,w,S),deleteFile:(w,S)=>HC(b,w,S),exists:(w,S)=>KC(b,w,S),getDirectoryContents:(w,S)=>GC(b,w,S),getFileContents:(w,S)=>YC(b,w,S),getFileDownloadLink:w=>(function(S,y){let g=Ot(S.remoteURL,It(y));const v=/^https:/i.test(g)?"https":"http";switch(S.authType){case pn.None:break;case pn.Password:{const h=xy(S.headers.Authorization.replace(/^Basic /i,"").trim());g=g.replace(/^https?:\/\//,`${v}://${h}@`);break}default:throw new dn({info:{code:xr.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${S.authType}`)}return g})(b,w),getFileUploadLink:w=>(function(S,y){let g=`${Ot(S.remoteURL,It(y))}?Content-Type=application/octet-stream`;const v=/^https:/i.test(g)?"https":"http";switch(S.authType){case pn.None:break;case pn.Password:{const h=xy(S.headers.Authorization.replace(/^Basic /i,"").trim());g=g.replace(/^https?:\/\//,`${v}://${h}@`);break}default:throw new dn({info:{code:xr.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${S.authType}`)}return g})(b,w),getHeaders:()=>Object.assign({},b.headers),getQuota:w=>rk(b,w),lock:(w,S)=>tk(b,w,S),moveFile:(w,S,y)=>ok(b,w,S,y),putFileContents:(w,S,y)=>ak(b,w,S,y),partialUpdateFileContents:(w,S,y,g,v)=>uk(b,w,S,y,g,v),getDAVCompliance:w=>tv(b,w),search:(w,S)=>ik(b,w,S),setHeaders:w=>{b.headers=Object.assign({},w)},stat:(w,S)=>yf(b,w,S),unlock:(w,S,y)=>ek(b,w,S,y)}}Nn.hT,Nn.O4,Nn.Kd,Nn.YK,Nn.UU,Nn.Gu,Nn.ky,Nn.h4,Nn.ch,Nn.hq,Nn.i5;var xf={},Rf={},rv;function Cf(){return rv||(rv=1,(function(e){const t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n=t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",r="["+t+"]["+n+"]*",i=new RegExp("^"+r+"$"),o=function(a,l){const u=[];let c=l.exec(a);for(;c;){const p=[];p.startIndex=l.lastIndex-c[0].length;const d=c.length;for(let m=0;m<d;m++)p.push(c[m]);u.push(p),c=l.exec(a)}return u},s=function(a){const l=i.exec(a);return!(l===null||typeof l>"u")};e.isExist=function(a){return typeof a<"u"},e.isEmptyObject=function(a){return Object.keys(a).length===0},e.merge=function(a,l,u){if(l){const c=Object.keys(l),p=c.length;for(let d=0;d<p;d++)u==="strict"?a[c[d]]=[l[c[d]]]:a[c[d]]=l[c[d]]}},e.getValue=function(a){return e.isExist(a)?a:""},e.isName=s,e.getAllMatches=o,e.nameRegexp=r})(Rf)),Rf}var iv;function ov(){if(iv)return xf;iv=1;const e=Cf(),t={allowBooleanAttributes:!1,unpairedTags:[]};xf.validate=function(y,g){g=Object.assign({},t,g);const v=[];let h=!1,E=!1;y[0]==="\uFEFF"&&(y=y.substr(1));for(let T=0;T<y.length;T++)if(y[T]==="<"&&y[T+1]==="?"){if(T+=2,T=r(y,T),T.err)return T}else if(y[T]==="<"){let R=T;if(T++,y[T]==="!"){T=i(y,T);continue}else{let x=!1;y[T]==="/"&&(x=!0,T++);let A="";for(;T<y.length&&y[T]!==">"&&y[T]!==" "&&y[T]!==" "&&y[T]!==`
35
- `&&y[T]!=="\r";T++)A+=y[T];if(A=A.trim(),A[A.length-1]==="/"&&(A=A.substring(0,A.length-1),T--),!b(A)){let O;return A.trim().length===0?O="Invalid space after '<'.":O="Tag '"+A+"' is an invalid name.",d("InvalidTag",O,w(y,T))}const N=a(y,T);if(N===!1)return d("InvalidAttr","Attributes for '"+A+"' have open quote.",w(y,T));let W=N.value;if(T=N.index,W[W.length-1]==="/"){const O=T-W.length;W=W.substring(0,W.length-1);const D=u(W,g);if(D===!0)h=!0;else return d(D.err.code,D.err.msg,w(y,O+D.err.line))}else if(x)if(N.tagClosed){if(W.trim().length>0)return d("InvalidTag","Closing tag '"+A+"' can't have attributes or invalid starting.",w(y,R));if(v.length===0)return d("InvalidTag","Closing tag '"+A+"' has not been opened.",w(y,R));{const O=v.pop();if(A!==O.tagName){let D=w(y,O.tagStartPos);return d("InvalidTag","Expected closing tag '"+O.tagName+"' (opened in line "+D.line+", col "+D.col+") instead of closing tag '"+A+"'.",w(y,R))}v.length==0&&(E=!0)}}else return d("InvalidTag","Closing tag '"+A+"' doesn't have proper closing.",w(y,T));else{const O=u(W,g);if(O!==!0)return d(O.err.code,O.err.msg,w(y,T-W.length+O.err.line));if(E===!0)return d("InvalidXml","Multiple possible root nodes found.",w(y,T));g.unpairedTags.indexOf(A)!==-1||v.push({tagName:A,tagStartPos:R}),h=!0}for(T++;T<y.length;T++)if(y[T]==="<")if(y[T+1]==="!"){T++,T=i(y,T);continue}else if(y[T+1]==="?"){if(T=r(y,++T),T.err)return T}else break;else if(y[T]==="&"){const O=p(y,T);if(O==-1)return d("InvalidChar","char '&' is not expected.",w(y,T));T=O}else if(E===!0&&!n(y[T]))return d("InvalidXml","Extra text at the end",w(y,T));y[T]==="<"&&T--}}else{if(n(y[T]))continue;return d("InvalidChar","char '"+y[T]+"' is not expected.",w(y,T))}if(h){if(v.length==1)return d("InvalidTag","Unclosed tag '"+v[0].tagName+"'.",w(y,v[0].tagStartPos));if(v.length>0)return d("InvalidXml","Invalid '"+JSON.stringify(v.map(T=>T.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return d("InvalidXml","Start tag expected.",1);return!0};function n(y){return y===" "||y===" "||y===`
36
- `||y==="\r"}function r(y,g){const v=g;for(;g<y.length;g++)if(y[g]=="?"||y[g]==" "){const h=y.substr(v,g-v);if(g>5&&h==="xml")return d("InvalidXml","XML declaration allowed only at the start of the document.",w(y,g));if(y[g]=="?"&&y[g+1]==">"){g++;break}else continue}return g}function i(y,g){if(y.length>g+5&&y[g+1]==="-"&&y[g+2]==="-"){for(g+=3;g<y.length;g++)if(y[g]==="-"&&y[g+1]==="-"&&y[g+2]===">"){g+=2;break}}else if(y.length>g+8&&y[g+1]==="D"&&y[g+2]==="O"&&y[g+3]==="C"&&y[g+4]==="T"&&y[g+5]==="Y"&&y[g+6]==="P"&&y[g+7]==="E"){let v=1;for(g+=8;g<y.length;g++)if(y[g]==="<")v++;else if(y[g]===">"&&(v--,v===0))break}else if(y.length>g+9&&y[g+1]==="["&&y[g+2]==="C"&&y[g+3]==="D"&&y[g+4]==="A"&&y[g+5]==="T"&&y[g+6]==="A"&&y[g+7]==="["){for(g+=8;g<y.length;g++)if(y[g]==="]"&&y[g+1]==="]"&&y[g+2]===">"){g+=2;break}}return g}const o='"',s="'";function a(y,g){let v="",h="",E=!1;for(;g<y.length;g++){if(y[g]===o||y[g]===s)h===""?h=y[g]:h!==y[g]||(h="");else if(y[g]===">"&&h===""){E=!0;break}v+=y[g]}return h!==""?!1:{value:v,index:g,tagClosed:E}}const l=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function u(y,g){const v=e.getAllMatches(y,l),h={};for(let E=0;E<v.length;E++){if(v[E][1].length===0)return d("InvalidAttr","Attribute '"+v[E][2]+"' has no space in starting.",S(v[E]));if(v[E][3]!==void 0&&v[E][4]===void 0)return d("InvalidAttr","Attribute '"+v[E][2]+"' is without value.",S(v[E]));if(v[E][3]===void 0&&!g.allowBooleanAttributes)return d("InvalidAttr","boolean attribute '"+v[E][2]+"' is not allowed.",S(v[E]));const T=v[E][2];if(!m(T))return d("InvalidAttr","Attribute '"+T+"' is an invalid name.",S(v[E]));if(!h.hasOwnProperty(T))h[T]=1;else return d("InvalidAttr","Attribute '"+T+"' is repeated.",S(v[E]))}return!0}function c(y,g){let v=/\d/;for(y[g]==="x"&&(g++,v=/[\da-fA-F]/);g<y.length;g++){if(y[g]===";")return g;if(!y[g].match(v))break}return-1}function p(y,g){if(g++,y[g]===";")return-1;if(y[g]==="#")return g++,c(y,g);let v=0;for(;g<y.length;g++,v++)if(!(y[g].match(/\w/)&&v<20)){if(y[g]===";")break;return-1}return g}function d(y,g,v){return{err:{code:y,msg:g,line:v.line||v,col:v.col}}}function m(y){return e.isName(y)}function b(y){return e.isName(y)}function w(y,g){const v=y.substring(0,g).split(/\r?\n/);return{line:v.length,col:v[v.length-1].length+1}}function S(y){return y.startIndex+y[1].length}return xf}var ha={},sv;function pk(){if(sv)return ha;sv=1;const e={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(n,r){return r},attributeValueProcessor:function(n,r){return r},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,r,i){return n}},t=function(n){return Object.assign({},e,n)};return ha.buildOptions=t,ha.defaultOptions=e,ha}var kf,av;function hk(){if(av)return kf;av=1;class e{constructor(n){this.tagname=n,this.child=[],this[":@"]={}}add(n,r){n==="__proto__"&&(n="#__proto__"),this.child.push({[n]:r})}addChild(n){n.tagname==="__proto__"&&(n.tagname="#__proto__"),n[":@"]&&Object.keys(n[":@"]).length>0?this.child.push({[n.tagname]:n.child,":@":n[":@"]}):this.child.push({[n.tagname]:n.child})}}return kf=e,kf}var Pf,lv;function mk(){if(lv)return Pf;lv=1;const e=Cf();function t(u,c){const p={};if(u[c+3]==="O"&&u[c+4]==="C"&&u[c+5]==="T"&&u[c+6]==="Y"&&u[c+7]==="P"&&u[c+8]==="E"){c=c+9;let d=1,m=!1,b=!1,w="";for(;c<u.length;c++)if(u[c]==="<"&&!b){if(m&&i(u,c)){c+=7;let S,y;[S,y,c]=n(u,c+1),y.indexOf("&")===-1&&(p[l(S)]={regx:RegExp(`&${S};`,"g"),val:y})}else if(m&&o(u,c))c+=8;else if(m&&s(u,c))c+=8;else if(m&&a(u,c))c+=9;else if(r)b=!0;else throw new Error("Invalid DOCTYPE");d++,w=""}else if(u[c]===">"){if(b?u[c-1]==="-"&&u[c-2]==="-"&&(b=!1,d--):d--,d===0)break}else u[c]==="["?m=!0:w+=u[c];if(d!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:p,i:c}}function n(u,c){let p="";for(;c<u.length&&u[c]!=="'"&&u[c]!=='"';c++)p+=u[c];if(p=p.trim(),p.indexOf(" ")!==-1)throw new Error("External entites are not supported");const d=u[c++];let m="";for(;c<u.length&&u[c]!==d;c++)m+=u[c];return[p,m,c]}function r(u,c){return u[c+1]==="!"&&u[c+2]==="-"&&u[c+3]==="-"}function i(u,c){return u[c+1]==="!"&&u[c+2]==="E"&&u[c+3]==="N"&&u[c+4]==="T"&&u[c+5]==="I"&&u[c+6]==="T"&&u[c+7]==="Y"}function o(u,c){return u[c+1]==="!"&&u[c+2]==="E"&&u[c+3]==="L"&&u[c+4]==="E"&&u[c+5]==="M"&&u[c+6]==="E"&&u[c+7]==="N"&&u[c+8]==="T"}function s(u,c){return u[c+1]==="!"&&u[c+2]==="A"&&u[c+3]==="T"&&u[c+4]==="T"&&u[c+5]==="L"&&u[c+6]==="I"&&u[c+7]==="S"&&u[c+8]==="T"}function a(u,c){return u[c+1]==="!"&&u[c+2]==="N"&&u[c+3]==="O"&&u[c+4]==="T"&&u[c+5]==="A"&&u[c+6]==="T"&&u[c+7]==="I"&&u[c+8]==="O"&&u[c+9]==="N"}function l(u){if(e.isName(u))return u;throw new Error(`Invalid entity name ${u}`)}return Pf=t,Pf}var If,cv;function gk(){if(cv)return If;cv=1;const e=/^[-+]?0x[a-fA-F0-9]+$/,t=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,n={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function r(s,a={}){if(a=Object.assign({},n,a),!s||typeof s!="string")return s;let l=s.trim();if(a.skipLike!==void 0&&a.skipLike.test(l))return s;if(s==="0")return 0;if(a.hex&&e.test(l))return o(l,16);if(l.search(/[eE]/)!==-1){const u=l.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);if(u){if(a.leadingZeros)l=(u[1]||"")+u[3];else if(!(u[2]==="0"&&u[3][0]==="."))return s;return a.eNotation?Number(l):s}else return s}else{const u=t.exec(l);if(u){const c=u[1],p=u[2];let d=i(u[3]);if(!a.leadingZeros&&p.length>0&&c&&l[2]!==".")return s;if(!a.leadingZeros&&p.length>0&&!c&&l[1]!==".")return s;if(a.leadingZeros&&p===s)return 0;{const m=Number(l),b=""+m;return b.search(/[eE]/)!==-1?a.eNotation?m:s:l.indexOf(".")!==-1?b==="0"&&d===""||b===d||c&&b==="-"+d?m:s:p?d===b||c+d===b?m:s:l===b||l===c+b?m:s}}else return s}}function i(s){return s&&s.indexOf(".")!==-1&&(s=s.replace(/0+$/,""),s==="."?s="0":s[0]==="."?s="0"+s:s[s.length-1]==="."&&(s=s.substr(0,s.length-1))),s}function o(s,a){if(parseInt)return parseInt(s,a);if(Number.parseInt)return Number.parseInt(s,a);if(window&&window.parseInt)return window.parseInt(s,a);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}return If=r,If}var Of,uv;function fv(){if(uv)return Of;uv=1;function e(t){return typeof t=="function"?t:Array.isArray(t)?n=>{for(const r of t)if(typeof r=="string"&&n===r||r instanceof RegExp&&r.test(n))return!0}:()=>!1}return Of=e,Of}var Ff,dv;function yk(){if(dv)return Ff;dv=1;const e=Cf(),t=hk(),n=mk(),r=gk(),i=fv();class o{constructor(T){this.options=T,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(R,x)=>String.fromCharCode(Number.parseInt(x,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(R,x)=>String.fromCharCode(Number.parseInt(x,16))}},this.addExternalEntities=s,this.parseXml=p,this.parseTextData=a,this.resolveNameSpace=l,this.buildAttributesMap=c,this.isItStopNode=w,this.replaceEntitiesValue=m,this.readStopNodeData=v,this.saveTextToParentTag=b,this.addChild=d,this.ignoreAttributesFn=i(this.options.ignoreAttributes)}}function s(E){const T=Object.keys(E);for(let R=0;R<T.length;R++){const x=T[R];this.lastEntities[x]={regex:new RegExp("&"+x+";","g"),val:E[x]}}}function a(E,T,R,x,A,N,W){if(E!==void 0&&(this.options.trimValues&&!x&&(E=E.trim()),E.length>0)){W||(E=this.replaceEntitiesValue(E));const O=this.options.tagValueProcessor(T,E,R,A,N);return O==null?E:typeof O!=typeof E||O!==E?O:this.options.trimValues?h(E,this.options.parseTagValue,this.options.numberParseOptions):E.trim()===E?h(E,this.options.parseTagValue,this.options.numberParseOptions):E}}function l(E){if(this.options.removeNSPrefix){const T=E.split(":"),R=E.charAt(0)==="/"?"/":"";if(T[0]==="xmlns")return"";T.length===2&&(E=R+T[1])}return E}const u=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function c(E,T,R){if(this.options.ignoreAttributes!==!0&&typeof E=="string"){const x=e.getAllMatches(E,u),A=x.length,N={};for(let W=0;W<A;W++){const O=this.resolveNameSpace(x[W][1]);if(this.ignoreAttributesFn(O,T))continue;let D=x[W][4],V=this.options.attributeNamePrefix+O;if(O.length)if(this.options.transformAttributeName&&(V=this.options.transformAttributeName(V)),V==="__proto__"&&(V="#__proto__"),D!==void 0){this.options.trimValues&&(D=D.trim()),D=this.replaceEntitiesValue(D);const L=this.options.attributeValueProcessor(O,D,T);L==null?N[V]=D:typeof L!=typeof D||L!==D?N[V]=L:N[V]=h(D,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(N[V]=!0)}if(!Object.keys(N).length)return;if(this.options.attributesGroupName){const W={};return W[this.options.attributesGroupName]=N,W}return N}}const p=function(E){E=E.replace(/\r\n?/g,`
37
- `);const T=new t("!xml");let R=T,x="",A="";for(let N=0;N<E.length;N++)if(E[N]==="<")if(E[N+1]==="/"){const O=y(E,">",N,"Closing Tag is not closed.");let D=E.substring(N+2,O).trim();if(this.options.removeNSPrefix){const te=D.indexOf(":");te!==-1&&(D=D.substr(te+1))}this.options.transformTagName&&(D=this.options.transformTagName(D)),R&&(x=this.saveTextToParentTag(x,R,A));const V=A.substring(A.lastIndexOf(".")+1);if(D&&this.options.unpairedTags.indexOf(D)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${D}>`);let L=0;V&&this.options.unpairedTags.indexOf(V)!==-1?(L=A.lastIndexOf(".",A.lastIndexOf(".")-1),this.tagsNodeStack.pop()):L=A.lastIndexOf("."),A=A.substring(0,L),R=this.tagsNodeStack.pop(),x="",N=O}else if(E[N+1]==="?"){let O=g(E,N,!1,"?>");if(!O)throw new Error("Pi Tag is not closed.");if(x=this.saveTextToParentTag(x,R,A),!(this.options.ignoreDeclaration&&O.tagName==="?xml"||this.options.ignorePiTags)){const D=new t(O.tagName);D.add(this.options.textNodeName,""),O.tagName!==O.tagExp&&O.attrExpPresent&&(D[":@"]=this.buildAttributesMap(O.tagExp,A,O.tagName)),this.addChild(R,D,A)}N=O.closeIndex+1}else if(E.substr(N+1,3)==="!--"){const O=y(E,"-->",N+4,"Comment is not closed.");if(this.options.commentPropName){const D=E.substring(N+4,O-2);x=this.saveTextToParentTag(x,R,A),R.add(this.options.commentPropName,[{[this.options.textNodeName]:D}])}N=O}else if(E.substr(N+1,2)==="!D"){const O=n(E,N);this.docTypeEntities=O.entities,N=O.i}else if(E.substr(N+1,2)==="!["){const O=y(E,"]]>",N,"CDATA is not closed.")-2,D=E.substring(N+9,O);x=this.saveTextToParentTag(x,R,A);let V=this.parseTextData(D,R.tagname,A,!0,!1,!0,!0);V==null&&(V=""),this.options.cdataPropName?R.add(this.options.cdataPropName,[{[this.options.textNodeName]:D}]):R.add(this.options.textNodeName,V),N=O+2}else{let O=g(E,N,this.options.removeNSPrefix),D=O.tagName;const V=O.rawTagName;let L=O.tagExp,te=O.attrExpPresent,Y=O.closeIndex;this.options.transformTagName&&(D=this.options.transformTagName(D)),R&&x&&R.tagname!=="!xml"&&(x=this.saveTextToParentTag(x,R,A,!1));const se=R;if(se&&this.options.unpairedTags.indexOf(se.tagname)!==-1&&(R=this.tagsNodeStack.pop(),A=A.substring(0,A.lastIndexOf("."))),D!==T.tagname&&(A+=A?"."+D:D),this.isItStopNode(this.options.stopNodes,A,D)){let he="";if(L.length>0&&L.lastIndexOf("/")===L.length-1)D[D.length-1]==="/"?(D=D.substr(0,D.length-1),A=A.substr(0,A.length-1),L=D):L=L.substr(0,L.length-1),N=O.closeIndex;else if(this.options.unpairedTags.indexOf(D)!==-1)N=O.closeIndex;else{const we=this.readStopNodeData(E,V,Y+1);if(!we)throw new Error(`Unexpected end of ${V}`);N=we.i,he=we.tagContent}const ae=new t(D);D!==L&&te&&(ae[":@"]=this.buildAttributesMap(L,A,D)),he&&(he=this.parseTextData(he,D,A,!0,te,!0,!0)),A=A.substr(0,A.lastIndexOf(".")),ae.add(this.options.textNodeName,he),this.addChild(R,ae,A)}else{if(L.length>0&&L.lastIndexOf("/")===L.length-1){D[D.length-1]==="/"?(D=D.substr(0,D.length-1),A=A.substr(0,A.length-1),L=D):L=L.substr(0,L.length-1),this.options.transformTagName&&(D=this.options.transformTagName(D));const he=new t(D);D!==L&&te&&(he[":@"]=this.buildAttributesMap(L,A,D)),this.addChild(R,he,A),A=A.substr(0,A.lastIndexOf("."))}else{const he=new t(D);this.tagsNodeStack.push(R),D!==L&&te&&(he[":@"]=this.buildAttributesMap(L,A,D)),this.addChild(R,he,A),R=he}x="",N=Y}}else x+=E[N];return T.child};function d(E,T,R){const x=this.options.updateTag(T.tagname,R,T[":@"]);x===!1||(typeof x=="string"&&(T.tagname=x),E.addChild(T))}const m=function(E){if(this.options.processEntities){for(let T in this.docTypeEntities){const R=this.docTypeEntities[T];E=E.replace(R.regx,R.val)}for(let T in this.lastEntities){const R=this.lastEntities[T];E=E.replace(R.regex,R.val)}if(this.options.htmlEntities)for(let T in this.htmlEntities){const R=this.htmlEntities[T];E=E.replace(R.regex,R.val)}E=E.replace(this.ampEntity.regex,this.ampEntity.val)}return E};function b(E,T,R,x){return E&&(x===void 0&&(x=T.child.length===0),E=this.parseTextData(E,T.tagname,R,!1,T[":@"]?Object.keys(T[":@"]).length!==0:!1,x),E!==void 0&&E!==""&&T.add(this.options.textNodeName,E),E=""),E}function w(E,T,R){const x="*."+R;for(const A in E){const N=E[A];if(x===N||T===N)return!0}return!1}function S(E,T,R=">"){let x,A="";for(let N=T;N<E.length;N++){let W=E[N];if(x)W===x&&(x="");else if(W==='"'||W==="'")x=W;else if(W===R[0])if(R[1]){if(E[N+1]===R[1])return{data:A,index:N}}else return{data:A,index:N};else W===" "&&(W=" ");A+=W}}function y(E,T,R,x){const A=E.indexOf(T,R);if(A===-1)throw new Error(x);return A+T.length-1}function g(E,T,R,x=">"){const A=S(E,T+1,x);if(!A)return;let N=A.data;const W=A.index,O=N.search(/\s/);let D=N,V=!0;O!==-1&&(D=N.substring(0,O),N=N.substring(O+1).trimStart());const L=D;if(R){const te=D.indexOf(":");te!==-1&&(D=D.substr(te+1),V=D!==A.data.substr(te+1))}return{tagName:D,tagExp:N,closeIndex:W,attrExpPresent:V,rawTagName:L}}function v(E,T,R){const x=R;let A=1;for(;R<E.length;R++)if(E[R]==="<")if(E[R+1]==="/"){const N=y(E,">",R,`${T} is not closed`);if(E.substring(R+2,N).trim()===T&&(A--,A===0))return{tagContent:E.substring(x,R),i:N};R=N}else if(E[R+1]==="?")R=y(E,"?>",R+1,"StopNode is not closed.");else if(E.substr(R+1,3)==="!--")R=y(E,"-->",R+3,"StopNode is not closed.");else if(E.substr(R+1,2)==="![")R=y(E,"]]>",R,"StopNode is not closed.")-2;else{const N=g(E,R,">");N&&((N&&N.tagName)===T&&N.tagExp[N.tagExp.length-1]!=="/"&&A++,R=N.closeIndex)}}function h(E,T,R){if(T&&typeof E=="string"){const x=E.trim();return x==="true"?!0:x==="false"?!1:r(E,R)}else return e.isExist(E)?E:""}return Ff=o,Ff}var _f={},pv;function vk(){if(pv)return _f;pv=1;function e(o,s){return t(o,s)}function t(o,s,a){let l;const u={};for(let c=0;c<o.length;c++){const p=o[c],d=n(p);let m="";if(a===void 0?m=d:m=a+"."+d,d===s.textNodeName)l===void 0?l=p[d]:l+=""+p[d];else{if(d===void 0)continue;if(p[d]){let b=t(p[d],s,m);const w=i(b,s);p[":@"]?r(b,p[":@"],m,s):Object.keys(b).length===1&&b[s.textNodeName]!==void 0&&!s.alwaysCreateTextNode?b=b[s.textNodeName]:Object.keys(b).length===0&&(s.alwaysCreateTextNode?b[s.textNodeName]="":b=""),u[d]!==void 0&&u.hasOwnProperty(d)?(Array.isArray(u[d])||(u[d]=[u[d]]),u[d].push(b)):s.isArray(d,m,w)?u[d]=[b]:u[d]=b}}}return typeof l=="string"?l.length>0&&(u[s.textNodeName]=l):l!==void 0&&(u[s.textNodeName]=l),u}function n(o){const s=Object.keys(o);for(let a=0;a<s.length;a++){const l=s[a];if(l!==":@")return l}}function r(o,s,a,l){if(s){const u=Object.keys(s),c=u.length;for(let p=0;p<c;p++){const d=u[p];l.isArray(d,a+"."+d,!0,!0)?o[d]=[s[d]]:o[d]=s[d]}}}function i(o,s){const{textNodeName:a}=s,l=Object.keys(o).length;return!!(l===0||l===1&&(o[a]||typeof o[a]=="boolean"||o[a]===0))}return _f.prettify=e,_f}var Df,hv;function bk(){if(hv)return Df;hv=1;const{buildOptions:e}=pk(),t=yk(),{prettify:n}=vk(),r=ov();class i{constructor(s){this.externalEntities={},this.options=e(s)}parse(s,a){if(typeof s!="string")if(s.toString)s=s.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(a){a===!0&&(a={});const c=r.validate(s,a);if(c!==!0)throw Error(`${c.err.msg}:${c.err.line}:${c.err.col}`)}const l=new t(this.options);l.addExternalEntities(this.externalEntities);const u=l.parseXml(s);return this.options.preserveOrder||u===void 0?u:n(u,this.options)}addEntity(s,a){if(a.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(s.indexOf("&")!==-1||s.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(a==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[s]=a}}return Df=i,Df}var Nf,mv;function wk(){if(mv)return Nf;mv=1;const e=`
38
- `;function t(a,l){let u="";return l.format&&l.indentBy.length>0&&(u=e),n(a,l,"",u)}function n(a,l,u,c){let p="",d=!1;for(let m=0;m<a.length;m++){const b=a[m],w=r(b);if(w===void 0)continue;let S="";if(u.length===0?S=w:S=`${u}.${w}`,w===l.textNodeName){let E=b[w];o(S,l)||(E=l.tagValueProcessor(w,E),E=s(E,l)),d&&(p+=c),p+=E,d=!1;continue}else if(w===l.cdataPropName){d&&(p+=c),p+=`<![CDATA[${b[w][0][l.textNodeName]}]]>`,d=!1;continue}else if(w===l.commentPropName){p+=c+`<!--${b[w][0][l.textNodeName]}-->`,d=!0;continue}else if(w[0]==="?"){const E=i(b[":@"],l),T=w==="?xml"?"":c;let R=b[w][0][l.textNodeName];R=R.length!==0?" "+R:"",p+=T+`<${w}${R}${E}?>`,d=!0;continue}let y=c;y!==""&&(y+=l.indentBy);const g=i(b[":@"],l),v=c+`<${w}${g}`,h=n(b[w],l,S,y);l.unpairedTags.indexOf(w)!==-1?l.suppressUnpairedNode?p+=v+">":p+=v+"/>":(!h||h.length===0)&&l.suppressEmptyNode?p+=v+"/>":h&&h.endsWith(">")?p+=v+`>${h}${c}</${w}>`:(p+=v+">",h&&c!==""&&(h.includes("/>")||h.includes("</"))?p+=c+l.indentBy+h+c:p+=h,p+=`</${w}>`),d=!0}return p}function r(a){const l=Object.keys(a);for(let u=0;u<l.length;u++){const c=l[u];if(a.hasOwnProperty(c)&&c!==":@")return c}}function i(a,l){let u="";if(a&&!l.ignoreAttributes)for(let c in a){if(!a.hasOwnProperty(c))continue;let p=l.attributeValueProcessor(c,a[c]);p=s(p,l),p===!0&&l.suppressBooleanAttributes?u+=` ${c.substr(l.attributeNamePrefix.length)}`:u+=` ${c.substr(l.attributeNamePrefix.length)}="${p}"`}return u}function o(a,l){a=a.substr(0,a.length-l.textNodeName.length-1);let u=a.substr(a.lastIndexOf(".")+1);for(let c in l.stopNodes)if(l.stopNodes[c]===a||l.stopNodes[c]==="*."+u)return!0;return!1}function s(a,l){if(a&&a.length>0&&l.processEntities)for(let u=0;u<l.entities.length;u++){const c=l.entities[u];a=a.replace(c.regex,c.val)}return a}return Nf=t,Nf}var Lf,gv;function Sk(){if(gv)return Lf;gv=1;const e=wk(),t=fv(),n={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(a,l){return l},attributeValueProcessor:function(a,l){return l},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function r(a){this.options=Object.assign({},n,a),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=t(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=s),this.processTextOrObjNode=i,this.options.format?(this.indentate=o,this.tagEndChar=`>
39
- `,this.newLine=`
40
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}r.prototype.build=function(a){return this.options.preserveOrder?e(a,this.options):(Array.isArray(a)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(a={[this.options.arrayNodeName]:a}),this.j2x(a,0,[]).val)},r.prototype.j2x=function(a,l,u){let c="",p="";const d=u.join(".");for(let m in a)if(Object.prototype.hasOwnProperty.call(a,m))if(typeof a[m]>"u")this.isAttribute(m)&&(p+="");else if(a[m]===null)this.isAttribute(m)||m===this.options.cdataPropName?p+="":m[0]==="?"?p+=this.indentate(l)+"<"+m+"?"+this.tagEndChar:p+=this.indentate(l)+"<"+m+"/"+this.tagEndChar;else if(a[m]instanceof Date)p+=this.buildTextValNode(a[m],m,"",l);else if(typeof a[m]!="object"){const b=this.isAttribute(m);if(b&&!this.ignoreAttributesFn(b,d))c+=this.buildAttrPairStr(b,""+a[m]);else if(!b)if(m===this.options.textNodeName){let w=this.options.tagValueProcessor(m,""+a[m]);p+=this.replaceEntitiesValue(w)}else p+=this.buildTextValNode(a[m],m,"",l)}else if(Array.isArray(a[m])){const b=a[m].length;let w="",S="";for(let y=0;y<b;y++){const g=a[m][y];if(!(typeof g>"u"))if(g===null)m[0]==="?"?p+=this.indentate(l)+"<"+m+"?"+this.tagEndChar:p+=this.indentate(l)+"<"+m+"/"+this.tagEndChar;else if(typeof g=="object")if(this.options.oneListGroup){const v=this.j2x(g,l+1,u.concat(m));w+=v.val,this.options.attributesGroupName&&g.hasOwnProperty(this.options.attributesGroupName)&&(S+=v.attrStr)}else w+=this.processTextOrObjNode(g,m,l,u);else if(this.options.oneListGroup){let v=this.options.tagValueProcessor(m,g);v=this.replaceEntitiesValue(v),w+=v}else w+=this.buildTextValNode(g,m,"",l)}this.options.oneListGroup&&(w=this.buildObjectNode(w,m,S,l)),p+=w}else if(this.options.attributesGroupName&&m===this.options.attributesGroupName){const b=Object.keys(a[m]),w=b.length;for(let S=0;S<w;S++)c+=this.buildAttrPairStr(b[S],""+a[m][b[S]])}else p+=this.processTextOrObjNode(a[m],m,l,u);return{attrStr:c,val:p}},r.prototype.buildAttrPairStr=function(a,l){return l=this.options.attributeValueProcessor(a,""+l),l=this.replaceEntitiesValue(l),this.options.suppressBooleanAttributes&&l==="true"?" "+a:" "+a+'="'+l+'"'};function i(a,l,u,c){const p=this.j2x(a,u+1,c.concat(l));return a[this.options.textNodeName]!==void 0&&Object.keys(a).length===1?this.buildTextValNode(a[this.options.textNodeName],l,p.attrStr,u):this.buildObjectNode(p.val,l,p.attrStr,u)}r.prototype.buildObjectNode=function(a,l,u,c){if(a==="")return l[0]==="?"?this.indentate(c)+"<"+l+u+"?"+this.tagEndChar:this.indentate(c)+"<"+l+u+this.closeTag(l)+this.tagEndChar;{let p="</"+l+this.tagEndChar,d="";return l[0]==="?"&&(d="?",p=""),(u||u==="")&&a.indexOf("<")===-1?this.indentate(c)+"<"+l+u+d+">"+a+p:this.options.commentPropName!==!1&&l===this.options.commentPropName&&d.length===0?this.indentate(c)+`<!--${a}-->`+this.newLine:this.indentate(c)+"<"+l+u+d+this.tagEndChar+a+this.indentate(c)+p}},r.prototype.closeTag=function(a){let l="";return this.options.unpairedTags.indexOf(a)!==-1?this.options.suppressUnpairedNode||(l="/"):this.options.suppressEmptyNode?l="/":l=`></${a}`,l},r.prototype.buildTextValNode=function(a,l,u,c){if(this.options.cdataPropName!==!1&&l===this.options.cdataPropName)return this.indentate(c)+`<![CDATA[${a}]]>`+this.newLine;if(this.options.commentPropName!==!1&&l===this.options.commentPropName)return this.indentate(c)+`<!--${a}-->`+this.newLine;if(l[0]==="?")return this.indentate(c)+"<"+l+u+"?"+this.tagEndChar;{let p=this.options.tagValueProcessor(l,a);return p=this.replaceEntitiesValue(p),p===""?this.indentate(c)+"<"+l+u+this.closeTag(l)+this.tagEndChar:this.indentate(c)+"<"+l+u+">"+p+"</"+l+this.tagEndChar}},r.prototype.replaceEntitiesValue=function(a){if(a&&a.length>0&&this.options.processEntities)for(let l=0;l<this.options.entities.length;l++){const u=this.options.entities[l];a=a.replace(u.regex,u.val)}return a};function o(a){return this.options.indentBy.repeat(a)}function s(a){return a.startsWith(this.options.attributeNamePrefix)&&a!==this.options.textNodeName?a.substr(this.attrPrefixLen):!1}return Lf=r,Lf}var $f,yv;function Ek(){if(yv)return $f;yv=1;const e=ov(),t=bk(),n=Sk();return $f={XMLParser:t,XMLValidator:e,XMLBuilder:n},$f}Ek();class vv{isEnabled(){return!0}isActive(t){return xt(t,"files-spaces-projects")?!1:xt(t,"files-spaces-generic")||_n(t,"files-public-link")}getTask(t){const{router:n,clientService:r,resourcesStore:i,authService:o,spacesStore:s,sharesStore:a,configStore:l}=t,{webdav:u,graphAuthenticated:c}=r,{replaceInvalidFileRoute:p}=Ta({router:n});return rn.useTask(function*(d,m,b,w=null,S=null,y={}){try{i.clearResourceList();const g=ko.Default;re.isPublicSpaceResource(b)&&g.push(Ve.DownloadURL);let{resource:v,children:h}=yield*re.call(u.listFiles(b,{path:w,fileId:S},{signal:d,davProperties:g}));v.id&&p({space:b,resource:v,path:w,fileId:S});let E;w==="/"&&(re.isShareSpaceResource(b)?(E=yield*re.call(Ks({graphClient:c,spacesStore:s,space:b,signal:d})),E&&(v=re.buildIncomingShareResource({graphRoles:a.graphRoles,driveItem:E,serverUrl:l.serverUrl}))):!re.isPersonalSpaceResource(b)&&!re.isPublicSpaceResource(b)&&(v=b)),yield i.loadAncestorMetaData({folder:v,space:b,client:u,signal:d}),re.isProjectSpaceResource(b)&&(yield s.loadGraphPermissions({ids:[b.id],graphClient:c})),re.isShareSpaceResource(b)&&(h.forEach(T=>T.remoteItemId=b.id),b.graphPermissions===void 0&&(E||(E=yield*re.call(Ks({graphClient:c,spacesStore:s,space:b,signal:d}))),cm({sharesStore:a,spacesStore:s,space:b,sharedDriveItem:E}))),i.initResourceList({currentFolder:v,resources:h})}catch(g){if(i.setCurrentFolder(null),console.error(g),g.statusCode===401)return o.handleAuthError(f(n.currentRoute))}}).restartable()}}class bv{isEnabled(){return!0}isActive(t){const n=f(t.currentRoute);return Vt(t,"files-common-favorites")||n?.query?.contextRouteName==="files-common-favorites"}getTask(t){const{resourcesStore:n,clientService:r,userStore:i}=t;return rn.useTask(function*(o,s){n.clearResourceList(),n.setAncestorMetaData({});let a=yield r.webdav.listFavoriteFiles({username:i.user?.onPremisesSamAccountName,signal:o});a=a.map(re.buildResource),n.initResourceList({currentFolder:null,resources:a})})}}class wv{isEnabled(){return!0}isActive(t){const n=f(t.currentRoute);return Mt(t,"files-shares-via-link")||n?.query?.contextRouteName==="files-shares-via-link"}getTask(t){const{userStore:n,spacesStore:r,clientService:i,configStore:o,resourcesStore:s}=t;return rn.useTask(function*(a,l){s.clearResourceList(),s.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:i.graphAuthenticated,signal:a}));const c=(yield*re.call(i.graphAuthenticated.driveItems.listSharedByMe({expand:new Set(["thumbnails"])},{signal:a}))).filter(p=>p.permissions.some(({link:d})=>!!d)).map(p=>re.buildOutgoingShareResource({driveItem:p,user:n.user,serverUrl:o.serverUrl}));s.initResourceList({currentFolder:null,resources:c})})}}class Sv{isEnabled(){return!0}isActive(t){const n=f(t.currentRoute);return Mt(t,"files-shares-with-me")||n?.query?.contextRouteName==="files-shares-with-me"}getTask(t){const{spacesStore:n,clientService:r,configStore:i,resourcesStore:o,sharesStore:s}=t;return rn.useTask(function*(a,l){o.clearResourceList(),o.setAncestorMetaData({}),i.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:r.graphAuthenticated,signal:a}));const c=(yield*re.call(r.graphAuthenticated.driveItems.listSharedWithMe({expand:new Set(["thumbnails"])},{signal:a}))).map(p=>re.buildIncomingShareResource({driveItem:p,graphRoles:s.graphRoles,serverUrl:i.serverUrl}));o.initResourceList({currentFolder:null,resources:c})})}}class Ev{isEnabled(){return!0}isActive(t){const n=f(t.currentRoute);return Mt(t,"files-shares-with-others")||n?.query?.contextRouteName==="files-shares-with-others"}getTask(t){const{userStore:n,spacesStore:r,clientService:i,configStore:o,resourcesStore:s}=t;return rn.useTask(function*(a,l){s.clearResourceList(),s.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:i.graphAuthenticated,signal:a}));const c=(yield*re.call(i.graphAuthenticated.driveItems.listSharedByMe({expand:new Set(["thumbnails"])},{signal:a}))).filter(p=>p.permissions.some(({link:d})=>!d)).map(p=>re.buildOutgoingShareResource({driveItem:p,user:n.user,serverUrl:o.serverUrl}));s.initResourceList({currentFolder:null,resources:c})})}}class Tv{isEnabled(){return!0}isActive(t){return yn(t,"files-trash-generic")}getTask(t){const{resourcesStore:n,spacesStore:r,clientService:{webdav:i,graphAuthenticated:o}}=t;return rn.useTask(function*(s,a,l){n.clearResourceList(),n.setAncestorMetaData({});const{resource:u,children:c}=yield i.listFiles(l,{},{depth:1,davProperties:ko.Trashbin,isTrash:!0,signal:s});re.isProjectSpaceResource(l)&&(yield r.loadGraphPermissions({ids:[l.id],graphClient:o})),n.initResourceList({currentFolder:u,resources:c})})}}class Av{loaders;constructor(){this.loaders=[new vv,new bv,new wv,new Sv,new Ev,new Tv]}getTask(){const t=vt(),n=at(),r=en(),i=He(),o=Ke(),s=dt(),a=ze(),l=Cr(),u=Jf(),c=this.loaders.find(p=>p.isEnabled()&&p.isActive(f(i)));if(!c){console.debug("No folder loader found for route");return}return rn.useTask(function*(...p){const d={clientService:o,configStore:s,userStore:t,spacesStore:n,capabilityStore:r,resourcesStore:a,sharesStore:l,router:i,authService:u};try{yield c.getTask(d).perform(...p)}catch(m){console.error(m)}})}}const xv=new Av;var Gr=(e=>(e.add="loading-service.add",e.remove="loading-service.remove",e.setProgress="loading-service.set-progress",e))(Gr||{});const Tk=200;class Ak{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,i)=>(r+=i.state.current/i.state.total,r),0);return Math.round(n/t.length*100)}addTask(t,{debounceTime:n=Tk,indeterminate:r=!0}={}){const i={id:Xt.v4(),active:!1,...!r&&{state:{total:0,current:0}}};return this.tasks.length||window.addEventListener("beforeunload",this.onBeforeUnload),this.tasks.push(i),Tt.debounce(()=>{i.active=!0,Je.publish("loading-service.add")},n)(),t({setProgress:({total:a,current:l})=>{r||this.setProgress({task:i,total:a,current:l})}}).finally(()=>{this.removeTask(i.id)})}removeTask(t){this.tasks=this.tasks.filter(n=>n.id!==t),this.tasks.length||window.removeEventListener("beforeunload",this.onBeforeUnload),Je.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,Je.publish("loading-service.set-progress")}onBeforeUnload(t){t.preventDefault()}}var xk="__lodash_hash_undefined__";function Rk(e){return this.__data__.set(e,xk),this}function Ck(e){return this.__data__.has(e)}function ma(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Tr;++t<n;)this.add(e[t])}ma.prototype.add=ma.prototype.push=Rk,ma.prototype.has=Ck;function kk(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 Pk(e,t){return e.has(t)}var Ik=1,Ok=2;function Rv(e,t,n,r,i,o){var s=n&Ik,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var p=-1,d=!0,m=n&Ok?new ma:void 0;for(o.set(e,t),o.set(t,e);++p<a;){var b=e[p],w=t[p];if(r)var S=s?r(w,b,p,t,e,o):r(b,w,p,e,t,o);if(S!==void 0){if(S)continue;d=!1;break}if(m){if(!kk(t,function(y,g){if(!Pk(m,g)&&(b===y||i(b,y,n,r,o)))return m.push(g)})){d=!1;break}}else if(!(b===w||i(b,w,n,r,o))){d=!1;break}}return o.delete(e),o.delete(t),d}function Fk(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function _k(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Dk=1,Nk=2,Lk="[object Boolean]",$k="[object Date]",Mk="[object Error]",Bk="[object Map]",jk="[object Number]",Uk="[object RegExp]",Vk="[object Set]",qk="[object String]",zk="[object Symbol]",Wk="[object ArrayBuffer]",Hk="[object DataView]",Cv=On?On.prototype:void 0,Mf=Cv?Cv.valueOf:void 0;function Kk(e,t,n,r,i,o,s){switch(n){case Hk:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Wk:return!(e.byteLength!=t.byteLength||!o(new qs(e),new qs(t)));case Lk:case $k:case jk:return So(+e,+t);case Mk:return e.name==t.name&&e.message==t.message;case Uk:case qk:return e==t+"";case Bk:var a=Fk;case Vk:var l=r&Dk;if(a||(a=_k),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;r|=Nk,s.set(e,t);var c=Rv(a(e),a(t),r,i,o,s);return s.delete(e),c;case zk:if(Mf)return Mf.call(e)==Mf.call(t)}return!1}function Bf(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function kv(e,t,n){var r=t(e);return Hn(e)?r:Bf(r,n(e))}function Gk(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function Pv(){return[]}var Qk=Object.prototype,Xk=Qk.propertyIsEnumerable,Iv=Object.getOwnPropertySymbols,Ov=Iv?function(e){return e==null?[]:(e=Object(e),Gk(Iv(e),function(t){return Xk.call(e,t)}))}:Pv,Yk=Lh(Object.keys,Object),Jk=Object.prototype,Zk=Jk.hasOwnProperty;function eP(e){if(!Ql(e))return Yk(e);var t=[];for(var n in Object(e))Zk.call(e,n)&&n!="constructor"&&t.push(n);return t}function tP(e){return Ws(e)?Qh(e):eP(e)}function Fv(e){return kv(e,tP,Ov)}var nP=1,rP=Object.prototype,iP=rP.hasOwnProperty;function oP(e,t,n,r,i,o){var s=n&nP,a=Fv(e),l=a.length,u=Fv(t),c=u.length;if(l!=c&&!s)return!1;for(var p=l;p--;){var d=a[p];if(!(s?d in t:iP.call(t,d)))return!1}var m=o.get(e),b=o.get(t);if(m&&b)return m==t&&b==e;var w=!0;o.set(e,t),o.set(t,e);for(var S=s;++p<l;){d=a[p];var y=e[d],g=t[d];if(r)var v=s?r(g,y,d,t,e,o):r(y,g,d,e,t,o);if(!(v===void 0?y===g||i(y,g,n,r,o):v)){w=!1;break}S||(S=d=="constructor")}if(w&&!S){var h=e.constructor,E=t.constructor;h!=E&&"constructor"in e&&"constructor"in t&&!(typeof h=="function"&&h instanceof h&&typeof E=="function"&&E instanceof E)&&(w=!1)}return o.delete(e),o.delete(t),w}var jf=si(nr,"DataView"),Uf=si(nr,"Promise"),Vf=si(nr,"Set"),qf=si(nr,"WeakMap"),_v="[object Map]",sP="[object Object]",Dv="[object Promise]",Nv="[object Set]",Lv="[object WeakMap]",$v="[object DataView]",aP=oi(jf),lP=oi(To),cP=oi(Uf),uP=oi(Vf),fP=oi(qf),Gn=ii;(jf&&Gn(new jf(new ArrayBuffer(1)))!=$v||To&&Gn(new To)!=_v||Uf&&Gn(Uf.resolve())!=Dv||Vf&&Gn(new Vf)!=Nv||qf&&Gn(new qf)!=Lv)&&(Gn=function(e){var t=ii(e),n=t==sP?e.constructor:void 0,r=n?oi(n):"";if(r)switch(r){case aP:return $v;case lP:return _v;case cP:return Dv;case uP:return Nv;case fP:return Lv}return t});var dP=1,Mv="[object Arguments]",Bv="[object Array]",ga="[object Object]",pP=Object.prototype,jv=pP.hasOwnProperty;function hP(e,t,n,r,i,o){var s=Hn(e),a=Hn(t),l=s?Bv:Gn(e),u=a?Bv:Gn(t);l=l==Mv?ga:l,u=u==Mv?ga:u;var c=l==ga,p=u==ga,d=l==u;if(d&&xo(e)){if(!xo(t))return!1;s=!0,c=!1}if(d&&!c)return o||(o=new ir),s||Zl(e)?Rv(e,t,n,r,i,o):Kk(e,t,l,n,r,i,o);if(!(n&dP)){var m=c&&jv.call(e,"__wrapped__"),b=p&&jv.call(t,"__wrapped__");if(m||b){var w=m?e.value():e,S=b?t.value():t;return o||(o=new ir),i(w,S,n,r,o)}}return d?(o||(o=new ir),oP(e,t,n,r,i,o)):!1}function Uv(e,t,n,r,i){return e===t?!0:e==null||t==null||!or(e)&&!or(t)?e!==e&&t!==t:hP(e,t,n,r,Uv,i)}function Vv(e,t){return Uv(e,t)}class mP{clientService;configStore;userStore;authStore;constructor({clientService:t,userStore:n,authStore:r,configStore:i}){this.clientService=t,this.userStore=n,this.authStore=r,this.configStore=i}get user(){return this.userStore.user}async loadPreview(t,n=!1,r=!0,i){const{space:o,resource:s}=t;if(!s.canDownload()||!s.hasPreview?.())return;const a=re.isPublicSpaceResource(o);if(!(!a&&(!this.configStore.serverUrl||!this.user.onPremisesSamAccountName||!this.authStore.accessToken))){if(a)return this.publicPreviewUrl(t,i);try{return await this.privatePreviewBlob(t,n,r,i)}catch(l){if(r)return;throw l}}}async cacheFactory(t,n,r){const{resource:i,dimensions:o}=t,s=mc.filePreview.get(i.id.toString());if(s&&s.etag===i.etag&&Vv(o,s.dimensions))return s.src;try{const a=await this.privatePreviewBlob(t,!1,!0,r);return mc.filePreview.set(i.id.toString(),{src:a,etag:i.etag,dimensions:o},0).src}catch(a){if(n)return;throw a}}buildQueryString(t){return TS.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,i){const{resource:o,dimensions:s,processor:a}=t;if(n)return this.cacheFactory(t,r,i);const l=[this.configStore.serverUrl,"remote.php/dav",dc(o.webDavPath),"?",this.buildQueryString({etag:o.etag,dimensions:s,processor:a})].join("");try{const{data:u}=await this.clientService.httpAuthenticated.get(l,{responseType:"blob",signal:i});return window.URL.createObjectURL(u)}catch(u){if([425,429].includes(u.status)){const c=u.response?.headers?.["retry-after"]||5;return await new Promise(p=>setTimeout(p,c*1e3)),this.privatePreviewBlob(t,n,r,i)}throw u}}async publicPreviewUrl(t,n){const{space:r,resource:i,dimensions:o,processor:s}=t;let{downloadURL:a}=i;if(!a){const{downloadURL:d}=await this.clientService.webdav.getFileInfo(r,i,{davProperties:[Ve.DownloadURL]});a=d}const[l,u]=a.split("?"),c=[this.buildQueryString({etag:i.etag,dimensions:o,processor:s}),u].filter(Boolean).join("&"),p=[l,c].filter(Boolean).join("?");try{const{status:d}=await this.clientService.httpUnAuthenticated.head(p,{signal:n});if(d!==404)return p}catch(d){if([425,429].includes(d.status)){const m=d.response?.headers?.["retry-after"]||5;return await new Promise(b=>setTimeout(b,m*1e3)),this.publicPreviewUrl(t,n)}throw d}}}const ya=de.z.enum(["fit","resize","fill","thumbnail"]);class gP{$gettext;constructor({$gettext:t}){this.$gettext=t}explain(t,n){return{code:"mustNotBeEmpty",message:this.$gettext("Must not be empty"),format:[],...Tt.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 yP{$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],...Tt.isBoolean(n)&&{verified:n}}}assert(t,n){return Array.from(n).filter(i=>t.characters.includes(i)).length>=t.minLength}validate(t){if(!Tt.isObject(t))throw new Error("options should be an object");if(!Tt.isNumber(t.minLength)||Tt.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");if(!Tt.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 va{$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(!Tt.isObject(t))throw new Error("options should be an object");if(!Tt.isNumber(t.minLength)||Tt.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 vP extends va{constructor(t){super(t)}explain(t,n){return{code:"atLeastCharacters",message:this.$gettext("%{param1}+ letters"),format:[t.minLength],...Tt.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>=t.minLength}}class bP extends va{constructor(t){super(t)}explain(t,n){return{code:"atLeastUppercaseCharacters",message:this.$gettext("%{param1}+ uppercase letters"),format:[t.minLength],...Tt.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/[A-Z\xC0-\xD6\xD8-\xDE]/g)?.length>=t.minLength}}class wP extends va{constructor(t){super(t)}explain(t,n){return{code:"atLeastLowercaseCharacters",message:this.$gettext("%{param1}+ lowercase letters"),format:[t.minLength],...Tt.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/[a-z\xDF-\xF6\xF8-\xFF]/g)?.length>=t.minLength}}class SP extends va{constructor(t){super(t)}explain(t,n){return{code:"atLeastDigits",message:this.$gettext("%{param1}+ numbers"),format:[t.minLength],...Tt.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/\d/g)?.length>=t.minLength}}class EP{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 vP({...this.language}),mustNotBeEmpty:new gP({...this.language}),atLeastUppercaseCharacters:new bP({...this.language}),atLeastLowercaseCharacters:new wP({...this.language}),atLeastDigits:new SP({...this.language}),mustContain:new yP({...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 AS.PasswordPolicy(r,n)}getPolicy({enforcePassword:t=!1}={}){return this.buildPolicy({enforcePassword:t}),this.policy}generatePassword(){const t="abcdefghijklmnopqrstuvwxyz",n="ABCDEFGHIJKLMNOPQRSTUVWXYZ",r="\"!#$%&'()*+,-./:;<=>?@[]^_`{|}~",i="0123456789",o=(m,b)=>{const w=256-256%m.length;let S="",y;for(let g=0;g<b;g++){do y=window.crypto.getRandomValues(new Uint8Array(1))[0];while(y>=w);S+=m[y%m.length]}return S},{minLowercaseCharacters:s,minUppercaseCharacters:a,minDigits:l,minSpecialCharacters:u,length:c}=this.generatePasswordRules;let p="";if(p+=o(t,s),p+=o(n,a),p+=o(i,l),p+=o(r,u),p.length<c){const m=c-p.length,b=t+n+r+i;p+=o(b,m)}return(m=>{const b=m.split(""),w=new Uint32Array(b.length);window.crypto.getRandomValues(w);for(let S=b.length-1;S>0;S--){const y=w[S]%(S+1);[b[S],b[y]]=[b[y],b[S]]}return b.join("")})(p)}}const qv=e=>({name:ft.basename(e),type:"directory",relativePath:e}),zv=(e,t)=>t.map(n=>({source:e,name:n.name,type:n.type,data:n,meta:{relativePath:n.relativePath||null}})),Wv=async e=>{const t=await new Promise((r,i)=>e.file(r,i));return e.fullPath===re.urlJoin(e.name,{leadingSlash:!0})||(t.relativePath=e.fullPath),t},TP=e=>typeof e.getAsEntry=="function"?e.getAsEntry():e.webkitGetAsEntry();async function*AP(e){const t=e.createReader(),n=()=>new Promise((i,o)=>{t.readEntries(i,o)});let r;do{r=await n();for(const i of r)yield i}while(r.length>0)}async function*Hv(e,t){if(e.isDirectory){let n=!1;for await(const r of AP(e))if(r.isDirectory)yield*Hv(r,t);else if(r.isFile)try{n=!0,yield Wv(r)}catch(i){console.error(i),t?.(i)}n||(yield qv(e.fullPath||e.name))}else try{yield Wv(e)}catch(n){console.error(n),t?.(n)}}const xP=async(e,t)=>{try{const n=[],r=await Promise.all(Array.from(e.items,i=>TP(i)));for(let i=0;i<r.length;i++)for await(const o of Hv(r[i],t))n.push(o);return n}catch(n){console.error(n);const r=Array.from(e.files);return Promise.resolve(r)}},RP={target:null,uppyService:null};class CP extends Wd.BasePlugin{nodes;uppyService;constructor(t,n){super(t,{...RP,...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)},i=await xP(t.dataTransfer,r);if(i.length>0){this.uppy.log("[DropTarget] Files were dropped");try{const o=zv("DropTarget",i);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=Hd.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 kP{uppy;uploadInputs=[];uploadFolderMap={};constructor({language:t}){const{$gettext:n}=t;this.uppy=new Wd({autoProceed:!1,onBeforeFileAdded:(r,i)=>r.id in i&&!i[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?re.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:i,headers:o}){const s={chunkSize:t,removeFingerprintOnSuccess:!0,overridePatchMethod:n,retryDelays:[0,500,1e3],uploadDataDuringCreation:r,limit:5,headers:o,onBeforeRequest:i,onShouldRetry:(u,c,p,d)=>u?.originalResponse?.getStatus()>=500?!1:u?.originalResponse?.getStatus()===401?!0:d(u)},a=this.uppy.getPlugin("XHRUpload");a&&this.uppy.removePlugin(a);const l=this.uppy.getPlugin("Tus");if(l){l.setOptions(s);return}this.uppy.use(xS,s)}useXhr({headers:t,timeout:n,endpoint:r}){const i={endpoint:r,method:"put",headers:t,formData:!1,timeout:n,getResponseData(){return{}}},o=this.uppy.getPlugin("Tus");o&&this.uppy.removePlugin(o);const s=this.uppy.getPlugin("XHRUpload");if(s){s.setOptions(i);return}this.uppy.use(RS,i)}tusActive(){return!!this.uppy.getPlugin("Tus")}useDropTarget({targetSelector:t}){this.uppy.getPlugin("DropTarget")||this.uppy.use(CP,{target:t,uppyService:this})}removeDropTarget(){const t=this.uppy.getPlugin("DropTarget");t&&this.uppy.removePlugin(t)}subscribe(t,n){return Je.subscribe(t,n)}unsubscribe(t,n){Je.unsubscribe(t,n)}publish(t,n){Je.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 i=r.target,o=Array.from(i.files);this.addFiles(o)}),this.uploadInputs.push(t))}removeUploadInput(t){this.uploadInputs=this.uploadInputs.filter(n=>n!==t)}generateUploadId(t){return Hd.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 PP(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var IP=Object.getOwnPropertySymbols,OP=IP?function(e){for(var t=[];e;)Bf(t,Ov(e)),e=Gl(e);return t}:Pv;function Kv(e){return kv(e,tc,OP)}var FP=Object.prototype,_P=FP.hasOwnProperty;function DP(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&_P.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function NP(e,t){var n=Kl(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var LP=/\w*$/;function $P(e){var t=new e.constructor(e.source,LP.exec(e));return t.lastIndex=e.lastIndex,t}var Gv=On?On.prototype:void 0,Qv=Gv?Gv.valueOf:void 0;function MP(e){return Qv?Object(Qv.call(e)):{}}var BP="[object Boolean]",jP="[object Date]",UP="[object Map]",VP="[object Number]",qP="[object RegExp]",zP="[object Set]",WP="[object String]",HP="[object Symbol]",KP="[object ArrayBuffer]",GP="[object DataView]",QP="[object Float32Array]",XP="[object Float64Array]",YP="[object Int8Array]",JP="[object Int16Array]",ZP="[object Int32Array]",eI="[object Uint8Array]",tI="[object Uint8ClampedArray]",nI="[object Uint16Array]",rI="[object Uint32Array]";function iI(e,t,n){var r=e.constructor;switch(t){case KP:return Kl(e);case BP:case jP:return new r(+e);case GP:return NP(e);case QP:case XP:case YP:case JP:case ZP:case eI:case tI:case nI:case rI:return Dh(e,n);case UP:return new r;case VP:case WP:return new r(e);case qP:return $P(e);case zP:return new r;case HP:return MP(e)}}var oI="[object Map]";function sI(e){return or(e)&&Gn(e)==oI}var Xv=Di&&Di.isMap,aI=Xv?Yl(Xv):sI,lI="[object Set]";function cI(e){return or(e)&&Gn(e)==lI}var Yv=Di&&Di.isSet,uI=Yv?Yl(Yv):cI,fI=1,Jv="[object Arguments]",dI="[object Array]",pI="[object Boolean]",hI="[object Date]",mI="[object Error]",Zv="[object Function]",gI="[object GeneratorFunction]",yI="[object Map]",vI="[object Number]",eb="[object Object]",bI="[object RegExp]",wI="[object Set]",SI="[object String]",EI="[object Symbol]",TI="[object WeakMap]",AI="[object ArrayBuffer]",xI="[object DataView]",RI="[object Float32Array]",CI="[object Float64Array]",kI="[object Int8Array]",PI="[object Int16Array]",II="[object Int32Array]",OI="[object Uint8Array]",FI="[object Uint8ClampedArray]",_I="[object Uint16Array]",DI="[object Uint32Array]",St={};St[Jv]=St[dI]=St[AI]=St[xI]=St[pI]=St[hI]=St[RI]=St[CI]=St[kI]=St[PI]=St[II]=St[yI]=St[vI]=St[eb]=St[bI]=St[wI]=St[SI]=St[EI]=St[OI]=St[FI]=St[_I]=St[DI]=!0,St[mI]=St[Zv]=St[TI]=!1;function ba(e,t,n,r,i,o){var s,a=t&fI;if(n&&(s=i?n(e,r,i,o):n(e)),s!==void 0)return s;if(!rr(e))return e;var l=Hn(e);if(l)s=DP(e);else{var u=Gn(e),c=u==Zv||u==gI;if(xo(e))return _h(e,a);if(u==eb||u==Jv||c&&!i)s={};else{if(!St[u])return i?e:{};s=iI(e,u,a)}}o||(o=new ir);var p=o.get(e);if(p)return p;o.set(e,s),uI(e)?e.forEach(function(b){s.add(ba(b,t,n,b,e,o))}):aI(e)&&e.forEach(function(b,w){s.set(w,ba(b,t,n,w,e,o))});var d=Kv,m=l?void 0:d(e);return PP(m||e,function(b,w){m&&(w=b,b=e[w]),Hh(s,w,ba(b,t,n,w,e,o))}),s}function NI(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}function LI(e,t){return t.length<2?e:Am(e,NI(t,0,-1))}var $I=Object.prototype,MI=$I.hasOwnProperty;function BI(e,t){t=Sc(t,e);var n=-1,r=t.length;if(!r)return!0;for(var i=e==null||typeof e!="object"&&typeof e!="function";++n<r;){var o=t[n];if(typeof o=="string"){if(o==="__proto__"&&!MI.call(e,"__proto__"))return!1;if(o==="constructor"&&n+1<r&&typeof t[n+1]=="string"&&t[n+1]==="prototype"){if(i&&n===0)continue;return!1}}}var s=LI(e,t);return s==null||delete s[Tm(Xd(t))]}function jI(e){return Xl(e)?void 0:e}var tb=On?On.isConcatSpreadable:void 0;function UI(e){return Hn(e)||zs(e)||!!(tb&&e&&e[tb])}function VI(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=UI),i||(i=[]);++o<s;){var a=e[o];n(a)?Bf(i,a):i[i.length]=a}return i}function qI(e){var t=e==null?0:e.length;return t?VI(e):[]}function zI(e){return em(Zh(e,void 0,qI),e+"")}var WI=1,HI=2,KI=4,Hi=zI(function(e,t){var n={};if(e==null)return n;var r=!1;t=bm(t,function(o){return o=Sc(o,e),r||(r=o.length>1),o}),Kh(e,Kv(e),n),r&&(n=ba(n,WI|HI|KI,jI));for(var i=t.length;i--;)BI(n,t[i]);return n});const GI=(e,t)=>{const n=(o="")=>o.split("/").filter(Boolean),r=n(e.path),i=n(t);return i.map((o,s)=>({id:Xt.v4(),allowContextActions:!0,text:o,to:{path:"/"+[...r].splice(0,r.length-i.length+s+1).join("/"),query:Hi(e.query,"fileId","page")},isStaticNav:!1}))},QI=(...e)=>{const t=e.pop();return[...e,{id:Xt.v4(),allowContextActions:t.allowContextActions,text:t.text,onClick:()=>Je.publish("app.files.list.load"),isTruncationPlaceholder:t.isTruncationPlaceholder,isStaticNav:t.isStaticNav}]};class Mo{static Cut="cut";static Copy="copy"}const zf=e=>e.clientY===0,Wf=(e,t,n)=>{if(!e)return;let r=n;r.$el&&(r=n.$el);const i=r.getBoundingClientRect(),o=zf(t)?t.target?.getBoundingClientRect().top||0:t.clientY;e.setProps({getReferenceClientRect:()=>({width:0,height:0,top:o,bottom:o,left:t.type==="contextmenu"&&!zf(t)?t.clientX:i.x,right:t.type==="contextmenu"&&!zf(t)?t.clientX:i.x})}),e.show()},wa=e=>(e||"").split("_")[0],di=(e,t,n=Ut.DateTime.DATETIME_MED)=>e.setLocale(wa(t)).toLocaleString(n),nb=(e,t,n=Ut.DateTime.DATETIME_MED)=>di(Ut.DateTime.fromJSDate(e),t,n),XI=(e,t,n=Ut.DateTime.DATETIME_MED)=>di(Ut.DateTime.fromHTTP(e),t,n),rb=(e,t,n=Ut.DateTime.DATETIME_MED)=>di(Ut.DateTime.fromISO(e),t,n),YI=(e,t,n=Ut.DateTime.DATETIME_MED)=>di(Ut.DateTime.fromRFC2822(e),t,n),Bo=(e,t)=>e.setLocale(wa(t)).toRelative(),ib=(e,t)=>Bo(Ut.DateTime.fromJSDate(e),t),JI=(e,t)=>Bo(Ut.DateTime.fromHTTP(e),t),ZI=(e,t)=>Bo(Ut.DateTime.fromISO(e),t),eO=(e,t)=>Bo(Ut.DateTime.fromRFC2822(e),t),tO=1048576,vn=(e,t)=>{const n=typeof e=="string"?parseInt(e):e;return n<0?"--":isNaN(n)?"?":ES.filesize(n,{round:n<tO?0:1,locale:wa(t),base:10,output:"string"})};function ob(e="",t=!1){const n=re.urlJoin(e,{leadingSlash:!0});if(n==="/")return[];const r=[],i=n.split("/");for(t&&r.push(n),i.pop();i.length>0;){if(!i.join("/")){i.pop();continue}r.push(i.join("/")),i.pop()}return r}var Rt=(e=>(e.open="sidebar.open",e.close="sidebar.close",e.toggle="sidebar.toggle",e.openWithPanel="sidebar.openWithPanel",e.setActivePanel="sidebar.setActivePanel",e))(Rt||{});const Hf=(e,t=void 0)=>{const n=window.localStorage.getItem(e),r=le(t);if(n)try{r.value=JSON.parse(n)}catch{r.value=n}return st(()=>f(r),(i,o)=>{i!==o&&(i!==void 0?window.localStorage.setItem(e,typeof i=="string"?i:JSON.stringify(i)):window.localStorage.removeItem(e))},{deep:!0}),r},Qr=()=>{const e=dt(),t=B(()=>e.options.embed?.enabled),n=B(()=>e.options.embed?.target==="location"),r=B(()=>e.options.embed?.chooseFileName),i=B(()=>e.options.embed?.chooseFileNameSuggestion),o=B(()=>e.options.embed?.target==="file"),s=B(()=>e.options.embed?.fileTypes),a=B(()=>e.options.embed?.messagesOrigin),l=B(()=>f(t)&&e.options.embed?.delegateAuthentication),u=B(()=>e.options.embed?.delegateAuthenticationOrigin);return{isEnabled:t,isLocationPicker:n,chooseFileName:r,chooseFileNameSuggestion:i,isFilePicker:o,messagesTargetOrigin:a,isDelegatingAuthentication:l,fileTypes:s,postMessage:(d,m)=>{const b={};f(a)&&(b.targetOrigin=f(a)),window.parent.postMessage({name:d,data:m},b)},verifyDelegatedAuthenticationOrigin:d=>f(u)?f(u)===d:!0}},Sa=e=>{const{isEnabled:t}=Qr(),n=e?.bus||Je,r=Hf("oc_sideBarOpen",!1),i=le(!1),o=B({get(){return f(t)?f(i):f(r)},set(b){if(f(t)){i.value=b;return}r.value=b}}),s=async()=>{await zt();const b=document.getElementById("app-sidebar");b&&b.focus()},a=le(null),l=n.subscribe(Rt.toggle,()=>{o.value=!f(o),f(o)&&s()}),u=n.subscribe(Rt.close,()=>{o.value=!1,a.value=null}),c=n.subscribe(Rt.open,()=>{o.value=!0,a.value=null,s()}),p=n.subscribe(Rt.openWithPanel,b=>{o.value=!0,a.value=b,s()}),d=n.subscribe(Rt.setActivePanel,b=>{a.value=b});return An(()=>{n.unsubscribe(Rt.toggle,l),n.unsubscribe(Rt.close,u),n.unsubscribe(Rt.open,c),n.unsubscribe(Rt.openWithPanel,p),n.unsubscribe(Rt.setActivePanel,d)}),{isSideBarOpen:tr(o),sideBarActivePanel:tr(a),onPanelActive:(b,w)=>{n.subscribe(Rt.setActivePanel,S=>{b===S&&setTimeout(()=>{w(S)},100)})}}},Yt=e=>e,sb=e=>re.ShareTypes.containsAnyValue(re.ShareTypes.authenticated,e??[]),ab=e=>re.ShareTypes.containsAnyValue(re.ShareTypes.unauthenticated,e??[]),nO=({isDirect:e})=>Yt(e?"This item is directly shared with others.":"This item is shared with others through one of the parent folders."),rO=({isDirect:e})=>Yt(e?"This item is directly shared via links.":"This item is shared via links through one of the parent folders."),iO=({resource:e,isDirect:t,interceptModifierClick:n})=>({id:`files-sharing-${e.getDomSelector()}`,accessibleDescription:nO({isDirect:t}),label:Yt("Show invited people"),icon:"group",category:"sharing",type:t?"user-direct":"user-indirect",fillType:"line",handler:(r,i)=>{i&&n(i,r)||Je.publish(Rt.openWithPanel,"sharing#peopleShares")}}),oO=({resource:e})=>({id:`files-sharing-synced-${e.getDomSelector()}`,accessibleDescription:Yt("This item is synced with your devices"),label:Yt("Synced with your devices"),icon:"loop-right",category:"sharing",type:"resource-synced",fillType:"line"}),sO=({resource:e})=>e.shareRoles?.length?{id:`files-sharing-role-${e.getDomSelector()}`,accessibleDescription:Yt(e.shareRoles[0].description),label:Yt(e.shareRoles[0].displayName),icon:e.shareRoles[0].icon,category:"sharing",type:"share-role",fillType:"line"}:{id:`files-sharing-role-${e.getDomSelector()}`,accessibleDescription:re.ShareTypes.remote.label,label:re.ShareTypes.remote.label,icon:re.ShareTypes.remote.icon,category:"sharing",type:"share-role",fillType:"line"},aO=({resource:e,isDirect:t})=>({id:`file-link-${e.getDomSelector()}`,accessibleDescription:rO({isDirect:t}),label:Yt("Show links"),icon:"link",category:"sharing",type:t?"link-direct":"link-indirect",fillType:"line",handler:()=>{Je.publish(Rt.openWithPanel,"sharing#linkShares")}}),lO=({resource:e})=>({id:`resource-locked-${e.getDomSelector()}`,accessibleDescription:Yt("Item locked"),label:Yt("This item is locked"),icon:"lock",category:"system",type:"resource-locked",fillType:"line"}),cO=({resource:e})=>({id:`resource-processing-${e.getDomSelector()}`,accessibleDescription:Yt("Item in processing"),label:Yt("This item is in processing"),icon:"loop-right",category:"system",type:"resource-processing",fillType:"line"}),uO=({resource:e})=>({id:`resource-space-enabled-${e.getDomSelector()}`,accessibleDescription:Yt("Space is enabled"),label:Yt("This space is enabled"),icon:"play-circle",category:"space",type:"resource-space-enabled",fillType:"line"}),fO=({resource:e})=>({id:`resource-space-disabled-${e.getDomSelector()}`,accessibleDescription:Yt("Space is disabled"),label:Yt("This space is disabled"),icon:"stop-circle",category:"space",type:"resource-space-disabled",fillType:"line"}),lb=({space:e,resource:t,ancestorMetaData:n,user:r,interceptModifierClick:i})=>{const o=[];if(t.locked&&o.push(lO({resource:t})),t.processing&&o.push(cO({resource:t})),re.isProjectSpaceResource(t)&&!t.disabled&&o.push(uO({resource:t})),re.isProjectSpaceResource(t)&&t.disabled&&o.push(fO({resource:t})),re.isIncomingShareResource(t)&&(t.shareTypes.includes(re.ShareTypes.remote.value)||t.shareRoles?.length)&&o.push(sO({resource:t})),re.isIncomingShareResource(t)&&t.syncEnabled&&o.push(oO({resource:t})),re.isProjectSpaceResource(e)||re.isPersonalSpaceResource(e)&&e.isOwner(r)){const a=Object.values(n).reduce((c,p)=>(c.push(...p.shareTypes||[]),c),[]),l=sb(t.shareTypes);(l||sb(a))&&o.push(iO({resource:t,isDirect:l,interceptModifierClick:i}));const u=ab(t.shareTypes);(u||ab(a))&&o.push(aO({resource:t,isDirect:u}))}return o},cb=e=>new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=i=>n(i),r.readAsArrayBuffer(e)}),ub=e=>new Promise(t=>e.toBlob(t)),jo=()=>window.navigator.platform.match("Mac");function pi(e){return e.status==="fulfilled"}function hi(e){return e.status==="rejected"}const Kf=e=>new TextEncoder().encode(e).length,nt=Me.defineStore("messages",()=>{const e=le([]),t=o=>{const s={...o,id:Xt.v4()};return e.value.push(s),s},n=o=>{const s=a=>a.response?.headers?.get("x-request-id");return o.map(a=>s(a)).filter(Boolean).map(a=>`X-Request-Id: ${a}`).join(`\r
41
- `)};return{messages:e,showMessage:t,showErrorMessage:o=>{const s={id:Xt.v4(),status:"danger",timeout:0,...o.errors&&{errorLogContent:n(o.errors)},...o};return e.value.push(s),s},removeMessage:o=>{e.value=f(e).filter(({id:s})=>o.id!==s)}}}),Uo=Me.defineStore("clipboard",()=>{const{$gettext:e}=Ie.useGettext(),{showMessage:t}=nt(),n=le(),r=le([]);return{action:n,resources:r,copyResources:a=>{a[0]?.canDownload()&&(n.value=Mo.Copy,r.value=a,t({title:e("Copied to clipboard!"),status:"success"}))},cutResources:a=>{a[0]?.canDownload()&&(n.value=Mo.Cut,r.value=a,t({title:e("Cut to clipboard!"),status:"success"}))},clearClipboard:()=>{n.value=void 0,r.value=[]}}}),fb={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},dt=Me.defineStore("config",()=>{const e=ar(),t=le(""),n=le(""),r=le({...fb}),i=le([]),o=le([]),s=le([]),a=le(),l=le(),u=le(),c=le([]),p=le([]),d=B(()=>re.urlJoin(f(t)||window.location.origin,{trailingSlash:!0})),m=B(()=>re.urlJoin(f(d),"groupware",{trailingSlash:!0})),b=B(()=>!!f(a)),w=B(()=>!!f(l));return{options:r,oAuth2:a,openIdConnect:l,isOAuth2:b,isOIDC:w,customTranslations:s,apps:i,externalApps:o,sentry:u,theme:n,scripts:c,styles:p,serverUrl:d,groupwareUrl:m,loadConfig:y=>{y.server&&(t.value=y.server?.endsWith("/")?y.server:y.server+"/"),i.value=y.apps||[],s.value=y.customTranslations||[],a.value=y.auth,l.value=y.openIdConnect,u.value=y.sentry,c.value=y.scripts||[],p.value=y.styles||[],n.value=y.theme,y.options&&(r.value=Co({...fb},y.options),f(r).ocm.openRemotely=f(r).cernFeatures,f(r).routing.idBased=!f(r).cernFeatures,f(r).routing.fullShareOwnerPaths=f(r).cernFeatures),y.external_apps&&(o.value=y.external_apps,y.external_apps.filter(Boolean).forEach(g=>{e.loadExternalAppConfig({appId:g.id,config:g.config})}))}}}),dO=de.z.object({url:de.z.string()}),pO=de.z.object({apiUrl:de.z.string().optional(),authUrl:de.z.string().optional(),clientId:de.z.string().optional(),clientSecret:de.z.string().optional(),logoutUrl:de.z.string().optional(),metaDataUrl:de.z.string().optional(),url:de.z.string().optional()}),hO=de.z.object({authority:de.z.string().optional(),client_id:de.z.string().optional(),client_secret:de.z.string().optional(),dynamic:de.z.string().optional(),metadata_url:de.z.string().optional(),post_logout_redirect_uri:de.z.string().optional(),response_type:de.z.string().optional(),scope:de.z.string().optional()}).passthrough(),mO=de.z.record(de.z.any(),de.z.any()),gO=de.z.object({href:de.z.string().optional()}),yO=de.z.object({async:de.z.boolean().optional(),src:de.z.string().optional()}),vO=de.z.object({cernFeatures:de.z.boolean().optional(),concurrentRequests:de.z.object({resourceBatchActions:de.z.number().optional(),sse:de.z.number().optional(),shares:de.z.object({create:de.z.number().optional(),list:de.z.number().optional()}).optional(),avatars:de.z.number().optional()}).optional(),contextHelpers:de.z.boolean().optional(),contextHelpersReadMore:de.z.boolean().optional(),defaultAppId:de.z.string().optional(),disabledExtensions:de.z.array(de.z.string()).optional(),disableFeedbackLink:de.z.boolean().optional(),accountEditLink:de.z.object({href:de.z.string().optional()}).optional(),editor:de.z.object({autosaveEnabled:de.z.boolean().optional(),autosaveInterval:de.z.number().optional(),openAsPreview:de.z.union([de.z.boolean(),de.z.array(de.z.string())]).optional()}).optional(),embed:de.z.object({enabled:de.z.boolean().optional(),target:de.z.string().optional(),messagesOrigin:de.z.string().optional(),delegateAuthentication:de.z.boolean().optional(),delegateAuthenticationOrigin:de.z.string().optional(),fileTypes:de.z.array(de.z.string()).optional(),chooseFileName:de.z.boolean().optional(),chooseFileNameSuggestion:de.z.string().optional()}).optional(),feedbackLink:de.z.object({ariaLabel:de.z.string().optional(),description:de.z.string().optional(),href:de.z.string().optional()}).optional(),isRunningOnEos:de.z.boolean().optional(),loginUrl:de.z.string().optional(),logoutUrl:de.z.string().optional(),ocm:de.z.object({openRemotely:de.z.boolean().optional()}).optional(),routing:de.z.object({fullShareOwnerPaths:de.z.boolean().optional(),idBased:de.z.boolean().optional()}).optional(),runningOnEos:de.z.boolean().optional(),tokenStorageLocal:de.z.boolean().optional(),upload:de.z.object({companionUrl:de.z.string().optional()}).optional(),userListRequiresFilter:de.z.boolean().optional(),hideLogo:de.z.boolean().optional()}),bO=de.z.object({id:de.z.string(),path:de.z.string(),config:de.z.record(de.z.string(),de.z.unknown()).optional()}),wO=de.z.object({server:de.z.string(),theme:de.z.string(),options:vO,apps:de.z.array(de.z.string()).optional(),external_apps:de.z.array(bO).optional(),customTranslations:de.z.array(dO).optional(),auth:pO.optional(),openIdConnect:hO.optional(),sentry:mO.optional(),scripts:de.z.array(yO).optional(),styles:de.z.array(gO).optional()}),db=Me.defineStore("extensionPreferences",()=>{const e=Yn.useLocalStorage("extensionPreferences",{});return{extensionPreferences:e,extractDefaultExtensionIds:(i,o)=>i.multiple?o.map(s=>s.id):i.defaultExtensionId?[i.defaultExtensionId]:[],getExtensionPreference:(i,o)=>{const s=e.value[i];return s||{extensionPointId:i,selectedExtensionIds:o}},setSelectedExtensionIds:(i,o)=>{if(!Object.hasOwn(f(e),i)){e.value[i]={extensionPointId:i,selectedExtensionIds:o};return}e.value[i].selectedExtensionIds=o}}}),Ki=Me.defineStore("extensionRegistry",()=>{const e=dt(),t=le([]),n=u=>{t.value.push(u)},r=u=>{t.value=f(t).map(c=>le(f(c).filter(({id:p})=>!u.includes(p)))).filter(c=>f(c).length)},i=u=>{if(!u.id||!u.extensionType)throw new Error("ExtensionPoint must have an id and an extensionType");return f(t).flatMap(c=>f(c).filter(p=>p.type===u.extensionType&&!e.options.disabledExtensions.includes(p.id)&&(!p.extensionPointIds||p.extensionPointIds?.includes(u.id))))},o=le([]);return{extensions:t,registerExtensions:n,unregisterExtensions:r,requestExtensions:i,extensionPoints:o,registerExtensionPoints:u=>{o.value.push(u)},unregisterExtensionPoints:u=>{o.value=f(o).map(c=>le(f(c).filter(({id:p})=>!u.includes(p)))).filter(c=>f(c).length)},getExtensionPoints:(u={})=>f(o).flatMap(c=>f(c).filter(p=>!(Object.hasOwn(u,"extensionType")&&p.extensionType!==u.extensionType)))}}),ht=Me.defineStore("modals",()=>{const e=le([]),t=B(()=>f(e).at(-1)),n=l=>f(e).find(u=>u.id===l);return{modals:e,activeModal:t,dispatchModal:l=>{const u={...l,id:Xt.v4()};return e.value.push(u),u},updateModal:(l,u,c)=>{const p=n(l);p[u]=c},removeModal:l=>{e.value=f(e).filter(u=>u.id!==l)},removeAllModals:()=>{e.value=[]},setModalActive:l=>{const u=f(e).findIndex(p=>p.id===l);if(u<0)return;const c=n(l);f(e).splice(u,1),e.value.push(c)}}}),vt=Me.defineStore("user",()=>{const e=le();return{user:e,setUser:r=>{e.value=r,kS.setUser({username:r.onPremisesSamAccountName})},reset:()=>{e.value=null}}});function SO(e,t,n,r){for(var i=-1,o=e==null?0:e.length;++i<o;)n=t(n,e[i],i,e);return n}function EO(e){return function(t){return e?.[t]}}var TO={À:"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"},AO=EO(TO),xO=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,RO="\\u0300-\\u036f",CO="\\ufe20-\\ufe2f",kO="\\u20d0-\\u20ff",PO=RO+CO+kO,IO="["+PO+"]",OO=RegExp(IO,"g");function FO(e){return e=wc(e),e&&e.replace(xO,AO).replace(OO,"")}var _O=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function DO(e){return e.match(_O)||[]}var NO=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function LO(e){return NO.test(e)}var pb="\\ud800-\\udfff",$O="\\u0300-\\u036f",MO="\\ufe20-\\ufe2f",BO="\\u20d0-\\u20ff",jO=$O+MO+BO,hb="\\u2700-\\u27bf",mb="a-z\\xdf-\\xf6\\xf8-\\xff",UO="\\xac\\xb1\\xd7\\xf7",VO="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",qO="\\u2000-\\u206f",zO=" \\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",gb="A-Z\\xc0-\\xd6\\xd8-\\xde",WO="\\ufe0e\\ufe0f",yb=UO+VO+qO+zO,vb="['’]",bb="["+yb+"]",HO="["+jO+"]",wb="\\d+",KO="["+hb+"]",Sb="["+mb+"]",Eb="[^"+pb+yb+wb+hb+mb+gb+"]",GO="\\ud83c[\\udffb-\\udfff]",QO="(?:"+HO+"|"+GO+")",XO="[^"+pb+"]",Tb="(?:\\ud83c[\\udde6-\\uddff]){2}",Ab="[\\ud800-\\udbff][\\udc00-\\udfff]",Gi="["+gb+"]",YO="\\u200d",xb="(?:"+Sb+"|"+Eb+")",JO="(?:"+Gi+"|"+Eb+")",Rb="(?:"+vb+"(?:d|ll|m|re|s|t|ve))?",Cb="(?:"+vb+"(?:D|LL|M|RE|S|T|VE))?",kb=QO+"?",Pb="["+WO+"]?",ZO="(?:"+YO+"(?:"+[XO,Tb,Ab].join("|")+")"+Pb+kb+")*",eF="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",tF="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",nF=Pb+kb+ZO,rF="(?:"+[KO,Tb,Ab].join("|")+")"+nF,iF=RegExp([Gi+"?"+Sb+"+"+Rb+"(?="+[bb,Gi,"$"].join("|")+")",JO+"+"+Cb+"(?="+[bb,Gi+xb,"$"].join("|")+")",Gi+"?"+xb+"+"+Rb,Gi+"+"+Cb,tF,eF,wb,rF].join("|"),"g");function oF(e){return e.match(iF)||[]}function sF(e,t,n){return e=wc(e),t=t,t===void 0?LO(e)?oF(e):DO(e):e.match(t)||[]}var aF="['’]",lF=RegExp(aF,"g");function cF(e){return function(t){return SO(sF(FO(t).replace(lF,"")),e,"")}}var Ib=cF(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Ob=de.z.object({name:de.z.string().optional(),slogan:de.z.string().optional(),logo:de.z.string().optional(),logoMobile:de.z.string().optional(),urls:de.z.object({accessDeniedHelp:de.z.string().optional(),imprint:de.z.string().optional(),privacy:de.z.string().optional(),accessibility:de.z.string().optional()}).optional(),shareRoles:de.z.record(de.z.string(),de.z.object({iconName:de.z.string()})).optional()}),uF=de.z.object({roles:de.z.record(de.z.string(),de.z.string()).optional(),colorPalette:de.z.record(de.z.string(),de.z.string()).optional(),fontFamily:de.z.string().optional()}),Fb=Ob.extend({designTokens:uF.optional(),favicon:de.z.string().optional(),background:de.z.string().optional()}),fF=Fb.extend({isDark:de.z.boolean(),label:de.z.string()}),_b=de.z.object({defaults:Fb,themes:de.z.array(fF)}),dF=de.z.object({common:Ob.optional(),clients:de.z.object({web:_b})}),pF="oc_currentThemeName",hF=e=>{let t=document.querySelector("link[rel~='icon']");t||(t=document.createElement("link"),t.rel="icon",document.head.appendChild(t)),t.href=e},cr=Me.defineStore("theme",()=>{const e=Yn.useLocalStorage(pF,null),t=Yn.usePreferredDark(),n=le(),r=le([]),i=c=>{const p=c.common,d=c.clients.web.defaults,m=Kd(p,d);r.value=c.clients.web.themes.map(b=>Kd(m,b)),o()},o=()=>{const c=f(r).find(d=>!d.isDark),p=f(r).find(d=>d.isDark);l(f(r).find(d=>d.label===f(e))||(f(t)?p:c)||f(r)[0],!1)},s=()=>{e.value=null,o()},a=B(()=>e.value===null),l=(c,p=!0)=>{n.value=c,p&&(e.value=f(n).label);const d=[{name:"roles",prefix:"role"},{name:"colorPalette",prefix:"color"}];Gs("font-family",f(n).designTokens.fontFamily),d.forEach(m=>{for(const b in f(n).designTokens[m.name])Gs(`${m.prefix}-${Ib(b)}`,f(n).designTokens[m.name][b])}),f(n).designTokens?.roles?.chrome||(Gs("role-chrome",f(n).designTokens?.roles?.surfaceContainer),Gs("role-on-chrome",f(n).designTokens?.roles?.onSurface)),f(n).favicon&&hF(f(n).favicon)};return{availableThemes:r,currentTheme:n,initializeThemes:i,setAndApplyTheme:l,setAutoSystemTheme:s,isCurrentThemeAutoSystem:a,getRoleIcon:c=>f(n).shareRoles[c.id]?.iconName||"user"}}),Cr=Me.defineStore("shares",()=>{const e=ze(),{getRoleIcon:t}=cr(),n=le(!1),r=le([]),i=le([]),o=le({}),s=x=>{o.value=x.reduce((A,N)=>(A[N.id]={...N,icon:t(N)},A),{})},a=x=>{const A=f(r).find(({id:N})=>N===x.id);if(A){Object.assign(A,x);return}f(r).push(x)},l=x=>{r.value=x},u=x=>{f(r).push(...x)},c=x=>{r.value=f(r).filter(({id:A})=>A!==x.id)},p=()=>{r.value=[],i.value=[],n.value=void 0},d=()=>{const x=Object.values(e.ancestorMetaData).map(({id:A})=>A);if(!x.length){r.value=[],i.value=[];return}f(r).forEach(A=>{x.includes(A.resourceId)||c(A)}),f(i).forEach(A=>{x.includes(A.resourceId)||w(A)})},m=x=>{i.value=x},b=x=>{const A=f(i).find(({id:N})=>N===x.id);if(A){Object.assign(A,x);return}f(i).push(x)},w=x=>{i.value=f(i).filter(({id:A})=>A!==x.id)},S=x=>{n.value=x},y=x=>{const A=D=>{const V=new Set;return D.forEach(L=>{V.add(L.shareType)}),Array.from(V)},N=[...e.resources,e.currentFolder].find(D=>D?.id===x);if(!N||re.isProjectSpaceResource(N))return;const W=[...f(r),...f(i)];e.updateResourceField({id:N.id,field:"shareTypes",value:A(W.filter(D=>!D.indirect))});const O=e.getAncestorById(x);O&&e.updateAncestorField({path:O.path,field:"shareTypes",value:A(W.filter(D=>!D.indirect))})};return{loading:n,collaboratorShares:r,linkShares:i,graphRoles:o,setGraphRoles:s,setLoading:S,setCollaboratorShares:l,setLinkShares:m,removeOrphanedShares:d,pruneShares:p,addShare:async({clientService:x,space:A,resource:N,options:W})=>{const D=await x.graphAuthenticated.permissions.createInvite(A.id,N.id,W,f(o));return u([D]),y(N.id),D},updateShare:async({clientService:x,space:A,resource:N,collaboratorShare:W,options:O})=>{const D=x.graphAuthenticated.permissions,V={roles:O.roles,expirationDateTime:O.expirationDateTime},L=await D.updatePermission(A.id,N.id,W.id,V,f(o));return a(L),L},deleteShare:async({clientService:x,space:A,resource:N,collaboratorShare:W})=>{await x.graphAuthenticated.permissions.deletePermission(A.id,N.id,W.id),c(W),y(N.id)},addLink:async({clientService:x,space:A,resource:N,options:W})=>{const D=await x.graphAuthenticated.permissions.createLink(A.id,N.id,W),V=e.selectedResources,L=V.some(({fileId:te})=>te===N.fileId)||V.length===0&&e.currentFolder.fileId===N.fileId;if(b(D),y(N.id),!L){const te=e.ancestorMetaData[N.path]??null;if(te){const{shareTypes:Y}=te;Y.includes(re.ShareTypes.link.value)||e.updateAncestorField({path:te.path,field:"shareTypes",value:[...Y,re.ShareTypes.link.value]})}}return D},updateLink:async({clientService:x,space:A,resource:N,linkShare:W,options:O})=>{const D=x.graphAuthenticated.permissions;let V;if(Object.hasOwn(O,"password"))V=await D.setPermissionPassword(A.id,N.id,W.id,{password:O.password}),W.hasPassword=!!O.password;else{const L={link:{...O.type&&{type:O.type},...O.displayName&&{"@libre.graph.displayName":O.displayName}},...Object.hasOwn(O,"expirationDateTime")&&{expirationDateTime:O.expirationDateTime}};V=await D.updatePermission(A.id,N.id,W.id,L)}return b(V),V},deleteLink:async({clientService:x,space:A,resource:N,linkShare:W})=>{await x.graphAuthenticated.permissions.deletePermission(A.id,N.id,W.id),w(W),y(N.id)}}}),bn={View:"view",Upload:"upload",Edit:"edit",CreateOnly:"createOnly"},Db={LibreGraphPermissionsActionsAllowedValues:"@libre.graph.permissions.actions.allowedValues",LibreGraphPermissionsRolesAllowedValues:"@libre.graph.permissions.roles.allowedValues"},Nb=e=>e.sort((t,n)=>n.permissions.length-t.permissions.length),Vo=async({graphClient:e,driveType:t,configStore:n,signal:r})=>{const i=await e.drives.listMyDrives({orderBy:"name asc",filter:`driveType eq ${t}`},{signal:r});if(!i.length)return[];if(t!=="mountpoint"||!n.options.routing?.fullShareOwnerPaths)return i;const o={};i.forEach(a=>{const{rootId:l,driveAlias:u}=a.root.remoteItem;o[l]=u});const s=Object.entries(o).map(([a,l])=>re.buildSpace({id:re.extractStorageId(a),name:l,driveType:l.split("/")[0],driveAlias:l,path:"/",serverUrl:n.serverUrl}));return[...i,...s]},at=Me.defineStore("spaces",()=>{const e=vt(),t=dt(),n=Cr(),r=le([]),i=le(),o=le(!1),s=le(!1),a=le(!1),l=le(null),u=le([]),c=le([]),p=B(()=>f(r).find(ae=>re.isPersonalSpaceResource(ae)&&ae.isOwner(e.user))),d=ae=>{o.value=ae},m=ae=>{s.value=ae},b=ae=>{a.value=ae},w=ae=>{i.value=ae},S=ae=>{l.value=ae},y=ae=>{if(!re.isProjectSpaceResource(ae))return[];const we=n.collaboratorShares.filter(Q=>Q.resourceId===ae.id);return Nb(we)},g=ae=>{f(r).push(...ae)},v=ae=>{r.value=f(r).filter(({id:we})=>we!==ae.id)},h=ae=>f(r).find(we=>ae==we.id),E=async({graphClient:ae,space:we,signal:Q})=>(await N({graphClient:ae,signal:Q}),f(r).find(ie=>re.isMountPointSpaceResource(ie)&&ie.root?.remoteItem?.id===we.id)),T=({driveAliasPrefix:ae,id:we,shareName:Q})=>{const ie=re.buildShareSpaceResource({driveAliasPrefix:ae,id:we,shareName:Q,serverUrl:t.serverUrl});return g([ie]),ie},R=ae=>{const we=f(r).find(({id:Q})=>Q===ae.id);if(we){Object.assign(we,ae);return}g([ae])},x=({id:ae,field:we,value:Q})=>{const ie=f(r).find(ce=>ae===ce.id);ie&&(ie[we]=Q)},A=async({graphClient:ae})=>{a.value=!0;try{const[we,Q]=await Promise.all([Vo({graphClient:ae,driveType:"personal",configStore:t}),Vo({graphClient:ae,driveType:"project",configStore:t})]);g([...we,...Q])}finally{a.value=!1}},N=async({graphClient:ae,signal:we})=>{if(!f(s))try{const Q=await Vo({graphClient:ae,driveType:"mountpoint",configStore:t,signal:we});g(Q)}finally{s.value=!0}},W=async({graphClient:ae,signal:we})=>{const Q=await Vo({graphClient:ae,driveType:"project",configStore:t,signal:we});r.value=f(r).filter(ie=>!re.isProjectSpaceResource(ie)),g(Q)},O=ae=>{f(u).includes(ae)||f(u).push(ae)},D=ae=>{u.value=f(u).filter(we=>we!==ae)},V=()=>{u.value=[]},L=ae=>{f(c).includes(ae)||f(c).push(ae)},te=ae=>{c.value=f(c).filter(we=>we!==ae)},Y=()=>{c.value=[]},se=le({});return{spaces:r,spacesInitialized:o,mountPointsInitialized:s,spacesLoading:a,currentSpace:i,personalSpace:p,defaultSpaceImageBlobURL:l,imagesLoading:u,readmesLoading:c,getSpace:h,createShareSpace:T,setSpacesInitialized:d,setMountPointsInitialized:m,setSpacesLoading:b,setCurrentSpace:w,setDefaultSpaceImageBlobURL:S,getSpaceMembers:y,getMountPointForSpace:E,addSpaces:g,removeSpace:v,upsertSpace:R,updateSpaceField:x,loadSpaces:A,loadMountPoints:N,reloadProjectSpaces:W,addToImagesLoading:O,removeFromImagesLoading:D,purgeImagesLoading:V,addToReadmesLoading:L,removeFromReadmesLoading:te,purgeReadmesLoading:Y,loadGraphPermissions:async({ids:ae,graphClient:we,useCache:Q=!0})=>{const ie=f(r).filter(ce=>ae.includes(ce.id)&&(ce.graphPermissions===void 0||!Q));if(ie.length){for(const{id:ce,disabled:Ae}of ie){if(Ae){x({id:ce,field:"graphPermissions",value:[]});continue}f(se)[ce]||(se.value[ce]=we.permissions.listPermissions(ce,ce,n.graphRoles,{select:[Db.LibreGraphPermissionsActionsAllowedValues]}).then(({allowedActions:ee})=>{x({id:ce,field:"graphPermissions",value:ee}),delete se.value[ce]}))}await Promise.all(Object.values(f(se)))}}}}),ze=Me.defineStore("resources",()=>{const e=dt(),t=at(),n=vt(),r=le([]),i=le(),o=le({}),s=le([]),a=B(()=>{let C=f(r);return f(O)||(C=C.filter(q=>!q.name.startsWith("."))),C}),l=B(()=>{const C=f(r).filter(({type:ge})=>ge==="file").length,q=f(r).filter(({type:ge,name:xe})=>ge==="file"&&xe.startsWith(".")).length,K=f(r).filter(({type:ge})=>ge==="folder").length,j=f(r).filter(({type:ge,name:xe})=>ge==="folder"&&xe.startsWith(".")).length,H=f(r).filter(re.isProjectSpaceResource).length;return{files:C,hiddenFiles:q,folders:K,hiddenFolders:j,spaces:H}}),u=C=>{r.value=C},c=C=>{r.value=f(r).filter(q=>!C.find(({id:K})=>K===q.id))},p=()=>{r.value=[]},d=C=>{const q=f(r).find(({id:K})=>K===C.id);if(q){Object.assign(q,C);return}f(r).push(C)},m=C=>{const q=f(r).filter(K=>!C.some(j=>j.path===K.path));r.value=[...q,...C]},b=({id:C,field:q,value:K})=>{const j=f(r).find(H=>C===H.id);j&&(j[q]=K)},w=C=>{i.value=C},S=()=>{i.value=void 0},y=C=>{r.value=C.resources,i.value=C.currentFolder},g=()=>{r.value=[],i.value=void 0,v.value=[]},v=le([]),h=le(null),E=B(()=>f(r).filter(C=>f(v).includes(C.id))),T=C=>{const q=C.find(K=>!f(v).includes(K));q&&(h.value=q),v.value=C},R=C=>{h.value=C,f(v).includes(C)||f(v).push(C)},x=C=>{h.value=C,f(v).includes(C)&&(v.value=f(v).filter(q=>q!==C))},A=C=>{f(v).includes(C)?x(C):R(C)},N=()=>{v.value=[]},W=C=>{h.value=C},O=le(!0),D=le(!0),V=le(!1),L=le(!0),te=le(!0),Y=C=>{O.value=C,window.localStorage.setItem("oc_hiddenFilesShown",C.toString())},se=C=>{D.value=C,window.localStorage.setItem("oc_fileExtensionsShown",C.toString())},he=C=>{V.value=C,window.localStorage.setItem("oc_webDavDetailsShown",C.toString())},ae=C=>{L.value=C,window.localStorage.setItem("oc_disabledSpacesShown",C.toString())},we=C=>{te.value=C,window.localStorage.setItem("oc_emptyTrashesShown",C.toString())},Q=C=>{o.value=C};return{resources:r,currentFolder:i,activeResources:a,totalResourcesCount:l,setResources:u,removeResources:c,clearResources:p,upsertResource:d,upsertResources:m,updateResourceField:b,setCurrentFolder:w,clearCurrentFolder:S,initResourceList:y,clearResourceList:g,selectedIds:v,latestSelectedId:h,selectedResources:E,setSelection:T,addSelection:R,removeSelection:x,toggleSelection:A,resetSelection:N,setLastSelectedId:W,areHiddenFilesShown:O,areFileExtensionsShown:D,areWebDavDetailsShown:V,areDisabledSpacesShown:L,areEmptyTrashesShown:te,setAreHiddenFilesShown:Y,setAreFileExtensionsShown:se,setAreWebDavDetailsShown:he,setAreDisabledSpacesShown:ae,setAreEmptyTrashesShown:we,ancestorMetaData:o,setAncestorMetaData:Q,updateAncestorField:({path:C,field:q,value:K})=>{const j=f(o)[C]??null;j&&(j[q]=K)},loadAncestorMetaData:({folder:C,space:q,client:K,signal:j})=>{const H={[C.path]:{id:C.fileId,shareTypes:C.shareTypes,parentFolderId:C.parentFolderId,spaceId:q.id,path:C.path}},ge=[],xe=[Ve.FileId,Ve.ShareTypes,Ve.FileParent],De=ob(C.path),Oe=t.spaces,Ce=()=>Oe.filter(ye=>re.isMountPointSpaceResource(ye)&&re.extractStorageId(ye.root.remoteItem.rootId)===q.id);let Fe=!0;if(e.options.routing.fullShareOwnerPaths){const ye=Oe.some(We=>re.isProjectSpaceResource(We)&&We.id===q.id);Fe=q.isOwner(n.user)||ye}for(const ye of De){const We=f(o)[ye]??null;if(We?.spaceId===q.id){H[ye]=We;continue}if(!Fe&&!Ce().find(Ge=>ye.startsWith(Ge.root.remoteItem.path)))break;ge.push(K.listFiles(q,{path:ye},{depth:0,davProperties:xe,signal:j}).then(({resource:Ge})=>{H[ye]={id:Ge.fileId,shareTypes:Ge.shareTypes,parentFolderId:Ge.parentFolderId,spaceId:q.id,path:ye}}))}return Promise.all(ge).then(()=>{if(!Object.keys(H).includes("/")){const ye=f(o)["/"];if(ye?.spaceId===q.id)H["/"]=ye;else{const{parentFolderId:We}=Object.values(H)[0],Ge=t.spaces.find(({id:Qe})=>We.startsWith(Qe));Ge&&(H["/"]={id:Ge.id,shareTypes:Ge.shareTypes,parentFolderId:Ge.id,spaceId:Ge.id,path:"/"})}}Q(H)})},getAncestorById:C=>Object.values(f(o)).find(q=>C===q.id),deleteQueue:s,addResourcesIntoDeleteQueue:C=>{s.value=s.value.concat(C.filter(q=>!f(s).includes(q)))},removeResourcesFromDeleteQueue:C=>{s.value=s.value.filter(q=>!C.includes(q))}}}),qo=Me.defineStore("webWorkers",()=>{const e=le([]);return{createWorker:(o,{needsTokenRenewal:s=!1}={})=>{const a=Xt.v4(),l=Yn.useWebWorker(o,{type:"module",name:a}),u={id:a,needsTokenRenewal:s,...l};return f(e).push(u),u},terminateWorker:o=>{const s=f(e).find(a=>o===a.id);s&&(s.terminate(),e.value=f(e).filter(a=>o!==a.id))},terminateAllWorkers:()=>{f(e).forEach(({terminate:o})=>{o()}),e.value=[]},updateAccessTokens:o=>{f(e).filter(({needsTokenRenewal:s})=>s).forEach(({post:s})=>{s(JSON.stringify({topic:"tokenUpdate",data:{accessToken:`Bearer ${o}`}}))})}}}),Ea=Me.defineStore("avatars",()=>{const e=dt(),t=le({}),n=yp(new Lr({concurrency:e.options.concurrentRequests.avatars}));return{avatarMap:t,getAvatar:l=>f(t)[l],addAvatar:(l,u)=>{t.value[l]=u},removeAvatar:l=>{t.value[l]=null},reset:()=>{t.value={}},avatarsQueue:n,pendingAvatarsRequests:new Map}}),Lb=Me.defineStore("updates",()=>{const e=le(!0),t=le(!1),n=le();return{updates:n,isLoading:e,hasError:t,setUpdates:s=>{n.value=s},setHasError:s=>{t.value=s},setIsLoading:s=>{e.value=s}}}),mF=Me.defineStore("groupwareConfig",()=>{const e=le(""),t=le([]),n=le(),r=le([]),i=le({});return{version:e,capabilities:t,limits:n,accounts:r,primaryAccounts:i,loadGroupwareConfig:s=>{e.value=s.version,t.value=s.capabilities||[],n.value=s.limits,r.value=s.accounts||[],i.value=s.primaryAccounts||{}}}}),$b=de.z.object({maxMailboxDepth:de.z.number(),maxSizeMailboxName:de.z.number(),maxMailboxesPerEmail:de.z.number(),maxSizeAttachmentsPerEmail:de.z.number(),mayCreateTopLevelMailbox:de.z.boolean(),maxDelayedSend:de.z.number()}),Mb=de.z.object({maxSizeScriptName:de.z.number(),maxSizeScript:de.z.number(),maxNumberScripts:de.z.number(),maxNumberRedirects:de.z.number()}),Bb=de.z.object({mail:$b.optional(),sieve:Mb.optional()}),jb=de.z.object({id:de.z.string(),name:de.z.string(),email:de.z.string().email(),mayDelete:de.z.boolean()}),Ub=de.z.object({accountId:de.z.string(),name:de.z.string(),isPersonal:de.z.boolean(),isReadOnly:de.z.boolean(),capabilities:Bb,identities:de.z.array(jb)}),Vb=de.z.object({maxSizeUpload:de.z.number(),maxConcurrentUpload:de.z.number(),maxSizeRequest:de.z.number(),maxConcurrentRequests:de.z.number()}),qb=de.z.array(Ub),zb=de.z.record(de.z.string(),de.z.string()),gF=de.z.object({version:de.z.string(),capabilities:de.z.array(de.z.string()),limits:Vb,accounts:qb,primaryAccounts:zb}),Ta=(e={})=>{const t=e.router||He(),n=e.configStore||dt();return{replaceInvalidFileRoute:({space:i,resource:o,path:s,fileId:a})=>{if(!n.options.routing?.idBased||s===o.path&&a===o.fileId)return!1;const l=sr(i,o,{configStore:n});return t.replace(l),!0}}},Gf=()=>{const e=Ht();return B(()=>f(e).name)},Wb=(e,t)=>{const n=Ht();return B(()=>f(n).meta[e]||t)},Aa=(e,t)=>{const n=He();return B({get(){return Ct(f(n.currentRoute).params[e])||t},async set(r){f(n.currentRoute).params[e]!==r&&await n.replace({params:{...f(n.currentRoute).params,[e]:r}})}})};let Hb=Promise.resolve();const tn=(e,t)=>{const n=He();return B({get(){return f(n.currentRoute).query[e]||t},set(r){if(f(n.currentRoute).query[e]===r)return;Hb=Hb.then(async()=>{try{await n.replace({path:f(n.currentRoute).path,query:{...f(n.currentRoute).query,[e]:r}})}catch{}})}})},kr=e=>{const t=tn(e.name),n=Hf(yF(e));return st(()=>f(t)?{value:f(t),source:"route"}:f(n)?{value:f(n),source:"storage"}:{value:e.defaultValue,source:"default"},r=>{["route","default"].includes(r.source)&&(n.value=r.value===e.defaultValue?void 0:Ct(r.value)),["storage","default"].includes(r.source)&&(t.value=r.value)},{immediate:!0}),t},yF=e=>["oc-options",e.storagePrefix,e.name].filter(Boolean).join("_"),Qn=(e,...t)=>{const n=le(!1),r=He(),i=Ht();return st(i,()=>{n.value=e(r,...t)},{immediate:!0}),n},xa="contextRouteName",Qf="contextRouteParams",Xf="contextRouteQuery",Ra=e=>{const{params:t,query:n}=e,r={},i=["fileId","shareId","q_share-visibility","page"].concat(e.meta?.contextQueryItems||[]);for(const o of i)r[o]=n[o];return{[xa]:e.name,[Qf]:t,[Xf]:r}},Kb=e=>({routeName:Ct(e[xa]),routeParams:e[Qf],routeQuery:e[Xf]}),Ct=e=>Array.isArray(e)?e[0].toString():e?.toString();function Gb({router:e,currentFileContext:t}){const n=a=>{const{fileName:l,routeName:u,routeParams:c,routeQuery:p}=f(a);return f(u)?e.push({name:f(u),params:f(c),query:{...f(p),scrollTo:f(l)}}):e.push({path:"/"})},{replaceInvalidFileRoute:r}=Ta({router:e}),i=(a,l)=>{const u=f(a);return r({space:f(u.space),resource:l,path:f(u.item),fileId:f(u.itemId)})},o=le(!1);return{replaceInvalidFileRoute:i,closeApp:()=>(o.value=!0,n(t)),closed:o}}const Ke=()=>Ar("$clientService");function Yf({clientService:e}){e=e||Ke();const t=vt();return{getUrlForResource:(a,l,u)=>e.webdav.getFileUrl(a,l,{username:t.user?.onPremisesSamAccountName,...u}),revokeUrl:a=>e.webdav.revokeUrl(a),getFileContents:(a,l)=>e.webdav.getFileContents(f(f(a).space),{path:f(f(a).item)},{...l}),getFileInfo:(a,l={})=>e.webdav.getFileInfo(f(f(a).space),{path:f(f(a).item),fileId:f(f(a).itemId)},l),putFileContents:(a,l)=>e.webdav.putFileContents(f(f(a).space),{path:f(f(a).item),...l})}}const Jf=()=>Ar("$authService");class mi{static allFiles="all-files";static currentFolder="current-folder"}const Zf=()=>{const e=dt(),t=Ke(),n=at(),r=ze(),i=en(),o=B(()=>i.searchContent?.enabled),s=B(()=>r.areHiddenFilesShown),a=B(()=>n.spaces.filter(re.isProjectSpaceResource)),l=d=>f(a).find(m=>m.id===d),u=rn.useTask(function*(d,m,b=null){if(e.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:t.graphAuthenticated,signal:d})),!m)return{totalResults:null,values:[]};const{resources:w,totalResults:S}=yield*re.call(t.webdav.search(m,{searchLimit:b,davProperties:ko.Default,signal:d}));return{totalResults:S,values:w.map(y=>{const g=l(y.parentFolderId),v=g||y;return e.options.routing.fullShareOwnerPaths&&v.remoteItemPath&&(v.path=re.urlJoin(v.remoteItemPath,v.path)),{id:v.id,data:v}}).filter(({data:y})=>!y.name.startsWith(".")||f(s))}}).restartable();return{search:async(d,m=null)=>await u.perform(d,m),buildSearchTerm:({term:d,isTitleOnlySearch:m,tags:b,lastModified:w,mediaType:S,scope:y,useScope:g})=>{const v=[],h=d,E=f(o)&&!m;if(h){let T=`name:"*${h}*"`;E&&(T=`(name:"*${h}*" OR content:"${h}")`),v.push(T)}if(g&&y&&v.push(`scope:${y}`),b){const T=b.split("+").map(R=>`"${R}"`);v.push(`tag:(${T.join(" OR ")})`)}if(w&&v.push(`mtime:${w}`),S){const T=S.split("+").map(R=>`"${R}"`);v.push(`mediatype:(${T.join(" OR ")})`)}return v.sort((T,R)=>Number(T.startsWith("scope:"))-Number(R.startsWith("scope:"))).join(" AND ")}}};function Qb({currentRoute:e,clientService:t}){const n=le(!1),{webdav:r}=t,{replaceInvalidFileRoute:i}=Ta(),{getFileInfo:o}=Yf({clientService:t}),s=Jf(),a=at(),{buildSearchTerm:l,search:u}=Zf(),c=tn("contextRouteQuery"),p=ze(),{activeResources:d}=Me.storeToRefs(p);return{isFolderLoading:n,loadFolderForFileContext:async b=>{n.value=!0;try{if(b=f(b),f(c)?.term){const T=l({term:f(c)?.term}),{values:R}=await u(T,200),x=R.filter(({data:A})=>re.isSearchResource(A)).map(A=>A.data);p.initResourceList({currentFolder:null,resources:x}),n.value=!1;return}if(["files-shares-with-me","files-shares-with-others","files-shares-via-link","files-common-favorites"].includes(f(b.routeName))){await xv.getTask().perform(),n.value=!1;return}p.clearResourceList();const S=f(b.space),y=await o(b,{davProperties:[Ve.FileId]});if(i({space:S,resource:y,path:f(b.item),fileId:f(b.itemId)}),a.spaces.some(T=>re.isMountPointSpaceResource(T)&&T.root.remoteItem?.id===y.id)){const T=await o(b);p.initResourceList({currentFolder:T,resources:[T]}),n.value=!1;return}const v=ft.dirname(y.path),{resource:h,children:E}=await r.listFiles(S,{path:v});h.type==="file"?p.initResourceList({currentFolder:h,resources:[h]}):p.initResourceList({currentFolder:h,resources:E})}catch(w){if(w.statusCode===401)return s.handleAuthError(f(e));p.setCurrentFolder(null),console.error(w)}n.value=!1},activeFiles:d}}function ed({appsStore:e,applicationId:t}){return{applicationMeta:B(()=>{const r=e.apps[t];if(!r)throw new Error(`useAppConfig: could not find config for applicationId: ${t}`);return r||{}})}}const ur=()=>Je;function Xb({titleSegments:e,eventBus:t}){const n=cr(),{currentTheme:r}=Me.storeToRefs(n);t=t||ur(),st(e,i=>{const o=f(i),s=" - ",a={shortDocumentTitle:o.join(s),fullDocumentTitle:[...o,f(r).name].join(s)};t.publish("runtime.documentTitle.changed",a)},{immediate:!0,deep:!0})}function vF({appsStore:e,applicationId:t,applicationName:n,currentFileContext:r,currentRoute:i}){const o=ed({applicationId:t,appsStore:e}),{$gettext:s}=Ie.useGettext(),a=B(()=>{const l=ft.basename(f(f(r)?.fileName))||s(f(i)?.meta?.title||""),u=f(f(o).applicationMeta);return[l,f(n)||u.name||u.id].filter(Boolean)});Xb({titleSegments:a})}function Yb(e={}){const t=e.clientService??Ke(),n=e.authStore??li();return{makeRequest:(i,o,s={})=>{const a=!n.accessToken||n.publicLinkContextReady?t.httpUnAuthenticated:t.httpAuthenticated,l=new gc({accessToken:n.accessToken,publicLinkToken:n.publicLinkToken,publicLinkPassword:n.publicLinkPassword});return s.method=i,s.url=o,s.headers={...l.getHeaders(),...s?.headers||{}},a.request(s)}}}const Jb=()=>{const e=at();return{areSpacesLoading:B(()=>!e.spacesInitialized||e.spacesLoading)}},Zb=(e={})=>{const t=at(),{areSpacesLoading:n}=Jb(),r=tn("shareId"),i=tn("fileId"),o=B(()=>Ct(f(i))),s=dt(),a=Ke(),l=B(()=>t.spaces),u=le(null),c=le(null),p=le(!1),d=m=>{const b=m.split("/");return f(l).find(w=>{if(!m.startsWith(w.driveAlias))return!1;const S=w.driveAlias.split("/");return b.length<S.length||b.slice(0,S.length).join("/")!==w.driveAlias?!1:w})};return kl(()=>{const m=f(e.driveAliasAndItem);!m?.startsWith("personal/")&&!m?.startsWith("project/")&&t.setCurrentSpace(null)}),st([e.driveAliasAndItem,n],async([m,b],[w,S])=>{if(m===w&&b===S)return;if(!m||m.startsWith("virtual/")){u.value=null,c.value=null;return}if(f(u)&&m.startsWith(f(u).driveAlias)){c.value=re.urlJoin(m.slice(f(u).driveAlias.length),{leadingSlash:!0});return}let g=null,v=null;if(m.startsWith("public/")||m.startsWith("ocm/")){const[h,...E]=m.split("/").slice(1);g=f(l).find(T=>T.id===h),v=E.join("/")}else if(m.startsWith("share/")||m.startsWith("ocm-share/")){const[h,...E]=m.split("/").slice(1),T=m.startsWith("ocm-share/")?"ocm-share":"share";let R=Ct(f(r));R?.includes(":")&&(R=[re.SHARE_JAIL_ID,R].join("!")),g=t.getSpace(R)||t.createShareSpace({driveAliasPrefix:T,id:R,shareName:f(h)}),v=E.join("/")}else f(o)?g=f(l).find(h=>f(o).startsWith(`${h.fileId}`)):g=d(m),g||(!t.mountPointsInitialized&&s.options.routing.fullShareOwnerPaths&&(p.value=!0,await t.loadMountPoints({graphClient:a.graphAuthenticated})),g=d(m)),g&&(v=m.slice(g.driveAlias.length));u.value=g,c.value=re.urlJoin(v,{leadingSlash:!0}),p.value=!1},{immediate:!0,deep:!0}),st(u,m=>{t.setCurrentSpace(m)},{immediate:!0}),{space:u,item:c,itemId:o,loading:p}};function ew(e){const t=He(),n=ar(),r=Ht(),i=e.clientService??Ke(),o=e.applicationId,s=li(),{publicLinkContextReady:a}=Me.storeToRefs(s),l=Aa("driveAliasAndItem"),{space:u,item:c,itemId:p,loading:d}=Zb({driveAliasAndItem:l}),m=B(()=>{if(f(d))return null;let b;return f(u)?b=re.urlJoin(f(u).webDavPath,f(c)):b=re.urlJoin(Ct(f(r).params.filePath)),{path:b,driveAliasAndItem:f(l),space:f(u),item:f(c),itemId:f(p),fileName:ft.basename(b),routeName:Ct(f(r).query[xa]),...Kb(f(r).query)}});return vF({appsStore:n,applicationId:o,applicationName:e.applicationName,currentFileContext:m,currentRoute:r}),{isPublicLinkContext:a,currentFileContext:m,...sm({appsStore:n,...e}),...Gb({router:t,currentFileContext:m}),...Yf({clientService:i}),...Qb({clientService:i,currentRoute:r}),...Yb({clientService:i,currentRoute:f(r)})}}const bF=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}}),wF=()=>[{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:re.urlJoin("personal/home",Ct(e.params.item),{leadingSlash:!1})}})},{path:"/list/favorites",redirect:e=>$i("files-common-favorites",e)},{path:"/list/shared-with-me",redirect:e=>Fn("files-shares-with-me",e)},{path:"/list/shared-with-others",redirect:e=>Fn("files-shares-with-others",e)},{path:"/list/shared-via-link",redirect:e=>Fn("files-shares-via-link",e)},{path:"/trash-bin",redirect:e=>Hr("files-trash-generic",e)},{path:"/public/list/:item(.*)",redirect:e=>Mi("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(bF),SF=(e,...t)=>{const[n,...r]=t.map(i=>{const o={"files-personal":Kn("files-spaces-generic").name,"files-favorites":$i("files-common-favorites").name,"files-shared-with-others":Fn("files-shares-with-others").name,"files-shared-with-me":Fn("files-shares-with-me").name,"files-trashbin ":Hr("files-trash-generic").name,"files-public-list":Mi("files-public-link").name}[i.name.toString()];return o&&console.warn(`route name "${name}" is deprecated, use "${o.toString()}" instead.`),{...i,...!!o&&{name:o}}});return nc(e,n,...r)},EF={name:"root",path:"/",redirect:e=>Kn("files-spaces-generic",e)},TF=e=>[EF,...ZA(e),...nx(e),...rx(e),...ex(e),...ix(e),...wF()],Ca=()=>{const e=Ke();return{getDefaultMetaFolder:async n=>{const{children:r}=await e.webdav.listFiles(n);return r.find(({name:i})=>i===".space")}}},ln=e=>{const t=vt(),n=at(),r=dt(),i=B(()=>n.spaces),o=Aa("driveAliasAndItem"),s=p=>f(e?.space)||f(i).find(d=>d.id===p),a=p=>{let d=p.storageId;(f(o)?.startsWith("public/")||f(o)?.startsWith("ocm/"))&&(d=f(o).split("/")[1]);const m=s(d);if(m&&!re.isMountPointSpaceResource(m))return m;const b=re.isShareResource(p)&&p.shareTypes.includes(re.ShareTypes.remote.value)||p?.id?.toString().startsWith(re.OCM_PROVIDER_ID)?"ocm-share":"share";let w;return p.remoteItemPath?w=ft.basename(p.remoteItemPath):f(o)?.startsWith("share/")||f(o)?.startsWith("ocm-share/")?w=f(o).split("/")[1]:w=p.name,n.getSpace(p.remoteItemId)||n.createShareSpace({driveAliasPrefix:b,id:p.remoteItemId,shareName:w})},l=p=>f(i).filter(d=>re.isMountPointSpaceResource(d)&&re.extractStorageId(d.root.remoteItem.rootId)===p.id);return{getInternalSpace:s,getMatchingSpace:a,isPersonalSpaceRoot:p=>p?.storageId&&p?.storageId===n.personalSpace?.storageId&&p?.path==="/"&&!re.isIncomingShareResource(p),isResourceAccessible:({space:p,path:d})=>{if(!r.options.routing.fullShareOwnerPaths)return!0;const m=f(i).some(w=>re.isProjectSpaceResource(w)&&w.id===p.id);return p.isOwner(t.user)||m||l(p).some(w=>d.startsWith(w.root.remoteItem.path))}}},Qi=()=>{const e=Ke(),t=ze();return{createSpace:i=>{const{graphAuthenticated:o}=e;return o.drives.createDrive({name:i},{params:{template:"default"}})},createDefaultMetaFolder:async i=>{const o=await e.webdav.createFolder(i,{path:".space"});return re.extractStorageId(o.parentFolderId)===t.currentFolder?.id&&t.upsertResource(o),o}}},gn=()=>Ar("$loadingService"),ka=()=>{const e=li(),t=Ke(),n=Ie.useGettext();return{headers:B(()=>{const i=new gc({accessToken:e.accessToken,publicLinkToken:e.publicLinkToken,publicLinkPassword:e.publicLinkPassword});return{"Accept-Language":n.current,"Initiator-ID":t.initiatorId,"X-Request-ID":Xt.v4(),...i.getHeaders()}})}};function AF(e){return new Worker("/assets/worker-BeDmEhWu.js",{name:e?.name})}const tw=({concurrentRequests:e=4}={})=>{const t=dt(),n=gn(),{headers:r}=ka(),{createWorker:i,terminateWorker:o}=qo(),s=({topic:l,space:u,resources:c},p)=>{const d=i(AF,{needsTokenRenewal:!0});let m;f(d.worker).onmessage=b=>{o(d.id),m?.(!0);const{successful:w,failed:S}=JSON.parse(b.data),y=S.map(({resource:g,...v})=>({resource:g,error:re.createHttpError(v)}));p({successful:w,failed:y})},n.addTask(()=>new Promise(b=>{m=b})),d.post(a({topic:l,space:u,resources:c}))},a=({topic:l,space:u,resources:c})=>JSON.stringify({topic:l,data:{space:u,resources:c,concurrentRequests:e,baseUrl:t.serverUrl,headers:{...f(r),"X-Request-ID":void 0}}});return{startWorker:s}};function xF(e){return new Worker("/assets/worker-DWoO7i6z.js",{name:e?.name})}const nw=()=>{const e=dt(),t=gn(),{headers:n}=ka(),{createWorker:r,terminateWorker:i}=qo(),o=(a,l)=>{const u=r(xF,{needsTokenRenewal:!0});let c;f(u.worker).onmessage=p=>{i(u.id),c?.(!0);const{successful:d,failed:m}=JSON.parse(p.data),b=m.map(({resourceName:w,...S})=>({resourceName:w,error:re.createHttpError(S)}));l({successful:d,failed:b})},t.addTask(()=>new Promise(p=>{c=p})),u.post(s(a))},s=a=>JSON.stringify({topic:"startProcess",data:{transferData:a,baseUrl:e.serverUrl,headers:{...f(n),"X-Request-ID":void 0}}});return{startWorker:o}};function RF(e){return new Worker("/assets/worker-Bc2UmjVr.js",{name:e?.name})}const rw=()=>{const e=dt(),t=gn(),{headers:n}=ka(),{createWorker:r,terminateWorker:i}=qo(),o=({space:a,resources:l,missingFolderPaths:u},c)=>{const p=r(RF,{needsTokenRenewal:!0});let d;f(p.worker).onmessage=m=>{i(p.id),d?.(!0);const{successful:b,failed:w}=JSON.parse(m.data),S=w.map(({resource:y,...g})=>({resource:y,error:re.createHttpError(g)}));c({successful:b,failed:S})},t.addTask(()=>new Promise(m=>{d=m})),p.post(s({space:a,resources:l,missingFolderPaths:u}))},s=({space:a,resources:l,missingFolderPaths:u})=>JSON.stringify({topic:"startProcess",data:{space:a,resources:l,missingFolderPaths:u,baseUrl:e.serverUrl,headers:{...f(n),"X-Request-ID":void 0}}});return{startWorker:o}};function CF(e){return new Worker("/assets/worker-BBQqm_-D.js",{name:e?.name})}const kF=({authService:e})=>{const{createWorker:t}=qo(),n=le();return{startWorker:()=>{n.value=t(CF),f(f(n).worker).onmessage=()=>{e.signinSilent().catch(async s=>{if(s instanceof CS.ErrorTimeout){console.warn("token renewal timed out, retrying in 5 seconds..."),f(n).post(JSON.stringify({topic:"set",expiry:5,expiryThreshold:0}));return}if(console.error("token renewal error:",s),!await e.getRefreshToken())return e.logoutUser()})}},setTokenTimer:({expiry:s,expiryThreshold:a})=>{if(!f(n)){console.error("token timer worker is not running");return}f(n).post(JSON.stringify({topic:"set",expiry:s,expiryThreshold:a}))},resetTokenTimer:()=>{if(!f(n)){console.error("token timer worker is not running");return}f(n).post(JSON.stringify({topic:"reset"}))}}};function PF(e){return e==null}const Xn=()=>{const e=ar(),t=He(),n=Za(),{isEnabled:r}=Qr(),{requestExtensions:i}=Ki(),o=_r(),{openUrl:s}=W0(),a=dt(),{options:l}=Me.storeToRefs(a),{actions:u}=Qa(),{actions:c}=Ja(),{actions:p}=Pa(),{actions:d}=ss(),{actions:m}=Ka(),{actions:b}=Ga(),{actions:w}=as(),{actions:S}=Pd(),{actions:y}=Xa(),{actions:g}=S0(),{actions:v}=Ya(),{actions:h}=ls(),{actions:E}=kd(),T=B(()=>[...f(b),...f(w),...f(d),...f(y),...f(p),...f(v),...f(E),...f(h),...f(u),...f(c),...f(m),...f(S)]),R=B(()=>(i({id:"global.files.context-actions",extensionType:"action"})||[]).map(L=>L.action).filter(L=>PF(L.category)||L.category==="context"||L.category==="actions")),x=B(()=>f(r)?[]:e.fileExtensions.map(L=>{const te=e.apps[L.app];return{name:`editor-${L.app}`,label:()=>L.label?typeof L.label=="function"?L.label():L.label:te.name,icon:L.icon||te.icon,...te.iconFillType&&{iconFillType:te.iconFillType},img:te.img,route:({space:Y,resources:se})=>A({appFileExtension:L,space:Y,resource:se[0]}),handler:Y=>W(L,Y.space,Y.resources[0]),isVisible:({resources:Y})=>!f(o)||Y.length!==1||!Y[0].canDownload()&&!L.secureView||!f(n)&&yn(t,"files-trash-generic")?!1:Y[0].extension&&L.extension?Y[0].extension.toLowerCase()===L.extension.toLowerCase():Y[0].mimeType&&L.mimeType?Y[0].mimeType.toLowerCase()===L.mimeType.toLowerCase()||Y[0].mimeType.split("/")[0].toLowerCase()===L.mimeType.toLowerCase():!1,hasPriority:L.hasPriority,class:`oc-files-actions-${Ib(te.name).toLowerCase()}-trigger`}}).sort((L,te)=>te.hasPriority!==L.hasPriority&&te.hasPriority?1:0)),A=({appFileExtension:L,space:te,resource:Y})=>{const se=re.isShareSpaceResource(te)?te.id:void 0,he=L.routeName||L.app,ae=N(he,te,Y,se);return t.resolve(ae)},N=(L,te,Y,se,he)=>({name:L,params:{driveAliasAndItem:te?.getDriveAliasAndItem(Y)},query:{...se&&{shareId:se},...Y.fileId&&f(l).routing.idBased&&{fileId:Y.fileId},...he&&{templateId:he},...Ra(f(t.currentRoute))}}),W=(L,te,Y)=>{const se=re.isShareSpaceResource(te)?te.id:void 0,he=L.routeName||L.app,ae=N(he,te,Y,se);if(f(l).cernFeatures){const we=t.resolve(ae).href,Q=`${L.routeName}-${Y.path}`;s(we,Q,!0);return}t.push(ae)},O=L=>{const te=D(L);te&&te.handler({...L})},D=L=>{const te=V(L);if(te.length)return te[0]},V=L=>{const te=he=>he.isVisible(L),Y=[...f(R),...f(x),...f(g)].filter(te).sort((he,ae)=>Number(ae.hasPriority)-Number(he.hasPriority)),se=L.omitSystemActions?[]:f(T).filter(te);return[...Y,...se]};return{getDefaultAction:D,getAllOpenWithActions:V,getEditorRouteOpts:N,openEditor:W,triggerDefaultAction:O}},Pa=()=>{const e=dt(),t=He(),{copyResources:n}=Uo(),r=Ie.useGettext(),{$gettext:i}=r,o=ze(),{currentFolder:s}=Me.storeToRefs(o),a=B(()=>jo()?i("⌘ + C"):i("Ctrl + C")),l=({resources:c})=>{Vt(t,"files-common-search")&&(c=c.filter(p=>!re.isProjectSpaceResource(p))),n(c)};return{actions:B(()=>[{name:"copy",icon:"file-copy-2",handler:l,shortcut:f(a),label:()=>i("Copy"),isVisible:({resources:c})=>{if(!xt(t,"files-spaces-generic")&&!_n(t,"files-public-link")&&!Vt(t,"files-common-favorites")&&!Vt(t,"files-common-search")||xt(t,"files-spaces-projects")||c.length===0)return!1;if(_n(t,"files-public-link"))return f(s)?.canCreate();if(Vt(t,"files-common-search")&&c.every(p=>re.isProjectSpaceResource(p)))return!1;if(f(e.options.runningOnEos)){const p=c[0].path?.split("/").filter(Boolean)||[];if(xt(t,"files-spaces-generic")&&p.length<5)return!1}return!!f(c)[0].canDownload()},class:"oc-files-actions-copy-trigger"}])}};var fr=(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))(fr||{}),Ia=(e=>(e.Ctrl="Control",e.Shift="Shift",e))(Ia||{});const IF=()=>{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"},Oa=e=>{const t=le([]),n=le(0),r=a=>{if(!e?.skipDisabledKeyBindingsCheck&&IF())return;const{key:l,ctrlKey:u,metaKey:c,shiftKey:p}=a;let d=null;const m=[];c||u?(d="Control",m.push("altKey","shiftKey")):p&&(d="Shift",m.push("altKey","ctrlKey","metaKey")),!((w,S)=>S.some(y=>w[y]))(a,m)&&f(t).filter(w=>w.primary===l&&w.modifier===d).forEach(w=>{w.preventDefault&&a.preventDefault(),w.callback(a)})},i=(a,l,{preventDefault:u=!0}={})=>{const c=Xt.v4();return t.value.push({id:c,...a,modifier:a.modifier??null,preventDefault:u,callback:l}),c},o=a=>{t.value=t.value.filter(l=>l.id!==a)},s=()=>{n.value=0};return Yn.useEventListener(document,"keydown",r),{actions:t,bindKeyAction:i,removeKeyAction:o,selectionCursor:n,resetSelectionCursor:s}};function gi(){return{interceptModifierClick:(t,n)=>{if(!t||!n)return!1;const r=t.shiftKey,i=t.ctrlKey||t.metaKey;return!r&&!i?!1:(t.stopPropagation?.(),t.stopImmediatePropagation?.(),r&&Je.publish("app.files.list.clicked.shift",{resource:n,skipTargetSelection:!1}),i&&Je.publish("app.files.list.clicked.meta",n),!0)}}}const td=()=>{const e=Oa(),t=10,n=.1;return{setCropperInstance:i=>{e.bindKeyAction({primary:fr.ArrowRight},()=>f(i)?.move(-t,0)),e.bindKeyAction({primary:fr.ArrowLeft},()=>f(i)?.move(t,0)),e.bindKeyAction({primary:fr.ArrowDown},()=>f(i)?.move(0,-t)),e.bindKeyAction({primary:fr.ArrowUp},()=>f(i)?.move(0,t)),e.bindKeyAction({primary:fr.Plus},()=>f(i)?.zoom(n)),e.bindKeyAction({primary:fr.Minus},()=>f(i)?.zoom(-n))}}},nd=()=>{const{showMessage:e,showErrorMessage:t}=nt(),{$gettext:n}=Ie.useGettext(),{copy:r}=Yn.useClipboard(),{interceptModifierClick:i}=gi(),o=async a=>{try{await r(a),e({title:n("The link has been copied to your clipboard.")})}catch(l){t({title:n("Copy link failed"),errors:[l]})}};return{actions:B(()=>[{name:"copy-permanent-link",icon:"link",label:()=>n("Copy permanent link"),handler:a=>{const{resources:l,event:u}=a,c=l[0];if(!(u&&i(u,c)))return o(c.privateLink)},isVisible:({space:a,resources:l})=>!(l.length!==1||re.isPublicSpaceResource(a)||re.isTrashResource(l[0])),class:"oc-files-actions-copy-permanent-link-trigger"}])}},zo={};function OF(e){return e.getIsPending!==void 0}function FF(e){if(OF(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 _F(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 DF(e){return Object.keys(e).reduce((t,n)=>(e[n]!==!1&&e[n]!==null&&e[n]!==void 0&&(t[n]=e[n]),t),{})}function NF(e,t){const{class:n,style:r,...i}=_F(e),{class:o,style:s,...a}=DF(t);return{class:[n,o],style:[r,s],...i,...a}}const iw=_e({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,i=n,o=Fl(),s=le(),a=le(),l=le(),u=Math.random().toString(36).substring(2);t({svgElSource:s,request:l}),st(()=>r.src,S=>{p(S)}),p(r.src);function c(S){if(S=S.cloneNode(!0),r.uniqueIds){const y=typeof r.uniqueIds=="string"?r.uniqueIds:u;S=w(S,y,r.uniqueIdsBase)}return S=r.transformSource(S),r.title&&b(S,r.title),S.innerHTML}function p(S){zo[S]||(zo[S]=d(S)),s.value&&zo[S].getIsPending()&&!r.keepDuringLoading&&(s.value=null,i("unloaded")),zo[S].then(y=>{s.value=y,zt(()=>{i("loaded",a.value)})}).catch(y=>{s.value&&(s.value=void 0,i("unloaded")),delete zo[S],i("error",y)})}function d(S){return FF(new Promise((y,g)=>{const v=new XMLHttpRequest;v.open("GET",S,!0),l.value=v,v.onload=()=>{if(v.status>=200&&v.status<400)try{let h=new DOMParser().parseFromString(v.responseText,"text/xml").getElementsByTagName("svg")[0];h?y(h):g(new Error('Loaded file is not valid SVG"'))}catch(h){g(h)}else g(new Error("Error loading SVG"))},v.onerror=g,v.send()}))}const m=()=>s.value?Ll("svg",{...NF(s.value,o),innerHTML:c(s.value),ref:a}):null;function b(S,y){const g=S.getElementsByTagName("title");if(g.length)g[0].textContent=y;else{const v=document.createElementNS("http://www.w3.org/2000/svg","title");v.textContent=y,S.insertBefore(v,S.firstChild)}}function w(S,y,g=""){const v=["id","href","xlink:href","xlink:role","xlink:arcrole"],h=["href","xlink:href"],E=(T,R)=>h.includes(T)&&(R?!R.includes("#"):!1);return[...S.children].forEach(T=>{var R;if((R=T.attributes)!=null&&R.length){const x=Object.values(T.attributes).map(A=>{const N=/url\((.*?)\)/.exec(A.value);return N!=null&&N[1]&&(A.value=A.value.replace(N[0],`url(${g}${N[1]}_${y})`)),A});v.forEach(A=>{const N=x.find(W=>W.name===A);N&&!E(A,N.value)&&(N.value=`${N.value}_${y}`)})}return T.children.length?w(T,y,g):T}),S}return(S,y)=>(X(),Te(m))}}),Pr=_e({__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}){iw.name="inline-svg";const n=t,r=B(()=>ci("oc-icon-title-")),i=B(()=>{const a=`${yx()}icons/`,l=e.fillType.toLowerCase();return l==="none"?`${a}${e.name}.svg`:`${a}${e.name}-${l}.svg`}),o=B(()=>({"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"})),s=a=>{if(e.accessibleLabel!==""){const l=document.createElement("title");l.setAttribute("id",r.value),l.appendChild(document.createTextNode(e.accessibleLabel)),a.insertBefore(l,a.firstChild)}return a};return(a,l)=>(X(),Te(Pn(e.type),{class:z.normalizeClass(["oc-icon","box-content","inline-block","align-baseline","[&_svg]:block",o.value,{"bg-transparent min-h-0":e.type==="button"}])},{default:ve(()=>[me(f(iw),{src:i.value,"transform-source":s,"aria-hidden":e.accessibleLabel===""?"true":null,"aria-labelledby":e.accessibleLabel===""?null:r.value,focusable:e.accessibleLabel===""?"false":null,style:z.normalizeStyle(e.color!==""?{fill:e.color}:{}),class:z.normalizeClass(o.value),onLoaded:l[0]||(l[0]=u=>n("loaded"))},null,8,["src","aria-hidden","aria-labelledby","focusable","style","class"])]),_:1},8,["class"]))}});var ow=["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] *)"],Fa=ow.join(","),sw=typeof Element>"u",yi=sw?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,_a=!sw&&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},Da=function(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=i===""||i==="true",s=o||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Da(t.parentNode));return s},LF=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},aw=function(t,n,r){if(Da(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Fa));return n&&yi.call(t,Fa)&&i.unshift(t),i=i.filter(r),i},Na=function(t,n,r){for(var i=[],o=Array.from(t);o.length;){var s=o.shift();if(!Da(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=Na(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:s,candidates:u})}else{var c=yi.call(s,Fa);c&&r.filter(s)&&(n||!t.includes(s))&&i.push(s);var p=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),d=!Da(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(p&&d){var m=Na(p===!0?s.children:p.children,!0,r);r.flatten?i.push.apply(i,m):i.push({scopeParent:s,candidates:m})}else o.unshift.apply(o,s.children)}}return i},lw=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},vi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||LF(t))&&!lw(t)?0:t.tabIndex},$F=function(t,n){var r=vi(t);return r<0&&n&&!lw(t)?0:r},MF=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},cw=function(t){return t.tagName==="INPUT"},BF=function(t){return cw(t)&&t.type==="hidden"},jF=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},UF=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},VF=function(t){if(!t.name)return!0;var n=t.form||_a(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(s){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",s.message),!1}var o=UF(i,t.form);return!o||o===t},qF=function(t){return cw(t)&&t.type==="radio"},zF=function(t){return qF(t)&&!VF(t)},WF=function(t){var n,r=t&&_a(t),i=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var s,a,l;for(o=!!((s=i)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&i;){var u,c,p;r=_a(i),i=(u=r)===null||u===void 0?void 0:u.host,o=!!((c=i)!==null&&c!==void 0&&(p=c.ownerDocument)!==null&&p!==void 0&&p.contains(i))}}return o},uw=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},HF=function(t,n){var r=n.displayCheck,i=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 s=yi.call(t,"details>summary:first-of-type"),a=s?t.parentElement:t;if(yi.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var l=t;t;){var u=t.parentElement,c=_a(t);if(u&&!u.shadowRoot&&i(u)===!0)return uw(t);t.assignedSlot?t=t.assignedSlot:!u&&c!==t.ownerDocument?t=c.host:t=u}t=l}if(WF(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return uw(t);return!1},KF=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 i=n.children.item(r);if(i.tagName==="LEGEND")return yi.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},La=function(t,n){return!(n.disabled||BF(n)||HF(n,t)||jF(n)||KF(n))},rd=function(t,n){return!(zF(n)||vi(n)<0||!La(t,n))},GF=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},fw=function(t){var n=[],r=[];return t.forEach(function(i,o){var s=!!i.scopeParent,a=s?i.scopeParent:i,l=$F(a,s),u=s?fw(i.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:o,tabIndex:l,item:i,isScope:s,content:u})}),r.sort(MF).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},QF=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Na([t],n.includeContainer,{filter:rd.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:GF}):r=aw(t,n.includeContainer,rd.bind(null,n)),fw(r)},XF=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Na([t],n.includeContainer,{filter:La.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=aw(t,n.includeContainer,La.bind(null,n)),r},Xi=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return yi.call(t,Fa)===!1?!1:rd(n,t)},YF=ow.concat("iframe:not([inert]):not([inert] *)").join(","),id=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return yi.call(t,YF)===!1?!1:La(n,t)};function od(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 JF(e){if(Array.isArray(e))return od(e)}function dw(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=mw(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
42
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return s=l.done,l},e:function(l){a=!0,o=l},f:function(){try{s||n.return==null||n.return()}finally{if(a)throw o}}}}function ZF(e,t,n){return(t=i_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e_(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function t_(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
43
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pw(Object(n),!0).forEach(function(r){ZF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pw(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function n_(e){return JF(e)||e_(e)||mw(e)||t_()}function r_(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 i_(e){var t=r_(e,"string");return typeof t=="symbol"?t:t+""}function mw(e,t){if(e){if(typeof e=="string")return od(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)?od(e,t):void 0}}var Ir={getActiveTrap:function(t){return t?.length>0?t[t.length-1]:null},activateTrap:function(t,n){var r=Ir.getActiveTrap(t);n!==r&&Ir.pauseTrap(t);var i=t.indexOf(n);i===-1||t.splice(i,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),Ir.unpauseTrap(t)},pauseTrap:function(t){var n=Ir.getActiveTrap(t);n?._setPausedState(!0)},unpauseTrap:function(t){var n=Ir.getActiveTrap(t);n&&!n._isManuallyPaused()&&n._setPausedState(!1)}},o_=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},s_=function(t){return t?.key==="Escape"||t?.key==="Esc"||t?.keyCode===27},Wo=function(t){return t?.key==="Tab"||t?.keyCode===9},a_=function(t){return Wo(t)&&!t.shiftKey},l_=function(t){return Wo(t)&&t.shiftKey},gw=function(t){return setTimeout(t,0)},Ho=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return typeof t=="function"?t.apply(void 0,r):t},$a=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},c_=[],u_=function(t,n){var r=n?.document||document,i=n?.trapStack||c_,o=hw({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:a_,isKeyBackward:l_},n),s={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},a,l=function(V,L,te){return V&&V[L]!==void 0?V[L]:o[te||L]},u=function(V,L){var te=typeof L?.composedPath=="function"?L.composedPath():void 0;return s.containerGroups.findIndex(function(Y){var se=Y.container,he=Y.tabbableNodes;return se.contains(V)||te?.includes(se)||he.find(function(ae){return ae===V})})},c=function(V){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},te=L.hasFallback,Y=te===void 0?!1:te,se=L.params,he=se===void 0?[]:se,ae=o[V];if(typeof ae=="function"&&(ae=ae.apply(void 0,n_(he))),ae===!0&&(ae=void 0),!ae){if(ae===void 0||ae===!1)return ae;throw new Error("`".concat(V,"` was specified but was not a node, or did not return a node"))}var we=ae;if(typeof ae=="string"){try{we=r.querySelector(ae)}catch(Q){throw new Error("`".concat(V,'` appears to be an invalid selector; error="').concat(Q.message,'"'))}if(!we&&!Y)throw new Error("`".concat(V,"` as selector refers to no known node"))}return we},p=function(){var V=c("initialFocus",{hasFallback:!0});if(V===!1)return!1;if(V===void 0||V&&!id(V,o.tabbableOptions))if(u(r.activeElement)>=0)V=r.activeElement;else{var L=s.tabbableGroups[0],te=L&&L.firstTabbableNode;V=te||c("fallbackFocus")}else V===null&&(V=c("fallbackFocus"));if(!V)throw new Error("Your focus-trap needs to have at least one focusable element");return V},d=function(){if(s.containerGroups=s.containers.map(function(V){var L=QF(V,o.tabbableOptions),te=XF(V,o.tabbableOptions),Y=L.length>0?L[0]:void 0,se=L.length>0?L[L.length-1]:void 0,he=te.find(function(Q){return Xi(Q)}),ae=te.slice().reverse().find(function(Q){return Xi(Q)}),we=!!L.find(function(Q){return vi(Q)>0});return{container:V,tabbableNodes:L,focusableNodes:te,posTabIndexesFound:we,firstTabbableNode:Y,lastTabbableNode:se,firstDomTabbableNode:he,lastDomTabbableNode:ae,nextTabbableNode:function(ie){var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Ae=L.indexOf(ie);return Ae<0?ce?te.slice(te.indexOf(ie)+1).find(function(ee){return Xi(ee)}):te.slice(0,te.indexOf(ie)).reverse().find(function(ee){return Xi(ee)}):L[Ae+(ce?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(V){return V.tabbableNodes.length>0}),s.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(s.containerGroups.find(function(V){return V.posTabIndexesFound})&&s.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.")},m=function(V){var L=V.activeElement;if(L)return L.shadowRoot&&L.shadowRoot.activeElement!==null?m(L.shadowRoot):L},b=function(V){if(V!==!1&&V!==m(document)){if(!V||!V.focus){b(p());return}V.focus({preventScroll:!!o.preventScroll}),s.mostRecentlyFocusedNode=V,o_(V)&&V.select()}},w=function(V){var L=c("setReturnFocus",{params:[V]});return L||(L===!1?!1:V)},S=function(V){var L=V.target,te=V.event,Y=V.isBackward,se=Y===void 0?!1:Y;L=L||$a(te),d();var he=null;if(s.tabbableGroups.length>0){var ae=u(L,te),we=ae>=0?s.containerGroups[ae]:void 0;if(ae<0)se?he=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:he=s.tabbableGroups[0].firstTabbableNode;else if(se){var Q=s.tabbableGroups.findIndex(function(C){var q=C.firstTabbableNode;return L===q});if(Q<0&&(we.container===L||id(L,o.tabbableOptions)&&!Xi(L,o.tabbableOptions)&&!we.nextTabbableNode(L,!1))&&(Q=ae),Q>=0){var ie=Q===0?s.tabbableGroups.length-1:Q-1,ce=s.tabbableGroups[ie];he=vi(L)>=0?ce.lastTabbableNode:ce.lastDomTabbableNode}else Wo(te)||(he=we.nextTabbableNode(L,!1))}else{var Ae=s.tabbableGroups.findIndex(function(C){var q=C.lastTabbableNode;return L===q});if(Ae<0&&(we.container===L||id(L,o.tabbableOptions)&&!Xi(L,o.tabbableOptions)&&!we.nextTabbableNode(L))&&(Ae=ae),Ae>=0){var ee=Ae===s.tabbableGroups.length-1?0:Ae+1,F=s.tabbableGroups[ee];he=vi(L)>=0?F.firstTabbableNode:F.firstDomTabbableNode}else Wo(te)||(he=we.nextTabbableNode(L))}}else he=c("fallbackFocus");return he},y=function(V){var L=$a(V);if(!(u(L,V)>=0)){if(Ho(o.clickOutsideDeactivates,V)){a.deactivate({returnFocus:o.returnFocusOnDeactivate});return}Ho(o.allowOutsideClick,V)||V.preventDefault()}},g=function(V){var L=$a(V),te=u(L,V)>=0;if(te||L instanceof Document)te&&(s.mostRecentlyFocusedNode=L);else{V.stopImmediatePropagation();var Y,se=!0;if(s.mostRecentlyFocusedNode)if(vi(s.mostRecentlyFocusedNode)>0){var he=u(s.mostRecentlyFocusedNode),ae=s.containerGroups[he].tabbableNodes;if(ae.length>0){var we=ae.findIndex(function(Q){return Q===s.mostRecentlyFocusedNode});we>=0&&(o.isKeyForward(s.recentNavEvent)?we+1<ae.length&&(Y=ae[we+1],se=!1):we-1>=0&&(Y=ae[we-1],se=!1))}}else s.containerGroups.some(function(Q){return Q.tabbableNodes.some(function(ie){return vi(ie)>0})})||(se=!1);else se=!1;se&&(Y=S({target:s.mostRecentlyFocusedNode,isBackward:o.isKeyBackward(s.recentNavEvent)})),b(Y||s.mostRecentlyFocusedNode||p())}s.recentNavEvent=void 0},v=function(V){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=V;var te=S({event:V,isBackward:L});te&&(Wo(V)&&V.preventDefault(),b(te))},h=function(V){(o.isKeyForward(V)||o.isKeyBackward(V))&&v(V,o.isKeyBackward(V))},E=function(V){s_(V)&&Ho(o.escapeDeactivates,V)!==!1&&(V.preventDefault(),a.deactivate())},T=function(V){var L=$a(V);u(L,V)>=0||Ho(o.clickOutsideDeactivates,V)||Ho(o.allowOutsideClick,V)||(V.preventDefault(),V.stopImmediatePropagation())},R=function(){if(s.active)return Ir.activateTrap(i,a),s.delayInitialFocusTimer=o.delayInitialFocus?gw(function(){b(p())}):b(p()),r.addEventListener("focusin",g,!0),r.addEventListener("mousedown",y,{capture:!0,passive:!1}),r.addEventListener("touchstart",y,{capture:!0,passive:!1}),r.addEventListener("click",T,{capture:!0,passive:!1}),r.addEventListener("keydown",h,{capture:!0,passive:!1}),r.addEventListener("keydown",E),a},x=function(V){s.active&&!s.paused&&a._setSubtreeIsolation(!1),s.adjacentElements.clear(),s.alreadySilent.clear();var L=new Set,te=new Set,Y=dw(V),se;try{for(Y.s();!(se=Y.n()).done;){var he=se.value;L.add(he);for(var ae=typeof ShadowRoot<"u"&&he.getRootNode()instanceof ShadowRoot,we=he;we;){L.add(we);var Q=we.parentElement,ie=[];Q?ie=Q.children:!Q&&ae&&(ie=we.getRootNode().children,Q=we.getRootNode().host,ae=typeof ShadowRoot<"u"&&Q.getRootNode()instanceof ShadowRoot);var ce=dw(ie),Ae;try{for(ce.s();!(Ae=ce.n()).done;){var ee=Ae.value;te.add(ee)}}catch(F){ce.e(F)}finally{ce.f()}we=Q}}}catch(F){Y.e(F)}finally{Y.f()}L.forEach(function(F){te.delete(F)}),s.adjacentElements=te},A=function(){if(s.active)return r.removeEventListener("focusin",g,!0),r.removeEventListener("mousedown",y,!0),r.removeEventListener("touchstart",y,!0),r.removeEventListener("click",T,!0),r.removeEventListener("keydown",h,!0),r.removeEventListener("keydown",E),a},N=function(V){var L=V.some(function(te){var Y=Array.from(te.removedNodes);return Y.some(function(se){return se===s.mostRecentlyFocusedNode})});L&&b(p())},W=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(N):void 0,O=function(){W&&(W.disconnect(),s.active&&!s.paused&&s.containers.map(function(V){W.observe(V,{subtree:!0,childList:!0})}))};return a={get active(){return s.active},get paused(){return s.paused},activate:function(V){if(s.active)return this;var L=l(V,"onActivate"),te=l(V,"onPostActivate"),Y=l(V,"checkCanFocusTrap"),se=Ir.getActiveTrap(i),he=!1;if(se&&!se.paused){var ae;(ae=se._setSubtreeIsolation)===null||ae===void 0||ae.call(se,!1),he=!0}try{Y||d(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=m(r),L?.();var we=function(){Y&&d(),R(),O(),o.isolateSubtrees&&a._setSubtreeIsolation(!0),te?.()};if(Y)return Y(s.containers.concat()).then(we,we),this;we()}catch(ie){if(se===Ir.getActiveTrap(i)&&he){var Q;(Q=se._setSubtreeIsolation)===null||Q===void 0||Q.call(se,!0)}throw ie}return this},deactivate:function(V){if(!s.active)return this;var L=hw({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},V);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,s.paused||a._setSubtreeIsolation(!1),s.alreadySilent.clear(),A(),s.active=!1,s.paused=!1,O(),Ir.deactivateTrap(i,a);var te=l(L,"onDeactivate"),Y=l(L,"onPostDeactivate"),se=l(L,"checkCanReturnFocus"),he=l(L,"returnFocus","returnFocusOnDeactivate");te?.();var ae=function(){gw(function(){he&&b(w(s.nodeFocusedBeforeActivation)),Y?.()})};return he&&se?(se(w(s.nodeFocusedBeforeActivation)).then(ae,ae),this):(ae(),this)},pause:function(V){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,V)):this},unpause:function(V){return s.active?(s.manuallyPaused=!1,i[i.length-1]!==this?this:this._setPausedState(!1,V)):this},updateContainerElements:function(V){var L=[].concat(V).filter(Boolean);return s.containers=L.map(function(te){return typeof te=="string"?r.querySelector(te):te}),o.isolateSubtrees&&x(s.containers),s.active&&(d(),o.isolateSubtrees&&!s.paused&&a._setSubtreeIsolation(!0)),O(),this}},Object.defineProperties(a,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function(V,L){if(s.paused===V)return this;if(s.paused=V,V){var te=l(L,"onPause"),Y=l(L,"onPostPause");te?.(),A(),O(),a._setSubtreeIsolation(!1),Y?.()}else{var se=l(L,"onUnpause"),he=l(L,"onPostUnpause");se?.(),a._setSubtreeIsolation(!0),d(),R(),O(),he?.()}return this}},_setSubtreeIsolation:{value:function(V){o.isolateSubtrees&&s.adjacentElements.forEach(function(L){var te;V?o.isolateSubtrees==="aria-hidden"?((L.ariaHidden==="true"||((te=L.getAttribute("aria-hidden"))===null||te===void 0?void 0:te.toLowerCase())==="true")&&s.alreadySilent.add(L),L.setAttribute("aria-hidden","true")):((L.inert||L.hasAttribute("inert"))&&s.alreadySilent.add(L),L.setAttribute("inert",!0)):s.alreadySilent.has(L)||(o.isolateSubtrees==="aria-hidden"?L.removeAttribute("aria-hidden"):L.removeAttribute("inert"))})}}}),a.updateContainerElements(t),a};function y8(e){return e}const f_={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},d_=_e({name:"FocusTrap",props:Object.assign({active:{type:Boolean,default:!0}},f_),emits:["update:active","activate","postActivate","deactivate","postDeactivate"],render(){return this.renderImpl()},setup(e,{slots:t,emit:n}){let r;const i=le(null),o=B(()=>{const a=i.value;return a&&(a instanceof HTMLElement?a:a.$el)});function s(){return r||(r=u_(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 Lt(()=>{st(()=>e.active,a=>{a&&o.value?s().activate():r&&(r.deactivate(),(!o.value||o.value.nodeType===Node.COMMENT_NODE)&&(r=null))},{immediate:!0,flush:"post"})}),kl(()=>{r&&r.deactivate(),r=null}),{activate(){s().activate()},deactivate(){r&&r.deactivate()},renderImpl(){if(!t.default)return null;const a=t.default().filter(u=>u.type!==Ii);return!a||!a.length||a.length>1?(console.error("[focus-trap-vue]: FocusTrap requires exactly one child."),a):Oi(a[0],{ref:i})}}}}),wn=_e({__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=B(()=>({...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}})),i=B(()=>({...e.type==="button"&&{click:o}})),o=s=>{n("click",s)};return(s,a)=>{const l=Ee("oc-spinner");return X(),Te(Pn(e.type),$t(r.value,{"aria-label":e.ariaLabel,class:[[`oc-button-${f(Tt.kebabCase)(e.colorRole)}`,`oc-button-${e.appearance}`,`oc-button-${f(Tt.kebabCase)(e.colorRole)}-${e.appearance}`,{...f(vx)(e.gapSize),...f(bx)(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"]},Os(i.value)),{default:ve(()=>[e.showSpinner?(X(),Te(l,{key:0,size:"small",class:"spinner"})):Re("",!0),Ue(s.$slots,"default")]),_:3},16,["aria-label","class"])}}}),p_=["src"],sd=_e({__name:"OcCard",props:{tag:{default:"div"},title:{},titleTag:{default:"h2"},logoUrl:{default:""},headerClass:{default:""},bodyClass:{default:""},footerClass:{default:""}},setup(e){const t=Vp(),n=B(()=>Object.hasOwn(t,"header")||!!f(e.title)||!!f(e.logoUrl)),r=B(()=>Object.hasOwn(t,"footer"));return(i,o)=>(X(),Te(Pn(e.tag),{class:"oc-card"},{default:ve(()=>[n.value?(X(),pe("div",{key:0,class:z.normalizeClass(["oc-card-header",e.headerClass])},[Ue(i.$slots,"header",{},()=>[e.logoUrl?(X(),pe("img",{key:0,src:e.logoUrl,alt:"","aria-hidden":!0,class:"max-w-48 max-h-48 absolute -translate-y-16"},null,8,p_)):Re("",!0),e.title?(X(),Te(Pn(e.titleTag),{key:1,class:"mt-0"},{default:ve(()=>[kt(z.toDisplayString(e.title),1)]),_:1})):Re("",!0)])],2)):Re("",!0),fe("div",{class:z.normalizeClass(["oc-card-body",e.bodyClass])},[Ue(i.$slots,"default")],2),r.value?(X(),pe("div",{key:1,class:z.normalizeClass(["oc-card-footer",e.footerClass])},[Ue(i.$slots,"footer")],2)):Re("",!0)]),_:3}))}}),yw=({target:e,mode:t="show",rootMargin:n="100px",onVisibleCallback:r})=>{if(!(window&&"IntersectionObserver"in window))return{isVisible:le(!0)};const o=le(!1),s=new IntersectionObserver(a=>{const l=a.at(-1).isIntersecting;o.value=l,f(o)&&r&&r(),t!=="showHide"&&o.value&&s.unobserve(e.value)},{rootMargin:n});return st(e,()=>{s.observe(e.value)}),An(()=>s.disconnect()),{isVisible:o}},vw=()=>{const{width:e}=Yn.useWindowSize();return{isMobile:B(()=>e.value<640)}},h_=Me.defineStore("bottomDrawers",()=>{const e=le([]),t=B(()=>f(e).length?f(e)[f(e).length-1]:null);return{drawers:e,currentDrawer:t,showDrawer:()=>{const o={id:ci()};return e.value.push(o),o},closeDrawer:o=>{e.value=f(e).filter(s=>s.id!==o)},closeAllDrawers:()=>{e.value=[]}}}),m_=["id"],g_=["textContent"],y_=_e({__name:"OcBottomDrawer",props:{drawerId:{},toggle:{},closeOnClick:{type:Boolean,default:!1},title:{default:""},usePortal:{type:Boolean,default:!1},portalTarget:{default:"app.runtime.bottom.drawer"}},emits:["show","hide"],setup(e,{expose:t,emit:n}){const r=n,{$gettext:i}=Ie.useGettext(),o=h_(),{showDrawer:s,closeDrawer:a,closeAllDrawers:l}=o,{drawers:u,currentDrawer:c}=Me.storeToRefs(o),p=le(null),d=Tn("bottomDrawerCardBodyRef"),m=B(()=>f(u).map(({id:v})=>v).includes(f(p)?.id)),b=B(()=>f(p)?.id&&f(c)?.id===f(p).id),w=async()=>{p.value=s(),r("show"),await zt(),f(d)?.addEventListener("click",y)},S=()=>{a(f(p)?.id),f(d)?.removeEventListener("click",y),r("hide")},y=v=>{const h=v.target.closest("a[href], button");if(h){if(h.hasAttribute("aria-expanded")){h.setAttribute("aria-expanded","true");return}e.closeOnClick&&(S(),l())}},g=v=>{v.target===v.currentTarget&&l()};return Yn.onKeyStroke("Escape",v=>{v.preventDefault(),l()}),Lt(()=>{f(e.toggle)&&document.querySelector(e.toggle).addEventListener("click",w)}),An(()=>{document.querySelector(e.toggle).removeEventListener("click",w),f(p)&&a(f(p).id)}),st(b,async()=>{f(b)&&(await zt(),document.getElementById(e.drawerId)?.classList.add("active"))}),t({show:w,hide:S}),(v,h)=>{const E=Ee("oc-icon");return m.value?(X(),Te(Pn(e.usePortal?"portal":"div"),{key:0,to:e.usePortal?e.portalTarget:void 0},{default:ve(()=>[fe("div",{class:"oc-bottom-drawer-background fixed inset-0 z-[calc(var(--z-index-modal)+2)] top-0 left-0 bg-black/40 size-full",role:"button",onClick:g},[me(f(d_),{active:b.value},{default:ve(()=>[fe("div",{id:e.drawerId,tabindex:"0",class:z.normalizeClass(["oc-bottom-drawer fixed inset-x-0 bg-role-surface-container-high rounded-t-sm w-full max-h-[66vh] overflow-y-auto transition-all duration-200 bottom-[-100%]",{"[&.active]:bottom-0":b.value}])},[me(sd,{class:"bg-transparent overflow-x-hidden","header-class":"flex flex-row justify-between items-center"},{header:ve(()=>[f(u).length>1?(X(),Te(wn,{key:0,appearance:"raw",class:"raw-hover-surface oc-bottom-drawer-back-button","aria-label":f(i)("Open the parent context menu"),onClick:h[0]||(h[0]=T=>S())},{default:ve(()=>[me(E,{name:"arrow-left","fill-type":"line"})]),_:1},8,["aria-label"])):Re("",!0),fe("span",{class:"font-semibold",textContent:z.toDisplayString(e.title)},null,8,g_),me(wn,{appearance:"raw",class:"raw-hover-surface oc-bottom-drawer-close-button","aria-label":f(i)("Close the context menu"),onClick:h[1]||(h[1]=T=>f(l)())},{default:ve(()=>[me(E,{name:"close","fill-type":"line"})]),_:1},8,["aria-label"])]),default:ve(()=>[fe("div",{ref_key:"bottomDrawerCardBodyRef",ref:d},[Ue(v.$slots,"default")],512)]),_:3})],10,m_)]),_:3},8,["active"])])]),_:3},8,["to"])):Re("",!0)}}});var Sn="top",Mn="bottom",Bn="right",En="left",ad="auto",Ko=[Sn,Mn,Bn,En],Yi="start",Go="end",v_="clippingParents",bw="viewport",Qo="popper",b_="reference",ww=Ko.reduce(function(e,t){return e.concat([t+"-"+Yi,t+"-"+Go])},[]),Sw=[].concat(Ko,[ad]).reduce(function(e,t){return e.concat([t,t+"-"+Yi,t+"-"+Go])},[]),w_="beforeRead",S_="read",E_="afterRead",T_="beforeMain",A_="main",x_="afterMain",R_="beforeWrite",C_="write",k_="afterWrite",P_=[w_,S_,E_,T_,A_,x_,R_,C_,k_];function dr(e){return e?(e.nodeName||"").toLowerCase():null}function Rn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function bi(e){var t=Rn(e).Element;return e instanceof t||e instanceof Element}function jn(e){var t=Rn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function ld(e){if(typeof ShadowRoot>"u")return!1;var t=Rn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function I_(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!jn(o)||!dr(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function O_(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 i=t.elements[r],o=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),a=s.reduce(function(l,u){return l[u]="",l},{});!jn(i)||!dr(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const Ew={name:"applyStyles",enabled:!0,phase:"write",fn:I_,effect:O_,requires:["computeStyles"]};function pr(e){return e.split("-")[0]}var wi=Math.max,Ma=Math.min,Ji=Math.round;function cd(){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 Tw(){return!/^((?!chrome|android).)*safari/i.test(cd())}function Zi(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&jn(e)&&(i=e.offsetWidth>0&&Ji(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Ji(r.height)/e.offsetHeight||1);var s=bi(e)?Rn(e):window,a=s.visualViewport,l=!Tw()&&n,u=(r.left+(l&&a?a.offsetLeft:0))/i,c=(r.top+(l&&a?a.offsetTop:0))/o,p=r.width/i,d=r.height/o;return{width:p,height:d,top:c,right:u+p,bottom:c+d,left:u,x:u,y:c}}function ud(e){var t=Zi(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 Aw(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&ld(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Or(e){return Rn(e).getComputedStyle(e)}function F_(e){return["table","td","th"].indexOf(dr(e))>=0}function Xr(e){return((bi(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ba(e){return dr(e)==="html"?e:e.assignedSlot||e.parentNode||(ld(e)?e.host:null)||Xr(e)}function xw(e){return!jn(e)||Or(e).position==="fixed"?null:e.offsetParent}function __(e){var t=/firefox/i.test(cd()),n=/Trident/i.test(cd());if(n&&jn(e)){var r=Or(e);if(r.position==="fixed")return null}var i=Ba(e);for(ld(i)&&(i=i.host);jn(i)&&["html","body"].indexOf(dr(i))<0;){var o=Or(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Xo(e){for(var t=Rn(e),n=xw(e);n&&F_(n)&&Or(n).position==="static";)n=xw(n);return n&&(dr(n)==="html"||dr(n)==="body"&&Or(n).position==="static")?t:n||__(e)||t}function fd(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Yo(e,t,n){return wi(e,Ma(t,n))}function D_(e,t,n){var r=Yo(e,t,n);return r>n?n:r}function Rw(){return{top:0,right:0,bottom:0,left:0}}function Cw(e){return Object.assign({},Rw(),e)}function kw(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var N_=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Cw(typeof t!="number"?t:kw(t,Ko))};function L_(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=pr(n.placement),l=fd(a),u=[En,Bn].indexOf(a)>=0,c=u?"height":"width";if(!(!o||!s)){var p=N_(i.padding,n),d=ud(o),m=l==="y"?Sn:En,b=l==="y"?Mn:Bn,w=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],S=s[l]-n.rects.reference[l],y=Xo(o),g=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,v=w/2-S/2,h=p[m],E=g-d[c]-p[b],T=g/2-d[c]/2+v,R=Yo(h,T,E),x=l;n.modifiersData[r]=(t={},t[x]=R,t.centerOffset=R-T,t)}}function $_(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||Aw(t.elements.popper,i)&&(t.elements.arrow=i))}const M_={name:"arrow",enabled:!0,phase:"main",fn:L_,effect:$_,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function eo(e){return e.split("-")[1]}var B_={top:"auto",right:"auto",bottom:"auto",left:"auto"};function j_(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Ji(n*i)/i||0,y:Ji(r*i)/i||0}}function Pw(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,p=e.isFixed,d=s.x,m=d===void 0?0:d,b=s.y,w=b===void 0?0:b,S=typeof c=="function"?c({x:m,y:w}):{x:m,y:w};m=S.x,w=S.y;var y=s.hasOwnProperty("x"),g=s.hasOwnProperty("y"),v=En,h=Sn,E=window;if(u){var T=Xo(n),R="clientHeight",x="clientWidth";if(T===Rn(n)&&(T=Xr(n),Or(T).position!=="static"&&a==="absolute"&&(R="scrollHeight",x="scrollWidth")),T=T,i===Sn||(i===En||i===Bn)&&o===Go){h=Mn;var A=p&&T===E&&E.visualViewport?E.visualViewport.height:T[R];w-=A-r.height,w*=l?1:-1}if(i===En||(i===Sn||i===Mn)&&o===Go){v=Bn;var N=p&&T===E&&E.visualViewport?E.visualViewport.width:T[x];m-=N-r.width,m*=l?1:-1}}var W=Object.assign({position:a},u&&B_),O=c===!0?j_({x:m,y:w},Rn(n)):{x:m,y:w};if(m=O.x,w=O.y,l){var D;return Object.assign({},W,(D={},D[h]=g?"0":"",D[v]=y?"0":"",D.transform=(E.devicePixelRatio||1)<=1?"translate("+m+"px, "+w+"px)":"translate3d("+m+"px, "+w+"px, 0)",D))}return Object.assign({},W,(t={},t[h]=g?w+"px":"",t[v]=y?m+"px":"",t.transform="",t))}function U_(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,u={placement:pr(t.placement),variation:eo(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Pw(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Pw(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const V_={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:U_,data:{}};var ja={passive:!0};function q_(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=Rn(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,ja)}),a&&l.addEventListener("resize",n.update,ja),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,ja)}),a&&l.removeEventListener("resize",n.update,ja)}}const z_={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:q_,data:{}};var W_={left:"right",right:"left",bottom:"top",top:"bottom"};function Ua(e){return e.replace(/left|right|bottom|top/g,function(t){return W_[t]})}var H_={start:"end",end:"start"};function Iw(e){return e.replace(/start|end/g,function(t){return H_[t]})}function dd(e){var t=Rn(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function pd(e){return Zi(Xr(e)).left+dd(e).scrollLeft}function K_(e,t){var n=Rn(e),r=Xr(e),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var u=Tw();(u||!u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+pd(e),y:l}}function G_(e){var t,n=Xr(e),r=dd(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=wi(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=wi(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+pd(e),l=-r.scrollTop;return Or(i||n).direction==="rtl"&&(a+=wi(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function hd(e){var t=Or(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Ow(e){return["html","body","#document"].indexOf(dr(e))>=0?e.ownerDocument.body:jn(e)&&hd(e)?e:Ow(Ba(e))}function Jo(e,t){var n;t===void 0&&(t=[]);var r=Ow(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Rn(r),s=i?[o].concat(o.visualViewport||[],hd(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(Jo(Ba(s)))}function md(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Q_(e,t){var n=Zi(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 Fw(e,t,n){return t===bw?md(K_(e,n)):bi(t)?Q_(t,n):md(G_(Xr(e)))}function X_(e){var t=Jo(Ba(e)),n=["absolute","fixed"].indexOf(Or(e).position)>=0,r=n&&jn(e)?Xo(e):e;return bi(r)?t.filter(function(i){return bi(i)&&Aw(i,r)&&dr(i)!=="body"}):[]}function Y_(e,t,n,r){var i=t==="clippingParents"?X_(e):[].concat(t),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,u){var c=Fw(e,u,r);return l.top=wi(c.top,l.top),l.right=Ma(c.right,l.right),l.bottom=Ma(c.bottom,l.bottom),l.left=wi(c.left,l.left),l},Fw(e,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function _w(e){var t=e.reference,n=e.element,r=e.placement,i=r?pr(r):null,o=r?eo(r):null,s=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(i){case Sn:l={x:s,y:t.y-n.height};break;case Mn:l={x:s,y:t.y+t.height};break;case Bn:l={x:t.x+t.width,y:a};break;case En:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var u=i?fd(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case Yi:l[u]=l[u]-(t[c]/2-n[c]/2);break;case Go:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function to(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,s=o===void 0?e.strategy:o,a=n.boundary,l=a===void 0?v_:a,u=n.rootBoundary,c=u===void 0?bw:u,p=n.elementContext,d=p===void 0?Qo:p,m=n.altBoundary,b=m===void 0?!1:m,w=n.padding,S=w===void 0?0:w,y=Cw(typeof S!="number"?S:kw(S,Ko)),g=d===Qo?b_:Qo,v=e.rects.popper,h=e.elements[b?g:d],E=Y_(bi(h)?h:h.contextElement||Xr(e.elements.popper),l,c,s),T=Zi(e.elements.reference),R=_w({reference:T,element:v,placement:i}),x=md(Object.assign({},v,R)),A=d===Qo?x:T,N={top:E.top-A.top+y.top,bottom:A.bottom-E.bottom+y.bottom,left:E.left-A.left+y.left,right:A.right-E.right+y.right},W=e.modifiersData.offset;if(d===Qo&&W){var O=W[i];Object.keys(N).forEach(function(D){var V=[Bn,Mn].indexOf(D)>=0?1:-1,L=[Sn,Mn].indexOf(D)>=0?"y":"x";N[D]+=O[L]*V})}return N}function J_(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?Sw:l,c=eo(r),p=c?a?ww:ww.filter(function(b){return eo(b)===c}):Ko,d=p.filter(function(b){return u.indexOf(b)>=0});d.length===0&&(d=p);var m=d.reduce(function(b,w){return b[w]=to(e,{placement:w,boundary:i,rootBoundary:o,padding:s})[pr(w)],b},{});return Object.keys(m).sort(function(b,w){return m[b]-m[w]})}function Z_(e){if(pr(e)===ad)return[];var t=Ua(e);return[Iw(e),t,Iw(t)]}function eD(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,p=n.rootBoundary,d=n.altBoundary,m=n.flipVariations,b=m===void 0?!0:m,w=n.allowedAutoPlacements,S=t.options.placement,y=pr(S),g=y===S,v=l||(g||!b?[Ua(S)]:Z_(S)),h=[S].concat(v).reduce(function(ce,Ae){return ce.concat(pr(Ae)===ad?J_(t,{placement:Ae,boundary:c,rootBoundary:p,padding:u,flipVariations:b,allowedAutoPlacements:w}):Ae)},[]),E=t.rects.reference,T=t.rects.popper,R=new Map,x=!0,A=h[0],N=0;N<h.length;N++){var W=h[N],O=pr(W),D=eo(W)===Yi,V=[Sn,Mn].indexOf(O)>=0,L=V?"width":"height",te=to(t,{placement:W,boundary:c,rootBoundary:p,altBoundary:d,padding:u}),Y=V?D?Bn:En:D?Mn:Sn;E[L]>T[L]&&(Y=Ua(Y));var se=Ua(Y),he=[];if(o&&he.push(te[O]<=0),a&&he.push(te[Y]<=0,te[se]<=0),he.every(function(ce){return ce})){A=W,x=!1;break}R.set(W,he)}if(x)for(var ae=b?3:1,we=function(Ae){var ee=h.find(function(F){var C=R.get(F);if(C)return C.slice(0,Ae).every(function(q){return q})});if(ee)return A=ee,"break"},Q=ae;Q>0;Q--){var ie=we(Q);if(ie==="break")break}t.placement!==A&&(t.modifiersData[r]._skip=!0,t.placement=A,t.reset=!0)}}const tD={name:"flip",enabled:!0,phase:"main",fn:eD,requiresIfExists:["offset"],data:{_skip:!1}};function Dw(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 Nw(e){return[Sn,Bn,Mn,En].some(function(t){return e[t]>=0})}function nD(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=to(t,{elementContext:"reference"}),a=to(t,{altBoundary:!0}),l=Dw(s,r),u=Dw(a,i,o),c=Nw(l),p=Nw(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":p})}const rD={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:nD};function iD(e,t,n){var r=pr(e),i=[En,Sn].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[En,Bn].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function oD(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,s=Sw.reduce(function(c,p){return c[p]=iD(p,t.rects,o),c},{}),a=s[t.placement],l=a.x,u=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=s}const sD={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:oD};function aD(e){var t=e.state,n=e.name;t.modifiersData[n]=_w({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const lD={name:"popperOffsets",enabled:!0,phase:"read",fn:aD,data:{}};function cD(e){return e==="x"?"y":"x"}function uD(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,p=n.padding,d=n.tether,m=d===void 0?!0:d,b=n.tetherOffset,w=b===void 0?0:b,S=to(t,{boundary:l,rootBoundary:u,padding:p,altBoundary:c}),y=pr(t.placement),g=eo(t.placement),v=!g,h=fd(y),E=cD(h),T=t.modifiersData.popperOffsets,R=t.rects.reference,x=t.rects.popper,A=typeof w=="function"?w(Object.assign({},t.rects,{placement:t.placement})):w,N=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),W=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(T){if(o){var D,V=h==="y"?Sn:En,L=h==="y"?Mn:Bn,te=h==="y"?"height":"width",Y=T[h],se=Y+S[V],he=Y-S[L],ae=m?-x[te]/2:0,we=g===Yi?R[te]:x[te],Q=g===Yi?-x[te]:-R[te],ie=t.elements.arrow,ce=m&&ie?ud(ie):{width:0,height:0},Ae=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Rw(),ee=Ae[V],F=Ae[L],C=Yo(0,R[te],ce[te]),q=v?R[te]/2-ae-C-ee-N.mainAxis:we-C-ee-N.mainAxis,K=v?-R[te]/2+ae+C+F+N.mainAxis:Q+C+F+N.mainAxis,j=t.elements.arrow&&Xo(t.elements.arrow),H=j?h==="y"?j.clientTop||0:j.clientLeft||0:0,ge=(D=W?.[h])!=null?D:0,xe=Y+q-ge-H,De=Y+K-ge,Oe=Yo(m?Ma(se,xe):se,Y,m?wi(he,De):he);T[h]=Oe,O[h]=Oe-Y}if(a){var Ce,Fe=h==="x"?Sn:En,ye=h==="x"?Mn:Bn,We=T[E],Ge=E==="y"?"height":"width",Qe=We+S[Fe],Xe=We-S[ye],lt=[Sn,En].indexOf(y)!==-1,Et=(Ce=W?.[E])!=null?Ce:0,Bt=lt?Qe:We-R[Ge]-x[Ge]-Et+N.altAxis,jt=lt?We+R[Ge]+x[Ge]-Et-N.altAxis:Xe,ct=m&&lt?D_(Bt,We,jt):Yo(m?Bt:Qe,We,m?jt:Xe);T[E]=ct,O[E]=ct-We}t.modifiersData[r]=O}}const fD={name:"preventOverflow",enabled:!0,phase:"main",fn:uD,requiresIfExists:["offset"]};function dD(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function pD(e){return e===Rn(e)||!jn(e)?dd(e):dD(e)}function hD(e){var t=e.getBoundingClientRect(),n=Ji(t.width)/e.offsetWidth||1,r=Ji(t.height)/e.offsetHeight||1;return n!==1||r!==1}function mD(e,t,n){n===void 0&&(n=!1);var r=jn(t),i=jn(t)&&hD(t),o=Xr(t),s=Zi(e,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((dr(t)!=="body"||hd(o))&&(a=pD(t)),jn(t)?(l=Zi(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=pd(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function gD(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function yD(e){var t=gD(e);return P_.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function vD(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function bD(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Lw={placement:"bottom",modifiers:[],strategy:"absolute"};function $w(){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 wD(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?Lw:i;return function(a,l,u){u===void 0&&(u=o);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Lw,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},p=[],d=!1,m={state:c,setOptions:function(y){var g=typeof y=="function"?y(c.options):y;w(),c.options=Object.assign({},o,c.options,g),c.scrollParents={reference:bi(a)?Jo(a):a.contextElement?Jo(a.contextElement):[],popper:Jo(l)};var v=yD(bD([].concat(r,c.options.modifiers)));return c.orderedModifiers=v.filter(function(h){return h.enabled}),b(),m.update()},forceUpdate:function(){if(!d){var y=c.elements,g=y.reference,v=y.popper;if($w(g,v)){c.rects={reference:mD(g,Xo(v),c.options.strategy==="fixed"),popper:ud(v)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(N){return c.modifiersData[N.name]=Object.assign({},N.data)});for(var h=0;h<c.orderedModifiers.length;h++){if(c.reset===!0){c.reset=!1,h=-1;continue}var E=c.orderedModifiers[h],T=E.fn,R=E.options,x=R===void 0?{}:R,A=E.name;typeof T=="function"&&(c=T({state:c,options:x,name:A,instance:m})||c)}}}},update:vD(function(){return new Promise(function(S){m.forceUpdate(),S(c)})}),destroy:function(){w(),d=!0}};if(!$w(a,l))return m;m.setOptions(u).then(function(S){!d&&u.onFirstUpdate&&u.onFirstUpdate(S)});function b(){c.orderedModifiers.forEach(function(S){var y=S.name,g=S.options,v=g===void 0?{}:g,h=S.effect;if(typeof h=="function"){var E=h({state:c,name:y,instance:m,options:v}),T=function(){};p.push(E||T)}})}function w(){p.forEach(function(S){return S()}),p=[]}return m}}var SD=[z_,lD,V_,Ew,sD,tD,fD,M_,rD],ED=wD({defaultModifiers:SD}),TD="tippy-box",Mw="tippy-content",AD="tippy-backdrop",Bw="tippy-arrow",jw="tippy-svg-arrow",Si={passive:!0,capture:!0},Uw=function(){return document.body};function xD(e,t){return{}.hasOwnProperty.call(e,t)}function gd(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function yd(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function Vw(e,t){return typeof e=="function"?e.apply(void 0,t):e}function qw(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function RD(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function CD(e){return e.split(/\s+/).filter(Boolean)}function no(e){return[].concat(e)}function zw(e,t){e.indexOf(t)===-1&&e.push(t)}function kD(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function PD(e){return e.split("-")[0]}function Va(e){return[].slice.call(e)}function Ww(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function Zo(){return document.createElement("div")}function es(e){return["Element","Fragment"].some(function(t){return yd(e,t)})}function ID(e){return yd(e,"NodeList")}function OD(e){return yd(e,"MouseEvent")}function Hw(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function FD(e){return es(e)?[e]:ID(e)?Va(e):Array.isArray(e)?e:Va(document.querySelectorAll(e))}function vd(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function Kw(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function _D(e){var t,n=no(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function DD(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,s=i.popperState,a=i.props,l=a.interactiveBorder,u=PD(s.placement),c=s.modifiersData.offset;if(!c)return!0;var p=u==="bottom"?c.top.y:0,d=u==="top"?c.bottom.y:0,m=u==="right"?c.left.x:0,b=u==="left"?c.right.x:0,w=o.top-r+p>l,S=r-o.bottom-d>l,y=o.left-n+m>l,g=n-o.right-b>l;return w||S||y||g})}function bd(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function Gw(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 hr={isTouch:!1},Qw=0;function ND(){hr.isTouch||(hr.isTouch=!0,window.performance&&document.addEventListener("mousemove",Xw))}function Xw(){var e=performance.now();e-Qw<20&&(hr.isTouch=!1,document.removeEventListener("mousemove",Xw)),Qw=e}function LD(){var e=document.activeElement;if(Hw(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function $D(){document.addEventListener("touchstart",ND,Si),window.addEventListener("blur",LD)}var MD=typeof window<"u"&&typeof document<"u",BD=MD?!!window.msCrypto:!1;function ro(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 Yw(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function jD(e){return Yw(`
44
- %ctippy.js
45
-
46
- %c`+Yw(e)+`
47
-
48
- %c👷‍ This is a development-only message. It will be removed in production.
49
- `)}function Jw(e){return[jD(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var ts;be.env.NODE_ENV!=="production"&&UD();function UD(){ts=new Set}function Fr(e,t){if(e&&!ts.has(t)){var n;ts.add(t),(n=console).warn.apply(n,Jw(t))}}function wd(e,t){if(e&&!ts.has(t)){var n;ts.add(t),(n=console).error.apply(n,Jw(t))}}function VD(e){var t=!e,n=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;wd(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),wd(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var Zw={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},qD={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Cn=Object.assign({appendTo:Uw,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},Zw,qD),zD=Object.keys(Cn),WD=function(t){be.env.NODE_ENV!=="production"&&n0(t,[]);var n=Object.keys(t);n.forEach(function(r){Cn[r]=t[r]})};function e0(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var a;r[o]=e[o]!==void 0?e[o]:(a=Cn[o])!=null?a:s}return r},{});return Object.assign({},e,n)}function HD(e,t){var n=t?Object.keys(e0(Object.assign({},Cn,{plugins:t}))):zD,r=n.reduce(function(i,o){var s=(e.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function t0(e,t){var n=Object.assign({},t,{content:Vw(t.content,[e])},t.ignoreAttributes?{}:HD(e,t.plugins));return n.aria=Object.assign({},Cn.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 n0(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=Object.keys(e);n.forEach(function(r){var i=RD(Cn,Object.keys(Zw)),o=!xD(i,r);o&&(o=t.filter(function(s){return s.name===r}).length===0),Fr(o,["`"+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.",`
50
-
51
- `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
52
- `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var KD=function(){return"innerHTML"};function Sd(e,t){e[KD()]=t}function r0(e){var t=Zo();return e===!0?t.className=Bw:(t.className=jw,es(e)?t.appendChild(e):Sd(t,e)),t}function i0(e,t){es(t.content)?(Sd(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?Sd(e,t.content):e.textContent=t.content)}function Ed(e){var t=e.firstElementChild,n=Va(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(Mw)}),arrow:n.find(function(r){return r.classList.contains(Bw)||r.classList.contains(jw)}),backdrop:n.find(function(r){return r.classList.contains(AD)})}}function o0(e){var t=Zo(),n=Zo();n.className=TD,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Zo();r.className=Mw,r.setAttribute("data-state","hidden"),i0(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,s){var a=Ed(t),l=a.box,u=a.content,c=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&i0(u,e.props),s.arrow?c?o.arrow!==s.arrow&&(l.removeChild(c),l.appendChild(r0(s.arrow))):l.appendChild(r0(s.arrow)):c&&l.removeChild(c)}return{popper:t,onUpdate:i}}o0.$$tippy=!0;var GD=1,qa=[],za=[];function QD(e,t){var n=t0(e,Object.assign({},Cn,e0(Ww(t)))),r,i,o,s=!1,a=!1,l=!1,u=!1,c,p,d,m=[],b=qw(xe,n.interactiveDebounce),w,S=GD++,y=null,g=kD(n.plugins),v={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},h={id:S,reference:e,popper:Zo(),popperInstance:y,props:n,state:v,plugins:g,clearDelayTimeouts:Bt,setProps:jt,setContent:ct,show:Ne,hide:M,hideWithInteractivity:k,enable:lt,disable:Et,unmount:I,destroy:J};if(!n.render)return be.env.NODE_ENV!=="production"&&wd(!0,"render() function has not been supplied."),h;var E=n.render(h),T=E.popper,R=E.onUpdate;T.setAttribute("data-tippy-root",""),T.id="tippy-"+h.id,h.popper=T,e._tippy=h,T._tippy=h;var x=g.map(function(G){return G.fn(h)}),A=e.hasAttribute("aria-expanded");return j(),ae(),Y(),se("onCreate",[h]),n.showOnCreate&&Qe(),T.addEventListener("mouseenter",function(){h.props.interactive&&h.state.isVisible&&h.clearDelayTimeouts()}),T.addEventListener("mouseleave",function(){h.props.interactive&&h.props.trigger.indexOf("mouseenter")>=0&&V().addEventListener("mousemove",b)}),h;function N(){var G=h.props.touch;return Array.isArray(G)?G:[G,0]}function W(){return N()[0]==="hold"}function O(){var G;return!!((G=h.props.render)!=null&&G.$$tippy)}function D(){return w||e}function V(){var G=D().parentNode;return G?_D(G):document}function L(){return Ed(T)}function te(G){return h.state.isMounted&&!h.state.isVisible||hr.isTouch||c&&c.type==="focus"?0:gd(h.props.delay,G?0:1,Cn.delay)}function Y(G){G===void 0&&(G=!1),T.style.pointerEvents=h.props.interactive&&!G?"":"none",T.style.zIndex=""+h.props.zIndex}function se(G,oe,ne){if(ne===void 0&&(ne=!0),x.forEach(function(Le){Le[G]&&Le[G].apply(Le,oe)}),ne){var Pe;(Pe=h.props)[G].apply(Pe,oe)}}function he(){var G=h.props.aria;if(G.content){var oe="aria-"+G.content,ne=T.id,Pe=no(h.props.triggerTarget||e);Pe.forEach(function(Le){var qe=Le.getAttribute(oe);if(h.state.isVisible)Le.setAttribute(oe,qe?qe+" "+ne:ne);else{var Ze=qe&&qe.replace(ne,"").trim();Ze?Le.setAttribute(oe,Ze):Le.removeAttribute(oe)}})}}function ae(){if(!(A||!h.props.aria.expanded)){var G=no(h.props.triggerTarget||e);G.forEach(function(oe){h.props.interactive?oe.setAttribute("aria-expanded",h.state.isVisible&&oe===D()?"true":"false"):oe.removeAttribute("aria-expanded")})}}function we(){V().removeEventListener("mousemove",b),qa=qa.filter(function(G){return G!==b})}function Q(G){if(!(hr.isTouch&&(l||G.type==="mousedown"))){var oe=G.composedPath&&G.composedPath()[0]||G.target;if(!(h.props.interactive&&Gw(T,oe))){if(no(h.props.triggerTarget||e).some(function(ne){return Gw(ne,oe)})){if(hr.isTouch||h.state.isVisible&&h.props.trigger.indexOf("click")>=0)return}else se("onClickOutside",[h,G]);h.props.hideOnClick===!0&&(h.clearDelayTimeouts(),h.hide(),a=!0,setTimeout(function(){a=!1}),h.state.isMounted||ee())}}}function ie(){l=!0}function ce(){l=!1}function Ae(){var G=V();G.addEventListener("mousedown",Q,!0),G.addEventListener("touchend",Q,Si),G.addEventListener("touchstart",ce,Si),G.addEventListener("touchmove",ie,Si)}function ee(){var G=V();G.removeEventListener("mousedown",Q,!0),G.removeEventListener("touchend",Q,Si),G.removeEventListener("touchstart",ce,Si),G.removeEventListener("touchmove",ie,Si)}function F(G,oe){q(G,function(){!h.state.isVisible&&T.parentNode&&T.parentNode.contains(T)&&oe()})}function C(G,oe){q(G,oe)}function q(G,oe){var ne=L().box;function Pe(Le){Le.target===ne&&(bd(ne,"remove",Pe),oe())}if(G===0)return oe();bd(ne,"remove",p),bd(ne,"add",Pe),p=Pe}function K(G,oe,ne){ne===void 0&&(ne=!1);var Pe=no(h.props.triggerTarget||e);Pe.forEach(function(Le){Le.addEventListener(G,oe,ne),m.push({node:Le,eventType:G,handler:oe,options:ne})})}function j(){W()&&(K("touchstart",ge,{passive:!0}),K("touchend",De,{passive:!0})),CD(h.props.trigger).forEach(function(G){if(G!=="manual")switch(K(G,ge),G){case"mouseenter":K("mouseleave",De);break;case"focus":K(BD?"focusout":"blur",Oe);break;case"focusin":K("focusout",Oe);break}})}function H(){m.forEach(function(G){var oe=G.node,ne=G.eventType,Pe=G.handler,Le=G.options;oe.removeEventListener(ne,Pe,Le)}),m=[]}function ge(G){var oe,ne=!1;if(!(!h.state.isEnabled||Ce(G)||a)){var Pe=((oe=c)==null?void 0:oe.type)==="focus";c=G,w=G.currentTarget,ae(),!h.state.isVisible&&OD(G)&&qa.forEach(function(Le){return Le(G)}),G.type==="click"&&(h.props.trigger.indexOf("mouseenter")<0||s)&&h.props.hideOnClick!==!1&&h.state.isVisible?ne=!0:Qe(G),G.type==="click"&&(s=!ne),ne&&!Pe&&Xe(G)}}function xe(G){var oe=G.target,ne=D().contains(oe)||T.contains(oe);if(!(G.type==="mousemove"&&ne)){var Pe=Ge().concat(T).map(function(Le){var qe,Ze=Le._tippy,et=(qe=Ze.popperInstance)==null?void 0:qe.state;return et?{popperRect:Le.getBoundingClientRect(),popperState:et,props:n}:null}).filter(Boolean);DD(Pe,G)&&(we(),Xe(G))}}function De(G){var oe=Ce(G)||h.props.trigger.indexOf("click")>=0&&s;if(!oe){if(h.props.interactive){h.hideWithInteractivity(G);return}Xe(G)}}function Oe(G){h.props.trigger.indexOf("focusin")<0&&G.target!==D()||h.props.interactive&&G.relatedTarget&&T.contains(G.relatedTarget)||Xe(G)}function Ce(G){return hr.isTouch?W()!==G.type.indexOf("touch")>=0:!1}function Fe(){ye();var G=h.props,oe=G.popperOptions,ne=G.placement,Pe=G.offset,Le=G.getReferenceClientRect,qe=G.moveTransition,Ze=O()?Ed(T).arrow:null,et=Le?{getBoundingClientRect:Le,contextElement:Le.contextElement||D()}:e,Dr={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function($e){var je=$e.state;if(O()){var bt=L(),U=bt.box;["placement","reference-hidden","escaped"].forEach(function(P){P==="placement"?U.setAttribute("data-placement",je.placement):je.attributes.popper["data-popper-"+P]?U.setAttribute("data-"+P,""):U.removeAttribute("data-"+P)}),je.attributes.popper={}}}},qt=[{name:"offset",options:{offset:Pe}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!qe}},Dr];O()&&Ze&&qt.push({name:"arrow",options:{element:Ze,padding:3}}),qt.push.apply(qt,oe?.modifiers||[]),h.popperInstance=ED(et,T,Object.assign({},oe,{placement:ne,onFirstUpdate:d,modifiers:qt}))}function ye(){h.popperInstance&&(h.popperInstance.destroy(),h.popperInstance=null)}function We(){var G=h.props.appendTo,oe,ne=D();h.props.interactive&&G===Uw||G==="parent"?oe=ne.parentNode:oe=Vw(G,[ne]),oe.contains(T)||oe.appendChild(T),h.state.isMounted=!0,Fe(),be.env.NODE_ENV!=="production"&&Fr(h.props.interactive&&G===Cn.appendTo&&ne.nextElementSibling!==T,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
53
-
54
- `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
55
-
56
- `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
57
-
58
- `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Ge(){return Va(T.querySelectorAll("[data-tippy-root]"))}function Qe(G){h.clearDelayTimeouts(),G&&se("onTrigger",[h,G]),Ae();var oe=te(!0),ne=N(),Pe=ne[0],Le=ne[1];hr.isTouch&&Pe==="hold"&&Le&&(oe=Le),oe?r=setTimeout(function(){h.show()},oe):h.show()}function Xe(G){if(h.clearDelayTimeouts(),se("onUntrigger",[h,G]),!h.state.isVisible){ee();return}if(!(h.props.trigger.indexOf("mouseenter")>=0&&h.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(G.type)>=0&&s)){var oe=te(!1);oe?i=setTimeout(function(){h.state.isVisible&&h.hide()},oe):o=requestAnimationFrame(function(){h.hide()})}}function lt(){h.state.isEnabled=!0}function Et(){h.hide(),h.state.isEnabled=!1}function Bt(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function jt(G){if(be.env.NODE_ENV!=="production"&&Fr(h.state.isDestroyed,ro("setProps")),!h.state.isDestroyed){se("onBeforeUpdate",[h,G]),H();var oe=h.props,ne=t0(e,Object.assign({},oe,Ww(G),{ignoreAttributes:!0}));h.props=ne,j(),oe.interactiveDebounce!==ne.interactiveDebounce&&(we(),b=qw(xe,ne.interactiveDebounce)),oe.triggerTarget&&!ne.triggerTarget?no(oe.triggerTarget).forEach(function(Pe){Pe.removeAttribute("aria-expanded")}):ne.triggerTarget&&e.removeAttribute("aria-expanded"),ae(),Y(),R&&R(oe,ne),h.popperInstance&&(Fe(),Ge().forEach(function(Pe){requestAnimationFrame(Pe._tippy.popperInstance.forceUpdate)})),se("onAfterUpdate",[h,G])}}function ct(G){h.setProps({content:G})}function Ne(){be.env.NODE_ENV!=="production"&&Fr(h.state.isDestroyed,ro("show"));var G=h.state.isVisible,oe=h.state.isDestroyed,ne=!h.state.isEnabled,Pe=hr.isTouch&&!h.props.touch,Le=gd(h.props.duration,0,Cn.duration);if(!(G||oe||ne||Pe)&&!D().hasAttribute("disabled")&&(se("onShow",[h],!1),h.props.onShow(h)!==!1)){if(h.state.isVisible=!0,O()&&(T.style.visibility="visible"),Y(),Ae(),h.state.isMounted||(T.style.transition="none"),O()){var qe=L(),Ze=qe.box,et=qe.content;vd([Ze,et],0)}d=function(){var qt;if(!(!h.state.isVisible||u)){if(u=!0,T.offsetHeight,T.style.transition=h.props.moveTransition,O()&&h.props.animation){var Nr=L(),$e=Nr.box,je=Nr.content;vd([$e,je],Le),Kw([$e,je],"visible")}he(),ae(),zw(za,h),(qt=h.popperInstance)==null||qt.forceUpdate(),se("onMount",[h]),h.props.animation&&O()&&C(Le,function(){h.state.isShown=!0,se("onShown",[h])})}},We()}}function M(){be.env.NODE_ENV!=="production"&&Fr(h.state.isDestroyed,ro("hide"));var G=!h.state.isVisible,oe=h.state.isDestroyed,ne=!h.state.isEnabled,Pe=gd(h.props.duration,1,Cn.duration);if(!(G||oe||ne)&&(se("onHide",[h],!1),h.props.onHide(h)!==!1)){if(h.state.isVisible=!1,h.state.isShown=!1,u=!1,s=!1,O()&&(T.style.visibility="hidden"),we(),ee(),Y(!0),O()){var Le=L(),qe=Le.box,Ze=Le.content;h.props.animation&&(vd([qe,Ze],Pe),Kw([qe,Ze],"hidden"))}he(),ae(),h.props.animation?O()&&F(Pe,h.unmount):h.unmount()}}function k(G){be.env.NODE_ENV!=="production"&&Fr(h.state.isDestroyed,ro("hideWithInteractivity")),V().addEventListener("mousemove",b),zw(qa,b),b(G)}function I(){be.env.NODE_ENV!=="production"&&Fr(h.state.isDestroyed,ro("unmount")),h.state.isVisible&&h.hide(),h.state.isMounted&&(ye(),Ge().forEach(function(G){G._tippy.unmount()}),T.parentNode&&T.parentNode.removeChild(T),za=za.filter(function(G){return G!==h}),h.state.isMounted=!1,se("onHidden",[h]))}function J(){be.env.NODE_ENV!=="production"&&Fr(h.state.isDestroyed,ro("destroy")),!h.state.isDestroyed&&(h.clearDelayTimeouts(),h.unmount(),H(),delete e._tippy,h.state.isDestroyed=!0,se("onDestroy",[h]))}}function ns(e,t){t===void 0&&(t={});var n=Cn.plugins.concat(t.plugins||[]);be.env.NODE_ENV!=="production"&&(VD(e),n0(t,n)),$D();var r=Object.assign({},t,{plugins:n}),i=FD(e);if(be.env.NODE_ENV!=="production"){var o=es(r.content),s=i.length>1;Fr(o&&s,["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.",`
59
-
60
- `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
61
-
62
- `,`1) content: element.innerHTML
63
- `,"2) content: () => element.cloneNode(true)"].join(" "))}var a=i.reduce(function(l,u){var c=u&&QD(u,r);return c&&l.push(c),l},[]);return es(e)?a[0]:a}ns.defaultProps=Cn,ns.setDefaultProps=WD,ns.currentInput=hr;var XD=function(t){var n=t===void 0?{}:t,r=n.exclude,i=n.duration;za.forEach(function(o){var s=!1;if(r&&(s=Hw(r)?o.reference===r:o.popper===r.popper),!s){var a=o.props.duration;o.setProps({duration:i}),o.hide(),o.state.isDestroyed||o.setProps({duration:a})}})};Object.assign({},Ew,{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)}}),ns.setDefaultProps({render:o0});const YD={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)}}}},Td=e=>{if(e)try{e.destroy()}catch{}},JD=["id"],ZD=_e({__name:"OcDrop",props:{title:{default:""},closeOnClick:{type:Boolean,default:!1},dropId:{default:()=>ci("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:i}=vw(),o=le(!1),s=B(()=>f(i)&&!e.enforceDropOnMobile),a=Tn("bottomDrawerRef"),l=Tn("drop"),u=le(null),c=()=>{if(f(s)){f(a).show();return}f(u)?.show()},p=()=>{if(f(s)){f(a).hide();return}f(u)?.hide()};t({show:c,hide:p,tippy:u});const d=S=>{const y=S.target.closest(".oc-button")?.hasAttribute("aria-expanded");e.closeOnClick&&!y&&p()},m=S=>{const y=l.value?.closest(".tippy-box");S.relatedTarget&&!y?.contains(S.relatedTarget)&&p()},b=B(()=>({hover:"mouseenter focus",click:void 0,manual:void 0})[e.mode]||e.mode);st(()=>e.position,()=>{f(u)?.setProps({placement:e.position})}),st(()=>e.mode,()=>{f(u)?.setProps({trigger:b.value})}),An(()=>{f(l)?.removeEventListener("focusout",m),Td(f(u))});const w=()=>{Td(f(u));const S=e.target?document.querySelector(e.target):e.toggle?document.querySelector(e.toggle):l.value?.previousElementSibling,y=l.value;if(!S||!y)return;const g={trigger:b.value,placement:e.position,arrow:!1,hideOnClick:!e.isNestedElement,interactive:!0,plugins:[YD],theme:"none",maxWidth:416,offset:e.offset,onShow:v=>{o.value=!0,r("showDrop"),e.isNestedElement||XD({exclude:v})},onHide:()=>{o.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:v}){const h=to(v),E=v.modifiersData.fullHeight||v.elements.popper.offsetHeight,T=h.top*-1-10,R=T+E+h.bottom*-1,x=R-T,A=R-x;E>x&&E>A&&(v.styles.popper.top=`-${T}px`,v.modifiersData.fullHeight=E),E>R&&(v.styles.popper.maxHeight=`${R-10}px`,v.styles.popper.overflowY="auto",v.styles.popper.overflowX="hidden")}}]},content:y};e.target&&(g.triggerTarget=e.toggle?document.querySelector(e.toggle):l.value?.previousElementSibling),u.value=ns(S,g),l.value?.addEventListener("focusout",m)};return st(s,async()=>{if(await zt(),f(s)){f(u)&&Td(f(u));return}w()},{immediate:!0}),(S,y)=>s.value?(X(),Te(y_,{key:0,ref_key:"bottomDrawerRef",ref:a,"drawer-id":e.dropId,toggle:e.toggle,"close-on-click":e.closeOnClick,title:e.title,"use-portal":"",onShow:y[0]||(y[0]=g=>r("showDrop")),onHide:y[1]||(y[1]=g=>r("hideDrop"))},{default:ve(()=>[Ue(S.$slots,"default")]),_:3},8,["drawer-id","toggle","close-on-click","title"])):(X(),pe("div",{key:1,id:e.dropId,ref_key:"drop",ref:l,class:"oc-drop shadow-md/20 rounded-sm",onClick:d},[o.value&&S.$slots.default?(X(),Te(sd,{key:0,"body-class":[f(wx)(e.paddingSize)]},{default:ve(()=>[Ue(S.$slots,"default")]),_:3},8,["body-class"])):o.value?Ue(S.$slots,"special",{key:1}):Re("",!0)],8,JD))}}),eN=["type","disabled"],tN={class:"flex flex-row flex-wrap text-sm pt-2 gap-x-2"},nN=["textContent"],s0="file-copy",rN=_e({__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,i=Tn("passwordInput"),{$gettext:o}=Ie.useGettext(),s=le(e.value),a=le(!1),l=le(s0),u=le(!1),c=B(()=>!!Object.keys(e.passwordPolicy?.rules||{}).length),p=B(()=>e.passwordPolicy?.missing(f(s))),d=g=>{const v={};for(let h=0;h<g.format.length;h++)v[`param${h+1}`]=g.format[h]?.toString();return o(g.message,v,!0)},m=()=>{navigator.clipboard.writeText(f(s)),l.value="check",setTimeout(()=>l.value=s0,1500)},b=()=>{const g=e.generatePasswordMethod();s.value=g,r("passwordGenerated",s.value)};return t({focus:()=>{f(i).focus()},select:()=>{f(i).select()},setSelectionRange:(g,v)=>{f(i).setSelectionRange(g,v)}}),st(s,g=>{if(Object.keys(e.passwordPolicy).length){if(!e.passwordPolicy.check(g))return r("passwordChallengeFailed");r("passwordChallengeCompleted")}}),(g,v)=>{const h=Ee("oc-contextual-helper"),E=Ee("portal"),T=sn("oc-tooltip");return X(),pe(Be,null,[fe("div",{class:z.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":u.value,"border-role-outline":!u.value}])},[ot(fe("input",$t(g.$attrs,{ref_key:"passwordInput",ref:i,"onUpdate:modelValue":v[0]||(v[0]=R=>s.value=R),class:"grow-2 border-0 focus:border-0 focus:outline-0",type:a.value?"text":"password",disabled:e.disabled,onFocus:v[1]||(v[1]=R=>u.value=!0),onBlur:v[2]||(v[2]=R=>u.value=!1)}),null,16,eN),[[yE,s.value]]),s.value&&!e.disabled?ot((X(),Te(wn,{key:0,"aria-label":a.value?f(o)("Hide password"):f(o)("Show password"),class:"oc-text-input-show-password-toggle px-2",appearance:"raw",size:"small",onClick:v[3]||(v[3]=R=>a.value=!a.value)},{default:ve(()=>[me(Pr,{size:"small",name:a.value?"eye-off":"eye"},null,8,["name"])]),_:1},8,["aria-label"])),[[T,a.value?f(o)("Hide password"):f(o)("Show password")]]):Re("",!0),s.value&&!e.disabled?ot((X(),Te(wn,{key:1,"aria-label":f(o)("Copy password"),class:"oc-text-input-copy-password-button px-2",appearance:"raw",size:"small",onClick:m},{default:ve(()=>[me(Pr,{size:"small",name:l.value},null,8,["name"])]),_:1},8,["aria-label"])),[[T,f(o)("Copy password")]]):Re("",!0),e.generatePasswordMethod&&!e.disabled?ot((X(),Te(wn,{key:2,"aria-label":f(o)("Generate password"),class:"oc-text-input-generate-password-button px-2",appearance:"raw",size:"small",onClick:b},{default:ve(()=>[me(Pr,{size:"small",name:"refresh","fill-type":"line"})]),_:1},8,["aria-label"])),[[T,f(o)("Generate password")]]):Re("",!0)],2),c.value?(X(),Te(E,{key:0,to:"app.design-system.password-policy"},{default:ve(()=>[fe("div",tN,[(X(!0),pe(Be,null,mt(p.value.rules,(R,x)=>(X(),pe("div",{key:x,class:"flex items-center oc-text-input-password-policy-rule"},[me(Pr,{size:"small",class:"mr-1",name:R.verified?"checkbox-circle":"close-circle",color:R.verified?"var(--oc-role-on-surface)":"var(--oc-role-error)"},null,8,["name","color"]),fe("span",{class:z.normalizeClass([{"oc-text-input-danger":!R.verified}]),textContent:z.toDisplayString(d(R))},null,10,nN),R.helperMessage?(X(),Te(h,{key:0,text:R.helperMessage,title:f(o)("Password policy")},null,8,["text","title"])):Re("",!0)]))),128))])]),_:1})):Re("",!0)],64)}}}),iN=["for"],oN={key:0,class:"text-role-error","aria-hidden":"true"},sN=["id","textContent"],aN=["id","textContent"],lN=_e({inheritAttrs:!1,__name:"OcTextInput",props:{id:{default:()=>ci("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,i=le(!1),o=B(()=>!!e.descriptionMessage),s=B(()=>e.fixMessageLine||f(i)||f(o)),a=B(()=>f(i).toString()),l=B(()=>`${e.id}-message`),u=B(()=>e.type==="password"?{passwordGenerated:v}:{}),c=Fl(),p=B(()=>{const R={};(f(i)||f(o))&&(R["aria-describedby"]=l.value),e.defaultValue&&(R.placeholder=e.defaultValue),e.type==="password"&&(R["password-policy"]=e.passwordPolicy,R["generate-password-method"]=e.generatePasswordMethod,R["has-error"]=f(i));const{change:x,input:A,focus:N,class:W,...O}=c;return{...O,...R}}),d=B(()=>!e.disabled&&e.clearButtonEnabled&&!!e.modelValue),m=B(()=>e.clearButtonAccessibleLabel||"Clear input"),b=B(()=>e.type==="password"?rN:"input"),w=Tn("inputRef"),S=()=>{f(w).focus()};t({focus:S});function y(){S(),v(""),g(null)}const g=R=>{r("change",R)},v=R=>{r("update:modelValue",R)},h=async R=>{await zt(),f(w).select(),E(),r("focus",R.value)},E=()=>{e.selectionRange&&e.selectionRange.length>1&&f(w).setSelectionRange(e.selectionRange[0],e.selectionRange[1])};st([()=>e.selectionRange,w],async()=>{f(w)&&(await zt(),E())},{immediate:!0});const T=Tt.debounce(()=>{i.value=!!e.errorMessage},e.errorMessageDebouncedTime);return st(()=>e.modelValue,()=>{T()}),st(()=>e.errorMessage,()=>{e.errorMessage?T():(i.value=!1,T.cancel?.())}),(R,x)=>(X(),pe("div",{class:z.normalizeClass([{"flex items-center":e.inlineLabel},R.$attrs.class])},[Ue(R.$slots,"label",{},()=>[fe("label",{class:z.normalizeClass(["inline-block",{"mr-2":e.inlineLabel,"mb-0.5":!e.inlineLabel}]),for:e.id},[kt(z.toDisplayString(e.label)+" ",1),e.requiredMark?(X(),pe("span",oN,"*")):Re("",!0)],10,iN)]),fe("div",{class:z.normalizeClass(["relative",{"grow-1":e.inlineLabel}])},[e.readOnly?(X(),Te(Pr,{key:0,name:"lock",size:"small",class:"mt-2 ml-2 absolute"})):Re("",!0),(X(),Te(Pn(b.value),$t({id:e.id},p.value,{ref_key:"inputRef",ref:w,"aria-invalid":a.value,class:["oc-text-input oc-input",{"oc-text-input-danger border-role-error":!!i.value,"pl-6":!!e.readOnly,"pr-6":d.value,"border-none outline-none bg-transparent":!e.hasBorder}],type:e.type,value:e.modelValue,disabled:e.disabled||e.readOnly},Os(u.value),{onChange:x[0]||(x[0]=A=>g(A.target.value)),onInput:x[1]||(x[1]=A=>v(A.target.value)),onPasswordChallengeCompleted:x[2]||(x[2]=A=>R.$emit("passwordChallengeCompleted")),onPasswordChallengeFailed:x[3]||(x[3]=A=>R.$emit("passwordChallengeFailed")),onFocus:x[4]||(x[4]=A=>h(A.target))}),null,16,["id","aria-invalid","class","type","value","disabled"])),d.value?(X(),Te(wn,{key:1,"aria-label":m.value,class:"pr-2 absolute top-[50%] transform-[translateY(-50%)] right-0 oc-text-input-btn-clear",appearance:"raw","no-hover":"",onClick:y},{default:ve(()=>[me(Pr,{name:"close",size:"small"})]),_:1},8,["aria-label"])):Re("",!0)],2),s.value?(X(),pe("div",{key:0,class:z.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":o.value,"oc-text-input-danger text-role-error focus:text-role-error border-role-error":i.value}])},[i.value?(X(),pe(Be,{key:0},[i.value?(X(),Te(Pr,{key:0,name:"error-warning",size:"small","fill-type":"line","aria-hidden":"true",class:"mr-1"})):Re("",!0),i.value?(X(),pe("span",{key:1,id:l.value,class:"oc-text-input-danger text-role-error focus:text-role-error border-role-error",textContent:z.toDisplayString(e.errorMessage)},null,8,sN)):Re("",!0)],64)):o.value?(X(),pe("span",{key:1,id:l.value,class:"oc-text-input-description text-role-on-surface-variant flex items-center relative",textContent:z.toDisplayString(e.descriptionMessage)},null,8,aN)):Re("",!0)],2)):Re("",!0),e.type==="password"?(X(),Te(f(fs.PortalTarget),{key:1,name:"app.design-system.password-policy"})):Re("",!0)],2))}});var cN=Object.defineProperty,a0=Object.getOwnPropertySymbols,uN=Object.prototype.hasOwnProperty,fN=Object.prototype.propertyIsEnumerable,l0=(e,t,n)=>t in e?cN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dN=(e,t)=>{for(var n in t||(t={}))uN.call(t,n)&&l0(e,n,t[n]);if(a0)for(var n of a0(t))fN.call(t,n)&&l0(e,n,t[n]);return e};const c0=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},pN={},hN={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},mN=fe("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),gN=[mN];function yN(e,t){return X(),pe("svg",hN,gN)}const vN=c0(pN,[["render",yN]]),bN={},wN={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"},SN=fe("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),EN=[SN];function TN(e,t){return X(),pe("svg",wN,EN)}dN({},{Deselect:vN,OpenIndicator:c0(bN,[["render",TN]])});const AN=["aria-label","aria-live","aria-hidden","role"],xN=_e({__name:"OcSpinner",props:{ariaLabel:{default:()=>{}},size:{default:"medium"}},setup(e){return(t,n)=>(X(),pe("span",{class:z.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,AN))}}),RN={class:"oc-status-indicators flex"},CN=["id","textContent"],kN=_e({__name:"OcStatusIndicators",props:{resource:{},indicators:{},disableHandler:{type:Boolean,default:!1}},setup(e){const{$gettext:t}=Ie.useGettext(),n=le({}),r=o=>Object.hasOwn(o,"handler"),i=o=>o.accessibleDescription?(f(n)[o.id]||(f(n)[o.id]=ci("oc-indicator-description-")),f(n)[o.id]):null;return(o,s)=>{const a=sn("oc-tooltip");return X(),pe("div",RN,[(X(!0),pe(Be,null,mt(e.indicators,(l,u)=>(X(),pe(Be,null,[r(l)&&!e.disableHandler?ot((X(),Te(wn,{id:l.id,key:`${l.id}-handler`,class:z.normalizeClass(["oc-status-indicators-indicator",{"ml-1":u>0}]),"aria-label":f(t)(l.label),"aria-describedby":i(l),appearance:"raw","data-testid":l.id,"data-test-indicator-type":l.type,"data-test-indicator-resource-name":e.resource.name,"data-test-indicator-resource-path":e.resource.path,"no-hover":"",onClick:c=>l.handler?.(e.resource,c)},{default:ve(()=>[me(Pr,{name:l.icon,size:"small","fill-type":l.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"])),[[a,f(t)(l.label)]]):ot((X(),Te(Pr,{id:l.id,key:l.id,tabindex:"-1",size:"small",class:z.normalizeClass(["oc-status-indicators-indicator",{"ml-1":u>0}]),name:l.icon,"fill-type":l.fillType,"accessible-label":f(t)(l.label),"aria-describedby":i(l),"data-testid":l.id,"data-test-indicator-type":l.type},null,8,["id","class","name","fill-type","accessible-label","aria-describedby","data-testid","data-test-indicator-type"])),[[a,f(t)(l.label)]]),i(l)?(X(),pe("p",{id:i(l),key:i(l),class:"sr-only",textContent:z.toDisplayString(f(t)(l.accessibleDescription))},null,8,CN)):Re("",!0)],64))),256))])}}}),PN={class:"oc-thead border-b"},IN=_e({name:"OcTableHead",__name:"OcTableHead",setup(e){return(t,n)=>(X(),pe("thead",PN,[Ue(t.$slots,"default")]))}}),ON=_e({name:"OcTableBody",__name:"OcTableBody",setup(e){return(t,n)=>(X(),pe("tbody",null,[Ue(t.$slots,"default")]))}}),u0=Ye(_e({__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,i)=>(X(),Te(Pn(e.type),{class:z.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:i[0]||(i[0]=o=>n("click",o))},{default:ve(()=>[Ue(r.$slots,"default",{},void 0,!0)]),_:3},8,["class"]))}}),[["__scopeId","data-v-dc7aa8e1"]]),f0=_e({__name:"OcTableTd",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},setup(e){return(t,n)=>(X(),Te(u0,{type:"td","align-h":e.alignH,"align-v":e.alignV,width:e.width,wrap:e.wrap,class:"oc-td"},{default:ve(()=>[Ue(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),d0=Ye(_e({__name:"OcTableTr",props:{lazy:{}},emits:["contextmenu","click","dragstart","drop","dragenter","dragleave","dragover","mouseleave","itemVisible"],setup(e,{emit:t}){const n=t,r=a1((a,l)=>{let u;return{get(){return a(),u},set(c){u=c,l()}}}),i=B(()=>e.lazy?e.lazy.colspan:1),{isVisible:o}=e.lazy?yw({...e.lazy,target:r,onVisibleCallback:()=>n("itemVisible")}):{isVisible:le(!0)},s=B(()=>!f(o));return e.lazy||n("itemVisible"),(a,l)=>(X(),pe("tr",{ref_key:"observerTarget",ref:r,onClick:l[0]||(l[0]=u=>a.$emit("click",u)),onContextmenu:l[1]||(l[1]=u=>a.$emit("contextmenu",u)),onDragstart:l[2]||(l[2]=u=>a.$emit("dragstart",u)),onDrop:l[3]||(l[3]=u=>a.$emit("drop",u)),onDragenter:l[4]||(l[4]=u=>a.$emit("dragenter",u)),onDragleave:l[5]||(l[5]=u=>a.$emit("dragleave",u)),onDragover:l[6]||(l[6]=u=>a.$emit("dragover",u)),onMouseleave:l[7]||(l[7]=u=>a.$emit("mouseleave",u))},[s.value?(X(),Te(f0,{key:0,colspan:i.value},{default:ve(()=>[...l[8]||(l[8]=[fe("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"])):Ue(a.$slots,"default",{key:1},void 0,!0)],544))}}),[["__scopeId","data-v-7acab1b8"]]),FN=Ye(_e({__name:"OcTableTh",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e){return(t,n)=>(X(),Te(u0,{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:ve(()=>[Ue(t.$slots,"default",{},void 0,!0)]),_:3},8,["align-h","align-v","width","wrap"]))}}),[["__scopeId","data-v-d746eb11"]]),_N={key:0,class:"oc-table-thead-content inline-table align-middle"},DN=["textContent"],NN={key:1},LN={key:0,class:"oc-table-thead-content inline-table align-middle"},$N=["textContent"],MN={key:1,class:"oc-table-footer border-t"},BN={class:"oc-table-footer-row h-10.5"},jN=["colspan"],UN=Ye(_e({__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:fx,EVENT_TROW_CLICKED:dx,EVENT_TROW_MOUNTED:px,EVENT_TROW_CONTEXTMENU:hx},{$gettext:i}=Ie.useGettext(),o=O=>e.itemDomSelector?e.itemDomSelector(O):O[e.idKey],s=B(()=>{const O=["oc-table"];return e.hover&&O.push("oc-table-hover"),e.sticky&&O.push("oc-table-sticky"),O}),a=B(()=>e.fields.length),l=O=>{O.preventDefault()},u=(O,D)=>{n(mx,[O,D])},c=(O,D)=>{n(um,[O,D])},p=(O,D,V)=>{n("dropRowStyling",O,D,V)},d=O=>O.type==="slot",m=O=>["callback","function"].indexOf(O.type)>=0,b=O=>Object.prototype.hasOwnProperty.call(O,"title")?O.title:O.name,w=()=>({class:s.value}),S=O=>{switch(e.paddingX){case"remove":return O==="right"?"pr-0":"pl-0";case"xsmall":return O==="right"?"pr-1":"pl-1";case"small":return O==="right"?"pr-2":"pl-2";case"medium":return O==="right"?"pr-4":"pl-4";case"large":return O==="right"?"pr-6":"pl-6";case"xlarge":return O==="right"?"pr-12":"pl-12";case"xxlarge":return O==="right"?"pr-24":"pl-24"}},y=(O,D)=>{const V=h(O);return V.class=`oc-table-header-cell oc-table-header-cell-${O.name}`,Object.prototype.hasOwnProperty.call(O,"thClass")&&(V.class+=` ${O.thClass}`),e.sticky&&(V.style=`top: ${e.headerPosition}px;`,V.class+=" z-10"),D===0&&(V.class+=` ${S("left")} `),D===e.fields.length-1&&(V.class+=` ${S("right")}`),A(V,O),V},g=(O,D)=>({...e.lazy&&{lazy:{colspan:a.value}},class:["oc-tbody-tr",`oc-tbody-tr-${o(O)||D}`,E(O)?"oc-table-highlighted":void 0,...T(O)?["oc-table-disabled","opacity-70","pointer-events-none","grayscale-60"]:[]].filter(Boolean)}),v=(O,D,V)=>{const L=h(O);return L.class=`oc-table-data-cell oc-table-data-cell-${O.name}`,Object.prototype.hasOwnProperty.call(O,"tdClass")&&(L.class+=` ${O.tdClass}`),Object.prototype.hasOwnProperty.call(O,"wrap")&&(L.wrap=O.wrap),D===0&&(L.class+=` ${S("left")} `),D===e.fields.length-1&&(L.class+=` ${S("right")}`),Object.prototype.hasOwnProperty.call(O,"accessibleLabelCallback")&&(L["aria-label"]=O.accessibleLabelCallback(V)),L},h=O=>({...O?.alignH&&{alignH:O.alignH},...O?.alignV&&{alignV:O.alignV},...O?.width&&{width:O.width},class:void 0,wrap:void 0,style:void 0}),E=O=>e.highlighted?Array.isArray(e.highlighted)?e.highlighted.indexOf(O[e.idKey])>-1:e.highlighted===O[e.idKey]:!1,T=O=>e.disabled.length?e.disabled.indexOf(O[e.idKey])>-1:!1,R=(O,D,V)=>{const L=[V[e.idKey],D+1].filter(Boolean);return d(O)?[...L,O.name].join("-"):m(O)?[...L,O.callback(V[O.name])].join("-"):[...L,V[O.name]].join("-")},x=O=>i("Sort by %{ name }",{name:O}),A=(O,D)=>{if(!N(D))return;let V="none";e.sortBy===D.name&&(V=e.sortDir===pt.Asc?"ascending":"descending"),O["aria-sort"]=V},N=({sortable:O})=>!!O,W=O=>{if(!N(O))return;let D=e.sortDir;e.sortBy===O.name&&e.sortDir!==void 0&&(D=e.sortDir===pt.Desc?pt.Asc:pt.Desc),(e.sortBy!==O.name||e.sortDir===void 0)&&(D=O.sortDir||pt.Desc),n("sort",{sortBy:O.name,sortDir:D})};return(O,D)=>{const V=Ee("oc-icon");return X(),pe("table",$t(w(),{class:"has-item-context-menu"}),[e.hasHeader?(X(),Te(IN,{key:0},{default:ve(()=>[me(d0,{class:"oc-table-header-row h-10.5"},{default:ve(()=>[(X(!0),pe(Be,null,mt(e.fields,(L,te)=>(X(),Te(FN,$t({key:`oc-thead-${L.name}`},{ref_for:!0},y(L,te)),{default:ve(()=>[L.sortable?(X(),Te(wn,{key:0,"aria-label":x(L.name),appearance:"raw","justify-content":"left",class:"oc-button-sort w-full hover:underline","gap-size":"small","no-hover":"",onClick:Y=>W(L)},{default:ve(()=>[L.headerType==="slot"?(X(),pe("span",_N,[Ue(O.$slots,L.name+"Header",{},void 0,!0)])):(X(),pe("span",{key:1,class:"oc-table-thead-content inline-table align-middle header-text",textContent:z.toDisplayString(b(L))},null,8,DN)),me(V,{name:e.sortDir==="asc"?"arrow-down":"arrow-up","fill-type":"line",class:z.normalizeClass([{"sr-only":e.sortBy!==L.name},"p-1 rounded-sm"]),size:"small"},null,8,["name","class"])]),_:2},1032,["aria-label","onClick"])):(X(),pe("div",NN,[L.headerType==="slot"?(X(),pe("span",LN,[Ue(O.$slots,L.name+"Header",{},void 0,!0)])):(X(),pe("span",{key:1,class:"oc-table-thead-content inline-table align-middle header-text",textContent:z.toDisplayString(b(L))},null,8,$N))]))]),_:2},1040))),128))]),_:3})]),_:3})):Re("",!0),me(ON,{class:"has-item-context-menu"},{default:ve(()=>[(X(!0),pe(Be,null,mt(e.data,(L,te)=>(X(),Te(d0,$t({key:`oc-tbody-tr-${o(L)||te}`,ref_for:!0,ref:`row-${te}`},{ref_for:!0},g(L,te),{"data-item-id":L[e.idKey],draggable:e.dragDrop,class:"border-t h-10.5",onClick:Y=>O.$emit(r.EVENT_TROW_CLICKED,[L,Y]),onContextmenu:Y=>O.$emit(r.EVENT_TROW_CONTEXTMENU,O.$refs[`row-${te}`][0],Y,L),onVnodeMounted:Y=>O.$emit(r.EVENT_TROW_MOUNTED,L,O.$refs[`row-${te}`][0]),onDragstart:Y=>u(L,Y),onDrop:Y=>c(L,Y),onDragenter:Wt(Y=>p(L,!1,Y),["prevent"]),onDragleave:Wt(Y=>p(L,!0,Y),["prevent"]),onDragover:D[0]||(D[0]=Y=>l(Y)),onItemVisible:Y=>O.$emit("itemVisible",L)}),{default:ve(()=>[(X(!0),pe(Be,null,mt(e.fields,(Y,se)=>(X(),Te(f0,$t({key:"oc-tbody-td-"+R(Y,se,L)},{ref_for:!0},v(Y,se,L)),{default:ve(()=>[d(Y)?Ue(O.$slots,Y.name,{key:0,item:L},void 0,!0):m(Y)?(X(),pe(Be,{key:1},[kt(z.toDisplayString(Y.callback(L[Y.name])),1)],64)):(X(),pe(Be,{key:2},[kt(z.toDisplayString(L[Y.name]),1)],64))]),_:2},1040))),128))]),_:2},1040,["data-item-id","draggable","onClick","onContextmenu","onVnodeMounted","onDragstart","onDrop","onDragenter","onDragleave","onItemVisible"]))),128))]),_:3}),O.$slots.footer?(X(),pe("tfoot",MN,[fe("tr",BN,[fe("td",{colspan:a.value,class:"oc-table-footer-cell p-1 text-sm text-role-on-surface-variant"},[Ue(O.$slots,"footer",{},void 0,!0)],8,jN)])])):Re("",!0)],16)}}}),[["__scopeId","data-v-57029fa4"]]),Ad=()=>{const{$gettext:e,$ngettext:t}=Ie.useGettext(),{showMessage:n,showErrorMessage:r}=nt(),{copy:i}=Yn.useClipboard(),o=({result:a,password:l})=>{const u=a.filter(pi);let c="";if(u.length){let d=e("Link has been created successfully");if(a.length===1)try{c=l?e("%{link} Password:%{password}",{link:u[0].value.webUrl,password:l},!0):u[0].value.webUrl,d=e("The link has been copied to your clipboard.")}catch(m){console.warn("Unable to copy link to clipboard",m)}n({title:t(d,"Links have been created successfully.",u.length)})}const p=a.filter(hi);return p.length&&r({errors:p.map(({reason:d})=>d),title:t("Failed to create link","Failed to create links",p.length)}),c};return{copyLink:async({createLinkHandler:a,password:l})=>{if(navigator.clipboard.write)await new Promise((u,c)=>{const p=new ClipboardItem({"text/plain":a().then(d=>{const m=o({result:d,password:l}),b=new Blob([m],{type:"text/plain"});return u(),b}).catch(d=>{throw c(),d})});navigator.clipboard.write([p])});else{const u=await a(),c=o({result:u,password:l});c&&i(c)}}}},Wa=()=>{const{$gettext:e}=Ie.useGettext(),t=en(),n=fn(),r=B(()=>n.can("create-all","PublicLink")),i=B(()=>bn.View),o=u=>u===bn.View?t.sharingPublicPasswordEnforcedFor.read_only:u===bn.Upload?t.sharingPublicPasswordEnforcedFor.upload_only:u===bn.CreateOnly?t.sharingPublicPasswordEnforcedFor.read_write:u===bn.Edit?t.sharingPublicPasswordEnforcedFor.read_write_delete:!1,s=({isFolder:u})=>f(r)?u?[bn.View,bn.Edit,bn.CreateOnly]:[bn.View,bn.Edit]:[],a=[{id:bn.View,displayName:e("Can view"),description:e("View, download"),icon:"eye"},{id:bn.Upload,displayName:e("Can upload"),description:e("View, upload, download"),icon:"upload"},{id:bn.Edit,displayName:e("Can edit"),description:e("View, upload, edit, download, delete"),icon:"pencil"},{id:bn.CreateOnly,displayName:e("Secret File Drop"),description:e("Upload only, existing content is not revealed"),icon:"inbox-unarchive"}];return{defaultLinkType:i,isPasswordEnforcedForLinkType:o,getAvailableLinkTypes:s,linkShareRoles:a,getLinkRoleByType:u=>a.find(({id:c})=>c===u)}},VN=_e({name:"LinkRoleDropdown",props:{modelValue:{type:Object,required:!0},availableLinkTypeOptions:{type:Array,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=Ie.useGettext(),{getLinkRoleByType:r}=Wa(),i=l=>e.modelValue===l,o=l=>{t("update:modelValue",l)},s=B(()=>n(r(e.modelValue)?.displayName)),a=Xt.v4();return{isSelectedType:i,updateSelectedType:o,currentLinkRoleLabel:s,dropUuid:a,getLinkRoleByType:r}}}),qN=["textContent"],zN=["textContent"],WN={class:"flex items-center"},HN={class:"text-left"},KN=["textContent"],GN={class:"text-sm leading-4"},QN={class:"flex"};function XN(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-button"),l=Ee("oc-list"),u=Ee("oc-drop"),c=sn("oc-tooltip");return X(),pe(Be,null,[e.availableLinkTypeOptions.length>1?(X(),Te(a,{key:0,id:`link-role-dropdown-toggle-${e.dropUuid}`,appearance:"raw","gap-size":"none","no-hover":"",class:"text-left link-role-dropdown-toggle"},{default:ve(()=>[fe("span",{class:"link-current-role",textContent:z.toDisplayString(e.currentLinkRoleLabel||e.$gettext("Select a role"))},null,8,qN),me(s,{name:"arrow-down-s"})]),_:1},8,["id"])):ot((X(),pe("span",{key:1,class:"link-current-role mr-4",textContent:z.toDisplayString(e.currentLinkRoleLabel)},null,8,zN)),[[c,e.getLinkRoleByType(e.modelValue)?.description]]),e.availableLinkTypeOptions.length>1?(X(),Te(u,{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:ve(()=>[me(l,{class:"role-dropdown-list"},{default:ve(()=>[(X(!0),pe(Be,null,mt(e.availableLinkTypeOptions,(p,d)=>(X(),pe("li",{key:`role-dropdown-${d}`},[me(a,{id:`files-role-${e.getLinkRoleByType(p).id}`,class:z.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:m=>e.updateSelectedType(p)},{default:ve(()=>[fe("span",WN,[me(s,{name:e.getLinkRoleByType(p).icon,class:"pl-2 pr-4"},null,8,["name"]),fe("span",HN,[fe("span",{class:"role-dropdown-list-option-label font-semibold block w-full leading-4",textContent:z.toDisplayString(e.$gettext(e.getLinkRoleByType(p).displayName))},null,8,KN),fe("span",GN,z.toDisplayString(e.$gettext(e.getLinkRoleByType(p).description)),1)])]),fe("span",QN,[e.isSelectedType(p)?(X(),Te(s,{key:0,name:"check"})):Re("",!0)])]),_:2},1032,["id","class","appearance","color-role","onClick"])]))),128))]),_:1})]),_:1},8,["title","drop-id","toggle"])):Re("",!0)],64)}const p0=Ye(VN,[["render",XN]]),YN={class:"flex justify-between pb-2"},JN={key:0,class:"flex items-center"},ZN={key:1,class:"flex items-center"},e2={class:"flex flex-col"},t2=["textContent"],n2=["textContent"],r2=["textContent"],i2={class:"mb-4 ml-[30px]"},o2={key:1,class:"text-sm text-role-on-surface-variant"},s2=["textContent"],a2=["textContent"],l2={class:"flex justify-end items-center mt-2"},c2={class:"sr-only"},h0=_e({__name:"CreateLinkModal",props:{modal:{},resources:{},space:{default:()=>{}}},emits:["cancel","confirm"],setup(e,{expose:t}){const n=Ke(),r=Ie.useGettext(),{$gettext:i}=r,{removeModal:o}=ht(),{copyLink:s}=Ad(),a=H0(),{isEnabled:l,postMessage:u}=Qr(),{defaultLinkType:c,getAvailableLinkTypes:p,getLinkRoleByType:d,isPasswordEnforcedForLinkType:m}=Wa(),{addLink:b}=Cr(),w=cr(),{currentTheme:S}=Me.storeToRefs(w),y=le(!1),g=le(!1),v=B(()=>e.resources.every(({isFolder:F})=>F)),h=B(()=>f(l)?i("Share link(s)"):i("Copy link")),E=B(()=>f(l)?i("Share link(s) and password(s)"):i("Copy link and password")),T=le(Xt.v4()),R=le({}),x=le(),A=yl({value:"",error:void 0}),N=le(f(c)),W=B(()=>i(d(f(N)).description)),O=B(()=>i(d(f(N)).displayName)),D=B(()=>d(f(N)).icon),V=B(()=>p({isFolder:f(v)})),L=B(()=>m(f(N))),te=a.getPolicy({enforcePassword:f(L)}),Y=()=>{y.value=!0},se=({date:F,error:C})=>{x.value=F,g.value=C},he=()=>Promise.allSettled(e.resources.map(F=>b({clientService:n,space:e.space,resource:F,options:{type:f(N),"@libre.graph.quickLink":!1,password:f(A).value,expirationDateTime:f(x)?.toISO(),displayName:i("Unnamed link")}}))),ae=B(()=>te.check(f(A).value)),we=B(()=>!f(ae)||f(g)),Q=async()=>{const F=await he(),C=[],q=F.filter(hi);return q.length&&q.map(({reason:K})=>K).forEach(K=>{if(console.error(K),K.response?.status===400){const j=K.response.data.error;j.message=Tt.upperFirst(j.message),C.push(j)}}),C.length?(A.error=i(C[0].message),Promise.reject()):F};t({onConfirm:async(F={})=>{if(f(l)){const q=(await Q()).filter(pi);q.length&&(u("opencloud-embed:share",q.map(({value:K})=>K.webUrl)),u("opencloud-embed:share-links",q.map(({value:K})=>({url:K.webUrl,...F.copyPassword&&{password:f(A).value}})))),o(e.modal.id);return}await s({createLinkHandler:Q,password:F.copyPassword?f(A).value:void 0}),o(e.modal.id)}});const ce=F=>{A.value=F,A.error=void 0},Ae=F=>{N.value=F},ee=()=>a.generatePassword();return Lt(()=>{const F=f(R)[f(N)];F&&F.$el.focus(),f(L)&&(A.value=a.generatePassword())}),(F,C)=>{const q=Ee("oc-icon"),K=Ee("oc-text-input"),j=Ee("oc-datepicker"),H=Ee("oc-list"),ge=Ee("oc-drop");return X(),pe(Be,null,[fe("div",YN,[y.value?(X(),pe("div",JN,[me(q,{class:"mr-2",name:D.value,"fill-type":"line"},null,8,["name"]),me(p0,{"model-value":N.value,"available-link-type-options":V.value,"onUpdate:modelValue":Ae},null,8,["model-value","available-link-type-options"])])):(X(),pe("div",ZN,[me(q,{class:"mr-2",name:D.value,"fill-type":"line"},null,8,["name"]),fe("div",e2,[fe("span",{class:"font-semibold",textContent:z.toDisplayString(O.value)},null,8,t2),fe("span",{class:"text-sm",textContent:z.toDisplayString(W.value)},null,8,n2)])])),y.value?Re("",!0):(X(),Te(f(wn),{key:2,class:"link-modal-advanced-mode-button","gap-size":"xsmall",appearance:"raw","no-hover":"",onClick:C[0]||(C[0]=xe=>Y())},{default:ve(()=>[me(q,{name:"settings-3",size:"small","fill-type":"fill"}),fe("span",{textContent:z.toDisplayString(f(i)("Options"))},null,8,r2)]),_:1}))]),fe("div",i2,[y.value?(X(),Te(K,{key:T.value,"model-value":A.value,type:"password","password-policy":f(te),"generate-password-method":ee,"error-message":A.error,label:f(i)("Password"),"required-mark":L.value,class:"link-modal-password-input","onUpdate:modelValue":ce},null,8,["model-value","password-policy","error-message","label","required-mark"])):A.value?(X(),pe("div",o2,[fe("span",{textContent:z.toDisplayString(f(i)("Password:"))},null,8,s2),fe("span",{textContent:z.toDisplayString(A.value)},null,8,a2)])):Re("",!0),y.value?(X(),Te(j,{key:2,class:"mt-2","min-date":f(Ut.DateTime).now(),label:f(i)("Expiry date"),"is-dark":f(S).isDark,onDateChanged:se},null,8,["min-date","label","is-dark"])):Re("",!0)]),fe("div",l2,[me(f(wn),{class:"link-modal-cancel oc-modal-body-actions-cancel ml-2",onClick:C[1]||(C[1]=xe=>F.$emit("cancel"))},{default:ve(()=>[kt(z.toDisplayString(f(i)("Cancel")),1)]),_:1}),fe("div",{class:z.normalizeClass(["ml-2",{"oc-button-group":A.value}])},[me(f(wn),{class:"link-modal-confirm oc-modal-body-actions-confirm",appearance:"filled",disabled:we.value,onClick:C[2]||(C[2]=xe=>F.$emit("confirm"))},{default:ve(()=>[kt(z.toDisplayString(h.value),1)]),_:1},8,["disabled"]),A.value?(X(),Te(f(wn),{key:0,class:"link-modal-confirm oc-modal-body-actions-confirm-secondary-trigger p-1",appearance:"filled",disabled:we.value,"aria-label":f(i)("More options")},{default:ve(()=>[me(q,{size:"small",name:"arrow-down-s"}),fe("span",c2,z.toDisplayString(f(i)("More options")),1)]),_:1},8,["disabled","aria-label"])):Re("",!0),A.value?(X(),Te(ge,{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:f(i)("More options"),"close-on-click":""},{default:ve(()=>[me(H,null,{default:ve(()=>[fe("li",null,[me(f(wn),{class:"oc-modal-body-actions-confirm-password",appearance:"raw","justify-content":"left",onClick:C[3]||(C[3]=xe=>F.$emit("confirm",{copyPassword:!0}))},{default:ve(()=>[kt(z.toDisplayString(E.value),1)]),_:1})])]),_:1})]),_:1},8,["title"])):Re("",!0)],2)])],64)}}}),u2=({enforceModal:e=!1}={})=>{const t=Ke(),n=vt(),{$gettext:r,$ngettext:i}=Ie.useGettext(),o=en(),s=fn(),a=gn(),{defaultLinkType:l}=Wa(),{addLink:u}=Cr(),{dispatchModal:c}=ht(),{copyLink:p}=Ad(),d=({space:w,resources:S})=>{const y=o.sharingPublicPasswordEnforcedFor.read_only===!0;if(e||y){c({title:i("Copy link for »%{resourceName}«","Copy links for the selected items",S.length,{resourceName:S[0].name}),customComponent:h0,customComponentAttrs:()=>({space:w,resources:S}),hideActions:!0});return}const g=S.map(h=>u({clientService:t,space:w,resource:h,options:{"@libre.graph.quickLink":!1,displayName:r("Unnamed link"),type:f(l)}}));p({createLinkHandler:()=>a.addTask(()=>Promise.allSettled(g))})},m=({resources:w})=>{if(!w.length)return!1;for(const S of w)if(!S.canShare({user:n.user,ability:s})||re.isProjectSpaceResource(S)&&S.disabled)return!1;return!0};return{actions:B(()=>[{name:"create-links",icon:"link",handler:d,label:()=>r("Create links"),isVisible:m,class:"oc-files-actions-create-links"}])}},f2=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=nt(),r=vt(),{$gettext:i}=Ie.useGettext(),{dispatchModal:o}=ht(),s=ar(),{isEnabled:a}=Qr(),{openEditor:l}=Xn(),u=Ke(),c=ze(),{resources:p,currentFolder:d,areFileExtensionsShown:m}=Me.storeToRefs(c),{isFileNameValid:b}=Ei(),w=B(()=>s.fileExtensions.filter(({newFileMenu:v})=>!!v)),S=(v,h)=>(c.upsertResource(v),l(h,f(e),v)),y=(v,h,E)=>{let T=i("New file")+`.${h}`;f(p).some(x=>x.name===T)&&(T=zn(T,h,f(p))),m.value||(T=re.extractNameWithoutExtension({name:T,extension:h}));const R=m.value?[0,T.length-(h.length+1)]:null;o({title:i("Create a new file"),confirmText:i("Create"),hasInput:!0,inputValue:T,inputLabel:i("File name"),inputRequiredMark:!0,inputSelectionRange:R,onConfirm:async x=>{m.value||(x=`${x}.${h}`);try{let A;if(E.createFileHandler)A=await E.createFileHandler({fileName:x,space:f(e),currentFolder:f(d)});else if(E.type==="folder"){const N=ft.join(f(d).path,x);A=await u.webdav.createFolder(f(e),{path:N})}else{const N=ft.join(f(d).path,x);A=await u.webdav.putFileContents(f(e),{path:N})}return c.upsertResource(A),t({title:i("»%{fileName}« was created successfully",{fileName:A.name})}),f(a)?void 0:S(A,E)}catch(A){console.error(A),n({title:i("Failed to create file"),errors:[A]})}},onInput:(x,A)=>{const N=m.value?x:`${x}.${h}`,W={path:ft.join(f(d).path,N),name:N,extension:h},{isValid:O,error:D}=b(W,N);A(O?null:D)}})};return{actions:B(()=>{const v=[],h={};for(const E of f(w)||[])E.hasPriority?h[E.extension]=E:h[E.extension]=h[E.extension]||E;for(const[,E]of Object.entries(h))v.push({name:"create-new-file",icon:"add",handler:T=>y(T,E.extension,E),label:()=>i(E.newFileMenu.menuTitle()),isVisible:()=>f(d)?.canUpload({user:r.user}),class:"oc-files-actions-create-new-file",ext:E.extension,isExternal:E.app?.startsWith("external-")});return v}),openFile:S}},m0=()=>{const e=tn("scrollTo"),t=tn("details"),n=ze(),r=B(()=>Ct(f(e))),i=B(()=>Ct(f(t))),o=(a,l={forceScroll:!1,topbarElement:null})=>{const u=document.querySelectorAll(`[data-item-id='${a}']`)[0];if(!u){Je.publish("app.files.navigate.page",{resourceId:a,forceScroll:l.forceScroll,topbarElement:l.topbarElement});return}const p=document.getElementById(l.topbarElement)?.offsetHeight||0+u.offsetHeight*2;(u.getBoundingClientRect().bottom>window.innerHeight||u.getBoundingClientRect().top<p||l.forceScroll)&&u.scrollIntoView({behavior:"smooth",block:"center"})};return Je.subscribe("app.files.navigate.scrollTo",a=>o(a.resourceId,{forceScroll:a.forceScroll,topbarElement:a.topbarElement})),{scrollToResource:o,scrollToResourceFromRoute:(a,l)=>{if(!f(r)||!a.length)return;const u=f(a).find(c=>re.isIncomingShareResource(c)?c.remoteItemId===f(r):c.id===f(r));u&&u.processing!==!0&&(n.setSelection([u.id]),o(u.id,{forceScroll:!0,topbarElement:l}),f(i)&&Je.publish(Rt.openWithPanel,f(i)))}}},d2=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=nt(),{dispatchModal:r}=ht(),{$gettext:i}=Ie.useGettext(),{scrollToResource:o}=m0(),s=ze(),{resources:a,currentFolder:l}=Me.storeToRefs(s),u=Ke(),{isFileNameValid:c}=Ei(),p=async b=>{b=b.trimEnd();try{const w=ft.join(f(l).path,b),S=await u.webdav.createFolder(f(e),{path:w});re.isShareSpaceResource(f(e))&&(S.remoteItemId=f(e).id),s.upsertResource(S),t({title:i("»%{folderName}« was created successfully",{folderName:b})}),await zt(),o(S.id,{forceScroll:!0,topbarElement:"files-app-bar"})}catch(w){console.error(w),n({title:i("Failed to create folder"),errors:[w]})}},d=()=>{let b=i("New folder");f(a).some(w=>w.name===b)&&(b=zn(b,"",f(a))),r({title:i("Create a new folder"),confirmText:i("Create"),hasInput:!0,inputValue:b,inputLabel:i("Folder name"),inputRequiredMark:!0,onConfirm:p,onInput:(w,S)=>{const y={path:ft.join(f(l).path,w),name:w,isFolder:!0},{isValid:g,error:v}=c(y,w,f(a));return S(g?null:v)}})};return{actions:B(()=>[{name:"create-folder",icon:"folder",handler:d,label:()=>i("New Folder"),isVisible:()=>f(l)?.canCreate(),class:"oc-files-actions-create-new-folder"}]),addNewFolder:p}},p2="rowMounted",h2="fileDropped",m2="contextmenuClicked";class rs{static Thumbnail=[36,36];static Tile=[1e3,1e3];static Preview=[1200,1200];static Avatar=64}class g2{static Thumbnail="thumbnail";static Preview="preview";static Avatar="avatar"}const xd=10,y2=63,Rd=256;class v2{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 g0{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 v2(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 is=_e({__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)"},i={name:"layout-grid",color:"var(--oc-role-secondary)"},o={name:"resource-type-file",color:"var(--oc-role-on-surface)"},s=Th(),a=wr(Eh),l=B(()=>e.resource.extension?!1:e.resource.type==="folder"||e.resource.isFolder),u=B(()=>e.resource.type==="space"),c=B(()=>re.isProjectSpaceResource(e.resource)&&e.resource.disabled===!0),p=B(()=>re.isPersonalSpaceResource(e.resource)),d=B(()=>e.resource.extension?.toLowerCase()),m=B(()=>e.resource.mimeType?.toLowerCase()),b=B(()=>{if(f(p))return n;if(f(c))return i;if(f(u))return r;if(f(l))return t;const w=s[f(d)]||a?.mimeType[f(m)]||a?.extension[f(d)];return{...o,...w}});return(w,S)=>{const y=Ee("oc-icon");return X(),Te(y,{key:`resource-icon-${b.value.name}`,name:b.value.name,color:b.value.color,size:e.size,class:z.normalizeClass(["oc-resource-icon","inline-flex","items-center",{"opacity-80 grayscale":c.value,"[&_svg]:h-[70%]":!u.value&&!l.value}])},null,8,["name","color","size","class"])}}}),b2={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=dt(),{options:n}=Me.storeToRefs(t);return{linkTarget:B(()=>f(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)}}},w2={key:1};function S2(e,t,n,r,i,o){return n.isResourceClickable?(X(),Te(Pn(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]=Wt(()=>{},["prevent","stop"])),onClick:o.emitClick},{default:ve(()=>[Ue(e.$slots,"default",{},void 0,!0)]),_:3},40,["to","target","rel","appearance","gap-size","justify-content","type","no-hover","onClick"])):(X(),pe("span",w2,[Ue(e.$slots,"default",{},void 0,!0)]))}const Ha=Ye(b2,[["render",S2],["__scopeId","data-v-15d92dd6"]]),E2=["data-test-resource-path","data-test-resource-name","data-test-resource-type","title"],T2={key:0,class:"truncate leading-4"},A2=["textContent"],x2=["textContent"],R2=["textContent"],Cd=_e({__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=B(()=>e.extension?e.name.slice(0,-e.extension.length-1):e.name),n=B(()=>e.extension?"."+e.extension:""),r=B(()=>{if(!e.isPathDisplayed)return null;const a=e.fullPath.replace(/^\//,"").split("/");return a.length<2?null:a.length===2?a[0]+"/":`…/${a[a.length-2]}/`}),i=B(()=>!e.isPathDisplayed||f(r)===e.fullPath?null:e.pathPrefix?Bl.join(e.pathPrefix,e.fullPath):e.fullPath),o=B(()=>{if(!f(i))return e.isExtensionDisplayed?`${f(t)}${f(n)}`:f(t)}),s=B(()=>(f(r)||"")+e.name);return(a,l)=>{const u=sn("oc-tooltip");return ot((X(),pe("span",{class:z.normalizeClass(["oc-resource-name flex min-w-0",[{"inline-block":!e.truncateName}]]),"data-test-resource-path":e.fullPath,"data-test-resource-name":s.value,"data-test-resource-type":e.type,title:o.value},[e.truncateName?(X(),pe("span",T2,[fe("span",{class:"oc-resource-basename whitespace-pre text-role-on-surface",textContent:z.toDisplayString(t.value)},null,8,A2)])):(X(),pe("span",{key:1,class:"oc-resource-basename break-normal text-role-on-surface leading-4",textContent:z.toDisplayString(t.value)},null,8,x2)),e.extension&&e.isExtensionDisplayed?(X(),pe("span",{key:2,class:"oc-resource-extension whitespace-pre text-role-on-surface leading-4",textContent:z.toDisplayString(n.value)},null,8,R2)):Re("",!0)],10,E2)),[[u,i.value]])}}}),C2={class:"flex"},k2=["textContent"],os=_e({__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}=Ie.useGettext(),i=B(()=>e.parentFolderLink?"router-link":"span"),o=B(()=>({"fill-type":"line",name:"folder-2",size:"small",...e.parentFolderLinkIconAdditionalAttributes})),s=B(()=>e.isThumbnailDisplayed&&Object.prototype.hasOwnProperty.call(e.resource,"thumbnail")),a=B(()=>e.resource.thumbnail),l=B(()=>e.resource.locked?r("This item is locked"):null),u=c=>{!c||typeof c.stopPropagation!="function"||n("click",c)};return(c,p)=>{const d=Ee("oc-image"),m=Ee("oc-icon"),b=sn("oc-tooltip");return X(),pe("div",{class:z.normalizeClass(["oc-resource inline-flex justify-start items-center max-w-full overflow-visible",{"pointer-events-none":!e.isResourceClickable}])},[e.isIconDisplayed?ot((X(),Te(Ha,{key:0,resource:e.resource,link:e.link,"is-resource-clickable":e.isResourceClickable,class:z.normalizeClass(["relative",{"hover:underline":e.isResourceClickable}]),"aria-label":e.isResourceClickable?f(r)("Open »%{name}«",{name:e.resource?.name??""}):void 0,onClick:u},{default:ve(()=>[s.value?ot((X(),Te(d,{key:a.value,src:a.value,"data-test-thumbnail-resource-name":e.resource.name,class:"rounded-xs size-8 object-cover max-w-fit","aria-label":l.value,alt:""},null,8,["src","data-test-thumbnail-resource-name","aria-label"])),[[b,l.value]]):ot((X(),Te(is,{key:1,"aria-label":l.value,"aria-hidden":"true",resource:e.resource},null,8,["aria-label","resource"])),[[b,l.value]])]),_:1},8,["resource","link","is-resource-clickable","class","aria-label"])),[[b,e.isResourceClickable?l.value:void 0]]):Re("",!0),fe("div",{class:z.normalizeClass(["oc-resource-details block truncate",{"pl-2":e.isIconDisplayed}])},[me(Ha,{resource:e.resource,"is-resource-clickable":e.isResourceClickable,link:e.link,class:z.normalizeClass(["hover:outline-offset-0 focus:outline-offset-0",{"hover:underline":e.isResourceClickable}]),onClick:u},{default:ve(()=>[(X(),Te(Cd,{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"]),fe("div",C2,[e.isPathDisplayed?(X(),Te(Pn(i.value),{key:0,to:e.parentFolderLink,class:z.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:ve(()=>[me(m,$t(o.value,{class:"mr-1"}),null,16),fe("span",{class:"text truncate text-sm hover:underline",textContent:z.toDisplayString(e.parentFolderName)},null,8,k2)]),_:1},8,["to","class"])):Re("",!0)])],2)],2)}}}),y0=_e({__name:"ResourcePreview",props:{searchResult:{default:()=>({data:{}})},isClickable:{type:Boolean,default:!0},term:{default:""}},setup(e){const t=new g0,{triggerDefaultAction:n}=Xn(),{getMatchingSpace:r}=ln(),{getDefaultAction:i}=Xn(),{loadPreview:o}=Nd(),s=Tn("resourceListItem"),{getPathPrefix:a,getParentFolderName:l,getParentFolderLink:u,getParentFolderLinkIconAdditionalAttributes:c,getFolderLink:p}=Yr(),d=ze(),m=le(),b=B(()=>d.areFileExtensionsShown),w=B(()=>({...e.searchResult.data,...f(m)&&{thumbnail:f(m)}})),S=B(()=>r(f(w))),y=B(()=>{const x=f(w);return re.isSpaceResource(x)&&x.disabled===!0}),g=()=>{n({space:f(S),resources:[f(w)]})},v=B(()=>e.isClickable?{parentFolderLink:u(f(w)),onClick:g}:{isResourceClickable:!1}),h=B(()=>{if(f(w).isFolder)return p(f(w));const x=i({resources:[f(w)],space:f(S)});if(!x?.route)return null;const A=x.route({space:f(S),resources:[f(w)]});return A.query={...A.query,contextRouteQuery:{...A.query?.contextRouteQuery||{},term:e.term}},A}),E=a(f(w)),T=l(f(w)),R=c(f(w));return Lt(()=>{f(y)&&f(s).parentElement.classList.add("disabled");const x=async()=>{const N=await o({space:f(S),resource:f(w),dimensions:rs.Thumbnail,cancelRunning:!0,updateStore:!1});N&&(m.value=N)},A=Tt.debounce(({unobserve:N})=>{N(),x()},250);t.observe(f(s).$el,{onEnter:A,onExit:A.cancel})}),An(()=>{t.disconnect()}),(x,A)=>(X(),Te(os,$t({ref_key:"resourceListItem",ref:s,resource:w.value,"path-prefix":f(E),"is-path-displayed":!0,link:h.value,"is-extension-displayed":b.value,"parent-folder-link-icon-additional-attributes":f(R),"parent-folder-name":f(T),"is-thumbnail-displayed":!!m.value},v.value),null,16,["resource","path-prefix","link","is-extension-displayed","parent-folder-link-icon-additional-attributes","parent-folder-name","is-thumbnail-displayed"]))}}),P2=7,I2=200,O2=_e({name:"CreateShortcutModal",components:{ResourcePreview:y0},props:{modal:{type:Object,required:!0},space:{type:Object,required:!0}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:n}){const r=Ke(),{$gettext:i}=Ie.useGettext(),{showMessage:o,showErrorMessage:s}=nt(),a=He(),{search:l}=Zf(),{getPathPrefix:u,getParentFolderName:c,getParentFolderLink:p,getParentFolderLinkIconAdditionalAttributes:d,getFolderLink:m}=Yr(),b=ze(),{resources:w,currentFolder:S}=Me.storeToRefs(b),y=Tn("dropRef"),g=le(""),v=le(""),h=le(null),E=le(null),T=le(!1);let R;const x=q=>{const K=q.trim();return L(K)?K:`https://${K}`},A=B(()=>x(f(g))),N=B(()=>!!f(w).find(q=>q.name===`${f(v)}.url`)),W=B(()=>f(N)||!f(v)||!f(g));st(W,()=>{t("update:confirmDisabled",f(W))},{immediate:!0});const O=B(()=>f(N)?i("»%{name}« already exists",{name:`${f(v)}.url`}):/[/]/.test(f(v))?i('Shortcut name cannot contain "/"'):""),D=rn.useTask(function*(q,K){h.value=null,K=`name:"*${K}*" NOT name:"*.url"`;try{h.value=yield l(K,P2)}catch{}}),V=Tt.debounce(()=>{D.perform(f(g))},I2),L=q=>["http://","https://"].some(j=>j.startsWith(q)||q.startsWith(j)),te=()=>{h.value=null,g.value=f(A);try{let q=new URL(f(A)).host;f(w).some(K=>K.name===`${q}.url`)&&(q=zn(`${q}.url`,"url",f(w)).slice(0,-4)),v.value=q}catch{}},Y=q=>{h.value=null;const K=new URL(window.location.href);let j=q.data.name;g.value=`${K.origin}/f/${q.id}`,f(w).some(H=>H.name===`${j}.url`)&&(j=zn(`${j}.url`,"url",f(w)).slice(0,-4)),v.value=j},se=q=>f(E)===q,he=(q=!1)=>{const K=Array.from(document.querySelectorAll("li.selectable-item"));let j=f(E)!==null?f(E):q?K.length:-1;const H=q?-1:1;do if(j+=H,j<0||j>K.length-1)return null;while(K[j].classList.contains("disabled"));return j},ae=()=>{E.value=he(!0)},we=()=>{E.value=he(!1)},Q=q=>{f(T)&&(q.stopPropagation(),f(y).hide())},ie=q=>{f(T)&&(q.stopPropagation(),f(E)!==null&&(f(E)===0?te():Y(f(h)?.values?.[f(E)-1]),f(y).hide()))},ce=()=>{T.value=!1,E.value=null},Ae=()=>{T.value=!0,E.value=0},ee=()=>{g.value.trim().length&&f(y).show()},F=async()=>{if(await zt(),v.value=g.value.trim(),!g.value.trim().length){f(y).hide();return}f(y).show(),_n(a,"files-public-link")||V()},C=async()=>{try{const K=`[InternetShortcut]
64
- URL=${Gd.sanitize(x(f(g)),{USE_PROFILES:{html:!0}})}`,j=re.urlJoin(f(S).path,`${f(v)}.url`),H=await r.webdav.putFileContents(e.space,{path:j,content:K});b.upsertResource(H),o({title:i("Shortcut was created successfully")})}catch(q){console.error(q),s({title:i("Failed to create shortcut"),errors:[q]})}};return Lt(async()=>{await zt(),R=new Qd(f(y)?.$refs?.drop)}),st(h,async()=>{await zt(),!(!f(T)||!R)&&(R.unmark(),R.mark(f(g),{element:"span",className:"mark-highlight",exclude:[".selectable-item-url *",".create-shortcut-modal-search-separator *"]}))},{deep:!0}),st(E,()=>{if(!f(T)||typeof f(y)?.$el?.scrollTo!="function")return;const q=f(y).$el.querySelectorAll(".selectable-item");q[f(E)]&&f(y).$el.scrollTo(0,f(E)===null?0:q[f(E)].getBoundingClientRect().y-q[f(E)].getBoundingClientRect().height)}),n({onConfirm:C}),{inputUrl:g,inputFilename:v,dropRef:y,dropItemUrl:A,searchResult:h,confirmButtonDisabled:W,inputFileNameErrorMessage:O,searchTask:D,dropItemUrlClicked:te,dropItemResourceClicked:Y,getPathPrefix:u,getFolderLink:m,getParentFolderLink:p,getParentFolderName:c,getParentFolderLinkIconAdditionalAttributes:d,onKeyEnterDrop:ie,onKeyDownDrop:we,onKeyUpDrop:ae,onKeyEscDrop:Q,onHideDrop:ce,onShowDrop:Ae,onInputUrlInput:F,onClickUrlInput:ee,isDropItemActive:se,onConfirm:C}}}),F2={class:"flex items-center mb-1"},_2={for:"create-shortcut-modal-url-input"},D2=["textContent"],N2={key:0,class:"p-1 flex justify-center"},L2={class:"create-shortcut-modal-search-separator text-role-on-surface-variant text-sm pl-1"},$2=["textContent"],M2={key:0,class:"flex w-full mt-4"},B2={class:"flex items-center mb-1"},j2={for:"create-shortcut-modal-filename-input"};function U2(e,t,n,r,i,o){const s=Ee("oc-contextual-helper"),a=Ee("oc-text-input"),l=Ee("oc-icon"),u=Ee("oc-button"),c=Ee("oc-spinner"),p=Ee("resource-preview"),d=Ee("oc-list"),m=Ee("oc-drop");return X(),pe(Be,null,[me(a,{id:"create-shortcut-modal-url-input",modelValue:e.inputUrl,"onUpdate:modelValue":[t[0]||(t[0]=b=>e.inputUrl=b),e.onInputUrlInput],placeholder:"example.org",label:e.$gettext("Webpage or file"),onKeydown:[bo(e.onKeyUpDrop,["up"]),bo(e.onKeyDownDrop,["down"]),bo(e.onKeyEscDrop,["esc"]),bo(e.onKeyEnterDrop,["enter"])],onClick:e.onClickUrlInput},{label:ve(()=>[fe("div",F2,[fe("label",_2,[kt(z.toDisplayString(e.$gettext("Webpage or file"))+" ",1),t[2]||(t[2]=fe("span",{class:"text-role-error","aria-hidden":"true"},"*",-1))]),me(s,{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"]),me(m,{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:ve(()=>[me(d,null,{default:ve(()=>[fe("li",{class:z.normalizeClass(["selectable-item selectable-item-url",{active:e.isDropItemActive(0)}])},[me(u,{class:"w-full",appearance:"raw","justify-content":"left",onClick:e.dropItemUrlClicked},{default:ve(()=>[me(l,{name:"external-link"}),fe("span",{textContent:z.toDisplayString(e.dropItemUrl)},null,8,D2)]),_:1},8,["onClick"])],2),e.searchTask.isRunning?(X(),pe("li",N2,[me(c)])):Re("",!0),e.searchResult?.values?.length?(X(),pe(Be,{key:1},[fe("li",L2,[fe("span",{textContent:z.toDisplayString(e.$gettext("Link to a file"))},null,8,$2)]),(X(!0),pe(Be,null,mt(e.searchResult.values,(b,w)=>(X(),pe("li",{key:w,class:z.normalizeClass(["selectable-item",{active:e.isDropItemActive(w+1)}])},[me(u,{class:"w-full",appearance:"raw","justify-content":"left",onClick:S=>e.dropItemResourceClicked(b)},{default:ve(()=>[me(p,{"search-result":b,"is-clickable":!1},null,8,["search-result"])]),_:2},1032,["onClick"])],2))),128))],64)):Re("",!0)]),_:1})]),_:1},8,["onHideDrop","onShowDrop"]),e.inputFilename?(X(),pe("div",M2,[me(a,{id:"create-shortcut-modal-filename-input",modelValue:e.inputFilename,"onUpdate:modelValue":t[1]||(t[1]=b=>e.inputFilename=b),label:e.$gettext("Shortcut name"),class:"w-full","error-message":e.inputFileNameErrorMessage,"fix-message-line":!0},{label:ve(()=>[fe("div",B2,[fe("label",j2,[kt(z.toDisplayString(e.$gettext("Shortcut name"))+" ",1),t[3]||(t[3]=fe("span",{class:"text-role-error","aria-hidden":"true"},"*",-1))]),me(s,{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"])])):Re("",!0)],64)}const v0=Ye(O2,[["render",U2]]),V2=({space:e})=>{const{dispatchModal:t}=ht(),{$gettext:n}=Ie.useGettext(),r=ze(),{currentFolder:i}=Me.storeToRefs(r);return{actions:B(()=>[{name:"create-shortcut",icon:"external-link",handler:()=>{t({title:n("Create a Shortcut"),confirmText:n("Create"),customComponent:v0,customComponentAttrs:()=>({space:f(e)})})},label:()=>n("New Shortcut"),isVisible:()=>f(i)?.canCreate(),class:"oc-files-actions-create-new-shortcut"}])}},kd=()=>{const{showMessage:e,showErrorMessage:t}=nt(),{can:n}=fn(),{$gettext:r,$ngettext:i}=Ie.useGettext(),{createSpace:o}=Qi(),s=Ke(),a=He(),l=B(()=>n("create-all","Drive")),{dispatchModal:u}=ht(),c=dt(),p=at(),d=ze(),{isSpaceNameValid:m}=Ei(),b=async({spaceName:y,resources:g,space:v})=>{const{webdav:h}=s,E=new Lr({concurrency:c.options.concurrentRequests.resourceBatchActions}),T=[];try{const R=await o(y);p.upsertSpace(R),g.length===1&&g[0].isFolder&&(g=(await h.listFiles(v,{path:g[0].path})).children);for(const x of g)T.push(E.add(()=>h.copyFiles(v,x,R,{path:x.name})));await Promise.all(T),d.resetSelection(),e({title:r("Space was created successfully")})}catch(R){console.error(R),t({title:r("Creating space failed…"),errors:[R]})}},w=({resources:y,space:g})=>{u({title:i("Create Space from »%{resourceName}«","Create Space from selection",y.length,{resourceName:y[0].name}),message:i("Create Space with the content of »%{resourceName}«.","Create Space with the selected files.",y.length,{resourceName:y[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:(v,h)=>{const{isValid:E,error:T}=m(v);h(E?null:T)},onConfirm:v=>b({spaceName:v,space:g,resources:y})})};return{actions:B(()=>[{name:"create-space-from-resource",icon:"function",handler:w,label:()=>r("Create Space from selection"),isVisible:({resources:y,space:g})=>!(!y.length||!f(l)||!xt(a,"files-spaces-generic")||!re.isPersonalSpaceResource(g)),class:"oc-files-actions-create-space-from-resource-trigger"}])}},ss=()=>{const e=vt(),t=en(),{displayDialog:n,filesList_delete:r}=D0(),{$gettext:i}=Ie.useGettext();return{actions:B(()=>[{name:"delete",icon:"delete-bin-5",label:()=>i("Delete"),handler:({resources:s})=>{r(s)},isVisible:({resources:s})=>s.length?s.every(a=>a.canBeDeleted()&&!re.isSpaceResource(a)&&!re.isIncomingShareResource(a)&&!re.isTrashResource(a)&&!a.isShareRoot()):!1,isDisabled:({resources:s})=>s.length===1&&s[0].locked,disabledTooltip:()=>i("File can't be deleted because it is currently locked."),class:"oc-files-actions-delete-trigger"},{name:"delete-permanent",icon:"delete-bin-5",label:()=>i("Delete"),handler:({space:s,resources:a})=>{n(s,a)},isVisible:({space:s,resources:a})=>!a.length||!t.filesPermanentDeletion||re.isProjectSpaceResource(s)&&!s.canDeleteFromTrashBin({user:e.user})?!1:a.every(re.isTrashResource),class:"oc-files-actions-delete-permanent-trigger"}])}},Ka=()=>{const{showMessage:e,showErrorMessage:t}=nt(),n=He(),{$gettext:r,$ngettext:i}=Ie.useGettext(),o=Ke(),s=gn(),a=dt(),{updateResourceField:l}=ze(),u=async({resources:p})=>{const d=[],m=[],b=new Lr({concurrency:a.options.concurrentRequests.resourceBatchActions});if(p.forEach(w=>{m.push(b.add(async()=>{try{const{graphAuthenticated:S}=o;await S.driveItems.deleteDriveItem(w.driveId,w.id),l({id:w.id,field:"syncEnabled",value:!1})}catch(S){console.error(S),d.push(S)}}))}),await Promise.all(m),d.length===0){xt(n,"files-spaces-generic")&&(e({title:i("Sync for the selected share was disabled successfully","Sync for the selected shares was disabled successfully",p.length)}),n.push(Fn("files-shares-with-me")));return}t({title:i("Failed to disable sync for the the selected share","Failed to disable sync for the selected shares",p.length),errors:d})};return{actions:B(()=>[{name:"disable-sync",icon:"spam-3",handler:p=>s.addTask(()=>u(p)),label:()=>r("Disable sync"),isVisible:({space:p,resources:d})=>!Mt(n,"files-shares-with-me")&&!xt(n,"files-spaces-generic")||d.length===0||xt(n,"files-spaces-generic")&&(p?.driveType!=="share"||d.length>1||d[0].path!=="/")?!1:d.some(m=>m.syncEnabled),class:"oc-files-actions-disable-sync-trigger"}])}},b0=()=>Ar("$archiverService"),Ga=()=>{const{showErrorMessage:e}=nt(),t=He(),n=b0(),{$ngettext:r,$gettext:i,current:o}=Ie.useGettext(),s=li(),a=_r(),l=({space:p,resources:d})=>(d.length>1&&(d=d.filter(m=>m.canDownload()&&!re.isProjectSpaceResource(m))),n.triggerDownload({fileIds:d.map(m=>m.fileId),...p&&re.isPublicSpaceResource(p)&&{publicToken:p.id,publicLinkPassword:s.publicLinkPassword}}).catch(m=>{console.error(m),e({title:r("Failed to download the selected folder.","Failed to download the selected files.",d.length),errors:[m]})})),u=p=>{const d=f(n.capability);return d?p.reduce((b,w)=>b+parseInt(`${w.size}`),0)>parseInt(d.max_size):void 0};return{actions:B(()=>[{name:"download-archive",icon:"inbox-archive",handler:p=>{l(p)},label:()=>i("Download"),disabledTooltip:({resources:p})=>u(p)?i("The selection exceeds the allowed archive size (max. %{maxSize})",{maxSize:vn(f(n.capability).max_size,o)}):"",isDisabled:({resources:p})=>u(p),isVisible:({resources:p})=>f(a)&&!xt(t,"files-spaces-generic")&&!_n(t,"files-public-link")&&!Vt(t,"files-common-favorites")&&!Vt(t,"files-common-search")&&!Mt(t,"files-shares-with-me")&&!Mt(t,"files-shares-with-others")&&!Mt(t,"files-shares-via-link")&&!Vt(t,"files-common-search")||!f(n.available)||p.length===0||p.length===1&&!p[0].isFolder||p.length>1&&p.every(m=>re.isProjectSpaceResource(m))||re.isProjectSpaceResource(p[0])&&p[0].disabled?!1:!p.some(m=>!m.canDownload()),class:"oc-files-actions-download-archive-trigger"}])}},w0=e=>{const{showErrorMessage:t}=nt(),n=e?.clientService||Ke(),{$gettext:r}=Ie.useGettext(),i=vt();return{downloadFile:async(s,a,l=null)=>{try{const u=await n.webdav.getFileUrl(s,a,{version:l,username:i.user?.onPremisesSamAccountName});fc(u,a.name)}catch(u){console.error(u),t({title:r("Download failed"),desc:r("File could not be located"),errors:[u]})}}}},as=()=>{const e=He(),{$gettext:t}=Ie.useGettext(),n=_r(),r=Za(),{downloadFile:i}=w0(),o=({space:a,resources:l})=>{i(a,l[0])};return{actions:B(()=>[{name:"download-file",icon:"file-download",handler:o,label:()=>t("Download"),isVisible:({resources:a})=>f(n)&&!f(r)&&!xt(e,"files-spaces-generic")&&!_n(e,"files-public-link")&&!Vt(e,"files-common-favorites")&&!Vt(e,"files-common-search")&&!Mt(e,"files-shares-with-me")&&!Mt(e,"files-shares-with-others")&&!Mt(e,"files-shares-via-link")||a.length!==1||a[0].isFolder?!1:a[0].canDownload(),class:"oc-files-actions-download-file-trigger"}])}},q2=()=>{const{showMessage:e,showErrorMessage:t}=nt(),n=vt(),r=en(),{$gettext:i}=Ie.useGettext(),o=Ke(),{dispatchModal:s}=ht(),a=ze(),l=at(),u=gn(),c=async({space:m})=>{try{await o.webdav.clearTrashBin(m),e({title:i("All deleted files were removed")}),a.resetSelection(),l.updateSpaceField({id:m.id,field:"hasTrashedItems",value:!1}),a.resources.some(re.isTrashResource)&&a.clearResources()}catch(b){console.error(b),t({title:i("Failed to empty trash bin"),errors:[b]})}},p=({resources:m})=>{s({title:i("Empty trash bin for »%{name}«",{name:m[0].name}),confirmText:i("Delete"),message:i("Are you sure you want to permanently delete the items in »%{name}«? You can’t undo this action.",{name:m[0].name}),hasInput:!1,onConfirm:()=>u.addTask(()=>c({space:m[0]}))})};return{actions:B(()=>[{name:"empty-trash-bin",icon:({resources:m})=>m[0]?.hasTrashedItems?"delete-bin-2":"delete-bin-7",label:()=>i("Empty trash bin"),handler:p,isVisible:({resources:m})=>m.length!==1||!r.filesPermanentDeletion||!re.isSpaceResource(m[0])?!1:m[0].canDeleteFromTrashBin({user:n.user}),isDisabled:({resources:m})=>!m[0].hasTrashedItems,class:"oc-files-actions-empty-trash-bin-trigger"}]),emptyTrashBin:c}},Qa=()=>{const{showMessage:e,showErrorMessage:t}=nt(),n=He(),{$gettext:r,$ngettext:i}=Ie.useGettext(),o=Ke(),s=gn(),a=dt(),l=ze(),{updateResourceField:u}=l,c=async({resources:d})=>{const m=[],b=[],w=new Lr({concurrency:a.options.concurrentRequests.resourceBatchActions});if(d.forEach(S=>{b.push(w.add(async()=>{try{const{graphAuthenticated:y}=o;await y.driveItems.createDriveItem(S.driveId,{name:S.name,remoteItem:{id:S.fileId}}),u({id:S.id,field:"syncEnabled",value:!0})}catch(y){console.error(y),m.push(y)}}))}),await Promise.all(b),m.length===0){l.resetSelection(),xt(n,"files-spaces-generic")&&e({title:i("Sync for the selected share was enabled successfully","Sync for the selected shares was enabled successfully",d.length)});return}t({title:i("Failed to enable sync for the the selected share","Failed to enable sync for the selected shares",d.length),errors:m})};return{actions:B(()=>[{name:"enable-sync",icon:"check",handler:d=>s.addTask(()=>c(d)),label:()=>r("Enable sync"),isVisible:({space:d,resources:m})=>!Mt(n,"files-shares-with-me")&&!xt(n,"files-spaces-generic")||m.length===0||xt(n,"files-spaces-generic")&&(f(d)?.driveType!=="share"||m.length>1||m[0].path!=="/")?!1:m.some(b=>!b.syncEnabled),class:"oc-files-actions-enable-sync-trigger"}])}},Pd=()=>{const{showErrorMessage:e}=nt(),t=en(),n=He(),{$gettext:r}=Ie.useGettext(),i=Ke(),o=_r(),s=fn(),a=ze(),l=ur(),u=async({space:p,resources:d})=>{try{const m=!d[0].starred;await i.webdav.setFavorite(p,d[0],m),a.updateResourceField({id:d[0].id,field:"starred",value:m}),m||l.publish("app.files.list.removeFromFavorites",d[0].id)}catch(m){const b=r('Failed to change favorite state of "%{file}"',{file:d[0].name},!0);e({title:b,errors:[m]})}};return{actions:B(()=>[{name:"favorite",icon:"star",handler:u,label:({resources:p})=>p[0].starred?r("Remove from favorites"):r("Add to favorites"),isVisible:({resources:p})=>f(o)&&!xt(n,"files-spaces-generic")&&!Vt(n,"files-common-favorites")||p.length!==1?!1:t.filesFavorites&&s.can("create","Favorite"),class:"oc-files-actions-favorite-trigger"}])}};function z2(e,t){const n=e.isReceivedShare()||e.isMounted(),r=t===""&&n;return e.canBeDeleted()&&!r}const Xa=()=>{const e=He(),{cutResources:t}=Uo(),n=Ie.useGettext(),{$gettext:r}=n,i=ze(),{currentFolder:o}=Me.storeToRefs(i),s=B(()=>jo()?r("⌘ + X"):r("Ctrl + X")),a=({resources:u})=>{t(u)};return{actions:B(()=>[{name:"cut",icon:"scissors",handler:a,shortcut:f(s),label:()=>r("Cut"),isVisible:({resources:u})=>!xt(e,"files-spaces-generic")&&!_n(e,"files-public-link")&&!Vt(e,"files-common-favorites")||u.length===0||!f(o)||u.length===1&&u[0].locked?!1:!u.some(p=>z2(p,f(o).path)===!1),class:"oc-files-actions-move-trigger"}])}},S0=()=>{const e=He(),{$gettext:t}=Ie.useGettext(),n=ze(),{currentFolder:r}=Me.storeToRefs(n),i=B(()=>_n(e,"files-public-link")?Mi("files-public-link"):yn(e,"files-trash-overview")?Hr("files-trash-generic"):Kn("files-spaces-generic"));return{actions:B(()=>[{name:"navigate",icon:"folder-open",label:()=>t("Navigate"),isVisible:({resources:s})=>s.length!==1||f(r)!==null&&wo(s[0],f(r))||re.isTrashResource(s[0])?!1:s[0].isFolder||s[0].type==="space",route:({space:s,resources:a})=>Co({},f(i),sr(s,{path:a[0].path,fileId:a[0].fileId})),class:"oc-files-actions-navigate-trigger"}])}},E0=()=>{const{$gettext:e}=Ie.useGettext(),{getDefaultAction:t}=Xn();return{actions:B(()=>[{name:"open",icon:"eye",label:()=>e("Open"),handler:r=>{const i=t({...r,omitSystemActions:!0});!i||!Object.hasOwn(i,"handler")||i.handler(r)},route:r=>{const i=t({...r,omitSystemActions:!0});if(!(!i||!Object.hasOwn(i,"route")))return i.route(r)},isVisible:r=>{const i=t({...r,omitSystemActions:!0});return i?i.isVisible(r):!1},class:"oc-files-actions-default-editor-trigger"}])}},W2=()=>{const{showErrorMessage:e}=nt(),t=He(),{$gettext:n}=Ie.useGettext(),r=_r(),i=Za(),o=Ke(),s=u=>{const c=/URL=(.+)/,p=u.match(c);if(p&&p[1])return p[1];throw new Error("unable to extract url")},a=async({resources:u,space:c})=>{try{const p=new URL(window.location.href),d=(await o.webdav.getFileContents(c,u[0])).body;let m=s(d);if(m=m.match(/^http[s]?:\/\//)?m:`https://${m}`,m=Gd.sanitize(m,{USE_PROFILES:{html:!0}}),m.startsWith(p.origin)){window.location.href=m;return}window.open(m)}catch(p){console.error(p),e({title:n("Failed to open shortcut"),errors:[p]})}};return{actions:B(()=>[{name:"open-shortcut",icon:"external-link",category:"context",handler:a,label:()=>n("Open shortcut"),isVisible:({resources:u})=>f(r)&&!f(i)&&!xt(t,"files-spaces-generic")&&!_n(t,"files-public-link")&&!Vt(t,"files-common-favorites")&&!Vt(t,"files-common-search")&&!Mt(t,"files-shares-with-me")&&!Mt(t,"files-shares-with-others")&&!Mt(t,"files-shares-via-link")||u.length!==1||u[0].extension!=="url"?!1:u[0].canDownload(),class:"oc-files-actions-open-short-cut-trigger"}]),extractUrl:s}},H2=_e({name:"AppLoadingSpinner"}),K2={class:"flex items-center justify-center size-full"};function G2(e,t,n,r,i,o){const s=Ee("oc-spinner");return X(),pe("div",K2,[me(s,{id:"app-loading-spinner",size:"large","aria-hidden":!0,"aria-label":""})])}const Id=Ye(H2,[["render",G2]]),Q2=_e({name:"FilePickerModal",components:{AppLoadingSpinner:Id},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=le(),n=le(!0),r=He(),{removeModal:i}=ht(),o=cr(),s=r.resolve(e.parentFolderLink),a=o.currentTheme.name,l=new URL(s.href,window.location.origin);l.searchParams.append("hide-logo","true"),l.searchParams.append("embed","true"),l.searchParams.append("embed-target","file"),l.searchParams.append("embed-delegate-authentication","false"),l.searchParams.append("embed-file-types",e.allowedFileTypes.join(","));const u=()=>{n.value=!1,f(t).contentWindow.focus()},c=({data:d})=>{if(d.name!=="opencloud-embed:file-pick")return;const{resource:m,locationQuery:b}=d.data;e.callbackFn({resource:m,locationQuery:b}),i(e.modal.id)},p=({data:d})=>{d.name==="opencloud-embed:cancel"&&i(e.modal.id)};return Lt(()=>{window.addEventListener("message",c),window.addEventListener("message",p)}),An(()=>{window.removeEventListener("message",c),window.removeEventListener("message",p)}),{isLoading:n,onLoad:u,iframeTitle:a,iframeSrc:l.href,iframeRef:t,onFilePick:c}}}),X2={class:"h-full",tabindex:"0"},Y2=["title","src"];function J2(e,t,n,r,i,o){const s=Ee("app-loading-spinner");return X(),pe("div",X2,[e.isLoading?(X(),Te(s,{key:0})):Re("",!0),ot(fe("iframe",{ref:"iframeRef",class:"size-full",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...a)=>e.onLoad&&e.onLoad(...a))},null,40,Y2),[[uh,!e.isLoading]])])}const T0=Ye(Q2,[["render",J2]]),A0=(e={})=>{const t=He(),{getMatchingSpace:n}=ln(e);return{createFolderLink:i=>{const{path:o,fileId:s,resource:a}=i,l=f(e.space)||n(a);return l?yn(t,"files-trash-overview")?Hr("files-trash-generic",sr(l)):Kn("files-spaces-generic",sr(l,{path:o,fileId:s})):{}}}},Yr=(e={})=>{const t=en(),{$gettext:n}=Ie.useGettext(),{getInternalSpace:r,getMatchingSpace:i,isResourceAccessible:o}=ln(),{createFolderLink:s}=A0(e);return{getPathPrefix:d=>{const m=f(e.space)||i(d);return re.isProjectSpaceResource(m)?Bl.join(n("Spaces"),m.name):re.isShareSpaceResource(m)?Bl.join(n("Shares"),m.name):m.name},getFolderLink:d=>s({path:d.path,fileId:d.fileId,resource:d}),getParentFolderLink:d=>{const m=f(e.space)||i(d),b=o({space:m,path:ft.dirname(d.path)});return d.remoteItemId&&d.path==="/"||!b?Fn("files-shares-with-me"):re.isProjectSpaceResource(d)?Kn("files-spaces-projects"):s({path:ft.dirname(d.path),...d.parentFolderId&&{fileId:d.parentFolderId},resource:d})},getParentFolderName:d=>{const m=f(e.space)||i(d),b=o({space:m,path:ft.dirname(d.path)});if(re.isShareRoot(d)||d.id===m.id&&re.isShareSpaceResource(m)||!b)return n("Shared with me");const S=re.extractParentFolderName(d);if(S)return S;if(re.isShareSpaceResource(m))return m.name;if(t.spacesProjects){if(re.isProjectSpaceResource(d))return n("Spaces");if(m?.driveType==="project")return m.name}return n("Personal")},getParentFolderLinkIconAdditionalAttributes:d=>re.isProjectSpaceResource(d)||re.isProjectSpaceResource(r(d.storageId)||{})&&d.path.split("/").length===2?{name:"layout-grid","fill-type":"fill"}:{}}},x0=({appId:e})=>{const{$gettext:t}=Ie.useGettext(),n=_r(),{dispatchModal:r}=ht(),i=ar(),{apps:o}=Me.storeToRefs(i),s=He(),{getParentFolderLink:a}=Yr(),{getMatchingSpace:l}=ln(),{getEditorRouteOpts:u}=Xn(),c=({resources:m})=>{const b=f(o)[e],w=a(m[0]),S=b.extensions.map(y=>y.extension?y.extension:y.mimeType);r({elementClass:"file-picker-modal",title:t("Open file in %{app}",{app:b.name}),customComponent:T0,hideActions:!0,customComponentAttrs:()=>({allowedFileTypes:S,parentFolderLink:w,callbackFn:d}),focusTrapInitial:!1})},p=B(()=>[{name:"open-with-app",icon:"folder-open",handler:c,label:()=>t("Open"),isVisible:()=>!f(n),class:"oc-files-actions-open-with-app-trigger"}]),d=({resource:m,locationQuery:b})=>{const w=l(m),S=re.isShareSpaceResource(w)?w.id:void 0,y=u(f(s.currentRoute).name,w,m,S);y.query={...y.query,...b};const g=s.resolve(y),v=new URL(g.href,window.location.origin);window.open(v.href,"_blank")};return{actions:p,onFilePicked:d}},R0=()=>{const e=He(),t=Ke(),{getMatchingSpace:n}=ln(),{$gettext:r,$ngettext:i}=Ie.useGettext(),o=Uo(),{startWorker:s}=nw(),a=ze(),{currentFolder:l}=Me.storeToRefs(a),u=B(()=>jo()?r("⌘ + V"):r("Ctrl + V")),c=B(()=>o.action===Mo.Cut?Sr.MOVE:Sr.COPY),p=async({targetSpace:b,sourceSpace:w,resources:S})=>{const y=new Sh(w,S,b,f(l),l,t,r,i),g=await y.getTransferData(f(c));if(!g.length)return;const v=f(l)?.id;s(g,async({successful:h,failed:E})=>{if(y.showResultMessage(E,h,f(c)),!h.length||f(l)&&v!==f(l).id)return;const T=[],R=[];for(const x of h)T.push((async()=>{const A=await t.webdav.getFileInfo(b,x);R.push(A)})());await Promise.allSettled(T),re.isShareSpaceResource(b)&&R.forEach(x=>{x.remoteItemId=b.id}),a.upsertResources(R)})},d=async({space:b})=>{const w=o.resources.reduce((y,g)=>{if(g.storageId in y)return y[g.storageId].resources.push(g),y;const v=n(g);return v.id in y||(y[v.id]={space:v,resources:[]}),y[v.id].resources.push(g),y},{}),S=Object.values(w).map(({space:y,resources:g})=>p({targetSpace:b,sourceSpace:y,resources:g}));await Promise.all(S),o.clearClipboard()};return{actions:B(()=>[{name:"paste",icon:"clipboard",handler:d,label:()=>r("Paste"),shortcut:f(u),isVisible:({resources:b})=>o.resources.length===0||!xt(e,"files-spaces-generic")&&!_n(e,"files-public-link")&&!Vt(e,"files-common-favorites")||b.length===0?!1:_n(e,"files-public-link")&&f(l)?f(l)?.canCreate():!0,class:"oc-files-actions-copy-trigger"}])}},Ya=()=>{const{showErrorMessage:e}=nt(),t=en(),n=He(),{$gettext:r}=Ie.useGettext(),i=Ke(),o=dt(),{dispatchModal:s}=ht(),a=vt(),l=fn(),u=ze(),{setCurrentFolder:c,upsertResource:p}=u,{isFileNameValid:d}=Ei(),m=async(S,y,g)=>{let v=u.currentFolder;try{const h=ft.join(ft.dirname(y.path),g);await i.webdav.moveFiles(S,y,S,{path:h});const E=wo(y,v);if(re.isShareSpaceResource(S)&&y.isReceivedShare()){if(S.rename(g),E)return v={...v},v.name=g,c(v),n.push(sr(S,{path:"",fileId:y.fileId}));const R={...y};R.name=g,p(R);return}if(E)return v={...v},Vl(S,v,h),c(v),n.push(sr(S,{path:h,fileId:y.fileId}));const T={...y};Vl(S,T,h),p(T)}catch(h){console.error(h);let E=r('Failed to rename "%{file}" to »%{newName}«',{file:y.name,newName:g},!0);h.statusCode===423&&(E=r("Failed to rename »%{file}« to »%{newName}« - the file is locked",{file:y.name,newName:g},!0)),e({title:E,errors:[h]})}},b=async({space:S,resources:y})=>{const g=u.currentFolder;let v;if(wo(y[0],g)){const O=ft.dirname(g.path);v=(await i.webdav.listFiles(S,{path:O})).children}const h=u.areFileExtensionsShown,E=async O=>{h||(O=`${O}.${y[0].extension}`),await m(S,y[0],O)},T=(O,D)=>{h||(O=`${O}.${y[0].extension}`);const{isValid:V,error:L}=d(y[0],O,v);D(V?null:L)},R=re.extractNameWithoutExtension(y[0]),x=!y[0].isFolder&&!h?R:y[0].name,A=y[0].isFolder?r("Rename folder »%{name}«",{name:x}):r("Rename file »%{name}«",{name:x}),N=!y[0].isFolder&&!h?R:y[0].name,W=y[0].isFolder||!h?null:[0,R.length];s({title:A,confirmText:r("Rename"),hasInput:!0,inputValue:N,inputSelectionRange:W,inputLabel:y[0].isFolder?r("Folder name"):r("File name"),inputRequiredMark:!0,onConfirm:E,onInput:T})};return{actions:B(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:b,isVisible:({resources:S})=>yn(n,"files-trash-generic")||Mt(n,"files-shares-with-me")&&!t.sharingCanRename||S.length!==1||(o.options.routing.fullShareOwnerPaths?S.some(v=>v.remoteItemPath&&v.path):S.some(v=>v.remoteItemId&&v.path==="/"))||S.length===1&&S[0].locked?!1:!S.some(v=>!v.canRename({user:a.user,ability:l})||v.processing),class:"oc-files-actions-rename-trigger"}]),renameResource:m}},ls=({showSuccessMessage:e=!0,onRestoreComplete:t}={})=>{const{showMessage:n,showErrorMessage:r}=nt(),i=vt(),o=He(),{$gettext:s,$ngettext:a}=Ie.useGettext(),l=Ke(),u=at(),c=ze(),{startWorker:p}=rw(),d=async(y,g)=>{const v={},h=[],E=[],T=[];for(const R of g){const x=ft.dirname(R.path);let A=[];if(x in v)A=v[x];else{try{A=(await l.webdav.listFiles(y,{path:x})).children}catch{T.push(x)}v[x]=A}A.some(W=>W.name===R.name)||E.filter(W=>W.id!==R.id).some(W=>W.path===R.path)?h.push(R):E.push(R)}return{existingResourcesByPath:v,conflicts:h,resolvedResources:E,missingFolderPaths:T.filter(R=>!v[R]?.length)}},m=async y=>{let g=0;const v=[],h=y.length;let E=!1,T;for(const R of y){const x=R.type==="folder";if(E){v.push({resource:R,strategy:T});continue}const A=h-g,W=await new jl(s,a).resolveFileExists({name:R.name,isFolder:x},A,!1);g++,W.doForAllConflicts&&(E=!0,T=W.strategy),v.push({resource:R,strategy:W.strategy})}return v},b=(y,g,v)=>{const h=f(o.currentRoute);p({space:y,resources:g,missingFolderPaths:v},async({successful:E,failed:T})=>{if(E.length){let R;E.length===1?R=s("%{resource} was restored successfully",{resource:E[0].name}):R=s("%{resourceCount} files restored successfully",{resourceCount:E.length.toString()}),e&&n({title:R}),h.name===f(o.currentRoute).name&&h.query?.fileId===f(o.currentRoute).query?.fileId&&(c.removeResources(E),c.resetSelection());const A=await l.graphAuthenticated.drives.getDrive(y.id);u.updateSpaceField({id:A.id,field:"spaceQuota",value:A.spaceQuota}),t?.({space:y,resources:E})}if(T.length){let R;const x={};T.length===1?(x.resource=T[0].resource.name,R=s('Failed to restore "%{resource}"',x,!0)):(x.resourceCount=T.length.toString(),R=s("Failed to restore %{resourceCount} files",x,!0)),r({title:R,errors:T.map(({error:A})=>A)})}})},w=async({space:y,resources:g})=>{const v=g.sort((W,O)=>W.path.length-O.path.length),{existingResourcesByPath:h,conflicts:E,resolvedResources:T,missingFolderPaths:R}=await d(y,v),x=await m(E),A=x.filter(W=>W.strategy===Wn.REPLACE).map(W=>W.resource);T.push(...A);const N=x.filter(W=>W.strategy===Wn.KEEP_BOTH).map(W=>W.resource);for(let W of N){W={...W};const O=ft.dirname(W.path),D=h[O]||[],V=re.extractExtensionFromFile(W),L=zn(W.name,V,[...D,...x.map(te=>te.resource),...T]);W.name=L,W.path=re.urlJoin(O,L),T.push(W)}return b(y,T,R)};return{actions:B(()=>[{name:"restore",icon:"arrow-go-back",label:()=>s("Restore"),handler:w,isVisible:({space:y,resources:g})=>!yn(o,"files-trash-generic")||!g.every(v=>re.isTrashResource(v)&&v.canBeRestored())||re.isProjectSpaceResource(y)&&!y.canRestoreFromTrashbin({user:i.user})?!1:g.length>0,class:"oc-files-actions-restore-trigger"}]),restoreResources:b,collectConflicts:d}},Z2=_e({name:"SaveAsModal",components:{AppLoadingSpinner:Id},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=le(),n=le(!0),r=cr(),{$gettext:i}=Ie.useGettext(),o=He(),s=Ke(),{removeModal:a}=ht(),{showMessage:l,showErrorMessage:u}=nt(),{getMatchingSpace:c}=ln(),{getEditorRouteOpts:p}=Xn(),d=o.resolve(e.parentFolderLink),m=r.currentTheme.name,b=new URL(d.href,window.location.origin);b.searchParams.append("hide-logo","true"),b.searchParams.append("embed","true"),b.searchParams.append("embed-target","location"),b.searchParams.append("embed-choose-file-name","true"),b.searchParams.append("embed-delegate-authentication","false"),b.searchParams.append("embed-choose-file-name-suggestion",e.originalResource.name);const w=()=>{n.value=!1,f(t).contentWindow.focus()},S=async({data:h})=>{if(h.name!=="opencloud-embed:select")return;const{resources:E,fileName:T,locationQuery:R}=h.data,x=E[0],A=c(x);try{const N=await y({destinationFolder:x,fileName:T,space:A});l({title:i("»%{fileName}« was saved successfully",{fileName:N.name})}),g({resource:N,space:A,locationQuery:R})}catch(N){console.error(N),u({title:i("Unable to save »%{fileName}«",{fileName:T}),errors:[N]}),console.error(N)}a(e.modal.id)},y=async({destinationFolder:h,fileName:E,space:T})=>{const{children:R}=await s.webdav.listFiles(T,{fileId:h.fileId},{davProperties:[Ve.Name]});return R.find(A=>A.name===E)&&(E=zn(E,e.originalResource.extension,R)),s.webdav.putFileContents(T,{fileName:E,parentFolderId:h.id,content:e.content,path:re.urlJoin(h.path,E)})},g=({locationQuery:h,resource:E,space:T})=>{const R=re.isShareSpaceResource(T)?T.id:void 0,x=p(f(o.currentRoute).name,T,E,R);x.query={...x.query,...h};const A=o.resolve(x),N=new URL(A.href,window.location.origin);window.open(N.href,"_blank")},v=({data:h})=>{h.name==="opencloud-embed:cancel"&&a(e.modal.id)};return Lt(()=>{window.addEventListener("message",S),window.addEventListener("message",v)}),An(()=>{window.removeEventListener("message",S),window.removeEventListener("message",v)}),{isLoading:n,onLoad:w,iframeTitle:m,iframeSrc:b.href,iframeRef:t,onLocationPick:S}}}),eL={class:"h-full",tabindex:"0"},tL=["title","src"];function nL(e,t,n,r,i,o){const s=Ee("app-loading-spinner");return X(),pe("div",eL,[e.isLoading?(X(),Te(s,{key:0})):Re("",!0),ot(fe("iframe",{ref:"iframeRef",class:"size-full",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...a)=>e.onLoad&&e.onLoad(...a))},null,40,tL),[[uh,!e.isLoading]])])}const C0=Ye(Z2,[["render",nL]]),k0=({content:e})=>{const{$gettext:t}=Ie.useGettext(),n=_r(),{dispatchModal:r}=ht(),{getParentFolderLink:i}=Yr(),o=({resources:a})=>{const l=i(a[0]);r({elementClass:"save-as-modal",title:t("Save as"),customComponent:C0,hideActions:!0,customComponentAttrs:()=>({content:f(e),parentFolderLink:l,originalResource:a[0]}),focusTrapInitial:!1})};return{actions:B(()=>[{name:"save-as",icon:"save-2",handler:o,label:()=>t("Save as"),isVisible:({resources:a})=>!f(n)||a.length!==1,class:"oc-files-actions-save-as-trigger"}])}},rL={class:z.normalizeClass(["[&_.cropper-crop-box]:!outline-1","[&_.cropper-crop-box]:!outline-role-outline","[&_.cropper-line]:!bg-role-outline","[&_.cropper-point]:!bg-role-outline"])},iL={key:0,class:"max-h-[400px]"},oL=["src"],sL={class:"text-sm text-role-on-surface-variant flex items-center mt-1"},aL=["textContent"],P0=_e({__name:"SpaceImageModal",props:{modal:{},space:{},file:{}},setup(e,{expose:t}){const{showMessage:n,showErrorMessage:r}=nt(),{$gettext:i}=Ie.useGettext(),o=Ke(),s=at(),{createDefaultMetaFolder:a}=Qi(),{getDefaultMetaFolder:l}=Ca(),{setCropperInstance:u}=td(),c=le(null),p=Tn("imageRef"),d=le(null);t({onConfirm:async()=>{const S=f(c)?.getCroppedCanvas({imageSmoothingQuality:"high"}),y=await b(S);await w(y)}});const b=async S=>(await new Promise(g=>S.toBlob(g,"image/png"))).arrayBuffer(),w=async S=>{const y=o.graphAuthenticated;s.addToImagesLoading(e.space.id);let g=await l(e.space);g||(g=await a(e.space));const v={"Content-Type":"application/offset+octet-stream"};try{const{fileId:h,processing:E}=await o.webdav.putFileContents(e.space,{parentFolderId:g.id,fileName:"image.png",content:S,headers:v,overwrite:!0}),T=await y.drives.updateDrive(e.space.id,{name:e.space.name,special:[{specialFolder:{name:"image"},id:h}]});E||s.removeFromImagesLoading(e.space.id),s.updateSpaceField({id:e.space.id,field:"spaceImageData",value:T.spaceImageData}),n({title:i("Space image was set successfully")}),Je.publish("app.files.spaces.uploaded-image",T)}catch(h){if(console.error(h),s.removeFromImagesLoading(e.space.id),h instanceof re.HttpError&&h.statusCode===507){r({title:i("Failed to set space image"),desc:i("Not enough quota to set the space image"),errors:[h]});return}r({title:i("Failed to set space image"),errors:[h]})}};return Lt(async()=>{try{d.value=URL.createObjectURL(e.file),f(c)&&f(c)?.destroy(),await zt(),c.value=new il(f(p),{aspectRatio:16/9,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1}),u(c)}catch(S){r({title:i("Failed to load space image"),errors:[S]})}}),(S,y)=>{const g=Ee("oc-icon");return X(),pe("div",rL,[d.value?(X(),pe("div",iL,[fe("img",{ref_key:"imageRef",ref:p,src:d.value},null,8,oL),fe("div",sL,[me(g,{class:"mr-1",name:"information",size:"small","fill-type":"line"}),fe("span",{textContent:z.toDisplayString(f(i)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:f(i)("+-"),panKeys:f(i)("↑↓←→")}))},null,8,aL)])])):Re("",!0)])}}}),I0=()=>{const e=vt(),t=He(),{$gettext:n}=Ie.useGettext(),r=Ke(),i=gn(),{dispatchModal:o}=ht(),s=async({space:l,resources:u})=>{const{getFileContents:c}=r.webdav,p=await c(l,u[0],{responseType:"blob"}),d=new File([p.body],u[0].name);o({title:n("Crop your Space image"),confirmText:n("Confirm"),customComponent:P0,customComponentAttrs:()=>({file:d,space:l})})};return{actions:B(()=>[{name:"set-space-image",icon:"image-edit",handler:l=>i.addTask(()=>s(l)),label:()=>n("Set as space image"),isVisible:({space:l,resources:u})=>u.length!==1||!u[0].hasPreview?.()||!u[0].mimeType?.includes("image/")||!xt(t,"files-spaces-generic")||!l||!re.isProjectSpaceResource(l)?!1:l.canEditImage({user:e.user}),class:"oc-files-actions-set-space-image-trigger"}])}},lL=()=>{const e=He(),{$gettext:t}=Ie.useGettext(),n=_r(),r=()=>{const o=yn(e,"files-trash-generic")?null:"actions";Je.publish(Rt.openWithPanel,o)};return{actions:B(()=>[{name:"show-actions",icon:"slideshow-3",label:()=>t("All Actions"),handler:r,isVisible:({resources:o})=>f(n)?o.length===1:!1,class:"oc-files-actions-show-actions-trigger"}])}},Od=()=>{const e=He(),t=ze(),{$gettext:n}=Ie.useGettext();return{actions:B(()=>[{name:"show-details",icon:"information",class:"oc-files-actions-show-details-trigger",label:()=>n("Details"),isVisible:({resources:i})=>yn(e,"files-trash-generic")?!1:i.length>0,handler({resources:i}){t.setSelection(i.map(({id:o})=>o)),Je.publish(Rt.open)}}])}},O0=()=>{const e=en(),{isPersonalSpaceRoot:t}=ln();return{canListShares:({space:r,resource:i})=>!e.sharingApiEnabled||re.isPublicSpaceResource(r)||t(i)||re.isTrashResource(i)?!1:re.isIncomingShareResource(i)?i.sharePermissions.includes(re.GraphSharePermission.readPermissions):re.isShareSpaceResource(r)?r.graphPermissions?.includes(re.GraphSharePermission.readPermissions):!0}},F0=()=>{const e=en(),t=fn(),n=vt();return{canShare:({space:i,resource:o})=>!e.sharingApiEnabled||re.isShareSpaceResource(i)||re.isProjectSpaceResource(i)&&!i.canShare({user:n.user})?!1:o.canShare({ability:t,user:n.user})}},Fd=()=>{const e=He(),{$gettext:t}=Ie.useGettext(),{canShare:n}=F0();ze();const{interceptModifierClick:r}=gi(),i=({resources:s,event:a})=>{const l=s[0];a&&r(a,l)||Je.publish(Rt.openWithPanel,"sharing#peopleShares")};return{actions:B(()=>[{name:"show-shares",icon:"user-add",label:()=>t("Share"),handler:i,isVisible:({space:s,resources:a})=>yn(e,"files-trash-generic")||a.length!==1?!1:n({space:s,resource:a[0]}),class:"oc-files-actions-show-shares-trigger"}])}},Ja=()=>{const{showMessage:e,showErrorMessage:t}=nt(),n=He(),{$gettext:r}=Ie.useGettext(),i=Ke(),o=gn(),s=dt(),{updateResourceField:a,resetSelection:l}=ze(),u=async({resources:p})=>{const d=[],m=[],b=new Lr({concurrency:s.options.concurrentRequests.resourceBatchActions}),w=!p[0].hidden;if(p.forEach(S=>{m.push(b.add(async()=>{try{await i.graphAuthenticated.driveItems.updateDriveItem(S.driveId,S.id,{"@UI.Hidden":w}),a({id:S.id,field:"hidden",value:w})}catch(y){console.error(y),d.push(y)}}))}),await Promise.all(m),d.length===0){l(),e({title:r(w?"The share was hidden successfully":"The share was unhidden successfully")});return}t({title:r(w?"Failed to hide the share":"Failed to unhide the share"),errors:d})};return{actions:B(()=>[{name:"toggle-hide-share",icon:"eye-off",handler:p=>o.addTask(()=>u(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"}])}},_0=()=>{const{$gettext:e}=Ie.useGettext(),{showErrorMessage:t}=nt(),{webdav:n}=Ke(),r=en(),i=ze(),{currentFolder:o}=Me.storeToRefs(i),{actions:s}=ls({showSuccessMessage:!1,onRestoreComplete:async({space:p,resources:d})=>{if(Ah({resourcesStore:i,parentFolderId:d[0].parentFolderId})){const{children:m}=await n.listFiles(p,{path:f(o).path});i.upsertResources(m.filter(({id:b})=>d.some(w=>w.id===a(b))))}}}),a=p=>p.includes("!")?p.split("!")[1]:p,l=async({space:p,resources:d,callback:m})=>{const b=d.map(w=>({...w,id:a(w.id)}));try{await f(s)[0].handler({space:p,resources:b}),m()}catch(w){console.error(w),t({title:e("Failed to restore files"),errors:[w]})}},u=B(()=>jo()?e("⌘ + Z"):e("Ctrl + Z"));return{actions:B(()=>[{name:"undoDelete",icon:"arrow-go-back",shortcut:f(u),isVisible:({space:p})=>r.davTrashbin?re.isProjectSpaceResource(p)||re.isPersonalSpaceResource(p):!1,label:()=>e("Undo"),handler:l}])}},D0=()=>{const e=dt(),{showMessage:t,showErrorMessage:n,removeMessage:r}=nt(),i=He(),o=Ie.useGettext(),{getMatchingSpace:s}=ln(),{$gettext:a,$ngettext:l}=o,u=Ke(),{dispatchModal:c}=ht(),p=at(),d=ur(),{bindKeyAction:m,removeKeyAction:b}=Oa(),{startWorker:w}=tw({concurrentRequests:e.options.concurrentRequests.resourceBatchActions}),{actions:S}=_0(),y=ze(),{currentFolder:g}=Me.storeToRefs(y),v=le([]),h=tn("page","1"),E=B(()=>parseInt(Ct(f(h)))),T=tn("items-per-page","1"),R=B(()=>parseInt(Ct(f(T)))),x=B(()=>gh(f(v))),A=({space:L,filesToDelete:te,deletedFiles:Y})=>{const se=Y.length===1&&te.length===1?a('"%{item}" was moved to trash bin',{item:Y[0].name}):l("%{itemCount} item was moved to trash bin","%{itemCount} items were moved to trash bin",Y.length,{itemCount:Y.length.toString()},!0),he=7,ae=f(S)[0],we=ae.isVisible({space:L,resources:Y});let Q;const ie=t({title:se,timeout:he,actions:[ae],actionOptions:{space:L,resources:Y,callback:()=>{r(ie),Q&&b(Q)}}});we&&(Q=m({primary:fr.Z,modifier:Ia.Ctrl},()=>(b(Q),ae.handler({space:L,resources:Y,callback:()=>{r(ie)}}))),setTimeout(()=>b(Q),he*1e3))},N=B(()=>{const L=f(x),te=L[0].type==="folder";let Y=null;return L.length===1?(te?Y=a("Permanently delete folder »%{name}«",{name:L[0].name},!0):Y=a("Permanently delete file »%{name}«",{name:L[0].name},!0),Y):l("Permanently delete selected resource?","Permanently delete %{amount} selected resources?",L.length,{amount:L.length.toString()},!1)}),W=B(()=>{const L=f(x),te=L[0].type==="folder";return L.length===1?a(te?"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."):a("Are you sure you want to delete all selected resources? All their content will be permanently removed. This action cannot be undone.")}),O=L=>{const te=f(i.currentRoute);w({topic:"trashBinDelete",space:L,resources:f(x)},({successful:Y,failed:se})=>{if(Y.length){const he=Y.length===1&&f(x).length===1?a('"%{item}" was deleted successfully',{item:Y[0].name}):l("%{itemCount} item was deleted successfully","%{itemCount} items were deleted successfully",Y.length,{itemCount:Y.length.toString()},!0);t({title:he})}se.forEach(({resource:he})=>{const ae=a('Failed to delete "%{item}"',{item:he.name});n({title:ae,errors:[new Error]})}),te.name===f(i.currentRoute).name&&te.query?.fileId===f(i.currentRoute).query?.fileId&&(y.removeResources(Y),y.resetSelection())})};return{displayDialog:(L,te)=>{v.value=[...te],c({title:f(N),message:f(W),confirmText:a("Delete"),onConfirm:()=>O(L)})},filesList_delete:L=>{v.value=[...L],y.addResourcesIntoDeleteQueue(f(v).map(({id:se})=>se)),f(v).forEach(({id:se})=>y.removeSelection(se));const te=f(L).reduce((se,he)=>{if(he.storageId in se)return se[he.storageId].resources.push(he),se;const ae=s(he);return ae.id in se||(se[ae.id]={space:ae,resources:[]}),se[ae.id].resources.push(he),se},{}),Y=f(g)?.id;return Object.values(te).map(({space:se,resources:he})=>{w({topic:"fileListDelete",space:se,resources:he},async({successful:ae,failed:we})=>{if(ae.length&&(A({space:se,filesToDelete:he,deletedFiles:ae}),d.publish("runtime.resource.deleted",ae)),y.removeResourcesFromDeleteQueue(we.map(({resource:Q})=>Q.id)),y.removeResourcesFromDeleteQueue(ae.map(({id:Q})=>Q)),we.forEach(({error:Q,resource:ie})=>{let ce=a('Failed to delete "%{resource}"',{resource:ie.name});Q.statusCode===423&&(ce=a('Failed to delete "%{resource}" - the file is locked',{resource:ie.name})),n({title:ce,errors:[Q]})}),Y===f(g)?.id){y.removeResources(ae);const Q=y.activeResources.length,ie=Math.ceil(f(Q)/f(R));f(E)>1&&f(E)>ie&&(h.value=ie.toString())}if(xt(i,"files-spaces-generic")&&!["public","share"].includes(se?.driveType)){const ie=await u.graphAuthenticated.drives.getDrive(f(L)[0].storageId);p.updateSpaceField({id:ie.id,field:"spaceQuota",value:ie.spaceQuota})}if(f(v).length&&wo(f(v)[0],f(g)))return i.push(sr(se,{path:ft.dirname(f(v)[0].path),fileId:f(v)[0].parentFolderId}))})})}}},cL=()=>{const e=Ht();return B(()=>f(e)?.query?.contextRouteName)},uL=e=>e==="files",_r=()=>{const e=Ht();return B(()=>uL(lc(f(e))))},Ei=()=>{const{$gettext:e}=Ie.useGettext(),t=ze();return{isSpaceNameValid:i=>i.trim()===""?{isValid:!1,error:e("The Space name cannot be empty")}:Kf(i)>Rd?{isValid:!1,error:e("The Space name is too long")}:i.trim()!==i?{isValid:!1,error:e("The Space name cannot start or end with whitespace")}:/[/\\.:?*"><|]/.test(i)?{isValid:!1,error:e(`The Space name cannot contain the following characters: / \\\\ . : ? * " > < |'`)}:{isValid:!0,error:void 0},isFileNameValid:(i,o,s=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(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(Kf(o)>Rd)return{isValid:!1,error:e("The name is too long")};const a=i.path.substring(0,i.path.length-i.name.length)+o;if((s||t.resources).some(u=>u.path===a&&u.name===o)){const u=e("The name »%{name}« is already taken");return{isValid:!1,error:e(u,{name:o},!0)}}return{isValid:!0,error:void 0}}}},Za=()=>B(()=>!!document.getElementById("files-global-search-options")),N0=()=>{const{showMessage:e,showErrorMessage:t}=nt(),n=vt(),{$gettext:r,$ngettext:i}=Ie.useGettext(),o=fn(),s=Ke(),a=Ht(),{dispatchModal:l}=ht(),u=at(),{removeResources:c}=ze(),p=w=>w.filter(S=>re.isProjectSpaceResource(S)&&S.canBeDeleted({user:n.user,ability:o})),d=async w=>{const S=s.graphAuthenticated,y=w.map(E=>S.drives.deleteDrive(E.id).then(()=>(c([E]),u.removeSpace(E),!0))),g=await Promise.allSettled(y),v=g.filter(pi);if(v.length){const E=v.length===1&&w.length===1?r("Space »%{space}« was deleted successfully",{space:w[0].name}):i("%{spaceCount} space was deleted successfully","%{spaceCount} spaces were deleted successfully",v.length,{spaceCount:v.length.toString()},!0);e({title:E})}const h=g.filter(hi);if(h.length){h.forEach(console.error);const E=h.length===1&&w.length===1?r("Failed to delete space »%{space}«",{space:w[0].name}):i("Failed to delete %{spaceCount} space","Failed to delete %{spaceCount} spaces",h.length,{spaceCount:h.length.toString()},!0);t({title:E,errors:h.map(T=>T.reason)})}f(a).name==="admin-settings-spaces"&&Je.publish("app.admin-settings.list.load")},m=({resources:w})=>{const S=p(w);if(!S.length)return;const y=i("Are you sure you want to delete the selected space?","Are you sure you want to delete %{count} selected spaces?",S.length,{count:S.length.toString()});l({title:i("Delete Space »%{space}«?","Delete %{spaceCount} Spaces?",S.length,{space:S[0].name,spaceCount:S.length.toString()}),confirmText:r("Delete"),message:y,hasInput:!1,onConfirm:()=>d(S)})};return{actions:B(()=>[{name:"delete",icon:"delete-bin",label:()=>r("Delete"),handler:m,isVisible:({resources:w})=>!!p(w).length,class:"oc-files-actions-delete-trigger"}]),deleteSpaces:d}},L0=()=>{const{showMessage:e,showErrorMessage:t}=nt(),n=vt(),{$gettext:r,$ngettext:i}=Ie.useGettext(),o=fn(),s=Ke(),a=Ht(),l=He(),{dispatchModal:u}=ht(),c=at(),p=w=>w.filter(S=>re.isProjectSpaceResource(S)&&S.canDisable({user:n.user,ability:o})),d=async w=>{const S=f(a),y=s.graphAuthenticated,g=w.map(T=>y.drives.disableDrive(T.id).then(()=>(S.name==="files-spaces-generic"&&l.push({name:"files-spaces-projects"}),S.name==="admin-settings-spaces"&&(T.disabled=!0,T.spaceQuota={total:T.spaceQuota.total}),c.updateSpaceField({id:T.id,field:"disabled",value:!0}),!0))),v=await Promise.allSettled(g),h=v.filter(pi);if(h.length){const T=h.length===1&&w.length===1?r("Space »%{space}« was disabled successfully",{space:w[0].name}):i("%{spaceCount} space was disabled successfully","%{spaceCount} spaces were disabled successfully",h.length,{spaceCount:h.length.toString()},!0);e({title:T})}const E=v.filter(hi);if(E.length){E.forEach(console.error);const T=E.length===1&&w.length===1?r("Failed to disable space »%{space}«",{space:w[0].name}):i("Failed to disable %{spaceCount} space","Failed to disable %{spaceCount} spaces",E.length,{spaceCount:E.length.toString()},!0);t({title:T,errors:E.map(R=>R.reason)})}},m=({resources:w})=>{const S=p(w);if(!S.length)return;const y=i("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.",S.length,{count:S.length.toString()}),g=r("Disable");u({title:i("Disable Space »%{space}«?","Disable %{spaceCount} Spaces?",S.length,{space:S[0].name,spaceCount:S.length.toString()}),confirmText:g,message:y,hasInput:!1,onConfirm:()=>d(S)})};return{actions:B(()=>[{name:"disable",icon:"stop-circle",label:()=>r("Disable"),handler:m,isVisible:({resources:w})=>!!p(w).length,class:"oc-files-actions-disable-trigger"}]),disableSpaces:d}},$0=()=>{const e=dt(),t=at(),n=Cr(),{showMessage:r,showErrorMessage:i}=nt(),o=He(),{$gettext:s}=Ie.useGettext(),a=fn(),l=Ke(),u=gn(),{upsertResource:c}=ze(),p=xt(o,"files-spaces-projects"),d=async w=>{const S=t.spaces.filter(re.isProjectSpaceResource),y=zn(w.name,"",S);try{let g=await l.graphAuthenticated.drives.createDrive({name:y,description:w.description,quota:{total:w.spaceQuota.total}});const v=await l.webdav.listFiles(w);if(v.children.length){const h=new Lr({concurrency:e.options.concurrentRequests.resourceBatchActions}),E=[];for(const T of v.children)E.push(h.add(()=>l.webdav.copyFiles(w,T,g,{path:T.name})));await Promise.all(E)}if(w.spaceReadmeData||w.spaceImageData){const h={special:[]};if(w.spaceReadmeData){const E=await l.webdav.getFileInfo(g,{path:`.space/${w.spaceReadmeData.name}`});h.special.push({specialFolder:{name:"readme"},id:E.id})}if(w.spaceImageData){const E=await l.webdav.getFileInfo(g,{path:`.space/${w.spaceImageData.name}`});h.special.push({specialFolder:{name:"image"},id:E.id})}g=await l.graphAuthenticated.drives.updateDrive(g.id,h,n.graphRoles)}t.upsertSpace(g),p&&c(g),r({title:s("Space »%{space}« was duplicated successfully",{space:w.name})})}catch(g){console.error(g),i({title:s("Failed to duplicate space »%{space}«",{space:w.name}),errors:[g]})}},m=async({resources:w})=>{for(const S of w)S.disabled||!re.isProjectSpaceResource(S)||await d(S)};return{actions:B(()=>[{name:"duplicate",icon:"folders",label:()=>s("Duplicate"),handler:w=>u.addTask(()=>m(w)),isVisible:({resources:w})=>!w?.length||w.every(S=>S.disabled)||w.every(S=>!re.isProjectSpaceResource(S))?!1:a.can("create-all","Drive"),class:"oc-files-actions-duplicate-trigger"}]),duplicateSpace:d}},fL=()=>{const{showMessage:e,showErrorMessage:t}=nt(),n=vt(),{$gettext:r}=Ie.useGettext(),i=fn(),o=Ke(),s=Ht(),{dispatchModal:a}=ht(),l=at(),u=(d,m)=>o.graphAuthenticated.drives.updateDrive(d.id,{name:d.name,description:m}).then(()=>{l.updateSpaceField({id:d.id,field:"description",value:m}),f(s).name==="admin-settings-spaces"&&(d.description=m),e({title:r("Space subtitle was changed successfully")})}).catch(w=>{console.error(w),t({title:r("Failed to change space subtitle"),errors:[w]})}),c=({resources:d})=>{d.length===1&&a({title:r("Change subtitle for space")+" "+d[0].name,confirmText:r("Confirm"),hasInput:!0,inputLabel:r("Space subtitle"),inputValue:d[0].description,onConfirm:m=>u(d[0],m)})};return{actions:B(()=>[{name:"editDescription",icon:"h-2",iconFillType:"none",label:()=>r("Edit subtitle"),handler:c,isVisible:({resources:d})=>d.length!==1?!1:d[0].canEditDescription({user:n.user,ability:i}),class:"oc-files-actions-edit-description-trigger"}]),editDescriptionSpace:u}},dL={name:"QuotaSelect",props:{totalQuota:{type:Number,default:0},maxQuota:{type:Number,default:0}},emits:["selectedOptionChange"],setup(){return{selectedOption:le(void 0),options:le([])}},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 Tt.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=vn(e,this.$language.current);return this.isValueValidNumber(e)?t:e.toString()}}},pL={class:"quota-select-batch-action-form"},hL=["textContent"],mL={class:"flex justify-between"},gL=["textContent"],yL={key:0,class:"oc-text-input-danger"};function vL(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-select");return X(),pe("div",pL,[me(a,$t({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":ve(({displayValue:l})=>[e.$attrs["read-only"]?(X(),Te(s,{key:0,name:"lock",class:"mr-1",size:"small"})):Re("",!0),fe("span",{textContent:z.toDisplayString(l)},null,8,hL)]),search:ve(({attributes:l,events:u})=>[fe("input",$t({class:"vs__search"},l,Os(u,!0)),null,16)]),option:ve(({displayValue:l,error:u})=>[fe("div",mL,[fe("span",{textContent:z.toDisplayString(l)},null,8,gL)]),u?(X(),pe("div",yL,z.toDisplayString(u),1)):Re("",!0)]),_:1},16,["model-value","selectable","options","create-option","label","onUpdate:modelValue"])])}const M0=Ye(dL,[["render",vL]]),bL={key:0,class:"mt-2"},wL=["textContent"],B0=_e({__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:i,showErrorMessage:o}=nt(),{$gettext:s,$ngettext:a}=Ie.useGettext(),l=Ke(),u=He(),c=at(),p=en(),{spacesMaxQuota:d}=Me.storeToRefs(p),{updateResourceField:m}=ze(),b=le(e.spaces[0]?.spaceQuota?.total||0),w=h=>e.resourceType==="space"?a("Space quota was changed successfully","Quota of %{count} spaces was changed successfully",h,{count:h.toString()}):e.resourceType==="user"?a("User quota was changed successfully","Quota of %{count} users was changed successfully",h,{count:h.toString()}):s("Quota was changed successfully"),S=h=>e.resourceType==="space"?a("Failed to change space quota","Failed to change quota for %{count} spaces",h,{count:h.toString()}):e.resourceType==="user"?a("Failed to change user quota","Failed to change quota for %{count} users",h,{count:h.toString()}):s("Failed to change quota"),y=B(()=>!e.spaces.some(h=>h.spaceQuota.total!==f(b)));st(y,()=>{r("update:confirmDisabled",f(y))},{immediate:!0});const g=h=>{b.value=h.value};return t({onConfirm:async()=>{const h=l.graphAuthenticated,E=e.spaces.map(async A=>{const N=await h.drives.updateDrive(A.id,{name:A.name,quota:{total:f(b)}});f(u.currentRoute).name==="admin-settings-spaces"&&Je.publish("app.admin-settings.spaces.space.quota.updated",{spaceId:A.id,quota:N.spaceQuota}),f(u.currentRoute).name==="admin-settings-users"&&Je.publish("app.admin-settings.users.user.quota.updated",{spaceId:A.id,quota:N.spaceQuota}),c.updateSpaceField({id:A.id,field:"spaceQuota",value:N.spaceQuota}),m({id:A.id,field:"spaceQuota",value:N.spaceQuota})}),T=await Promise.allSettled(E),R=T.filter(pi);R.length&&i({title:w(R.length)});const x=T.filter(hi);x.length&&(console.error(x),x.forEach(console.error),o({title:S(x.length),errors:x.map(A=>A.reason)}))}}),(h,E)=>{const T=Ee("oc-contextual-helper");return X(),pe(Be,null,[me(M0,{"total-quota":b.value,"max-quota":f(d),"position-fixed":!0,onSelectedOptionChange:g},null,8,["total-quota","max-quota"]),e.warningMessage?(X(),pe("div",bL,[fe("span",{class:"oc-text-input-warning",textContent:z.toDisplayString(e.warningMessage)},null,8,wL),e.warningMessageContextualHelperData?(X(),Te(T,$t({key:0,class:"pl-1"},e.warningMessageContextualHelperData),null,16)):Re("",!0)])):Re("",!0)],64)}}}),j0=()=>{const{dispatchModal:e}=ht(),{$gettext:t}=Ie.useGettext(),n=fn(),r=({resources:s})=>s.length===1?t("Change quota for Space »%{name}«",{name:s[0].name}):t("Change quota for %{count} Spaces",{count:s.length.toString()}),i=({resources:s})=>{e({title:r({resources:s}),customComponent:B0,customComponentAttrs:()=>({spaces:s,resourceType:"space"})})};return{actions:B(()=>[{name:"editQuota",icon:"cloud",label:()=>t("Edit quota"),handler:i,isVisible:({resources:s})=>!s||!s.length||s.some(a=>!re.isProjectSpaceResource(a)||re.isSpaceResource(a)&&!a.spaceQuota)?!1:n.can("set-quota-all","Drive"),class:"oc-files-actions-edit-quota-trigger"}])}};function U0(){const{triggerDefaultAction:e}=Xn();return{openWithDefaultApp:({space:n,resource:r})=>{if(!r||r.isFolder)return;e({...{resources:[r],space:n},omitSystemActions:!0})}}}const SL=()=>{const e=Ke(),{openWithDefaultApp:t}=U0(),{createDefaultMetaFolder:n}=Qi(),r=vt(),i=at(),{$gettext:o}=Ie.useGettext(),{getDefaultMetaFolder:s}=Ca(),a=async(c,p)=>{const d=await e.webdav.putFileContents(c,{path:".space/readme.md",parentFolderId:p.id,fileName:"readme.md"}),m=await e.graphAuthenticated.drives.updateDrive(c.id,{name:c.name,special:[{specialFolder:{name:"readme"},id:d.id}]});return i.updateSpaceField({id:c.id,field:"spaceReadmeData",value:m.spaceReadmeData}),d},l=async({resources:c})=>{let p=null,d=await s(c[0]);if(d||(d=await n(c[0]),p=await a(c[0],d)),!p){const m=re.getRelativeSpecialFolderSpacePath(c[0],"readme");m?p=await e.webdav.getFileInfo(c[0],{path:m}):p=await a(c[0],d)}t({space:c[0],resource:p})};return{actions:B(()=>[{name:"editReadmeContent",icon:"article",label:()=>o("Edit description"),handler:l,isVisible:({resources:c})=>c.length!==1?!1:c[0].canEditReadme({user:r.user}),class:"oc-files-actions-edit-readme-content-trigger"}])}},V0=()=>{const{showMessage:e,showErrorMessage:t}=nt(),n=vt(),{$gettext:r}=Ie.useGettext(),i=fn(),o=Ke(),s=Ht(),{isSpaceNameValid:a}=Ei(),{dispatchModal:l}=ht(),u=at(),c=(m,b)=>o.graphAuthenticated.drives.updateDrive(m.id,{name:b}).then(()=>{f(s).name==="admin-settings-spaces"&&(m.name=b),u.updateSpaceField({id:m.id,field:"name",value:b}),e({title:r("Space name was changed successfully")})}).catch(S=>{console.error(S),t({title:r("Failed to rename space"),errors:[S]})}),p=({resources:m})=>{m.length===1&&l({title:r("Rename space »%{name}«",{name:m[0].name}),confirmText:r("Rename"),hasInput:!0,inputLabel:r("Space name"),inputValue:m[0].name,inputRequiredMark:!0,onConfirm:b=>c(m[0],b),onInput:(b,w)=>{const{isValid:S,error:y}=a(b);w(S?null:y)}})};return{actions:B(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:p,isVisible:({resources:m})=>m.length!==1?!1:m[0].canRename({user:n.user,ability:i}),class:"oc-files-actions-rename-trigger"}]),renameSpace:c}},q0=()=>{const{showMessage:e,showErrorMessage:t}=nt(),n=vt(),{$gettext:r,$ngettext:i}=Ie.useGettext(),o=fn(),s=Ke(),a=gn(),l=Ht(),{dispatchModal:u}=ht(),c=at(),p=w=>w.filter(S=>re.isProjectSpaceResource(S)&&S.canRestore({user:n.user,ability:o})),d=async w=>{const S=s.graphAuthenticated,y=w.map(E=>S.drives.updateDrive(E.id,{name:E.name},{headers:{Restore:"true"}}).then(T=>(f(l).name==="admin-settings-spaces"&&(E.disabled=!1,E.spaceQuota=T.spaceQuota),c.updateSpaceField({id:E.id,field:"disabled",value:!1}),!0))),g=await a.addTask(()=>Promise.allSettled(y));await c.loadGraphPermissions({ids:w.map(E=>E.id),graphClient:S});const v=g.filter(pi);if(v.length){const E=v.length===1&&w.length===1?r("Space »%{space}« was enabled successfully",{space:w[0].name}):i("%{spaceCount} space was enabled successfully","%{spaceCount} spaces were enabled successfully",v.length,{spaceCount:v.length.toString()},!0);e({title:E})}const h=g.filter(hi);if(h.length){h.forEach(console.error);const E=h.length===1&&w.length===1?r("Failed to enable space »%{space}«",{space:w[0].name}):i("Failed to enable %{spaceCount} space","Failed to enable %{spaceCount} spaces",h.length,{spaceCount:h.length.toString()},!0);t({title:E,errors:h.map(T=>T.reason)})}},m=({resources:w})=>{const S=p(w);if(!S.length)return;const y=i("If you enable the selected space, it can be accessed again.","If you enable the %{count} selected spaces, they can be accessed again.",S.length,{count:S.length.toString()}),g=r("Enable");u({title:i("Enable Space »%{space}«?","Enable %{spaceCount} Spaces?",S.length,{space:S[0].name,spaceCount:S.length.toString()}),confirmText:g,message:y,hasInput:!1,onConfirm:()=>d(S)})};return{actions:B(()=>[{name:"restore",icon:"play-circle",label:()=>r("Enable"),handler:m,isVisible:({resources:w})=>!!p(w).length,class:"oc-files-actions-restore-trigger"}]),restoreSpaces:d}},EL=()=>{const{$gettext:e}=Ie.useGettext(),t=ze(),n=({resources:i})=>{t.setSelection(i.map(({id:o})=>o)),Je.publish(Rt.openWithPanel,"space-share")};return{actions:B(()=>[{name:"show-members",icon:"group",label:()=>e("Members"),handler:n,isVisible:({resources:i})=>i.length===1&&!i[0].disabled,class:"oc-files-actions-show-details-trigger"}])}},TL=()=>{const e=He(),{$gettext:t}=Ie.useGettext(),n=i=>Hr("files-trash-generic",{...sr(i,{fileId:i.fileId})});return{actions:B(()=>[{name:"navigateToTrash",icon:"delete-bin-5",label:()=>t("Open trash bin"),handler:({resources:i})=>{e.push(n(i[0]))},isVisible:({resources:i})=>!(i.length!==1||!re.isProjectSpaceResource(i[0])&&!re.isPersonalSpaceResource(i[0])||i[0].disabled),class:"oc-files-actions-navigate-to-trash-trigger"}])}},AL=_e({name:"EmojiPickerModal",components:{},props:{modal:{type:Object,required:!0}},emits:["confirm"],setup(e,{emit:t}){const n=cr(),{currentTheme:r}=Me.storeToRefs(n),i=B(()=>f(r).isDark?"dark":"light");return{onEmojiSelect:s=>{t("confirm",s)},theme:i}}});function xL(e,t,n,r,i,o){const s=Ee("oc-emoji-picker");return X(),Te(s,{theme:e.theme,onEmojiSelect:e.onEmojiSelect},null,8,["theme","onEmojiSelect"])}const z0=Ye(AL,[["render",xL]]),RL=()=>{const e=vt(),{showMessage:t,showErrorMessage:n}=nt(),{$gettext:r}=Ie.useGettext(),i=Ke(),o=gn(),s=at(),{createDefaultMetaFolder:a}=Qi(),{dispatchModal:l}=ht(),{getDefaultMetaFolder:u}=Ca(),c=({resources:b})=>{b.length===1&&l({elementClass:"w-auto",title:r("Set icon for »%{space}«",{space:b[0].name}),hideConfirmButton:!0,customComponent:z0,focusTrapInitial:!1,onConfirm:w=>d(b[0],w)})},p=async b=>{const w=document.createElement("canvas"),S=w.getContext("2d"),y=16/9,g=720,v=g/y;w.width=g,w.height=v;const h=.4*g;S.font=`${h}px sans-serif`,S.textBaseline="middle",S.textAlign="center",S.fillText(b,w.width/2,w.height/2+15);const T=await ub(w);return cb(T)},d=async(b,w)=>{const S=i.graphAuthenticated,y=await p(w);let g=await u(b);return g||(g=await a(b)),o.addTask(async()=>{const v={"Content-Type":"application/offset+octet-stream"};try{const{fileId:h}=await i.webdav.putFileContents(b,{parentFolderId:g.id,fileName:"image.png",content:y,headers:v,overwrite:!0}),E=await S.drives.updateDrive(b.id,{name:b.name,special:[{specialFolder:{name:"image"},id:h}]});s.updateSpaceField({id:b.id,field:"spaceImageData",value:E.spaceImageData}),t({title:r("Space icon was set successfully")}),Je.publish("app.files.spaces.uploaded-image",E)}catch(h){if(console.error(h),h instanceof re.HttpError&&h.statusCode===507){n({title:r("Failed to set space icon"),desc:r("Not enough quota to set the space icon"),errors:[h]});return}n({title:r("Failed to set space icon"),errors:[h]})}})};return{actions:B(()=>[{name:"set-space-icon",icon:"emoji-sticker",handler:c,label:()=>r("Set icon"),isVisible:({resources:b})=>b.length!==1?!1:b[0].canEditImage({user:e.user}),class:"oc-files-actions-set-space-icon-trigger"}]),setIconSpace:d}},CL=()=>{const e=vt(),{$gettext:t}=Ie.useGettext(),{dispatchModal:n}=ht(),{graphAuthenticated:r,webdav:i}=Ke(),o=at(),{showMessage:s,showErrorMessage:a}=nt(),{defaultSpaceImageBlobURL:l}=Me.storeToRefs(o),u=async({space:d})=>{try{await i.deleteFile(d,{path:".space/image.png"}),await r.drives.updateDrive(d.id,{name:d.name,special:[{specialFolder:{name:"image"},id:null}]}),o.updateSpaceField({id:d.id,field:"spaceImageData",value:null}),o.updateSpaceField({id:d.id,field:"thumbnail",value:f(l)}),s({title:t("Space image deleted successfully")})}catch(m){console.error(m),a({title:t("Failed to delete space image"),errors:[m]})}},c=({resources:d})=>{n({title:t("Delete »%{space}« image",{space:d[0].name}),confirmText:t("Delete"),onConfirm:()=>u({space:d[0]}),message:t("Are you sure you want to delete the image of »%{space}«?",{space:d[0].name})})};return{actions:B(()=>[{name:"delete-space-image",icon:"delete-bin",handler:c,label:()=>t("Delete image"),isVisible:({resources:d})=>d.length!==1||!d[0].spaceImageData?!1:d[0].canEditImage({user:e.user}),class:"oc-files-actions-delete-space-image-trigger"}]),deleteSpaceImage:u}},kL=()=>{const{$gettext:e}=Ie.useGettext();return{actions:B(()=>[{name:"show-details",icon:"information",label:()=>e("Details"),handler:()=>Je.publish(Rt.open),isVisible:({resources:n})=>n.length>0,class:"oc-admin-settings-show-details-trigger"}])}},PL=()=>{const{getMatchingSpace:e}=ln(),t=at(),n=ar(),r=ze(),i=Ke(),{$gettext:o}=Ie.useGettext(),{openEditor:s}=Xn(),{resources:a,currentFolder:l}=Me.storeToRefs(r);return{openEmptyEditor:async(c,p)=>{let d=f(l)?e(f(l)):null,m=f(a),b=f(l)?.path;(!d||!f(l).canCreate())&&(d=t.personalSpace,m=(await i.webdav.listFiles(d)).children,b="");let w=o("New file")+`.${p}`;m.some(v=>v.name===w)&&(w=zn(w,p,m));const S=await i.webdav.putFileContents(d,{path:re.urlJoin(b,w)}),y=e(S),g=n.fileExtensions.find(({app:v,extension:h})=>v===c&&h===p);s(g,y,S)}}},W0=()=>{const{$gettext:e}=Ie.useGettext(),{showMessage:t}=nt();return{openUrl:(r,i,o)=>{const s=window.open(r,i);s?o&&s.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.")})}}},IL=()=>Ar("$appProviderService"),OL=()=>{const{isResourceAccessible:e}=ln();return{breadcrumbsFromPath:({route:r,space:i,resourcePath:o,ancestorMetaData:s=le({})})=>{const a=(c="")=>c.split("/").filter(Boolean),l=a(r.path),u=a(o);return u.map((c,p)=>{const d=re.urlJoin(...u.slice(0,p+1),{leadingSlash:!0}),m=e({space:f(i),path:d});let b;return m&&(b=f(s)[d]),{id:Xt.v4(),allowContextActions:!0,text:c,...m&&{to:{path:"/"+[...l].splice(0,l.length-u.length+p+1).join("/"),query:{...Hi(r.query,"page","fileId"),...b&&{fileId:b.id}}}},isStaticNav:!1}})},concatBreadcrumbs:(...r)=>{const i=r.pop();return[...r,{id:Xt.v4(),allowContextActions:i.allowContextActions,text:i.text,onClick:()=>Je.publish("app.files.list.load"),isTruncationPlaceholder:i.isTruncationPlaceholder,isStaticNav:i.isStaticNav}]}}},FL=(e="")=>{const t=le(0),n=async()=>{await zt();const r=document.querySelector(e||"#files-app-bar"),i=r?r.getBoundingClientRect().height:0;t.value!==i&&(t.value=i)};return window.onresize=n,Lt(n),{y:t,refresh:n}},_d=()=>{const e=le(!0),t=()=>{e.value=window.innerHeight>500};return Lt(()=>{t(),window.addEventListener("resize",t)}),An(()=>{window.removeEventListener("resize",t)}),{isSticky:e}};class io{static perPageDefault="100";static perPageQueryName="items-per-page";static options=["20","50","100","250","500"]}function _L(e){const t=ds.useRouter(),n=ds.useRoute(),r=DL(e),i=NL(e),o=B(()=>Math.ceil(f(e.items).length/f(i))||1),s=B(()=>{if(!f(i))return f(e.items);const a=(f(r)-1)*f(i),l=a+f(i);return f(e.items).slice(a,l)});return Je.subscribe("app.files.navigate.page",({resourceId:a,forceScroll:l,topbarElement:u})=>{const c=Tt.findIndex(f(e.items),p=>p.id===a);if(c>=0){const p=Math.ceil((c+1)/Number(f(i)));t.push({...f(n),query:{...f(n).query,page:p}}).then(()=>{Je.publish("app.files.navigate.scrollTo",{resourceId:a,forceScroll:l,topbarElement:u})})}}),{items:s,total:o,page:r,perPage:i}}function DL(e){if(e.page)return B(()=>f(e.page));const t=tn("page","1");return B(()=>parseInt(Ct(f(t))))}function NL(e){if(e.perPage)return B(()=>f(e.perPage));const t=kr({name:e.perPageQueryName||io.perPageQueryName,defaultValue:e.perPageDefault||io.perPageDefault,storagePrefix:e.perPageStoragePrefix});return B(()=>parseInt(Ct(f(t))))}const H0=()=>Ar("$passwordPolicyService");var el=(e=>(e.mounted="portal-target.mounted",e))(el||{});const LL=()=>{const e=ur(),t=fs.useWormhole();return{registerPortal:r=>{e.subscribe(el.mounted,()=>{t.open(r)})}}},K0=()=>Ar("$previewService"),G0=()=>{const e=ar();return{canBeOpenedWithSecureView:n=>e.fileExtensions.filter(({secureView:i})=>i).some(({mimeType:i})=>i===n.mimeType)}},Q0=()=>{const e=vt();return{canListVersions:({space:n,resource:r})=>r.type==="folder"||re.isSpaceResource(r)||re.isTrashResource(r)?!1:n?.canListVersions({user:e.user})}},X0=()=>{const e=Ke(),t=at(),n=B(()=>t.spaces),r=l=>f(n).find(u=>l.toString().startsWith(u.id.toString())),i=l=>f(n).find(u=>re.isMountPointSpaceResource(u)&&u.root?.remoteItem?.id===l),o=(l,u)=>{const c=[Ve.FileId,Ve.FileParent,Ve.Name,Ve.ResourceType],p=re.buildSpace({id:l,name:""});return e.webdav.getFileInfo(p,{fileId:l},{davProperties:c,signal:u})},s=rn.useTask(function*(l,u){let c,p,d=r(u);if(d)return c=yield e.webdav.getPathForFileId(u,{signal:l}),p=yield e.webdav.getFileInfo(d,{path:c},{signal:l}),{space:d,resource:p,path:c};yield t.loadMountPoints({graphClient:e.graphAuthenticated,signal:l});let m=i(u);p=yield o(u,l);const b=m?[]:[f(p).name];let w=f(p);for(;!m;)w=yield o(w.parentFolderId,l),m=i(w.id),m||b.unshift(w.name);return d=t.getSpace(m.root?.remoteItem?.id)||t.createShareSpace({driveAliasPrefix:p.storageId?.startsWith(re.OCM_PROVIDER_ID)?"ocm-share":"share",id:m.root?.remoteItem?.id,shareName:m.name}),c=re.urlJoin(...b),{space:d,resource:p,path:c}}).restartable();return{getResourceContext:l=>s.perform(l)}},nn={name:{table:"resource-table",condensedTable:"resource-table-condensed",tiles:"resource-tiles"},defaultModeName:"resource-tiles",queryName:"view-mode",tilesSizeDefault:2,tilesSizeMax:6,tilesSizeQueryName:"tiles-size"},$L=140,ML=84,Y0=()=>{const e=le($L),t=le(ML),n=i=>f(e)+(i-1)*f(t);return{calculateTileSizePixels:n,calculateTileSizeRem:i=>{const o=parseFloat(getComputedStyle(document.documentElement).fontSize);return n(i)/o}}};function BL(e){if(e)return B(()=>f(e));const t=kr({name:nn.queryName,defaultValue:nn.defaultModeName});return B(()=>Ct(f(t)))}function jL(e){if(e)return B(()=>parseInt(f(e)));const t=kr({name:nn.tilesSizeQueryName,defaultValue:nn.tilesSizeDefault.toString()});return B(()=>parseInt(Ct(f(t))))}const UL=le(nn.tilesSizeMax);function Dd(){return UL}const Nd=e=>{const t=K0(),{updateResourceField:n}=ze(),{httpAuthenticated:r}=Ke(),i=at(),{defaultSpaceImageBlobURL:o}=Me.storeToRefs(i),s=dt(),{serverUrl:a}=Me.storeToRefs(s),l=new Lr({concurrency:4}),u=B(()=>f(e)===nn.name.tiles),c=B(()=>f(u)?ya.enum.fit:ya.enum.thumbnail),p=B(()=>f(u)?rs.Tile:rs.Thumbnail),d=rn.useTask(function*(S,{space:y,resource:g,dimensions:v,processor:h,updateStore:E=!0}){const T=re.isProjectSpaceResource(g)?re.buildSpaceImageResource(g):g,R=T.id===y.spaceImageData?.id;R&&i.addToImagesLoading(y.id);const x=yield l.add(()=>t.loadPreview({space:y,resource:T,processor:h||f(c),dimensions:v||f(p)},!0,!0,S));return x&&E&&n({id:g.id,field:"thumbnail",value:x}),R&&i.removeFromImagesLoading(y.id),x}),m=async S=>{const{resource:y,cancelRunning:g}=S;if(g&&w(),re.isProjectSpaceResource(y)&&(!y.spaceImageData||y.disabled)){f(o)&&i.updateSpaceField({id:y.id,field:"thumbnail",value:f(o)});try{const v=await r.get(`${f(a)}images/default-space-icon.png`,{responseType:"blob"});return i.setDefaultSpaceImageBlobURL(URL.createObjectURL(v.data)),i.updateSpaceField({id:y.id,field:"thumbnail",value:f(o)}),f(o)}catch{return null}}try{return await d.perform(S)}catch(v){v!=="cancel"&&console.error(v)}},b=B(()=>d.isRunning),w=()=>{d.cancelAll(),l.clear(),i.purgeImagesLoading()};return kl(w),{loadPreview:m,previewsLoading:b}},J0=({showSizeInformation:e=!0}={})=>{const t=ze(),{current:n,$gettext:r,$ngettext:i}=Ie.useGettext(),o=He(),{resources:s,totalResourcesCount:a,areHiddenFilesShown:l,currentFolder:u}=Me.storeToRefs(t),c=B(()=>{if(!f(u)?.size||f(u)?.size==="0"){const d=f(s).map(m=>m.size?parseInt(m.size.toString()):0).reduce((m,b)=>m+b,0);return vn(d,n)}return vn(f(u).size,n)});return{resourceContentsText:B(()=>{let d=i("%{ filesCount } file","%{ filesCount } files",f(a).files,{filesCount:f(a).files.toString()});!f(l)&&f(a).hiddenFiles&&(d=i("%{ filesCount } file including %{ filesHiddenCount } hidden","%{ filesCount } files including %{ filesHiddenCount } hidden",f(a).files,{filesCount:f(a).files.toString(),filesHiddenCount:f(a).hiddenFiles.toString()}));let m=i("%{ foldersCount } folder","%{ foldersCount } folders",f(a).folders,{foldersCount:f(a).folders.toString()});!f(l)&&f(a).hiddenFolders&&(m=i("%{ foldersCount } folder including %{ foldersHiddenCount } hidden","%{ foldersCount } folders including %{ foldersHiddenCount } hidden",f(a).folders,{foldersCount:f(a).folders.toString(),foldersHiddenCount:f(a).hiddenFolders.toString()}));const b=i("%{ spacesCount } space","%{ spacesCount } spaces",f(a).spaces,{spacesCount:f(a).spaces.toString()}),w=f(a).files+f(a).folders+f(a).spaces,S=e&&parseFloat(f(c))>0,y=Mt(o,"files-shares-via-link"),g=r(S?"%{ itemsCount } item with %{ itemSize } in total":"%{ itemsCount } item in total"),v=r(S?"%{ itemsCount } items with %{ itemSize } in total":"%{ itemsCount } items in total"),h=y?"(%{ filesStr}, %{ foldersStr}, %{ spacesStr})":"(%{ filesStr}, %{ foldersStr})",E=`${g} ${h}`,T=`${v} ${h}`;return i(E,T,w,{itemsCount:w.toString(),itemSize:f(c),filesStr:d,foldersStr:m,spacesStr:b})})}},Z0=({isResourceSelected:e,isResourceDisabled:t,emit:n})=>{const r=ur(),{isMobile:i}=vw(),{interceptModifierClick:o}=gi(),s=d=>{r.publish("app.files.list.clicked"),n("update:selectedIds",d)},a=Qn(yn,"files-trash-overview"),l=d=>f(a)&&re.isProjectSpaceResource(d)&&d.disabled?!1:!t(d),u=d=>document.getElementById(`context-menu-trigger-${d.getDomSelector()}`);return{shouldShowContextDrop:l,showContextMenuOnBtnClick:(d,m)=>{const{dropdown:b,event:w}=d;if(w instanceof MouseEvent&&o(w,m))return;if(t(m))return!1;if(b?.tippy===void 0)return;const S=u(m);S&&(e(m)||s([m.id]),Wf(b.tippy,w,S))},showContextMenuOnRightClick:(d,m)=>{if(d instanceof MouseEvent&&o(d,m))return;if(d.preventDefault(),t(m))return!1;const b=u(m);if(b){if(e(m)||s([m.id]),f(i)){b.click();return}Wf(b._tippy,d,b)}}}},eS=({selectedIds:e,selectedResources:t,emit:n})=>{const r=ze(),i=le(),o=Tn("ghostElement"),s=async(d,m)=>{i.value=d,await zt(),f(o).$el.ariaHidden="true",f(o).$el.style.left="-99999px",f(o).$el.style.top="-99999px",m.dataTransfer.setDragImage(f(o).$el,0,0),m.dataTransfer.dropEffect="move",m.dataTransfer.effectAllowed="move"},a=async(d,m)=>{f(e).includes(d.id)||(r.toggleSelection(d.id),n("update:selectedIds",[...r.selectedIds])),await s(d,m)},l=B(()=>f(t).filter(({id:d})=>d!==f(i)?.id)),u=d=>(d.dataTransfer.types||[]).some(m=>m==="Files"),c=(d,m)=>{u(m)||(i.value=null,p(d,!0,m),n("fileDropped",d.id))},p=(d,m,b)=>{if(u(b)||b.currentTarget?.contains(b.relatedTarget)||f(e).includes(d.id)||d.type!=="folder")return;const w=document.querySelectorAll(`[data-item-id='${d.id}']`)?.[0];if(!w)return;const S="!bg-role-secondary-container";m?w.classList.remove(S):w.classList.add(S)};return{ghostElement:o,dragItem:i,dragSelection:l,dragStart:a,fileDropped:c,setDropStyling:p}},tS=({resources:e,disabledResources:t,selectedIds:n,emit:r})=>{const i=ur(),{$gettext:o}=Ie.useGettext(),s=p=>{i.publish("app.files.list.clicked"),r("update:selectedIds",p)},a=p=>{switch(p.type){case"folder":return o("Select folder");case"space":return o("Select space");default:return o("Select file")}},l=B(()=>{const p=f(t).length===f(e).length,d=f(n).length===f(e).length-f(t).length;return!p&&d}),u=B(()=>f(l)?o("Clear selection"):o("Select all"));return{getResourceCheckboxLabel:a,areAllResourcesSelected:l,selectAllCheckboxLabel:u,toggleSelectionAll:()=>{if(f(l))return s([]);s(f(e).filter(p=>!f(t).includes(p.id)).map(p=>p.id))}}},Ld=({space:e,resources:t,selectedIds:n,emit:r})=>{const i=ze(),o=He(),s=ur(),{interceptModifierClick:a}=gi(),{getMatchingSpace:l}=ln(),{canBeOpenedWithSecureView:u}=G0(),{getDefaultAction:c}=Xn(),{isEnabled:p,fileTypes:d,isFilePicker:m,postMessage:b}=Qr(),w=Uo(),{resources:S,action:y}=Me.storeToRefs(w),g=B(()=>f(t).filter(D=>f(n).includes(D.id))),v=D=>f(n).includes(D.id),h=D=>i.deleteQueue.includes(D),E=D=>f(p)&&f(d)?.length?!f(d).includes(D.extension)&&!f(d).includes(D.mimeType)&&!D.isFolder:h(D.id)?!0:re.isSpaceResource(D)?D.disabled:D.processing===!0,T=B(()=>f(t)?.filter(E)?.map(D=>D.id)||[]);return{selectedResources:g,disabledResources:T,isResourceSelected:v,isResourceInDeleteQueue:h,isResourceDisabled:E,isResourceClickable:(D,V)=>!V||re.isProjectSpaceResource(D)&&D.disabled||!D.isFolder&&!D.canDownload()&&!u(D)?!1:!E(D),isResourceCut:D=>f(y)!==Mo.Cut?!1:f(S).some(V=>V.id===D.id),fileContainerClicked:({resource:D,event:V})=>{if(E(D))return;if(f(p)&&f(m)&&!D.isFolder)return b("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(D)),locationQuery:JSON.parse(JSON.stringify(Ra(f(o.currentRoute))))});!V.shiftKey&&!V.metaKey&&!V.ctrlKey&&s.publish("app.files.shiftAnchor.reset");const L=V?.target;if(L?.closest("div")?.id==="oc-files-context-menu")return;if(V&&V.metaKey)return s.publish("app.files.list.clicked.meta",D);if(V&&V.shiftKey)return s.publish("app.files.list.clicked.shift",{resource:D,skipTargetSelection:!1});L.getAttribute("type")!=="checkbox"&&(v(D)||(s.publish("app.files.list.clicked"),r("update:selectedIds",[D.id])))},fileNameClicked:({resource:D,event:V})=>{if(!a(V,D)){if(f(p))return f(m)||r("update:selectedIds",[D.id]),f(m)&&!D.isFolder?b("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(D)),locationQuery:JSON.parse(JSON.stringify(Ra(f(o.currentRoute))))}):void 0;r("fileClick",{space:l(D),resources:[D]})}},fileCheckboxClicked:({resource:D,event:V})=>{a(V,D)||(i.toggleSelection(D.id),s.publish("app.files.list.clicked"),r("update:selectedIds",[...i.selectedIds]))},getResourceLink:D=>{let V=f(e);V||(V=l(D));const L=c({resources:[D],space:V});if(L?.route)return L.route({space:V,resources:[D]})},...eS({selectedIds:n,selectedResources:g,emit:r}),...Z0({isResourceDisabled:E,isResourceSelected:v,emit:r}),...tS({resources:t,disabledResources:T,selectedIds:n,emit:r})}},$d=()=>{const{getMatchingSpace:e}=ln(),t=ze(),n=B({get(){return t.selectedResources},set(s){t.setSelection(s.map(({id:a})=>a))}}),r=B({get(){return t.selectedIds},set(s){t.setSelection(s)}}),i=s=>f(r).includes(s.id),o=B(()=>{if(f(n).length!==1)return null;const s=f(n)[0];return e(s)});return{selectedResources:n,selectedResourcesIds:r,isResourceInSelection:i,selectedResourceSpace:o}};class cs{static sortByQueryName="sort-by";static sortDirQueryName="sort-dir"}function VL(e){const t=He(),n=qL(e),r=zL(e),i=B(()=>rS(f(n))||f(Md(f(s))?.name)),o=B(()=>HL(f(r))||WL(f(i),f(s))),s=e.fields;return{items:B(()=>{const u=f(e.items);return f(i)?nS(u,f(s),f(i),f(o)):u}),sortBy:i,sortDir:o,handleSort:({sortBy:u,sortDir:c})=>t.replace({query:{...f(t.currentRoute).query,[f(e.sortByQueryName)||cs.sortByQueryName]:u,[f(e.sortDirQueryName)||cs.sortDirQueryName]:c}})}}function qL(e){return e.sortBy?Ft(e.sortBy)?e.sortBy:le(e.sortBy):kr({name:f(e.sortByQueryName)||cs.sortByQueryName,defaultValue:f(Md(f(e.fields))?.name),storagePrefix:f(e.routeName)||f(Gf())})}function zL(e){return e.sortDir?Ft(e.sortDir)?e.sortDir:le(e.sortDir):kr({name:f(e.sortDirQueryName)||cs.sortDirQueryName,defaultValue:f(Md(f(e.fields))?.sortDir),storagePrefix:f(e.routeName)||f(Gf())})}const Md=e=>{const t=e.filter(n=>n.sortable);return t?t[0]:null},WL=(e,t)=>{const n=t.find(r=>r.name===e);return n&&n.sortDir?f(n.sortDir):pt.Desc},nS=(e,t,n,r)=>{const i=t.find(a=>a.name===n);if(!i)return e;const{sortable:o}=i,s=new Intl.Collator(navigator.language,{sensitivity:"base",numeric:!0});if(n==="name"){const a=c=>c.type==="folder"&&!c.extension,l=[...e.filter(c=>a(c))].sort((c,p)=>Bd(c,p,s,n,r,o)),u=[...e.filter(c=>!a(c))].sort((c,p)=>Bd(c,p,s,n,r,o));return r===pt.Asc?l.concat(u):u.concat(l)}return[...e].sort((a,l)=>Bd(a,l,s,i.prop||i.name,r,o))},Bd=(e,t,n,r,i,o)=>{let s=Ec(e,r),a=Ec(t,r);const l=i===pt.Asc?1:-1;if(o)if(typeof o=="string"){const c=p=>p.map(d=>d[o]).join("");s=c(s),a=c(a)}else typeof o=="function"&&(s=o(s),a=o(a));return!isNaN(s)&&!isNaN(a)?(s-a)*l:n.compare((s||"").toString(),(a||"").toString())*l},rS=e=>Array.isArray(e)?e[0]:e,HL=e=>{switch(rS(e)){case pt.Asc:return pt.Asc;case pt.Desc:return pt.Desc}return null};function KL(e){const t=en(),n=li(),r=Ke(),i=Ie.useGettext(),o=B(()=>t.tusMaxChunkSize>0),s=()=>{const u={};return n.publicLinkPassword?u.Authorization="Basic "+Kr.from(["public",n.publicLinkPassword].join(":")).toString("base64"):n.accessToken&&!n.publicLinkPassword&&(u.Authorization="Bearer "+n.accessToken),u["X-Request-ID"]=Xt.v4(),u["Accept-Language"]=i.current,u["Initiator-ID"]=r.initiatorId,u},a=B(()=>{const u={onBeforeRequest:(c,p)=>new Promise(d=>{const m=s();c.setHeader("Authorization",m.Authorization),c.setHeader("X-Request-ID",m["X-Request-ID"]),c.setHeader("Accept-Language",m["Accept-Language"]),c.setHeader("Initiator-ID",m["Initiator-ID"]),p?.isRemote&&c.setHeader("x-oc-mtime",(p?.data?.lastModified/1e3).toFixed(0)),d()}),chunkSize:t.tusMaxChunkSize||1/0,overridePatchMethod:t.tusHttpMethodOverride,uploadDataDuringCreation:t.tusExtension.includes("creation-with-upload")};return u.headers=c=>{if(c.xhrUpload||c?.isRemote)return{"x-oc-mtime":(c?.data?.lastModified/1e3).toFixed(0),...s()}},u}),l=B(()=>({timeout:6e4,endpoint:"",headers:u=>({"x-oc-mtime":(u?.data?.lastModified/1e3).toFixed(0),...s()})}));st([a,l],()=>{if(f(o)){e.uppyService.useTus(f(a));return}e.uppyService.useXhr(f(l))},{immediate:!0})}const iS=()=>{const e=Ke(),{addAvatar:t,getAvatar:n,avatarsQueue:r,pendingAvatarsRequests:i}=Ea(),o=async a=>{try{const l=await e.graphAuthenticated.photos.getUserPhoto(a,{responseType:"blob"});t(a,URL.createObjectURL(l))}catch(l){l.response?.status===404&&t(a,null)}return n(a)};return{enqueueAvatar:a=>{if(n(a)!==void 0||i.has(a))return;const l=r.add(()=>o(a));i.set(a,l),l.finally(()=>i.delete(a))}}},GL=_e({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=dt(),{options:n}=Me.storeToRefs(t),r=B(()=>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")),i=B(()=>({...{appearance:e.action.appearance||e.appearance,...e.action.isDisabled&&{disabled:e.action.isDisabled(e.actionOptions)},...e.action.id&&{id:e.action.id}},...f(r)==="router-link"&&{to:e.action.route(e.actionOptions)},...f(r)==="a"&&{href:e.action.href(e.actionOptions)},...["router-link","a"].includes(f(r))&&{target:n.value.cernFeatures?"_blank":"_self"}})),o=B(()=>typeof e.action.icon=="function"?e.action.icon(e.actionOptions):e.action.icon);return{componentType:r,componentProps:i,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}}}}),QL={key:3,class:"oc-files-context-action-label flex flex-col","data-testid":"action-label"},XL=["textContent"],YL=["textContent"];function JL(e,t,n,r,i,o){const s=Ee("oc-image"),a=Ee("oc-icon"),l=Ee("oc-button"),u=sn("oc-tooltip");return ot((X(),pe("li",null,[ot((X(),Te(l,$t({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"},Os(e.componentListeners)),{default:ve(()=>[e.action.img?(X(),Te(s,{key:0,"data-testid":"action-img",src:e.action.img,alt:"",class:"oc-icon oc-icon-m w-[22px]"},null,8,["src"])):e.hasExternalImageIcon?(X(),Te(s,{key:1,"data-testid":"action-img",src:e.actionIcon,alt:"",class:"oc-icon oc-icon-m w-[22px]"},null,8,["src"])):e.actionIcon?(X(),Te(a,{key:2,"data-testid":"action-icon",name:e.actionIcon,"fill-type":e.action.iconFillType||"line",size:e.size},null,8,["name","fill-type","size"])):Re("",!0),e.action.hideLabel?Re("",!0):(X(),pe("span",QL,[fe("span",{class:"text-left",textContent:z.toDisplayString(e.action.label(e.actionOptions))},null,8,XL)])),e.action.shortcut&&e.shortcutHint?(X(),pe("span",{key:4,class:"text-sm flex-row-reverse",textContent:z.toDisplayString(e.action.shortcut)},null,8,YL)):Re("",!0)]),_:1},16,["type","class","aria-label","size"])),[[u,e.showTooltip||e.action.hideLabel?e.action.label(e.actionOptions):""]])])),[[u,e.componentProps.disabled?e.action.disabledTooltip?.(e.actionOptions):""]])}const tl=Ye(GL,[["render",JL]]),ZL=_e({name:"BatchActions",components:{ActionMenuItem:tl},props:{actions:{type:Array,required:!0},actionOptions:{type:Object,required:!0},limitedScreenSpace:{type:Boolean,default:!1,required:!1}}});function e$(e,t,n,r,i,o){const s=Ee("action-menu-item"),a=Ee("oc-list");return X(),pe("div",null,[me(a,{id:"oc-appbar-batch-actions",class:z.normalizeClass(["block xl:flex xl:items-center",{"oc-appbar-batch-actions-squashed [&_.oc-files-context-action-label]:hidden":e.limitedScreenSpace}])},{default:ve(()=>[(X(!0),pe(Be,null,mt(e.actions,(l,u)=>(X(),Te(s,{key:`action-${u}`,action:l,"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 oS=Ye(ZL,[["render",e$]]),t$={class:"context-menu px-2"},n$={class:"inline-flex gap-2"},r$={class:"flex oc-files-context-action-label"},i$=["textContent"],sS=_e({__name:"ActionMenuDropItem",props:{menuSectionDrop:{},appearance:{},actionOptions:{}},setup(e){const t=ci(`oc-files-context-actions-${e.menuSectionDrop.name}-drop-`),n=ci(`oc-files-context-actions-${e.menuSectionDrop.name}-toggle-`);return(r,i)=>{const o=Ee("oc-icon"),s=Ee("oc-button"),a=Ee("oc-list");return X(),pe("li",t$,[me(s,{id:f(n),appearance:"raw","justify-content":"space-between","gap-size":"medium",class:"w-full flex justify-between","aria-expanded":"false"},{default:ve(()=>[fe("span",n$,[me(o,{name:e.menuSectionDrop.icon,size:"medium","fill-type":"line"},null,8,["name"]),fe("span",r$,[fe("span",{textContent:z.toDisplayString(e.menuSectionDrop.label)},null,8,i$)])]),me(o,{name:"arrow-right-s",size:"small","fill-type":"line"})]),_:1},8,["id"]),me(f(ZD),{title:e.menuSectionDrop.label,"drop-id":f(t),toggle:`#${f(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:ve(()=>[e.menuSectionDrop.items.length?(X(),Te(a,{key:0},{default:ve(()=>[(X(!0),pe(Be,null,mt(e.menuSectionDrop.items,(l,u)=>(X(),Te(tl,{key:`section-${e.menuSectionDrop.label}-action-${u}`,action:l,appearance:e.appearance,"action-options":e.actionOptions},null,8,["action","appearance","action-options"]))),128))]),_:1})):Re("",!0)]),_:1},8,["title","drop-id","toggle"])])}}}),o$=_e({name:"ContextActionMenu",components:{ActionMenuDropItem:sS,ActionMenuItem:tl},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}}}),s$={id:"oc-files-context-menu"};function a$(e,t,n,r,i,o){const s=Ee("action-menu-item"),a=Ee("action-menu-drop-item"),l=Ee("oc-list");return X(),pe("div",s$,[(X(!0),pe(Be,null,mt(e.menuSections,(u,c)=>(X(),Te(l,{id:`oc-files-context-actions-${u.name}`,key:`section-${u.name}-list`,class:z.normalizeClass(["[&_li]:px-0",e.getSectionClasses(c)])},{default:ve(()=>[u.items?(X(!0),pe(Be,{key:0},mt(u.items,(p,d)=>(X(),Te(s,{key:`section-${u.name}-action-${d}`,action:p,appearance:e.appearance,"action-options":e.actionOptions,class:"context-menu"},null,8,["action","appearance","action-options"]))),128)):Re("",!0),(X(!0),pe(Be,null,mt(u.dropItems,p=>(X(),pe(Be,null,[p.items.length?(X(),Te(a,{key:p.name,"menu-section-drop":p,appearance:e.appearance,"action-options":e.actionOptions},null,8,["menu-section-drop","appearance","action-options"])):Re("",!0)],64))),256))]),_:2},1032,["id","class"]))),128))])}const nl=Ye(o$,[["render",a$]]),l$=_e({name:"ContextActions",components:{ContextActionMenu:nl},props:{actionOptions:{type:Object,required:!0}},setup(e){const{getAllOpenWithActions:t}=Xn(),{$gettext:n}=Ie.useGettext(),{actions:r}=E0(),{actions:i}=Qa(),{actions:o}=Ja(),{actions:s}=Pa(),{actions:a}=nd(),{actions:l}=Ka(),{actions:u}=ss(),{actions:c}=Ga(),{actions:p}=as(),{actions:d}=Pd(),{actions:m}=Xa(),{actions:b}=R0(),{actions:w}=Ya(),{actions:S}=ls(),{actions:y}=I0(),{actions:g}=Od(),{actions:v}=kd(),{actions:h}=Fd(),E=Ki(),T=B(()=>E.requestExtensions({id:"global.files.context-actions",extensionType:"action"}).map(Y=>Y.action)),R=B(()=>E.requestExtensions({id:"global.files.batch-actions",extensionType:"action"}).map(Y=>Y.action)),x=u1(e,"actionOptions"),A=B(()=>[...f(i),...f(l),...f(c),...f(m),...f(s),...f(u),...f(S),...f(v),...f(R).filter(Y=>Y.category==="actions"||Tt.isNil(Y.category))].filter(Y=>Y.isVisible(f(x)))),N=B(()=>[...f(g),...f(R).filter(Y=>Y.category==="sidebar")].filter(Y=>Y.isVisible(f(x)))),W=B(()=>f(r).filter(Y=>Y.isVisible(f(x))).sort((Y,se)=>Number(se.hasPriority)-Number(Y.hasPriority))),O=B(()=>t({...f(x),omitSystemActions:!0}).filter(Y=>Y.isVisible(f(x))).sort((Y,se)=>Number(se.hasPriority)-Number(Y.hasPriority))),D=B(()=>[...f(h),...f(a),...f(T).filter(Y=>Y.category==="share")].filter(Y=>Y.isVisible(f(x)))),V=B(()=>[...f(c),...f(p),...f(u),...f(m),...f(s),...f(b),...f(w),...f(v),...f(S),...f(i),...f(l),...f(o),...f(y),...f(T).filter(Y=>Y.category==="actions"||Tt.isNil(Y.category))].filter(Y=>Y.isVisible(f(x)))),L=B(()=>[...f(d).map(Y=>(Y.keepOpen=!0,Y)),...f(g),...f(T).filter(Y=>Y.category==="sidebar")].filter(Y=>Y.isVisible(f(x))));return{menuSections:B(()=>{const Y=[];return f(x).resources.length>1?(f(A).length&&Y.push({name:"batch-actions",items:[...f(A)]}),Y.push({name:"batch-details",items:[...f(N)]}),Y):([...f(W),...f(O)].length&&Y.push({name:"context",items:[...f(W)],dropItems:[{label:n("Open with..."),name:"open-with",icon:"apps",items:[...f(O)]}]}),f(D).length&&Y.push({name:"share",items:f(D)}),f(V).length&&Y.push({name:"actions",items:f(V)}),f(L).length&&Y.push({name:"sidebar",items:f(L)}),Y)})}}});function c$(e,t,n,r,i,o){const s=Ee("context-action-menu");return X(),Te(s,{"menu-sections":e.menuSections,"action-options":e.actionOptions},null,8,["menu-sections","action-options"])}const aS=Ye(l$,[["render",c$]]),u$={class:"flex items-center"},f$={class:"flex justify-between w-full"},d$={class:"flex items-center"},p$=["textContent"],h$={key:0,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},m$={key:1,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},g$={key:2,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},y$={key:3,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},v$={key:4,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},b$={key:5,class:"mt-2 mb-4 last:mb-0 flex justify-between items-center [&>*]:flex [&>*]:justify-between"},w$=["textContent"],S$=["max"],lS=Ye(_e({__name:"ViewOptions",props:{perPageStoragePrefix:{},hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},paginationOptions:{default:()=>io.options},perPageQueryName:{default:()=>io.perPageQueryName},perPageDefault:{default:()=>io.perPageDefault},viewModeDefault:{default:()=>nn.defaultModeName},viewModes:{default:()=>[]}},setup(e){const t=He(),n=Ht(),{$gettext:r}=Ie.useGettext(),{isSideBarOpen:i}=Sa(),o=ze(),{setAreHiddenFilesShown:s,setAreFileExtensionsShown:a,setAreDisabledSpacesShown:l,setAreEmptyTrashesShown:u}=o,{areHiddenFilesShown:c,areFileExtensionsShown:p,areDisabledSpacesShown:d,areEmptyTrashesShown:m}=Me.storeToRefs(o),b=le(!1),w=Qn(xt,"files-spaces-projects"),S=Qn(yn,"files-trash-overview"),y=tn("page"),g=B(()=>f(y)?parseInt(Ct(f(y))):1),v=kr({name:e.perPageQueryName,defaultValue:e.perPageDefault,storagePrefix:e.perPageStoragePrefix}),h=kr({name:nn.queryName,defaultValue:e.viewModeDefault}),E=kr({name:nn.tilesSizeQueryName,defaultValue:nn.tilesSizeDefault.toString()}),T=Y=>t.replace({query:{...f(n).query,[e.perPageQueryName]:Y.toString(),...f(g)>1&&{page:"1"}}}),R=Y=>{h.value=Y.name};st([v,h,E],Y=>{b.value=Y.some(se=>!se)},{immediate:!0,deep:!0});const x=Dd(),A=B({get(){return f(c)},set(Y){s(Y)}}),N=B({get(){return f(p)},set(Y){a(Y)}}),W=B({get(){return f(d)},set(Y){l(Y)}}),O=B({get(){return f(m)},set(Y){u(Y)}}),D=Y=>{A.value=Y},V=Y=>{N.value=Y},L=Y=>{W.value=Y},te=Y=>{O.value=Y};return(Y,se)=>{const he=Ee("oc-icon"),ae=Ee("oc-button"),we=Ee("oc-list"),Q=Ee("oc-drop"),ie=Ee("oc-switch"),ce=Ee("oc-page-size"),Ae=sn("oc-tooltip");return X(),pe("div",u$,[e.viewModes.length?(X(),pe(Be,{key:0},[ot((X(),Te(ae,{id:"mobile-viewmode-switch-toggle","aria-label":f(r)("Switch view mode"),appearance:"raw",class:z.normalizeClass(["my-2 mx-1 p-1 align-middle",{"sm:hidden":!f(i),"md:hidden":f(i)}])},{default:ve(()=>[me(he,{name:"list-view","fill-type":"none"})]),_:1},8,["aria-label","class"])),[[Ae,f(r)("Switch view mode")]]),me(Q,{title:f(r)("View mode"),"drop-id":"mobile-viewmode-switch-drop",toggle:"#mobile-viewmode-switch-toggle",class:"w-auto","padding-size":"medium","close-on-click":""},{default:ve(()=>[me(we,null,{default:ve(()=>[(X(!0),pe(Be,null,mt(e.viewModes,ee=>(X(),pe("li",{key:ee.name},[me(ae,{appearance:f(h)===ee.name?"filled":"raw","color-role":f(h)===ee.name?"secondaryContainer":"secondary","justify-content":"left",onClick:F=>R(ee)},{default:ve(()=>[fe("div",f$,[fe("span",d$,[me(he,{name:ee.icon.name,"fill-type":ee.icon.fillType,size:"medium",class:"mr-1"},null,8,["name","fill-type"]),fe("span",{textContent:z.toDisplayString(ee.label)},null,8,p$)]),f(h)===ee.name?(X(),Te(he,{key:0,name:"check",size:"medium"})):Re("",!0)])]),_:2},1032,["appearance","color-role","onClick"])]))),128))]),_:1})]),_:1},8,["title"])],64)):Re("",!0),e.viewModes.length>1?(X(),pe("div",{key:1,class:z.normalizeClass(["viewmode-switch-buttons oc-button-group hidden mr-2",{"sm:inline-flex":!f(i),"md:inline-flex":f(i)}])},[(X(!0),pe(Be,null,mt(e.viewModes,ee=>ot((X(),Te(ae,{key:ee.name,"no-hover":f(h)===ee.name,class:z.normalizeClass([ee.name]),appearance:f(h)===ee.name?"filled":"outline","color-role":f(h)===ee.name?"secondaryContainer":"secondary","aria-label":f(r)("Switch to %{viewMode}",{viewMode:ee.label}),onClick:F=>R(ee)},{default:ve(()=>[me(he,{name:ee.icon.name,"fill-type":ee.icon.fillType,size:"small"},null,8,["name","fill-type"])]),_:2},1032,["no-hover","class","appearance","color-role","aria-label","onClick"])),[[Ae,f(r)("Switch to %{viewMode}",{viewMode:ee.label})]])),128))],2)):Re("",!0),ot((X(),Te(ae,{id:"files-view-options-btn",key:"files-view-options-btn","data-testid":"files-view-options-btn","aria-label":f(r)("Display customization options of the files list"),appearance:"raw",class:"my-2 mx-1 p-1 align-middle"},{default:ve(()=>[me(he,{name:"settings-3","fill-type":"line"})]),_:1},8,["aria-label"])),[[Ae,f(r)("Display customization options of the files list")]]),me(Q,{title:f(r)("View options"),"drop-id":"files-view-options-drop",toggle:"#files-view-options-btn",mode:"click",class:"w-auto","padding-size":"medium"},{default:ve(()=>[me(we,null,{default:ve(()=>[e.hasHiddenFiles?(X(),pe("li",h$,[me(ie,{checked:A.value,"onUpdate:checked":[se[0]||(se[0]=ee=>A.value=ee),D],"data-testid":"files-switch-hidden-files",label:f(r)("Show hidden files")},null,8,["checked","label"])])):Re("",!0),e.hasFileExtensions?(X(),pe("li",m$,[me(ie,{checked:N.value,"onUpdate:checked":[se[1]||(se[1]=ee=>N.value=ee),V],"data-testid":"files-switch-files-extensions-files",label:f(r)("Show file extensions")},null,8,["checked","label"])])):Re("",!0),e.hasPagination?(X(),pe("li",g$,[b.value?Re("",!0):(X(),Te(ce,{key:0,selected:f(Ct)(f(v)),"data-testid":"files-pagination-size",label:f(r)("Items per page"),options:e.paginationOptions,class:"files-pagination-size",onChange:T},null,8,["selected","label","options"]))])):Re("",!0),f(w)?(X(),pe("li",y$,[me(ie,{checked:W.value,"onUpdate:checked":[se[2]||(se[2]=ee=>W.value=ee),L],"data-testid":"files-switch-projects-show-disabled",label:f(r)("Show disabled Spaces")},null,8,["checked","label"])])):Re("",!0),f(S)?(X(),pe("li",v$,[me(ie,{checked:O.value,"onUpdate:checked":[se[3]||(se[3]=ee=>O.value=ee),te],"data-testid":"files-switch-projects-show-disabled",label:f(r)("Show empty trash bins")},null,8,["checked","label"])])):Re("",!0),f(h)===f(nn).name.tiles?(X(),pe("li",b$,[fe("label",{for:"tiles-size-slider",textContent:z.toDisplayString(f(r)("Tile size"))},null,8,w$),ot(fe("input",{id:"tiles-size-slider","onUpdate:modelValue":se[4]||(se[4]=ee=>Ft(E)?E.value=ee:null),type:"range",min:1,max:f(x),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,S$),[[$l,f(E)]])])):Re("",!0)]),_:1})]),_:1},8,["title"])])}}}),[["__scopeId","data-v-15b0e205"]]),E$=_e({name:"AppBar",components:{BatchActions:oS,ContextActions:aS,ViewOptions:lS},props:{viewModeDefault:{type:String,required:!1,default:()=>nn.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},isSideBarOpen:{type:Boolean,default:!1},batchActionsLoading:{type:Boolean,default:!1},space:{type:Object,required:!1,default:null}},setup(e,{emit:t}){const n=at(),{$gettext:r}=Ie.useGettext(),{can:i}=fn(),o=He(),{requestExtensions:s}=Ki(),{isSticky:a}=_d(),l=ze(),{selectedResources:u}=Me.storeToRefs(l),c=B(()=>e.space),{actions:p}=Qa(),{actions:d}=Ja(),{actions:m}=Pa(),{actions:b}=$0(),{actions:w}=Ka(),{actions:S}=ss(),{actions:y}=Ga(),{actions:g}=as(),{actions:v}=Xa(),{actions:h}=ls(),{actions:E}=N0(),{actions:T}=L0(),{actions:R}=j0(),{actions:x}=q0(),A=le(0),N=Qn(Vt,"files-common-search"),W=B(()=>Object.hasOwn(Vp(),"navigation")&&i("create-all","Share")),O=B(()=>{let Q=[...f(d),...f(p),...f(w),...f(y),...f(g),...f(v),...f(m),...f(S),...f(h)];N.value||(Q=[...Q,...f(b),...f(R),...f(x),...f(E),...f(T)]);const ie=s({id:"global.files.batch-actions",extensionType:"action"});return ie.length&&(Q=[...Q,...ie.map(ce=>ce.action)]),Q.filter(ce=>ce.isVisible({space:f(c),resources:l.selectedResources}))}),D=B(()=>n.spaces.filter(Q=>re.isPersonalSpaceResource(Q)||re.isProjectSpaceResource(Q))),V=wr("isMobileWidth"),L=Qn(yn,"files-trash-generic"),te=B(()=>!f(V)&&e.breadcrumbs.length?!0:f(L)&&f(D).length===1?!1:e.breadcrumbs.length>1),Y=B(()=>f(L)&&f(D).length===1?e.breadcrumbs.length<=2:e.breadcrumbs.length<=1),se=B(()=>f(c)&&(re.isProjectSpaceResource(f(c))||re.isShareSpaceResource(f(c)))?3:2),he=Q=>{t(um,Q)},ae=Wb("title"),we=B(()=>f(ae)?r(f(ae)):f(c)?.name||"");return{router:o,hasSharesNavigation:W,batchActions:O,showBreadcrumb:te,showMobileNav:Y,breadcrumbMaxWidth:A,breadcrumbTruncationOffset:se,fileDroppedBreadcrumb:he,pageTitle:we,selectedResources:u,isSticky:a}},data:function(){return{resizeObserver:new ResizeObserver(this.onResize),limitedScreenSpace:!1}},computed:{showContextActions(){return Xd(this.breadcrumbs).allowContextActions},showBatchActions(){return this.hasBulkActions&&(this.selectedResources.length>=1||yn(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}}}),T$={class:"files-topbar py-2 w-full"},A$=["textContent"],x$={key:3,id:"files-app-bar-controls-right",class:"flex"},R$={class:"files-app-bar-actions flex items-center justify-end mt-1 min-h-10 gap-2"},C$={class:"flex-1 flex justify-start items-center"},k$={key:1};function P$(e,t,n,r,i,o){const s=Ee("oc-hidden-announcer"),a=Ee("context-actions"),l=Ee("oc-breadcrumb"),u=Ee("portal-target"),c=Ee("view-options"),p=Ee("batch-actions"),d=Ee("oc-spinner");return X(),pe("div",{id:"files-app-bar",ref:"filesAppBar",class:z.normalizeClass(["px-4 bg-role-surface rounded-t-xl [display:inherit] top-0 z-20",{"files-app-bar-squashed":e.isSideBarOpen,sticky:e.isSticky}])},[fe("div",T$,[fe("h1",{class:"sr-only",textContent:z.toDisplayString(e.pageTitle)},null,8,A$),me(s,{announcement:e.selectedResourcesAnnouncement,level:"polite"},null,8,["announcement"]),fe("div",{class:z.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?(X(),Te(l,{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:ve(()=>[me(a,{"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"])):Re("",!0),e.showMobileNav?(X(),Te(u,{key:1,name:"app.runtime.mobile.nav"})):Re("",!0),e.hasSharesNavigation?Ue(e.$slots,"navigation",{key:2}):Re("",!0),e.hasViewOptions?(X(),pe("div",x$,[me(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"])])):Re("",!0)],2),fe("div",R$,[fe("div",C$,[Ue(e.$slots,"actions",{limitedScreenSpace:e.limitedScreenSpace}),e.showBatchActions&&!e.batchActionsLoading?(X(),Te(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?(X(),pe("div",k$,[me(d,{"aria-label":e.$gettext("Loading actions")},null,8,["aria-label"])])):Re("",!0)])]),Ue(e.$slots,"content")])],2)}const I$=Ye(E$,[["render",P$]]),O$=_e({name:"CreateSpace",props:{showLabel:{type:Boolean,default:!0}},emits:["spaceCreated"],setup(e,{emit:t}){const{showMessage:n,showErrorMessage:r}=nt(),{$gettext:i}=Ie.useGettext(),{createSpace:o}=Qi(),{isSpaceNameValid:s}=Ei(),{dispatchModal:a}=ht(),l=at(),{upsertResource:u}=ze(),c=async d=>{try{const m=await o(d);u(m),l.upsertSpace(m),t("spaceCreated",m),n({title:i("Space was created successfully")})}catch(m){console.error(m),r({title:i("Creating space failed…"),errors:[m]})}};return{showCreateSpaceModal:()=>{a({title:i("Create a new space"),confirmText:i("Create"),hasInput:!0,inputLabel:i("Space name"),inputValue:i("New space"),inputRequiredMark:!0,onConfirm:d=>c(d),onInput:(d,m)=>{const{isValid:b,error:w}=s(d);m(b?null:w)}})}}}}),F$=["textContent"];function _$(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-button"),l=sn("oc-tooltip");return ot((X(),Te(a,{id:"new-space-menu-btn","aria-label":e.showLabel?void 0:e.$gettext("New space"),appearance:"filled",onClick:e.showCreateSpaceModal},{default:ve(()=>[me(s,{name:"add"}),e.showLabel?(X(),pe("span",{key:0,textContent:z.toDisplayString(e.$gettext("New Space"))},null,8,F$)):Re("",!0)]),_:1},8,["aria-label","onClick"])),[[l,e.showLabel?void 0:e.$gettext("New space")]])}const D$=Ye(O$,[["render",_$]]),N$={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"},L$={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"},$$={class:"open-file-bar flex"},M$={class:"flex"},B$={key:1,class:"flex items-center","data-testid":"autosave-indicator"},cS=_e({__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}=Ie.useGettext(),r=ze(),i=dt(),{getMatchingSpace:o}=ln(),{getParentFolderName:s,getPathPrefix:a,getParentFolderLinkIconAdditionalAttributes:l}=Yr(),u=B(()=>r.areFileExtensionsShown),c=B(()=>t("Show context menu")),p=B(()=>e.isEditor&&e.hasAutoSave&&i.options.editor.autosaveEnabled),d=B(()=>{const w=Ut.Duration.fromObject({seconds:i.options.editor.autosaveInterval},{locale:n});return t("Autosave (every %{ duration })",{duration:w.toHuman()})}),m=B(()=>o(e.resource)),b=B(()=>!re.isPublicSpaceResource(f(m)));return(w,S)=>{const y=Ee("oc-icon"),g=Ee("oc-button"),v=Ee("oc-drop"),h=Ee("portal"),E=sn("oc-tooltip");return X(),Te(h,{to:"app.runtime.header.left"},{default:ve(()=>[fe("div",N$,[fe("div",L$,[fe("div",$$,[e.resource?(X(),Te(os,{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":u.value,"path-prefix":f(a)(e.resource),resource:e.resource,"parent-folder-name":f(s)(e.resource),"parent-folder-link-icon-additional-attributes":f(l)(e.resource),"is-path-displayed":b.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"])):Re("",!0)]),fe("div",M$,[e.dropDownMenuSections.length?(X(),pe(Be,{key:0},[ot((X(),Te(g,{id:"oc-openfile-contextmenu-trigger","aria-label":c.value,appearance:"raw-inverse","color-role":"chrome",class:"p-1"},{default:ve(()=>[me(y,{name:"more-2"})]),_:1},8,["aria-label"])),[[E,c.value]]),me(v,{"drop-id":"oc-openfile-contextmenu",mode:"click","padding-size":"small",toggle:"#oc-openfile-contextmenu-trigger","close-on-click":"",title:e.resource.name,onClick:S[0]||(S[0]=Wt(()=>{},["stop","prevent"]))},{default:ve(()=>[me(nl,{"menu-sections":e.dropDownMenuSections,"action-options":e.dropDownActionOptions},null,8,["menu-sections","action-options"])]),_:1},8,["title"])],64)):Re("",!0),p.value&&!e.isReadOnly?(X(),pe("span",B$,[ot(me(y,{"accessible-label":d.value,name:"refresh",color:"white",class:"ox-p-xs mx-1"},null,8,["accessible-label"]),[[E,d.value]])])):Re("",!0),e.mainActions.length&&e.resource?(X(),Te(nl,{key:2,"menu-sections":[{name:"main-actions",items:e.mainActions.filter(T=>T.isVisible()).map(T=>({...T,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"])):Re("",!0),me(g,{id:"app-top-bar-close",appearance:"raw-inverse","color-role":"chrome",class:"p-1","aria-label":f(t)("Close"),onClick:S[1]||(S[1]=T=>w.$emit("close"))},{default:ve(()=>[me(y,{name:"close"})]),_:1},8,["aria-label"])])])])]),_:1})}}}),j$=_e({name:"ErrorScreen",props:{message:{default:"",type:String,required:!1}}}),U$={class:"text-center flex justify-center items-center h-full"},V$={key:0,class:"text-xl"};function q$(e,t,n,r,i,o){const s=Ee("oc-icon");return X(),pe("div",U$,[me(s,{size:"xxlarge",name:"error-warning","fill-type":"line"}),e.message?(X(),pe("p",V$,z.toDisplayString(e.message),1)):Re("",!0)])}const z$=Ye(j$,[["render",q$]]),W$=_e({name:"LoadingScreen"}),H$={class:"text-center flex justify-center items-center h-full"},K$=["textContent"];function G$(e,t,n,r,i,o){const s=Ee("oc-spinner");return X(),pe("div",H$,[me(s,{size:"xlarge"}),fe("p",{class:"sr-only",textContent:z.toDisplayString(e.$gettext("Loading app"))},null,8,K$)])}const Q$=Ye(W$,[["render",G$]]),X$=["id","data-testid","tabindex","inert"],Y$={key:0,class:"sidebar-panel__header header grid grid-cols-[auto_1fr_auto] items-center pt-2 px-2"},J$={class:"col-start-2 text-center my-0 text-lg"},Z$={key:0,class:"mt-4"},uS=Ye(_e({__name:"SideBar",props:{isOpen:{type:Boolean},loading:{type:Boolean},availablePanels:{},panelContext:{},activePanel:{default:""}},emits:["selectPanel","close"],setup(e,{emit:t}){const n=t,{$gettext:r}=Ie.useGettext(),i=Tn("appSideBar"),o=B(()=>e.availablePanels.filter(A=>A.isVisible(e.panelContext)&&A.isRoot?.(e.panelContext))),s=B(()=>e.availablePanels.filter(A=>A.isVisible(e.panelContext)&&!A.isRoot?.(e.panelContext))),a=B(()=>f(o).length?[f(o)[0],...f(s)]:f(s)),l=B(()=>{const A=e.activePanel?.split("#")[0];return!A||!f(s).map(N=>N.name).includes(A)?null:A}),u=B(()=>f(l)!==null),c=B(()=>f(l)===null),p=le(null),d=A=>{p.value=A},m=B(()=>f(u)?f(l):f(o)[0].name),b=B(()=>f(o).length===1?r("Back to %{panel} panel",{panel:f(o)[0].title(e.panelContext)}):r("Back to main panels")),w=le(window.innerWidth),S=B(()=>f(w)<=580),y=B(()=>f(i)?.parentElement?.querySelector("div")),g=()=>{if(!f(y))return;const A=f(S)?"hidden":"visible";f(y).style.visibility=A},v=()=>{e.isOpen&&(w.value=window.innerWidth,g())};st(()=>e.isOpen,async A=>{A&&(await zt(),g())},{immediate:!0});const h=A=>{n("selectPanel",A)},E=()=>{n("selectPanel",null)},T=()=>{n("close")},R=A=>{d(f(m)),h(A)},x=()=>{d(f(m)),E(),f(i).focus()};return Lt(()=>{window.addEventListener("resize",v)}),An(()=>{window.removeEventListener("resize",v),f(y)&&(f(y).style.visibility="visible")}),(A,N)=>{const W=Ee("oc-spinner"),O=Ee("oc-icon"),D=Ee("oc-button"),V=sn("oc-tooltip");return X(),pe("div",{id:"app-sidebar",ref_key:"appSideBar",ref:i,"data-testid":"app-sidebar",tabindex:"-1",class:z.normalizeClass(["border-l focus:outline-0 focus-visible:outline-0 w-[440px] min-w-[440px] overflow-hidden relative focus:shadow-none focus-visible:shadow-none",{"flex justify-center items-center":e.loading,"w-full min-w-full":S.value}])},[e.loading?(X(),Te(W,{key:0})):(X(!0),pe(Be,{key:1},mt(a.value,L=>(X(),pe("div",{id:`sidebar-panel-${L.name}`,key:`panel-${L.name}`,"data-testid":`sidebar-panel-${L.name}`,tabindex:m.value===L.name?-1:null,class:z.normalizeClass(["sidebar-panel absolute top-0 grid grid-rows-[auto_auto_1fr] bg-role-surface rounded-r-xl w-full size-full max-w-full max-h-full overflow-hidden 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]":c.value&&L.isRoot?.(e.panelContext)}]),inert:m.value!==L.name},[[m.value,p.value].includes(L.name)?(X(),pe("div",Y$,[L.isRoot?.(e.panelContext)?Re("",!0):ot((X(),Te(D,{key:0,class:"header__back col-start-1 p-1",appearance:"raw","aria-label":b.value,onClick:x},{default:ve(()=>[me(O,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"])),[[V,b.value]]),fe("h2",J$,z.toDisplayString(L.title(e.panelContext)),1),me(D,{appearance:"raw",class:"header__close col-start-3 p-1","aria-label":f(r)("Close file sidebar"),onClick:T},{default:ve(()=>[me(O,{name:"close"})]),_:1},8,["aria-label"])])):Re("",!0),fe("div",null,[L.isRoot?.(e.panelContext)?Ue(A.$slots,"rootHeader",{key:0},void 0,!0):Ue(A.$slots,"subHeader",{key:1},void 0,!0)]),fe("div",{class:z.normalizeClass(["sidebar-panel__body flex flex-col p-2 overflow-y-auto overflow-x-hidden",[`sidebar-panel__body-${L.name}`]])},[fe("div",{class:z.normalizeClass(["sidebar-panel__body-content",{"flex-1 ":!L.isRoot?.(e.panelContext)}])},[Ue(A.$slots,"body",{},()=>[(X(!0),pe(Be,null,mt(L.isRoot?.(e.panelContext)?o.value:[L],(te,Y)=>(X(),pe("div",{key:`sidebar-panel-${te.name}`},[(c.value?te.isRoot?.(e.panelContext):[m.value,p.value].includes(te.name))?(X(),Te(Pn(te.component),$t({key:0,class:[{"multi-root-panel-separator mt-4 pt-2 border-t":Y>0},"rounded-sm"]},{ref_for:!0},te.componentAttrs?.(e.panelContext)||{}),null,16,["class"])):Re("",!0)]))),128))],!0)],2),L.isRoot?.(e.panelContext)&&s.value.length>0?(X(),pe("div",Z$,[(X(!0),pe(Be,null,mt(s.value,te=>(X(),Te(D,{id:`sidebar-panel-${te.name}-select`,key:`panel-select-${te.name}`,"data-testid":`sidebar-panel-${te.name}-select`,appearance:"raw-inverse","color-role":"surface",class:"!grid !grid-cols-[auto_1fr_auto] text-left px-2 w-full h-12",onClick:Y=>R(te.name)},{default:ve(()=>[me(O,{name:te.icon,"fill-type":te.iconFillType},null,8,["name","fill-type"]),kt(" "+z.toDisplayString(te.title(e.panelContext))+" ",1),me(O,{name:"arrow-right-s","fill-type":"line"})]),_:2},1032,["id","data-testid","onClick"]))),128))])):Re("",!0)],2)],10,X$))),128))],2)}}}),[["__scopeId","data-v-b2b7e1e8"]]),eM={class:"grid items-center p-2"},tM={class:"flex items-center text-sm"},nM=["textContent"],rM=["textContent"],jd=_e({__name:"SpaceInfo",setup(e){const t=wr("resource");return(n,r)=>{const i=Ee("oc-icon");return X(),pe("div",eM,[fe("div",tM,[me(i,{name:"layout-grid",size:f(t).description?"large":"medium",class:"block mr-2"},null,8,["size"]),fe("div",null,[fe("h3",{"data-testid":"space-info-name",class:"font-semibold m-0 text-base break-all",textContent:z.toDisplayString(f(t).name)},null,8,nM),fe("span",{"data-testid":"space-info-subtitle",textContent:z.toDisplayString(f(t).description)},null,8,rM)])])])}}}),iM={class:"flex justify-between p-2"},oM={class:"flex items-center"},sM={"data-testid":"files-info-name",class:"font-semibold m-0 text-base break-all"},Ud=_e({__name:"FileInfo",props:{isSubPanelActive:{type:Boolean,default:!0}},setup(e){const t=ze(),{isPersonalSpaceRoot:n}=ln(),r=wr("resource"),i=wr("space"),o=B(()=>t.areFileExtensionsShown),s=B(()=>n(f(r))?f(i).name:f(r).name);return(a,l)=>(X(),pe("div",iM,[fe("div",oM,[e.isSubPanelActive?(X(),Te(is,{key:0,resource:f(r),size:"large",class:"mr-2 relative"},null,8,["resource"])):Re("",!0),fe("div",null,[fe("h3",sM,[me(Cd,{name:s.value,extension:f(r).extension,type:f(r).type,"full-path":f(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"])])])])]))}}),fS=_e({__name:"FileSideBar",props:{isOpen:{type:Boolean},activePanel:{default:()=>{}},space:{default:()=>{}}},setup(e){const t=He(),n=Ke(),r=Ki(),i=ur(),o=at(),s=Cr(),a=dt(),l=ar(),{canListShares:u}=O0(),{canListVersions:c}=Q0(),p=ze(),{currentFolder:d}=Me.storeToRefs(p),m=le(),b=le([]),w=le([]),S=le([]),{selectedResources:y}=$d(),g=le(!1),v=B(()=>f(g)),h=B(()=>f(y).length===0?{root:e.space,parent:null,items:f(d)?.id?[f(d)]:[]}:{root:e.space,parent:f(d),items:f(y)}),E=Qn(Mt,"files-shares-with-me"),T=Qn(Mt,"files-shares-with-others"),R=Qn(Mt,"files-shares-via-link"),x=xt(t,"files-spaces-projects"),A=Qn(Vt,"files-common-favorites"),N=Qn(Vt,"files-common-search"),W=()=>{i.publish(Rt.close)},O=Q=>{i.publish(Rt.setActivePanel,Q)},D=B(()=>f(h).items?.length===1&&!re.isProjectSpaceResource(f(h).items[0])),V=B(()=>f(h).items?.length===1&&re.isProjectSpaceResource(f(h).items[0])),L=B(()=>f(E)||f(T)||f(R)),te=B(()=>f(L)||f(N)||f(A)),Y=B(()=>r.requestExtensions({id:"global.files.sidebar",extensionType:"sidebarPanel"}).map(Q=>Q.panel)),se=rn.useTask(function*(Q,ie){b.value=yield n.webdav.listFileVersions(ie.id,{signal:Q})}),he=rn.useTask(function*(Q,ie){s.setLoading(!0),s.removeOrphanedShares();const{collaboratorShares:ce,linkShares:Ae}=s,ee=n.graphAuthenticated.permissions;let F=e.space?.id;if(re.isShareSpaceResource(e.space)){const Fe=yield o.getMountPointForSpace({graphClient:n.graphAuthenticated,space:e.space,signal:Q});Fe&&(F=Fe.root.remoteItem.rootId)}const{shares:C,allowedRoles:q}=yield*re.call(ee.listPermissions(F,ie.fileId,s.graphRoles,{},{signal:Q})),K=C.filter(re.isCollaboratorShare),j=C.filter(re.isLinkShare),H=Object.values(s.graphRoles);if(w.value=q?.map(Fe=>({...Fe,icon:H.find(ye=>ye.id===Fe.id)?.icon}))||[],l.isAppEnabled("open-cloud-mesh")){const{allowedRoles:Fe}=yield*re.call(ee.listPermissions(F,ie.fileId,s.graphRoles,{filter:`@libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition, '@Subject.UserType=="Federated"'))`,select:[Db.LibreGraphPermissionsRolesAllowedValues]},{signal:Q}));S.value=Fe?.map(ye=>({...ye,icon:H.find(We=>We.id===ye.id)?.icon}))||[]}!f(te)&&!f(x)&&(ce.forEach(Fe=>{K.some(ye=>ye.id===Fe.id)||K.push({...Fe,indirect:!0})}),Ae.forEach(Fe=>{j.some(ye=>ye.id===Fe.id)||j.push({...Fe,indirect:!0})})),Vt(t,"files-common-search")&&(yield p.loadAncestorMetaData({folder:f(ie),space:e.space,client:n.webdav,signal:Q}));const xe=[...ce,...Ae].map(({resourceId:Fe})=>Fe),De=Object.values(p.ancestorMetaData).filter(({id:Fe,path:ye})=>Fe===ie.id||xe.includes(Fe)||re.isIncomingShareResource(ie)?!1:re.isPersonalSpaceResource(e.space)?ye!=="/":!0).map(({id:Fe})=>Fe);f(te)&&re.isProjectSpaceResource(e.space)&&!re.isProjectSpaceResource(ie)&&De.push(e.space.id);const Oe=new Lr({concurrency:a.options.concurrentRequests.shares.list}),Ce=[...new Set(De)].map(Fe=>Oe.add(()=>n.graphAuthenticated.permissions.listPermissions(F,Fe,s.graphRoles,{},{signal:Q}).then(ye=>{const We=ye.shares.map(Ge=>({...Ge,indirect:!0}));K.push(...We.filter(re.isCollaboratorShare)),j.push(...We.filter(re.isLinkShare))})));yield Promise.allSettled(Ce),s.setCollaboratorShares(K),s.setLinkShares(j),s.setLoading(!1)}).restartable(),ae=le();st(()=>[...f(h).items,e.isOpen],async(Q,ie)=>{if(f(h).items?.length!==1)return;if(!e.isOpen){ae.value=void 0,b.value=[];return}const ce=Q?.[0],Ae=ie?.[0];if(ce?.id===Ae?.id&&ce?.mdate===f(ae))return;const ee=f(h).items[0];if(ae.value=ee.mdate,se.isRunning&&se.cancelAll(),!!c({space:e.space,resource:ee}))try{await se.perform(ee)}catch(F){console.error(F)}},{immediate:!0,deep:!0});const we=B(()=>f(h).items.map(Q=>Q.id));return st(()=>[we,e.isOpen],async()=>{if(!e.isOpen||!f(h).items?.length){s.pruneShares(),m.value=null;return}if(f(h).items?.length!==1)return;const Q=f(h).items[0];if(g.value=!0,re.isProjectSpaceResource(Q)&&await o.loadGraphPermissions({ids:[Q.id],graphClient:n.graphAuthenticated}),u({space:e.space,resource:Q}))try{he.isRunning&&he.cancelAll(),he.perform(Q)}catch(ie){console.error(ie)}if(!re.isOutgoingShareResource(Q)&&!re.isIncomingShareResource(Q)){m.value=Q,g.value=!1;return}try{const ie=await n.webdav.getFileInfo(e.space,{path:Q.path}),ce={...ie,...Q,tags:ie.tags};m.value=ce}catch(ie){m.value=Q,console.error(ie)}g.value=!1},{deep:!0,immediate:!0}),ni("resource",tr(m)),ni("versions",tr(b)),ni("space",B(()=>e.space)),ni("activePanel",B(()=>e.activePanel)),ni("availableInternalShareRoles",tr(w)),ni("availableExternalShareRoles",tr(S)),ni("versionsLoading",B(()=>se.isRunning)),(Q,ie)=>e.isOpen?(X(),Te(uS,$t({key:0,ref:"sidebar",class:"files-side-bar z-30","is-open":e.isOpen,"active-panel":e.activePanel,"available-panels":Y.value,"panel-context":h.value,loading:v.value},Q.$attrs,{"data-custom-key-bindings-disabled":"true",onSelectPanel:O,onClose:W}),{rootHeader:ve(()=>[D.value?(X(),Te(Ud,{key:0,class:"px-2 pt-2","is-sub-panel-active":!1})):V.value?(X(),Te(jd,{key:1})):Re("",!0)]),subHeader:ve(()=>[D.value?(X(),Te(Ud,{key:0,class:"px-2 pt-2","is-sub-panel-active":!0})):V.value?(X(),Te(jd,{key:1})):Re("",!0)]),_:1},16,["is-open","active-panel","available-panels","panel-context","loading"])):Re("",!0)}}),aM=_e({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=cr(),{currentTheme:t}=Me.storeToRefs(e),n=le(),r=le(!0);return{confirmDisabled:r,onDateChanged:({date:o,error:s})=>{r.value=s||!o,n.value=o},currentTheme:t,dateTime:n}}}),lM={class:"flex justify-end items-center mt-2"};function cM(e,t,n,r,i,o){const s=Ee("oc-datepicker"),a=Ee("oc-button");return X(),pe(Be,null,[me(s,{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"]),fe("div",lM,[me(a,{class:"oc-modal-body-actions-cancel ml-2",onClick:t[0]||(t[0]=l=>e.$emit("cancel"))},{default:ve(()=>[kt(z.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),me(a,{disabled:e.confirmDisabled,class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:t[1]||(t[1]=l=>e.$emit("confirm",e.dateTime))},{default:ve(()=>[kt(z.toDisplayString(e.$gettext("Confirm")),1)]),_:1},8,["disabled"])])],64)}const uM=Ye(aM,[["render",cM]]),fM=_e({name:"UnsavedChangesModal",props:{modal:{type:Object,required:!0},closeCallback:{type:Function,required:!0}},emits:["cancel","confirm"],setup(e){const{removeModal:t}=ht();return{onClose:()=>{t(e.modal.id),e.closeCallback()}}}}),dM=["textContent"],pM={class:"flex justify-end items-center mt-4"},hM={class:"oc-modal-body-actions-grid"};function mM(e,t,n,r,i,o){const s=Ee("oc-button");return X(),pe(Be,null,[fe("span",{class:"inline-block mb-4",textContent:z.toDisplayString(e.$gettext("Your changes were not saved. Do you want to save them?"))},null,8,dM),t[2]||(t[2]=fe("div",{class:"my-4"},null,-1)),fe("div",pM,[fe("div",hM,[me(s,{class:"oc-modal-body-actions-cancel ml-2",onClick:t[0]||(t[0]=a=>e.$emit("cancel"))},{default:ve(()=>[kt(z.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),me(s,{class:"oc-modal-body-actions-secondary ml-2",onClick:e.onClose},{default:ve(()=>[kt(z.toDisplayString(e.$gettext("Don't Save")),1)]),_:1},8,["onClick"]),me(s,{class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:t[1]||(t[1]=a=>e.$emit("confirm"))},{default:ve(()=>[kt(z.toDisplayString(e.$gettext("Save")),1)]),_:1})])])],64)}const dS=Ye(fM,[["render",mM]]);var gM=/\s/;function yM(e){for(var t=e.length;t--&&gM.test(e.charAt(t)););return t}var vM=/^\s+/;function bM(e){return e&&e.slice(0,yM(e)+1).replace(vM,"")}var pS=NaN,wM=/^[-+]0x[0-9a-f]+$/i,SM=/^0b[01]+$/i,EM=/^0o[0-7]+$/i,TM=parseInt;function AM(e){if(typeof e=="number")return e;if(Js(e))return pS;if(rr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=rr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=bM(e);var n=SM.test(e);return n||EM.test(e)?TM(e.slice(2),n?2:8):wM.test(e)?pS:+e}const xM=["id"],RM=["textContent"],CM={key:3,class:"flex size-full"},hS=_e({__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}=Ie.useGettext(),r=ar(),{showMessage:i,showErrorMessage:o}=nt(),s=ds.useRouter(),a=Ht(),l=Ke(),u=gn(),{getResourceContext:c}=X0(),{selectedResources:p}=$d(),{dispatchModal:d}=ht(),m=at(),b=dt(),w=ze(),S=Cr(),y=ur(),{isSideBarOpen:g,sideBarActivePanel:v}=Sa(),{actions:h}=x0({appId:e.applicationId}),{actions:E}=nd(),{actions:T}=as(),{actions:R}=Od(),{actions:x}=Fd(),{actions:A}=ss(),N=B(()=>!!e.wrappedComponent.emits?.includes("update:resource")),W=le(),O=le(),D=le(""),V=le(""),L=le(!f(N)),te=le(),Y=le(!1),se=le(),he=le();let ae="",we=null;const{actions:Q}=k0({content:he}),ie=B(()=>!!e.wrappedComponent.emits?.includes("update:currentContent")),ce=$e=>!!Object.keys(e.wrappedComponent.props).includes($e),Ae=B(()=>f(he)!==f(se)),ee=$e=>{$e.preventDefault()};st(Ae,$e=>{$e?window.addEventListener("beforeunload",ee):window.removeEventListener("beforeunload",ee)});const{applicationConfig:F,closeApp:C,currentFileContext:q,getFileContents:K,getFileInfo:j,getUrlForResource:H,putFileContents:ge,replaceInvalidFileRoute:xe,revokeUrl:De,activeFiles:Oe,loadFolderForFileContext:Ce,isFolderLoading:Fe}=ew({applicationId:e.applicationId}),{applicationMeta:ye}=ed({applicationId:e.applicationId,appsStore:r}),We=B(()=>f(ye).meta?.fileSizeLimit),Ge=B(()=>{const{name:$e}=f(ye);return t("%{appName} for %{fileName}",{appName:t($e),fileName:f(f(q).fileName)})}),Qe=Aa("driveAliasAndItem"),Xe=tn("fileId"),lt=B(()=>Ct(f(Xe))),Et=async()=>{const $e=f(lt),{space:je,path:bt}=await c($e),U=je.getDriveAliasAndItem({path:bt});return re.isPersonalSpaceResource(je)?s.push({params:{...f(a).params,driveAliasAndItem:U},query:{...f(a).query,fileId:$e,contextRouteName:"files-spaces-generic",contextRouteParams:{driveAliasAndItem:ft.dirname(U)}}}):s.push({params:{...f(a).params,driveAliasAndItem:U},query:{...f(a).query,fileId:$e,contextRouteName:bt==="/"?"files-shares-with-me":"files-spaces-generic",...re.isShareSpaceResource(je)&&{shareId:je.id},contextRouteParams:{driveAliasAndItem:ft.dirname(U)},contextRouteQuery:{...re.isShareSpaceResource(je)&&{shareId:je.id}}}})},Bt=rn.useTask(function*($e){try{f(Qe)||(yield Et()),O.value=f(f(q).space);const je=yield j(f(q),{signal:$e});if(W.value=je,re.isShareSpaceResource(f(O))&&(f(W).remoteItemId=f(O).id,f(W).id===f(W).remoteItemId)){const bt=yield*re.call(Ks({graphClient:l.graphAuthenticated,spacesStore:m,space:f(O)}));bt&&(W.value={...je,...re.buildIncomingShareResource({graphRoles:S.graphRoles,driveItem:bt,serverUrl:b.serverUrl}),tags:je.tags})}w.initResourceList({currentFolder:null,resources:[f(W)]}),p.value=[f(W)]}catch(je){console.error(je),te.value=je,L.value=!1}}).restartable(),jt=rn.useTask(function*($e){try{const je=e.importResourceWithExtension(f(W));if(je){const bt=Ut.DateTime.local().toFormat("yyyyMMddHHmmss"),U=`${f(W).name}_${bt}.${je}`;if(!(yield l.webdav.copyFiles(f(O),f(W),f(O),{path:U},{signal:$e})))throw new Error(t("Importing failed"));W.value={path:U}}if(xe(q,f(W)))return;if(Y.value=![vm.Updateable,vm.FileUpdateable].some(bt=>(f(W).permissions||"").indexOf(bt)>-1),f(ce("currentContent"))){const bt=yield*re.call(K(q,{...e.fileContentOptions,signal:$e}));se.value=he.value=bt.body,D.value=bt.headers["OC-ETag"]}f(ce("url"))&&(V.value=yield H(f(O),f(W),{...e.urlForResourceOptions,signal:$e}))}catch(je){console.error(je),te.value=je}finally{L.value=!1}}).restartable();st(q,async()=>{f(N)?O.value=f(f(q).space):(await Bt.perform(),f(We)&&AM(f(W).size)>f(We)?d({title:t("File exceeds %{threshold}",{threshold:vn(f(We),n)}),message:t("%{resource} exceeds the recommended size of %{threshold} for editing, and may cause performance issues.",{resource:f(W).name,threshold:vn(f(We),n)}),confirmText:t("Continue"),onCancel:()=>{C()},onConfirm:()=>{jt.perform()}}):jt.perform())},{immediate:!0});const ct=$e=>{console.error($e),o({title:t("An error occurred"),desc:$e.message,errors:[$e]})},Ne=()=>{i({title:t("File autosaved")})},M=rn.useTask(function*(){const $e=f(he);try{const je=yield ge(q,{content:$e,previousEntityTag:f(D)});se.value=$e,D.value=je.etag,w.upsertResource(je)}catch(je){switch(je.statusCode){case 401:case 403:ct(new re.HttpError(t("You're not authorized to save this file"),je.response));break;case 409:case 412:ct(new re.HttpError(t("This file was updated outside this window. Please copy your changes or save the file under a new name (»Save As...«)."),je.response));break;case 507:const bt=m.spaces.find(U=>U.id===f(W).storageId&&re.isProjectSpaceResource(U));if(bt){ct(new re.HttpError(t('Insufficient quota on "%{spaceName}" to save this file',{spaceName:bt.name}),je.response));break}ct(new re.HttpError(t("Insufficient quota for saving this file"),je.response));break;default:ct(new re.HttpError("",je.response))}}}).drop(),k=async()=>{await M.perform()};let I=null;Lt(()=>{if(ae=y.subscribe("runtime.resource.deleted",Pe),w.ancestorMetaData?.["/"]&&f(O)&&w.ancestorMetaData["/"].spaceId!==f(O).id&&w.setAncestorMetaData({}),!f(ie))return;const $e=b.options.editor;$e.autosaveEnabled&&!e.disableAutoSave&&(I=setInterval(async()=>{Ae.value&&(await k(),Ne())},($e.autosaveInterval||120)*1e3))}),An(()=>{y.unsubscribe("runtime.resource.deleted",ae),u.isLoading||window.removeEventListener("beforeunload",ee),f(ce("url"))&&De(V.value),f(ie)&&(clearInterval(I),I=null)});const{bindKeyAction:J}=Oa({skipDisabledKeyBindingsCheck:!0});J({modifier:Ia.Ctrl,primary:fr.S},()=>{f(Ae)&&k()});const G=B(()=>[{name:"save-file",disabledTooltip:()=>"",isVisible:()=>f(ie)&&!f(Y),isDisabled:()=>!f(Ae),icon:"save",id:"app-save-action",label:()=>t("Save"),handler:k}]),oe=B(()=>({space:f(O),resources:[f(W)]})),ne=async($e,je)=>{f(Ae)&&(await k(),Ne()),je($e)},Pe=$e=>{if($e.find(bt=>bt.id===f(W).id)){if(we)return we();C()}},Le=B(()=>[...f(h),...f(G),...f(Q).map($e=>({...$e,isVisible:je=>ie.value&&$e.isVisible(je)}))].filter($e=>$e.isVisible(f(oe)))),qe=B(()=>[...f(x),...f(E)].filter($e=>$e.isVisible(f(oe)))),Ze=B(()=>[...f(T).map($e=>({...$e,handler:je=>ne(je,$e.handler)})),...f(A)].filter($e=>$e.isVisible(f(oe)))),et=B(()=>[...f(R)].filter($e=>$e.isVisible(f(oe)))),Dr=B(()=>{const $e=[];return f(Le).length&&$e.push({name:"context",items:f(Le)}),f(qe).length&&$e.push({name:"share",items:f(qe)}),f(Ze).length&&$e.push({name:"actions",items:f(Ze)}),f(et).length&&$e.push({name:"sidebar",items:f(et)}),$e}),qt=B(()=>[...f(G)]);ds.onBeforeRouteLeave(($e,je,bt)=>{f(Ae)?d({title:t("Unsaved changes"),customComponent:dS,focusTrapInitial:".oc-modal-body-actions-confirm",hideActions:!0,customComponentAttrs:()=>({closeCallback:()=>{bt()}}),async onConfirm(){await k(),bt()}}):bt()});const Nr=B(()=>({url:f(V),space:f(f(q).space),resource:f(W),activeFiles:f(Oe),isDirty:f(Ae),isReadOnly:f(Y),applicationConfig:f(F),currentFileContext:f(q),currentContent:f(he),isFolderLoading:f(Fe),"onUpdate:resource":$e=>{O.value=f(f(q).space),W.value={...$e,...re.isShareSpaceResource(f(O))&&{remoteItemId:f(O).id}},p.value=[f(W)]},"onUpdate:currentContent":$e=>{he.value=$e},"onRegister:onDeleteResourceCallback":$e=>{we=$e},"onDelete:resource":()=>{f(A)[0].isVisible({space:f(O),resources:[f(W)]})&&f(A)[0].handler({space:f(O),resources:[f(W)]})},onSave:k,onClose:C,loadFolderForFileContext:Ce,revokeUrl:De,getUrlForResource:H}));return($e,je)=>(X(),pe("main",{id:e.applicationId,class:"app-wrapper h-full",onKeydown:je[0]||(je[0]=bo((...bt)=>f(C)&&f(C)(...bt),["esc"]))},[fe("h1",{class:"sr-only",textContent:z.toDisplayString(Ge.value)},null,8,RM),!L.value&&!te.value&&W.value?(X(),Te(cS,{key:0,"main-actions":qt.value,"drop-down-menu-sections":Dr.value,"drop-down-action-options":oe.value,"has-auto-save":!e.disableAutoSave,"is-editor":ie.value,resource:W.value,"is-read-only":Y.value,onClose:f(C)},null,8,["main-actions","drop-down-menu-sections","drop-down-action-options","has-auto-save","is-editor","resource","is-read-only","onClose"])):Re("",!0),L.value?(X(),Te(Q$,{key:1})):te.value?(X(),Te(z$,{key:2,message:te.value.message},null,8,["message"])):(X(),pe("div",CM,[Ue($e.$slots,"default",$t({class:["app-wrapper-content size-full",{"w-[calc(100%-440px)] hidden xs:block":f(g)}]},Nr.value)),me(fS,{"is-open":f(g),"active-panel":f(v),space:O.value},null,8,["is-open","active-panel","space"])]))],40,xM))}});function kM(e,t){return _e({render(){return Ll(hS,{wrappedComponent:e,...t},{default:n=>Ll(e,n)})}})}const Vd=_e({__name:"ContextMenuQuickAction",props:{item:{},resourceDomSelector:{type:Function,default:e=>re.extractDomSelector(e.id)},title:{default:""}},emits:["quickActionClicked"],setup(e){const{$gettext:t}=Ie.useGettext(),n=B(()=>t("Show context menu"));return(r,i)=>{const o=Ee("oc-icon"),s=Ee("oc-drop"),a=Ee("oc-button"),l=sn("oc-tooltip");return ot((X(),Te(a,{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:i[0]||(i[0]=Wt(u=>r.$emit("quickActionClicked",{event:u,dropdown:r.$refs[`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`]}),["stop","prevent"]))},{default:ve(()=>[me(o,{name:"more-2"}),me(s,{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:ve(()=>[Ue(r.$slots,"contextMenu",{item:e.item})]),_:3},8,["drop-id","toggle","title"])]),_:3},8,["id","data-test-context-menu-resource-name","aria-label"])),[[l,n.value]])}}}),PM=_e({name:"ResourceGhostElement",components:{ResourceIcon:is},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}}}),IM={id:"ghost-element",class:"z-[var(--z-index-modal)] absolute pt-1 pl-4 bg-transparent"},OM={class:"relative rounded-sm bg-role-surface-container-high"},FM={key:0,class:"-z-10 absolute top-[3px] left-[3px] right-[-3px] bottom-[-3px] rounded-sm bg-role-surface-container-high brightness-82"},_M={key:1,class:"-z-20 absolute top-[6px] left-[6px] right-[-6px] bottom-[-6px] rounded-sm bg-role-surface-container-high brightness-72"},DM={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 NM(e,t,n,r,i,o){const s=Ee("resource-icon");return X(),pe("div",IM,[fe("div",OM,[me(s,{class:"p-1",resource:e.previewItems[0]},null,8,["resource"]),e.showSecondLayer?(X(),pe("div",FM)):Re("",!0),e.showThirdLayer?(X(),pe("div",_M)):Re("",!0)]),fe("span",DM,z.toDisplayString(e.itemCount),1)])}const qd=Ye(PM,[["render",NM]]),LM=_e({name:"ResourceSize",props:{size:{type:[String,Number],required:!0}},setup:e=>{const{current:t}=Ie.useGettext();return{formattedSize:B(()=>vn(e.size,t))}}}),$M=["textContent"];function MM(e,t,n,r,i,o){return X(),pe("span",{textContent:z.toDisplayString(e.formattedSize)},null,8,$M)}const mS=Ye(LM,[["render",MM]]),gS=_e({__name:"ResourceStatusIndicators",props:{resource:{},space:{default:()=>{}},filter:{type:Function,default:void 0}},setup(e){const t=Fl(),n=vt(),r=ze(),{interceptModifierClick:i}=gi(),o=B(()=>{const s=lb({space:e.space,resource:e.resource,ancestorMetaData:r.ancestorMetaData,user:n.user,interceptModifierClick:i});return e.filter?s.filter(e.filter):s});return(s,a)=>o.value.length>0?(X(),Te(f(kN),$t({key:0},f(t),{indicators:o.value,resource:e.resource}),null,16,["indicators","resource"])):Re("",!0)}}),rl=_e({__name:"UserAvatar",props:{userId:{},userName:{}},setup(e){const t=Ea(),{avatarMap:n}=Me.storeToRefs(t),{enqueueAvatar:r}=iS(),i=B(()=>f(n)[e.userId]);return Lt(()=>{r(e.userId)}),(o,s)=>{const a=Ee("oc-avatar");return X(),Te(a,{"user-name":e.userName,src:i.value,width:36},null,8,["user-name","src"])}}}),BM={class:z.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"])},jM={class:"flex flex-col items-center"},UM={class:"oc-button-group"},VM={key:0},qM=["src"],zM={class:"text-sm text-role-on-surface-variant flex items-center mt-1"},WM=["textContent"],HM=_e({__name:"AvatarUpload",setup(e){const t=vt(),n=Ea(),{avatarMap:r}=Me.storeToRefs(n),{user:i}=Me.storeToRefs(t),{$gettext:o}=Ie.useGettext(),{showErrorMessage:s,showMessage:a}=nt(),{graphAuthenticated:l}=Ke(),{setCropperInstance:u}=td(),c=le(null),p=le(null),d=le(null),m=le(!1),b=le(!1),w=le(!1),S=le(null),y=xd*1024*1024,g=B(()=>!!f(r)[f(i).id]),v=W=>{const D=W.target.files?.[0];if(D){if(D.size>y){s({title:o("File size exceeds the limit of %{size}MB",{size:xd.toString()})});return}c.value=URL.createObjectURL(D),b.value=!0}};st(c,async W=>{W&&(await zt(),d.value&&d.value.destroy(),p.value&&(d.value=new il(p.value,{aspectRatio:1,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1,ready(){m.value=!0}}),u(d)))});const h=()=>d.value.getCroppedCanvas({width:256,height:256,imageSmoothingQuality:"high"}),E=async W=>await new Promise(O=>{W.toBlob(D=>O(D),"image/png")}),T=()=>{S.value?.click()},R=()=>{b.value=!1,N()},x=async()=>{const W=h(),O=await E(W),D=URL.createObjectURL(O),V=new File([O],"avatar.png",{type:"image/png",lastModified:Date.now()});try{await l.photos.updateOwnUserPhotoPatch(V),n.addAvatar(f(i).id,D),a({title:o("Profile picture was set successfully")})}catch(L){s({title:o("Failed to set profile picture"),errors:[L]})}b.value=!1,N()},A=async()=>{try{await l.photos.deleteOwnUserPhoto(),n.removeAvatar(f(i).id),a({title:o("Profile picture was removed successfully")})}catch(W){s({title:o("Failed to remove profile picture"),errors:[W]})}w.value=!1},N=()=>{d.value?.destroy(),d.value=null,S.value&&(S.value.value=""),c.value=null};return(W,O)=>{const D=Ee("oc-button"),V=Ee("oc-icon"),L=Ee("oc-modal");return X(),pe("div",BM,[fe("input",{ref_key:"fileInputRef",ref:S,class:"invisible avatar-file-input",type:"file",accept:"image/jpeg, image/png",onChange:v},null,544),fe("div",jM,[me(rl,{class:"mb-4",width:128,"user-id":f(i).id,"user-name":f(i).displayName},null,8,["user-id","user-name"]),fe("div",null,[fe("div",UM,[me(D,{size:"small",onClick:T},{default:ve(()=>[kt(z.toDisplayString(f(o)("Upload")),1)]),_:1}),g.value?(X(),Te(D,{key:0,class:"avatar-upload-remove-button",size:"small",onClick:O[0]||(O[0]=te=>w.value=!0)},{default:ve(()=>[kt(z.toDisplayString(f(o)("Remove")),1)]),_:1})):Re("",!0)])])]),b.value?(X(),Te(L,{key:0,title:f(o)("Crop your new profile picture"),"button-cancel-text":f(o)("Cancel"),"button-confirm-text":f(o)("Set"),"button-confirm-disabled":!m.value,"focus-trap-initial":!1,onCancel:R,onConfirm:x},{content:ve(()=>[c.value?(X(),pe("div",VM,[fe("img",{ref_key:"imageRef",ref:p,class:"max-h-[400px]",src:c.value},null,8,qM),fe("div",zM,[me(V,{class:"mr-1",name:"information",size:"small","fill-type":"line"}),fe("span",{textContent:z.toDisplayString(f(o)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:f(o)("+-"),panKeys:f(o)("↑↓←→")}))},null,8,WM)])])):Re("",!0)]),_:1},8,["title","button-cancel-text","button-confirm-text","button-confirm-disabled"])):Re("",!0),w.value?(X(),Te(L,{key:1,message:f(o)("Are you sure you want to remove your profile picture?"),title:f(o)("Remove profile picture"),"button-cancel-text":f(o)("Cancel"),"button-confirm-text":f(o)("Remove"),onCancel:O[1]||(O[1]=te=>w.value=!1),onConfirm:A},null,8,["message","title","button-cancel-text","button-confirm-text"])):Re("",!0)])}}}),KM={class:"resource-table-select-all flex justify-center items-center"},GM={class:"truncate"},QM=["textContent"],XM=["textContent"],YM=["textContent"],JM={key:0,class:"flex items-center justify-end flex-row flex-nowrap"},ZM=850,eB=_e({__name:"ResourceTable",props:{resources:{},resourceDomSelector:{type:Function,default:e=>re.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},isSideBarOpen:{type:Boolean,default:!1},dragDrop:{type:Boolean,default:!1},viewMode:{default:()=>nn.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=He(),i=en(),{getMatchingSpace:o}=ln(),{interceptModifierClick:s}=gi(),{getParentFolderLink:a,getParentFolderLinkIconAdditionalAttributes:l,getParentFolderName:u,getPathPrefix:c}=Yr({space:le(e.space)}),{isSticky:p}=_d(),{$gettext:d,$ngettext:m,current:b}=Ie.useGettext(),{isLocationPicker:w,isFilePicker:S}=Qr(),{selectedResources:y,disabledResources:g,isResourceSelected:v,fileContainerClicked:h,fileNameClicked:E,fileCheckboxClicked:T,isResourceDisabled:R,isResourceInDeleteQueue:x,isResourceClickable:A,isResourceCut:N,getResourceLink:W,dragItem:O,dragSelection:D,dragStart:V,fileDropped:L,setDropStyling:te,shouldShowContextDrop:Y,showContextMenuOnRightClick:se,showContextMenuOnBtnClick:he,selectAllCheckboxLabel:ae,getResourceCheckboxLabel:we,toggleSelectionAll:Q,areAllResourcesSelected:ie}=Ld({space:B(()=>e.space),resources:B(()=>e.resources),selectedIds:B(()=>e.selectedIds),emit:n}),ce=li(),{userContextReady:Ae}=Me.storeToRefs(ce),ee=ze(),{areFileExtensionsShown:F,latestSelectedId:C}=Me.storeToRefs(ee),{width:q}=Yn.useWindowSize(),K=B(()=>i.filesTags&&q.value>=ZM),{actions:j}=Ya(),{actions:H}=V0(),ge=B(()=>f(j)[0].handler),xe=B(()=>f(H)[0].handler),De=Ne=>d("Search for tag %{tag}",{tag:Ne}),Oe=B(()=>{if(e.resources.length===0)return[];const Ne=e.resources[0],M=[];e.isSelectable&&M.push({name:"select",title:"",type:"slot",headerType:"slot",width:"shrink"});const k=dm(Ne);return M.push(...[{name:"name",title:d("Name"),type:"slot",width:"expand",wrap:"truncate"},{name:"manager",prop:"members",title:d("Manager"),type:"slot"},{name:"members",title:d("Members"),prop:"members",type:"slot"},{name:"totalQuota",prop:"spaceQuota.total",title:d("Total quota"),type:"slot",sortable:!0},{name:"usedQuota",prop:"spaceQuota.used",title:d("Used quota"),type:"slot",sortable:!0},{name:"remainingQuota",prop:"spaceQuota.remaining",title:d("Remaining quota"),type:"slot",sortable:!0},{name:"indicators",title:d("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"size",title:d("Size"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"syncEnabled",title:d("Info"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"tags",title:d("Tags"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedBy",title:d("Shared by"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedWith",title:d("Shared with"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"mdate",title:d("Modified"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:I=>lt(I.mdate)+" ("+Xe(I.mdate)+")"},{name:"sdate",title:d("Shared on"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:I=>lt(I.sdate)+" ("+Xe(I.sdate)+")"},{name:"ddate",title:d("Deleted"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:I=>lt(I.ddate)+" ("+Xe(I.ddate)+")"}].filter(I=>{if(I.name==="tags"&&!f(K))return!1;if(I.name==="indicators")return!0;let J;return I.prop?J=Ec(Ne,I.prop)!==void 0:J=Object.prototype.hasOwnProperty.call(Ne,I.name),e.fieldsDisplayed?J&&e.fieldsDisplayed.includes(I.name):J}).map(I=>{const J=k.find(G=>G.name===I.name);return J&&Object.assign(I,{sortable:J.sortable,sortDir:J.sortDir}),I})),e.hasActions&&M.push({name:"actions",title:d("Actions"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"}),M}),Ce=Ne=>{const M=f(r.currentRoute).query?.term;return $i("files-common-search",{query:{provider:"files.sdk",q_tags:Ne,...M&&{term:M}}})},Fe=Ne=>f(Ae)?{to:Ce(Ne)}:{},ye=Ne=>Ne.id===f(C),We=Ne=>e.showRenameQuickAction?re.isProjectSpaceResource(Ne)?f(H).filter(M=>M.isVisible({resources:[Ne]})).length:f(j).filter(M=>M.isVisible({space:e.space,resources:[Ne]})).length:!1,Ge=Ne=>{if(re.isProjectSpaceResource(Ne))return f(xe)({resources:[Ne]});f(ge)({space:o(Ne),resources:[Ne]})},Qe=()=>{Je.publish(Rt.open)},Xe=Ne=>nb(new Date(Ne),b),lt=Ne=>ib(new Date(Ne),b),Et=Ne=>{if(!re.isShareResource(Ne))return;const M=Ne.type==="folder"?d("folder"):d("file"),k=Ne.sharedWith.filter(({shareType:I})=>re.ShareTypes.authenticated.includes(re.ShareTypes.getByValue(I))).length;return k?m("This %{ resourceType } is shared via %{ shareCount } invite","This %{ resourceType } is shared via %{ shareCount } invites",k,{resourceType:M,shareCount:k.toString()}):""},Bt=Ne=>{if(!re.isShareResource(Ne))return"";const M=Ne.type==="folder"?d("folder"):d("file");return d("This %{ resourceType } is shared by %{ user }",{resourceType:M,user:Ne.sharedBy.map(({displayName:k})=>k).join(", ")})},jt=Ne=>re.isShareResource(Ne)?Ne.sharedBy.map(M=>({displayName:M.displayName,name:M.displayName,avatarType:re.ShareTypes.user.key,username:M.id,userId:M.id})):[],ct=Ne=>re.isShareResource(Ne)?Ne.sharedWith.filter(({shareType:M})=>re.ShareTypes.authenticated.includes(re.ShareTypes.getByValue(M))).map(M=>({displayName:M.displayName,name:M.displayName,avatarType:re.ShareTypes.getByValue(M.shareType).key,username:M.id,userId:M.id})):[];return(Ne,M)=>{const k=Ee("oc-checkbox"),I=Ee("oc-icon"),J=Ee("oc-tag"),G=Ee("oc-avatars"),oe=sn("oc-tooltip");return X(),pe(Be,null,[me(f(UN),$t(Ne.$attrs,{id:"files-space-table",class:[{condensed:e.viewMode===f(nn).name.condensedTable,"files-table":e.resourceType==="file","files-table-squashed":e.resourceType==="file"&&e.isSideBarOpen,"spaces-table":e.resourceType==="space","spaces-table-squashed":e.resourceType==="space"&&e.isSideBarOpen}],data:e.resources,fields:Oe.value,highlighted:e.selectedIds,disabled:f(g),sticky:f(p),"header-position":e.headerPosition,"drag-drop":e.dragDrop,hover:e.hover,"item-dom-selector":e.resourceDomSelector,selection:f(y),"sort-by":e.sortBy,"sort-dir":e.sortDir,lazy:e.lazy,"padding-x":"medium",onHighlight:M[1]||(M[1]=ne=>f(h)({resource:ne[0],event:ne[1]})),onContextmenuClicked:M[2]||(M[2]=(ne,Pe,Le)=>f(se)(Pe,Le)),onItemDropped:M[3]||(M[3]=ne=>f(L)(ne[0],ne[1])),onItemDragged:M[4]||(M[4]=ne=>f(V)(ne[0],ne[1])),onDropRowStyling:f(te),onSort:M[5]||(M[5]=ne=>Ne.$emit("sort",ne)),"onUpdate:modelValue":M[6]||(M[6]=ne=>Ne.$emit("update:modelValue",ne))}),jp({name:ve(({item:ne})=>[fe("div",{class:z.normalizeClass(["resource-table-resource-wrapper flex items-center",[{"resource-table-resource-wrapper-limit-max-width":We(ne)}]])},[Ue(Ne.$slots,"image",{resource:ne}),(X(),Te(os,{key:`${ne.path}-${e.resourceDomSelector(ne)}-${ne.thumbnail}`,resource:ne,"path-prefix":f(c)(ne),"is-path-displayed":e.arePathsDisplayed,"parent-folder-name":f(u)(ne),"is-icon-displayed":!Ne.$slots.image,"is-extension-displayed":f(F),"is-resource-clickable":f(A)(ne,e.areResourcesClickable),link:f(W)(ne),"parent-folder-link":f(a)(ne),"parent-folder-link-icon-additional-attributes":f(l)(ne),class:z.normalizeClass({"opacity-60":f(N)(ne)}),onClick:Wt(Pe=>f(E)({resource:ne,event:Pe}),["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"])),We(ne)?(X(),Te(f(wn),{key:0,class:"resource-table-edit-name inline-flex raw-hover-surface p-1 ml-1",appearance:"raw","aria-label":f(d)("Rename file »%{name}«",{name:ne.name}),title:f(d)("Rename"),onClick:Wt(Pe=>{f(s)(Pe,ne)||Ge(ne)},["stop"])},{default:ve(()=>[me(I,{name:"edit-2","fill-type":"line",size:"small",color:"var(--oc-role-on-surface)"})]),_:1},8,["aria-label","title","onClick"])):Re("",!0)],2),Ue(Ne.$slots,"additionalResourceContent",{resource:ne})]),syncEnabled:ve(({item:ne})=>[Ue(Ne.$slots,"syncEnabled",{resource:ne})]),size:ve(({item:ne})=>[me(mS,{size:ne.size||Number.NaN},null,8,["size"])]),tags:ve(({item:ne})=>[(X(!0),pe(Be,null,mt(ne.tags.slice(0,2),Pe=>(X(),Te(Pn(f(Ae)?"router-link":"span"),$t({key:Pe},{ref_for:!0},Fe(Pe),{class:"resource-table-tag-wrapper"}),{default:ve(()=>[ot((X(),Te(J,{class:"resource-table-tag ml-1 max-w-20",rounded:!0,size:"small"},{default:ve(()=>[me(I,{name:"price-tag-3",size:"small"}),fe("span",GM,z.toDisplayString(Pe),1)]),_:2},1024)),[[oe,De(Pe)]])]),_:2},1040))),128)),ne.tags.length>2?(X(),Te(J,{key:0,size:"small",class:"resource-table-tag-more align-text-bottom cursor-pointer",onClick:M[0]||(M[0]=Pe=>Qe())},{default:ve(()=>[kt(" + "+z.toDisplayString(ne.tags.length-2),1)]),_:2},1024)):Re("",!0)]),manager:ve(({item:ne})=>[Ue(Ne.$slots,"manager",{resource:ne})]),members:ve(({item:ne})=>[Ue(Ne.$slots,"members",{resource:ne})]),totalQuota:ve(({item:ne})=>[Ue(Ne.$slots,"totalQuota",{resource:ne})]),usedQuota:ve(({item:ne})=>[Ue(Ne.$slots,"usedQuota",{resource:ne})]),remainingQuota:ve(({item:ne})=>[Ue(Ne.$slots,"remainingQuota",{resource:ne})]),mdate:ve(({item:ne})=>[ot(fe("span",{tabindex:"0",textContent:z.toDisplayString(lt(ne.mdate))},null,8,QM),[[oe,Xe(ne.mdate)]])]),indicators:ve(({item:ne})=>[me(gS,{space:e.space,resource:ne,"disable-handler":f(R)(ne)},null,8,["space","resource","disable-handler"])]),sdate:ve(({item:ne})=>[ot(fe("span",{tabindex:"0",textContent:z.toDisplayString(lt(ne.sdate))},null,8,XM),[[oe,Xe(ne.sdate)]])]),ddate:ve(({item:ne})=>[ot(fe("p",{tabindex:"0",class:"m-0",textContent:z.toDisplayString(lt(ne.ddate))},null,8,YM),[[oe,Xe(ne.ddate)]])]),sharedBy:ve(({item:ne})=>[me(G,{class:"flex items-center justify-end flex-row flex-nowrap","is-tooltip-displayed":!0,items:jt(ne),"accessible-description":Bt(ne),"hover-effect":""},{userAvatars:ve(({avatars:Pe,width:Le})=>[(X(!0),pe(Be,null,mt(Pe,qe=>(X(),Te(f(rl),{key:qe.userId,"user-id":qe.userId,"user-name":qe.displayName,width:Le},null,8,["user-id","user-name","width"]))),128))]),_:1},8,["items","accessible-description"])]),sharedWith:ve(({item:ne})=>[me(G,{class:"flex items-center justify-end flex-row flex-nowrap","data-testid":"resource-table-shared-with",items:ct(ne),stacked:!0,"max-displayed":3,"is-tooltip-displayed":!0,"accessible-description":Et(ne),"hover-effect":""},{userAvatars:ve(({avatars:Pe,width:Le})=>[(X(!0),pe(Be,null,mt(Pe,qe=>(X(),Te(f(rl),{key:qe.userId,"user-id":qe.userId,"user-name":qe.displayName,width:Le},null,8,["user-id","user-name","width"]))),128))]),_:1},8,["items","accessible-description"])]),actions:ve(({item:ne})=>[f(Y)(ne)?(X(),pe("div",JM,[Ue(Ne.$slots,"quickActions",{resource:ne}),me(Vd,{title:ne.name,item:ne,"resource-dom-selector":e.resourceDomSelector,class:"resource-table-btn-action-dropdown",onQuickActionClicked:Pe=>f(he)(Pe,ne)},{contextMenu:ve(()=>[Ue(Ne.$slots,"contextMenu",{resource:ne})]),_:2},1032,["title","item","resource-dom-selector","onQuickActionClicked"])])):Re("",!0)]),_:2},[!f(w)&&!f(S)?{name:"selectHeader",fn:ve(()=>[fe("div",KM,[ot(me(k,{id:"resource-table-select-all",size:"large",label:f(ae),disabled:e.resources.length===f(g).length,"label-hidden":!0,"model-value":f(ie),onClick:Wt(f(Q),["stop"])},null,8,["label","disabled","model-value","onClick"]),[[oe,{content:f(ae),placement:"bottom"}]])])]),key:"0"}:void 0,!f(w)&&!f(S)?{name:"select",fn:ve(({item:ne})=>[f(x)(ne.id)?(X(),Te(f(xN),{key:0,class:"inline-flex ml-1",size:"medium","aria-label":f(d)("File is being processed")},null,8,["aria-label"])):(X(),Te(k,{key:1,id:`resource-table-select-${e.resourceDomSelector(ne)}`,label:f(we)(ne),"label-hidden":!0,size:"large",disabled:f(R)(ne),"model-value":f(v)(ne),outline:ye(ne),"data-test-selection-resource-name":ne.name,"data-test-selection-resource-path":ne.path,onClick:Wt(Pe=>f(T)({resource:ne,event:Pe}),["stop"])},null,8,["id","label","disabled","model-value","outline","data-test-selection-resource-name","data-test-selection-resource-path","onClick"]))]),key:"1"}:void 0,Ne.$slots.footer?{name:"footer",fn:ve(()=>[Ue(Ne.$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"]),f(O)?(X(),Te(Dp,{key:0,to:"body"},[me(qd,{ref:"ghostElement","preview-items":[f(O),...f(D)]},null,8,["preview-items"])])):Re("",!0)],64)}}}),tB={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"},nB={class:"z-10 absolute top-0 left-0 [&_input]:not-[.oc-checkbox-checked]:bg-role-surface-container"},rB={key:0,class:"oc-tile-card-loading-spinner z-990 m-2"},iB=["textContent"],oB=["aria-label"],sB={class:"flex justify-between items-center"},aB={class:"flex items-center truncate resource-name-wrapper text-role-on-surface overflow-hidden"},lB={class:"flex items-center"},cB={key:0,class:"text-left my-0 truncate"},uB=["textContent"],yS=_e({__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}=Ie.useGettext(),{getParentFolderName:i,getParentFolderLink:o}=Yr({space:le(e.space)}),s=Tn("observerTarget"),a=B(()=>f(s)?.$el),l=B(()=>e.resource.locked||e.resource.processing),u=B(()=>e.resource.locked?{name:"lock",fillType:"fill"}:e.resource.processing?{name:"loop-right",fillType:"line"}:{}),c=B(()=>e.resource.locked?r("This item is locked"):null),p=B(()=>re.isSpaceResource(e.resource)?e.resource.description:""),{isVisible:d}=e.lazy?yw({target:a,onVisibleCallback:()=>n("itemVisible")}):{isVisible:le(!0)},m=B(()=>!f(d));return e.lazy||n("itemVisible"),(b,w)=>{const S=Ee("oc-spinner"),y=Ee("oc-tag"),g=Ee("oc-image"),v=Ee("oc-icon"),h=sn("oc-tooltip");return X(),Te(f(sd),{ref_key:"observerTarget",ref:s,"body-class":"p-0",class:z.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&&!f(re.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&&f(re.isProjectSpaceResource)(e.resource)}]),"data-item-id":e.resource.id,onContextmenu:w[4]||(w[4]=E=>b.$emit("contextmenu",E))},{default:ve(()=>[m.value?(X(),pe("div",tB)):(X(),pe(Be,{key:1},[me(Ha,{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:w[1]||(w[1]=E=>b.$emit("fileNameClicked",E))},{default:ve(()=>[fe("div",nB,[e.isLoading?(X(),pe("div",rB,[me(S,{"aria-label":f(r)("File is being processed")},null,8,["aria-label"])])):Ue(b.$slots,"selection",{key:1,item:e.resource})]),e.isResourceDisabled&&f(re.isProjectSpaceResource)(e.resource)?(X(),Te(y,{key:0,class:"z-10 absolute text-role-on-surface",type:"span"},{default:ve(()=>[fe("span",{textContent:z.toDisplayString(f(r)("Disabled"))},null,8,iB)]),_:1})):Re("",!0),ot((X(),pe("div",{class:z.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},[Ue(b.$slots,"imageField",{item:e.resource},()=>[e.resource.thumbnail?(X(),Te(g,{key:0,class:z.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:w[0]||(w[0]=Wt(E=>b.$emit("tileClicked",[e.resource,E]),["stop"]))},null,8,["class","src","data-test-thumbnail-resource-name"])):(X(),Te(is,{key:1,resource:e.resource,size:e.resourceIconSize,class:"tile-default-image pt-1 relative"},jp({_:2},[l.value?{name:"status",fn:ve(()=>[me(v,$t(u.value,{size:"xsmall"}),null,16)]),key:"0"}:void 0]),1032,["resource","size"]))])],10,oB)),[[h,c.value]])]),_:3},8,["resource","link","is-resource-clickable"]),fe("div",{class:"p-2",onClick:w[3]||(w[3]=Wt(E=>b.$emit("tileClicked",[e.resource,E]),["stop"]))},[fe("div",sB,[fe("div",aB,[me(os,{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":f(i)(e.resource),"parent-folder-link":f(o)(e.resource),link:e.resourceRoute,onClick:w[2]||(w[2]=Wt(E=>b.$emit("fileNameClicked",E),["stop"]))},null,8,["resource","is-extension-displayed","is-resource-clickable","is-path-displayed","parent-folder-name","parent-folder-link","link"])]),fe("div",lB,[Ue(b.$slots,"indicators",{item:e.resource,class:"resource-indicators"}),Ue(b.$slots,"actions",{item:e.resource}),Ue(b.$slots,"contextMenu",{item:e.resource})])]),p.value?(X(),pe("p",cB,[fe("span",{class:"text-sm",textContent:z.toDisplayString(p.value)},null,8,uB)])):Re("",!0),Ue(b.$slots,"additionalResourceContent",{item:e.resource})])],64))]),_:3},8,["data-item-id","class"])}}}),fB={id:"tiles-view",class:"px-4 pt-2"},dB={class:"flex items-center mb-2 pb-2 oc-tiles-controls"},pB={key:1,class:"oc-tiles-sort"},hB={key:0,class:"flex"},mB={class:"p-1 text-sm"},gB=Ye(_e({__name:"ResourceTiles",props:{resources:{default:()=>[]},selectedIds:{default:()=>[]},isSelectable:{type:Boolean,default:!0},space:{},sortFields:{default:()=>[]},sortBy:{},sortDir:{},viewSize:{default:()=>nn.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}=Ie.useGettext(),i=ze(),{areFileExtensionsShown:o}=Me.storeToRefs(i),{isLocationPicker:s,isFilePicker:a}=Qr(),l=Dd(),u=B(()=>Math.min(f(l),e.viewSize)),{isSideBarOpen:c}=Sa(),{disabledResources:p,isResourceSelected:d,fileContainerClicked:m,fileNameClicked:b,fileCheckboxClicked:w,isResourceDisabled:S,isResourceInDeleteQueue:y,isResourceClickable:g,isResourceCut:v,getResourceLink:h,dragItem:E,dragSelection:T,dragStart:R,fileDropped:x,setDropStyling:A,shouldShowContextDrop:N,showContextMenuOnRightClick:W,showContextMenuOnBtnClick:O,selectAllCheckboxLabel:D,getResourceCheckboxLabel:V,toggleSelectionAll:L,areAllResourcesSelected:te}=Ld({space:B(()=>e.space),resources:B(()=>e.resources),selectedIds:B(()=>e.selectedIds),emit:n}),Y=window.__E2E__===!0?!1:e.lazy,se=B(()=>e.sortFields.find(q=>q.name===e.sortBy&&q.sortDir===e.sortDir)||e.sortFields[0]),he=q=>{n("sort",{sortBy:q.name,sortDir:f(q.sortDir)})},ae=B(()=>{const q={1:"xlarge",2:"xlarge",3:"xxlarge",4:"xxlarge",5:"xxxlarge",6:"xxxlarge"},K=f(u);return q[K]??"xxlarge"}),we=le(0),Q=()=>{const q=document.getElementById("tiles-view"),K=getComputedStyle(q),j=parseInt(K.getPropertyValue("padding-left"),10)|0,H=parseInt(K.getPropertyValue("padding-right"),10)|0;we.value=q.clientWidth-j-H},ie=B(()=>parseFloat(getComputedStyle(document.documentElement).fontSize)),{calculateTileSizePixels:ce}=Y0(),Ae=B(()=>{const q=[...Array(nn.tilesSizeMax).keys()].map(K=>K+1);return[...new Set(q.map(K=>{const j=ce(K);return j?Math.round(f(we)/(j+f(ie))):0}))]}),ee=B(()=>{const q=f(Ae);return q.length<f(u)?q[q.length-1]:q[f(u)-1]}),F=B(()=>{const q=f(ee)?e.resources.length%f(ee):0;return q?f(ee)-q:0}),C=B(()=>f(we)/f(ee)-f(ie));return st(C,q=>{q&&!isNaN(q)&&document.documentElement.style.setProperty("--oc-size-tiles-actual",`${q}px`)},{immediate:!0}),st(Ae,q=>{l.value=Math.max(q.length,1)}),st(c,()=>{Q()}),Lt(()=>{window.addEventListener("resize",Q),Q()}),An(()=>{window.removeEventListener("resize",Q)}),(q,K)=>{const j=Ee("oc-checkbox"),H=Ee("oc-icon"),ge=Ee("oc-button"),xe=Ee("oc-list"),De=Ee("oc-filter-chip"),Oe=sn("oc-tooltip");return X(),pe("div",fB,[fe("div",dB,[e.isSelectable&&!f(a)?ot((X(),Te(j,{key:0,id:"tiles-view-select-all",class:"ml-2",size:"large",label:f(D),"label-hidden":!0,disabled:e.resources.length===f(p).length,"model-value":f(te),onClick:Wt(f(L),["stop"])},null,8,["label","disabled","model-value","onClick"])),[[Oe,f(D)]]):Re("",!0),e.sortFields.length?(X(),pe("div",pB,[me(De,{class:"[&_.oc-filter-chip-label]:text-sm","filter-label":f(r)("Sort by"),"selected-item-names":[se.value.label],"has-active-state":!1,"close-on-click":"",raw:""},{default:ve(()=>[me(xe,null,{default:ve(()=>[(X(!0),pe(Be,null,mt(e.sortFields,(Ce,Fe)=>(X(),pe("li",{key:Fe},[me(ge,{appearance:se.value===Ce?"filled":"raw-inverse","color-role":se.value===Ce?"secondaryContainer":"surface","no-hover":se.value===Ce,"justify-content":"space-between",class:"oc-tiles-sort-filter-chip-item",onClick:ye=>he(Ce)},{default:ve(()=>[fe("span",null,z.toDisplayString(Ce.label),1),Ce===se.value?(X(),pe("div",hB,[me(H,{name:"check"})])):Re("",!0)]),_:2},1032,["appearance","color-role","no-hover","onClick"])]))),128))]),_:1})]),_:1},8,["filter-label","selected-item-names"])])):Re("",!0)]),me(xe,{class:"oc-tiles grid justify-start gap-3"},{default:ve(()=>[(X(!0),pe(Be,null,mt(e.resources,Ce=>(X(),pe("li",{key:Ce.id,class:"oc-tiles-item has-item-context-menu"},[me(yS,{resource:Ce,space:e.space,"resource-route":f(h)(Ce),"is-resource-selected":f(d)(Ce),"is-resource-clickable":f(g)(Ce,e.areResourcesClickable),"is-resource-disabled":f(S)(Ce),"is-extension-displayed":f(o),"is-path-displayed":e.arePathsDisplayed,"resource-icon-size":ae.value,draggable:e.dragDrop,lazy:f(Y),"is-loading":f(y)(Ce.id),class:z.normalizeClass({"opacity-60":f(v)(Ce)}),onContextmenu:Fe=>f(W)(Fe,Ce),onFileNameClicked:Wt(Fe=>f(b)({resource:Ce,event:Fe}),["stop"]),onDragstart:Fe=>f(R)(Ce,Fe),onDragenter:Wt(Fe=>f(A)(Ce,!1,Fe),["prevent"]),onDragleave:Wt(Fe=>f(A)(Ce,!0,Fe),["prevent"]),onDrop:Fe=>f(x)(Ce,Fe),onDragover:K[0]||(K[0]=Fe=>Fe.preventDefault()),onItemVisible:Fe=>q.$emit("itemVisible",Ce),onTileClicked:Fe=>f(m)({resource:Ce,event:Fe[1]})},{selection:ve(()=>[e.isSelectable&&!f(s)&&!f(a)?(X(),Te(j,{key:0,label:f(V)(Ce),"label-hidden":!0,size:"large",class:"inline-flex p-2.5",disabled:f(S)(Ce),"model-value":f(d)(Ce),"data-test-selection-resource-name":Ce.name,"data-test-selection-resource-path":Ce.path,onClick:Wt(Fe=>f(w)({resource:Ce,event:Fe}),["stop","prevent"])},null,8,["label","disabled","model-value","data-test-selection-resource-name","data-test-selection-resource-path","onClick"])):Re("",!0)]),imageField:ve(()=>[Ue(q.$slots,"image",{resource:Ce},void 0,!0)]),indicators:ve(()=>[me(gS,{space:e.space,class:"ml-2",resource:Ce,filter:Fe=>["system","sharing"].includes(Fe.category),"disable-handler":f(S)(Ce)},null,8,["space","resource","filter","disable-handler"])]),actions:ve(()=>[Ue(q.$slots,"actions",{resource:Ce},void 0,!0)]),contextMenu:ve(()=>[f(N)(Ce)?(X(),Te(f(Vd),{key:0,item:Ce,title:Ce.name,class:"resource-tiles-btn-action-dropdown",onQuickActionClicked:Fe=>f(O)(Fe,Ce)},{contextMenu:ve(()=>[Ue(q.$slots,"contextMenu",{resource:Ce},void 0,!0)]),_:2},1032,["item","title","onQuickActionClicked"])):Re("",!0)]),additionalResourceContent:ve(()=>[Ue(q.$slots,"additionalResourceContent",{resource:Ce},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)),(X(!0),pe(Be,null,mt(F.value,Ce=>(X(),pe("li",{key:`ghost-tile-${Ce}`,class:"list-item","aria-hidden":!0}))),128))]),_:3}),f(E)?(X(),Te(Dp,{key:0,to:"body"},[me(qd,{ref:"ghostElement","preview-items":[f(E),...f(T)]},null,8,["preview-items"])])):Re("",!0),fe("div",mB,[Ue(q.$slots,"footer",{},void 0,!0)])])}}}),[["__scopeId","data-v-8d88c01d"]]),yB=_e({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=He(),{current:i}=Ie.useGettext(),o=Ht(),s=cr(),{currentTheme:a}=Me.storeToRefs(s),l=le(),u=le(e.items),c=le(),p=le(),d=le(!1),m=le(),b=`q_${e.filterName}`,w=tn(b),S=V=>V[e.idAttribute],y=()=>r.push({query:{...Hi(f(o).query,[b]),...f(l)&&{[b]:S(f(l))}}}),g=V=>f(l)&&S(f(l))===S(V),v=()=>{c.value=void 0,p.value=void 0},h=async V=>{v(),g(V)?l.value=void 0:(l.value=V,f(m).hideDrop()),await y(),t("selectionChange",f(l))},E=()=>{l.value=void 0,d.value=!1,v(),t("selectionChange",f(l)),y()},T=()=>{u.value=e.items},R=()=>{d.value=!1},x=()=>{const V=Ct(f(w));if(!V)return;const L=e.items.find(te=>S(te)===V);if(L){l.value=L;return}if(f(A)){const te=V.replace("range:",""),Y=Number(te.split(" - ")[0]),se=Number(te.split(" - ")[1]);c.value=Ut.DateTime.fromMillis(Y),p.value=Ut.DateTime.fromMillis(se),l.value=f(W)}},A=B(()=>Ct(f(w))?.startsWith("range:")),N=B(()=>!f(c)||!f(p)?!1:f(c)<=f(p)),W=B(()=>{if(!f(c)||!f(p))return null;const V=di(f(c),i,Ut.DateTime.DATE_SHORT),L=di(f(p),i,Ut.DateTime.DATE_SHORT),te=f(c).toMillis(),Y=f(p).toMillis();return{[e.idAttribute]:`range:${te} - ${Y}`,[e.displayNameAttribute]:`${V} - ${L}`}}),O=async()=>{l.value=f(W),await y(),f(m).hideDrop(),t("selectionChange",f(l))},D=({date:V,error:L},te)=>{if(L){console.error("date could not be set");return}const Y=te==="from"?c:p;if(!V){Y.value=void 0;return}const se=te==="from"?V.startOf("day"):V.endOf("day");Y.value=se};return n({setSelectedItemsBasedOnQuery:x}),Lt(()=>{x()}),{clearFilter:E,displayedItems:u,isItemSelected:g,selectedItem:l,onShowDrop:T,onHideDrop:R,filterChip:m,toggleItemSelection:h,setSelectedItemsBasedOnQuery:x,fromDate:c,toDate:p,dateRangeValid:N,applyDateRangeFilter:O,dateRangeApplied:A,setDateRangeDate:D,dateRangeClicked:d,currentTheme:a,queryParam:b}}}),vB={class:"flex items-center truncate"},bB={class:"truncate ml-2"},wB={class:"flex"},SB={class:"my-1"},EB={class:"flex items-center truncate"},TB={class:"truncate ml-2"},AB=["textContent"],xB={class:"flex"},RB={class:"flex items-center justify-between mb-4"},CB=["textContent"],kB={class:"mt-2"},PB={class:"date-filter-apply-btn text-end"};function IB(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-button"),l=Ee("oc-list"),u=Ee("oc-datepicker"),c=Ee("oc-filter-chip");return X(),pe("div",{class:z.normalizeClass(["date-filter flex overflow-hidden [&_label]:text-sm",`date-filter-${e.filterName}`])},[me(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:ve(()=>[me(l,{class:z.normalizeClass({"invisible min-h-[225px] transition-[visibility] duration-[0.4s,0s]":e.dateRangeClicked})},{default:ve(()=>[(X(!0),pe(Be,null,mt(e.displayedItems,(p,d)=>(X(),pe("li",{key:d,class:"my-1 first:mt-0 last:mb-0"},[me(a,{class:z.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:m=>e.toggleItemSelection(p)},{default:ve(()=>[fe("div",vB,[fe("div",bB,[Ue(e.$slots,"item",{item:p},void 0,!0)])]),fe("div",wB,[e.isItemSelected(p)?(X(),Te(s,{key:0,name:"check"})):Re("",!0)])]),_:2},1032,["class","data-testid","onClick"])]))),128)),fe("li",SB,[me(a,{class:z.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:ve(()=>[fe("div",EB,[fe("div",TB,[fe("span",{textContent:z.toDisplayString(e.$gettext("Custom date range"))},null,8,AB)])]),fe("div",xB,[e.dateRangeApplied?(X(),Te(s,{key:0,name:"check"})):Re("",!0)])]),_:1},8,["class"])])]),_:3},8,["class"]),fe("div",{class:z.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}])},[fe("div",RB,[me(a,{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:ve(()=>[me(s,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"]),fe("span",{textContent:z.toDisplayString(e.$gettext("Custom date range"))},null,8,CB),me(a,{appearance:"raw",class:"date-filter-range-panel-close","aria-label":e.$gettext("Close filter"),onClick:t[2]||(t[2]=p=>e.filterChip.hideDrop())},{default:ve(()=>[me(s,{name:"close"})]),_:1},8,["aria-label"])]),fe("div",kB,[me(u,{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"]),me(u,{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"])]),fe("div",PB,[me(a,{size:"small",disabled:!e.dateRangeValid,onClick:e.applyDateRangeFilter},{default:ve(()=>[kt(z.toDisplayString(e.$gettext("Apply")),1)]),_:1},8,["disabled","onClick"])])],2)]),_:3},8,["filter-label","selected-item-names","onClearFilter","onShowDrop","onHideDrop"])],2)}const OB=Ye(yB,[["render",IB],["__scopeId","data-v-80ea8301"]]),FB=_e({name:"ItemFilterInline",props:{filterName:{type:String,required:!0},filterOptions:{type:Array,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=He(),r=Ht(),i=le(e.filterOptions[0].name),o=`q_${e.filterName}`,s=tn(o),a=u=>n.push({query:{...Hi(f(r).query,[o]),[o]:u}}),l=async u=>{i.value=u.name,await a(u.name),t("toggleFilter",u)};return Lt(()=>{const u=Ct(f(s));u&&e.filterOptions.some(({name:c})=>c===u)&&(i.value=u,t("toggleFilter",e.filterOptions.find(({name:c})=>c===u)))}),{queryParam:o,activeOption:i,toggleFilter:l}}}),_B=["textContent"];function DB(e,t,n,r,i,o){const s=Ee("oc-button");return X(),pe("div",null,[fe("div",{class:z.normalizeClass(["item-inline-filter inline-flex outline outline-role-secondary outline-offset-[-1px] rounded-full",`item-inline-filter-${e.filterName}`])},[(X(!0),pe(Be,null,mt(e.filterOptions,(a,l)=>(X(),Te(s,{id:a.name,key:l,class:z.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===a.name}]),appearance:e.activeOption===a.name?"filled":"raw-inverse","color-role":e.activeOption===a.name?"secondaryContainer":"surface","no-hover":e.activeOption===a.name,onClick:u=>e.toggleFilter(a)},{default:ve(()=>[fe("span",{class:"truncate item-inline-filter-option-label",textContent:z.toDisplayString(a.label)},null,8,_B)]),_:2},1032,["id","class","appearance","color-role","no-hover","onClick"]))),128))],2)])}const NB=Ye(FB,[["render",DB]]),LB={class:"space-quota"},$B=["textContent"],vS=_e({__name:"SpaceQuota",props:{spaceQuota:{}},setup(e){const{$gettext:t,current:n}=Ie.useGettext(),r=B(()=>e.spaceQuota.total?t("%{used} of %{total} used (%{percentage}% used)",{used:f(o),total:f(i),percentage:f(s).toString()}):t("%{used} used (no restriction)",{used:f(o)})),i=B(()=>vn(e.spaceQuota.total,n)),o=B(()=>vn(e.spaceQuota.used,n)),s=B(()=>parseFloat((e.spaceQuota.used/e.spaceQuota.total*100).toFixed(2))),a=B(()=>e.spaceQuota.state==="normal"?"var(--oc-role-secondary)":"var(--oc-role-error)");return(l,u)=>{const c=Ee("oc-progress");return X(),pe("div",LB,[fe("p",{class:"mb-2 mt-0",textContent:z.toDisplayString(r.value)},null,8,$B),me(c,{value:s.value,max:100,size:"small",color:a.value,"background-color":"var(--oc-role-surface)"},null,8,["value","color"])])}}}),MB=_e({name:"WebDavDetails",props:{space:{type:Object,required:!0}},setup(e){const t=wr("resource"),n="check",r="file-copy",i=le(r),o=le(r),s=B(()=>dc(f(t).webDavPath)),a=B(()=>e.space?.getWebDavUrl({path:f(t).path}));return{copyWebDAVPathIcon:i,copyWebDAVPathToClipboard:()=>{navigator.clipboard.writeText(f(s)),i.value=n,setTimeout(()=>i.value=r,1500)},copyWebDAVUrlIcon:o,copyWebDAVUrlToClipboard:()=>{navigator.clipboard.writeText(f(a)),o.value=n,setTimeout(()=>o.value=r,1500)},webDavPath:s,webDavUrl:a}}}),BB={class:"flex"},jB=["textContent"],UB={class:"flex"},VB=["textContent"];function qB(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-button"),l=sn("oc-tooltip");return X(),pe(Be,null,[fe("dt",null,z.toDisplayString(e.$gettext("WebDAV path")),1),fe("dd",BB,[ot(fe("div",{class:"truncate",textContent:z.toDisplayString(e.webDavPath)},null,8,jB),[[l,e.webDavPath]]),ot((X(),Te(a,{class:"ml-2",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV path to clipboard"),"no-hover":"",onClick:e.copyWebDAVPathToClipboard},{default:ve(()=>[me(s,{name:e.copyWebDAVPathIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[l,e.$gettext("Copy WebDAV path")]])]),fe("dt",null,z.toDisplayString(e.$gettext("WebDAV URL")),1),fe("dd",UB,[ot(fe("div",{class:"truncate",textContent:z.toDisplayString(e.webDavUrl)},null,8,VB),[[l,e.webDavUrl]]),ot((X(),Te(a,{class:"ml-2",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV URL to clipboard"),"no-hover":"",onClick:e.copyWebDAVUrlToClipboard},{default:ve(()=>[me(s,{name:e.copyWebDAVUrlIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[l,e.$gettext("Copy WebDAV URL")]])])],64)}const bS=Ye(MB,[["render",qB]]),zB={id:"oc-space-details-sidebar",class:"p-4 bg-role-surface-container rounded-sm"},WB={class:"text-center"},HB={key:1,class:"relative mb-2"},KB=["src"],GB={key:0,class:"flex items-center oc-space-details-sidebar-members mb-2 text-sm gap-2"},QB=["textContent"],XB=["textContent"],YB=["aria-label"],JB=_e({__name:"SpaceDetails",props:{showShareIndicators:{type:Boolean,default:!0}},setup(e){const t=vt(),n=ze(),{resourceContentsText:r}=J0({showSizeInformation:!1}),i=He(),{$gettext:o,$ngettext:s,current:a}=Ie.useGettext(),{loadPreview:l}=Nd(),u=at(),{imagesLoading:c}=Me.storeToRefs(u),p=Cr(),d=wr("resource"),m=le(""),{user:b}=Me.storeToRefs(t),w=B(()=>u.getSpaceMembers(f(d))),S=B(()=>p.linkShares.length),y=B(()=>n.areWebDavDetailsShown),g=B(()=>!xt(i,"files-spaces-projects")),v=B(()=>`${vn(f(d).size,a)}, ${f(r)}`);st(()=>f(d).spaceImageData,async()=>{m.value=await l({space:f(d),resource:f(d).spaceImageData?re.buildSpaceImageResource(f(d)):f(d),dimensions:rs.Tile,processor:ya.enum.fit,cancelRunning:!0,updateStore:!1})},{immediate:!0});const h=B(()=>f(w).length?f(w).filter(re.isManager).map(({sharedWith:se})=>se.id===f(b)?.id?o("%{displayName} (me)",{displayName:se.displayName}):se.displayName).join(", "):re.getSpaceManagers(f(d),p.graphRoles)?.map(({grantedToV2:he})=>he.user?.id===f(b)?.id?o("%{displayName} (me)",{displayName:he.user.displayName}):he.user?.displayName||he.group?.displayName).join(", ")),E=B(()=>rb(f(d).mdate,a)),T=B(()=>f(W)||f(O)),R=B(()=>f(W)&&!f(O)?f(V):!f(W)&&f(O)?f(L):f(D)===1?s("This space has one member and %{linkShareCount} link.","This space has one member and %{linkShareCount} links.",f(S),{linkShareCount:f(S).toString()}):f(S)===1?o("This space has %{memberShareCount} members and one link.",{memberShareCount:f(D).toString()}):o("This space has %{memberShareCount} members and %{linkShareCount} links.",{memberShareCount:f(D).toString(),linkShareCount:f(S).toString()})),x=B(()=>o("Open share panel")),A=B(()=>o("Open link list in share panel")),N=B(()=>o("Open member list in share panel")),W=B(()=>f(D)>0),O=B(()=>f(S)>0),D=B(()=>f(w).length),V=B(()=>s("This space has %{memberShareCount} member.","This space has %{memberShareCount} members.",f(D),{memberShareCount:f(D).toString()})),L=B(()=>s("%{linkShareCount} link giving access.","%{linkShareCount} links giving access.",f(S),{linkShareCount:f(S).toString()})),te=()=>{Je.publish(Rt.setActivePanel,"space-share")};return(Y,se)=>{const he=Ee("oc-spinner"),ae=Ee("oc-icon"),we=Ee("oc-button"),Q=Ee("portal-target");return X(),pe("div",zB,[fe("div",WB,[f(c).includes(f(d).id)?(X(),Te(he,{key:0,"aria-label":f(o)("Space image is loading")},null,8,["aria-label"])):m.value?(X(),pe("div",HB,[fe("img",{src:m.value,alt:"",class:"size-full object-cover aspect-[16/9]"},null,8,KB)])):(X(),Te(ae,{key:2,name:"layout-grid",size:"xxlarge",class:"space-default-image px-4 py-4"}))]),e.showShareIndicators&&T.value&&!f(d).disabled?(X(),pe("div",GB,[W.value?(X(),Te(we,{key:0,appearance:"raw","aria-label":N.value,"no-hover":"",onClick:te},{default:ve(()=>[me(ae,{name:"group",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):Re("",!0),O.value?(X(),Te(we,{key:1,appearance:"raw","aria-label":A.value,"no-hover":"",onClick:te},{default:ve(()=>[me(ae,{name:"link",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):Re("",!0),fe("p",{textContent:z.toDisplayString(R.value)},null,8,QB),me(we,{appearance:"raw","aria-label":x.value,size:"small","no-hover":"",onClick:te},{default:ve(()=>[fe("span",{class:"text-sm",textContent:z.toDisplayString(f(o)("Show"))},null,8,XB)]),_:1},8,["aria-label"])])):Re("",!0),fe("dl",{class:"details-list grid grid-cols-[auto_minmax(0,1fr)] m-0","aria-label":f(o)("Overview of the information about the selected space")},[fe("dt",null,z.toDisplayString(f(o)("Last activity")),1),fe("dd",null,z.toDisplayString(E.value),1),f(d).description?(X(),pe(Be,{key:0},[fe("dt",null,z.toDisplayString(f(o)("Subtitle")),1),fe("dd",null,z.toDisplayString(f(d).description),1)],64)):Re("",!0),fe("dt",null,z.toDisplayString(f(o)("Manager")),1),fe("dd",null,z.toDisplayString(h.value),1),f(d).disabled?Re("",!0):(X(),pe(Be,{key:1},[fe("dt",null,z.toDisplayString(f(o)("Quota")),1),fe("dd",null,[me(vS,{"space-quota":f(d).spaceQuota},null,8,["space-quota"])])],64)),g.value?(X(),pe(Be,{key:2},[fe("dt",null,z.toDisplayString(f(o)("Size")),1),fe("dd",null,z.toDisplayString(v.value),1)],64)):Re("",!0),y.value?(X(),Te(bS,{key:3,space:f(d)},null,8,["space"])):Re("",!0),me(Q,{name:"app.files.sidebar.space.details.table","slot-props":{space:f(d),resource:f(d)},multiple:!0},null,8,["slot-props"])],8,YB)])}}}),ZB={id:"oc-spaces-details-multiple-sidebar",class:"p-4 bg-role-surface-container rounded-sm"},ej={class:"text-center mb-6 rounded-sm"},tj=["textContent"],nj=_e({__name:"SpaceDetailsMultiple",props:{selectedSpaces:{}},setup(e){const t=Ie.useGettext(),{$gettext:n,$ngettext:r}=t,i=B(()=>{let d=0;return e.selectedSpaces.forEach(m=>{d+=m.spaceQuota.total}),vn(d,t.current)}),o=B(()=>{let d=0;return e.selectedSpaces.forEach(m=>{m.disabled||(d+=m.spaceQuota.remaining)}),vn(d,t.current)}),s=B(()=>{let d=0;return e.selectedSpaces.forEach(m=>{m.disabled||(d+=m.spaceQuota.used)}),vn(d,t.current)}),a=B(()=>e.selectedSpaces.filter(d=>!d.disabled).length),l=B(()=>e.selectedSpaces.filter(d=>d.disabled).length),u=B(()=>n("Overview of the information about the selected spaces")),c=B(()=>r("%{ itemCount } space selected","%{ itemCount } spaces selected",e.selectedSpaces.length,{itemCount:e.selectedSpaces.length.toString()})),p=B(()=>[{term:n("Total quota:"),definition:f(i).toString()},{term:n("Remaining quota:"),definition:f(o).toString()},{term:n("Used quota:"),definition:f(s).toString()},{term:n("Enabled:"),definition:f(a).toString()},{term:n("Disabled:"),definition:f(l).toString()}]);return(d,m)=>{const b=Ee("oc-icon"),w=Ee("oc-definition-list");return X(),pe("div",ZB,[fe("div",ej,[fe("div",null,[me(b,{size:"xxlarge",name:"layout-grid"}),fe("p",{textContent:z.toDisplayString(c.value)},null,8,tj)])]),me(w,{"aria-label":u.value,items:p.value,class:"m-0"},null,8,["aria-label","items"])])}}}),rj=_e({name:"SpaceNoSelection"}),ij={class:"mt-12"},oj={class:"flex flex-col items-center space-info text-center"};function sj(e,t,n,r,i,o){const s=Ee("oc-icon"),a=sn("translate");return X(),pe("div",ij,[fe("div",oj,[me(s,{name:"layout-grid",size:"xxlarge"}),ot((X(),pe("p",null,[...t[0]||(t[0]=[kt("Select a space to view details",-1)])])),[[a]])])])}const aj=Ye(rj,[["render",sj]]),lj=_e({name:"CompareSaveDialog",props:{originalObject:{type:Object,required:!0},compareObject:{type:Object,required:!0},confirmButtonDisabled:{type:Boolean,default:()=>!1}},emits:["confirm","revert"],setup(){const e=le(!1);let t;return Lt(()=>{t=Je.subscribe("sidebar.entity.saved",()=>{e.value=!0})}),An(()=>{Je.unsubscribe("sidebar.entity.saved",t)}),{saved:e}},computed:{unsavedChanges(){return!Vv(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}}}),cj={class:"w-full flex flex-row flex-wrap justify-between items-center"},uj={key:0,class:"flex items-center"},fj=["textContent"],dj={key:1},pj=["textContent"],hj=["textContent"];function mj(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-button");return X(),pe("div",cj,[e.saved?(X(),pe("span",uj,[me(s,{name:"checkbox-circle"}),fe("span",{class:"ml-2",textContent:z.toDisplayString(e.$gettext("Changes saved"))},null,8,fj)])):(X(),pe("span",dj,z.toDisplayString(e.unsavedChangesText),1)),fe("div",null,[me(a,{disabled:!e.unsavedChanges,class:"compare-save-dialog-revert-btn",onClick:t[0]||(t[0]=l=>e.$emit("revert"))},{default:ve(()=>[fe("span",{textContent:z.toDisplayString(e.$gettext("Revert"))},null,8,pj)]),_:1},8,["disabled"]),me(a,{appearance:"filled",class:"compare-save-dialog-confirm-btn",disabled:!e.unsavedChanges||e.confirmButtonDisabled,onClick:t[1]||(t[1]=l=>e.$emit("confirm"))},{default:ve(()=>[fe("span",{textContent:z.toDisplayString(e.$gettext("Save"))},null,8,hj)]),_:1},8,["disabled"])])])}const gj=Ye(lj,[["render",mj]]),yj=q1(async()=>(await Promise.resolve().then(()=>h8)).default),vj=_e({name:"CustomComponentTarget",props:{extensionPoint:{type:Object,required:!0}},setup(e){const t=Ki(),n=db(),r=B(()=>t.requestExtensions(e.extensionPoint)),i=n.extractDefaultExtensionIds(e.extensionPoint,f(r));return{extensions:B(()=>{if(e.extensionPoint.multiple||f(r).length<=1)return f(r);const s=n.getExtensionPreference(e.extensionPoint.id,i);return s.selectedExtensionIds.length?[f(r).find(a=>s.selectedExtensionIds.includes(a.id))||f(r)[0]]:[f(r)[0]]})}}});function bj(e,t,n,r,i,o){return X(!0),pe(Be,null,mt(e.extensions,s=>(X(),Te(Pn(s.content),{key:`custom-component-${s.id}`}))),128)}const wj=Ye(vj,[["render",bj]]),Sj={class:"flex items-center truncate"},Ej={class:"truncate"},Tj={class:"flex"},Aj=_e({__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,i=He(),o=Ht(),s=Tn("filterInputRef"),a=le([]),l=le(e.items),u=Tn("itemFilterListRef"),c=`q_${e.filterName}`,p=tn(c),d=R=>R[e.idAttribute],m=()=>i.push({query:{...Hi(f(o).query,[c]),...!!f(a).length&&{[c]:f(a).reduce((R,x)=>(R+=`${d(x)}+`,R),"").slice(0,-1)}}}),b=R=>!!f(a).find(x=>d(x)===d(R)),w=async R=>{b(R)?a.value=f(a).filter(x=>d(x)!==d(R)):(e.allowMultiple||(a.value=[]),a.value.push(R)),await m(),r("selectionChange",f(a))},S=le(),y=(R,x)=>{if(!(x||"").trim())return R;const N=new zd(R,{...Ul,keys:e.filterableAttributes}).search(x).map(W=>W.item);return R.filter(W=>N.includes(W))},g=()=>{a.value=[],r("selectionChange",f(a)),m()},v=R=>{l.value=R},h=async()=>{v(e.items),await zt(),f(s)?.focus()};let E;st(S,()=>{v(y(e.items,f(S))),f(u)&&(E=new Qd(f(u)),E.unmark(),E.mark(f(S),{element:"span",className:"mark-highlight"}))});const T=()=>{const R=Ct(f(p));if(R){const x=R.split("+");a.value=e.items.filter(A=>x.includes(d(A)))}};return t({setSelectedItemsBasedOnQuery:T}),Lt(()=>{T()}),(R,x)=>{const A=Ee("oc-checkbox"),N=Ee("oc-icon"),W=Ee("oc-button"),O=Ee("oc-list"),D=Ee("oc-filter-chip");return X(),pe("div",{class:z.normalizeClass(["item-filter flex",`item-filter-${e.filterName}`])},[me(D,{"filter-label":e.filterLabel,"selected-item-names":a.value.map(V=>V[e.displayNameAttribute]),"close-on-click":e.closeOnClick,onClearFilter:g,onShowDrop:h},{default:ve(()=>[e.showOptionFilter&&e.filterableAttributes.length?(X(),Te(f(lN),{key:0,ref_key:"filterInputRef",ref:s,modelValue:S.value,"onUpdate:modelValue":x[0]||(x[0]=V=>S.value=V),class:"item-filter-input mb-4 mt-2",autocomplete:"off",label:e.optionFilterLabel===""?R.$gettext("Filter list"):e.optionFilterLabel},null,8,["modelValue","label"])):Re("",!0),fe("div",{ref_key:"itemFilterListRef",ref:u},[me(O,{class:"item-filter-list"},{default:ve(()=>[(X(!0),pe(Be,null,mt(l.value,(V,L)=>(X(),pe("li",{key:L,class:"my-1"},[me(W,{class:z.normalizeClass(["item-filter-list-item flex items-center w-full",{"item-filter-list-item-active":!e.allowMultiple&&b(V),"justify-start":e.allowMultiple,"justify-between":!e.allowMultiple}]),"justify-content":"space-between",appearance:"raw","data-test-value":V[e.displayNameAttribute],onClick:te=>w(V)},{default:ve(()=>[fe("div",Sj,[e.allowMultiple?(X(),Te(A,{key:0,size:"large",class:"mr-2",label:R.$gettext("Toggle selection"),"model-value":b(V),"label-hidden":!0,"onUpdate:modelValue":te=>w(V),onClick:x[1]||(x[1]=Wt(()=>{},["stop"]))},null,8,["label","model-value","onUpdate:modelValue"])):Re("",!0),fe("div",null,[Ue(R.$slots,"image",{item:V})]),fe("div",Ej,[Ue(R.$slots,"item",{item:V})])]),fe("div",Tj,[!e.allowMultiple&&b(V)?(X(),Te(N,{key:0,name:"check"})):Re("",!0)])]),_:2},1032,["class","data-test-value","onClick"])]))),128))]),_:3})],512)]),_:3},8,["filter-label","selected-item-names","close-on-click"])],2)}}}),xj=_e({name:"ItemFilterToggle",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=He(),r=Ht(),i=le(!1),o=`q_${e.filterName}`,s=tn(o),a=()=>n.push({query:{...Hi(f(r).query,[o]),...f(i)&&{[o]:"true"}}}),l=async()=>{i.value=!f(i),await a(),t("toggleFilter",f(i))};return Lt(()=>{Ct(f(s))==="true"&&(i.value=!0)}),{queryParam:o,filterActive:i,toggleFilter:l}}});function Rj(e,t,n,r,i,o){const s=Ee("oc-filter-chip");return X(),pe("div",{class:z.normalizeClass(["item-filter flex",`item-filter-${e.filterName}`])},[me(s,{"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 Cj=Ye(xj,[["render",Rj]]),kj=_e({name:"LoadingIndicator",setup(){const e=gn();let t,n,r;const i=le(e.isLoading),o=le(e.currentProgress),s=()=>{o.value=e.currentProgress,i.value=e.isLoading},a=()=>{o.value=e.currentProgress};return Lt(()=>{t=Je.subscribe(Gr.add,s),n=Je.subscribe(Gr.remove,s),r=Je.subscribe(Gr.setProgress,a)}),An(()=>{Je.unsubscribe(Gr.add,t),Je.unsubscribe(Gr.remove,n),Je.unsubscribe(Gr.setProgress,r)}),{isLoading:i,currentProgress:o}}}),Pj={key:0,id:"oc-loading-indicator",class:"w-full"};function Ij(e,t,n,r,i,o){const s=Ee("oc-progress");return e.isLoading?(X(),pe("div",Pj,[me(s,{max:100,indeterminate:e.currentProgress===null,value:e.currentProgress,size:"xsmall"},null,8,["indeterminate","value"])])):Re("",!0)}const Oj=Ye(kj,[["render",Ij]]),Fj={class:"no-content-message flex flex-col justify-center items-center text-center"},_j={class:"text-role-on-surface-variant text-xl"},Dj={class:"text-role-on-surface-variant"},Nj=Ye(_e({__name:"NoContentMessage",props:{icon:{},iconFillType:{default:"fill"}},setup(e){return(t,n)=>{const r=Ee("oc-icon");return X(),pe("div",Fj,[me(r,{name:e.icon,type:"div",size:"xxlarge","fill-type":e.iconFillType,class:"mb-4"},null,8,["name","fill-type"]),fe("div",_j,[Ue(t.$slots,"message",{},void 0,!0)]),fe("div",Dj,[Ue(t.$slots,"callToAction",{},void 0,!0)])])}}}),[["__scopeId","data-v-734c490b"]]),Lj=_e({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 $j(e,t,n,r,i,o){const s=Ee("oc-pagination");return e.pages>1?(X(),Te(s,{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"])):Re("",!0)}const Mj=Ye(Lj,[["render",$j]]),Bj=_e({name:"SearchBarFilter",props:{currentFolderAvailable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=Ie.useGettext(),r=tn("useScope"),i=le(),o=le(),s=B(()=>n(i.value?.title)),a=B(()=>[{id:mi.currentFolder,title:n("Current folder"),enabled:e.currentFolderAvailable},{id:mi.allFiles,title:n("All files"),enabled:!0}]);return st(()=>e.currentFolderAvailable,()=>{if(f(r)){if(f(r).toString()==="true"){i.value=f(a).find(({id:c})=>c===mi.currentFolder);return}i.value=f(a).find(({id:c})=>c===mi.allFiles);return}if(!e.currentFolderAvailable){i.value=f(a).find(({id:u})=>u===mi.allFiles);return}if(f(o)){i.value=f(a).find(({id:u})=>u===f(o).id);return}i.value=f(a).find(({id:u})=>u===mi.allFiles)},{immediate:!0}),{currentSelection:i,currentSelectionTitle:s,onOptionSelected:u=>{o.value=u,i.value=u,t("update:modelValue",{value:u})},locationOptions:a}}}),jj={key:0},Uj={key:0,class:"flex"};function Vj(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-button"),l=Ee("oc-list"),u=Ee("oc-filter-chip");return X(),pe("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?(X(),pe("div",jj,[me(u,{"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:ve(()=>[me(l,null,{default:ve(()=>[(X(!0),pe(Be,null,mt(e.locationOptions,(c,p)=>(X(),pe("li",{key:p},[me(a,{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:d=>e.onOptionSelected(c)},{default:ve(()=>[fe("span",null,z.toDisplayString(c.title),1),c.id===e.currentSelection.id?(X(),pe("div",Uj,[me(s,{name:"check"})])):Re("",!0)]),_:2},1032,["appearance","color-role","no-hover","disabled","data-test-id","onClick"])]))),128))]),_:1})]),_:1},8,["filter-label","selected-item-names"])])):Re("",!0)])}const qj=Ye(Bj,[["render",Vj]]),zj=_e({name:"PortalTarget",components:{PortalTargetVue:fs.PortalTarget},props:{...fs.PortalTarget.props},setup(e){const t=B(()=>e);return Lt(()=>{Je.publish(el.mounted,e)}),{properties:t}}});function Wj(e,t,n,r,i,o){const s=Ee("portal-target-vue");return X(),Te(s,z.normalizeProps(eh(e.properties)),null,16)}const Hj=Ye(zj,[["render",Wj]]),Kj={key:0},Gj={key:0,class:"version-check-loading flex items-center"},Qj=["textContent"],Xj={key:0,class:"version-check-no-updates flex items-center"},Yj=["textContent"],Jj=["textContent"],Zj=_e({__name:"VersionCheck",setup(e){const{$gettext:t}=Ie.useGettext(),n=en(),r=Lb(),i=n.capabilities.core["check-for-updates"],{updates:o,isLoading:s,hasError:a}=Me.storeToRefs(r),l=B(()=>i&&!f(a)),u=le(!1),c=le(),p=n.status.edition||"rolling",m=n.status.productversion.split("+")[0];return st(()=>o,()=>{if(!f(o))return;const b=f(o).channels[p].current_version;hc(b,m)>0&&(u.value=!0,c.value=f(o).channels[p])},{immediate:!0,deep:!0}),(b,w)=>{const S=Ee("oc-spinner"),y=Ee("oc-icon"),g=Ee("oc-button");return l.value?(X(),pe("div",Kj,[f(s)?(X(),pe("div",Gj,[fe("span",{textContent:z.toDisplayString(f(t)("Checking for updates"))},null,8,Qj),me(S,{class:"ml-1",size:"xsmall"})])):(X(),pe(Be,{key:1},[u.value?(X(),Te(g,{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:ve(()=>[fe("span",{class:"text-xs",textContent:z.toDisplayString(f(t)("Version %{version} available",{version:c.value.current_version}))},null,8,Jj),me(y,{name:"refresh",size:"xsmall","fill-type":"line"})]),_:1},8,["href"])):(X(),pe("div",Xj,[fe("span",{textContent:z.toDisplayString(f(t)("Up to date"))},null,8,Yj),me(y,{class:"ml-0.5",name:"checkbox-circle",size:"xsmall","fill-type":"line"})]))],64))])):Re("",!0)}}}),e8={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é"}},t8={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"}},n8={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"}},r8={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"}},i8={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"}},o8={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:"Автопрокрутка"}},s8={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:"同期スクロール"}},a8={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"}},l8={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"},c8={"fr-FR":e8,"de-DE":t8,"it-IT":n8,"es-ES":r8,"pl-PL":i8,ru:o8,"jp-JP":s8,"id-ID":a8},u8=_e({name:"TextEditor",components:{MdEditor:oo.MdEditor,MdPreview:oo.MdPreview,NormalToolbar:oo.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=Ie.useGettext(),{currentTheme:r}=cr(),i=le(!0),o=B(()=>{const{showPreviewOnlyMd:c=!0}=e.applicationConfig;return{showPreviewOnlyMd:c}}),s=B(()=>e.markdownMode||["md","markdown"].includes(e.resource?.extension)||!f(o).showPreviewOnlyMd),a=B(()=>f(r).isDark?"dark":"light"),l=B(()=>f(s)?["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 oo.config({editorConfig:{languageUserDefined:c8},editorExtensions:{screenfull:{instance:PS},cropper:{instance:il}},markdownItPlugins(c){return[...c,{type:"xss",plugin:oo.XSSPlugin,options:{}}]},codeMirrorExtensions(c){const p=[...c,{type:"lineNumbers",extension:IS.lineNumbers()}],d=p.find(m=>m.type==="linkShortener");return d&&(d.options.maxLength=120),f(s)?p:p.filter(m=>["lineWrapping","keymap","floatingToolbar","lineNumbers"].includes(m.type))}}),{isMarkdown:s,theme:a,toolbars:l,language:n,languages:l8,onUploadImg:async c=>{const d=(await Promise.all([...c].map(b=>new Promise((w,S)=>{const y=new FileReader;y.onload=()=>w(y.result),y.onerror=S,y.readAsDataURL(b)})))).map(b=>`![image](${b})`),m=`${f(e.currentContent)}
65
- ${d.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(`
66
14
 
67
15
  `)}
68
- `;t("update:currentContent",m)},showLineNumbers:i}}}),f8={id:"text-editor-container",class:"h-full [&_.md-editor-preview]:!font-(family-name:--oc-font-family)"},d8={key:0};function p8(e,t,n,r,i,o){const s=Ee("md-preview"),a=Ee("oc-icon"),l=Ee("NormalToolbar"),u=Ee("md-editor");return X(),pe("div",f8,[e.isReadOnly?(X(),pe("article",d8,[me(s,{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"])])):(X(),Te(u,{key:1,id:"text-editor-component",class:z.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:ve(()=>[me(l,{title:e.showLineNumbers?e.$gettext("hide line numbers"):e.$gettext("show line numbers"),onOnClick:t[0]||(t[0]=c=>e.showLineNumbers=!e.showLineNumbers)},{default:ve(()=>[me(a,{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 h8=Object.freeze(Object.defineProperty({__proto__:null,default:Ye(u8,[["render",p8]])},Symbol.toStringTag,{value:"Module"}));$.AVATAR_UPLOAD_MAX_FILE_SIZE_MB=xd,$.AccountCapabilitiesSchema=Bb,$.AccountSchema=Ub,$.AccountsSchema=qb,$.ActionMenuDropItem=sS,$.ActionMenuItem=tl,$.ApiError=Dx,$.AppBar=I$,$.AppLoadingSpinner=Id,$.AppProviderService=xx,$.AppTopBar=cS,$.AppWrapper=hS,$.AppWrapperRoute=kM,$.ArchiverService=Lx,$.Auth=gc,$.AvatarUpload=HM,$.BatchActions=oS,$.Cache=lm,$.ClientService=zx,$.ClipboardActions=Mo,$.CompareSaveDialog=gj,$.ConflictDialog=jl,$.ContextActionMenu=nl,$.ContextActions=aS,$.ContextMenuQuickAction=Vd,$.CreateLinkModal=h0,$.CreateShortcutModal=v0,$.CreateSpace=D$,$.CustomComponentTarget=wj,$.DateFilter=OB,$.DatePickerModal=uM,$.EVENT_FILE_DROPPED=h2,$.EVENT_TROW_CONTEXTMENU=m2,$.EVENT_TROW_MOUNTED=p2,$.EmojiPickerModal=z0,$.EventBus=ym,$.FileInfo=Ud,$.FilePickerModal=T0,$.FileSideBar=fS,$.FolderLoaderFavorites=bv,$.FolderLoaderSharedViaLink=wv,$.FolderLoaderSharedWithMe=Sv,$.FolderLoaderSharedWithOthers=Ev,$.FolderLoaderSpace=vv,$.FolderLoaderTrashbin=Tv,$.FolderService=Av,$.FolderViewModeConstants=nn,$.HttpClient=yc,$.IdentitySchema=jb,$.ImageDimension=rs,$.ImageType=g2,$.ItemFilter=Aj,$.ItemFilterInline=NB,$.ItemFilterToggle=Cj,$.Key=fr,$.LimitsSchema=Vb,$.LinkRoleDropdown=p0,$.LoadingEventTopics=Gr,$.LoadingIndicator=Oj,$.LoadingService=Ak,$.MailCapabilitiesSchema=$b,$.MimeTypesToAppsSchema=hm,$.Modifier=Ia,$.NoContentMessage=Nj,$.Pagination=Mj,$.PaginationConstants=io,$.PasswordPolicyService=EP,$.PortalTarget=Hj,$.PortalTargetEventTopics=el,$.PreviewService=mP,$.PrimaryAccountsSchema=zb,$.ProcessorType=ya,$.QuotaModal=B0,$.QuotaSelect=M0,$.RESOURCE_MAX_CHARACTER_LENGTH=y2,$.RESOURCE_NAME_MAX_BYTES=Rd,$.RawConfigSchema=wO,$.RawGroupwareConfigSchema=gF,$.ResolveStrategy=Wn,$.ResourceConflictModal=bh,$.ResourceGhostElement=qd,$.ResourceIcon=is,$.ResourceLink=Ha,$.ResourceListItem=os,$.ResourceName=Cd,$.ResourcePreview=y0,$.ResourceSize=mS,$.ResourceTable=eB,$.ResourceTile=yS,$.ResourceTiles=gB,$.ResourceTransfer=Sh,$.RuntimeError=ji,$.SaveAsModal=C0,$.SearchBarFilter=qj,$.SearchLocationFilterConstants=mi,$.SideBar=uS,$.SideBarEventTopics=Rt,$.SieveCapabilitiesSchema=Mb,$.SortConstants=cs,$.SpaceDetails=JB,$.SpaceDetailsMultiple=nj,$.SpaceImageModal=P0,$.SpaceInfo=jd,$.SpaceMoveInfoModal=vh,$.SpaceNoSelection=aj,$.SpaceQuota=vS,$.TextEditor=yj,$.ThemeConfig=dF,$.TransferType=Sr,$.UnsavedChangesModal=dS,$.UppyService=kP,$.UserAvatar=rl,$.VersionCheck=Zj,$.ViewOptions=lS,$.VisibilityObserver=g0,$.WebDavDetails=bS,$.WebThemeConfig=_b,$.activeApp=lc,$.authContextValues=ox,$.blobToArrayBuffer=cb,$.breadcrumbsFromPath=GI,$.buildRoutes=TF,$.buildUrl=ax,$.cacheService=mc,$.canvasToBlob=ub,$.cloneStateObject=gh,$.compareVersions=hc,$.concatBreadcrumbs=QI,$.contextQueryToFileContextProps=Kb,$.contextRouteNameKey=xa,$.contextRouteParamsKey=Qf,$.contextRouteQueryKey=Xf,$.convertToMinimalUppyFile=zv,$.createDefaultFileIconMapping=Th,$.createFileRouteOptions=sr,$.createFolderDummyFile=qv,$.createLocation=Li,$.createLocationCommon=$i,$.createLocationPublic=Mi,$.createLocationShares=Fn,$.createLocationSpaces=Kn,$.createLocationTrash=Hr,$.defaultFuseOptions=Ul,$.defineWebApplication=OS,$.determineResourceTableSortFields=dm,$.determineResourceTilesSortFields=Sx,$.dirname=ft.dirname,$.displayPositionedDropdown=Wf,$.encodePath=dc,$.eventBus=Je,$.filterResources=NE,$.focusCheckbox=ux,$.folderService=xv,$.formatDateFromDateTime=di,$.formatDateFromHTTP=XI,$.formatDateFromISO=rb,$.formatDateFromJSDate=nb,$.formatDateFromRFC=YI,$.formatFileSize=vn,$.formatRelativeDateFromDateTime=Bo,$.formatRelativeDateFromHTTP=JI,$.formatRelativeDateFromISO=ZI,$.formatRelativeDateFromJSDate=ib,$.formatRelativeDateFromRFC=eO,$.getIndicators=lb,$.getLocaleFromLanguage=wa,$.getParentPaths=ob,$.getSharedAncestorRoute=cx,$.getSharedDriveItem=Ks,$.getSpacesByType=Vo,$.getTextByteSize=Kf,$.isItemInCurrentFolder=Ah,$.isLocationActive=SF,$.isLocationActiveDirector=Ni,$.isLocationCommonActive=Vt,$.isLocationPublicActive=_n,$.isLocationSharesActive=Mt,$.isLocationSpacesActive=xt,$.isLocationTrashActive=yn,$.isMacOs=jo,$.isPromiseFulfilled=pi,$.isPromiseRejected=hi,$.isResourceBeeingMovedToSameLocation=wh,$.isSameResource=wo,$.locationPublicLink=sc,$.locationPublicUpload=ac,$.locationSharesViaLink=oc,$.locationSharesWithMe=Hs,$.locationSharesWithOthers=ic,$.locationSpacesGeneric=rc,$.objectKeys=Nx,$.parseVersion=pc,$.queryItemAsString=Ct,$.renameResource=Vl,$.resolveFileNameDuplicate=zn,$.resourceIconMappingInjectionKey=Eh,$.routeToContextQuery=Ra,$.setCurrentUserShareSpacePermissions=cm,$.sortFields=pm,$.sortHelper=nS,$.sortSpaceMembers=Nb,$.translateSortFields=Ex,$.triggerDownloadWithFilename=fc,$.useAbility=fn,$.useActionsShowDetails=kL,$.useActiveApp=sx,$.useActiveLocation=Qn,$.useAppConfig=sm,$.useAppDefaults=ew,$.useAppFileHandling=Yf,$.useAppFolderHandling=Qb,$.useAppMeta=ed,$.useAppNavigation=Gb,$.useAppProviderService=IL,$.useAppsStore=ar,$.useArchiverService=b0,$.useAuthService=Jf,$.useAuthStore=li,$.useAvatarsStore=Ea,$.useBreadcrumbsFromPath=OL,$.useCanBeOpenedWithSecureView=G0,$.useCanListShares=O0,$.useCanListVersions=Q0,$.useCanShare=F0,$.useCapabilityStore=en,$.useClientService=Ke,$.useClipboardStore=Uo,$.useConfigStore=dt,$.useCopyLink=Ad,$.useCreateSpace=Qi,$.useCropperKeyboardActions=td,$.useDeleteWorker=tw,$.useDocumentTitle=Xb,$.useDownloadFile=w0,$.useDriveResolver=Zb,$.useEmbedMode=Qr,$.useEventBus=ur,$.useExtensionPreferencesStore=db,$.useExtensionRegistry=Ki,$.useFileActions=Xn,$.useFileActionsCopy=Pa,$.useFileActionsCopyPermanentLink=nd,$.useFileActionsCreateLink=u2,$.useFileActionsCreateNewFile=f2,$.useFileActionsCreateNewFolder=d2,$.useFileActionsCreateNewShortcut=V2,$.useFileActionsCreateSpaceFromResource=kd,$.useFileActionsDelete=ss,$.useFileActionsDeleteResources=D0,$.useFileActionsDisableSync=Ka,$.useFileActionsDownloadArchive=Ga,$.useFileActionsDownloadFile=as,$.useFileActionsEmptyTrashBin=q2,$.useFileActionsEnableSync=Qa,$.useFileActionsFavorite=Pd,$.useFileActionsMove=Xa,$.useFileActionsNavigate=S0,$.useFileActionsOpenShortcut=W2,$.useFileActionsOpenWithApp=x0,$.useFileActionsOpenWithDefault=E0,$.useFileActionsPaste=R0,$.useFileActionsRename=Ya,$.useFileActionsRestore=ls,$.useFileActionsSaveAs=k0,$.useFileActionsSetImage=I0,$.useFileActionsShowActions=lL,$.useFileActionsShowDetails=Od,$.useFileActionsShowShares=Fd,$.useFileActionsToggleHideShare=Ja,$.useFileActionsUndoDelete=_0,$.useFileListHeaderPosition=FL,$.useFileRouteReplace=Ta,$.useFolderLink=Yr,$.useGetMatchingSpace=ln,$.useGetResourceContext=X0,$.useGroupwareConfigStore=mF,$.useInterceptModifierClick=gi,$.useIsAppActive=cL,$.useIsFilesAppActive=_r,$.useIsResourceNameValid=Ei,$.useIsSearchActive=Za,$.useIsTopBarSticky=_d,$.useKeyboardActions=Oa,$.useLinkTypes=Wa,$.useLoadAvatars=iS,$.useLoadPreview=Nd,$.useLoadingService=gn,$.useLocalStorage=Hf,$.useMessages=nt,$.useModals=ht,$.useOpenEmptyEditor=PL,$.useOpenWithDefaultApp=U0,$.usePagination=_L,$.usePasswordPolicyService=H0,$.usePasteWorker=nw,$.usePortalTarget=LL,$.usePreviewService=K0,$.useRequest=Yb,$.useRequestHeaders=ka,$.useResourceContents=J0,$.useResourceRouteResolver=A0,$.useResourceViewContextMenu=Z0,$.useResourceViewDrag=eS,$.useResourceViewHelpers=Ld,$.useResourceViewSelection=tS,$.useResourcesStore=ze,$.useRestoreWorker=rw,$.useRoute=Ht,$.useRouteMeta=Wb,$.useRouteName=Gf,$.useRouteParam=Aa,$.useRouteQuery=tn,$.useRouteQueryPersisted=kr,$.useRouter=He,$.useScrollTo=m0,$.useSearch=Zf,$.useSelectedResources=$d,$.useService=Ar,$.useSharesStore=Cr,$.useSideBar=Sa,$.useSort=VL,$.useSpaceActionsDelete=N0,$.useSpaceActionsDeleteImage=CL,$.useSpaceActionsDisable=L0,$.useSpaceActionsDuplicate=$0,$.useSpaceActionsEditDescription=fL,$.useSpaceActionsEditQuota=j0,$.useSpaceActionsEditReadmeContent=SL,$.useSpaceActionsNavigateToTrash=TL,$.useSpaceActionsRename=V0,$.useSpaceActionsRestore=q0,$.useSpaceActionsSetIcon=RL,$.useSpaceActionsShowMembers=EL,$.useSpaceHelpers=Ca,$.useSpacesLoading=Jb,$.useSpacesStore=at,$.useThemeStore=cr,$.useTileSize=Y0,$.useTokenTimerWorker=kF,$.useUpdatesStore=Lb,$.useUpload=KL,$.useUserStore=vt,$.useViewMode=BL,$.useViewSize=jL,$.useViewSizeMax=Dd,$.useWebWorkersStore=qo,$.useWindowOpen=W0,Object.defineProperty($,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"})}));