@opencloud-eu/web-pkg 3.1.0 → 4.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.
@@ -1,67 +1,87 @@
1
- (function(L,ee){typeof exports=="object"&&typeof module<"u"?ee(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/drop-target"),require("pinia"),require("oidc-client-ts"),require("p-queue"),require("@vueuse/core"),require("cropperjs"),require("dompurify"),require("mark.js"),require("vue-router"),require("portal-vue"),require("@vue/shared"),require("deepmerge"),require("md-editor-v3"),require("zod"),require("@sentry/vue"),require("screenfull")):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/drop-target","pinia","oidc-client-ts","p-queue","@vueuse/core","cropperjs","dompurify","mark.js","vue-router","portal-vue","@vue/shared","deepmerge","md-editor-v3","zod","@sentry/vue","screenfull"],ee):(L=typeof globalThis<"u"?globalThis:L||self,ee(L["web-pkg"]={},L.webClient,L.vue,L.vue3Gettext,L.Fuse,L.lodashEs,L.globalAxios,L.uuid,L.fetchEventSource,L.vueConcurrency,L.luxon,L.filesize,L.qs,L.passwordSheriff,L.Uppy,L.Tus,L.XHRUpload,L.DropTarget,L.pinia,L.oidcClientTs,L.PQueue,L.core,L.Cropper,L.DOMPurify,L.Mark,L.vueRouter,L.portalVue,L.shared,L.merge$1,L.mdEditorV3,L.zod,L.vue$1,L.screenfull))})(this,function(L,ee,Ht,Fe,dd,It,Lo,en,Q0,pn,qt,X0,Y0,J0,Z0,ew,tw,nw,Ue,rw,Fr,Vr,Ra,pd,hd,Mo,_a,W,gd,Bo,be,iw,ow){"use strict";var uM=Object.defineProperty;var H0=L=>{throw TypeError(L)};var fM=(L,ee,Ht)=>ee in L?uM(L,ee,{enumerable:!0,configurable:!0,writable:!0,value:Ht}):L[ee]=Ht;var Ee=(L,ee,Ht)=>fM(L,typeof ee!="symbol"?ee+"":ee,Ht),ud=(L,ee,Ht)=>ee.has(L)||H0("Cannot "+Ht);var Oe=(L,ee,Ht)=>(ud(L,ee,"read from private field"),Ht?Ht.call(L):ee.get(L)),Rn=(L,ee,Ht)=>ee.has(L)?H0("Cannot add the same private member more than once"):ee instanceof WeakSet?ee.add(L):ee.set(L,Ht),Ut=(L,ee,Ht,Fe)=>(ud(L,ee,"write to private field"),Fe?Fe.call(L,Ht):ee.set(L,Ht),Ht),qr=(L,ee,Ht)=>(ud(L,ee,"access private method"),Ht);var Zt,nn,Pr,Pt,Wt,Br,hi,jr,sr,gi,Do,mi,G0,Ur,Aa,fd,K0;const sw=e=>e;function md(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function aw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yd={exports:{}},Mt=yd.exports={},Xn,Yn;function Ia(){throw new Error("setTimeout has not been defined")}function Ca(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Xn=setTimeout:Xn=Ia}catch{Xn=Ia}try{typeof clearTimeout=="function"?Yn=clearTimeout:Yn=Ca}catch{Yn=Ca}})();function bd(e){if(Xn===setTimeout)return setTimeout(e,0);if((Xn===Ia||!Xn)&&setTimeout)return Xn=setTimeout,setTimeout(e,0);try{return Xn(e,0)}catch{try{return Xn.call(null,e,0)}catch{return Xn.call(this,e,0)}}}function lw(e){if(Yn===clearTimeout)return clearTimeout(e);if((Yn===Ca||!Yn)&&clearTimeout)return Yn=clearTimeout,clearTimeout(e);try{return Yn(e)}catch{try{return Yn.call(null,e)}catch{return Yn.call(this,e)}}}var ar=[],yi=!1,zr,jo=-1;function cw(){!yi||!zr||(yi=!1,zr.length?ar=zr.concat(ar):jo=-1,ar.length&&vd())}function vd(){if(!yi){var e=bd(cw);yi=!0;for(var t=ar.length;t;){for(zr=ar,ar=[];++jo<t;)zr&&zr[jo].run();jo=-1,t=ar.length}zr=null,yi=!1,lw(e)}}Mt.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];ar.push(new wd(e,t)),ar.length===1&&!yi&&bd(vd)};function wd(e,t){this.fun=e,this.array=t}wd.prototype.run=function(){this.fun.apply(null,this.array)},Mt.title="browser",Mt.browser=!0,Mt.env={},Mt.argv=[],Mt.version="",Mt.versions={};function lr(){}Mt.on=lr,Mt.addListener=lr,Mt.once=lr,Mt.off=lr,Mt.removeListener=lr,Mt.removeAllListeners=lr,Mt.emit=lr,Mt.prependListener=lr,Mt.prependOnceListener=lr,Mt.listeners=function(e){return[]},Mt.binding=function(e){throw new Error("process.binding is not supported")},Mt.cwd=function(){return"/"},Mt.chdir=function(e){throw new Error("process.chdir is not supported")},Mt.umask=function(){return 0};var uw=yd.exports;const ve=aw(uw);function cr(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let lt;const Pa=new WeakSet;class fw{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,Pa.has(this)&&(Pa.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Ed(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Id(this),Td(this);const t=lt,n=qn;lt=this,qn=!0;try{return this.fn()}finally{ve.env.NODE_ENV!=="production"&&lt!==this&&cr("Active effect was not restored correctly - this is likely a Vue internal bug."),Ad(this),lt=t,qn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)xa(t);this.deps=this.depsTail=void 0,Id(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Pa.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ka(this)&&this.run()}get dirty(){return ka(this)}}let Sd=0,zi,Wi;function Ed(e,t=!1){if(e.flags|=8,t){e.next=Wi,Wi=e;return}e.next=zi,zi=e}function Fa(){Sd++}function Oa(){if(--Sd>0)return;if(Wi){let t=Wi;for(Wi=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;zi;){let t=zi;for(zi=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 Td(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ad(e){let t,n=e.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),xa(r),dw(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function ka(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Rd(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Rd(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Hi)||(e.globalVersion=Hi,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ka(e))))return;e.flags|=2;const t=e.dep,n=lt,r=qn;lt=e,qn=!0;try{Td(e);const o=e.fn(e._value);(t.version===0||W.hasChanged(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{lt=n,qn=r,Ad(e),e.flags&=-3}}function xa(e,t=!1){const{dep:n,prevSub:r,nextSub:o}=e;if(r&&(r.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=r,e.nextSub=void 0),ve.env.NODE_ENV!=="production"&&n.subsHead===e&&(n.subsHead=o),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)xa(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function dw(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let qn=!0;const _d=[];function bi(){_d.push(qn),qn=!1}function vi(){const e=_d.pop();qn=e===void 0?!0:e}function Id(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=lt;lt=void 0;try{t()}finally{lt=n}}}let Hi=0;class pw{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 Uo{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,ve.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){if(!lt||!qn||lt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==lt)n=this.activeLink=new pw(lt,this),lt.deps?(n.prevDep=lt.depsTail,lt.depsTail.nextDep=n,lt.depsTail=n):lt.deps=lt.depsTail=n,Cd(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=lt.depsTail,n.nextDep=void 0,lt.depsTail.nextDep=n,lt.depsTail=n,lt.deps===n&&(lt.deps=r)}return ve.env.NODE_ENV!=="production"&&lt.onTrack&&lt.onTrack(W.extend({effect:lt},t)),n}trigger(t){this.version++,Hi++,this.notify(t)}notify(t){Fa();try{if(ve.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(W.extend({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Oa()}}}function Cd(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)Cd(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),ve.env.NODE_ENV!=="production"&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}const qo=new WeakMap,Wr=Symbol(ve.env.NODE_ENV!=="production"?"Object iterate":""),Na=Symbol(ve.env.NODE_ENV!=="production"?"Map keys iterate":""),Gi=Symbol(ve.env.NODE_ENV!=="production"?"Array iterate":"");function rn(e,t,n){if(qn&&lt){let r=qo.get(e);r||qo.set(e,r=new Map);let o=r.get(n);o||(r.set(n,o=new Uo),o.map=r,o.key=n),ve.env.NODE_ENV!=="production"?o.track({target:e,type:t,key:n}):o.track()}}function Or(e,t,n,r,o,i){const s=qo.get(e);if(!s){Hi++;return}const a=c=>{c&&(ve.env.NODE_ENV!=="production"?c.trigger({target:e,type:t,key:n,newValue:r,oldValue:o,oldTarget:i}):c.trigger())};if(Fa(),t==="clear")s.forEach(a);else{const c=W.isArray(e),u=c&&W.isIntegerKey(n);if(c&&n==="length"){const l=Number(r);s.forEach((d,f)=>{(f==="length"||f===Gi||!W.isSymbol(f)&&f>=l)&&a(d)})}else switch((n!==void 0||s.has(void 0))&&a(s.get(n)),u&&a(s.get(Gi)),t){case"add":c?u&&a(s.get("length")):(a(s.get(Wr)),W.isMap(e)&&a(s.get(Na)));break;case"delete":c||(a(s.get(Wr)),W.isMap(e)&&a(s.get(Na)));break;case"set":W.isMap(e)&&a(s.get(Wr));break}}Oa()}function hw(e,t){const n=qo.get(e);return n&&n.get(t)}function wi(e){const t=rt(e);return t===e?t:(rn(t,"iterate",Gi),hn(e)?t:t.map(on))}function Vo(e){return rn(e=rt(e),"iterate",Gi),e}const gw={__proto__:null,[Symbol.iterator](){return $a(this,Symbol.iterator,on)},concat(...e){return wi(this).concat(...e.map(t=>W.isArray(t)?wi(t):t))},entries(){return $a(this,"entries",e=>(e[1]=on(e[1]),e))},every(e,t){return ur(this,"every",e,t,void 0,arguments)},filter(e,t){return ur(this,"filter",e,t,n=>n.map(on),arguments)},find(e,t){return ur(this,"find",e,t,on,arguments)},findIndex(e,t){return ur(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ur(this,"findLast",e,t,on,arguments)},findLastIndex(e,t){return ur(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ur(this,"forEach",e,t,void 0,arguments)},includes(...e){return Da(this,"includes",e)},indexOf(...e){return Da(this,"indexOf",e)},join(e){return wi(this).join(e)},lastIndexOf(...e){return Da(this,"lastIndexOf",e)},map(e,t){return ur(this,"map",e,t,void 0,arguments)},pop(){return Ki(this,"pop")},push(...e){return Ki(this,"push",e)},reduce(e,...t){return Pd(this,"reduce",e,t)},reduceRight(e,...t){return Pd(this,"reduceRight",e,t)},shift(){return Ki(this,"shift")},some(e,t){return ur(this,"some",e,t,void 0,arguments)},splice(...e){return Ki(this,"splice",e)},toReversed(){return wi(this).toReversed()},toSorted(e){return wi(this).toSorted(e)},toSpliced(...e){return wi(this).toSpliced(...e)},unshift(...e){return Ki(this,"unshift",e)},values(){return $a(this,"values",on)}};function $a(e,t,n){const r=Vo(e),o=r[t]();return r!==e&&!hn(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.value&&(i.value=n(i.value)),i}),o}const mw=Array.prototype;function ur(e,t,n,r,o,i){const s=Vo(e),a=s!==e&&!hn(e),c=s[t];if(c!==mw[t]){const d=c.apply(e,i);return a?on(d):d}let u=n;s!==e&&(a?u=function(d,f){return n.call(this,on(d),f,e)}:n.length>2&&(u=function(d,f){return n.call(this,d,f,e)}));const l=c.call(s,u,r);return a&&o?o(l):l}function Pd(e,t,n,r){const o=Vo(e);let i=n;return o!==e&&(hn(e)?n.length>3&&(i=function(s,a,c){return n.call(this,s,a,c,e)}):i=function(s,a,c){return n.call(this,s,on(a),c,e)}),o[t](i,...r)}function Da(e,t,n){const r=rt(e);rn(r,"iterate",Gi);const o=r[t](...n);return(o===-1||o===!1)&&Go(n[0])?(n[0]=rt(n[0]),r[t](...n)):o}function Ki(e,t,n=[]){bi(),Fa();const r=rt(e)[t].apply(e,n);return Oa(),vi(),r}const yw=W.makeMap("__proto__,__v_isRef,__isVue"),Fd=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(W.isSymbol));function bw(e){W.isSymbol(e)||(e=String(e));const t=rt(this);return rn(t,"has",e),t.hasOwnProperty(e)}class Od{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return r===(o?i?Dd:$d:i?Cw:Nd).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const s=W.isArray(t);if(!o){let c;if(s&&(c=gw[n]))return c;if(n==="hasOwnProperty")return bw}const a=Reflect.get(t,n,Vt(t)?t:r);return(W.isSymbol(n)?Fd.has(n):yw(n))||(o||rn(t,"get",n),i)?a:Vt(a)?s&&W.isIntegerKey(n)?a:a.value:W.isObject(a)?o?fr(a):Ba(a):a}}class vw extends Od{constructor(t=!1){super(!1,t)}set(t,n,r,o){let i=t[n];if(!this._isShallow){const c=Jn(i);if(!hn(r)&&!Jn(r)&&(i=rt(i),r=rt(r)),!W.isArray(t)&&Vt(i)&&!Vt(r))return c?!1:(i.value=r,!0)}const s=W.isArray(t)&&W.isIntegerKey(n)?Number(n)<t.length:W.hasOwn(t,n),a=Reflect.set(t,n,r,Vt(t)?t:o);return t===rt(o)&&(s?W.hasChanged(r,i)&&Or(t,"set",n,r,i):Or(t,"add",n,r)),a}deleteProperty(t,n){const r=W.hasOwn(t,n),o=t[n],i=Reflect.deleteProperty(t,n);return i&&r&&Or(t,"delete",n,void 0,o),i}has(t,n){const r=Reflect.has(t,n);return(!W.isSymbol(n)||!Fd.has(n))&&rn(t,"has",n),r}ownKeys(t){return rn(t,"iterate",W.isArray(t)?"length":Wr),Reflect.ownKeys(t)}}class kd extends Od{constructor(t=!1){super(!0,t)}set(t,n){return ve.env.NODE_ENV!=="production"&&cr(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return ve.env.NODE_ENV!=="production"&&cr(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const ww=new vw,Sw=new kd,Ew=new kd(!0),La=e=>e,zo=e=>Reflect.getPrototypeOf(e);function Tw(e,t,n){return function(...r){const o=this.__v_raw,i=rt(o),s=W.isMap(i),a=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,u=o[e](...r),l=n?La:t?Ko:on;return!t&&rn(i,"iterate",c?Na:Wr),{next(){const{value:d,done:f}=u.next();return f?{value:d,done:f}:{value:a?[l(d[0]),l(d[1])]:l(d),done:f}},[Symbol.iterator](){return this}}}}function Wo(e){return function(...t){if(ve.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";cr(`${W.capitalize(e)} operation ${n}failed: target is readonly.`,rt(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function Aw(e,t){const n={get(o){const i=this.__v_raw,s=rt(i),a=rt(o);e||(W.hasChanged(o,a)&&rn(s,"get",o),rn(s,"get",a));const{has:c}=zo(s),u=t?La:e?Ko:on;if(c.call(s,o))return u(i.get(o));if(c.call(s,a))return u(i.get(a));i!==s&&i.get(o)},get size(){const o=this.__v_raw;return!e&&rn(rt(o),"iterate",Wr),Reflect.get(o,"size",o)},has(o){const i=this.__v_raw,s=rt(i),a=rt(o);return e||(W.hasChanged(o,a)&&rn(s,"has",o),rn(s,"has",a)),o===a?i.has(o):i.has(o)||i.has(a)},forEach(o,i){const s=this,a=s.__v_raw,c=rt(a),u=t?La:e?Ko:on;return!e&&rn(c,"iterate",Wr),a.forEach((l,d)=>o.call(i,u(l),u(d),s))}};return W.extend(n,e?{add:Wo("add"),set:Wo("set"),delete:Wo("delete"),clear:Wo("clear")}:{add(o){!t&&!hn(o)&&!Jn(o)&&(o=rt(o));const i=rt(this);return zo(i).has.call(i,o)||(i.add(o),Or(i,"add",o,o)),this},set(o,i){!t&&!hn(i)&&!Jn(i)&&(i=rt(i));const s=rt(this),{has:a,get:c}=zo(s);let u=a.call(s,o);u?ve.env.NODE_ENV!=="production"&&xd(s,a,o):(o=rt(o),u=a.call(s,o));const l=c.call(s,o);return s.set(o,i),u?W.hasChanged(i,l)&&Or(s,"set",o,i,l):Or(s,"add",o,i),this},delete(o){const i=rt(this),{has:s,get:a}=zo(i);let c=s.call(i,o);c?ve.env.NODE_ENV!=="production"&&xd(i,s,o):(o=rt(o),c=s.call(i,o));const u=a?a.call(i,o):void 0,l=i.delete(o);return c&&Or(i,"delete",o,void 0,u),l},clear(){const o=rt(this),i=o.size!==0,s=ve.env.NODE_ENV!=="production"?W.isMap(o)?new Map(o):new Set(o):void 0,a=o.clear();return i&&Or(o,"clear",void 0,void 0,s),a}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Tw(o,e,t)}),n}function Ma(e,t){const n=Aw(e,t);return(r,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?r:Reflect.get(W.hasOwn(n,o)&&o in r?n:r,o,i)}const Rw={get:Ma(!1,!1)},_w={get:Ma(!0,!1)},Iw={get:Ma(!0,!0)};function xd(e,t,n){const r=rt(n);if(r!==n&&t.call(e,r)){const o=W.toRawType(e);cr(`Reactive ${o} contains both the raw and reactive versions of the same object${o==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Nd=new WeakMap,Cw=new WeakMap,$d=new WeakMap,Dd=new WeakMap;function Pw(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Fw(e){return e.__v_skip||!Object.isExtensible(e)?0:Pw(W.toRawType(e))}function Ba(e){return Jn(e)?e:ja(e,!1,ww,Rw,Nd)}function fr(e){return ja(e,!0,Sw,_w,$d)}function Ho(e){return ja(e,!0,Ew,Iw,Dd)}function ja(e,t,n,r,o){if(!W.isObject(e))return ve.env.NODE_ENV!=="production"&&cr(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=Fw(e);if(i===0)return e;const s=o.get(e);if(s)return s;const a=new Proxy(e,i===2?r:n);return o.set(e,a),a}function Hr(e){return Jn(e)?Hr(e.__v_raw):!!(e&&e.__v_isReactive)}function Jn(e){return!!(e&&e.__v_isReadonly)}function hn(e){return!!(e&&e.__v_isShallow)}function Go(e){return e?!!e.__v_raw:!1}function rt(e){const t=e&&e.__v_raw;return t?rt(t):e}function Ld(e){return!W.hasOwn(e,"__v_skip")&&Object.isExtensible(e)&&W.def(e,"__v_skip",!0),e}const on=e=>W.isObject(e)?Ba(e):e,Ko=e=>W.isObject(e)?fr(e):e;function Vt(e){return e?e.__v_isRef===!0:!1}function le(e){return Md(e,!1)}function Ow(e){return Md(e,!0)}function Md(e,t){return Vt(e)?e:new kw(e,t)}class kw{constructor(t,n){this.dep=new Uo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:rt(t),this._value=n?t:on(t),this.__v_isShallow=n}get value(){return ve.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||hn(t)||Jn(t);t=r?t:rt(t),W.hasChanged(t,n)&&(this._rawValue=t,this._value=r?t:on(t),ve.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:n}):this.dep.trigger())}}function p(e){return Vt(e)?e.value:e}const xw={get:(e,t,n)=>t==="__v_raw"?e:p(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return Vt(o)&&!Vt(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function Nw(e){return Hr(e)?e:new Proxy(e,xw)}class $w{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Uo,{get:r,set:o}=t(n.track.bind(n),n.trigger.bind(n));this._get=r,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function Bd(e){return new $w(e)}class Dw{constructor(t,n,r){this._object=t,this._key=n,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0}get value(){const t=this._object[this._key];return this._value=t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return hw(rt(this._object),this._key)}}class Lw{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 Mw(e,t,n){return Vt(e)?e:W.isFunction(e)?new Lw(e):W.isObject(e)&&arguments.length>1?Bw(e,t,n):le(e)}function Bw(e,t,n){const r=e[t];return Vt(r)?r:new Dw(e,t,n)}class jw{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Uo(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Hi-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&lt!==this)return Ed(this,!0),!0;ve.env.NODE_ENV}get value(){const t=ve.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return Rd(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter?this.setter(t):ve.env.NODE_ENV!=="production"&&cr("Write operation failed: computed value is readonly")}}function Uw(e,t,n=!1){let r,o;W.isFunction(e)?r=e:(r=e.get,o=e.set);const i=new jw(r,o,n);return ve.env.NODE_ENV,i}const Qo={},Xo=new WeakMap;let Gr;function qw(e,t=!1,n=Gr){if(n){let r=Xo.get(n);r||Xo.set(n,r=[]),r.push(e)}else ve.env.NODE_ENV!=="production"&&!t&&cr("onWatcherCleanup() was called when there was no active watcher to associate with.")}function Vw(e,t,n=W.EMPTY_OBJ){const{immediate:r,deep:o,once:i,scheduler:s,augmentJob:a,call:c}=n,u=h=>{(n.onWarn||cr)("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.")},l=h=>o?h:hn(h)||o===!1||o===0?dr(h,1):dr(h);let d,f,m,w,y=!1,E=!1;if(Vt(e)?(f=()=>e.value,y=hn(e)):Hr(e)?(f=()=>l(e),y=!0):W.isArray(e)?(E=!0,y=e.some(h=>Hr(h)||hn(h)),f=()=>e.map(h=>{if(Vt(h))return h.value;if(Hr(h))return l(h);if(W.isFunction(h))return c?c(h,2):h();ve.env.NODE_ENV!=="production"&&u(h)})):W.isFunction(e)?t?f=c?()=>c(e,2):e:f=()=>{if(m){bi();try{m()}finally{vi()}}const h=Gr;Gr=d;try{return c?c(e,3,[w]):e(w)}finally{Gr=h}}:(f=W.NOOP,ve.env.NODE_ENV!=="production"&&u(e)),t&&o){const h=f,S=o===!0?1/0:o;f=()=>dr(h(),S)}const b=()=>{d.stop()};if(i&&t){const h=t;t=(...S)=>{h(...S),b()}}let g=E?new Array(e.length).fill(Qo):Qo;const v=h=>{if(!(!(d.flags&1)||!d.dirty&&!h))if(t){const S=d.run();if(o||y||(E?S.some((T,I)=>W.hasChanged(T,g[I])):W.hasChanged(S,g))){m&&m();const T=Gr;Gr=d;try{const I=[S,g===Qo?void 0:E&&g[0]===Qo?[]:g,w];g=S,c?c(t,3,I):t(...I)}finally{Gr=T}}}else d.run()};return a&&a(v),d=new fw(f),d.scheduler=s?()=>s(v,!1):v,w=h=>qw(h,!1,d),m=d.onStop=()=>{const h=Xo.get(d);if(h){if(c)c(h,4);else for(const S of h)S();Xo.delete(d)}},ve.env.NODE_ENV!=="production"&&(d.onTrack=n.onTrack,d.onTrigger=n.onTrigger),t?r?v(!0):g=d.run():s?s(v.bind(null,!0),!0):d.run(),b.pause=d.pause.bind(d),b.resume=d.resume.bind(d),b.stop=b,b}function dr(e,t=1/0,n){if(t<=0||!W.isObject(e)||e.__v_skip||(n=n||new Set,n.has(e)))return e;if(n.add(e),t--,Vt(e))dr(e.value,t,n);else if(W.isArray(e))for(let r=0;r<e.length;r++)dr(e[r],t,n);else if(W.isSet(e)||W.isMap(e))e.forEach(r=>{dr(r,t,n)});else if(W.isPlainObject(e)){for(const r in e)dr(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&dr(e[r],t,n)}return e}const Kr=[];function zw(e){Kr.push(e)}function Ww(){Kr.pop()}let Ua=!1;function Ze(e,...t){if(Ua)return;Ua=!0,bi();const n=Kr.length?Kr[Kr.length-1].component:null,r=n&&n.appContext.config.warnHandler,o=Hw();if(r)Yo(r,n,11,[e+t.map(i=>{var s,a;return(a=(s=i.toString)==null?void 0:s.call(i))!=null?a:JSON.stringify(i)}).join(""),n&&n.proxy,o.map(({vnode:i})=>`at <${_p(n,i.type)}>`).join(`
2
- `),o]);else{const i=[`[Vue warn]: ${e}`,...t];o.length&&i.push(`
3
- `,...Gw(o)),console.warn(...i)}vi(),Ua=!1}function Hw(){let e=Kr[Kr.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 Gw(e){const t=[];return e.forEach((n,r)=>{t.push(...r===0?[]:[`
4
- `],...Kw(n))}),t}function Kw({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",r=e.component?e.component.parent==null:!1,o=` at <${_p(e.component,e.type,r)}`,i=">"+n;return e.props?[o,...Qw(e.props),i]:[o+i]}function Qw(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(r=>{t.push(...jd(r,e[r]))}),n.length>3&&t.push(" ..."),t}function jd(e,t,n){return W.isString(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:Vt(t)?(t=jd(e,rt(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):W.isFunction(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=rt(t),n?t:[`${e}=`,t])}const qa={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 Yo(e,t,n,r){try{return r?e(...r):e()}catch(o){Jo(o,t,n)}}function Va(e,t,n,r){if(W.isFunction(e)){const o=Yo(e,t,n,r);return o&&W.isPromise(o)&&o.catch(i=>{Jo(i,t,n)}),o}if(W.isArray(e)){const o=[];for(let i=0;i<e.length;i++)o.push(Va(e[i],t,n,r));return o}else ve.env.NODE_ENV!=="production"&&Ze(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function Jo(e,t,n,r=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||W.EMPTY_OBJ;if(t){let a=t.parent;const c=t.proxy,u=ve.env.NODE_ENV!=="production"?qa[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const l=a.ec;if(l){for(let d=0;d<l.length;d++)if(l[d](e,c,u)===!1)return}a=a.parent}if(i){bi(),Yo(i,null,10,[e,c,u]),vi();return}}Xw(e,n,o,r,s)}function Xw(e,t,n,r=!0,o=!1){if(ve.env.NODE_ENV!=="production"){const i=qa[t];if(n&&zw(n),Ze(`Unhandled error${i?` during execution of ${i}`:""}`),n&&Ww(),r)throw e;console.error(e)}else{if(o)throw e;console.error(e)}}const kn=[];let pr=-1;const Si=[];let kr=null,Ei=0;const Ud=Promise.resolve();let Zo=null;const Yw=100;function _n(e){const t=Zo||Ud;return e?t.then(this?e.bind(this):e):t}function Jw(e){let t=pr+1,n=kn.length;for(;t<n;){const r=t+n>>>1,o=kn[r],i=Qi(o);i<e||i===e&&o.flags&2?t=r+1:n=r}return t}function za(e){if(!(e.flags&1)){const t=Qi(e),n=kn[kn.length-1];!n||!(e.flags&2)&&t>=Qi(n)?kn.push(e):kn.splice(Jw(t),0,e),e.flags|=1,qd()}}function qd(){Zo||(Zo=Ud.then(zd))}function Vd(e){W.isArray(e)?Si.push(...e):kr&&e.id===-1?kr.splice(Ei+1,0,e):e.flags&1||(Si.push(e),e.flags|=1),qd()}function Zw(e){if(Si.length){const t=[...new Set(Si)].sort((n,r)=>Qi(n)-Qi(r));if(Si.length=0,kr){kr.push(...t);return}for(kr=t,ve.env.NODE_ENV!=="production"&&(e=e||new Map),Ei=0;Ei<kr.length;Ei++){const n=kr[Ei];ve.env.NODE_ENV!=="production"&&Wd(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}kr=null,Ei=0}}const Qi=e=>e.id==null?e.flags&2?-1:1/0:e.id;function zd(e){ve.env.NODE_ENV!=="production"&&(e=e||new Map);const t=ve.env.NODE_ENV!=="production"?n=>Wd(e,n):W.NOOP;try{for(pr=0;pr<kn.length;pr++){const n=kn[pr];if(n&&!(n.flags&8)){if(ve.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),Yo(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;pr<kn.length;pr++){const n=kn[pr];n&&(n.flags&=-2)}pr=-1,kn.length=0,Zw(e),Zo=null,(kn.length||Si.length)&&zd(e)}}function Wd(e,t){const n=e.get(t)||0;if(n>Yw){const r=t.i,o=r&&us(r.type);return Jo(`Maximum recursive updates exceeded${o?` in component <${o}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,n+1),!1}let Xi=!1;const Wa=new Map;ve.env.NODE_ENV!=="production"&&(W.getGlobalThis().__VUE_HMR_RUNTIME__={createRecord:Ha(eS),rerender:Ha(tS),reload:Ha(nS)});const es=new Map;function eS(e,t){return es.has(e)?!1:(es.set(e,{initialDef:ts(t),instances:new Set}),!0)}function ts(e){return Ip(e)?e.__vccOpts:e}function tS(e,t){const n=es.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(r=>{t&&(r.render=t,ts(r.type).render=t),r.renderCache=[],Xi=!0,r.update(),Xi=!1}))}function nS(e,t){const n=es.get(e);if(!n)return;t=ts(t),Hd(n.initialDef,t);const r=[...n.instances];for(let o=0;o<r.length;o++){const i=r[o],s=ts(i.type);let a=Wa.get(s);a||(s!==n.initialDef&&Hd(s,t),Wa.set(s,a=new Set)),a.add(i),i.appContext.propsCache.delete(i.type),i.appContext.emitsCache.delete(i.type),i.appContext.optionsCache.delete(i.type),i.ceReload?(a.add(i),i.ceReload(t.styles),a.delete(i)):i.parent?za(()=>{Xi=!0,i.parent.update(),Xi=!1,a.delete(i)}):i.appContext.reload?i.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),i.root.ce&&i!==i.root&&i.root.ce._removeChildStyle(s)}Vd(()=>{Wa.clear()})}function Hd(e,t){W.extend(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function Ha(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 xr,Yi=[],Ga=!1;function rS(e,...t){xr?xr.emit(e,...t):Ga||Yi.push({event:e,args:t})}function Gd(e,t){var n,r;xr=e,xr?(xr.enabled=!0,Yi.forEach(({event:o,args:i})=>xr.emit(o,...i)),Yi=[]):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(i=>{Gd(i,t)}),setTimeout(()=>{xr||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Ga=!0,Yi=[])},3e3)):(Ga=!0,Yi=[])}const iS=oS("component:updated");/*! #__NO_SIDE_EFFECTS__ */function oS(e){return t=>{rS(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let tn=null,Kd=null;function Qd(e){const t=tn;return tn=e,Kd=e&&e.type.__scopeId||null,t}function Se(e,t=tn,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&bp(-1);const i=Qd(t);let s;try{s=e(...o)}finally{Qd(i),r._d&&bp(1)}return ve.env.NODE_ENV!=="production"&&iS(t),s};return r._n=!0,r._c=!0,r._d=!0,r}function ot(e,t){if(tn===null)return ve.env.NODE_ENV!=="production"&&Ze("withDirectives can only be used inside render functions."),e;const n=Rp(tn),r=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,s,a,c=W.EMPTY_OBJ]=t[o];i&&(W.isFunction(i)&&(i={mounted:i,updated:i}),i.deep&&dr(s),r.push({dir:i,instance:n,value:s,oldValue:void 0,arg:a,modifiers:c}))}return e}const sS=Symbol("_vte"),aS=e=>e.__isTeleport,Qr=e=>e&&(e.disabled||e.disabled===""),Xd=e=>e&&(e.defer||e.defer===""),Yd=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Jd=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ka=(e,t)=>{const n=e&&e.to;if(W.isString(n))if(t){const r=t(n);return ve.env.NODE_ENV!=="production"&&!r&&!Qr(e)&&Ze(`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 ve.env.NODE_ENV!=="production"&&Ze("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"),null;else return ve.env.NODE_ENV!=="production"&&!n&&!Qr(e)&&Ze(`Invalid Teleport target: ${n}`),n},Zd={name:"Teleport",__isTeleport:!0,process(e,t,n,r,o,i,s,a,c,u){const{mc:l,pc:d,pbc:f,o:{insert:m,querySelector:w,createText:y,createComment:E}}=u,b=Qr(t.props);let{shapeFlag:g,children:v,dynamicChildren:h}=t;if(ve.env.NODE_ENV!=="production"&&Xi&&(c=!1,h=null),e==null){const S=t.el=ve.env.NODE_ENV!=="production"?E("teleport start"):y(""),T=t.anchor=ve.env.NODE_ENV!=="production"?E("teleport end"):y("");m(S,n,r),m(T,n,r);const I=(A,$)=>{g&16&&(o&&o.isCE&&(o.ce._teleportTarget=A),l(v,A,$,o,i,s,a,c))},_=()=>{const A=t.target=Ka(t.props,w),$=tp(A,t,y,m);A?(s!=="svg"&&Yd(A)?s="svg":s!=="mathml"&&Jd(A)&&(s="mathml"),b||(I(A,$),rs(t,!1))):ve.env.NODE_ENV!=="production"&&!b&&Ze("Invalid Teleport target on mount:",A,`(${typeof A})`)};b&&(I(n,T),rs(t,!0)),Xd(t.props)?(t.el.__isMounted=!1,nl(()=>{_(),delete t.el.__isMounted},i)):_()}else{if(Xd(t.props)&&e.el.__isMounted===!1){nl(()=>{Zd.process(e,t,n,r,o,i,s,a,c,u)},i);return}t.el=e.el,t.targetStart=e.targetStart;const S=t.anchor=e.anchor,T=t.target=e.target,I=t.targetAnchor=e.targetAnchor,_=Qr(e.props),A=_?n:T,$=_?S:I;if(s==="svg"||Yd(T)?s="svg":(s==="mathml"||Jd(T))&&(s="mathml"),h?(f(e.dynamicChildren,h,A,o,i,s,a),gp(e,t,ve.env.NODE_ENV==="production")):c||d(e,t,A,$,o,i,s,a,!1),b)_?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ns(t,n,S,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const D=t.target=Ka(t.props,w);D?ns(t,D,null,u,0):ve.env.NODE_ENV!=="production"&&Ze("Invalid Teleport target on update:",T,`(${typeof T})`)}else _&&ns(t,T,I,u,1);rs(t,b)}},remove(e,t,n,{um:r,o:{remove:o}},i){const{shapeFlag:s,children:a,anchor:c,targetStart:u,targetAnchor:l,target:d,props:f}=e;if(d&&(o(u),o(l)),i&&o(c),s&16){const m=i||!Qr(f);for(let w=0;w<a.length;w++){const y=a[w];r(y,t,n,m,!!y.dynamicChildren)}}},move:ns,hydrate:lS};function ns(e,t,n,{o:{insert:r},m:o},i=2){i===0&&r(e.targetAnchor,t,n);const{el:s,anchor:a,shapeFlag:c,children:u,props:l}=e,d=i===2;if(d&&r(s,t,n),(!d||Qr(l))&&c&16)for(let f=0;f<u.length;f++)o(u[f],t,n,2);d&&r(a,t,n)}function lS(e,t,n,r,o,i,{o:{nextSibling:s,parentNode:a,querySelector:c,insert:u,createText:l}},d){const f=t.target=Ka(t.props,c);if(f){const m=Qr(t.props),w=f._lpa||f.firstChild;if(t.shapeFlag&16)if(m)t.anchor=d(s(e),t,a(e),n,r,o,i),t.targetStart=w,t.targetAnchor=w&&s(w);else{t.anchor=s(e);let y=w;for(;y;){if(y&&y.nodeType===8){if(y.data==="teleport start anchor")t.targetStart=y;else if(y.data==="teleport anchor"){t.targetAnchor=y,f._lpa=t.targetAnchor&&s(t.targetAnchor);break}}y=s(y)}t.targetAnchor||tp(f,t,l,u),d(w&&s(w),t,f,n,r,o,i)}rs(t,m)}return t.anchor&&s(t.anchor)}const ep=Zd;function rs(e,t){const n=e.ctx;if(n&&n.ut){let r,o;for(t?(r=e.el,o=e.anchor):(r=e.targetStart,o=e.targetAnchor);r&&r!==o;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function tp(e,t,n,r){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[sS]=i,e&&(r(o,e),r(i,e)),i}function np(e,t){e.shapeFlag&6&&e.component?(e.transition=t,np(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}/*! #__NO_SIDE_EFFECTS__ */function Ne(e,t){return W.isFunction(e)?W.extend({name:e.name},t,{setup:e}):e}function cS(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const uS=new WeakSet;function Qa(e){const t=ol(),n=Ow(null);if(t){const o=t.refs===W.EMPTY_OBJ?t.refs={}:t.refs;let i;ve.env.NODE_ENV!=="production"&&(i=Object.getOwnPropertyDescriptor(o,e))&&!i.configurable?Ze(`useTemplateRef('${e}') already exists.`):Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:s=>n.value=s})}else ve.env.NODE_ENV!=="production"&&Ze("useTemplateRef() is called when there is no active component instance to be associated with.");const r=ve.env.NODE_ENV!=="production"?fr(n):n;return ve.env.NODE_ENV!=="production"&&uS.add(r),r}const rp=e=>e.nodeType===8;W.getGlobalThis().requestIdleCallback,W.getGlobalThis().cancelIdleCallback;function fS(e,t){if(rp(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(rp(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const dS=e=>!!e.type.__asyncLoader;/*! #__NO_SIDE_EFFECTS__ */function pS(e){W.isFunction(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:o=200,hydrate:i,timeout:s,suspensible:a=!0,onError:c}=e;let u=null,l,d=0;const f=()=>(d++,u=null,m()),m=()=>{let w;return u||(w=u=t().catch(y=>{if(y=y instanceof Error?y:new Error(String(y)),c)return new Promise((E,b)=>{c(y,()=>E(f()),()=>b(y),d+1)});throw y}).then(y=>{if(w!==u&&u)return u;if(ve.env.NODE_ENV!=="production"&&!y&&Ze("Async component loader resolved to undefined. If you are using retry(), make sure to return its return value."),y&&(y.__esModule||y[Symbol.toStringTag]==="Module")&&(y=y.default),ve.env.NODE_ENV!=="production"&&y&&!W.isObject(y)&&!W.isFunction(y))throw new Error(`Invalid async component load result: ${y}`);return l=y,y}))};return Ne({name:"AsyncComponentWrapper",__asyncLoader:m,__asyncHydrate(w,y,E){let b=!1;const g=i?()=>{const h=i(()=>{if(ve.env.NODE_ENV!=="production"&&b){Ze(`Skipping lazy hydration for component '${us(l)}': it was updated before lazy hydration performed.`);return}E()},S=>fS(w,S));h&&(y.bum||(y.bum=[])).push(h),(y.u||(y.u=[])).push(()=>b=!0)}:E;l?g():m().then(()=>!y.isUnmounted&&g())},get __asyncResolved(){return l},setup(){const w=En;if(cS(w),l)return()=>Xa(l,w);const y=v=>{u=null,Jo(v,w,13,!r)};if(a&&w.suspense||_i)return m().then(v=>()=>Xa(v,w)).catch(v=>(y(v),()=>r?he(r,{error:v}):null));const E=le(!1),b=le(),g=le(!!o);return o&&setTimeout(()=>{g.value=!1},o),s!=null&&setTimeout(()=>{if(!E.value&&!b.value){const v=new Error(`Async component timed out after ${s}ms.`);y(v),b.value=v}},s),m().then(()=>{E.value=!0,w.parent&&hS(w.parent.vnode)&&w.parent.update()}).catch(v=>{y(v),b.value=v}),()=>{if(E.value&&l)return Xa(l,w);if(b.value&&r)return he(r,{error:b.value});if(n&&!g.value)return he(n)}}})}function Xa(e,t){const{ref:n,props:r,children:o,ce:i}=t.vnode,s=he(e,r,o);return s.ref=n,s.ce=i,delete t.vnode.ce,s}const hS=e=>e.type.__isKeepAlive;function gS(e,t,n=En,r=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...s)=>{bi();const a=Tp(n),c=Va(t,n,e,s);return a(),vi(),c});return r?o.unshift(i):o.push(i),i}else if(ve.env.NODE_ENV!=="production"){const o=W.toHandlerKey(qa[e].replace(/ hook$/,""));Ze(`${o} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const is=e=>(t,n=En)=>{(!_i||e==="sp")&&gS(e,(...r)=>t(...r),n)},Bt=is("m"),mS=is("bu"),Vn=is("bum"),Ya=is("um"),os="components",yS="directives";function pe(e,t){return Ja(os,e,!0,t)||e}const ip=Symbol.for("v-ndc");function Nr(e){return W.isString(e)?Ja(os,e,!1)||e:e||ip}function ln(e){return Ja(yS,e)}function Ja(e,t,n=!0,r=!1){const o=tn||En;if(o){const i=o.type;if(e===os){const a=us(i,!1);if(a&&(a===t||a===W.camelize(t)||a===W.capitalize(W.camelize(t))))return i}const s=op(o[e]||i[e],t)||op(o.appContext[e],t);if(!s&&r)return i;if(ve.env.NODE_ENV!=="production"&&n&&!s){const a=e===os?`
5
- If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`:"";Ze(`Failed to resolve ${e.slice(0,-1)}: ${t}${a}`)}return s}else ve.env.NODE_ENV!=="production"&&Ze(`resolve${W.capitalize(e.slice(0,-1))} can only be used in render() or setup().`)}function op(e,t){return e&&(e[t]||e[W.camelize(t)]||e[W.capitalize(W.camelize(t))])}function wt(e,t,n,r){let o;const i=n,s=W.isArray(e);if(s||W.isString(e)){const a=s&&Hr(e);let c=!1,u=!1;a&&(c=!hn(e),u=Jn(e),e=Vo(e)),o=new Array(e.length);for(let l=0,d=e.length;l<d;l++)o[l]=t(c?u?Ko(on(e[l])):on(e[l]):e[l],l,void 0,i)}else if(typeof e=="number"){ve.env.NODE_ENV!=="production"&&!Number.isInteger(e)&&Ze(`The v-for range expect an integer value but got ${e}.`),o=new Array(e);for(let a=0;a<e;a++)o[a]=t(a+1,a,void 0,i)}else if(W.isObject(e))if(e[Symbol.iterator])o=Array.from(e,(a,c)=>t(a,c,void 0,i));else{const a=Object.keys(e);o=new Array(a.length);for(let c=0,u=a.length;c<u;c++){const l=a[c];o[c]=t(e[l],l,c,i)}}else o=[];return o}function sp(e,t){for(let n=0;n<t.length;n++){const r=t[n];if(W.isArray(r))for(let o=0;o<r.length;o++)e[r[o].name]=r[o].fn;else r&&(e[r.name]=r.key?(...o)=>{const i=r.fn(...o);return i&&(i.key=r.key),i}:r.fn)}return e}function Xe(e,t,n={},r,o){if(tn.ce||tn.parent&&dS(tn.parent)&&tn.parent.ce)return t!=="default"&&(n.name=t),X(),Ae(qe,null,[he("slot",n,r&&r())],64);let i=e[t];ve.env.NODE_ENV!=="production"&&i&&i.length>1&&(Ze("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."),i=()=>[]),i&&i._c&&(i._d=!1),X();const s=i&&ap(i(n)),a=n.key||s&&s.key,c=Ae(qe,{key:(a&&!W.isSymbol(a)?a:`_${t}`)+(!s&&r?"_fb":"")},s||(r?r():[]),s&&e._===1?64:-2);return!o&&c.scopeId&&(c.slotScopeIds=[c.scopeId+"-s"]),i&&i._c&&(i._d=!0),c}function ap(e){return e.some(t=>ls(t)?!(t.type===Ai||t.type===qe&&!ap(t.children)):!0)?e:null}function Za(e,t){const n={};if(ve.env.NODE_ENV!=="production"&&!W.isObject(e))return Ze("v-on with no argument expects an object value."),n;for(const r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:W.toHandlerKey(r)]=e[r];return n}const el=e=>e?$S(e)?Rp(e):el(e.parent):null,tl=W.extend(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>ve.env.NODE_ENV!=="production"?Ho(e.props):e.props,$attrs:e=>ve.env.NODE_ENV!=="production"?Ho(e.attrs):e.attrs,$slots:e=>ve.env.NODE_ENV!=="production"?Ho(e.slots):e.slots,$refs:e=>ve.env.NODE_ENV!=="production"?Ho(e.refs):e.refs,$parent:e=>el(e.parent),$root:e=>el(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>wS(e),$forceUpdate:e=>e.f||(e.f=()=>{za(e.update)}),$nextTick:e=>e.n||(e.n=_n.bind(e.proxy)),$watch:e=>CS.bind(e)}),bS={};ve.env.NODE_ENV!=="production"&&(bS.ownKeys=e=>(Ze("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 vS(){return cp().slots}function lp(){return cp().attrs}function cp(){const e=ol();return ve.env.NODE_ENV!=="production"&&!e&&Ze("useContext() called without active instance."),e.setupContext||(e.setupContext=LS(e))}function up(e){return W.isArray(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function wS(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:s}}=e.appContext,a=i.get(t);let c;return a?c=a:!o.length&&!n&&!r?c=t:(c={},o.length&&o.forEach(u=>ss(c,u,s,!0)),ss(c,t,s)),W.isObject(t)&&i.set(t,c),c}function ss(e,t,n,r=!1){const{mixins:o,extends:i}=t;i&&ss(e,i,n,!0),o&&o.forEach(s=>ss(e,s,n,!0));for(const s in t)if(r&&s==="expose")ve.env.NODE_ENV!=="production"&&Ze('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const a=SS[s]||n&&n[s];e[s]=a?a(e[s],t[s]):t[s]}return e}const SS={data:fp,props:pp,emits:pp,methods:Ji,computed:Ji,beforeCreate:gn,created:gn,beforeMount:gn,mounted:gn,beforeUpdate:gn,updated:gn,beforeDestroy:gn,beforeUnmount:gn,destroyed:gn,unmounted:gn,activated:gn,deactivated:gn,errorCaptured:gn,serverPrefetch:gn,components:Ji,directives:Ji,watch:TS,provide:fp,inject:ES};function fp(e,t){return t?e?function(){return W.extend(W.isFunction(e)?e.call(this,this):e,W.isFunction(t)?t.call(this,this):t)}:t:e}function ES(e,t){return Ji(dp(e),dp(t))}function dp(e){if(W.isArray(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function gn(e,t){return e?[...new Set([].concat(e,t))]:t}function Ji(e,t){return e?W.extend(Object.create(null),e,t):t}function pp(e,t){return e?W.isArray(e)&&W.isArray(t)?[...new Set([...e,...t])]:W.extend(Object.create(null),up(e),up(t??{})):t}function TS(e,t){if(!e)return t;if(!t)return e;const n=W.extend(Object.create(null),e);for(const r in t)n[r]=gn(e[r],t[r]);return n}let AS=null;function Ti(e,t){if(!En)ve.env.NODE_ENV!=="production"&&Ze("provide() can only be used inside setup().");else{let n=En.provides;const r=En.parent&&En.parent.provides;r===n&&(n=En.provides=Object.create(r)),n[e]=t}}function hr(e,t,n=!1){const r=En||tn;if(r||AS){let o=r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&W.isFunction(t)?t.call(r&&r.proxy):t;ve.env.NODE_ENV!=="production"&&Ze(`injection "${String(e)}" not found.`)}else ve.env.NODE_ENV!=="production"&&Ze("inject() can only be used inside setup() or functional components.")}const RS={},hp=e=>Object.getPrototypeOf(e)===RS,nl=OS;function gp(e,t,n=!1){const r=e.children,o=t.children;if(W.isArray(r)&&W.isArray(o))for(let i=0;i<r.length;i++){const s=r[i];let a=o[i];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=o[i]=NS(o[i]),a.el=s.el),!n&&a.patchFlag!==-2&&gp(s,a)),a.type===yp&&(a.el=s.el),a.type===Ai&&!a.el&&(a.el=s.el),ve.env.NODE_ENV!=="production"&&a.el&&(a.el.__vnode=a)}}const _S=Symbol.for("v-scx"),IS=()=>{{const e=hr(_S);return e||ve.env.NODE_ENV!=="production"&&Ze("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function St(e,t,n){return ve.env.NODE_ENV!=="production"&&!W.isFunction(t)&&Ze("`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."),mp(e,t,n)}function mp(e,t,n=W.EMPTY_OBJ){const{immediate:r,deep:o,flush:i,once:s}=n;ve.env.NODE_ENV!=="production"&&!t&&(r!==void 0&&Ze('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&Ze('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),s!==void 0&&Ze('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const a=W.extend({},n);ve.env.NODE_ENV!=="production"&&(a.onWarn=Ze);const c=t&&r||!t&&i!=="post";let u;if(_i){if(i==="sync"){const m=IS();u=m.__watcherHandles||(m.__watcherHandles=[])}else if(!c){const m=()=>{};return m.stop=W.NOOP,m.resume=W.NOOP,m.pause=W.NOOP,m}}const l=En;a.call=(m,w,y)=>Va(m,l,w,y);let d=!1;i==="post"?a.scheduler=m=>{nl(m,l&&l.suspense)}:i!=="sync"&&(d=!0,a.scheduler=(m,w)=>{w?m():za(m)}),a.augmentJob=m=>{t&&(m.flags|=4),d&&(m.flags|=2,l&&(m.id=l.uid,m.i=l))};const f=Vw(e,t,a);return _i&&(u?u.push(f):c&&f()),f}function CS(e,t,n){const r=this.proxy,o=W.isString(e)?e.includes(".")?PS(r,e):()=>r[e]:e.bind(r,r);let i;W.isFunction(t)?i=t:(i=t.handler,n=t);const s=Tp(this),a=mp(o,i.bind(r),n);return s(),a}function PS(e,t){const n=t.split(".");return()=>{let r=e;for(let o=0;o<n.length&&r;o++)r=r[n[o]];return r}}const FS=e=>e.__isSuspense;function OS(e,t){t&&t.pendingBranch?W.isArray(e)?t.effects.push(...e):t.effects.push(e):Vd(e)}const qe=Symbol.for("v-fgt"),yp=Symbol.for("v-txt"),Ai=Symbol.for("v-cmt"),as=[];let In=null;function X(e=!1){as.push(In=e?null:[])}function kS(){as.pop(),In=as[as.length-1]||null}let Zi=1;function bp(e,t=!1){Zi+=e,e<0&&In&&t&&(In.hasOnce=!0)}function vp(e){return e.dynamicChildren=Zi>0?In||W.EMPTY_ARR:null,kS(),Zi>0&&In&&In.push(e),e}function de(e,t,n,r,o,i){return vp(fe(e,t,n,r,o,i,!0))}function Ae(e,t,n,r,o){return vp(he(e,t,n,r,o,!0))}function ls(e){return e?e.__v_isVNode===!0:!1}const xS=(...e)=>Sp(...e),wp=({key:e})=>e??null,cs=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?W.isString(e)||Vt(e)||W.isFunction(e)?{i:tn,r:e,k:t,f:!!n}:e:null);function fe(e,t=null,n=null,r=0,o=null,i=e===qe?0:1,s=!1,a=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&wp(t),ref:t&&cs(t),scopeId:Kd,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:i,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:tn};return a?(il(c,n),i&128&&e.normalize(c)):n&&(c.shapeFlag|=W.isString(n)?8:16),ve.env.NODE_ENV!=="production"&&c.key!==c.key&&Ze("VNode created with invalid key (NaN). VNode type:",c.type),Zi>0&&!s&&In&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&In.push(c),c}const he=ve.env.NODE_ENV!=="production"?xS:Sp;function Sp(e,t=null,n=null,r=0,o=null,i=!1){if((!e||e===ip)&&(ve.env.NODE_ENV!=="production"&&!e&&Ze(`Invalid vnode type when creating vnode: ${e}.`),e=Ai),ls(e)){const a=Ri(e,t,!0);return n&&il(a,n),Zi>0&&!i&&In&&(a.shapeFlag&6?In[In.indexOf(e)]=a:In.push(a)),a.patchFlag=-2,a}if(Ip(e)&&(e=e.__vccOpts),t){t=rl(t);let{class:a,style:c}=t;a&&!W.isString(a)&&(t.class=W.normalizeClass(a)),W.isObject(c)&&(Go(c)&&!W.isArray(c)&&(c=W.extend({},c)),t.style=W.normalizeStyle(c))}const s=W.isString(e)?1:FS(e)?128:aS(e)?64:W.isObject(e)?4:W.isFunction(e)?2:0;return ve.env.NODE_ENV!=="production"&&s&4&&Go(e)&&(e=rt(e),Ze("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,o,s,i,!0)}function rl(e){return e?Go(e)||hp(e)?W.extend({},e):e:null}function Ri(e,t,n=!1,r=!1){const{props:o,ref:i,patchFlag:s,children:a,transition:c}=e,u=t?Gt(o||{},t):o,l={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&wp(u),ref:t&&t.ref?n&&i?W.isArray(i)?i.concat(cs(t)):[i,cs(t)]:cs(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:ve.env.NODE_ENV!=="production"&&s===-1&&W.isArray(a)?a.map(Ep):a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==qe?s===-1?16:s|16:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ri(e.ssContent),ssFallback:e.ssFallback&&Ri(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&np(l,c.clone(l)),l}function Ep(e){const t=Ri(e);return W.isArray(e.children)&&(t.children=e.children.map(Ep)),t}function Ot(e=" ",t=0){return he(yp,null,e,t)}function Ce(e="",t=!1){return t?(X(),Ae(Ai,null,e)):he(Ai,null,e)}function NS(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ri(e)}function il(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(W.isArray(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),il(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!hp(t)?t._ctx=tn:o===3&&tn&&(tn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else W.isFunction(t)?(t={default:t,_ctx:tn},n=32):(t=String(t),r&64?(n=16,t=[Ot(t)]):n=8);e.children=t,e.shapeFlag|=n}function Gt(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const o in r)if(o==="class")t.class!==r.class&&(t.class=W.normalizeClass([t.class,r.class]));else if(o==="style")t.style=W.normalizeStyle([t.style,r.style]);else if(W.isOn(o)){const i=t[o],s=r[o];s&&i!==s&&!(W.isArray(i)&&i.includes(s))&&(t[o]=i?[].concat(i,s):s)}else o!==""&&(t[o]=r[o])}return t}let En=null;const ol=()=>En||tn;let sl;{const e=W.getGlobalThis(),t=(n,r)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(r),i=>{o.length>1?o.forEach(s=>s(i)):o[0](i)}};sl=t("__VUE_INSTANCE_SETTERS__",n=>En=n),t("__VUE_SSR_SETTERS__",n=>_i=n)}const Tp=e=>{const t=En;return sl(e),e.scope.on(),()=>{e.scope.off(),sl(t)}};function $S(e){return e.vnode.shapeFlag&4}let _i=!1;const Ap=ve.env.NODE_ENV!=="production"?{get(e,t){return rn(e,"get",""),e[t]},set(){return Ze("setupContext.attrs is readonly."),!1},deleteProperty(){return Ze("setupContext.attrs is readonly."),!1}}:{get(e,t){return rn(e,"get",""),e[t]}};function DS(e){return new Proxy(e.slots,{get(t,n){return rn(e,"get","$slots"),t[n]}})}function LS(e){const t=n=>{if(ve.env.NODE_ENV!=="production"&&(e.exposed&&Ze("expose() should be called only once per setup()."),n!=null)){let r=typeof n;r==="object"&&(W.isArray(n)?r="array":Vt(n)&&(r="ref")),r!=="object"&&Ze(`expose() should be passed a plain object, received ${r}.`)}e.exposed=n||{}};if(ve.env.NODE_ENV!=="production"){let n,r;return Object.freeze({get attrs(){return n||(n=new Proxy(e.attrs,Ap))},get slots(){return r||(r=DS(e))},get emit(){return(o,...i)=>e.emit(o,...i)},expose:t})}else return{attrs:new Proxy(e.attrs,Ap),slots:e.slots,emit:e.emit,expose:t}}function Rp(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Nw(Ld(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in tl)return tl[n](e)},has(t,n){return n in t||n in tl}})):e.proxy}const MS=/(?:^|[-_])(\w)/g,BS=e=>e.replace(MS,t=>t.toUpperCase()).replace(/[-_]/g,"");function us(e,t=!0){return W.isFunction(e)?e.displayName||e.name:e.name||t&&e.__name}function _p(e,t,n=!1){let r=us(t);if(!r&&t.__file){const o=t.__file.match(/([^/\\]+)\.\w+$/);o&&(r=o[1])}if(!r&&e&&e.parent){const o=i=>{for(const s in i)if(i[s]===t)return s};r=o(e.components||e.parent.type.components)||o(e.appContext.components)}return r?BS(r):n?"App":"Anonymous"}function Ip(e){return W.isFunction(e)&&"__vccOpts"in e}const B=(e,t)=>{const n=Uw(e,t,_i);if(ve.env.NODE_ENV!=="production"){const r=ol();r&&r.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function al(e,t,n){const r=arguments.length;return r===2?W.isObject(t)&&!W.isArray(t)?ls(t)?he(e,null,[t]):he(e,t):he(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ls(n)&&(n=[n]),he(e,t,n))}function jS(){if(ve.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},n={style:"color:#f5222d"},r={style:"color:#eb2f96"},o={__vue_custom_formatter:!0,header(d){if(!W.isObject(d))return null;if(d.__isVue)return["div",e,"VueInstance"];if(Vt(d)){bi();const f=d.value;return vi(),["div",{},["span",e,l(d)],"<",a(f),">"]}else{if(Hr(d))return["div",{},["span",e,hn(d)?"ShallowReactive":"Reactive"],"<",a(d),`>${Jn(d)?" (readonly)":""}`];if(Jn(d))return["div",{},["span",e,hn(d)?"ShallowReadonly":"Readonly"],"<",a(d),">"]}return null},hasBody(d){return d&&d.__isVue},body(d){if(d&&d.__isVue)return["div",{},...i(d.$)]}};function i(d){const f=[];d.type.props&&d.props&&f.push(s("props",rt(d.props))),d.setupState!==W.EMPTY_OBJ&&f.push(s("setup",d.setupState)),d.data!==W.EMPTY_OBJ&&f.push(s("data",rt(d.data)));const m=c(d,"computed");m&&f.push(s("computed",m));const w=c(d,"inject");return w&&f.push(s("injected",w)),f.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:d}]]),f}function s(d,f){return f=W.extend({},f),Object.keys(f).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},d],["div",{style:"padding-left:1.25em"},...Object.keys(f).map(m=>["div",{},["span",r,m+": "],a(f[m],!1)])]]:["span",{}]}function a(d,f=!0){return typeof d=="number"?["span",t,d]:typeof d=="string"?["span",n,JSON.stringify(d)]:typeof d=="boolean"?["span",r,d]:W.isObject(d)?["object",{object:f?rt(d):d}]:["span",n,String(d)]}function c(d,f){const m=d.type;if(W.isFunction(m))return;const w={};for(const y in d.ctx)u(m,y,f)&&(w[y]=d.ctx[y]);return w}function u(d,f,m){const w=d[m];if(W.isArray(w)&&w.includes(f)||W.isObject(w)&&f in w||d.extends&&u(d.extends,f,m)||d.mixins&&d.mixins.some(y=>u(y,f,m)))return!0}function l(d){return hn(d)?"ShallowRef":d.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(o):window.devtoolsFormatters=[o]}const US=ve.env.NODE_ENV!=="production"?Ze:W.NOOP;ve.env.NODE_ENV,ve.env.NODE_ENV;let qS;const Cp=typeof window<"u"&&window.trustedTypes;if(Cp)try{qS=Cp.createPolicy("vue",{createHTML:e=>e})}catch(e){ve.env.NODE_ENV!=="production"&&US(`Error creating trusted types policy: ${e}`)}const Pp=Symbol("_vod"),VS=Symbol("_vsh"),ll={beforeMount(e,{value:t},{transition:n}){e[Pp]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):eo(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),eo(e,!0),r.enter(e)):r.leave(e,()=>{eo(e,!1)}):eo(e,t))},beforeUnmount(e,{value:t}){eo(e,t)}};ve.env.NODE_ENV!=="production"&&(ll.name="show");function eo(e,t){e.style.display=t?e[Pp]:"none",e[VS]=!t}Symbol(ve.env.NODE_ENV!=="production"?"CSS_VAR_TEXT":"");function to(e,t,n,r){e.addEventListener(t,n,r)}const Fp=e=>{const t=e.props["onUpdate:modelValue"]||!1;return W.isArray(t)?n=>W.invokeArrayFns(t,n):t};function zS(e){e.target.composing=!0}function Op(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const cl=Symbol("_assign"),WS={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e[cl]=Fp(o);const i=r||o.props&&o.props.type==="number";to(e,t?"change":"input",s=>{if(s.target.composing)return;let a=e.value;n&&(a=a.trim()),i&&(a=W.looseToNumber(a)),e[cl](a)}),n&&to(e,"change",()=>{e.value=e.value.trim()}),t||(to(e,"compositionstart",zS),to(e,"compositionend",Op),to(e,"change",Op))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:o,number:i}},s){if(e[cl]=Fp(s),e.composing)return;const a=(i||e.type==="number")&&!/^0\d/.test(e.value)?W.looseToNumber(e.value):e.value,c=t??"";a!==c&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||o&&e.value.trim()===c)||(e.value=c))}},HS=["ctrl","shift","alt","meta"],GS={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)=>HS.some(n=>e[`${n}Key`]&&!t.includes(n))},Cn=(e,t)=>{const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(o,...i)=>{for(let s=0;s<t.length;s++){const a=GS[t[s]];if(a&&a(o,t))return}return e(o,...i)})},KS={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},no=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=o=>{if(!("key"in o))return;const i=W.hyphenate(o.key);if(t.some(s=>s===i||KS[s]===i))return e(o)})};function QS(){jS()}ve.env.NODE_ENV!=="production"&&QS();const mn=()=>Ht.useAbility();function kp(e){if(e===void 0)throw new Error('cloneStateObject: cannot clone "undefined"');return JSON.parse(JSON.stringify(e))}const ro=(e,t)=>!e||!t?!1:e.id===t.id;var $r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ul(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fl,xp;function XS(){if(xp)return fl;xp=1;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,i){for(var s="",a=0,c=-1,u=0,l,d=0;d<=o.length;++d){if(d<o.length)l=o.charCodeAt(d);else{if(l===47)break;l=47}if(l===47){if(!(c===d-1||u===1))if(c!==d-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 f=s.lastIndexOf("/");if(f!==s.length-1){f===-1?(s="",a=0):(s=s.slice(0,f),a=s.length-1-s.lastIndexOf("/")),c=d,u=0;continue}}else if(s.length===2||s.length===1){s="",a=0,c=d,u=0;continue}}i&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+o.slice(c+1,d):s=o.slice(c+1,d),a=d-c-1;c=d,u=0}else l===46&&u!==-1?++u:u=-1}return s}function n(o,i){var s=i.dir||i.root,a=i.base||(i.name||"")+(i.ext||"");return s?s===i.root?s+a:s+o+a:a}var r={resolve:function(){for(var i="",s=!1,a,c=arguments.length-1;c>=-1&&!s;c--){var u;c>=0?u=arguments[c]:(a===void 0&&(a=ve.cwd()),u=a),e(u),u.length!==0&&(i=u+"/"+i,s=u.charCodeAt(0)===47)}return i=t(i,!s),s?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(i){if(e(i),i.length===0)return".";var s=i.charCodeAt(0)===47,a=i.charCodeAt(i.length-1)===47;return i=t(i,!s),i.length===0&&!s&&(i="."),i.length>0&&a&&(i+="/"),s?"/"+i:i},isAbsolute:function(i){return e(i),i.length>0&&i.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var i,s=0;s<arguments.length;++s){var a=arguments[s];e(a),a.length>0&&(i===void 0?i=a:i+="/"+a)}return i===void 0?".":r.normalize(i)},relative:function(i,s){if(e(i),e(s),i===s||(i=r.resolve(i),s=r.resolve(s),i===s))return"";for(var a=1;a<i.length&&i.charCodeAt(a)===47;++a);for(var c=i.length,u=c-a,l=1;l<s.length&&s.charCodeAt(l)===47;++l);for(var d=s.length,f=d-l,m=u<f?u:f,w=-1,y=0;y<=m;++y){if(y===m){if(f>m){if(s.charCodeAt(l+y)===47)return s.slice(l+y+1);if(y===0)return s.slice(l+y)}else u>m&&(i.charCodeAt(a+y)===47?w=y:y===0&&(w=0));break}var E=i.charCodeAt(a+y),b=s.charCodeAt(l+y);if(E!==b)break;E===47&&(w=y)}var g="";for(y=a+w+1;y<=c;++y)(y===c||i.charCodeAt(y)===47)&&(g.length===0?g+="..":g+="/..");return g.length>0?g+s.slice(l+w):(l+=w,s.charCodeAt(l)===47&&++l,s.slice(l))},_makeLong:function(i){return i},dirname:function(i){if(e(i),i.length===0)return".";for(var s=i.charCodeAt(0),a=s===47,c=-1,u=!0,l=i.length-1;l>=1;--l)if(s=i.charCodeAt(l),s===47){if(!u){c=l;break}}else u=!1;return c===-1?a?"/":".":a&&c===1?"//":i.slice(0,c)},basename:function(i,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');e(i);var a=0,c=-1,u=!0,l;if(s!==void 0&&s.length>0&&s.length<=i.length){if(s.length===i.length&&s===i)return"";var d=s.length-1,f=-1;for(l=i.length-1;l>=0;--l){var m=i.charCodeAt(l);if(m===47){if(!u){a=l+1;break}}else f===-1&&(u=!1,f=l+1),d>=0&&(m===s.charCodeAt(d)?--d===-1&&(c=l):(d=-1,c=f))}return a===c?c=f:c===-1&&(c=i.length),i.slice(a,c)}else{for(l=i.length-1;l>=0;--l)if(i.charCodeAt(l)===47){if(!u){a=l+1;break}}else c===-1&&(u=!1,c=l+1);return c===-1?"":i.slice(a,c)}},extname:function(i){e(i);for(var s=-1,a=0,c=-1,u=!0,l=0,d=i.length-1;d>=0;--d){var f=i.charCodeAt(d);if(f===47){if(!u){a=d+1;break}continue}c===-1&&(u=!1,c=d+1),f===46?s===-1?s=d:l!==1&&(l=1):s!==-1&&(l=-1)}return s===-1||c===-1||l===0||l===1&&s===c-1&&s===a+1?"":i.slice(s,c)},format:function(i){if(i===null||typeof i!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof i);return n("/",i)},parse:function(i){e(i);var s={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return s;var a=i.charCodeAt(0),c=a===47,u;c?(s.root="/",u=1):u=0;for(var l=-1,d=0,f=-1,m=!0,w=i.length-1,y=0;w>=u;--w){if(a=i.charCodeAt(w),a===47){if(!m){d=w+1;break}continue}f===-1&&(m=!1,f=w+1),a===46?l===-1?l=w:y!==1&&(y=1):l!==-1&&(y=-1)}return l===-1||f===-1||y===0||y===1&&l===f-1&&l===d+1?f!==-1&&(d===0&&c?s.base=s.name=i.slice(1,f):s.base=s.name=i.slice(d,f)):(d===0&&c?(s.name=i.slice(1,l),s.base=i.slice(1,f)):(s.name=i.slice(d,l),s.base=i.slice(d,f)),s.ext=i.slice(l,f)),d>0?s.dir=i.slice(0,d-1):c&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return r.posix=r,fl=r,fl}var dt=XS();const fs=ul(dt),YS=Ne({name:"SpaceMoveInfoModal",props:{modal:{type:Object,required:!0}}}),ze=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},JS=["textContent"],ZS=["textContent"];function eE(e,t,n,r,o,i){return X(),de(qe,null,[fe("p",{class:"oc-mt-rm",textContent:W.toDisplayString(e.$gettext("Moving files from one space to another is not possible. Do you want to copy instead?"))},null,8,JS),fe("p",{class:"oc-mb-rm",textContent:W.toDisplayString(e.$gettext("Note: Links and shares of the original file are not copied."))},null,8,ZS)],64)}const Np=ze(YS,[["render",eE]]),tE=Ne({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}=pt(),{$gettext:n}=Fe.useGettext(),r=le(!1),o=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)),i=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:i,checkboxValue:r,checkboxLabel:o,confirmSecondaryText:s,onConfirm:()=>{t(e.modal.id),e.callbackFn({strategy:Wn.KEEP_BOTH,doForAllConflicts:p(r)})},onConfirmSecondary:()=>{t(e.modal.id);const l=e.suggestMerge?Wn.MERGE:Wn.REPLACE;e.callbackFn({strategy:l,doForAllConflicts:p(r)})},onCancel:()=>{t(e.modal.id),e.callbackFn({strategy:Wn.SKIP,doForAllConflicts:p(r)})}}}}),nE=["textContent"],rE={class:"oc-my-m"},iE={class:"oc-flex oc-flex-right oc-flex-middle oc-mt-m"},oE={class:"oc-modal-body-actions-grid"};function sE(e,t,n,r,o,i){const s=pe("oc-checkbox"),a=pe("oc-button");return X(),de(qe,null,[fe("span",{class:"oc-display-inline-block oc-mb-m",textContent:W.toDisplayString(e.message)},null,8,nE),fe("div",rE,[e.conflictCount>1?(X(),Ae(s,{key:0,modelValue:e.checkboxValue,"onUpdate:modelValue":t[0]||(t[0]=c=>e.checkboxValue=c),size:"medium",label:e.checkboxLabel,"aria-label":e.checkboxLabel},null,8,["modelValue","label","aria-label"])):Ce("",!0)]),fe("div",iE,[fe("div",oE,[he(a,{class:"oc-modal-body-actions-cancel oc-ml-s",onClick:e.onCancel},{default:Se(()=>[Ot(W.toDisplayString(e.$gettext("Skip")),1)]),_:1},8,["onClick"]),he(a,{class:"oc-modal-body-actions-secondary oc-ml-s",onClick:e.onConfirmSecondary},{default:Se(()=>[Ot(W.toDisplayString(e.confirmSecondaryText),1)]),_:1},8,["onClick"]),he(a,{class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",onClick:e.onConfirm},{default:Se(()=>[Ot(W.toDisplayString(e.$gettext("Keep both")),1)]),_:1},8,["onClick"])])])],64)}const $p=ze(tE,[["render",sE]]);class dl{constructor(t,n){this.$gettext=t,this.$ngettext=n}async resolveAllConflicts(t,n,r){const o=[];for(const u of t){const l=dt.join(n.path,u.name);r.some(f=>f.path===l)&&o.push({resource:u,strategy:null})}let i=0,s=!1,a=null;const c=[];for(const u of o){if(s){u.strategy=a,c.push(u);continue}const l=o.length-i,d=await this.resolveFileExists(u.resource,l);u.strategy=d.strategy,c.push(u),i+=1,d.doForAllConflicts&&(s=!0,a=d.strategy)}return c}resolveFileExists(t,n,r=!1,o=!1){const{dispatchModal:i}=pt();return new Promise(s=>{i({title:t.isFolder?this.$gettext("Folder already exists"):this.$gettext("File already exists"),hideActions:!0,customComponent:$p,customComponentAttrs:()=>({resource:t,conflictCount:n,suggestMerge:r,separateSkipHandling:o,callbackFn:a=>{s(a)}})})})}resolveDoCopyInsteadOfMoveForSpaces(){const{dispatchModal:t}=pt();return new Promise(n=>{t({title:this.$gettext("Copy here?"),customComponent:Np,confirmText:this.$gettext("Copy here"),onCancel:()=>{n(!1)},onConfirm:()=>Promise.resolve(n(!0))})})}}const zn=(e,t,n,r=1)=>{let o;return t?o=`${ee.extractNameWithoutExtension({name:e,extension:t})} (${r}).${t}`:o=`${e} (${r})`,n.some(s=>s.name===o)?zn(e,t,n,r+1):o},Dp=(e,t,n,r)=>e.id===n.id&&dt.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||{}),gr=(e=>(e[e.COPY=0]="COPY",e[e.MOVE=1]="MOVE",e))(gr||{});class Lp extends dl{constructor(t,n,r,o,i,s,a,c){super(a,c),this.sourceSpace=t,this.resourcesToMove=n,this.targetSpace=r,this.targetFolder=o,this.currentFolder=i,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);tt().showErrorMessage({title:n})}showResultMessage(t,n,r){var a,c;if(t.length===0){const u=n.length;if(u===0)return;const l=r===gr.COPY?this.$ngettext("%{count} item was copied successfully","%{count} items were copied successfully",u,{count:u.toString()},!0):this.$ngettext("%{count} item was moved successfully","%{count} items were moved successfully",u,{count:u.toString()},!0);tt().showMessage({title:l,status:"success"});return}let o=r===gr.COPY?this.$gettext("Failed to copy %{count} resources",{count:t.length.toString()},!0):this.$gettext("Failed to move %{count} resources",{count:t.length.toString()},!0);t.length===1&&(o=r===gr.COPY?this.$gettext('Failed to copy "%{name}"',{name:(a=t[0])==null?void 0:a.resourceName},!0):this.$gettext('Failed to move "%{name}"',{name:(c=t[0])==null?void 0:c.resourceName},!0));let i="";t.some(({error:u})=>u instanceof ee.HttpError&&u.statusCode===507)&&(i=this.$gettext("Insufficient quota")),tt().showErrorMessage({title:o,...i&&{desc:i},errors:t.map(({error:u})=>u)})}async getTransferData(t){var i;if(this.hasRecursion())return this.showRecursionErrorMessage(),[];if(this.sourceSpace.id!==this.targetSpace.id&&t===gr.MOVE){if(!await this.resolveDoCopyInsteadOfMoveForSpaces())return[];t=gr.COPY}const n=(await this.clientService.webdav.listFiles(this.targetSpace,this.targetFolder)).children,r=await this.resolveAllConflicts(this.resourcesToMove,this.targetFolder,n),o=[];for(const s of this.resourcesToMove){const a={...s},{id:c,name:u,extension:l}=a,d=r.some(w=>w.resource.id===c);let f=u,m=!1;if(d){const w=(i=r.find(y=>y.resource.id===c))==null?void 0:i.strategy;if(w===Wn.SKIP)continue;if(w===Wn.REPLACE){if(this.isOverwritingParentFolder(a,this.targetFolder,n)){const y=new Error;this.showResultMessage([{error:y,resourceName:u}],[],t);continue}m=!0}w===Wn.KEEP_BOTH&&(f=zn(u,l,n),a.name=f)}Dp(this.sourceSpace,a,this.targetSpace,this.targetFolder)&&m||o.push({resource:a,sourceSpace:this.sourceSpace,targetSpace:this.targetSpace,targetFolder:this.targetFolder,path:dt.join(this.targetFolder.path,f),overwrite:m,transferType:t})}return o}isOverwritingParentFolder(t,n,r){var s;if(t.type!=="folder"||n.path===((s=p(this.currentFolder))==null?void 0:s.path))return!1;const o=dt.basename(t.path),i=dt.join(n.path,o);return r.some(a=>a.path===i)}}const pl={ignoreLocation:!0,threshold:0,useExtendedSearch:!0},aE=(e,t,n)=>new dd(e,{...pl,keys:["name","type","icon","extension","tags"]}).search(t,{limit:n}).map(o=>o.item),Mp="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","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"]}};function Bp(){const e={};return Object.values(lE).forEach(t=>{t.extensions.forEach(n=>{e[n]=t.icon})}),e}function hl(e,t,n){return t.name=dt.basename(n),t.path=n,t.webDavPath=dt.join(e.webDavPath,n),t.extension=ee.extractExtensionFromFile(t),t}function cE(){this.__data__=[],this.size=0}function io(e,t){return e===t||e!==e&&t!==t}function ds(e,t){for(var n=e.length;n--;)if(io(e[n][0],t))return n;return-1}var uE=Array.prototype,fE=uE.splice;function dE(e){var t=this.__data__,n=ds(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():fE.call(t,n,1),--this.size,!0}function pE(e){var t=this.__data__,n=ds(t,e);return n<0?void 0:t[n][1]}function hE(e){return ds(this.__data__,e)>-1}function gE(e,t){var n=this.__data__,r=ds(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function mr(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])}}mr.prototype.clear=cE,mr.prototype.delete=dE,mr.prototype.get=pE,mr.prototype.has=hE,mr.prototype.set=gE;function mE(){this.__data__=new mr,this.size=0}function yE(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function bE(e){return this.__data__.get(e)}function vE(e){return this.__data__.has(e)}const Dr=globalThis||void 0||self;var jp=typeof Dr=="object"&&Dr&&Dr.Object===Object&&Dr,wE=typeof self=="object"&&self&&self.Object===Object&&self,Zn=jp||wE||Function("return this")(),xn=Zn.Symbol,Up=Object.prototype,SE=Up.hasOwnProperty,EE=Up.toString,oo=xn?xn.toStringTag:void 0;function TE(e){var t=SE.call(e,oo),n=e[oo];try{e[oo]=void 0;var r=!0}catch{}var o=EE.call(e);return r&&(t?e[oo]=n:delete e[oo]),o}var AE=Object.prototype,RE=AE.toString;function _E(e){return RE.call(e)}var IE="[object Null]",CE="[object Undefined]",qp=xn?xn.toStringTag:void 0;function Xr(e){return e==null?e===void 0?CE:IE:qp&&qp in Object(e)?TE(e):_E(e)}function er(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var PE="[object AsyncFunction]",FE="[object Function]",OE="[object GeneratorFunction]",kE="[object Proxy]";function gl(e){if(!er(e))return!1;var t=Xr(e);return t==FE||t==OE||t==PE||t==kE}var ml=Zn["__core-js_shared__"],Vp=function(){var e=/[^.]+$/.exec(ml&&ml.keys&&ml.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function xE(e){return!!Vp&&Vp in e}var NE=Function.prototype,$E=NE.toString;function Yr(e){if(e!=null){try{return $E.call(e)}catch{}try{return e+""}catch{}}return""}var DE=/[\\^$.*+?()[\]{}|]/g,LE=/^\[object .+?Constructor\]$/,ME=Function.prototype,BE=Object.prototype,jE=ME.toString,UE=BE.hasOwnProperty,qE=RegExp("^"+jE.call(UE).replace(DE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function VE(e){if(!er(e)||xE(e))return!1;var t=gl(e)?qE:LE;return t.test(Yr(e))}function zE(e,t){return e==null?void 0:e[t]}function Jr(e,t){var n=zE(e,t);return VE(n)?n:void 0}var so=Jr(Zn,"Map"),ao=Jr(Object,"create");function WE(){this.__data__=ao?ao(null):{},this.size=0}function HE(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var GE="__lodash_hash_undefined__",KE=Object.prototype,QE=KE.hasOwnProperty;function XE(e){var t=this.__data__;if(ao){var n=t[e];return n===GE?void 0:n}return QE.call(t,e)?t[e]:void 0}var YE=Object.prototype,JE=YE.hasOwnProperty;function ZE(e){var t=this.__data__;return ao?t[e]!==void 0:JE.call(t,e)}var e1="__lodash_hash_undefined__";function t1(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ao&&t===void 0?e1:t,this}function Zr(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])}}Zr.prototype.clear=WE,Zr.prototype.delete=HE,Zr.prototype.get=XE,Zr.prototype.has=ZE,Zr.prototype.set=t1;function n1(){this.size=0,this.__data__={hash:new Zr,map:new(so||mr),string:new Zr}}function r1(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ps(e,t){var n=e.__data__;return r1(t)?n[typeof t=="string"?"string":"hash"]:n.map}function i1(e){var t=ps(this,e).delete(e);return this.size-=t?1:0,t}function o1(e){return ps(this,e).get(e)}function s1(e){return ps(this,e).has(e)}function a1(e,t){var n=ps(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function yr(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])}}yr.prototype.clear=n1,yr.prototype.delete=i1,yr.prototype.get=o1,yr.prototype.has=s1,yr.prototype.set=a1;var l1=200;function c1(e,t){var n=this.__data__;if(n instanceof mr){var r=n.__data__;if(!so||r.length<l1-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new yr(r)}return n.set(e,t),this.size=n.size,this}function tr(e){var t=this.__data__=new mr(e);this.size=t.size}tr.prototype.clear=mE,tr.prototype.delete=yE,tr.prototype.get=bE,tr.prototype.has=vE,tr.prototype.set=c1;var hs=function(){try{var e=Jr(Object,"defineProperty");return e({},"",{}),e}catch{}}();function yl(e,t,n){t=="__proto__"&&hs?hs(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function bl(e,t,n){(n!==void 0&&!io(e[t],n)||n===void 0&&!(t in e))&&yl(e,t,n)}function u1(e){return function(t,n,r){for(var o=-1,i=Object(t),s=r(t),a=s.length;a--;){var c=s[++o];if(n(i[c],c,i)===!1)break}return t}}var f1=u1(),zp=typeof L=="object"&&L&&!L.nodeType&&L,Wp=zp&&typeof module=="object"&&module&&!module.nodeType&&module,d1=Wp&&Wp.exports===zp,Hp=d1?Zn.Buffer:void 0,Gp=Hp?Hp.allocUnsafe:void 0;function Kp(e,t){if(t)return e.slice();var n=e.length,r=Gp?Gp(n):new e.constructor(n);return e.copy(r),r}var gs=Zn.Uint8Array;function vl(e){var t=new e.constructor(e.byteLength);return new gs(t).set(new gs(e)),t}function Qp(e,t){var n=t?vl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function p1(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Xp=Object.create,h1=function(){function e(){}return function(t){if(!er(t))return{};if(Xp)return Xp(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Yp(e,t){return function(n){return e(t(n))}}var wl=Yp(Object.getPrototypeOf,Object),g1=Object.prototype;function Sl(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||g1;return e===n}function m1(e){return typeof e.constructor=="function"&&!Sl(e)?h1(wl(e)):{}}function nr(e){return e!=null&&typeof e=="object"}var y1="[object Arguments]";function Jp(e){return nr(e)&&Xr(e)==y1}var Zp=Object.prototype,b1=Zp.hasOwnProperty,v1=Zp.propertyIsEnumerable,ms=Jp(function(){return arguments}())?Jp:function(e){return nr(e)&&b1.call(e,"callee")&&!v1.call(e,"callee")},Hn=Array.isArray,w1=9007199254740991;function eh(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=w1}function ys(e){return e!=null&&eh(e.length)&&!gl(e)}function S1(e){return nr(e)&&ys(e)}function E1(){return!1}var th=typeof L=="object"&&L&&!L.nodeType&&L,nh=th&&typeof module=="object"&&module&&!module.nodeType&&module,T1=nh&&nh.exports===th,rh=T1?Zn.Buffer:void 0,A1=rh?rh.isBuffer:void 0,lo=A1||E1,R1="[object Object]",_1=Function.prototype,I1=Object.prototype,ih=_1.toString,C1=I1.hasOwnProperty,P1=ih.call(Object);function El(e){if(!nr(e)||Xr(e)!=R1)return!1;var t=wl(e);if(t===null)return!0;var n=C1.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&ih.call(n)==P1}var F1="[object Arguments]",O1="[object Array]",k1="[object Boolean]",x1="[object Date]",N1="[object Error]",$1="[object Function]",D1="[object Map]",L1="[object Number]",M1="[object Object]",B1="[object RegExp]",j1="[object Set]",U1="[object String]",q1="[object WeakMap]",V1="[object ArrayBuffer]",z1="[object DataView]",W1="[object Float32Array]",H1="[object Float64Array]",G1="[object Int8Array]",K1="[object Int16Array]",Q1="[object Int32Array]",X1="[object Uint8Array]",Y1="[object Uint8ClampedArray]",J1="[object Uint16Array]",Z1="[object Uint32Array]",At={};At[W1]=At[H1]=At[G1]=At[K1]=At[Q1]=At[X1]=At[Y1]=At[J1]=At[Z1]=!0,At[F1]=At[O1]=At[V1]=At[k1]=At[z1]=At[x1]=At[N1]=At[$1]=At[D1]=At[L1]=At[M1]=At[B1]=At[j1]=At[U1]=At[q1]=!1;function eT(e){return nr(e)&&eh(e.length)&&!!At[Xr(e)]}function Tl(e){return function(t){return e(t)}}var oh=typeof L=="object"&&L&&!L.nodeType&&L,co=oh&&typeof module=="object"&&module&&!module.nodeType&&module,tT=co&&co.exports===oh,Al=tT&&jp.process,Ii=function(){try{var e=co&&co.require&&co.require("util").types;return e||Al&&Al.binding&&Al.binding("util")}catch{}}(),sh=Ii&&Ii.isTypedArray,Rl=sh?Tl(sh):eT;function _l(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var nT=Object.prototype,rT=nT.hasOwnProperty;function ah(e,t,n){var r=e[t];(!(rT.call(e,t)&&io(r,n))||n===void 0&&!(t in e))&&yl(e,t,n)}function lh(e,t,n,r){var o=!n;n||(n={});for(var i=-1,s=t.length;++i<s;){var a=t[i],c=void 0;c===void 0&&(c=e[a]),o?yl(n,a,c):ah(n,a,c)}return n}function iT(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var oT=9007199254740991,sT=/^(?:0|[1-9]\d*)$/;function ch(e,t){var n=typeof e;return t=t??oT,!!t&&(n=="number"||n!="symbol"&&sT.test(e))&&e>-1&&e%1==0&&e<t}var aT=Object.prototype,lT=aT.hasOwnProperty;function uh(e,t){var n=Hn(e),r=!n&&ms(e),o=!n&&!r&&lo(e),i=!n&&!r&&!o&&Rl(e),s=n||r||o||i,a=s?iT(e.length,String):[],c=a.length;for(var u in e)(t||lT.call(e,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||ch(u,c)))&&a.push(u);return a}function cT(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var uT=Object.prototype,fT=uT.hasOwnProperty;function dT(e){if(!er(e))return cT(e);var t=Sl(e),n=[];for(var r in e)r=="constructor"&&(t||!fT.call(e,r))||n.push(r);return n}function Il(e){return ys(e)?uh(e,!0):dT(e)}function pT(e){return lh(e,Il(e))}function hT(e,t,n,r,o,i,s){var a=_l(e,n),c=_l(t,n),u=s.get(c);if(u){bl(e,n,u);return}var l=i?i(a,c,n+"",e,t,s):void 0,d=l===void 0;if(d){var f=Hn(c),m=!f&&lo(c),w=!f&&!m&&Rl(c);l=c,f||m||w?Hn(a)?l=a:S1(a)?l=p1(a):m?(d=!1,l=Kp(c,!0)):w?(d=!1,l=Qp(c,!0)):l=[]:El(c)||ms(c)?(l=a,ms(a)?l=pT(a):(!er(a)||gl(a))&&(l=m1(c))):d=!1}d&&(s.set(c,l),o(l,c,r,i,s),s.delete(c)),bl(e,n,l)}function fh(e,t,n,r,o){e!==t&&f1(t,function(i,s){if(o||(o=new tr),er(i))hT(e,t,s,n,fh,r,o);else{var a=r?r(_l(e,s),i,s+"",e,t,o):void 0;a===void 0&&(a=i),bl(e,s,a)}},Il)}function dh(e){return e}function gT(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 ph=Math.max;function hh(e,t,n){return t=ph(t===void 0?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=ph(r.length-t,0),s=Array(i);++o<i;)s[o]=r[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=r[o];return a[t]=n(s),gT(e,this,a)}}function mT(e){return function(){return e}}var yT=hs?function(e,t){return hs(e,"toString",{configurable:!0,enumerable:!1,value:mT(t),writable:!0})}:dh,bT=800,vT=16,wT=Date.now;function ST(e){var t=0,n=0;return function(){var r=wT(),o=vT-(r-n);if(n=r,o>0){if(++t>=bT)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var gh=ST(yT);function ET(e,t){return gh(hh(e,t,dh),e+"")}function TT(e,t,n){if(!er(n))return!1;var r=typeof t;return(r=="number"?ys(n)&&ch(t,n.length):r=="string"&&t in n)?io(n[t],e):!1}function AT(e){return ET(function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(o--,i):void 0,s&&TT(n[0],n[1],s)&&(i=o<3?void 0:i,o=1),t=Object(t);++r<o;){var a=n[r];a&&e(t,a,r,i)}return t})}var uo=AT(function(e,t,n){fh(e,t,n)});const Cl=(e,...t)=>{const{href:n}=e.resolve(p(e.currentRoute));return t.map(r=>{const{href:o}=e.resolve({...r});return o==="/"||o==="#/"?!1:n.startsWith(o)}).some(Boolean)},fo=(...e)=>(t,...n)=>{if(!n.length)return Cl(t,...e);const[r,...o]=n.map(i=>{const s=e.find(a=>a.name===i);if(!s)throw new Error(`unknown comparative '${i}'`);return s});return Cl(t,r,...o)};function dM(e){return e}const po=(e,...t)=>uo({},{name:e},...t.map(n=>({...n.params&&{params:n.params},...n.query&&{query:n.query}}))),Ci=(e,t={})=>po(e,t),mh=Ci("files-common-favorites"),yh=Ci("files-common-search"),Ct=fo(mh,yh),RT=e=>[{path:"/search",component:e.App,children:[{name:yh.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:mh.name,path:"",component:e.Favorites,meta:{authContext:"user",title:"Favorite files"}}]}],Nn=(e,t={})=>po(e,t),bh=Nn("files-spaces-projects"),Pl=Nn("files-spaces-generic"),ht=fo(bh,Pl),_T=e=>[{path:"/spaces",component:e.App,children:[{path:"projects",name:bh.name,component:e.Spaces.Projects,meta:{authContext:"user",title:"Spaces"}},{path:":driveAliasAndItem(.*)?",name:Pl.name,component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0,contextQueryItems:["sort-by","sort-dir"]}}]}],$n=(e,t={})=>po(e,t),IT=$n("files-shares"),bs=$n("files-shares-with-me"),Fl=$n("files-shares-with-others"),Ol=$n("files-shares-via-link"),jt=fo(bs,Fl,Ol),CT=e=>[{name:IT.name,path:"/shares",component:e.App,redirect:bs,children:[{name:bs.name,path:"with-me",component:e.Shares.SharedWithMe,meta:{authContext:"user",title:"Files shared with me"}},{name:Fl.name,path:"with-others",component:e.Shares.SharedWithOthers,meta:{authContext:"user",title:"Files shared with others"}},{name:Ol.name,path:"via-link",component:e.Shares.SharedViaLink,meta:{authContext:"user",title:"Files shared via link"}}]}],Pi=(e,t={})=>po(e,t),kl=Pi("files-public-link"),xl=Pi("files-public-upload"),Pn=fo(kl,xl),PT=e=>[{path:"/link",component:e.App,meta:{auth:!1},children:[{name:kl.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"publicLink",patchCleanPath:!0}}]},{path:"/upload",component:e.App,meta:{auth:!1},children:[{name:xl.name,path:":token?",component:e.FilesDrop,meta:{authContext:"publicLink",title:"Public file upload"}}]}],Fi=(e,t={})=>po(e,t),vh=Fi("files-trash-generic"),wh=Fi("files-trash-overview"),Fn=fo(vh,wh),FT=e=>[{path:"/trash",component:e.App,children:[{path:"overview",name:wh.name,component:e.Trash.Overview,meta:{authContext:"user",title:"Trash overview"}},{name:vh.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0}}]}];function Sh(e){return{applicationConfig:B(()=>e.appsStore.externalAppConfig[e.applicationId]||{})}}const OT=["anonymous","user","idp","publicLink","hybrid"],br=e=>hr(e),We=()=>br("$router"),Kt=()=>We().currentRoute,Nl=e=>e.path.split("/")[1],kT=()=>{const e=Kt();return B(()=>Nl(p(e)))},rr=(e,t={},n)=>{var o,i;const r=(n==null?void 0:n.configStore)||st();return{params:{driveAliasAndItem:e.getDriveAliasAndItem({path:t.path||""})},query:{...ee.isShareSpaceResource(e)&&{shareId:e.id},...((i=(o=r==null?void 0:r.options)==null?void 0:o.routing)==null?void 0:i.idBased)&&!It.isUndefined(t.fileId)&&{fileId:`${t.fileId}`}}}},xT=(e,t)=>{const n=document.querySelector("base"),r=!!n,o=new URL(window.location.href.split("#")[0]);return o.search="",r?o.pathname=new URL(n.href).pathname:o.pathname.endsWith("/index.html")&&(o.pathname=o.pathname.split("/").slice(0,-1).filter(Boolean).join("/")),/\.(html?)$/i.test(t)?o.pathname=[...o.pathname.split("/"),...t.split("/")].filter(Boolean).join("/"):o[r?"pathname":"hash"]=e.resolve(t).href,o.href},ir=Ue.defineStore("apps",()=>{const e=le({}),t=le({}),n=le([]),r=B(()=>Object.keys(p(e))),o=(c,u)=>{c.id&&(c.extensions&&c.extensions.forEach(l=>{i({appId:c.id,data:l})}),p(e)[c.id]={applicationMenu:c.applicationMenu||{enabled:()=>!1},defaultExtension:c.defaultExtension||"",icon:"check_box_outline_blank",name:c.name||c.id,translations:u,...c})},i=({appId:c,data:u})=>{var l,d,f;p(n).push({app:c,extension:u.extension,createFileHandler:u.createFileHandler,label:u.label,mimeType:u.mimeType,routeName:u.routeName,newFileMenu:u.newFileMenu,icon:u.icon,name:u.name,hasPriority:u.hasPriority||((f=(d=(l=p(t))==null?void 0:l[c])==null?void 0:d.priorityExtensions)==null?void 0:f.includes(u.extension))||!1,secureView:u.secureView||!1})};return{apps:e,externalAppConfig:t,appIds:r,fileExtensions:n,registerApp:o,registerFileExtension:i,loadExternalAppConfig:({appId:c,config:u})=>{t.value={...p(t),[c]:u}},isAppEnabled:c=>p(r).includes(c)}}),ei=Ue.defineStore("auth",()=>{const e=le(),t=le(!1),n=le(!1),r=le(),o=le(),i=le(),s=le(!1),a=m=>{e.value=m},c=m=>{t.value=m},u=m=>{n.value=m},l=m=>{r.value=m.publicLinkToken,o.value=m.publicLinkPassword,i.value=m.publicLinkType,s.value=m.publicLinkContextReady};return{accessToken:e,idpContextReady:t,userContextReady:n,publicLinkToken:r,publicLinkPassword:o,publicLinkType:i,publicLinkContextReady:s,setAccessToken:a,setIdpContextReady:c,setUserContextReady:u,setPublicLinkContext:l,clearUserContext:()=>{a(null),c(null),u(null)},clearPublicLinkContext:()=>{l({publicLinkToken:null,publicLinkPassword:null,publicLinkType:null,publicLinkContextReady:!1})}}}),Eh={core:{"support-sse":!1,"support-url-signing":!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:ee.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:[]}},notifications:{"ocs-endpoints":[]},password_policy:{},search:{property:{mediatype:{},mtime:{}}},spaces:{enabled:!1,max_quota:0,projects:!1}},sn=Ue.defineStore("capabilities",()=>{const e=le(!1),t=le(Eh),n=R=>{t.value=uo({...Eh},R.capabilities),e.value=!0},r=B(()=>p(t).core["support-url-signing"]),o=B(()=>p(t).core["support-sse"]),i=B(()=>p(t).graph["personal-data-export"]),s=B(()=>p(t).core.status),a=B(()=>p(t).dav.reports),c=B(()=>p(t).dav.trashbin),u=B(()=>p(t).spaces.max_quota),l=B(()=>p(t).spaces.projects),d=B(()=>p(t).graph.users.create_disabled),f=B(()=>p(t).graph.users.delete_disabled),m=B(()=>p(t).graph.users.change_password_self_disabled),w=B(()=>p(t).graph.users.read_only_attributes),y=B(()=>p(t).files.app_providers),E=B(()=>p(t).files.favorites),b=B(()=>p(t).files.thumbnail),g=B(()=>p(t).files.archivers),v=B(()=>p(t).files.privateLinks),h=B(()=>p(t).files.permanent_deletion),S=B(()=>p(t).files.tags),T=B(()=>p(t).files.undelete),I=B(()=>p(t).files_sharing.api_enabled),_=B(()=>p(t).files_sharing.deny_access),A=B(()=>p(t).files_sharing.can_rename),$=B(()=>p(t).files_sharing.allow_custom),D=B(()=>{var R;return(R=p(t).files_sharing.public)==null?void 0:R.enabled}),N=B(()=>{var R;return(R=p(t).files_sharing.public)==null?void 0:R.can_edit}),x=B(()=>{var R;return(R=p(t).files_sharing.public)==null?void 0:R.can_contribute}),V=B(()=>{var R;return(R=p(t).files_sharing.public)==null?void 0:R.alias}),G=B(()=>{var R;return(R=p(t).files_sharing.public)==null?void 0:R.default_permissions}),ae=B(()=>{var R;return(R=p(t).files_sharing.public)==null?void 0:R.password.enforced_for}),ye=B(()=>p(t).files_sharing.search_min_length),ue=B(()=>{var R;return(R=p(t).files_sharing.user)==null?void 0:R.profile_picture}),te=B(()=>{var R;return(R=p(t).files.tus_support)==null?void 0:R.max_chunk_size}),ce=B(()=>{var R;return(R=p(t).files.tus_support)==null?void 0:R.extension}),oe=B(()=>{var R;return(R=p(t).files.tus_support)==null?void 0:R.http_method_override}),J=B(()=>p(t).notifications["ocs-endpoints"]),ne=B(()=>p(t).password_policy),se=B(()=>{var R;return(R=p(t).search.property)==null?void 0:R.mtime}),Re=B(()=>{var R;return(R=p(t).search.property)==null?void 0:R.mediatype}),H=B(()=>{var R;return(R=p(t).search.property)==null?void 0:R.content});return{isInitialized:e,capabilities:t,setCapabilities:n,status:s,supportUrlSigning:r,supportSSE:o,personalDataExport:i,davReports:a,davTrashbin:c,spacesMaxQuota:u,spacesProjects:l,graphUsersCreateDisabled:d,graphUsersDeleteDisabled:f,graphUsersChangeSelfPasswordDisabled:m,graphUsersReadOnlyAttributes:w,filesAppProviders:y,filesFavorites:E,filesThumbnail:b,filesArchivers:g,filesPrivateLinks:v,filesPermanentDeletion:h,filesTags:S,filesUndelete:T,sharingApiEnabled:I,sharingDenyAccess:_,sharingCanRename:A,sharingAllowCustom:$,sharingPublicEnabled:D,sharingPublicCanEdit:N,sharingPublicCanContribute:x,sharingPublicAlias:V,sharingPublicDefaultPermissions:G,sharingPublicPasswordEnforcedFor:ae,sharingSearchMinLength:ye,sharingUserProfilePicture:ue,tusMaxChunkSize:te,tusExtension:ce,tusHttpMethodOverride:oe,notificationsOcsEndpoints:J,passwordPolicy:ne,searchLastMofifiedDate:se,searchMediaType:Re,searchContent:H}});class NT{constructor(t,n){Ee(this,"value");Ee(this,"expires");this.value=t,this.expires=n?new Date().getTime()+n:0}get expired(){return this.expires>0&&this.expires<new Date().getTime()}}class $l{constructor(t){Ee(this,"map");Ee(this,"ttl");Ee(this,"capacity");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 NT(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 vs=async({graphClient:e,spacesStore:t,space:n,signal:r})=>{const o=await t.getMountPointForSpace({graphClient:e,space:n,signal:r});if(!o)return null;const{id:i}=o;return e.driveItems.getDriveItem(i.split("!")[0],i)},$T=({sharedAncestor:e,matchingSpace:t})=>t?Nn("files-spaces-generic",rr(t,{path:e.path,fileId:e.id})):{},Th=({sharesStore:e,spacesStore:t,space:n,sharedDriveItem:r})=>{var s;const o=((s=r==null?void 0:r.remoteItem)==null?void 0:s.permissions)||[];if(!o.length)return;const i=[];o.forEach(a=>{if(a["@libre.graph.permissions.actions"]){i.push(...a["@libre.graph.permissions.actions"]);return}const c=e.graphRoles[a.roles[0]];if(!c)return;const u=c.rolePermissions.flatMap(l=>l.allowedResourceActions);i.push(...u)}),t.updateSpaceField({id:n.id,field:"graphPermissions",value:[...new Set(i)]})},DT=e=>{var n;const t=(n=document.querySelectorAll(`[data-item-id="${e}"] input[type=checkbox]`))==null?void 0:n[0];t&&t.focus()};class ti{}Ee(ti,"sortByQueryName","sort-by"),Ee(ti,"sortDirQueryName","sort-dir");var LT="[object Symbol]";function ws(e){return typeof e=="symbol"||nr(e)&&Xr(e)==LT}var MT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,BT=/^\w*$/;function jT(e,t){if(Hn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||ws(e)?!0:BT.test(e)||!MT.test(e)||t!=null&&e in Object(t)}var UT="Expected a function";function Dl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(UT);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(Dl.Cache||yr),n}Dl.Cache=yr;var qT=500;function VT(e){var t=Dl(e,function(r){return n.size===qT&&n.clear(),r}),n=t.cache;return t}var zT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,WT=/\\(\\)?/g,HT=VT(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(zT,function(n,r,o,i){t.push(o?i.replace(WT,"$1"):r||n)}),t});function Ah(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var Rh=xn?xn.prototype:void 0,_h=Rh?Rh.toString:void 0;function Ih(e){if(typeof e=="string")return e;if(Hn(e))return Ah(e,Ih)+"";if(ws(e))return _h?_h.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ll(e){return e==null?"":Ih(e)}function Ml(e,t){return Hn(e)?e:jT(e,t)?[e]:HT(Ll(e))}function Ch(e){if(typeof e=="string"||ws(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ph(e,t){t=Ml(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Ch(t[n++])];return n&&n==r?e:void 0}function Bl(e,t,n){var r=e==null?void 0:Ph(e,t);return r===void 0?n:r}var zt=(e=>(e.Desc="desc",e.Asc="asc",e))(zt||{});function GT(e){const t=We(),n=KT(e),r=QT(e),o=B(()=>{var u;return Oh(p(n))||p((u=jl(p(s)))==null?void 0:u.name)}),i=B(()=>YT(p(r))||XT(p(o),p(s))),s=e.fields;return{items:B(()=>{const u=p(e.items);return p(o)?Fh(u,p(s),p(o),p(i)):u}),sortBy:o,sortDir:i,handleSort:({sortBy:u,sortDir:l})=>t.replace({query:{...p(t.currentRoute).query,[p(e.sortByQueryName)||ti.sortByQueryName]:u,[p(e.sortDirQueryName)||ti.sortDirQueryName]:l}})}}function KT(e){var t;return e.sortBy?Vt(e.sortBy)?e.sortBy:le(e.sortBy):Tr({name:p(e.sortByQueryName)||ti.sortByQueryName,defaultValue:p((t=jl(p(e.fields)))==null?void 0:t.name),storagePrefix:p(e.routeName)||p(Zs())})}function QT(e){var t;return e.sortDir?Vt(e.sortDir)?e.sortDir:le(e.sortDir):Tr({name:p(e.sortDirQueryName)||ti.sortDirQueryName,defaultValue:p((t=jl(p(e.fields)))==null?void 0:t.sortDir),storagePrefix:p(e.routeName)||p(Zs())})}const jl=e=>{const t=e.filter(n=>n.sortable);return t?t[0]:null},XT=(e,t)=>{const n=t.find(r=>r.name===e);return n&&n.sortDir?p(n.sortDir):"desc"},Fh=(e,t,n,r)=>{const o=t.find(a=>a.name===n);if(!o)return e;const{sortable:i}=o,s=new Intl.Collator(navigator.language,{sensitivity:"base",numeric:!0});if(n==="name"){const a=[...e.filter(u=>u.type==="folder")].sort((u,l)=>Ul(u,l,s,n,r,i)),c=[...e.filter(u=>u.type!=="folder")].sort((u,l)=>Ul(u,l,s,n,r,i));return r==="asc"?a.concat(c):c.concat(a)}return[...e].sort((a,c)=>Ul(a,c,s,o.prop||o.name,r,i))},Ul=(e,t,n,r,o,i)=>{let s=Bl(e,r),a=Bl(t,r);const c=o==="asc"?1:-1;if(i)if(typeof i=="string"){const l=d=>d.map(f=>f[i]).join("");s=l(s),a=l(a)}else typeof i=="function"&&(s=i(s),a=i(a));return!isNaN(s)&&!isNaN(a)?(s-a)*c:n.compare((s||"").toString(),(a||"").toString())*c},Oh=e=>Array.isArray(e)?e[0]:e,YT=e=>{switch(Oh(e)){case"asc":return"asc";case"desc":return"desc"}return null},kh=e=>e?[{name:"name",sortable:!0,sortDir:zt.Asc},{name:"size",sortable:!0,sortDir:zt.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:zt.Asc},{name:"owner",sortable:"displayName",sortDir:zt.Asc},{name:"mdate",sortable:t=>new Date(t).valueOf(),sortDir:zt.Desc},{name:"sdate",sortable:t=>new Date(t).valueOf(),sortDir:zt.Desc},{name:"ddate",sortable:t=>new Date(t).valueOf(),sortDir:zt.Desc}].filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[];function pM(e){return e}const xh=[{label:"A-Z",name:"name",sortable:!0,sortDir:zt.Asc},{label:"Z-A",name:"name",sortable:!0,sortDir:zt.Desc},{label:"Newest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:zt.Desc},{label:"Oldest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:zt.Asc},{label:"Largest",name:"size",sortable:!0,sortDir:zt.Desc},{label:"Smallest",name:"size",sortable:!0,sortDir:zt.Asc},{label:"Remaining quota",name:"remainingQuota",prop:"spaceQuota.remaining",sortable:!0,sortDir:zt.Desc},{label:"Total quota",name:"totalQuota",prop:"spaceQuota.total",sortable:!0,sortDir:zt.Desc},{label:"Used quota",name:"usedQuota",prop:"spaceQuota.used",sortable:!0,sortDir:zt.Desc}],JT=e=>e?xh.filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[],ZT=(e,{$gettext:t})=>e.map(n=>({...n,label:t(n.label)})),eA=be.z.object({icon:be.z.string(),name:be.z.string(),secure_view:be.z.boolean().optional().default(!1),target_ext:be.z.string().optional()}),tA=be.z.object({allow_creation:be.z.boolean().optional(),app_providers:be.z.array(eA),default_application:be.z.string().optional(),description:be.z.string().optional(),ext:be.z.string().optional(),mime_type:be.z.string(),name:be.z.string().optional()}),Nh=be.z.object({"mime-types":be.z.array(tA)});class nA{constructor(t,n){Ee(this,"_mimeTypes",le([]));Ee(this,"serverUrl");Ee(this,"clientService");this.serverUrl=t,this.clientService=n}async loadData(){const t=ee.urlJoin(this.serverUrl,"app","list"),{data:{"mime-types":n}}=await this.clientService.httpUnAuthenticated.get(t,{schema:Nh});this._mimeTypes.value=n}set mimeTypes(t){this._mimeTypes.value=t}get mimeTypes(){return p(this._mimeTypes)}get templateMimeTypes(){return p(this._mimeTypes).filter(t=>!!t.app_providers.some(n=>!!n.target_ext))}get appNames(){return[...new Set(p(this._mimeTypes).flatMap(t=>t.app_providers.map(n=>n.name)))]}getMimeTypesByAppName(t){return p(this._mimeTypes).filter(n=>n.app_providers.some(r=>r.name===t))}}var $h={},Ss={};Ss.byteLength=oA,Ss.toByteArray=aA,Ss.fromByteArray=uA;for(var or=[],Dn=[],rA=typeof Uint8Array<"u"?Uint8Array:Array,ql="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Oi=0,iA=ql.length;Oi<iA;++Oi)or[Oi]=ql[Oi],Dn[ql.charCodeAt(Oi)]=Oi;Dn[45]=62,Dn[95]=63;function Dh(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 oA(e){var t=Dh(e),n=t[0],r=t[1];return(n+r)*3/4-r}function sA(e,t,n){return(t+n)*3/4-n}function aA(e){var t,n=Dh(e),r=n[0],o=n[1],i=new rA(sA(e,r,o)),s=0,a=o>0?r-4:r,c;for(c=0;c<a;c+=4)t=Dn[e.charCodeAt(c)]<<18|Dn[e.charCodeAt(c+1)]<<12|Dn[e.charCodeAt(c+2)]<<6|Dn[e.charCodeAt(c+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=t&255;return o===2&&(t=Dn[e.charCodeAt(c)]<<2|Dn[e.charCodeAt(c+1)]>>4,i[s++]=t&255),o===1&&(t=Dn[e.charCodeAt(c)]<<10|Dn[e.charCodeAt(c+1)]<<4|Dn[e.charCodeAt(c+2)]>>2,i[s++]=t>>8&255,i[s++]=t&255),i}function lA(e){return or[e>>18&63]+or[e>>12&63]+or[e>>6&63]+or[e&63]}function cA(e,t,n){for(var r,o=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),o.push(lA(r));return o.join("")}function uA(e){for(var t,n=e.length,r=n%3,o=[],i=16383,s=0,a=n-r;s<a;s+=i)o.push(cA(e,s,s+i>a?a:s+i));return r===1?(t=e[n-1],o.push(or[t>>2]+or[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(or[t>>10]+or[t>>4&63]+or[t<<2&63]+"=")),o.join("")}var Vl={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Vl.read=function(e,t,n,r,o){var i,s,a=o*8-r-1,c=(1<<a)-1,u=c>>1,l=-7,d=n?o-1:0,f=n?-1:1,m=e[t+d];for(d+=f,i=m&(1<<-l)-1,m>>=-l,l+=a;l>0;i=i*256+e[t+d],d+=f,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=r;l>0;s=s*256+e[t+d],d+=f,l-=8);if(i===0)i=1-u;else{if(i===c)return s?NaN:(m?-1:1)*(1/0);s=s+Math.pow(2,r),i=i-u}return(m?-1:1)*s*Math.pow(2,i-r)},Vl.write=function(e,t,n,r,o,i){var s,a,c,u=i*8-o-1,l=(1<<u)-1,d=l>>1,f=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:i-1,w=r?1:-1,y=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=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+d>=1?t+=f/c:t+=f*Math.pow(2,1-d),t*c>=2&&(s++,c/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(t*c-1)*Math.pow(2,o),s=s+d):(a=t*Math.pow(2,d-1)*Math.pow(2,o),s=0));o>=8;e[n+m]=a&255,m+=w,a/=256,o-=8);for(s=s<<o|a,u+=o;u>0;e[n+m]=s&255,m+=w,s/=256,u-=8);e[n+m-w]|=y*128};/*!
1
+ (function(M,te){typeof exports=="object"&&typeof module<"u"?te(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("p-queue"),require("@vueuse/core"),require("cropperjs"),require("dompurify"),require("mark.js"),require("vue-router"),require("portal-vue"),require("@vue/shared"),require("deepmerge"),require("md-editor-v3"),require("zod"),require("@sentry/vue"),require("screenfull")):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","p-queue","@vueuse/core","cropperjs","dompurify","mark.js","vue-router","portal-vue","@vue/shared","deepmerge","md-editor-v3","zod","@sentry/vue","screenfull"],te):(M=typeof globalThis<"u"?globalThis:M||self,te(M["web-pkg"]={},M.webClient,M.vue,M.vue3Gettext,M.Fuse,M.lodashEs,M.globalAxios,M.uuid,M.fetchEventSource,M.vueConcurrency,M.luxon,M.filesize,M.qs,M.passwordSheriff,M.Uppy,M.Tus,M.XHRUpload,M.utils,M.pinia,M.oidcClientTs,M.PQueue,M.core,M.Cropper,M.DOMPurify,M.Mark,M.vueRouter,M.portalVue,M.shared,M.merge$1,M.mdEditorV3,M.zod,M.vue$1,M.screenfull))})(this,(function(M,te,vS,Fe,Wd,Ct,Xo,Xt,bS,or,Mt,wS,SS,ES,Hd,TS,AS,Gd,Ve,RS,On,ln,Wa,Kd,Qd,Yo,Ha,W,Xd,Jo,Te,CS,IS){"use strict";const _S=e=>e;function Yd(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function OS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Jd={exports:{}},Dt=Jd.exports={},Gr,Kr;function Ga(){throw new Error("setTimeout has not been defined")}function Ka(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Gr=setTimeout:Gr=Ga}catch{Gr=Ga}try{typeof clearTimeout=="function"?Kr=clearTimeout:Kr=Ka}catch{Kr=Ka}})();function Zd(e){if(Gr===setTimeout)return setTimeout(e,0);if((Gr===Ga||!Gr)&&setTimeout)return Gr=setTimeout,setTimeout(e,0);try{return Gr(e,0)}catch{try{return Gr.call(null,e,0)}catch{return Gr.call(this,e,0)}}}function PS(e){if(Kr===clearTimeout)return clearTimeout(e);if((Kr===Ka||!Kr)&&clearTimeout)return Kr=clearTimeout,clearTimeout(e);try{return Kr(e)}catch{try{return Kr.call(null,e)}catch{return Kr.call(this,e)}}}var cn=[],di=!1,Bn,Zo=-1;function kS(){!di||!Bn||(di=!1,Bn.length?cn=Bn.concat(cn):Zo=-1,cn.length&&ep())}function ep(){if(!di){var e=Zd(kS);di=!0;for(var t=cn.length;t;){for(Bn=cn,cn=[];++Zo<t;)Bn&&Bn[Zo].run();Zo=-1,t=cn.length}Bn=null,di=!1,PS(e)}}Dt.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];cn.push(new tp(e,t)),cn.length===1&&!di&&Zd(ep)};function tp(e,t){this.fun=e,this.array=t}tp.prototype.run=function(){this.fun.apply(null,this.array)},Dt.title="browser",Dt.browser=!0,Dt.env={},Dt.argv=[],Dt.version="",Dt.versions={};function un(){}Dt.on=un,Dt.addListener=un,Dt.once=un,Dt.off=un,Dt.removeListener=un,Dt.removeAllListeners=un,Dt.emit=un,Dt.prependListener=un,Dt.prependOnceListener=un,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 FS=Jd.exports;const ve=OS(FS);function Qr(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let ft;const Qa=new WeakSet;class xS{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,Qa.has(this)&&(Qa.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,lp(this),ip(this);const t=ft,r=Br;ft=this,Br=!0;try{return this.fn()}finally{ve.env.NODE_ENV!=="production"&&ft!==this&&Qr("Active effect was not restored correctly - this is likely a Vue internal bug."),op(this),ft=t,Br=r,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Za(t);this.deps=this.depsTail=void 0,lp(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Qa.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ja(this)&&this.run()}get dirty(){return Ja(this)}}let rp=0,Hi,Gi;function np(e,t=!1){if(e.flags|=8,t){e.next=Gi,Gi=e;return}e.next=Hi,Hi=e}function Xa(){rp++}function Ya(){if(--rp>0)return;if(Gi){let t=Gi;for(Gi=void 0;t;){const r=t.next;t.next=void 0,t.flags&=-9,t=r}}let e;for(;Hi;){let t=Hi;for(Hi=void 0;t;){const r=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=r}}if(e)throw e}function ip(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function op(e){let t,r=e.depsTail,n=r;for(;n;){const i=n.prevDep;n.version===-1?(n===r&&(r=i),Za(n),NS(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=i}e.deps=t,e.depsTail=r}function Ja(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(sp(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function sp(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ki)||(e.globalVersion=Ki,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ja(e))))return;e.flags|=2;const t=e.dep,r=ft,n=Br;ft=e,Br=!0;try{ip(e);const i=e.fn(e._value);(t.version===0||W.hasChanged(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{ft=r,Br=n,op(e),e.flags&=-3}}function Za(e,t=!1){const{dep:r,prevSub:n,nextSub:i}=e;if(n&&(n.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=n,e.nextSub=void 0),ve.env.NODE_ENV!=="production"&&r.subsHead===e&&(r.subsHead=i),r.subs===e&&(r.subs=n,!n&&r.computed)){r.computed.flags&=-5;for(let o=r.computed.deps;o;o=o.nextDep)Za(o,!0)}!t&&!--r.sc&&r.map&&r.map.delete(r.key)}function NS(e){const{prevDep:t,nextDep:r}=e;t&&(t.nextDep=r,e.prevDep=void 0),r&&(r.prevDep=t,e.nextDep=void 0)}let Br=!0;const ap=[];function pi(){ap.push(Br),Br=!1}function hi(){const e=ap.pop();Br=e===void 0?!0:e}function lp(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const r=ft;ft=void 0;try{t()}finally{ft=r}}}let Ki=0;class DS{constructor(t,r){this.sub=t,this.dep=r,this.version=r.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class es{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,ve.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){if(!ft||!Br||ft===this.computed)return;let r=this.activeLink;if(r===void 0||r.sub!==ft)r=this.activeLink=new DS(ft,this),ft.deps?(r.prevDep=ft.depsTail,ft.depsTail.nextDep=r,ft.depsTail=r):ft.deps=ft.depsTail=r,cp(r);else if(r.version===-1&&(r.version=this.version,r.nextDep)){const n=r.nextDep;n.prevDep=r.prevDep,r.prevDep&&(r.prevDep.nextDep=n),r.prevDep=ft.depsTail,r.nextDep=void 0,ft.depsTail.nextDep=r,ft.depsTail=r,ft.deps===r&&(ft.deps=n)}return ve.env.NODE_ENV!=="production"&&ft.onTrack&&ft.onTrack(W.extend({effect:ft},t)),r}trigger(t){this.version++,Ki++,this.notify(t)}notify(t){Xa();try{if(ve.env.NODE_ENV!=="production")for(let r=this.subsHead;r;r=r.nextSub)r.sub.onTrigger&&!(r.sub.flags&8)&&r.sub.onTrigger(W.extend({effect:r.sub},t));for(let r=this.subs;r;r=r.prevSub)r.sub.notify()&&r.sub.dep.notify()}finally{Ya()}}}function cp(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)cp(n)}const r=e.dep.subs;r!==e&&(e.prevSub=r,r&&(r.nextSub=e)),ve.env.NODE_ENV!=="production"&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}const ts=new WeakMap,jn=Symbol(ve.env.NODE_ENV!=="production"?"Object iterate":""),el=Symbol(ve.env.NODE_ENV!=="production"?"Map keys iterate":""),Qi=Symbol(ve.env.NODE_ENV!=="production"?"Array iterate":"");function Yt(e,t,r){if(Br&&ft){let n=ts.get(e);n||ts.set(e,n=new Map);let i=n.get(r);i||(n.set(r,i=new es),i.map=n,i.key=r),ve.env.NODE_ENV!=="production"?i.track({target:e,type:t,key:r}):i.track()}}function Pn(e,t,r,n,i,o){const s=ts.get(e);if(!s){Ki++;return}const a=l=>{l&&(ve.env.NODE_ENV!=="production"?l.trigger({target:e,type:t,key:r,newValue:n,oldValue:i,oldTarget:o}):l.trigger())};if(Xa(),t==="clear")s.forEach(a);else{const l=W.isArray(e),u=l&&W.isIntegerKey(r);if(l&&r==="length"){const c=Number(n);s.forEach((d,f)=>{(f==="length"||f===Qi||!W.isSymbol(f)&&f>=c)&&a(d)})}else switch((r!==void 0||s.has(void 0))&&a(s.get(r)),u&&a(s.get(Qi)),t){case"add":l?u&&a(s.get("length")):(a(s.get(jn)),W.isMap(e)&&a(s.get(el)));break;case"delete":l||(a(s.get(jn)),W.isMap(e)&&a(s.get(el)));break;case"set":W.isMap(e)&&a(s.get(jn));break}}Ya()}function $S(e,t){const r=ts.get(e);return r&&r.get(t)}function mi(e){const t=st(e);return t===e?t:(Yt(t,"iterate",Qi),sr(e)?t:t.map(Jt))}function rs(e){return Yt(e=st(e),"iterate",Qi),e}const LS={__proto__:null,[Symbol.iterator](){return tl(this,Symbol.iterator,Jt)},concat(...e){return mi(this).concat(...e.map(t=>W.isArray(t)?mi(t):t))},entries(){return tl(this,"entries",e=>(e[1]=Jt(e[1]),e))},every(e,t){return fn(this,"every",e,t,void 0,arguments)},filter(e,t){return fn(this,"filter",e,t,r=>r.map(Jt),arguments)},find(e,t){return fn(this,"find",e,t,Jt,arguments)},findIndex(e,t){return fn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return fn(this,"findLast",e,t,Jt,arguments)},findLastIndex(e,t){return fn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return fn(this,"forEach",e,t,void 0,arguments)},includes(...e){return rl(this,"includes",e)},indexOf(...e){return rl(this,"indexOf",e)},join(e){return mi(this).join(e)},lastIndexOf(...e){return rl(this,"lastIndexOf",e)},map(e,t){return fn(this,"map",e,t,void 0,arguments)},pop(){return Xi(this,"pop")},push(...e){return Xi(this,"push",e)},reduce(e,...t){return up(this,"reduce",e,t)},reduceRight(e,...t){return up(this,"reduceRight",e,t)},shift(){return Xi(this,"shift")},some(e,t){return fn(this,"some",e,t,void 0,arguments)},splice(...e){return Xi(this,"splice",e)},toReversed(){return mi(this).toReversed()},toSorted(e){return mi(this).toSorted(e)},toSpliced(...e){return mi(this).toSpliced(...e)},unshift(...e){return Xi(this,"unshift",e)},values(){return tl(this,"values",Jt)}};function tl(e,t,r){const n=rs(e),i=n[t]();return n!==e&&!sr(e)&&(i._next=i.next,i.next=()=>{const o=i._next();return o.value&&(o.value=r(o.value)),o}),i}const MS=Array.prototype;function fn(e,t,r,n,i,o){const s=rs(e),a=s!==e&&!sr(e),l=s[t];if(l!==MS[t]){const d=l.apply(e,o);return a?Jt(d):d}let u=r;s!==e&&(a?u=function(d,f){return r.call(this,Jt(d),f,e)}:r.length>2&&(u=function(d,f){return r.call(this,d,f,e)}));const c=l.call(s,u,n);return a&&i?i(c):c}function up(e,t,r,n){const i=rs(e);let o=r;return i!==e&&(sr(e)?r.length>3&&(o=function(s,a,l){return r.call(this,s,a,l,e)}):o=function(s,a,l){return r.call(this,s,Jt(a),l,e)}),i[t](o,...n)}function rl(e,t,r){const n=st(e);Yt(n,"iterate",Qi);const i=n[t](...r);return(i===-1||i===!1)&&ss(r[0])?(r[0]=st(r[0]),n[t](...r)):i}function Xi(e,t,r=[]){pi(),Xa();const n=st(e)[t].apply(e,r);return Ya(),hi(),n}const BS=W.makeMap("__proto__,__v_isRef,__isVue"),fp=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(W.isSymbol));function jS(e){W.isSymbol(e)||(e=String(e));const t=st(this);return Yt(t,"has",e),t.hasOwnProperty(e)}class dp{constructor(t=!1,r=!1){this._isReadonly=t,this._isShallow=r}get(t,r,n){if(r==="__v_skip")return t.__v_skip;const i=this._isReadonly,o=this._isShallow;if(r==="__v_isReactive")return!i;if(r==="__v_isReadonly")return i;if(r==="__v_isShallow")return o;if(r==="__v_raw")return n===(i?o?yp:gp:o?XS:mp).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const s=W.isArray(t);if(!i){let l;if(s&&(l=LS[r]))return l;if(r==="hasOwnProperty")return jS}const a=Reflect.get(t,r,Bt(t)?t:n);return(W.isSymbol(r)?fp.has(r):BS(r))||(i||Yt(t,"get",r),o)?a:Bt(a)?s&&W.isIntegerKey(r)?a:a.value:W.isObject(a)?i?dn(a):ol(a):a}}class US extends dp{constructor(t=!1){super(!1,t)}set(t,r,n,i){let o=t[r];if(!this._isShallow){const l=Xr(o);if(!sr(n)&&!Xr(n)&&(o=st(o),n=st(n)),!W.isArray(t)&&Bt(o)&&!Bt(n))return l?(ve.env.NODE_ENV!=="production"&&Qr(`Set operation on key "${String(r)}" failed: target is readonly.`,t[r]),!0):(o.value=n,!0)}const s=W.isArray(t)&&W.isIntegerKey(r)?Number(r)<t.length:W.hasOwn(t,r),a=Reflect.set(t,r,n,Bt(t)?t:i);return t===st(i)&&(s?W.hasChanged(n,o)&&Pn(t,"set",r,n,o):Pn(t,"add",r,n)),a}deleteProperty(t,r){const n=W.hasOwn(t,r),i=t[r],o=Reflect.deleteProperty(t,r);return o&&n&&Pn(t,"delete",r,void 0,i),o}has(t,r){const n=Reflect.has(t,r);return(!W.isSymbol(r)||!fp.has(r))&&Yt(t,"has",r),n}ownKeys(t){return Yt(t,"iterate",W.isArray(t)?"length":jn),Reflect.ownKeys(t)}}class pp extends dp{constructor(t=!1){super(!0,t)}set(t,r){return ve.env.NODE_ENV!=="production"&&Qr(`Set operation on key "${String(r)}" failed: target is readonly.`,t),!0}deleteProperty(t,r){return ve.env.NODE_ENV!=="production"&&Qr(`Delete operation on key "${String(r)}" failed: target is readonly.`,t),!0}}const qS=new US,VS=new pp,zS=new pp(!0),nl=e=>e,ns=e=>Reflect.getPrototypeOf(e);function WS(e,t,r){return function(...n){const i=this.__v_raw,o=st(i),s=W.isMap(o),a=e==="entries"||e===Symbol.iterator&&s,l=e==="keys"&&s,u=i[e](...n),c=r?nl:t?as:Jt;return!t&&Yt(o,"iterate",l?el:jn),{next(){const{value:d,done:f}=u.next();return f?{value:d,done:f}:{value:a?[c(d[0]),c(d[1])]:c(d),done:f}},[Symbol.iterator](){return this}}}}function is(e){return function(...t){if(ve.env.NODE_ENV!=="production"){const r=t[0]?`on key "${t[0]}" `:"";Qr(`${W.capitalize(e)} operation ${r}failed: target is readonly.`,st(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function HS(e,t){const r={get(i){const o=this.__v_raw,s=st(o),a=st(i);e||(W.hasChanged(i,a)&&Yt(s,"get",i),Yt(s,"get",a));const{has:l}=ns(s),u=t?nl:e?as:Jt;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&&Yt(st(i),"iterate",jn),i.size},has(i){const o=this.__v_raw,s=st(o),a=st(i);return e||(W.hasChanged(i,a)&&Yt(s,"has",i),Yt(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=st(a),u=t?nl:e?as:Jt;return!e&&Yt(l,"iterate",jn),a.forEach((c,d)=>i.call(o,u(c),u(d),s))}};return W.extend(r,e?{add:is("add"),set:is("set"),delete:is("delete"),clear:is("clear")}:{add(i){!t&&!sr(i)&&!Xr(i)&&(i=st(i));const o=st(this);return ns(o).has.call(o,i)||(o.add(i),Pn(o,"add",i,i)),this},set(i,o){!t&&!sr(o)&&!Xr(o)&&(o=st(o));const s=st(this),{has:a,get:l}=ns(s);let u=a.call(s,i);u?ve.env.NODE_ENV!=="production"&&hp(s,a,i):(i=st(i),u=a.call(s,i));const c=l.call(s,i);return s.set(i,o),u?W.hasChanged(o,c)&&Pn(s,"set",i,o,c):Pn(s,"add",i,o),this},delete(i){const o=st(this),{has:s,get:a}=ns(o);let l=s.call(o,i);l?ve.env.NODE_ENV!=="production"&&hp(o,s,i):(i=st(i),l=s.call(o,i));const u=a?a.call(o,i):void 0,c=o.delete(i);return l&&Pn(o,"delete",i,void 0,u),c},clear(){const i=st(this),o=i.size!==0,s=ve.env.NODE_ENV!=="production"?W.isMap(i)?new Map(i):new Set(i):void 0,a=i.clear();return o&&Pn(i,"clear",void 0,void 0,s),a}}),["keys","values","entries",Symbol.iterator].forEach(i=>{r[i]=WS(i,e,t)}),r}function il(e,t){const r=HS(e,t);return(n,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?n:Reflect.get(W.hasOwn(r,i)&&i in n?r:n,i,o)}const GS={get:il(!1,!1)},KS={get:il(!0,!1)},QS={get:il(!0,!0)};function hp(e,t,r){const n=st(r);if(n!==r&&t.call(e,n)){const i=W.toRawType(e);Qr(`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 mp=new WeakMap,XS=new WeakMap,gp=new WeakMap,yp=new WeakMap;function YS(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function JS(e){return e.__v_skip||!Object.isExtensible(e)?0:YS(W.toRawType(e))}function ol(e){return Xr(e)?e:sl(e,!1,qS,GS,mp)}function dn(e){return sl(e,!0,VS,KS,gp)}function os(e){return sl(e,!0,zS,QS,yp)}function sl(e,t,r,n,i){if(!W.isObject(e))return ve.env.NODE_ENV!=="production"&&Qr(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=JS(e);if(o===0)return e;const s=i.get(e);if(s)return s;const a=new Proxy(e,o===2?n:r);return i.set(e,a),a}function Un(e){return Xr(e)?Un(e.__v_raw):!!(e&&e.__v_isReactive)}function Xr(e){return!!(e&&e.__v_isReadonly)}function sr(e){return!!(e&&e.__v_isShallow)}function ss(e){return e?!!e.__v_raw:!1}function st(e){const t=e&&e.__v_raw;return t?st(t):e}function vp(e){return!W.hasOwn(e,"__v_skip")&&Object.isExtensible(e)&&W.def(e,"__v_skip",!0),e}const Jt=e=>W.isObject(e)?ol(e):e,as=e=>W.isObject(e)?dn(e):e;function Bt(e){return e?e.__v_isRef===!0:!1}function le(e){return bp(e,!1)}function ZS(e){return bp(e,!0)}function bp(e,t){return Bt(e)?e:new eE(e,t)}class eE{constructor(t,r){this.dep=new es,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=r?t:st(t),this._value=r?t:Jt(t),this.__v_isShallow=r}get value(){return ve.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(t){const r=this._rawValue,n=this.__v_isShallow||sr(t)||Xr(t);t=n?t:st(t),W.hasChanged(t,r)&&(this._rawValue=t,this._value=n?t:Jt(t),ve.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:r}):this.dep.trigger())}}function h(e){return Bt(e)?e.value:e}const tE={get:(e,t,r)=>t==="__v_raw"?e:h(Reflect.get(e,t,r)),set:(e,t,r,n)=>{const i=e[t];return Bt(i)&&!Bt(r)?(i.value=r,!0):Reflect.set(e,t,r,n)}};function rE(e){return Un(e)?e:new Proxy(e,tE)}class nE{constructor(t){this.__v_isRef=!0,this._value=void 0;const r=this.dep=new es,{get:n,set:i}=t(r.track.bind(r),r.trigger.bind(r));this._get=n,this._set=i}get value(){return this._value=this._get()}set value(t){this._set(t)}}function iE(e){return new nE(e)}class oE{constructor(t,r,n){this._object=t,this._key=r,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){const t=this._object[this._key];return this._value=t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return $S(st(this._object),this._key)}}class sE{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 aE(e,t,r){return Bt(e)?e:W.isFunction(e)?new sE(e):W.isObject(e)&&arguments.length>1?lE(e,t,r):le(e)}function lE(e,t,r){const n=e[t];return Bt(n)?n:new oE(e,t,r)}class cE{constructor(t,r,n){this.fn=t,this.setter=r,this._value=void 0,this.dep=new es(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ki-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!r,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&ft!==this)return np(this,!0),!0;ve.env.NODE_ENV}get value(){const t=ve.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return sp(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter?this.setter(t):ve.env.NODE_ENV!=="production"&&Qr("Write operation failed: computed value is readonly")}}function uE(e,t,r=!1){let n,i;W.isFunction(e)?n=e:(n=e.get,i=e.set);const o=new cE(n,i,r);return ve.env.NODE_ENV,o}const ls={},cs=new WeakMap;let qn;function fE(e,t=!1,r=qn){if(r){let n=cs.get(r);n||cs.set(r,n=[]),n.push(e)}else ve.env.NODE_ENV!=="production"&&!t&&Qr("onWatcherCleanup() was called when there was no active watcher to associate with.")}function dE(e,t,r=W.EMPTY_OBJ){const{immediate:n,deep:i,once:o,scheduler:s,augmentJob:a,call:l}=r,u=p=>{(r.onWarn||Qr)("Invalid watch source: ",p,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},c=p=>i?p:sr(p)||i===!1||i===0?pn(p,1):pn(p);let d,f,m,w,v=!1,E=!1;if(Bt(e)?(f=()=>e.value,v=sr(e)):Un(e)?(f=()=>c(e),v=!0):W.isArray(e)?(E=!0,v=e.some(p=>Un(p)||sr(p)),f=()=>e.map(p=>{if(Bt(p))return p.value;if(Un(p))return c(p);if(W.isFunction(p))return l?l(p,2):p();ve.env.NODE_ENV!=="production"&&u(p)})):W.isFunction(e)?t?f=l?()=>l(e,2):e:f=()=>{if(m){pi();try{m()}finally{hi()}}const p=qn;qn=d;try{return l?l(e,3,[w]):e(w)}finally{qn=p}}:(f=W.NOOP,ve.env.NODE_ENV!=="production"&&u(e)),t&&i){const p=f,S=i===!0?1/0:i;f=()=>pn(p(),S)}const b=()=>{d.stop()};if(o&&t){const p=t;t=(...S)=>{p(...S),b()}}let g=E?new Array(e.length).fill(ls):ls;const y=p=>{if(!(!(d.flags&1)||!d.dirty&&!p))if(t){const S=d.run();if(i||v||(E?S.some((T,R)=>W.hasChanged(T,g[R])):W.hasChanged(S,g))){m&&m();const T=qn;qn=d;try{const R=[S,g===ls?void 0:E&&g[0]===ls?[]:g,w];g=S,l?l(t,3,R):t(...R)}finally{qn=T}}}else d.run()};return a&&a(y),d=new xS(f),d.scheduler=s?()=>s(y,!1):y,w=p=>fE(p,!1,d),m=d.onStop=()=>{const p=cs.get(d);if(p){if(l)l(p,4);else for(const S of p)S();cs.delete(d)}},ve.env.NODE_ENV!=="production"&&(d.onTrack=r.onTrack,d.onTrigger=r.onTrigger),t?n?y(!0):g=d.run():s?s(y.bind(null,!0),!0):d.run(),b.pause=d.pause.bind(d),b.resume=d.resume.bind(d),b.stop=b,b}function pn(e,t=1/0,r){if(t<=0||!W.isObject(e)||e.__v_skip||(r=r||new Map,(r.get(e)||0)>=t))return e;if(r.set(e,t),t--,Bt(e))pn(e.value,t,r);else if(W.isArray(e))for(let n=0;n<e.length;n++)pn(e[n],t,r);else if(W.isSet(e)||W.isMap(e))e.forEach(n=>{pn(n,t,r)});else if(W.isPlainObject(e)){for(const n in e)pn(e[n],t,r);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&pn(e[n],t,r)}return e}const Vn=[];function pE(e){Vn.push(e)}function hE(){Vn.pop()}let al=!1;function rt(e,...t){if(al)return;al=!0,pi();const r=Vn.length?Vn[Vn.length-1].component:null,n=r&&r.appContext.config.warnHandler,i=mE();if(n)us(n,r,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(""),r&&r.proxy,i.map(({vnode:o})=>`at <${ah(r,o.type)}>`).join(`
2
+ `),i]);else{const o=[`[Vue warn]: ${e}`,...t];i.length&&o.push(`
3
+ `,...gE(i)),console.warn(...o)}hi(),al=!1}function mE(){let e=Vn[Vn.length-1];if(!e)return[];const t=[];for(;e;){const r=t[0];r&&r.vnode===e?r.recurseCount++:t.push({vnode:e,recurseCount:0});const n=e.component&&e.component.parent;e=n&&n.vnode}return t}function gE(e){const t=[];return e.forEach((r,n)=>{t.push(...n===0?[]:[`
4
+ `],...yE(r))}),t}function yE({vnode:e,recurseCount:t}){const r=t>0?`... (${t} recursive calls)`:"",n=e.component?e.component.parent==null:!1,i=` at <${ah(e.component,e.type,n)}`,o=">"+r;return e.props?[i,...vE(e.props),o]:[i+o]}function vE(e){const t=[],r=Object.keys(e);return r.slice(0,3).forEach(n=>{t.push(...wp(n,e[n]))}),r.length>3&&t.push(" ..."),t}function wp(e,t,r){return W.isString(t)?(t=JSON.stringify(t),r?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?r?t:[`${e}=${t}`]:Bt(t)?(t=wp(e,st(t.value),!0),r?t:[`${e}=Ref<`,t,">"]):W.isFunction(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=st(t),r?t:[`${e}=`,t])}const ll={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 us(e,t,r,n){try{return n?e(...n):e()}catch(i){fs(i,t,r)}}function cl(e,t,r,n){if(W.isFunction(e)){const i=us(e,t,r,n);return i&&W.isPromise(i)&&i.catch(o=>{fs(o,t,r)}),i}if(W.isArray(e)){const i=[];for(let o=0;o<e.length;o++)i.push(cl(e[o],t,r,n));return i}else ve.env.NODE_ENV!=="production"&&rt(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function fs(e,t,r,n=!0){const i=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||W.EMPTY_OBJ;if(t){let a=t.parent;const l=t.proxy,u=ve.env.NODE_ENV!=="production"?ll[r]:`https://vuejs.org/error-reference/#runtime-${r}`;for(;a;){const c=a.ec;if(c){for(let d=0;d<c.length;d++)if(c[d](e,l,u)===!1)return}a=a.parent}if(o){pi(),us(o,null,10,[e,l,u]),hi();return}}bE(e,r,i,n,s)}function bE(e,t,r,n=!0,i=!1){if(ve.env.NODE_ENV!=="production"){const o=ll[t];if(r&&pE(r),rt(`Unhandled error${o?` during execution of ${o}`:""}`),r&&hE(),n)throw e;console.error(e)}else{if(i)throw e;console.error(e)}}const _r=[];let hn=-1;const gi=[];let kn=null,yi=0;const Sp=Promise.resolve();let ds=null;const wE=100;function ar(e){const t=ds||Sp;return e?t.then(this?e.bind(this):e):t}function SE(e){let t=hn+1,r=_r.length;for(;t<r;){const n=t+r>>>1,i=_r[n],o=Yi(i);o<e||o===e&&i.flags&2?t=n+1:r=n}return t}function ul(e){if(!(e.flags&1)){const t=Yi(e),r=_r[_r.length-1];!r||!(e.flags&2)&&t>=Yi(r)?_r.push(e):_r.splice(SE(t),0,e),e.flags|=1,Ep()}}function Ep(){ds||(ds=Sp.then(Ap))}function Tp(e){W.isArray(e)?gi.push(...e):kn&&e.id===-1?kn.splice(yi+1,0,e):e.flags&1||(gi.push(e),e.flags|=1),Ep()}function EE(e){if(gi.length){const t=[...new Set(gi)].sort((r,n)=>Yi(r)-Yi(n));if(gi.length=0,kn){kn.push(...t);return}for(kn=t,ve.env.NODE_ENV!=="production"&&(e=e||new Map),yi=0;yi<kn.length;yi++){const r=kn[yi];ve.env.NODE_ENV!=="production"&&Rp(e,r)||(r.flags&4&&(r.flags&=-2),r.flags&8||r(),r.flags&=-2)}kn=null,yi=0}}const Yi=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ap(e){ve.env.NODE_ENV!=="production"&&(e=e||new Map);const t=ve.env.NODE_ENV!=="production"?r=>Rp(e,r):W.NOOP;try{for(hn=0;hn<_r.length;hn++){const r=_r[hn];if(r&&!(r.flags&8)){if(ve.env.NODE_ENV!=="production"&&t(r))continue;r.flags&4&&(r.flags&=-2),us(r,r.i,r.i?15:14),r.flags&4||(r.flags&=-2)}}}finally{for(;hn<_r.length;hn++){const r=_r[hn];r&&(r.flags&=-2)}hn=-1,_r.length=0,EE(e),ds=null,(_r.length||gi.length)&&Ap(e)}}function Rp(e,t){const r=e.get(t)||0;if(r>wE){const n=t.i,i=n&&Rs(n.type);return fs(`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,r+1),!1}let Ji=!1;const fl=new Map;if(ve.env.NODE_ENV!=="production"){const e=W.getGlobalThis();e.__VUE_HMR_RUNTIME__||(e.__VUE_HMR_RUNTIME__={createRecord:dl(TE),rerender:dl(AE),reload:dl(RE)})}const ps=new Map;function TE(e,t){return ps.has(e)?!1:(ps.set(e,{initialDef:hs(t),instances:new Set}),!0)}function hs(e){return lh(e)?e.__vccOpts:e}function AE(e,t){const r=ps.get(e);r&&(r.initialDef.render=t,[...r.instances].forEach(n=>{t&&(n.render=t,hs(n.type).render=t),n.renderCache=[],Ji=!0,n.job.flags&8||n.update(),Ji=!1}))}function RE(e,t){const r=ps.get(e);if(!r)return;t=hs(t),Cp(r.initialDef,t);const n=[...r.instances];for(let i=0;i<n.length;i++){const o=n[i],s=hs(o.type);let a=fl.get(s);a||(s!==r.initialDef&&Cp(s,t),fl.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?ul(()=>{o.job.flags&8||(Ji=!0,o.parent.update(),Ji=!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)}Tp(()=>{fl.clear()})}function Cp(e,t){W.extend(e,t);for(const r in e)r!=="__file"&&!(r in t)&&delete e[r]}function dl(e){return(t,r)=>{try{return e(t,r)}catch(n){console.error(n),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let Fn,Zi=[],pl=!1;function CE(e,...t){Fn?Fn.emit(e,...t):pl||Zi.push({event:e,args:t})}function Ip(e,t){var r,n;Fn=e,Fn?(Fn.enabled=!0,Zi.forEach(({event:i,args:o})=>Fn.emit(i,...o)),Zi=[]):typeof window<"u"&&window.HTMLElement&&!((n=(r=window.navigator)==null?void 0:r.userAgent)!=null&&n.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{Ip(o,t)}),setTimeout(()=>{Fn||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,pl=!0,Zi=[])},3e3)):(pl=!0,Zi=[])}const IE=_E("component:updated");function _E(e){return t=>{CE(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let Zt=null,_p=null;function Op(e){const t=Zt;return Zt=e,_p=e&&e.type.__scopeId||null,t}function we(e,t=Zt,r){if(!t||e._n)return e;const n=(...i)=>{n._d&&Ss(-1);const o=Op(t);let s;try{s=e(...i)}finally{Op(o),n._d&&Ss(1)}return ve.env.NODE_ENV!=="production"&&IE(t),s};return n._n=!0,n._c=!0,n._d=!0,n}function lt(e,t){if(Zt===null)return ve.env.NODE_ENV!=="production"&&rt("withDirectives can only be used inside render functions."),e;const r=sh(Zt),n=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[o,s,a,l=W.EMPTY_OBJ]=t[i];o&&(W.isFunction(o)&&(o={mounted:o,updated:o}),o.deep&&pn(s),n.push({dir:o,instance:r,value:s,oldValue:void 0,arg:a,modifiers:l}))}return e}const OE=Symbol("_vte"),PE=e=>e.__isTeleport,zn=e=>e&&(e.disabled||e.disabled===""),Pp=e=>e&&(e.defer||e.defer===""),kp=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Fp=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,hl=(e,t)=>{const r=e&&e.to;if(W.isString(r))if(t){const n=t(r);return ve.env.NODE_ENV!=="production"&&!n&&!zn(e)&&rt(`Failed to locate Teleport target with selector "${r}". 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.`),n}else return ve.env.NODE_ENV!=="production"&&rt("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"),null;else return ve.env.NODE_ENV!=="production"&&!r&&!zn(e)&&rt(`Invalid Teleport target: ${r}`),r},xp={name:"Teleport",__isTeleport:!0,process(e,t,r,n,i,o,s,a,l,u){const{mc:c,pc:d,pbc:f,o:{insert:m,querySelector:w,createText:v,createComment:E}}=u,b=zn(t.props);let{shapeFlag:g,children:y,dynamicChildren:p}=t;if(ve.env.NODE_ENV!=="production"&&Ji&&(l=!1,p=null),e==null){const S=t.el=ve.env.NODE_ENV!=="production"?E("teleport start"):v(""),T=t.anchor=ve.env.NODE_ENV!=="production"?E("teleport end"):v("");m(S,r,n),m(T,r,n);const R=(A,D)=>{g&16&&(i&&i.isCE&&(i.ce._teleportTarget=A),c(y,A,D,i,o,s,a,l))},I=()=>{const A=t.target=hl(t.props,w),D=Dp(A,t,v,m);A?(s!=="svg"&&kp(A)?s="svg":s!=="mathml"&&Fp(A)&&(s="mathml"),b||(R(A,D),gs(t,!1))):ve.env.NODE_ENV!=="production"&&!b&&rt("Invalid Teleport target on mount:",A,`(${typeof A})`)};b&&(R(r,T),gs(t,!0)),Pp(t.props)?(t.el.__isMounted=!1,Sl(()=>{I(),delete t.el.__isMounted},o)):I()}else{if(Pp(t.props)&&e.el.__isMounted===!1){Sl(()=>{xp.process(e,t,r,n,i,o,s,a,l,u)},o);return}t.el=e.el,t.targetStart=e.targetStart;const S=t.anchor=e.anchor,T=t.target=e.target,R=t.targetAnchor=e.targetAnchor,I=zn(e.props),A=I?r:T,D=I?S:R;if(s==="svg"||kp(T)?s="svg":(s==="mathml"||Fp(T))&&(s="mathml"),p?(f(e.dynamicChildren,p,A,i,o,s,a),Xp(e,t,ve.env.NODE_ENV==="production")):l||d(e,t,A,D,i,o,s,a,!1),b)I?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ms(t,r,S,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const H=t.target=hl(t.props,w);H?ms(t,H,null,u,0):ve.env.NODE_ENV!=="production"&&rt("Invalid Teleport target on update:",T,`(${typeof T})`)}else I&&ms(t,T,R,u,1);gs(t,b)}},remove(e,t,r,{um:n,o:{remove:i}},o){const{shapeFlag:s,children:a,anchor:l,targetStart:u,targetAnchor:c,target:d,props:f}=e;if(d&&(i(u),i(c)),o&&i(l),s&16){const m=o||!zn(f);for(let w=0;w<a.length;w++){const v=a[w];n(v,t,r,m,!!v.dynamicChildren)}}},move:ms,hydrate:kE};function ms(e,t,r,{o:{insert:n},m:i},o=2){o===0&&n(e.targetAnchor,t,r);const{el:s,anchor:a,shapeFlag:l,children:u,props:c}=e,d=o===2;if(d&&n(s,t,r),(!d||zn(c))&&l&16)for(let f=0;f<u.length;f++)i(u[f],t,r,2);d&&n(a,t,r)}function kE(e,t,r,n,i,o,{o:{nextSibling:s,parentNode:a,querySelector:l,insert:u,createText:c}},d){function f(v,E,b,g){E.anchor=d(s(v),E,a(v),r,n,i,o),E.targetStart=b,E.targetAnchor=g}const m=t.target=hl(t.props,l),w=zn(t.props);if(m){const v=m._lpa||m.firstChild;if(t.shapeFlag&16)if(w)f(e,t,v,v&&s(v));else{t.anchor=s(e);let E=v;for(;E;){if(E&&E.nodeType===8){if(E.data==="teleport start anchor")t.targetStart=E;else if(E.data==="teleport anchor"){t.targetAnchor=E,m._lpa=t.targetAnchor&&s(t.targetAnchor);break}}E=s(E)}t.targetAnchor||Dp(m,t,c,u),d(v&&s(v),t,m,r,n,i,o)}gs(t,w)}else w&&t.shapeFlag&16&&f(e,t,e,s(e));return t.anchor&&s(t.anchor)}const Np=xp;function gs(e,t){const r=e.ctx;if(r&&r.ut){let n,i;for(t?(n=e.el,i=e.anchor):(n=e.targetStart,i=e.targetAnchor);n&&n!==i;)n.nodeType===1&&n.setAttribute("data-v-owner",r.uid),n=n.nextSibling;r.ut()}}function Dp(e,t,r,n){const i=t.targetStart=r(""),o=t.targetAnchor=r("");return i[OE]=o,e&&(n(i,e),n(o,e)),o}function $p(e,t){e.shapeFlag&6&&e.component?(e.transition=t,$p(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 xe(e,t){return W.isFunction(e)?W.extend({name:e.name},t,{setup:e}):e}function FE(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const xE=new WeakSet;function Wn(e){const t=As(),r=ZS(null);if(t){const i=t.refs===W.EMPTY_OBJ?t.refs={}:t.refs;let o;ve.env.NODE_ENV!=="production"&&(o=Object.getOwnPropertyDescriptor(i,e))&&!o.configurable?rt(`useTemplateRef('${e}') already exists.`):Object.defineProperty(i,e,{enumerable:!0,get:()=>r.value,set:s=>r.value=s})}else ve.env.NODE_ENV!=="production"&&rt("useTemplateRef() is called when there is no active component instance to be associated with.");const n=ve.env.NODE_ENV!=="production"?dn(r):r;return ve.env.NODE_ENV!=="production"&&xE.add(n),n}const Lp=e=>e.nodeType===8;W.getGlobalThis().requestIdleCallback,W.getGlobalThis().cancelIdleCallback;function NE(e,t){if(Lp(e)&&e.data==="["){let r=1,n=e.nextSibling;for(;n;){if(n.nodeType===1){if(t(n)===!1)break}else if(Lp(n))if(n.data==="]"){if(--r===0)break}else n.data==="["&&r++;n=n.nextSibling}}else t(e)}const DE=e=>!!e.type.__asyncLoader;function $E(e){W.isFunction(e)&&(e={loader:e});const{loader:t,loadingComponent:r,errorComponent:n,delay:i=200,hydrate:o,timeout:s,suspensible:a=!0,onError:l}=e;let u=null,c,d=0;const f=()=>(d++,u=null,m()),m=()=>{let w;return u||(w=u=t().catch(v=>{if(v=v instanceof Error?v:new Error(String(v)),l)return new Promise((E,b)=>{l(v,()=>E(f()),()=>b(v),d+1)});throw v}).then(v=>{if(w!==u&&u)return u;if(ve.env.NODE_ENV!=="production"&&!v&&rt("Async component loader resolved to undefined. If you are using retry(), make sure to return its return value."),v&&(v.__esModule||v[Symbol.toStringTag]==="Module")&&(v=v.default),ve.env.NODE_ENV!=="production"&&v&&!W.isObject(v)&&!W.isFunction(v))throw new Error(`Invalid async component load result: ${v}`);return c=v,v}))};return xe({name:"AsyncComponentWrapper",__asyncLoader:m,__asyncHydrate(w,v,E){let b=!1;(v.bu||(v.bu=[])).push(()=>b=!0);const g=()=>{if(b){ve.env.NODE_ENV!=="production"&&rt(`Skipping lazy hydration for component '${Rs(c)||c.__file}': it was updated before lazy hydration performed.`);return}E()},y=o?()=>{const p=o(g,S=>NE(w,S));p&&(v.bum||(v.bum=[])).push(p)}:g;c?y():m().then(()=>!v.isUnmounted&&y())},get __asyncResolved(){return c},setup(){const w=Ar;if(FE(w),c)return()=>ml(c,w);const v=y=>{u=null,fs(y,w,13,!n)};if(a&&w.suspense||Si)return m().then(y=>()=>ml(y,w)).catch(y=>(v(y),()=>n?ge(n,{error:y}):null));const E=le(!1),b=le(),g=le(!!i);return i&&setTimeout(()=>{g.value=!1},i),s!=null&&setTimeout(()=>{if(!E.value&&!b.value){const y=new Error(`Async component timed out after ${s}ms.`);v(y),b.value=y}},s),m().then(()=>{E.value=!0,w.parent&&LE(w.parent.vnode)&&w.parent.update()}).catch(y=>{v(y),b.value=y}),()=>{if(E.value&&c)return ml(c,w);if(b.value&&n)return ge(n,{error:b.value});if(r&&!g.value)return ge(r)}}})}function ml(e,t){const{ref:r,props:n,children:i,ce:o}=t.vnode,s=ge(e,n,i);return s.ref=r,s.ce=o,delete t.vnode.ce,s}const LE=e=>e.type.__isKeepAlive;function ME(e,t,r=Ar,n=!1){if(r){const i=r[e]||(r[e]=[]),o=t.__weh||(t.__weh=(...s)=>{pi();const a=ih(r),l=cl(t,r,e,s);return a(),hi(),l});return n?i.unshift(o):i.push(o),o}else if(ve.env.NODE_ENV!=="production"){const i=W.toHandlerKey(ll[e].replace(/ hook$/,""));rt(`${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 ys=e=>(t,r=Ar)=>{(!Si||e==="sp")&&ME(e,(...n)=>t(...n),r)},$t=ys("m"),BE=ys("bu"),mr=ys("bum"),gl=ys("um"),vs="components",jE="directives";function be(e,t){return yl(vs,e,!0,t)||e}const Mp=Symbol.for("v-ndc");function jr(e){return W.isString(e)?yl(vs,e,!1)||e:e||Mp}function lr(e){return yl(jE,e)}function yl(e,t,r=!0,n=!1){const i=Zt||Ar;if(i){const o=i.type;if(e===vs){const a=Rs(o,!1);if(a&&(a===t||a===W.camelize(t)||a===W.capitalize(W.camelize(t))))return o}const s=Bp(i[e]||o[e],t)||Bp(i.appContext[e],t);if(!s&&n)return o;if(ve.env.NODE_ENV!=="production"&&r&&!s){const a=e===vs?`
5
+ If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`:"";rt(`Failed to resolve ${e.slice(0,-1)}: ${t}${a}`)}return s}else ve.env.NODE_ENV!=="production"&&rt(`resolve${W.capitalize(e.slice(0,-1))} can only be used in render() or setup().`)}function Bp(e,t){return e&&(e[t]||e[W.camelize(t)]||e[W.capitalize(W.camelize(t))])}function mt(e,t,r,n){let i;const o=r,s=W.isArray(e);if(s||W.isString(e)){const a=s&&Un(e);let l=!1,u=!1;a&&(l=!sr(e),u=Xr(e),e=rs(e)),i=new Array(e.length);for(let c=0,d=e.length;c<d;c++)i[c]=t(l?u?as(Jt(e[c])):Jt(e[c]):e[c],c,void 0,o)}else if(typeof e=="number"){ve.env.NODE_ENV!=="production"&&!Number.isInteger(e)&&rt(`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(W.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 r=0;r<t.length;r++){const n=t[r];if(W.isArray(n))for(let i=0;i<n.length;i++)e[n[i].name]=n[i].fn;else n&&(e[n.name]=n.key?(...i)=>{const o=n.fn(...i);return o&&(o.key=n.key),o}:n.fn)}return e}function je(e,t,r={},n,i){if(Zt.ce||Zt.parent&&DE(Zt.parent)&&Zt.parent.ce)return t!=="default"&&(r.name=t),Q(),Ae(Ue,null,[ge("slot",r,n&&n())],64);let o=e[t];ve.env.NODE_ENV!=="production"&&o&&o.length>1&&(rt("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),Q();const s=o&&Up(o(r)),a=r.key||s&&s.key,l=Ae(Ue,{key:(a&&!W.isSymbol(a)?a:`_${t}`)+(!s&&n?"_fb":"")},s||(n?n():[]),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=>Es(t)?!(t.type===bi||t.type===Ue&&!Up(t.children)):!0)?e:null}function vl(e,t){const r={};if(ve.env.NODE_ENV!=="production"&&!W.isObject(e))return rt("v-on with no argument expects an object value."),r;for(const n in e)r[t&&/[A-Z]/.test(n)?`on:${n}`:W.toHandlerKey(n)]=e[n];return r}const bl=e=>e?n1(e)?sh(e):bl(e.parent):null,wl=W.extend(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>ve.env.NODE_ENV!=="production"?os(e.props):e.props,$attrs:e=>ve.env.NODE_ENV!=="production"?os(e.attrs):e.attrs,$slots:e=>ve.env.NODE_ENV!=="production"?os(e.slots):e.slots,$refs:e=>ve.env.NODE_ENV!=="production"?os(e.refs):e.refs,$parent:e=>bl(e.parent),$root:e=>bl(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>qE(e),$forceUpdate:e=>e.f||(e.f=()=>{ul(e.update)}),$nextTick:e=>e.n||(e.n=ar.bind(e.proxy)),$watch:e=>XE.bind(e)}),UE={};ve.env.NODE_ENV!=="production"&&(UE.ownKeys=e=>(rt("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 qp(){return zp("useSlots").slots}function Vp(){return zp("useAttrs").attrs}function zp(e){const t=As();return ve.env.NODE_ENV!=="production"&&!t&&rt(`${e}() called without active instance.`),t.setupContext||(t.setupContext=o1(t))}function Wp(e){return W.isArray(e)?e.reduce((t,r)=>(t[r]=null,t),{}):e}function qE(e){const t=e.type,{mixins:r,extends:n}=t,{mixins:i,optionsCache:o,config:{optionMergeStrategies:s}}=e.appContext,a=o.get(t);let l;return a?l=a:!i.length&&!r&&!n?l=t:(l={},i.length&&i.forEach(u=>bs(l,u,s,!0)),bs(l,t,s)),W.isObject(t)&&o.set(t,l),l}function bs(e,t,r,n=!1){const{mixins:i,extends:o}=t;o&&bs(e,o,r,!0),i&&i.forEach(s=>bs(e,s,r,!0));for(const s in t)if(n&&s==="expose")ve.env.NODE_ENV!=="production"&&rt('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const a=VE[s]||r&&r[s];e[s]=a?a(e[s],t[s]):t[s]}return e}const VE={data:Hp,props:Kp,emits:Kp,methods:eo,computed:eo,beforeCreate:cr,created:cr,beforeMount:cr,mounted:cr,beforeUpdate:cr,updated:cr,beforeDestroy:cr,beforeUnmount:cr,destroyed:cr,unmounted:cr,activated:cr,deactivated:cr,errorCaptured:cr,serverPrefetch:cr,components:eo,directives:eo,watch:WE,provide:Hp,inject:zE};function Hp(e,t){return t?e?function(){return W.extend(W.isFunction(e)?e.call(this,this):e,W.isFunction(t)?t.call(this,this):t)}:t:e}function zE(e,t){return eo(Gp(e),Gp(t))}function Gp(e){if(W.isArray(e)){const t={};for(let r=0;r<e.length;r++)t[e[r]]=e[r];return t}return e}function cr(e,t){return e?[...new Set([].concat(e,t))]:t}function eo(e,t){return e?W.extend(Object.create(null),e,t):t}function Kp(e,t){return e?W.isArray(e)&&W.isArray(t)?[...new Set([...e,...t])]:W.extend(Object.create(null),Wp(e),Wp(t??{})):t}function WE(e,t){if(!e)return t;if(!t)return e;const r=W.extend(Object.create(null),e);for(const n in t)r[n]=cr(e[n],t[n]);return r}let HE=null;function vi(e,t){if(!Ar)ve.env.NODE_ENV!=="production"&&rt("provide() can only be used inside setup().");else{let r=Ar.provides;const n=Ar.parent&&Ar.parent.provides;n===r&&(r=Ar.provides=Object.create(n)),r[e]=t}}function mn(e,t,r=!1){const n=As();if(n||HE){let i=n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return r&&W.isFunction(t)?t.call(n&&n.proxy):t;ve.env.NODE_ENV!=="production"&&rt(`injection "${String(e)}" not found.`)}else ve.env.NODE_ENV!=="production"&&rt("inject() can only be used inside setup() or functional components.")}const GE={},Qp=e=>Object.getPrototypeOf(e)===GE,Sl=ZE;function Xp(e,t,r=!1){const n=e.children,i=t.children;if(W.isArray(n)&&W.isArray(i))for(let o=0;o<n.length;o++){const s=n[o];let a=i[o];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[o]=r1(i[o]),a.el=s.el),!r&&a.patchFlag!==-2&&Xp(s,a)),a.type===Jp&&a.patchFlag!==-1&&(a.el=s.el),a.type===bi&&!a.el&&(a.el=s.el),ve.env.NODE_ENV!=="production"&&a.el&&(a.el.__vnode=a)}}const KE=Symbol.for("v-scx"),QE=()=>{{const e=mn(KE);return e||ve.env.NODE_ENV!=="production"&&rt("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function dt(e,t,r){return ve.env.NODE_ENV!=="production"&&!W.isFunction(t)&&rt("`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."),Yp(e,t,r)}function Yp(e,t,r=W.EMPTY_OBJ){const{immediate:n,deep:i,flush:o,once:s}=r;ve.env.NODE_ENV!=="production"&&!t&&(n!==void 0&&rt('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&rt('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),s!==void 0&&rt('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const a=W.extend({},r);ve.env.NODE_ENV!=="production"&&(a.onWarn=rt);const l=t&&n||!t&&o!=="post";let u;if(Si){if(o==="sync"){const m=QE();u=m.__watcherHandles||(m.__watcherHandles=[])}else if(!l){const m=()=>{};return m.stop=W.NOOP,m.resume=W.NOOP,m.pause=W.NOOP,m}}const c=Ar;a.call=(m,w,v)=>cl(m,c,w,v);let d=!1;o==="post"?a.scheduler=m=>{Sl(m,c&&c.suspense)}:o!=="sync"&&(d=!0,a.scheduler=(m,w)=>{w?m():ul(m)}),a.augmentJob=m=>{t&&(m.flags|=4),d&&(m.flags|=2,c&&(m.id=c.uid,m.i=c))};const f=dE(e,t,a);return Si&&(u?u.push(f):l&&f()),f}function XE(e,t,r){const n=this.proxy,i=W.isString(e)?e.includes(".")?YE(n,e):()=>n[e]:e.bind(n,n);let o;W.isFunction(t)?o=t:(o=t.handler,r=t);const s=ih(this),a=Yp(i,o.bind(n),r);return s(),a}function YE(e,t){const r=t.split(".");return()=>{let n=e;for(let i=0;i<r.length&&n;i++)n=n[r[i]];return n}}const JE=e=>e.__isSuspense;function ZE(e,t){t&&t.pendingBranch?W.isArray(e)?t.effects.push(...e):t.effects.push(e):Tp(e)}const Ue=Symbol.for("v-fgt"),Jp=Symbol.for("v-txt"),bi=Symbol.for("v-cmt"),ws=[];let Tr=null;function Q(e=!1){ws.push(Tr=e?null:[])}function e1(){ws.pop(),Tr=ws[ws.length-1]||null}let to=1;function Ss(e,t=!1){to+=e,e<0&&Tr&&t&&(Tr.hasOnce=!0)}function Zp(e){return e.dynamicChildren=to>0?Tr||W.EMPTY_ARR:null,e1(),to>0&&Tr&&Tr.push(e),e}function ye(e,t,r,n,i,o){return Zp(fe(e,t,r,n,i,o,!0))}function Ae(e,t,r,n,i){return Zp(ge(e,t,r,n,i,!0))}function Es(e){return e?e.__v_isVNode===!0:!1}const t1=(...e)=>th(...e),eh=({key:e})=>e??null,Ts=({ref:e,ref_key:t,ref_for:r})=>(typeof e=="number"&&(e=""+e),e!=null?W.isString(e)||Bt(e)||W.isFunction(e)?{i:Zt,r:e,k:t,f:!!r}:e:null);function fe(e,t=null,r=null,n=0,i=null,o=e===Ue?0:1,s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&eh(t),ref:t&&Ts(t),scopeId:_p,slotScopeIds:null,children:r,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:n,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Zt};return a?(El(l,r),o&128&&e.normalize(l)):r&&(l.shapeFlag|=W.isString(r)?8:16),ve.env.NODE_ENV!=="production"&&l.key!==l.key&&rt("VNode created with invalid key (NaN). VNode type:",l.type),to>0&&!s&&Tr&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Tr.push(l),l}const ge=ve.env.NODE_ENV!=="production"?t1:th;function th(e,t=null,r=null,n=0,i=null,o=!1){if((!e||e===Mp)&&(ve.env.NODE_ENV!=="production"&&!e&&rt(`Invalid vnode type when creating vnode: ${e}.`),e=bi),Es(e)){const a=wi(e,t,!0);return r&&El(a,r),to>0&&!o&&Tr&&(a.shapeFlag&6?Tr[Tr.indexOf(e)]=a:Tr.push(a)),a.patchFlag=-2,a}if(lh(e)&&(e=e.__vccOpts),t){t=rh(t);let{class:a,style:l}=t;a&&!W.isString(a)&&(t.class=W.normalizeClass(a)),W.isObject(l)&&(ss(l)&&!W.isArray(l)&&(l=W.extend({},l)),t.style=W.normalizeStyle(l))}const s=W.isString(e)?1:JE(e)?128:PE(e)?64:W.isObject(e)?4:W.isFunction(e)?2:0;return ve.env.NODE_ENV!=="production"&&s&4&&ss(e)&&(e=st(e),rt("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,r,n,i,s,o,!0)}function rh(e){return e?ss(e)||Qp(e)?W.extend({},e):e:null}function wi(e,t,r=!1,n=!1){const{props:i,ref:o,patchFlag:s,children:a,transition:l}=e,u=t?jt(i||{},t):i,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&eh(u),ref:t&&t.ref?r&&o?W.isArray(o)?o.concat(Ts(t)):[o,Ts(t)]:Ts(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:ve.env.NODE_ENV!=="production"&&s===-1&&W.isArray(a)?a.map(nh):a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ue?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&&wi(e.ssContent),ssFallback:e.ssFallback&&wi(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&n&&$p(c,l.clone(c)),c}function nh(e){const t=wi(e);return W.isArray(e.children)&&(t.children=e.children.map(nh)),t}function Pt(e=" ",t=0){return ge(Jp,null,e,t)}function _e(e="",t=!1){return t?(Q(),Ae(bi,null,e)):ge(bi,null,e)}function r1(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:wi(e)}function El(e,t){let r=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(W.isArray(t))r=16;else if(typeof t=="object")if(n&65){const i=t.default;i&&(i._c&&(i._d=!1),El(e,i()),i._c&&(i._d=!0));return}else{r=32;const i=t._;!i&&!Qp(t)?t._ctx=Zt:i===3&&Zt&&(Zt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else W.isFunction(t)?(t={default:t,_ctx:Zt},r=32):(t=String(t),n&64?(r=16,t=[Pt(t)]):r=8);e.children=t,e.shapeFlag|=r}function jt(...e){const t={};for(let r=0;r<e.length;r++){const n=e[r];for(const i in n)if(i==="class")t.class!==n.class&&(t.class=W.normalizeClass([t.class,n.class]));else if(i==="style")t.style=W.normalizeStyle([t.style,n.style]);else if(W.isOn(i)){const o=t[i],s=n[i];s&&o!==s&&!(W.isArray(o)&&o.includes(s))&&(t[i]=o?[].concat(o,s):s)}else i!==""&&(t[i]=n[i])}return t}let Ar=null;const As=()=>Ar||Zt;let Tl;{const e=W.getGlobalThis(),t=(r,n)=>{let i;return(i=e[r])||(i=e[r]=[]),i.push(n),o=>{i.length>1?i.forEach(s=>s(o)):i[0](o)}};Tl=t("__VUE_INSTANCE_SETTERS__",r=>Ar=r),t("__VUE_SSR_SETTERS__",r=>Si=r)}const ih=e=>{const t=Ar;return Tl(e),e.scope.on(),()=>{e.scope.off(),Tl(t)}};function n1(e){return e.vnode.shapeFlag&4}let Si=!1;const oh=ve.env.NODE_ENV!=="production"?{get(e,t){return Yt(e,"get",""),e[t]},set(){return rt("setupContext.attrs is readonly."),!1},deleteProperty(){return rt("setupContext.attrs is readonly."),!1}}:{get(e,t){return Yt(e,"get",""),e[t]}};function i1(e){return new Proxy(e.slots,{get(t,r){return Yt(e,"get","$slots"),t[r]}})}function o1(e){const t=r=>{if(ve.env.NODE_ENV!=="production"&&(e.exposed&&rt("expose() should be called only once per setup()."),r!=null)){let n=typeof r;n==="object"&&(W.isArray(r)?n="array":Bt(r)&&(n="ref")),n!=="object"&&rt(`expose() should be passed a plain object, received ${n}.`)}e.exposed=r||{}};if(ve.env.NODE_ENV!=="production"){let r,n;return Object.freeze({get attrs(){return r||(r=new Proxy(e.attrs,oh))},get slots(){return n||(n=i1(e))},get emit(){return(i,...o)=>e.emit(i,...o)},expose:t})}else return{attrs:new Proxy(e.attrs,oh),slots:e.slots,emit:e.emit,expose:t}}function sh(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(rE(vp(e.exposed)),{get(t,r){if(r in t)return t[r];if(r in wl)return wl[r](e)},has(t,r){return r in t||r in wl}})):e.proxy}const s1=/(?:^|[-_])\w/g,a1=e=>e.replace(s1,t=>t.toUpperCase()).replace(/[-_]/g,"");function Rs(e,t=!0){return W.isFunction(e)?e.displayName||e.name:e.name||t&&e.__name}function ah(e,t,r=!1){let n=Rs(t);if(!n&&t.__file){const i=t.__file.match(/([^/\\]+)\.\w+$/);i&&(n=i[1])}if(!n&&e&&e.parent){const i=o=>{for(const s in o)if(o[s]===t)return s};n=i(e.components||e.parent.type.components)||i(e.appContext.components)}return n?a1(n):r?"App":"Anonymous"}function lh(e){return W.isFunction(e)&&"__vccOpts"in e}const B=(e,t)=>{const r=uE(e,t,Si);if(ve.env.NODE_ENV!=="production"){const n=As();n&&n.appContext.config.warnRecursiveComputed&&(r._warnRecursive=!0)}return r};function Al(e,t,r){const n=(o,s,a)=>{Ss(-1);try{return ge(o,s,a)}finally{Ss(1)}},i=arguments.length;return i===2?W.isObject(t)&&!W.isArray(t)?Es(t)?n(e,null,[t]):n(e,t):n(e,null,t):(i>3?r=Array.prototype.slice.call(arguments,2):i===3&&Es(r)&&(r=[r]),n(e,t,r))}function l1(){if(ve.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},r={style:"color:#f5222d"},n={style:"color:#eb2f96"},i={__vue_custom_formatter:!0,header(d){if(!W.isObject(d))return null;if(d.__isVue)return["div",e,"VueInstance"];if(Bt(d)){pi();const f=d.value;return hi(),["div",{},["span",e,c(d)],"<",a(f),">"]}else{if(Un(d))return["div",{},["span",e,sr(d)?"ShallowReactive":"Reactive"],"<",a(d),`>${Xr(d)?" (readonly)":""}`];if(Xr(d))return["div",{},["span",e,sr(d)?"ShallowReadonly":"Readonly"],"<",a(d),">"]}return null},hasBody(d){return d&&d.__isVue},body(d){if(d&&d.__isVue)return["div",{},...o(d.$)]}};function o(d){const f=[];d.type.props&&d.props&&f.push(s("props",st(d.props))),d.setupState!==W.EMPTY_OBJ&&f.push(s("setup",d.setupState)),d.data!==W.EMPTY_OBJ&&f.push(s("data",st(d.data)));const m=l(d,"computed");m&&f.push(s("computed",m));const w=l(d,"inject");return w&&f.push(s("injected",w)),f.push(["div",{},["span",{style:n.style+";opacity:0.66"},"$ (internal): "],["object",{object:d}]]),f}function s(d,f){return f=W.extend({},f),Object.keys(f).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},d],["div",{style:"padding-left:1.25em"},...Object.keys(f).map(m=>["div",{},["span",n,m+": "],a(f[m],!1)])]]:["span",{}]}function a(d,f=!0){return typeof d=="number"?["span",t,d]:typeof d=="string"?["span",r,JSON.stringify(d)]:typeof d=="boolean"?["span",n,d]:W.isObject(d)?["object",{object:f?st(d):d}]:["span",r,String(d)]}function l(d,f){const m=d.type;if(W.isFunction(m))return;const w={};for(const v in d.ctx)u(m,v,f)&&(w[v]=d.ctx[v]);return w}function u(d,f,m){const w=d[m];if(W.isArray(w)&&w.includes(f)||W.isObject(w)&&f in w||d.extends&&u(d.extends,f,m)||d.mixins&&d.mixins.some(v=>u(v,f,m)))return!0}function c(d){return sr(d)?"ShallowRef":d.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}const c1=ve.env.NODE_ENV!=="production"?rt:W.NOOP;ve.env.NODE_ENV,ve.env.NODE_ENV;let u1;const ch=typeof window<"u"&&window.trustedTypes;if(ch)try{u1=ch.createPolicy("vue",{createHTML:e=>e})}catch(e){ve.env.NODE_ENV!=="production"&&c1(`Error creating trusted types policy: ${e}`)}const uh=Symbol("_vod"),f1=Symbol("_vsh"),fh={name:"show",beforeMount(e,{value:t},{transition:r}){e[uh]=e.style.display==="none"?"":e.style.display,r&&t?r.beforeEnter(e):ro(e,t)},mounted(e,{value:t},{transition:r}){r&&t&&r.enter(e)},updated(e,{value:t,oldValue:r},{transition:n}){!t!=!r&&(n?t?(n.beforeEnter(e),ro(e,!0),n.enter(e)):n.leave(e,()=>{ro(e,!1)}):ro(e,t))},beforeUnmount(e,{value:t}){ro(e,t)}};function ro(e,t){e.style.display=t?e[uh]:"none",e[f1]=!t}Symbol(ve.env.NODE_ENV!=="production"?"CSS_VAR_TEXT":"");function no(e,t,r,n){e.addEventListener(t,r,n)}const dh=e=>{const t=e.props["onUpdate:modelValue"]||!1;return W.isArray(t)?r=>W.invokeArrayFns(t,r):t};function d1(e){e.target.composing=!0}function ph(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Rl=Symbol("_assign"),p1={created(e,{modifiers:{lazy:t,trim:r,number:n}},i){e[Rl]=dh(i);const o=n||i.props&&i.props.type==="number";no(e,t?"change":"input",s=>{if(s.target.composing)return;let a=e.value;r&&(a=a.trim()),o&&(a=W.looseToNumber(a)),e[Rl](a)}),r&&no(e,"change",()=>{e.value=e.value.trim()}),t||(no(e,"compositionstart",d1),no(e,"compositionend",ph),no(e,"change",ph))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:r,modifiers:{lazy:n,trim:i,number:o}},s){if(e[Rl]=dh(s),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?W.looseToNumber(e.value):e.value,l=t??"";a!==l&&(document.activeElement===e&&e.type!=="range"&&(n&&t===r||i&&e.value.trim()===l)||(e.value=l))}},h1=["ctrl","shift","alt","meta"],m1={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)=>h1.some(r=>e[`${r}Key`]&&!t.includes(r))},Vt=(e,t)=>{const r=e._withMods||(e._withMods={}),n=t.join(".");return r[n]||(r[n]=((i,...o)=>{for(let s=0;s<t.length;s++){const a=m1[t[s]];if(a&&a(i,t))return}return e(i,...o)}))},g1={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},io=(e,t)=>{const r=e._withKeys||(e._withKeys={}),n=t.join(".");return r[n]||(r[n]=(i=>{if(!("key"in i))return;const o=W.hyphenate(i.key);if(t.some(s=>s===o||g1[s]===o))return e(i)}))};function y1(){l1()}ve.env.NODE_ENV!=="production"&&y1();const ur=()=>vS.useAbility();function hh(e){if(e===void 0)throw new Error('cloneStateObject: cannot clone "undefined"');return JSON.parse(JSON.stringify(e))}const oo=(e,t)=>!e||!t?!1:e.id===t.id;var xn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Il,mh;function v1(){if(mh)return Il;mh=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,d=0;d<=i.length;++d){if(d<i.length)c=i.charCodeAt(d);else{if(c===47)break;c=47}if(c===47){if(!(l===d-1||u===1))if(l!==d-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 f=s.lastIndexOf("/");if(f!==s.length-1){f===-1?(s="",a=0):(s=s.slice(0,f),a=s.length-1-s.lastIndexOf("/")),l=d,u=0;continue}}else if(s.length===2||s.length===1){s="",a=0,l=d,u=0;continue}}o&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+i.slice(l+1,d):s=i.slice(l+1,d),a=d-l-1;l=d,u=0}else c===46&&u!==-1?++u:u=-1}return s}function r(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 n={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=ve.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?".":n.normalize(o)},relative:function(o,s){if(e(o),e(s),o===s||(o=n.resolve(o),s=n.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 d=s.length,f=d-c,m=u<f?u:f,w=-1,v=0;v<=m;++v){if(v===m){if(f>m){if(s.charCodeAt(c+v)===47)return s.slice(c+v+1);if(v===0)return s.slice(c+v)}else u>m&&(o.charCodeAt(a+v)===47?w=v:v===0&&(w=0));break}var E=o.charCodeAt(a+v),b=s.charCodeAt(c+v);if(E!==b)break;E===47&&(w=v)}var g="";for(v=a+w+1;v<=l;++v)(v===l||o.charCodeAt(v)===47)&&(g.length===0?g+="..":g+="/..");return g.length>0?g+s.slice(c+w):(c+=w,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 d=s.length-1,f=-1;for(c=o.length-1;c>=0;--c){var m=o.charCodeAt(c);if(m===47){if(!u){a=c+1;break}}else f===-1&&(u=!1,f=c+1),d>=0&&(m===s.charCodeAt(d)?--d===-1&&(l=c):(d=-1,l=f))}return a===l?l=f: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,d=o.length-1;d>=0;--d){var f=o.charCodeAt(d);if(f===47){if(!u){a=d+1;break}continue}l===-1&&(u=!1,l=d+1),f===46?s===-1?s=d: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 r("/",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,d=0,f=-1,m=!0,w=o.length-1,v=0;w>=u;--w){if(a=o.charCodeAt(w),a===47){if(!m){d=w+1;break}continue}f===-1&&(m=!1,f=w+1),a===46?c===-1?c=w:v!==1&&(v=1):c!==-1&&(v=-1)}return c===-1||f===-1||v===0||v===1&&c===f-1&&c===d+1?f!==-1&&(d===0&&l?s.base=s.name=o.slice(1,f):s.base=s.name=o.slice(d,f)):(d===0&&l?(s.name=o.slice(1,c),s.base=o.slice(1,f)):(s.name=o.slice(d,c),s.base=o.slice(d,f)),s.ext=o.slice(c,f)),d>0?s.dir=o.slice(0,d-1):l&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,Il=n,Il}var pt=v1();const Cs=Cl(pt),b1=xe({name:"SpaceMoveInfoModal",props:{modal:{type:Object,required:!0}}}),qe=(e,t)=>{const r=e.__vccOpts||e;for(const[n,i]of t)r[n]=i;return r},w1=["textContent"],S1=["textContent"];function E1(e,t,r,n,i,o){return Q(),ye(Ue,null,[fe("p",{class:"mt-0",textContent:W.toDisplayString(e.$gettext("Moving files from one space to another is not possible. Do you want to copy instead?"))},null,8,w1),fe("p",{class:"mb-0",textContent:W.toDisplayString(e.$gettext("Note: Links and shares of the original file are not copied."))},null,8,S1)],64)}const gh=qe(b1,[["render",E1]]),T1=xe({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:r}=Fe.useGettext(),n=le(!1),i=B(()=>e.conflictCount<2?"":e.separateSkipHandling?e.resource.isFolder?r("Apply to all %{count} folders",{count:e.conflictCount.toString()},!0):r("Apply to all %{count} files",{count:e.conflictCount.toString()},!0):r("Apply to all %{count} conflicts",{count:e.conflictCount.toString()},!0)),o=B(()=>e.resource.isFolder?r("Folder with name »%{name}« already exists.",{name:e.resource.name},!0):r("File with name »%{name}« already exists.",{name:e.resource.name},!0)),s=B(()=>e.confirmSecondaryTextOverwrite||r("Replace"));return{message:o,checkboxValue:n,checkboxLabel:i,confirmSecondaryText:s,onConfirm:()=>{t(e.modal.id),e.callbackFn({strategy:qr.KEEP_BOTH,doForAllConflicts:h(n)})},onConfirmSecondary:()=>{t(e.modal.id);const c=e.suggestMerge?qr.MERGE:qr.REPLACE;e.callbackFn({strategy:c,doForAllConflicts:h(n)})},onCancel:()=>{t(e.modal.id),e.callbackFn({strategy:qr.SKIP,doForAllConflicts:h(n)})}}}}),A1=["textContent"],R1={class:"my-4"},C1={class:"flex justify-end items-center mt-4"},I1={class:"oc-modal-body-actions-grid"};function _1(e,t,r,n,i,o){const s=be("oc-checkbox"),a=be("oc-button");return Q(),ye(Ue,null,[fe("span",{class:"inline-block mb-4",textContent:W.toDisplayString(e.message)},null,8,A1),fe("div",R1,[e.conflictCount>1?(Q(),Ae(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"])):_e("",!0)]),fe("div",C1,[fe("div",I1,[ge(a,{class:"oc-modal-body-actions-cancel ml-2",onClick:e.onCancel},{default:we(()=>[Pt(W.toDisplayString(e.$gettext("Skip")),1)]),_:1},8,["onClick"]),ge(a,{class:"oc-modal-body-actions-secondary ml-2",onClick:e.onConfirmSecondary},{default:we(()=>[Pt(W.toDisplayString(e.confirmSecondaryText),1)]),_:1},8,["onClick"]),ge(a,{class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:e.onConfirm},{default:we(()=>[Pt(W.toDisplayString(e.$gettext("Keep both")),1)]),_:1},8,["onClick"])])])],64)}const yh=qe(T1,[["render",_1]]);class _l{constructor(t,r){this.$gettext=t,this.$ngettext=r}async resolveAllConflicts(t,r,n){const i=[];for(const u of t){const c=pt.join(r.path,u.name);n.some(f=>f.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,d=await this.resolveFileExists(u.resource,c);u.strategy=d.strategy,l.push(u),o+=1,d.doForAllConflicts&&(s=!0,a=d.strategy)}return l}resolveFileExists(t,r,n=!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:yh,customComponentAttrs:()=>({resource:t,conflictCount:r,suggestMerge:n,separateSkipHandling:i,callbackFn:a=>{s(a)}})})})}resolveDoCopyInsteadOfMoveForSpaces(){const{dispatchModal:t}=ht();return new Promise(r=>{t({title:this.$gettext("Copy here?"),customComponent:gh,confirmText:this.$gettext("Copy here"),onCancel:()=>{r(!1)},onConfirm:()=>Promise.resolve(r(!0))})})}}const Ur=(e,t,r,n=1)=>{let i;return t?i=`${te.extractNameWithoutExtension({name:e,extension:t})} (${n}).${t}`:i=`${e} (${n})`,r.some(s=>s.name===i)?Ur(e,t,r,n+1):i},vh=(e,t,r,n)=>e.id===r.id&&pt.dirname(t.path)===n.path;var qr=(e=>(e[e.SKIP=0]="SKIP",e[e.REPLACE=1]="REPLACE",e[e.KEEP_BOTH=2]="KEEP_BOTH",e[e.MERGE=3]="MERGE",e))(qr||{}),gn=(e=>(e[e.COPY=0]="COPY",e[e.MOVE=1]="MOVE",e))(gn||{});class bh extends _l{constructor(t,r,n,i,o,s,a,l){super(a,l),this.sourceSpace=t,this.resourcesToMove=r,this.targetSpace=n,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,r=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:r})}showResultMessage(t,r,n){if(t.length===0){const a=r.length;if(a===0)return;const l=n===gn.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=n===gn.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=n===gn.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 te.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===gn.MOVE){if(!await this.resolveDoCopyInsteadOfMoveForSpaces())return[];t=gn.COPY}const r=(await this.clientService.webdav.listFiles(this.targetSpace,this.targetFolder)).children,n=await this.resolveAllConflicts(this.resourcesToMove,this.targetFolder,r),i=[];for(const o of this.resourcesToMove){const s={...o},{id:a,name:l,extension:u}=s,c=n.some(m=>m.resource.id===a);let d=l,f=!1;if(c){const m=n.find(w=>w.resource.id===a)?.strategy;if(m===qr.SKIP)continue;if(m===qr.REPLACE){if(this.isOverwritingParentFolder(s,this.targetFolder,r)){const w=new Error;this.showResultMessage([{error:w,resourceName:l}],[],t);continue}f=!0}m===qr.KEEP_BOTH&&(d=Ur(l,u,r),s.name=d)}vh(this.sourceSpace,s,this.targetSpace,this.targetFolder)&&f||i.push({resource:s,sourceSpace:this.sourceSpace,targetSpace:this.targetSpace,targetFolder:this.targetFolder,path:pt.join(this.targetFolder.path,d),overwrite:f,transferType:t})}return i}isOverwritingParentFolder(t,r,n){if(t.type!=="folder"||r.path===h(this.currentFolder)?.path)return!1;const i=pt.basename(t.path),o=pt.join(r.path,i);return n.some(s=>s.path===o)}}const Ol={ignoreLocation:!0,threshold:0,useExtendedSearch:!0},O1=(e,t,r)=>new Wd(e,{...Ol,keys:["name","type","icon","extension","tags"]}).search(t,{limit:r}).map(i=>i.item),wh="oc-resource-icon-mapping",P1={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"]}};function Sh(){const e={};return Object.values(P1).forEach(t=>{t.extensions.forEach(r=>{e[r]=t.icon})}),e}function Pl(e,t,r){return t.name=pt.basename(r),t.path=r,t.webDavPath=pt.join(e.webDavPath,r),t.extension=te.extractExtensionFromFile(t),t}function k1(){this.__data__=[],this.size=0}function so(e,t){return e===t||e!==e&&t!==t}function Is(e,t){for(var r=e.length;r--;)if(so(e[r][0],t))return r;return-1}var F1=Array.prototype,x1=F1.splice;function N1(e){var t=this.__data__,r=Is(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():x1.call(t,r,1),--this.size,!0}function D1(e){var t=this.__data__,r=Is(t,e);return r<0?void 0:t[r][1]}function $1(e){return Is(this.__data__,e)>-1}function L1(e,t){var r=this.__data__,n=Is(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function yn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}yn.prototype.clear=k1,yn.prototype.delete=N1,yn.prototype.get=D1,yn.prototype.has=$1,yn.prototype.set=L1;function M1(){this.__data__=new yn,this.size=0}function B1(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function j1(e){return this.__data__.get(e)}function U1(e){return this.__data__.has(e)}const Nn=globalThis||void 0||self;var Eh=typeof Nn=="object"&&Nn&&Nn.Object===Object&&Nn,q1=typeof self=="object"&&self&&self.Object===Object&&self,Yr=Eh||q1||Function("return this")(),Or=Yr.Symbol,Th=Object.prototype,V1=Th.hasOwnProperty,z1=Th.toString,ao=Or?Or.toStringTag:void 0;function W1(e){var t=V1.call(e,ao),r=e[ao];try{e[ao]=void 0;var n=!0}catch{}var i=z1.call(e);return n&&(t?e[ao]=r:delete e[ao]),i}var H1=Object.prototype,G1=H1.toString;function K1(e){return G1.call(e)}var Q1="[object Null]",X1="[object Undefined]",Ah=Or?Or.toStringTag:void 0;function Hn(e){return e==null?e===void 0?X1:Q1:Ah&&Ah in Object(e)?W1(e):K1(e)}function Jr(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Y1="[object AsyncFunction]",J1="[object Function]",Z1="[object GeneratorFunction]",eT="[object Proxy]";function kl(e){if(!Jr(e))return!1;var t=Hn(e);return t==J1||t==Z1||t==Y1||t==eT}var Fl=Yr["__core-js_shared__"],Rh=(function(){var e=/[^.]+$/.exec(Fl&&Fl.keys&&Fl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function tT(e){return!!Rh&&Rh in e}var rT=Function.prototype,nT=rT.toString;function Gn(e){if(e!=null){try{return nT.call(e)}catch{}try{return e+""}catch{}}return""}var iT=/[\\^$.*+?()[\]{}|]/g,oT=/^\[object .+?Constructor\]$/,sT=Function.prototype,aT=Object.prototype,lT=sT.toString,cT=aT.hasOwnProperty,uT=RegExp("^"+lT.call(cT).replace(iT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function fT(e){if(!Jr(e)||tT(e))return!1;var t=kl(e)?uT:oT;return t.test(Gn(e))}function dT(e,t){return e?.[t]}function Kn(e,t){var r=dT(e,t);return fT(r)?r:void 0}var lo=Kn(Yr,"Map"),co=Kn(Object,"create");function pT(){this.__data__=co?co(null):{},this.size=0}function hT(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var mT="__lodash_hash_undefined__",gT=Object.prototype,yT=gT.hasOwnProperty;function vT(e){var t=this.__data__;if(co){var r=t[e];return r===mT?void 0:r}return yT.call(t,e)?t[e]:void 0}var bT=Object.prototype,wT=bT.hasOwnProperty;function ST(e){var t=this.__data__;return co?t[e]!==void 0:wT.call(t,e)}var ET="__lodash_hash_undefined__";function TT(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=co&&t===void 0?ET:t,this}function Qn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Qn.prototype.clear=pT,Qn.prototype.delete=hT,Qn.prototype.get=vT,Qn.prototype.has=ST,Qn.prototype.set=TT;function AT(){this.size=0,this.__data__={hash:new Qn,map:new(lo||yn),string:new Qn}}function RT(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function _s(e,t){var r=e.__data__;return RT(t)?r[typeof t=="string"?"string":"hash"]:r.map}function CT(e){var t=_s(this,e).delete(e);return this.size-=t?1:0,t}function IT(e){return _s(this,e).get(e)}function _T(e){return _s(this,e).has(e)}function OT(e,t){var r=_s(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function vn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}vn.prototype.clear=AT,vn.prototype.delete=CT,vn.prototype.get=IT,vn.prototype.has=_T,vn.prototype.set=OT;var PT=200;function kT(e,t){var r=this.__data__;if(r instanceof yn){var n=r.__data__;if(!lo||n.length<PT-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new vn(n)}return r.set(e,t),this.size=r.size,this}function Zr(e){var t=this.__data__=new yn(e);this.size=t.size}Zr.prototype.clear=M1,Zr.prototype.delete=B1,Zr.prototype.get=j1,Zr.prototype.has=U1,Zr.prototype.set=kT;var Os=(function(){try{var e=Kn(Object,"defineProperty");return e({},"",{}),e}catch{}})();function xl(e,t,r){t=="__proto__"&&Os?Os(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function Nl(e,t,r){(r!==void 0&&!so(e[t],r)||r===void 0&&!(t in e))&&xl(e,t,r)}function FT(e){return function(t,r,n){for(var i=-1,o=Object(t),s=n(t),a=s.length;a--;){var l=s[++i];if(r(o[l],l,o)===!1)break}return t}}var xT=FT(),Ch=typeof M=="object"&&M&&!M.nodeType&&M,Ih=Ch&&typeof module=="object"&&module&&!module.nodeType&&module,NT=Ih&&Ih.exports===Ch,_h=NT?Yr.Buffer:void 0,Oh=_h?_h.allocUnsafe:void 0;function Ph(e,t){if(t)return e.slice();var r=e.length,n=Oh?Oh(r):new e.constructor(r);return e.copy(n),n}var Ps=Yr.Uint8Array;function Dl(e){var t=new e.constructor(e.byteLength);return new Ps(t).set(new Ps(e)),t}function kh(e,t){var r=t?Dl(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function DT(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var Fh=Object.create,$T=(function(){function e(){}return function(t){if(!Jr(t))return{};if(Fh)return Fh(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})();function xh(e,t){return function(r){return e(t(r))}}var $l=xh(Object.getPrototypeOf,Object),LT=Object.prototype;function Ll(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||LT;return e===r}function MT(e){return typeof e.constructor=="function"&&!Ll(e)?$T($l(e)):{}}function en(e){return e!=null&&typeof e=="object"}var BT="[object Arguments]";function Nh(e){return en(e)&&Hn(e)==BT}var Dh=Object.prototype,jT=Dh.hasOwnProperty,UT=Dh.propertyIsEnumerable,ks=Nh((function(){return arguments})())?Nh:function(e){return en(e)&&jT.call(e,"callee")&&!UT.call(e,"callee")},Vr=Array.isArray,qT=9007199254740991;function $h(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=qT}function Fs(e){return e!=null&&$h(e.length)&&!kl(e)}function VT(e){return en(e)&&Fs(e)}function zT(){return!1}var Lh=typeof M=="object"&&M&&!M.nodeType&&M,Mh=Lh&&typeof module=="object"&&module&&!module.nodeType&&module,WT=Mh&&Mh.exports===Lh,Bh=WT?Yr.Buffer:void 0,HT=Bh?Bh.isBuffer:void 0,uo=HT||zT,GT="[object Object]",KT=Function.prototype,QT=Object.prototype,jh=KT.toString,XT=QT.hasOwnProperty,YT=jh.call(Object);function Ml(e){if(!en(e)||Hn(e)!=GT)return!1;var t=$l(e);if(t===null)return!0;var r=XT.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&jh.call(r)==YT}var JT="[object Arguments]",ZT="[object Array]",eA="[object Boolean]",tA="[object Date]",rA="[object Error]",nA="[object Function]",iA="[object Map]",oA="[object Number]",sA="[object Object]",aA="[object RegExp]",lA="[object Set]",cA="[object String]",uA="[object WeakMap]",fA="[object ArrayBuffer]",dA="[object DataView]",pA="[object Float32Array]",hA="[object Float64Array]",mA="[object Int8Array]",gA="[object Int16Array]",yA="[object Int32Array]",vA="[object Uint8Array]",bA="[object Uint8ClampedArray]",wA="[object Uint16Array]",SA="[object Uint32Array]",At={};At[pA]=At[hA]=At[mA]=At[gA]=At[yA]=At[vA]=At[bA]=At[wA]=At[SA]=!0,At[JT]=At[ZT]=At[fA]=At[eA]=At[dA]=At[tA]=At[rA]=At[nA]=At[iA]=At[oA]=At[sA]=At[aA]=At[lA]=At[cA]=At[uA]=!1;function EA(e){return en(e)&&$h(e.length)&&!!At[Hn(e)]}function Bl(e){return function(t){return e(t)}}var Uh=typeof M=="object"&&M&&!M.nodeType&&M,fo=Uh&&typeof module=="object"&&module&&!module.nodeType&&module,TA=fo&&fo.exports===Uh,jl=TA&&Eh.process,Ei=(function(){try{var e=fo&&fo.require&&fo.require("util").types;return e||jl&&jl.binding&&jl.binding("util")}catch{}})(),qh=Ei&&Ei.isTypedArray,Ul=qh?Bl(qh):EA;function ql(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var AA=Object.prototype,RA=AA.hasOwnProperty;function Vh(e,t,r){var n=e[t];(!(RA.call(e,t)&&so(n,r))||r===void 0&&!(t in e))&&xl(e,t,r)}function zh(e,t,r,n){var i=!r;r||(r={});for(var o=-1,s=t.length;++o<s;){var a=t[o],l=void 0;l===void 0&&(l=e[a]),i?xl(r,a,l):Vh(r,a,l)}return r}function CA(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var IA=9007199254740991,_A=/^(?:0|[1-9]\d*)$/;function Wh(e,t){var r=typeof e;return t=t??IA,!!t&&(r=="number"||r!="symbol"&&_A.test(e))&&e>-1&&e%1==0&&e<t}var OA=Object.prototype,PA=OA.hasOwnProperty;function Hh(e,t){var r=Vr(e),n=!r&&ks(e),i=!r&&!n&&uo(e),o=!r&&!n&&!i&&Ul(e),s=r||n||i||o,a=s?CA(e.length,String):[],l=a.length;for(var u in e)(t||PA.call(e,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Wh(u,l)))&&a.push(u);return a}function kA(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var FA=Object.prototype,xA=FA.hasOwnProperty;function NA(e){if(!Jr(e))return kA(e);var t=Ll(e),r=[];for(var n in e)n=="constructor"&&(t||!xA.call(e,n))||r.push(n);return r}function Vl(e){return Fs(e)?Hh(e,!0):NA(e)}function DA(e){return zh(e,Vl(e))}function $A(e,t,r,n,i,o,s){var a=ql(e,r),l=ql(t,r),u=s.get(l);if(u){Nl(e,r,u);return}var c=o?o(a,l,r+"",e,t,s):void 0,d=c===void 0;if(d){var f=Vr(l),m=!f&&uo(l),w=!f&&!m&&Ul(l);c=l,f||m||w?Vr(a)?c=a:VT(a)?c=DT(a):m?(d=!1,c=Ph(l,!0)):w?(d=!1,c=kh(l,!0)):c=[]:Ml(l)||ks(l)?(c=a,ks(a)?c=DA(a):(!Jr(a)||kl(a))&&(c=MT(l))):d=!1}d&&(s.set(l,c),i(c,l,n,o,s),s.delete(l)),Nl(e,r,c)}function Gh(e,t,r,n,i){e!==t&&xT(t,function(o,s){if(i||(i=new Zr),Jr(o))$A(e,t,s,r,Gh,n,i);else{var a=n?n(ql(e,s),o,s+"",e,t,i):void 0;a===void 0&&(a=o),Nl(e,s,a)}},Vl)}function Kh(e){return e}function LA(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Qh=Math.max;function Xh(e,t,r){return t=Qh(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=Qh(n.length-t,0),s=Array(o);++i<o;)s[i]=n[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=n[i];return a[t]=r(s),LA(e,this,a)}}function MA(e){return function(){return e}}var BA=Os?function(e,t){return Os(e,"toString",{configurable:!0,enumerable:!1,value:MA(t),writable:!0})}:Kh,jA=800,UA=16,qA=Date.now;function VA(e){var t=0,r=0;return function(){var n=qA(),i=UA-(n-r);if(r=n,i>0){if(++t>=jA)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Yh=VA(BA);function zA(e,t){return Yh(Xh(e,t,Kh),e+"")}function WA(e,t,r){if(!Jr(r))return!1;var n=typeof t;return(n=="number"?Fs(r)&&Wh(t,r.length):n=="string"&&t in r)?so(r[t],e):!1}function HA(e){return zA(function(t,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,s&&WA(r[0],r[1],s)&&(o=i<3?void 0:o,i=1),t=Object(t);++n<i;){var a=r[n];a&&e(t,a,n,o)}return t})}var po=HA(function(e,t,r){Gh(e,t,r)});const zl=(e,...t)=>{const{href:r}=e.resolve(h(e.currentRoute));return t.map(n=>{const{href:i}=e.resolve({...n});return i==="/"||i==="#/"?!1:r.startsWith(i)}).some(Boolean)},ho=(...e)=>(t,...r)=>{if(!r.length)return zl(t,...e);const[n,...i]=r.map(o=>{const s=e.find(a=>a.name===o);if(!s)throw new Error(`unknown comparative '${o}'`);return s});return zl(t,n,...i)};function F8(e){return e}const mo=(e,...t)=>po({},{name:e},...t.map(r=>({...r.params&&{params:r.params},...r.query&&{query:r.query}}))),Ti=(e,t={})=>mo(e,t),Jh=Ti("files-common-favorites"),Zh=Ti("files-common-search"),It=ho(Jh,Zh),GA=e=>[{path:"/search",component:e.App,children:[{name:Zh.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:Jh.name,path:"",component:e.Favorites,meta:{authContext:"user",title:"Favorite files"}}]}],Pr=(e,t={})=>mo(e,t),em=Pr("files-spaces-projects"),Wl=Pr("files-spaces-generic"),gt=ho(em,Wl),KA=e=>[{path:"/spaces",component:e.App,children:[{path:"projects",name:em.name,component:e.Spaces.Projects,meta:{authContext:"user",title:"Spaces"}},{path:":driveAliasAndItem(.*)?",name:Wl.name,component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0,contextQueryItems:["sort-by","sort-dir"]}}]}],kr=(e,t={})=>mo(e,t),QA=kr("files-shares"),xs=kr("files-shares-with-me"),Hl=kr("files-shares-with-others"),Gl=kr("files-shares-via-link"),Lt=ho(xs,Hl,Gl),XA=e=>[{name:QA.name,path:"/shares",component:e.App,redirect:xs,children:[{name:xs.name,path:"with-me",component:e.Shares.SharedWithMe,meta:{authContext:"user",title:"Files shared with me"}},{name:Hl.name,path:"with-others",component:e.Shares.SharedWithOthers,meta:{authContext:"user",title:"Files shared with others"}},{name:Gl.name,path:"via-link",component:e.Shares.SharedViaLink,meta:{authContext:"user",title:"Files shared via link"}}]}],Ai=(e,t={})=>mo(e,t),Kl=Ai("files-public-link"),Ql=Ai("files-public-upload"),Rr=ho(Kl,Ql),YA=e=>[{path:"/link",component:e.App,meta:{auth:!1},children:[{name:Kl.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"publicLink",patchCleanPath:!0}}]},{path:"/upload",component:e.App,meta:{auth:!1},children:[{name:Ql.name,path:":token?",component:e.FilesDrop,meta:{authContext:"publicLink",title:"Public file upload"}}]}],Ri=(e,t={})=>mo(e,t),tm=Ri("files-trash-generic"),rm=Ri("files-trash-overview"),gr=ho(tm,rm),JA=e=>[{path:"/trash",component:e.App,children:[{path:"overview",name:rm.name,component:e.Trash.Overview,meta:{authContext:"user",title:"Trash overview"}},{name:tm.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0}}]}];function nm(e){return{applicationConfig:B(()=>e.appsStore.externalAppConfig[e.applicationId]||{})}}const ZA=["anonymous","user","idp","publicLink","hybrid"],bn=e=>mn(e),He=()=>bn("$router"),zt=()=>He().currentRoute,Xl=e=>e.path.split("/")[1],eR=()=>{const e=zt();return B(()=>Xl(h(e)))},tn=(e,t={},r)=>{const n=r?.configStore||ct();return{params:{driveAliasAndItem:e.getDriveAliasAndItem({path:t.path||""})},query:{...te.isShareSpaceResource(e)&&{shareId:e.id},...n?.options?.routing?.idBased&&!Ct.isUndefined(t.fileId)&&{fileId:`${t.fileId}`}}}},tR=(e,t)=>{const r=document.querySelector("base"),n=!!r,i=new URL(window.location.href.split("#")[0]);return i.search="",n?i.pathname=new URL(r.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[n?"pathname":"hash"]=e.resolve(t).href,i.href},rn=Ve.defineStore("apps",()=>{const e=le({}),t=le({}),r=le([]),n=B(()=>Object.keys(h(e))),i=(l,u)=>{l.id&&(l.extensions&&l.extensions.forEach(c=>{o({appId:l.id,data:c})}),h(e)[l.id]={applicationMenu:l.applicationMenu||{enabled:()=>!1},defaultExtension:l.defaultExtension||"",icon:"check_box_outline_blank",name:l.name||l.id,translations:u,...l})},o=({appId:l,data:u})=>{h(r).push({app:l,extension:u.extension,createFileHandler:u.createFileHandler,label:u.label,mimeType:u.mimeType,routeName:u.routeName,newFileMenu:u.newFileMenu,icon:u.icon,name:u.name,hasPriority:u.hasPriority||h(t)?.[l]?.priorityExtensions?.includes(u.extension)||!1,secureView:u.secureView||!1})};return{apps:e,externalAppConfig:t,appIds:n,fileExtensions:r,registerApp:i,registerFileExtension:o,loadExternalAppConfig:({appId:l,config:u})=>{t.value={...h(t),[l]:u}},isAppEnabled:l=>h(n).includes(l)}}),Xn=Ve.defineStore("auth",()=>{const e=le(),t=le(!1),r=le(!1),n=le(),i=le(),o=le(),s=le(!1),a=m=>{e.value=m},l=m=>{t.value=m},u=m=>{r.value=m},c=m=>{n.value=m.publicLinkToken,i.value=m.publicLinkPassword,o.value=m.publicLinkType,s.value=m.publicLinkContextReady};return{accessToken:e,idpContextReady:t,userContextReady:r,publicLinkToken:n,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})}}}),im={core:{"support-sse":!1,"support-url-signing":!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:te.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}},er=Ve.defineStore("capabilities",()=>{const e=le(!1),t=le(im),r=N=>{t.value=po({...im},N.capabilities),e.value=!0},n=B(()=>h(t).core["support-url-signing"]),i=B(()=>h(t).core["support-sse"]),o=B(()=>h(t).graph["personal-data-export"]),s=B(()=>h(t).core.status),a=B(()=>h(t).dav.reports),l=B(()=>h(t).dav.trashbin),u=B(()=>h(t).spaces.max_quota),c=B(()=>h(t).spaces.projects),d=B(()=>h(t).graph.users.create_disabled),f=B(()=>h(t).graph.users.delete_disabled),m=B(()=>h(t).graph.users.change_password_self_disabled),w=B(()=>h(t).graph.users.read_only_attributes),v=B(()=>h(t).graph.users.edit_login_allowed_disabled),E=B(()=>h(t).files.app_providers),b=B(()=>h(t).files.favorites),g=B(()=>h(t).files.archivers),y=B(()=>h(t).files.privateLinks),p=B(()=>h(t).files.permanent_deletion),S=B(()=>h(t).files.tags),T=B(()=>h(t).files.undelete),R=B(()=>h(t).files_sharing.api_enabled),I=B(()=>h(t).files_sharing.deny_access),A=B(()=>h(t).files_sharing.can_rename),D=B(()=>h(t).files_sharing.allow_custom),H=B(()=>h(t).files_sharing.public?.enabled),_=B(()=>h(t).files_sharing.public?.can_edit),x=B(()=>h(t).files_sharing.public?.can_contribute),z=B(()=>h(t).files_sharing.public?.alias),G=B(()=>h(t).files_sharing.public?.default_permissions),ne=B(()=>h(t).files_sharing.public?.password.enforced_for),ie=B(()=>h(t).files_sharing.search_min_length),ee=B(()=>h(t).files_sharing.user?.profile_picture),ue=B(()=>h(t).files.tus_support?.max_chunk_size),de=B(()=>h(t).files.tus_support?.extension),ce=B(()=>h(t).files.tus_support?.http_method_override),X=B(()=>h(t).notifications["ocs-endpoints"]),oe=B(()=>h(t).password_policy),ae=B(()=>h(t).search.property?.mtime),Ce=B(()=>h(t).search.property?.mediatype),Z=B(()=>h(t).search.property?.content);return{isInitialized:e,capabilities:t,setCapabilities:r,status:s,supportUrlSigning:n,supportSSE:i,personalDataExport:o,davReports:a,davTrashbin:l,spacesMaxQuota:u,spacesProjects:c,graphUsersCreateDisabled:d,graphUsersDeleteDisabled:f,graphUsersChangeSelfPasswordDisabled:m,graphUsersEditLoginAllowedDisabled:v,graphUsersReadOnlyAttributes:w,filesAppProviders:E,filesFavorites:b,filesArchivers:g,filesPrivateLinks:y,filesPermanentDeletion:p,filesTags:S,filesUndelete:T,sharingApiEnabled:R,sharingDenyAccess:I,sharingCanRename:A,sharingAllowCustom:D,sharingPublicEnabled:H,sharingPublicCanEdit:_,sharingPublicCanContribute:x,sharingPublicAlias:z,sharingPublicDefaultPermissions:G,sharingPublicPasswordEnforcedFor:ne,sharingSearchMinLength:ie,sharingUserProfilePicture:ee,tusMaxChunkSize:ue,tusExtension:de,tusHttpMethodOverride:ce,notificationsOcsEndpoints:X,passwordPolicy:oe,searchLastMofifiedDate:ae,searchMediaType:Ce,searchContent:Z}});class rR{value;expires;constructor(t,r){this.value=t,this.expires=r?new Date().getTime()+r:0}get expired(){return this.expires>0&&this.expires<new Date().getTime()}}class Yl{map;ttl;capacity;constructor(t){this.ttl=t.ttl||0,this.capacity=t.capacity||0,this.map=new Map}set(t,r,n){return this.evict(),this.map.set(t,new rR(r,isNaN(n)?this.ttl:n)),r}get(t){this.evict();const r=this.map.get(t);if(r)return r.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,r)=>{t.expired&&this.delete(r)}),!!this.capacity)for(const[t]of[...this.map.entries()]){if(this.map.size<=this.capacity)break;this.delete(t)}}}const Ns=async({graphClient:e,spacesStore:t,space:r,signal:n})=>{const i=await t.getMountPointForSpace({graphClient:e,space:r,signal:n});if(!i)return null;const{id:o}=i;return e.driveItems.getDriveItem(o.split("!")[0],o)},nR=({sharedAncestor:e,matchingSpace:t})=>t?Pr("files-spaces-generic",tn(t,{path:e.path,fileId:e.id})):{},om=({sharesStore:e,spacesStore:t,space:r,sharedDriveItem:n})=>{const i=n?.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:r.id,field:"graphPermissions",value:[...new Set(o)]})},iR=e=>{const t=document.querySelectorAll(`[data-item-id="${e}"] input[type=checkbox]`)?.[0];t&&t.focus()};class go{static sortByQueryName="sort-by";static sortDirQueryName="sort-dir"}var oR="[object Symbol]";function Ds(e){return typeof e=="symbol"||en(e)&&Hn(e)==oR}var sR=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,aR=/^\w*$/;function lR(e,t){if(Vr(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Ds(e)?!0:aR.test(e)||!sR.test(e)||t!=null&&e in Object(t)}var cR="Expected a function";function Jl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(cR);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(Jl.Cache||vn),r}Jl.Cache=vn;var uR=500;function fR(e){var t=Jl(e,function(n){return r.size===uR&&r.clear(),n}),r=t.cache;return t}var dR=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pR=/\\(\\)?/g,hR=fR(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(dR,function(r,n,i,o){t.push(i?o.replace(pR,"$1"):n||r)}),t});function sm(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var am=Or?Or.prototype:void 0,lm=am?am.toString:void 0;function cm(e){if(typeof e=="string")return e;if(Vr(e))return sm(e,cm)+"";if(Ds(e))return lm?lm.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Zl(e){return e==null?"":cm(e)}function ec(e,t){return Vr(e)?e:lR(e,t)?[e]:hR(Zl(e))}function um(e){if(typeof e=="string"||Ds(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function fm(e,t){t=ec(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[um(t[r++])];return r&&r==n?e:void 0}function tc(e,t,r){var n=e==null?void 0:fm(e,t);return n===void 0?r:n}var Ut=(e=>(e.Desc="desc",e.Asc="asc",e))(Ut||{});function mR(e){const t=He(),r=gR(e),n=yR(e),i=B(()=>pm(h(r))||h(rc(h(s))?.name)),o=B(()=>bR(h(n))||vR(h(i),h(s))),s=e.fields;return{items:B(()=>{const u=h(e.items);return h(i)?dm(u,h(s),h(i),h(o)):u}),sortBy:i,sortDir:o,handleSort:({sortBy:u,sortDir:c})=>t.replace({query:{...h(t.currentRoute).query,[h(e.sortByQueryName)||go.sortByQueryName]:u,[h(e.sortDirQueryName)||go.sortDirQueryName]:c}})}}function gR(e){return e.sortBy?Bt(e.sortBy)?e.sortBy:le(e.sortBy):Tn({name:h(e.sortByQueryName)||go.sortByQueryName,defaultValue:h(rc(h(e.fields))?.name),storagePrefix:h(e.routeName)||h(pa())})}function yR(e){return e.sortDir?Bt(e.sortDir)?e.sortDir:le(e.sortDir):Tn({name:h(e.sortDirQueryName)||go.sortDirQueryName,defaultValue:h(rc(h(e.fields))?.sortDir),storagePrefix:h(e.routeName)||h(pa())})}const rc=e=>{const t=e.filter(r=>r.sortable);return t?t[0]:null},vR=(e,t)=>{const r=t.find(n=>n.name===e);return r&&r.sortDir?h(r.sortDir):"desc"},dm=(e,t,r,n)=>{const i=t.find(a=>a.name===r);if(!i)return e;const{sortable:o}=i,s=new Intl.Collator(navigator.language,{sensitivity:"base",numeric:!0});if(r==="name"){const a=[...e.filter(u=>u.type==="folder")].sort((u,c)=>nc(u,c,s,r,n,o)),l=[...e.filter(u=>u.type!=="folder")].sort((u,c)=>nc(u,c,s,r,n,o));return n==="asc"?a.concat(l):l.concat(a)}return[...e].sort((a,l)=>nc(a,l,s,i.prop||i.name,n,o))},nc=(e,t,r,n,i,o)=>{let s=tc(e,n),a=tc(t,n);const l=i==="asc"?1:-1;if(o)if(typeof o=="string"){const c=d=>d.map(f=>f[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:r.compare((s||"").toString(),(a||"").toString())*l},pm=e=>Array.isArray(e)?e[0]:e,bR=e=>{switch(pm(e)){case"asc":return"asc";case"desc":return"desc"}return null},hm=e=>e?[{name:"name",sortable:!0,sortDir:Ut.Asc},{name:"size",sortable:!0,sortDir:Ut.Desc},{name:"sharedWith",sortable:t=>t.length>0?t.sort((r,n)=>r.shareType!==n.shareType?r.shareType<n.shareType?-1:1:r.displayName<n.displayName?-1:1).map(r=>r.displayName).join():!1,sortDir:Ut.Asc},{name:"owner",sortable:"displayName",sortDir:Ut.Asc},{name:"mdate",sortable:t=>new Date(t).valueOf(),sortDir:Ut.Desc},{name:"sdate",sortable:t=>new Date(t).valueOf(),sortDir:Ut.Desc},{name:"ddate",sortable:t=>new Date(t).valueOf(),sortDir:Ut.Desc}].filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[];function x8(e){return e}const mm=[{label:"A-Z",name:"name",sortable:!0,sortDir:Ut.Asc},{label:"Z-A",name:"name",sortable:!0,sortDir:Ut.Desc},{label:"Newest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Ut.Desc},{label:"Oldest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Ut.Asc},{label:"Largest",name:"size",sortable:!0,sortDir:Ut.Desc},{label:"Smallest",name:"size",sortable:!0,sortDir:Ut.Asc},{label:"Remaining quota",name:"remainingQuota",prop:"spaceQuota.remaining",sortable:!0,sortDir:Ut.Desc},{label:"Total quota",name:"totalQuota",prop:"spaceQuota.total",sortable:!0,sortDir:Ut.Desc},{label:"Used quota",name:"usedQuota",prop:"spaceQuota.used",sortable:!0,sortDir:Ut.Desc}],wR=e=>e?mm.filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[],SR=(e,{$gettext:t})=>e.map(r=>({...r,label:t(r.label)})),ER=Te.z.object({icon:Te.z.string(),name:Te.z.string(),secure_view:Te.z.boolean().optional().default(!1),target_ext:Te.z.string().optional()}),TR=Te.z.object({allow_creation:Te.z.boolean().optional(),app_providers:Te.z.array(ER),default_application:Te.z.string().optional(),description:Te.z.string().optional(),ext:Te.z.string().optional(),mime_type:Te.z.string(),name:Te.z.string().optional()}),gm=Te.z.object({"mime-types":Te.z.array(TR)});class AR{_mimeTypes=le([]);serverUrl;clientService;constructor(t,r){this.serverUrl=t,this.clientService=r}async loadData(){const t=te.urlJoin(this.serverUrl,"app","list"),{data:{"mime-types":r}}=await this.clientService.httpUnAuthenticated.get(t,{schema:gm});this._mimeTypes.value=r}set mimeTypes(t){this._mimeTypes.value=t}get mimeTypes(){return h(this._mimeTypes)}get templateMimeTypes(){return h(this._mimeTypes).filter(t=>!!t.app_providers.some(r=>!!r.target_ext))}get appNames(){return[...new Set(h(this._mimeTypes).flatMap(t=>t.app_providers.map(r=>r.name)))]}getMimeTypesByAppName(t){return h(this._mimeTypes).filter(r=>r.app_providers.some(n=>n.name===t))}}var ym={},$s={};$s.byteLength=IR,$s.toByteArray=OR,$s.fromByteArray=FR;for(var nn=[],Fr=[],RR=typeof Uint8Array<"u"?Uint8Array:Array,ic="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ci=0,CR=ic.length;Ci<CR;++Ci)nn[Ci]=ic[Ci],Fr[ic.charCodeAt(Ci)]=Ci;Fr[45]=62,Fr[95]=63;function vm(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function IR(e){var t=vm(e),r=t[0],n=t[1];return(r+n)*3/4-n}function _R(e,t,r){return(t+r)*3/4-r}function OR(e){var t,r=vm(e),n=r[0],i=r[1],o=new RR(_R(e,n,i)),s=0,a=i>0?n-4:n,l;for(l=0;l<a;l+=4)t=Fr[e.charCodeAt(l)]<<18|Fr[e.charCodeAt(l+1)]<<12|Fr[e.charCodeAt(l+2)]<<6|Fr[e.charCodeAt(l+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=t&255;return i===2&&(t=Fr[e.charCodeAt(l)]<<2|Fr[e.charCodeAt(l+1)]>>4,o[s++]=t&255),i===1&&(t=Fr[e.charCodeAt(l)]<<10|Fr[e.charCodeAt(l+1)]<<4|Fr[e.charCodeAt(l+2)]>>2,o[s++]=t>>8&255,o[s++]=t&255),o}function PR(e){return nn[e>>18&63]+nn[e>>12&63]+nn[e>>6&63]+nn[e&63]}function kR(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),i.push(PR(n));return i.join("")}function FR(e){for(var t,r=e.length,n=r%3,i=[],o=16383,s=0,a=r-n;s<a;s+=o)i.push(kR(e,s,s+o>a?a:s+o));return n===1?(t=e[r-1],i.push(nn[t>>2]+nn[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(nn[t>>10]+nn[t>>4&63]+nn[t<<2&63]+"=")),i.join("")}var oc={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */oc.read=function(e,t,r,n,i){var o,s,a=i*8-n-1,l=(1<<a)-1,u=l>>1,c=-7,d=r?i-1:0,f=r?-1:1,m=e[t+d];for(d+=f,o=m&(1<<-c)-1,m>>=-c,c+=a;c>0;o=o*256+e[t+d],d+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=s*256+e[t+d],d+=f,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,n),o=o-u}return(m?-1:1)*s*Math.pow(2,o-n)},oc.write=function(e,t,r,n,i,o){var s,a,l,u=o*8-i-1,c=(1<<u)-1,d=c>>1,f=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,w=n?1:-1,v=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+d>=1?t+=f/l:t+=f*Math.pow(2,1-d),t*l>=2&&(s++,l/=2),s+d>=c?(a=0,s=c):s+d>=1?(a=(t*l-1)*Math.pow(2,i),s=s+d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[r+m]=a&255,m+=w,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+m]=s&255,m+=w,s/=256,u-=8);e[r+m-w]|=v*128};/*!
7
7
  * The buffer module from node.js, for the browser.
8
8
  *
9
9
  * @author Feross Aboukhadijeh <https://feross.org>
10
10
  * @license MIT
11
- */(function(e){const t=Ss,n=Vl,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=l,e.SlowBuffer=S,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o;const{Uint8Array:i,ArrayBuffer:s,SharedArrayBuffer:a}=globalThis;l.TYPED_ARRAY_SUPPORT=c(),!l.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 c(){try{const j=new i(1),C={foo:function(){return 42}};return Object.setPrototypeOf(C,i.prototype),Object.setPrototypeOf(j,C),j.foo()===42}catch{return!1}}Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}});function u(j){if(j>o)throw new RangeError('The value "'+j+'" is invalid for option "size"');const C=new i(j);return Object.setPrototypeOf(C,l.prototype),C}function l(j,C,O){if(typeof j=="number"){if(typeof C=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(j)}return d(j,C,O)}l.poolSize=8192;function d(j,C,O){if(typeof j=="string")return y(j,C);if(s.isView(j))return b(j);if(j==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof j);if(_t(j,s)||j&&_t(j.buffer,s)||typeof a<"u"&&(_t(j,a)||j&&_t(j.buffer,a)))return g(j,C,O);if(typeof j=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Q=j.valueOf&&j.valueOf();if(Q!=null&&Q!==j)return l.from(Q,C,O);const re=v(j);if(re)return re;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof j[Symbol.toPrimitive]=="function")return l.from(j[Symbol.toPrimitive]("string"),C,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof j)}l.from=function(j,C,O){return d(j,C,O)},Object.setPrototypeOf(l.prototype,i.prototype),Object.setPrototypeOf(l,i);function f(j){if(typeof j!="number")throw new TypeError('"size" argument must be of type number');if(j<0)throw new RangeError('The value "'+j+'" is invalid for option "size"')}function m(j,C,O){return f(j),j<=0?u(j):C!==void 0?typeof O=="string"?u(j).fill(C,O):u(j).fill(C):u(j)}l.alloc=function(j,C,O){return m(j,C,O)};function w(j){return f(j),u(j<0?0:h(j)|0)}l.allocUnsafe=function(j){return w(j)},l.allocUnsafeSlow=function(j){return w(j)};function y(j,C){if((typeof C!="string"||C==="")&&(C="utf8"),!l.isEncoding(C))throw new TypeError("Unknown encoding: "+C);const O=T(j,C)|0;let Q=u(O);const re=Q.write(j,C);return re!==O&&(Q=Q.slice(0,re)),Q}function E(j){const C=j.length<0?0:h(j.length)|0,O=u(C);for(let Q=0;Q<C;Q+=1)O[Q]=j[Q]&255;return O}function b(j){if(_t(j,i)){const C=new i(j);return g(C.buffer,C.byteOffset,C.byteLength)}return E(j)}function g(j,C,O){if(C<0||j.byteLength<C)throw new RangeError('"offset" is outside of buffer bounds');if(j.byteLength<C+(O||0))throw new RangeError('"length" is outside of buffer bounds');let Q;return C===void 0&&O===void 0?Q=new i(j):O===void 0?Q=new i(j,C):Q=new i(j,C,O),Object.setPrototypeOf(Q,l.prototype),Q}function v(j){if(l.isBuffer(j)){const C=h(j.length)|0,O=u(C);return O.length===0||j.copy(O,0,0,C),O}if(j.length!==void 0)return typeof j.length!="number"||$t(j.length)?u(0):E(j);if(j.type==="Buffer"&&Array.isArray(j.data))return E(j.data)}function h(j){if(j>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return j|0}function S(j){return+j!=j&&(j=0),l.alloc(+j)}l.isBuffer=function(C){return C!=null&&C._isBuffer===!0&&C!==l.prototype},l.compare=function(C,O){if(_t(C,i)&&(C=l.from(C,C.offset,C.byteLength)),_t(O,i)&&(O=l.from(O,O.offset,O.byteLength)),!l.isBuffer(C)||!l.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(C===O)return 0;let Q=C.length,re=O.length;for(let me=0,Te=Math.min(Q,re);me<Te;++me)if(C[me]!==O[me]){Q=C[me],re=O[me];break}return Q<re?-1:re<Q?1:0},l.isEncoding=function(C){switch(String(C).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}},l.concat=function(C,O){if(!Array.isArray(C))throw new TypeError('"list" argument must be an Array of Buffers');if(C.length===0)return l.alloc(0);let Q;if(O===void 0)for(O=0,Q=0;Q<C.length;++Q)O+=C[Q].length;const re=l.allocUnsafe(O);let me=0;for(Q=0;Q<C.length;++Q){let Te=C[Q];if(_t(Te,i))me+Te.length>re.length?(l.isBuffer(Te)||(Te=l.from(Te)),Te.copy(re,me)):i.prototype.set.call(re,Te,me);else if(l.isBuffer(Te))Te.copy(re,me);else throw new TypeError('"list" argument must be an Array of Buffers');me+=Te.length}return re};function T(j,C){if(l.isBuffer(j))return j.length;if(s.isView(j)||_t(j,s))return j.byteLength;if(typeof j!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof j);const O=j.length,Q=arguments.length>2&&arguments[2]===!0;if(!Q&&O===0)return 0;let re=!1;for(;;)switch(C){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return xe(j).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return et(j).length;default:if(re)return Q?-1:xe(j).length;C=(""+C).toLowerCase(),re=!0}}l.byteLength=T;function I(j,C,O){let Q=!1;if((C===void 0||C<0)&&(C=0),C>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,C>>>=0,O<=C))return"";for(j||(j="utf8");;)switch(j){case"hex":return J(this,C,O);case"utf8":case"utf-8":return ye(this,C,O);case"ascii":return ce(this,C,O);case"latin1":case"binary":return oe(this,C,O);case"base64":return ae(this,C,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,C,O);default:if(Q)throw new TypeError("Unknown encoding: "+j);j=(j+"").toLowerCase(),Q=!0}}l.prototype._isBuffer=!0;function _(j,C,O){const Q=j[C];j[C]=j[O],j[O]=Q}l.prototype.swap16=function(){const C=this.length;if(C%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<C;O+=2)_(this,O,O+1);return this},l.prototype.swap32=function(){const C=this.length;if(C%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<C;O+=4)_(this,O,O+3),_(this,O+1,O+2);return this},l.prototype.swap64=function(){const C=this.length;if(C%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<C;O+=8)_(this,O,O+7),_(this,O+1,O+6),_(this,O+2,O+5),_(this,O+3,O+4);return this},l.prototype.toString=function(){const C=this.length;return C===0?"":arguments.length===0?ye(this,0,C):I.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(C){if(!l.isBuffer(C))throw new TypeError("Argument must be a Buffer");return this===C?!0:l.compare(this,C)===0},l.prototype.inspect=function(){let C="";const O=e.INSPECT_MAX_BYTES;return C=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(C+=" ... "),"<Buffer "+C+">"},r&&(l.prototype[r]=l.prototype.inspect),l.prototype.compare=function(C,O,Q,re,me){if(_t(C,i)&&(C=l.from(C,C.offset,C.byteLength)),!l.isBuffer(C))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof C);if(O===void 0&&(O=0),Q===void 0&&(Q=C?C.length:0),re===void 0&&(re=0),me===void 0&&(me=this.length),O<0||Q>C.length||re<0||me>this.length)throw new RangeError("out of range index");if(re>=me&&O>=Q)return 0;if(re>=me)return-1;if(O>=Q)return 1;if(O>>>=0,Q>>>=0,re>>>=0,me>>>=0,this===C)return 0;let Te=me-re,Ye=Q-O;const ut=Math.min(Te,Ye),ft=this.slice(re,me),bt=C.slice(O,Q);for(let it=0;it<ut;++it)if(ft[it]!==bt[it]){Te=ft[it],Ye=bt[it];break}return Te<Ye?-1:Ye<Te?1:0};function A(j,C,O,Q,re){if(j.length===0)return-1;if(typeof O=="string"?(Q=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,$t(O)&&(O=re?0:j.length-1),O<0&&(O=j.length+O),O>=j.length){if(re)return-1;O=j.length-1}else if(O<0)if(re)O=0;else return-1;if(typeof C=="string"&&(C=l.from(C,Q)),l.isBuffer(C))return C.length===0?-1:$(j,C,O,Q,re);if(typeof C=="number")return C=C&255,typeof i.prototype.indexOf=="function"?re?i.prototype.indexOf.call(j,C,O):i.prototype.lastIndexOf.call(j,C,O):$(j,[C],O,Q,re);throw new TypeError("val must be string, number or Buffer")}function $(j,C,O,Q,re){let me=1,Te=j.length,Ye=C.length;if(Q!==void 0&&(Q=String(Q).toLowerCase(),Q==="ucs2"||Q==="ucs-2"||Q==="utf16le"||Q==="utf-16le")){if(j.length<2||C.length<2)return-1;me=2,Te/=2,Ye/=2,O/=2}function ut(bt,it){return me===1?bt[it]:bt.readUInt16BE(it*me)}let ft;if(re){let bt=-1;for(ft=O;ft<Te;ft++)if(ut(j,ft)===ut(C,bt===-1?0:ft-bt)){if(bt===-1&&(bt=ft),ft-bt+1===Ye)return bt*me}else bt!==-1&&(ft-=ft-bt),bt=-1}else for(O+Ye>Te&&(O=Te-Ye),ft=O;ft>=0;ft--){let bt=!0;for(let it=0;it<Ye;it++)if(ut(j,ft+it)!==ut(C,it)){bt=!1;break}if(bt)return ft}return-1}l.prototype.includes=function(C,O,Q){return this.indexOf(C,O,Q)!==-1},l.prototype.indexOf=function(C,O,Q){return A(this,C,O,Q,!0)},l.prototype.lastIndexOf=function(C,O,Q){return A(this,C,O,Q,!1)};function D(j,C,O,Q){O=Number(O)||0;const re=j.length-O;Q?(Q=Number(Q),Q>re&&(Q=re)):Q=re;const me=C.length;Q>me/2&&(Q=me/2);let Te;for(Te=0;Te<Q;++Te){const Ye=parseInt(C.substr(Te*2,2),16);if($t(Ye))return Te;j[O+Te]=Ye}return Te}function N(j,C,O,Q){return Nt(xe(C,j.length-O),j,O,Q)}function x(j,C,O,Q){return Nt(Me(C),j,O,Q)}function V(j,C,O,Q){return Nt(et(C),j,O,Q)}function G(j,C,O,Q){return Nt(Ge(C,j.length-O),j,O,Q)}l.prototype.write=function(C,O,Q,re){if(O===void 0)re="utf8",Q=this.length,O=0;else if(Q===void 0&&typeof O=="string")re=O,Q=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(Q)?(Q=Q>>>0,re===void 0&&(re="utf8")):(re=Q,Q=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const me=this.length-O;if((Q===void 0||Q>me)&&(Q=me),C.length>0&&(Q<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");re||(re="utf8");let Te=!1;for(;;)switch(re){case"hex":return D(this,C,O,Q);case"utf8":case"utf-8":return N(this,C,O,Q);case"ascii":case"latin1":case"binary":return x(this,C,O,Q);case"base64":return V(this,C,O,Q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,C,O,Q);default:if(Te)throw new TypeError("Unknown encoding: "+re);re=(""+re).toLowerCase(),Te=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ae(j,C,O){return C===0&&O===j.length?t.fromByteArray(j):t.fromByteArray(j.slice(C,O))}function ye(j,C,O){O=Math.min(j.length,O);const Q=[];let re=C;for(;re<O;){const me=j[re];let Te=null,Ye=me>239?4:me>223?3:me>191?2:1;if(re+Ye<=O){let ut,ft,bt,it;switch(Ye){case 1:me<128&&(Te=me);break;case 2:ut=j[re+1],(ut&192)===128&&(it=(me&31)<<6|ut&63,it>127&&(Te=it));break;case 3:ut=j[re+1],ft=j[re+2],(ut&192)===128&&(ft&192)===128&&(it=(me&15)<<12|(ut&63)<<6|ft&63,it>2047&&(it<55296||it>57343)&&(Te=it));break;case 4:ut=j[re+1],ft=j[re+2],bt=j[re+3],(ut&192)===128&&(ft&192)===128&&(bt&192)===128&&(it=(me&15)<<18|(ut&63)<<12|(ft&63)<<6|bt&63,it>65535&&it<1114112&&(Te=it))}}Te===null?(Te=65533,Ye=1):Te>65535&&(Te-=65536,Q.push(Te>>>10&1023|55296),Te=56320|Te&1023),Q.push(Te),re+=Ye}return te(Q)}const ue=4096;function te(j){const C=j.length;if(C<=ue)return String.fromCharCode.apply(String,j);let O="",Q=0;for(;Q<C;)O+=String.fromCharCode.apply(String,j.slice(Q,Q+=ue));return O}function ce(j,C,O){let Q="";O=Math.min(j.length,O);for(let re=C;re<O;++re)Q+=String.fromCharCode(j[re]&127);return Q}function oe(j,C,O){let Q="";O=Math.min(j.length,O);for(let re=C;re<O;++re)Q+=String.fromCharCode(j[re]);return Q}function J(j,C,O){const Q=j.length;(!C||C<0)&&(C=0),(!O||O<0||O>Q)&&(O=Q);let re="";for(let me=C;me<O;++me)re+=Be[j[me]];return re}function ne(j,C,O){const Q=j.slice(C,O);let re="";for(let me=0;me<Q.length-1;me+=2)re+=String.fromCharCode(Q[me]+Q[me+1]*256);return re}l.prototype.slice=function(C,O){const Q=this.length;C=~~C,O=O===void 0?Q:~~O,C<0?(C+=Q,C<0&&(C=0)):C>Q&&(C=Q),O<0?(O+=Q,O<0&&(O=0)):O>Q&&(O=Q),O<C&&(O=C);const re=this.subarray(C,O);return Object.setPrototypeOf(re,l.prototype),re};function se(j,C,O){if(j%1!==0||j<0)throw new RangeError("offset is not uint");if(j+C>O)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUintLE=l.prototype.readUIntLE=function(C,O,Q){C=C>>>0,O=O>>>0,Q||se(C,O,this.length);let re=this[C],me=1,Te=0;for(;++Te<O&&(me*=256);)re+=this[C+Te]*me;return re},l.prototype.readUintBE=l.prototype.readUIntBE=function(C,O,Q){C=C>>>0,O=O>>>0,Q||se(C,O,this.length);let re=this[C+--O],me=1;for(;O>0&&(me*=256);)re+=this[C+--O]*me;return re},l.prototype.readUint8=l.prototype.readUInt8=function(C,O){return C=C>>>0,O||se(C,1,this.length),this[C]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(C,O){return C=C>>>0,O||se(C,2,this.length),this[C]|this[C+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(C,O){return C=C>>>0,O||se(C,2,this.length),this[C]<<8|this[C+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(C,O){return C=C>>>0,O||se(C,4,this.length),(this[C]|this[C+1]<<8|this[C+2]<<16)+this[C+3]*16777216},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(C,O){return C=C>>>0,O||se(C,4,this.length),this[C]*16777216+(this[C+1]<<16|this[C+2]<<8|this[C+3])},l.prototype.readBigUInt64LE=Ve(function(C){C=C>>>0,ke(C,"offset");const O=this[C],Q=this[C+7];(O===void 0||Q===void 0)&&Pe(C,this.length-8);const re=O+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24,me=this[++C]+this[++C]*2**8+this[++C]*2**16+Q*2**24;return BigInt(re)+(BigInt(me)<<BigInt(32))}),l.prototype.readBigUInt64BE=Ve(function(C){C=C>>>0,ke(C,"offset");const O=this[C],Q=this[C+7];(O===void 0||Q===void 0)&&Pe(C,this.length-8);const re=O*2**24+this[++C]*2**16+this[++C]*2**8+this[++C],me=this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+Q;return(BigInt(re)<<BigInt(32))+BigInt(me)}),l.prototype.readIntLE=function(C,O,Q){C=C>>>0,O=O>>>0,Q||se(C,O,this.length);let re=this[C],me=1,Te=0;for(;++Te<O&&(me*=256);)re+=this[C+Te]*me;return me*=128,re>=me&&(re-=Math.pow(2,8*O)),re},l.prototype.readIntBE=function(C,O,Q){C=C>>>0,O=O>>>0,Q||se(C,O,this.length);let re=O,me=1,Te=this[C+--re];for(;re>0&&(me*=256);)Te+=this[C+--re]*me;return me*=128,Te>=me&&(Te-=Math.pow(2,8*O)),Te},l.prototype.readInt8=function(C,O){return C=C>>>0,O||se(C,1,this.length),this[C]&128?(255-this[C]+1)*-1:this[C]},l.prototype.readInt16LE=function(C,O){C=C>>>0,O||se(C,2,this.length);const Q=this[C]|this[C+1]<<8;return Q&32768?Q|4294901760:Q},l.prototype.readInt16BE=function(C,O){C=C>>>0,O||se(C,2,this.length);const Q=this[C+1]|this[C]<<8;return Q&32768?Q|4294901760:Q},l.prototype.readInt32LE=function(C,O){return C=C>>>0,O||se(C,4,this.length),this[C]|this[C+1]<<8|this[C+2]<<16|this[C+3]<<24},l.prototype.readInt32BE=function(C,O){return C=C>>>0,O||se(C,4,this.length),this[C]<<24|this[C+1]<<16|this[C+2]<<8|this[C+3]},l.prototype.readBigInt64LE=Ve(function(C){C=C>>>0,ke(C,"offset");const O=this[C],Q=this[C+7];(O===void 0||Q===void 0)&&Pe(C,this.length-8);const re=this[C+4]+this[C+5]*2**8+this[C+6]*2**16+(Q<<24);return(BigInt(re)<<BigInt(32))+BigInt(O+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24)}),l.prototype.readBigInt64BE=Ve(function(C){C=C>>>0,ke(C,"offset");const O=this[C],Q=this[C+7];(O===void 0||Q===void 0)&&Pe(C,this.length-8);const re=(O<<24)+this[++C]*2**16+this[++C]*2**8+this[++C];return(BigInt(re)<<BigInt(32))+BigInt(this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+Q)}),l.prototype.readFloatLE=function(C,O){return C=C>>>0,O||se(C,4,this.length),n.read(this,C,!0,23,4)},l.prototype.readFloatBE=function(C,O){return C=C>>>0,O||se(C,4,this.length),n.read(this,C,!1,23,4)},l.prototype.readDoubleLE=function(C,O){return C=C>>>0,O||se(C,8,this.length),n.read(this,C,!0,52,8)},l.prototype.readDoubleBE=function(C,O){return C=C>>>0,O||se(C,8,this.length),n.read(this,C,!1,52,8)};function Re(j,C,O,Q,re,me){if(!l.isBuffer(j))throw new TypeError('"buffer" argument must be a Buffer instance');if(C>re||C<me)throw new RangeError('"value" argument is out of bounds');if(O+Q>j.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(C,O,Q,re){if(C=+C,O=O>>>0,Q=Q>>>0,!re){const Ye=Math.pow(2,8*Q)-1;Re(this,C,O,Q,Ye,0)}let me=1,Te=0;for(this[O]=C&255;++Te<Q&&(me*=256);)this[O+Te]=C/me&255;return O+Q},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(C,O,Q,re){if(C=+C,O=O>>>0,Q=Q>>>0,!re){const Ye=Math.pow(2,8*Q)-1;Re(this,C,O,Q,Ye,0)}let me=Q-1,Te=1;for(this[O+me]=C&255;--me>=0&&(Te*=256);)this[O+me]=C/Te&255;return O+Q},l.prototype.writeUint8=l.prototype.writeUInt8=function(C,O,Q){return C=+C,O=O>>>0,Q||Re(this,C,O,1,255,0),this[O]=C&255,O+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(C,O,Q){return C=+C,O=O>>>0,Q||Re(this,C,O,2,65535,0),this[O]=C&255,this[O+1]=C>>>8,O+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(C,O,Q){return C=+C,O=O>>>0,Q||Re(this,C,O,2,65535,0),this[O]=C>>>8,this[O+1]=C&255,O+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(C,O,Q){return C=+C,O=O>>>0,Q||Re(this,C,O,4,4294967295,0),this[O+3]=C>>>24,this[O+2]=C>>>16,this[O+1]=C>>>8,this[O]=C&255,O+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(C,O,Q){return C=+C,O=O>>>0,Q||Re(this,C,O,4,4294967295,0),this[O]=C>>>24,this[O+1]=C>>>16,this[O+2]=C>>>8,this[O+3]=C&255,O+4};function H(j,C,O,Q,re){Le(C,Q,re,j,O,7);let me=Number(C&BigInt(4294967295));j[O++]=me,me=me>>8,j[O++]=me,me=me>>8,j[O++]=me,me=me>>8,j[O++]=me;let Te=Number(C>>BigInt(32)&BigInt(4294967295));return j[O++]=Te,Te=Te>>8,j[O++]=Te,Te=Te>>8,j[O++]=Te,Te=Te>>8,j[O++]=Te,O}function R(j,C,O,Q,re){Le(C,Q,re,j,O,7);let me=Number(C&BigInt(4294967295));j[O+7]=me,me=me>>8,j[O+6]=me,me=me>>8,j[O+5]=me,me=me>>8,j[O+4]=me;let Te=Number(C>>BigInt(32)&BigInt(4294967295));return j[O+3]=Te,Te=Te>>8,j[O+2]=Te,Te=Te>>8,j[O+1]=Te,Te=Te>>8,j[O]=Te,O+8}l.prototype.writeBigUInt64LE=Ve(function(C,O=0){return H(this,C,O,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=Ve(function(C,O=0){return R(this,C,O,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(C,O,Q,re){if(C=+C,O=O>>>0,!re){const ut=Math.pow(2,8*Q-1);Re(this,C,O,Q,ut-1,-ut)}let me=0,Te=1,Ye=0;for(this[O]=C&255;++me<Q&&(Te*=256);)C<0&&Ye===0&&this[O+me-1]!==0&&(Ye=1),this[O+me]=(C/Te>>0)-Ye&255;return O+Q},l.prototype.writeIntBE=function(C,O,Q,re){if(C=+C,O=O>>>0,!re){const ut=Math.pow(2,8*Q-1);Re(this,C,O,Q,ut-1,-ut)}let me=Q-1,Te=1,Ye=0;for(this[O+me]=C&255;--me>=0&&(Te*=256);)C<0&&Ye===0&&this[O+me+1]!==0&&(Ye=1),this[O+me]=(C/Te>>0)-Ye&255;return O+Q},l.prototype.writeInt8=function(C,O,Q){return C=+C,O=O>>>0,Q||Re(this,C,O,1,127,-128),C<0&&(C=255+C+1),this[O]=C&255,O+1},l.prototype.writeInt16LE=function(C,O,Q){return C=+C,O=O>>>0,Q||Re(this,C,O,2,32767,-32768),this[O]=C&255,this[O+1]=C>>>8,O+2},l.prototype.writeInt16BE=function(C,O,Q){return C=+C,O=O>>>0,Q||Re(this,C,O,2,32767,-32768),this[O]=C>>>8,this[O+1]=C&255,O+2},l.prototype.writeInt32LE=function(C,O,Q){return C=+C,O=O>>>0,Q||Re(this,C,O,4,2147483647,-2147483648),this[O]=C&255,this[O+1]=C>>>8,this[O+2]=C>>>16,this[O+3]=C>>>24,O+4},l.prototype.writeInt32BE=function(C,O,Q){return C=+C,O=O>>>0,Q||Re(this,C,O,4,2147483647,-2147483648),C<0&&(C=4294967295+C+1),this[O]=C>>>24,this[O+1]=C>>>16,this[O+2]=C>>>8,this[O+3]=C&255,O+4},l.prototype.writeBigInt64LE=Ve(function(C,O=0){return H(this,C,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=Ve(function(C,O=0){return R(this,C,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function F(j,C,O,Q,re,me){if(O+Q>j.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function K(j,C,O,Q,re){return C=+C,O=O>>>0,re||F(j,C,O,4),n.write(j,C,O,Q,23,4),O+4}l.prototype.writeFloatLE=function(C,O,Q){return K(this,C,O,!0,Q)},l.prototype.writeFloatBE=function(C,O,Q){return K(this,C,O,!1,Q)};function z(j,C,O,Q,re){return C=+C,O=O>>>0,re||F(j,C,O,8),n.write(j,C,O,Q,52,8),O+8}l.prototype.writeDoubleLE=function(C,O,Q){return z(this,C,O,!0,Q)},l.prototype.writeDoubleBE=function(C,O,Q){return z(this,C,O,!1,Q)},l.prototype.copy=function(C,O,Q,re){if(!l.isBuffer(C))throw new TypeError("argument should be a Buffer");if(Q||(Q=0),!re&&re!==0&&(re=this.length),O>=C.length&&(O=C.length),O||(O=0),re>0&&re<Q&&(re=Q),re===Q||C.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(Q<0||Q>=this.length)throw new RangeError("Index out of range");if(re<0)throw new RangeError("sourceEnd out of bounds");re>this.length&&(re=this.length),C.length-O<re-Q&&(re=C.length-O+Q);const me=re-Q;return this===C&&typeof i.prototype.copyWithin=="function"?this.copyWithin(O,Q,re):i.prototype.set.call(C,this.subarray(Q,re),O),me},l.prototype.fill=function(C,O,Q,re){if(typeof C=="string"){if(typeof O=="string"?(re=O,O=0,Q=this.length):typeof Q=="string"&&(re=Q,Q=this.length),re!==void 0&&typeof re!="string")throw new TypeError("encoding must be a string");if(typeof re=="string"&&!l.isEncoding(re))throw new TypeError("Unknown encoding: "+re);if(C.length===1){const Te=C.charCodeAt(0);(re==="utf8"&&Te<128||re==="latin1")&&(C=Te)}}else typeof C=="number"?C=C&255:typeof C=="boolean"&&(C=Number(C));if(O<0||this.length<O||this.length<Q)throw new RangeError("Out of range index");if(Q<=O)return this;O=O>>>0,Q=Q===void 0?this.length:Q>>>0,C||(C=0);let me;if(typeof C=="number")for(me=O;me<Q;++me)this[me]=C;else{const Te=l.isBuffer(C)?C:l.from(C,re),Ye=Te.length;if(Ye===0)throw new TypeError('The value "'+C+'" is invalid for argument "value"');for(me=0;me<Q-O;++me)this[me+O]=Te[me%Ye]}return this};const M={};function q(j,C,O){M[j]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:C.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${j}]`,this.stack,delete this.name}get code(){return j}set code(re){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:re,writable:!0})}toString(){return`${this.name} [${j}]: ${this.message}`}}}q("ERR_BUFFER_OUT_OF_BOUNDS",function(j){return j?`${j} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),q("ERR_INVALID_ARG_TYPE",function(j,C){return`The "${j}" argument must be of type number. Received type ${typeof C}`},TypeError),q("ERR_OUT_OF_RANGE",function(j,C,O){let Q=`The value of "${j}" is out of range.`,re=O;return Number.isInteger(O)&&Math.abs(O)>2**32?re=ge(String(O)):typeof O=="bigint"&&(re=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(re=ge(re)),re+="n"),Q+=` It must be ${C}. Received ${re}`,Q},RangeError);function ge(j){let C="",O=j.length;const Q=j[0]==="-"?1:0;for(;O>=Q+4;O-=3)C=`_${j.slice(O-3,O)}${C}`;return`${j.slice(0,O)}${C}`}function _e(j,C,O){ke(C,"offset"),(j[C]===void 0||j[C+O]===void 0)&&Pe(C,j.length-(O+1))}function Le(j,C,O,Q,re,me){if(j>O||j<C){const Te=typeof C=="bigint"?"n":"";let Ye;throw C===0||C===BigInt(0)?Ye=`>= 0${Te} and < 2${Te} ** ${(me+1)*8}${Te}`:Ye=`>= -(2${Te} ** ${(me+1)*8-1}${Te}) and < 2 ** ${(me+1)*8-1}${Te}`,new M.ERR_OUT_OF_RANGE("value",Ye,j)}_e(Q,re,me)}function ke(j,C){if(typeof j!="number")throw new M.ERR_INVALID_ARG_TYPE(C,"number",j)}function Pe(j,C,O){throw Math.floor(j)!==j?(ke(j,O),new M.ERR_OUT_OF_RANGE("offset","an integer",j)):C<0?new M.ERR_BUFFER_OUT_OF_BOUNDS:new M.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${C}`,j)}const De=/[^+/0-9A-Za-z-_]/g;function Z(j){if(j=j.split("=")[0],j=j.trim().replace(De,""),j.length<2)return"";for(;j.length%4!==0;)j=j+"=";return j}function xe(j,C){C=C||1/0;let O;const Q=j.length;let re=null;const me=[];for(let Te=0;Te<Q;++Te){if(O=j.charCodeAt(Te),O>55295&&O<57344){if(!re){if(O>56319){(C-=3)>-1&&me.push(239,191,189);continue}else if(Te+1===Q){(C-=3)>-1&&me.push(239,191,189);continue}re=O;continue}if(O<56320){(C-=3)>-1&&me.push(239,191,189),re=O;continue}O=(re-55296<<10|O-56320)+65536}else re&&(C-=3)>-1&&me.push(239,191,189);if(re=null,O<128){if((C-=1)<0)break;me.push(O)}else if(O<2048){if((C-=2)<0)break;me.push(O>>6|192,O&63|128)}else if(O<65536){if((C-=3)<0)break;me.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((C-=4)<0)break;me.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return me}function Me(j){const C=[];for(let O=0;O<j.length;++O)C.push(j.charCodeAt(O)&255);return C}function Ge(j,C){let O,Q,re;const me=[];for(let Te=0;Te<j.length&&!((C-=2)<0);++Te)O=j.charCodeAt(Te),Q=O>>8,re=O%256,me.push(re),me.push(Q);return me}function et(j){return t.toByteArray(Z(j))}function Nt(j,C,O,Q){let re;for(re=0;re<Q&&!(re+O>=C.length||re>=j.length);++re)C[re+O]=j[re];return re}function _t(j,C){return j instanceof C||j!=null&&j.constructor!=null&&j.constructor.name!=null&&j.constructor.name===C.name}function $t(j){return j!==j}const Be=function(){const j="0123456789abcdef",C=new Array(256);for(let O=0;O<16;++O){const Q=O*16;for(let re=0;re<16;++re)C[Q+re]=j[O]+j[re]}return C}();function Ve(j){return typeof BigInt>"u"?dn:j}function dn(){throw new Error("BigInt not supported")}})($h);const vr=$h.Buffer;var zl,Lh;function Mh(){return Lh||(Lh=1,zl=typeof ve=="object"&&ve.env&&ve.env.NODE_DEBUG&&/\bsemver\b/i.test(ve.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),zl}var Wl,Bh;function jh(){if(Bh)return Wl;Bh=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,o=t-6;return Wl={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Wl}var Es={exports:{}},Uh;function fA(){return Uh||(Uh=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:o}=jh(),i=Mh();t=e.exports={};const s=t.re=[],a=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],l=t.t={};let d=0;const f="[a-zA-Z0-9-]",m=[["\\s",1],["\\d",o],[f,r]],w=E=>{for(const[b,g]of m)E=E.split(`${b}*`).join(`${b}{0,${g}}`).split(`${b}+`).join(`${b}{1,${g}}`);return E},y=(E,b,g)=>{const v=w(b),h=d++;i(E,h,b),l[E]=h,c[h]=b,u[h]=v,s[h]=new RegExp(b,g?"g":void 0),a[h]=new RegExp(v,g?"g":void 0)};y("NUMERICIDENTIFIER","0|[1-9]\\d*"),y("NUMERICIDENTIFIERLOOSE","\\d+"),y("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),y("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),y("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),y("PRERELEASEIDENTIFIER",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIER]})`),y("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIERLOOSE]})`),y("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),y("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),y("BUILDIDENTIFIER",`${f}+`),y("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),y("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),y("FULL",`^${c[l.FULLPLAIN]}$`),y("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),y("LOOSE",`^${c[l.LOOSEPLAIN]}$`),y("GTLT","((?:<|>)?=?)"),y("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),y("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),y("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),y("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),y("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),y("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),y("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),y("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),y("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`),y("COERCERTL",c[l.COERCE],!0),y("COERCERTLFULL",c[l.COERCEFULL],!0),y("LONETILDE","(?:~>?)"),y("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",y("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),y("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),y("LONECARET","(?:\\^)"),y("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",y("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),y("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),y("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),y("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),y("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",y("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),y("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),y("STAR","(<|>)?=?\\s*\\*"),y("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),y("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Es,Es.exports)),Es.exports}var Hl,qh;function dA(){if(qh)return Hl;qh=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Hl=r=>r?typeof r!="object"?e:r:t,Hl}var Gl,Vh;function pA(){if(Vh)return Gl;Vh=1;const e=/^[0-9]+$/,t=(r,o)=>{const i=e.test(r),s=e.test(o);return i&&s&&(r=+r,o=+o),r===o?0:i&&!s?-1:s&&!i?1:r<o?-1:1};return Gl={compareIdentifiers:t,rcompareIdentifiers:(r,o)=>t(o,r)},Gl}var Kl,zh;function Wh(){if(zh)return Kl;zh=1;const e=Mh(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=jh(),{safeRe:r,t:o}=fA(),i=dA(),{compareIdentifiers:s}=pA();class a{constructor(u,l){if(l=i(l),u instanceof a){if(u.loose===!!l.loose&&u.includePrerelease===!!l.includePrerelease)return u;u=u.version}else if(typeof u!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof u}".`);if(u.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",u,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const d=u.trim().match(l.loose?r[o.LOOSE]:r[o.FULL]);if(!d)throw new TypeError(`Invalid Version: ${u}`);if(this.raw=u,this.major=+d[1],this.minor=+d[2],this.patch=+d[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");d[4]?this.prerelease=d[4].split(".").map(f=>{if(/^[0-9]+$/.test(f)){const m=+f;if(m>=0&&m<n)return m}return f}):this.prerelease=[],this.build=d[5]?d[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(u){if(e("SemVer.compare",this.version,this.options,u),!(u instanceof a)){if(typeof u=="string"&&u===this.version)return 0;u=new a(u,this.options)}return u.version===this.version?0:this.compareMain(u)||this.comparePre(u)}compareMain(u){return u instanceof a||(u=new a(u,this.options)),s(this.major,u.major)||s(this.minor,u.minor)||s(this.patch,u.patch)}comparePre(u){if(u instanceof a||(u=new a(u,this.options)),this.prerelease.length&&!u.prerelease.length)return-1;if(!this.prerelease.length&&u.prerelease.length)return 1;if(!this.prerelease.length&&!u.prerelease.length)return 0;let l=0;do{const d=this.prerelease[l],f=u.prerelease[l];if(e("prerelease compare",l,d,f),d===void 0&&f===void 0)return 0;if(f===void 0)return 1;if(d===void 0)return-1;if(d===f)continue;return s(d,f)}while(++l)}compareBuild(u){u instanceof a||(u=new a(u,this.options));let l=0;do{const d=this.build[l],f=u.build[l];if(e("build compare",l,d,f),d===void 0&&f===void 0)return 0;if(f===void 0)return 1;if(d===void 0)return-1;if(d===f)continue;return s(d,f)}while(++l)}inc(u,l,d){if(u.startsWith("pre")){if(!l&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(l){const f=`-${l}`.match(this.options.loose?r[o.PRERELEASELOOSE]:r[o.PRERELEASE]);if(!f||f[1]!==l)throw new Error(`invalid identifier: ${l}`)}}switch(u){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",l,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",l,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",l,d),this.inc("pre",l,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",l,d),this.inc("pre",l,d);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const f=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[f];else{let m=this.prerelease.length;for(;--m>=0;)typeof this.prerelease[m]=="number"&&(this.prerelease[m]++,m=-2);if(m===-1){if(l===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(f)}}if(l){let m=[l,f];d===!1&&(m=[l]),s(this.prerelease[0],l)===0?isNaN(this.prerelease[1])&&(this.prerelease=m):this.prerelease=m}break}default:throw new Error(`invalid increment argument: ${u}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Kl=a,Kl}var Ql,Hh;function hA(){if(Hh)return Ql;Hh=1;const e=Wh();return Ql=(n,r)=>new e(n,r).major,Ql}var gA=hA();const Gh=ul(gA);var Xl,Kh;function mA(){if(Kh)return Xl;Kh=1;const e=Wh();return Xl=(n,r,o)=>new e(n,o).compare(new e(r,o)),Xl}var Yl,Qh;function yA(){if(Qh)return Yl;Qh=1;const e=mA();return Yl=(n,r,o)=>e(r,n,o),Yl}var bA=yA();const vA=ul(bA);class ki extends Error{constructor(n,...r){super([n,...r].filter(Boolean).join(", "));Ee(this,"name","RuntimeError");Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class wA extends ki{constructor(){super(...arguments);Ee(this,"name","ApiError")}}const Jl=(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)};class SA{constructor(t,n,r,o=le([])){Ee(this,"clientService");Ee(this,"userStore");Ee(this,"serverUrl");Ee(this,"capability");Ee(this,"available");Ee(this,"fileIdsSupported");this.clientService=t,this.userStore=n,this.serverUrl=r,this.capability=B(()=>{const i=p(o).filter(s=>s.enabled).sort((s,a)=>vA(s.version,a.version));return i.length?i[0]:null}),this.available=B(()=>{var i;return!!((i=p(this.capability))!=null&&i.version)}),this.fileIdsSupported=B(()=>{var i;return Gh((i=p(this.capability))==null?void 0:i.version)>=2})}async triggerDownload(t){var o,i,s;if(!p(this.available))throw new ki("no archiver available");if((((o=t.fileIds)==null?void 0:o.length)||0)+(((i=t.files)==null?void 0:i.length)||0)===0)throw new ki("requested archive with empty list of resources");const n=this.buildDownloadUrl({...t});if(!n)throw new ki("download url could not be built");const r=t.publicToken?n:await this.clientService.ocsUserContext.signUrl(n,(s=this.userStore.user)==null?void 0:s.onPremisesSamAccountName);try{const a=await fetch(r,{headers:{...this.clientService.getRequestHeaders({useAuth:!t.publicLinkPassword}),...!!t.publicLinkPassword&&{Authorization:"Basic "+vr.from(["public",t.publicLinkPassword].join(":")).toString("base64")}}});if(!a.ok)throw new ee.HttpError("",a);const c=await a.blob(),u=URL.createObjectURL(c),l=this.getFileNameFromResponseHeaders(a.headers);return Jl(u,l),r}catch(a){throw new ee.HttpError("archive could not be fetched",a.response)}}buildDownloadUrl(t){const n=[];switch(t.publicToken&&n.push(`public-token=${t.publicToken}`),Gh(p(this.capability).version)){case 2:return n.push(...t.fileIds.map(o=>`id=${o}`)),this.url+"?"+n.join("&");case 1:{const o=Math.random().toString(36).substring(2);return n.push(`dir=${encodeURIComponent(t.dir)}`,...t.files.map(i=>`files[]=${encodeURIComponent(i)}`),`downloadStartSecret=${o}`),this.url+"?"+n.join("&")}default:return}}get url(){if(!this.available)throw new ki("no archiver available");const t=p(this.capability);return/^https?:\/\//i.test(t.archiver_url)?t.archiver_url:ee.urlJoin(this.serverUrl,t.archiver_url)}getFileNameFromResponseHeaders(t){var r;const n=(r=t.get("content-disposition"))==null?void 0:r.split('"')[1];return decodeURI(n)}}const EA=new $l({ttl:10*1e3,capacity:250}),TA=new $l({ttl:10*1e3,capacity:250});class AA{get avatarUrl(){return TA}get filePreview(){return EA}}const Zl=new AA;class Xh{constructor(t={}){Ee(this,"accessToken");Ee(this,"publicLinkToken");Ee(this,"publicLinkPassword");this.accessToken=t.accessToken,this.publicLinkToken=t.publicLinkToken,this.publicLinkPassword=t.publicLinkPassword}getHeaders(){return{...this.publicLinkToken&&{"public-token":this.publicLinkToken},...this.publicLinkPassword&&{Authorization:"Basic "+vr.from(["public",this.publicLinkPassword].join(":")).toString("base64")},...this.accessToken&&!this.publicLinkPassword&&{Authorization:"Bearer "+this.accessToken}}}}class ec{constructor(t,n){Ee(this,"instance");Ee(this,"cancelToken");this.cancelToken=Lo.CancelToken.source(),this.instance=Lo.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 uo({cancelToken:this.cancelToken.token},t)}processResponse(t,n){if(n!=null&&n.schema){const r=n.schema.parse(t.data);return{...t,data:r}}return t}async internalRequest(t,n,r){const o=await this.instance[t](n,this.obtainConfig(r));return this.processResponse(o,r)}async internalRequestWithData(t,n,r,o){const i=await this.instance[t](n,r,this.obtainConfig(o));return this.processResponse(i,o)}}class RA extends Error{constructor(){super(...arguments);Ee(this,"name","RetriableError")}}const _A=15e3;class IA{constructor(t,n){Ee(this,"url");Ee(this,"fetchOptions");Ee(this,"abortController");Ee(this,"eventListenerMap");Ee(this,"readyState");Ee(this,"withCredentials");Ee(this,"CONNECTING");Ee(this,"OPEN");Ee(this,"CLOSED");Ee(this,"onerror");Ee(this,"onmessage");Ee(this,"onopen");this.url=t,this.fetchOptions=n,this.abortController=new AbortController,this.eventListenerMap={},this.readyState=this.CONNECTING,this.connect()}connect(){return Q0.fetchEventSource(this.url,{openWhenHidden:!0,signal:this.abortController.signal,fetch:this.fetchProvider.bind(this),onopen:async()=>{var n;const t=new Event("open");(n=this.onopen)==null||n.bind(this)(t),this.readyState=this.OPEN},onmessage:t=>{var i;const n=new MessageEvent("message",{data:t.data});(i=this.onmessage)==null||i.bind(this)(n);const r=t.event,o=this.eventListenerMap[r];o==null||o.forEach(s=>s(n))},onclose:()=>{throw this.readyState=this.CLOSED,new RA},onerror:t=>{var r;console.error(t);const n=new CustomEvent("error",{detail:t});return(r=this.onerror)==null||r.bind(this)(n),3e4+Math.floor(Math.random()*_A)}})}fetchProvider(...t){const[n,r]=t,o={...r,...this.fetchOptions};return window.fetch(n,o)}close(){this.abortController.abort("closed")}addEventListener(t,n){this.eventListenerMap[t]=this.eventListenerMap[t]||[],this.eventListenerMap[t].push(n)}removeEventListener(t,n){var r;this.eventListenerMap[t]=(r=this.eventListenerMap[t])==null?void 0:r.filter(o=>o!==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 tc=null;const CA=(e,t)=>(tc||(tc=new IA(new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse",e).href,t)),tc),PA=(e,t)=>({headers:{Authorization:`Bearer ${e.accessToken}`,"Accept-Language":t,"X-Request-ID":en.v4(),"X-Requested-With":"XMLHttpRequest"}});class FA{constructor(t){Ee(this,"configStore");Ee(this,"language");Ee(this,"authStore");Ee(this,"httpAuthenticatedClient");Ee(this,"httpUnAuthenticatedClient");Ee(this,"graphClient");Ee(this,"ocsClient");Ee(this,"webDavClient");Ee(this,"initiatorId",en.v4());Ee(this,"staticHeaders",{"Initiator-ID":this.initiatorId,"X-Requested-With":"XMLHttpRequest"});Ee(this,"getRequestHeaders",({useAuth:t=!0}={})=>({...this.staticHeaders,...this.getDynamicHeaders({useAuth:t})}));this.configStore=t.configStore,this.language=t.language,this.authStore=t.authStore,this.initGraphClient(),this.initOcsClient(),this.initWebDavClient(),this.httpAuthenticatedClient=new ec({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.httpUnAuthenticatedClient=new ec({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 CA(this.configStore.serverUrl,PA({accessToken:this.authStore.accessToken},this.currentLanguage))}get ocs(){return this.ocsClient}get ocsUserContext(){return this.ocs}ocsPublicLinkContext(t){return this.ocs}get webdav(){return this.webDavClient}get currentLanguage(){return this.language.current}initGraphClient(){const t=Lo.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.graphClient=ee.graph(this.configStore.serverUrl,t)}initOcsClient(){const t=Lo.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.ocsClient=ee.ocs(this.configStore.serverUrl,t)}initWebDavClient(){this.webDavClient=ee.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 "+vr.from(["public",this.authStore.publicLinkPassword].join(":")).toString("base64")),t})}getDynamicHeaders({useAuth:t=!0}={}){return{"Accept-Language":this.currentLanguage,"X-Request-ID":en.v4(),...t&&{Authorization:"Bearer "+this.authStore.accessToken}}}}class Yh{constructor(){Ee(this,"topics");this.topics=new Map}subscribe(t,n){const r={token:en.v4(),callback:n},o=[r,...this.topics.get(t)||[]];return this.topics.set(t,o),r.token}publish(t,n){(this.topics.get(t)||[]).forEach(o=>o.callback(n))}unsubscribe(t,n){this.topics.has(t)&&this.topics.set(t,this.topics.get(t).filter(r=>r.token!==n))}}const Ke=new Yh;class Jh{isEnabled(){return!0}isActive(t){return ht(t,"files-spaces-projects")?!1:ht(t,"files-spaces-generic")||Pn(t,"files-public-link")}getTask(t){const{router:n,clientService:r,resourcesStore:o,authService:i,spacesStore:s,sharesStore:a,configStore:c}=t,{webdav:u,graphAuthenticated:l}=r,{replaceInvalidFileRoute:d}=Js({router:n});return pn.useTask(function*(f,m,w,y=null,E=null,b={}){try{o.clearResourceList();let{resource:g,children:v}=yield*ee.call(u.listFiles(w,{path:y,fileId:E},{signal:f}));g.id&&d({space:w,resource:g,path:y,fileId:E});let h;y==="/"&&(ee.isShareSpaceResource(w)?(h=yield*ee.call(vs({graphClient:l,spacesStore:s,space:w,signal:f})),h&&(g=ee.buildIncomingShareResource({graphRoles:a.graphRoles,driveItem:h,serverUrl:c.serverUrl}))):!ee.isPersonalSpaceResource(w)&&!ee.isPublicSpaceResource(w)&&(g=w)),yield o.loadAncestorMetaData({folder:g,space:w,client:u,signal:f}),ee.isProjectSpaceResource(w)&&(yield s.loadGraphPermissions({ids:[w.id],graphClient:l})),ee.isShareSpaceResource(w)&&(v.forEach(S=>S.remoteItemId=w.id),w.graphPermissions===void 0&&(h||(h=yield*ee.call(vs({graphClient:l,spacesStore:s,space:w,signal:f}))),Th({sharesStore:a,spacesStore:s,space:w,sharedDriveItem:h}))),o.initResourceList({currentFolder:g,resources:v})}catch(g){if(o.setCurrentFolder(null),console.error(g),g.statusCode===401)return i.handleAuthError(p(n.currentRoute))}}).restartable()}}class Zh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return Ct(t,"files-common-favorites")||((r=n==null?void 0:n.query)==null?void 0:r.contextRouteName)==="files-common-favorites"}getTask(t){const{resourcesStore:n,clientService:r,userStore:o}=t;return pn.useTask(function*(i,s){var c;n.clearResourceList(),n.setAncestorMetaData({});let a=yield r.webdav.listFavoriteFiles({username:(c=o.user)==null?void 0:c.onPremisesSamAccountName,signal:i});a=a.map(ee.buildResource),n.initResourceList({currentFolder:null,resources:a})})}}class eg{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return jt(t,"files-shares-via-link")||((r=n==null?void 0:n.query)==null?void 0:r.contextRouteName)==="files-shares-via-link"}getTask(t){const{userStore:n,spacesStore:r,clientService:o,configStore:i,resourcesStore:s}=t;return pn.useTask(function*(a,c){s.clearResourceList(),s.setAncestorMetaData({}),i.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:o.graphAuthenticated,signal:a}));const l=(yield*ee.call(o.graphAuthenticated.driveItems.listSharedByMe({signal:a}))).filter(d=>d.permissions.some(({link:f})=>!!f)).map(d=>ee.buildOutgoingShareResource({driveItem:d,user:n.user,serverUrl:i.serverUrl}));s.initResourceList({currentFolder:null,resources:l})})}}class tg{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return jt(t,"files-shares-with-me")||((r=n==null?void 0:n.query)==null?void 0:r.contextRouteName)==="files-shares-with-me"}getTask(t){const{spacesStore:n,clientService:r,configStore:o,resourcesStore:i,sharesStore:s}=t;return pn.useTask(function*(a,c){i.clearResourceList(),i.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:r.graphAuthenticated,signal:a}));const l=(yield*ee.call(r.graphAuthenticated.driveItems.listSharedWithMe({signal:a}))).map(d=>ee.buildIncomingShareResource({driveItem:d,graphRoles:s.graphRoles,serverUrl:o.serverUrl}));i.initResourceList({currentFolder:null,resources:l})})}}class ng{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return jt(t,"files-shares-with-others")||((r=n==null?void 0:n.query)==null?void 0:r.contextRouteName)==="files-shares-with-others"}getTask(t){const{userStore:n,spacesStore:r,clientService:o,configStore:i,resourcesStore:s}=t;return pn.useTask(function*(a,c){s.clearResourceList(),s.setAncestorMetaData({}),i.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:o.graphAuthenticated,signal:a}));const l=(yield*ee.call(o.graphAuthenticated.driveItems.listSharedByMe({signal:a}))).filter(d=>d.permissions.some(({link:f})=>!f)).map(d=>ee.buildOutgoingShareResource({driveItem:d,user:n.user,serverUrl:i.serverUrl}));s.initResourceList({currentFolder:null,resources:l})})}}class On{}Ee(On,"Shared","S"),Ee(On,"Shareable","R"),Ee(On,"Mounted","M"),Ee(On,"Deletable","D"),Ee(On,"Renameable","N"),Ee(On,"Moveable","V"),Ee(On,"Updateable","NV"),Ee(On,"FileUpdateable","W"),Ee(On,"FolderCreateable","CK"),Ee(On,"Deny","Z"),Ee(On,"SecureView","X");const Ts=e=>({value:e,type:null}),OA=e=>Ts(e),gt=e=>Ts(e),nc=e=>Ts(e),kA=e=>Ts(e),xA={Permissions:gt("permissions"),IsFavorite:nc("favorite"),FileId:gt("fileid"),FileParent:gt("file-parent"),Name:gt("name"),OwnerId:gt("owner-id"),OwnerDisplayName:gt("owner-display-name"),PrivateLink:gt("privatelink"),ContentLength:nc("getcontentlength"),ContentSize:nc("size"),LastModifiedDate:gt("getlastmodified"),Tags:OA("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:kA("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"),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")},je=Object.fromEntries(Object.entries(xA).map(([e,t])=>[e,t.value])),pi=class pi{};Ee(pi,"Default",[je.Permissions,je.IsFavorite,je.FileId,je.FileParent,je.Name,je.LockDiscovery,je.ActiveLock,je.OwnerId,je.OwnerDisplayName,je.RemoteItemId,je.ShareRoot,je.ShareTypes,je.PrivateLink,je.ContentLength,je.ContentSize,je.LastModifiedDate,je.ETag,je.MimeType,je.ResourceType,je.DownloadURL,je.Tags,je.Audio,je.Location,je.Image,je.Photo]),Ee(pi,"PublicLink",pi.Default.concat([je.PublicLinkItemType,je.PublicLinkPermission,je.PublicLinkExpiration,je.PublicLinkShareDate,je.PublicLinkShareOwner])),Ee(pi,"Trashbin",[je.ContentLength,je.ResourceType,je.TrashbinOriginalLocation,je.TrashbinOriginalFilename,je.TrashbinDeletedDate,je.Permissions,je.FileParent]),Ee(pi,"DavNamespace",[je.ContentLength,je.LastModifiedDate,je.ETag,je.MimeType,je.ResourceType,je.LockDiscovery,je.ActiveLock]);let As=pi;var rc={},Rs={exports:{}},rg;function ic(){if(rg)return Rs.exports;rg=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(S,T,I){return Function.prototype.apply.call(S,T,I)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(S){return Object.getOwnPropertyNames(S).concat(Object.getOwnPropertySymbols(S))}:n=function(S){return Object.getOwnPropertyNames(S)};function r(h){console&&console.warn&&console.warn(h)}var o=Number.isNaN||function(S){return S!==S};function i(){i.init.call(this)}Rs.exports=i,Rs.exports.once=b,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.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(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(h){if(typeof h!="number"||h<0||o(h))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+h+".");s=h}}),i.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},i.prototype.setMaxListeners=function(S){if(typeof S!="number"||S<0||o(S))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+S+".");return this._maxListeners=S,this};function c(h){return h._maxListeners===void 0?i.defaultMaxListeners:h._maxListeners}i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(S){for(var T=[],I=1;I<arguments.length;I++)T.push(arguments[I]);var _=S==="error",A=this._events;if(A!==void 0)_=_&&A.error===void 0;else if(!_)return!1;if(_){var $;if(T.length>0&&($=T[0]),$ instanceof Error)throw $;var D=new Error("Unhandled error."+($?" ("+$.message+")":""));throw D.context=$,D}var N=A[S];if(N===void 0)return!1;if(typeof N=="function")t(N,this,T);else for(var x=N.length,V=w(N,x),I=0;I<x;++I)t(V[I],this,T);return!0};function u(h,S,T,I){var _,A,$;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",S,T.listener?T.listener:T),A=h._events),$=A[S]),$===void 0)$=A[S]=T,++h._eventsCount;else if(typeof $=="function"?$=A[S]=I?[T,$]:[$,T]:I?$.unshift(T):$.push(T),_=c(h),_>0&&$.length>_&&!$.warned){$.warned=!0;var D=new Error("Possible EventEmitter memory leak detected. "+$.length+" "+String(S)+" listeners added. Use emitter.setMaxListeners() to increase limit");D.name="MaxListenersExceededWarning",D.emitter=h,D.type=S,D.count=$.length,r(D)}return h}i.prototype.addListener=function(S,T){return u(this,S,T,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(S,T){return u(this,S,T,!0)};function l(){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 d(h,S,T){var I={fired:!1,wrapFn:void 0,target:h,type:S,listener:T},_=l.bind(I);return _.listener=T,I.wrapFn=_,_}i.prototype.once=function(S,T){return a(T),this.on(S,d(this,S,T)),this},i.prototype.prependOnceListener=function(S,T){return a(T),this.prependListener(S,d(this,S,T)),this},i.prototype.removeListener=function(S,T){var I,_,A,$,D;if(a(T),_=this._events,_===void 0)return this;if(I=_[S],I===void 0)return this;if(I===T||I.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete _[S],_.removeListener&&this.emit("removeListener",S,I.listener||T));else if(typeof I!="function"){for(A=-1,$=I.length-1;$>=0;$--)if(I[$]===T||I[$].listener===T){D=I[$].listener,A=$;break}if(A<0)return this;A===0?I.shift():y(I,A),I.length===1&&(_[S]=I[0]),_.removeListener!==void 0&&this.emit("removeListener",S,D||T)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(S){var T,I,_;if(I=this._events,I===void 0)return this;if(I.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):I[S]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete I[S]),this;if(arguments.length===0){var A=Object.keys(I),$;for(_=0;_<A.length;++_)$=A[_],$!=="removeListener"&&this.removeAllListeners($);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=I[S],typeof T=="function")this.removeListener(S,T);else if(T!==void 0)for(_=T.length-1;_>=0;_--)this.removeListener(S,T[_]);return this};function f(h,S,T){var I=h._events;if(I===void 0)return[];var _=I[S];return _===void 0?[]:typeof _=="function"?T?[_.listener||_]:[_]:T?E(_):w(_,_.length)}i.prototype.listeners=function(S){return f(this,S,!0)},i.prototype.rawListeners=function(S){return f(this,S,!1)},i.listenerCount=function(h,S){return typeof h.listenerCount=="function"?h.listenerCount(S):m.call(h,S)},i.prototype.listenerCount=m;function m(h){var S=this._events;if(S!==void 0){var T=S[h];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function w(h,S){for(var T=new Array(S),I=0;I<S;++I)T[I]=h[I];return T}function y(h,S){for(;S+1<h.length;S++)h[S]=h[S+1];h.pop()}function E(h){for(var S=new Array(h.length),T=0;T<S.length;++T)S[T]=h[T].listener||h[T];return S}function b(h,S){return new Promise(function(T,I){function _($){h.removeListener(S,A),I($)}function A(){typeof h.removeListener=="function"&&h.removeListener("error",_),T([].slice.call(arguments))}v(h,S,A,{once:!0}),S!=="error"&&g(h,_,{once:!0})})}function g(h,S,T){typeof h.on=="function"&&v(h,"error",S,T)}function v(h,S,T,I){if(typeof h.on=="function")I.once?h.once(S,T):h.on(S,T);else if(typeof h.addEventListener=="function")h.addEventListener(S,function _(A){I.once&&h.removeEventListener(S,_),T(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof h)}return Rs.exports}var _s={exports:{}},ig;function ni(){return ig||(ig=1,typeof Object.create=="function"?_s.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:_s.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}}),_s.exports}var oc,og;function sg(){return og||(og=1,oc=ic().EventEmitter),oc}var sc={},ag;function Is(){return ag||(ag=1,function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},n={};n.byteLength=l,n.toByteArray=f,n.fromByteArray=y;for(var r=[],o=[],i=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=s.length;a<c;++a)r[a]=s[a],o[s.charCodeAt(a)]=a;o[45]=62,o[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 S=h===v?0:4-h%4;return[h,S]}function l(g){var v=u(g),h=v[0],S=v[1];return(h+S)*3/4-S}function d(g,v,h){return(v+h)*3/4-h}function f(g){var v,h=u(g),S=h[0],T=h[1],I=new i(d(g,S,T)),_=0,A=T>0?S-4:S,$;for($=0;$<A;$+=4)v=o[g.charCodeAt($)]<<18|o[g.charCodeAt($+1)]<<12|o[g.charCodeAt($+2)]<<6|o[g.charCodeAt($+3)],I[_++]=v>>16&255,I[_++]=v>>8&255,I[_++]=v&255;return T===2&&(v=o[g.charCodeAt($)]<<2|o[g.charCodeAt($+1)]>>4,I[_++]=v&255),T===1&&(v=o[g.charCodeAt($)]<<10|o[g.charCodeAt($+1)]<<4|o[g.charCodeAt($+2)]>>2,I[_++]=v>>8&255,I[_++]=v&255),I}function m(g){return r[g>>18&63]+r[g>>12&63]+r[g>>6&63]+r[g&63]}function w(g,v,h){for(var S,T=[],I=v;I<h;I+=3)S=(g[I]<<16&16711680)+(g[I+1]<<8&65280)+(g[I+2]&255),T.push(m(S));return T.join("")}function y(g){for(var v,h=g.length,S=h%3,T=[],I=16383,_=0,A=h-S;_<A;_+=I)T.push(w(g,_,_+I>A?A:_+I));return S===1?(v=g[h-1],T.push(r[v>>2]+r[v<<4&63]+"==")):S===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 E={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */E.read=function(g,v,h,S,T){var I,_,A=T*8-S-1,$=(1<<A)-1,D=$>>1,N=-7,x=h?T-1:0,V=h?-1:1,G=g[v+x];for(x+=V,I=G&(1<<-N)-1,G>>=-N,N+=A;N>0;I=I*256+g[v+x],x+=V,N-=8);for(_=I&(1<<-N)-1,I>>=-N,N+=S;N>0;_=_*256+g[v+x],x+=V,N-=8);if(I===0)I=1-D;else{if(I===$)return _?NaN:(G?-1:1)*(1/0);_=_+Math.pow(2,S),I=I-D}return(G?-1:1)*_*Math.pow(2,I-S)},E.write=function(g,v,h,S,T,I){var _,A,$,D=I*8-T-1,N=(1<<D)-1,x=N>>1,V=T===23?Math.pow(2,-24)-Math.pow(2,-77):0,G=S?0:I-1,ae=S?1:-1,ye=v<0||v===0&&1/v<0?1:0;for(v=Math.abs(v),isNaN(v)||v===1/0?(A=isNaN(v)?1:0,_=N):(_=Math.floor(Math.log(v)/Math.LN2),v*($=Math.pow(2,-_))<1&&(_--,$*=2),_+x>=1?v+=V/$:v+=V*Math.pow(2,1-x),v*$>=2&&(_++,$/=2),_+x>=N?(A=0,_=N):_+x>=1?(A=(v*$-1)*Math.pow(2,T),_=_+x):(A=v*Math.pow(2,x-1)*Math.pow(2,T),_=0));T>=8;g[h+G]=A&255,G+=ae,A/=256,T-=8);for(_=_<<T|A,D+=T;D>0;g[h+G]=_&255,G+=ae,_/=256,D-=8);g[h+G-ae]|=ye*128};/*!
11
+ */(function(e){const t=$s,r=oc,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=S,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 L=new o(1),C={foo:function(){return 42}};return Object.setPrototypeOf(C,o.prototype),Object.setPrototypeOf(L,C),L.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(L){if(L>i)throw new RangeError('The value "'+L+'" is invalid for option "size"');const C=new o(L);return Object.setPrototypeOf(C,c.prototype),C}function c(L,C,k){if(typeof L=="number"){if(typeof C=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(L)}return d(L,C,k)}c.poolSize=8192;function d(L,C,k){if(typeof L=="string")return v(L,C);if(s.isView(L))return b(L);if(L==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof L);if(Xe(L,s)||L&&Xe(L.buffer,s)||typeof a<"u"&&(Xe(L,a)||L&&Xe(L.buffer,a)))return g(L,C,k);if(typeof L=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Y=L.valueOf&&L.valueOf();if(Y!=null&&Y!==L)return c.from(Y,C,k);const q=y(L);if(q)return q;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof L[Symbol.toPrimitive]=="function")return c.from(L[Symbol.toPrimitive]("string"),C,k);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof L)}c.from=function(L,C,k){return d(L,C,k)},Object.setPrototypeOf(c.prototype,o.prototype),Object.setPrototypeOf(c,o);function f(L){if(typeof L!="number")throw new TypeError('"size" argument must be of type number');if(L<0)throw new RangeError('The value "'+L+'" is invalid for option "size"')}function m(L,C,k){return f(L),L<=0?u(L):C!==void 0?typeof k=="string"?u(L).fill(C,k):u(L).fill(C):u(L)}c.alloc=function(L,C,k){return m(L,C,k)};function w(L){return f(L),u(L<0?0:p(L)|0)}c.allocUnsafe=function(L){return w(L)},c.allocUnsafeSlow=function(L){return w(L)};function v(L,C){if((typeof C!="string"||C==="")&&(C="utf8"),!c.isEncoding(C))throw new TypeError("Unknown encoding: "+C);const k=T(L,C)|0;let Y=u(k);const q=Y.write(L,C);return q!==k&&(Y=Y.slice(0,q)),Y}function E(L){const C=L.length<0?0:p(L.length)|0,k=u(C);for(let Y=0;Y<C;Y+=1)k[Y]=L[Y]&255;return k}function b(L){if(Xe(L,o)){const C=new o(L);return g(C.buffer,C.byteOffset,C.byteLength)}return E(L)}function g(L,C,k){if(C<0||L.byteLength<C)throw new RangeError('"offset" is outside of buffer bounds');if(L.byteLength<C+(k||0))throw new RangeError('"length" is outside of buffer bounds');let Y;return C===void 0&&k===void 0?Y=new o(L):k===void 0?Y=new o(L,C):Y=new o(L,C,k),Object.setPrototypeOf(Y,c.prototype),Y}function y(L){if(c.isBuffer(L)){const C=p(L.length)|0,k=u(C);return k.length===0||L.copy(k,0,0,C),k}if(L.length!==void 0)return typeof L.length!="number"||at(L.length)?u(0):E(L);if(L.type==="Buffer"&&Array.isArray(L.data))return E(L.data)}function p(L){if(L>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return L|0}function S(L){return+L!=L&&(L=0),c.alloc(+L)}c.isBuffer=function(C){return C!=null&&C._isBuffer===!0&&C!==c.prototype},c.compare=function(C,k){if(Xe(C,o)&&(C=c.from(C,C.offset,C.byteLength)),Xe(k,o)&&(k=c.from(k,k.offset,k.byteLength)),!c.isBuffer(C)||!c.isBuffer(k))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(C===k)return 0;let Y=C.length,q=k.length;for(let re=0,me=Math.min(Y,q);re<me;++re)if(C[re]!==k[re]){Y=C[re],q=k[re];break}return Y<q?-1:q<Y?1:0},c.isEncoding=function(C){switch(String(C).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(C,k){if(!Array.isArray(C))throw new TypeError('"list" argument must be an Array of Buffers');if(C.length===0)return c.alloc(0);let Y;if(k===void 0)for(k=0,Y=0;Y<C.length;++Y)k+=C[Y].length;const q=c.allocUnsafe(k);let re=0;for(Y=0;Y<C.length;++Y){let me=C[Y];if(Xe(me,o))re+me.length>q.length?(c.isBuffer(me)||(me=c.from(me)),me.copy(q,re)):o.prototype.set.call(q,me,re);else if(c.isBuffer(me))me.copy(q,re);else throw new TypeError('"list" argument must be an Array of Buffers');re+=me.length}return q};function T(L,C){if(c.isBuffer(L))return L.length;if(s.isView(L)||Xe(L,s))return L.byteLength;if(typeof L!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof L);const k=L.length,Y=arguments.length>2&&arguments[2]===!0;if(!Y&&k===0)return 0;let q=!1;for(;;)switch(C){case"ascii":case"latin1":case"binary":return k;case"utf8":case"utf-8":return Ye(L).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k*2;case"hex":return k>>>1;case"base64":return Pe(L).length;default:if(q)return Y?-1:Ye(L).length;C=(""+C).toLowerCase(),q=!0}}c.byteLength=T;function R(L,C,k){let Y=!1;if((C===void 0||C<0)&&(C=0),C>this.length||((k===void 0||k>this.length)&&(k=this.length),k<=0)||(k>>>=0,C>>>=0,k<=C))return"";for(L||(L="utf8");;)switch(L){case"hex":return X(this,C,k);case"utf8":case"utf-8":return ie(this,C,k);case"ascii":return de(this,C,k);case"latin1":case"binary":return ce(this,C,k);case"base64":return ne(this,C,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oe(this,C,k);default:if(Y)throw new TypeError("Unknown encoding: "+L);L=(L+"").toLowerCase(),Y=!0}}c.prototype._isBuffer=!0;function I(L,C,k){const Y=L[C];L[C]=L[k],L[k]=Y}c.prototype.swap16=function(){const C=this.length;if(C%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let k=0;k<C;k+=2)I(this,k,k+1);return this},c.prototype.swap32=function(){const C=this.length;if(C%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let k=0;k<C;k+=4)I(this,k,k+3),I(this,k+1,k+2);return this},c.prototype.swap64=function(){const C=this.length;if(C%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let k=0;k<C;k+=8)I(this,k,k+7),I(this,k+1,k+6),I(this,k+2,k+5),I(this,k+3,k+4);return this},c.prototype.toString=function(){const C=this.length;return C===0?"":arguments.length===0?ie(this,0,C):R.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(C){if(!c.isBuffer(C))throw new TypeError("Argument must be a Buffer");return this===C?!0:c.compare(this,C)===0},c.prototype.inspect=function(){let C="";const k=e.INSPECT_MAX_BYTES;return C=this.toString("hex",0,k).replace(/(.{2})/g,"$1 ").trim(),this.length>k&&(C+=" ... "),"<Buffer "+C+">"},n&&(c.prototype[n]=c.prototype.inspect),c.prototype.compare=function(C,k,Y,q,re){if(Xe(C,o)&&(C=c.from(C,C.offset,C.byteLength)),!c.isBuffer(C))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof C);if(k===void 0&&(k=0),Y===void 0&&(Y=C?C.length:0),q===void 0&&(q=0),re===void 0&&(re=this.length),k<0||Y>C.length||q<0||re>this.length)throw new RangeError("out of range index");if(q>=re&&k>=Y)return 0;if(q>=re)return-1;if(k>=Y)return 1;if(k>>>=0,Y>>>=0,q>>>=0,re>>>=0,this===C)return 0;let me=re-q,Ne=Y-k;const Le=Math.min(me,Ne),Je=this.slice(q,re),et=C.slice(k,Y);for(let tt=0;tt<Le;++tt)if(Je[tt]!==et[tt]){me=Je[tt],Ne=et[tt];break}return me<Ne?-1:Ne<me?1:0};function A(L,C,k,Y,q){if(L.length===0)return-1;if(typeof k=="string"?(Y=k,k=0):k>2147483647?k=2147483647:k<-2147483648&&(k=-2147483648),k=+k,at(k)&&(k=q?0:L.length-1),k<0&&(k=L.length+k),k>=L.length){if(q)return-1;k=L.length-1}else if(k<0)if(q)k=0;else return-1;if(typeof C=="string"&&(C=c.from(C,Y)),c.isBuffer(C))return C.length===0?-1:D(L,C,k,Y,q);if(typeof C=="number")return C=C&255,typeof o.prototype.indexOf=="function"?q?o.prototype.indexOf.call(L,C,k):o.prototype.lastIndexOf.call(L,C,k):D(L,[C],k,Y,q);throw new TypeError("val must be string, number or Buffer")}function D(L,C,k,Y,q){let re=1,me=L.length,Ne=C.length;if(Y!==void 0&&(Y=String(Y).toLowerCase(),Y==="ucs2"||Y==="ucs-2"||Y==="utf16le"||Y==="utf-16le")){if(L.length<2||C.length<2)return-1;re=2,me/=2,Ne/=2,k/=2}function Le(et,tt){return re===1?et[tt]:et.readUInt16BE(tt*re)}let Je;if(q){let et=-1;for(Je=k;Je<me;Je++)if(Le(L,Je)===Le(C,et===-1?0:Je-et)){if(et===-1&&(et=Je),Je-et+1===Ne)return et*re}else et!==-1&&(Je-=Je-et),et=-1}else for(k+Ne>me&&(k=me-Ne),Je=k;Je>=0;Je--){let et=!0;for(let tt=0;tt<Ne;tt++)if(Le(L,Je+tt)!==Le(C,tt)){et=!1;break}if(et)return Je}return-1}c.prototype.includes=function(C,k,Y){return this.indexOf(C,k,Y)!==-1},c.prototype.indexOf=function(C,k,Y){return A(this,C,k,Y,!0)},c.prototype.lastIndexOf=function(C,k,Y){return A(this,C,k,Y,!1)};function H(L,C,k,Y){k=Number(k)||0;const q=L.length-k;Y?(Y=Number(Y),Y>q&&(Y=q)):Y=q;const re=C.length;Y>re/2&&(Y=re/2);let me;for(me=0;me<Y;++me){const Ne=parseInt(C.substr(me*2,2),16);if(at(Ne))return me;L[k+me]=Ne}return me}function _(L,C,k,Y){return We(Ye(C,L.length-k),L,k,Y)}function x(L,C,k,Y){return We(Qe(C),L,k,Y)}function z(L,C,k,Y){return We(Pe(C),L,k,Y)}function G(L,C,k,Y){return We(he(C,L.length-k),L,k,Y)}c.prototype.write=function(C,k,Y,q){if(k===void 0)q="utf8",Y=this.length,k=0;else if(Y===void 0&&typeof k=="string")q=k,Y=this.length,k=0;else if(isFinite(k))k=k>>>0,isFinite(Y)?(Y=Y>>>0,q===void 0&&(q="utf8")):(q=Y,Y=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const re=this.length-k;if((Y===void 0||Y>re)&&(Y=re),C.length>0&&(Y<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");q||(q="utf8");let me=!1;for(;;)switch(q){case"hex":return H(this,C,k,Y);case"utf8":case"utf-8":return _(this,C,k,Y);case"ascii":case"latin1":case"binary":return x(this,C,k,Y);case"base64":return z(this,C,k,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,C,k,Y);default:if(me)throw new TypeError("Unknown encoding: "+q);q=(""+q).toLowerCase(),me=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ne(L,C,k){return C===0&&k===L.length?t.fromByteArray(L):t.fromByteArray(L.slice(C,k))}function ie(L,C,k){k=Math.min(L.length,k);const Y=[];let q=C;for(;q<k;){const re=L[q];let me=null,Ne=re>239?4:re>223?3:re>191?2:1;if(q+Ne<=k){let Le,Je,et,tt;switch(Ne){case 1:re<128&&(me=re);break;case 2:Le=L[q+1],(Le&192)===128&&(tt=(re&31)<<6|Le&63,tt>127&&(me=tt));break;case 3:Le=L[q+1],Je=L[q+2],(Le&192)===128&&(Je&192)===128&&(tt=(re&15)<<12|(Le&63)<<6|Je&63,tt>2047&&(tt<55296||tt>57343)&&(me=tt));break;case 4:Le=L[q+1],Je=L[q+2],et=L[q+3],(Le&192)===128&&(Je&192)===128&&(et&192)===128&&(tt=(re&15)<<18|(Le&63)<<12|(Je&63)<<6|et&63,tt>65535&&tt<1114112&&(me=tt))}}me===null?(me=65533,Ne=1):me>65535&&(me-=65536,Y.push(me>>>10&1023|55296),me=56320|me&1023),Y.push(me),q+=Ne}return ue(Y)}const ee=4096;function ue(L){const C=L.length;if(C<=ee)return String.fromCharCode.apply(String,L);let k="",Y=0;for(;Y<C;)k+=String.fromCharCode.apply(String,L.slice(Y,Y+=ee));return k}function de(L,C,k){let Y="";k=Math.min(L.length,k);for(let q=C;q<k;++q)Y+=String.fromCharCode(L[q]&127);return Y}function ce(L,C,k){let Y="";k=Math.min(L.length,k);for(let q=C;q<k;++q)Y+=String.fromCharCode(L[q]);return Y}function X(L,C,k){const Y=L.length;(!C||C<0)&&(C=0),(!k||k<0||k>Y)&&(k=Y);let q="";for(let re=C;re<k;++re)q+=_t[L[re]];return q}function oe(L,C,k){const Y=L.slice(C,k);let q="";for(let re=0;re<Y.length-1;re+=2)q+=String.fromCharCode(Y[re]+Y[re+1]*256);return q}c.prototype.slice=function(C,k){const Y=this.length;C=~~C,k=k===void 0?Y:~~k,C<0?(C+=Y,C<0&&(C=0)):C>Y&&(C=Y),k<0?(k+=Y,k<0&&(k=0)):k>Y&&(k=Y),k<C&&(k=C);const q=this.subarray(C,k);return Object.setPrototypeOf(q,c.prototype),q};function ae(L,C,k){if(L%1!==0||L<0)throw new RangeError("offset is not uint");if(L+C>k)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(C,k,Y){C=C>>>0,k=k>>>0,Y||ae(C,k,this.length);let q=this[C],re=1,me=0;for(;++me<k&&(re*=256);)q+=this[C+me]*re;return q},c.prototype.readUintBE=c.prototype.readUIntBE=function(C,k,Y){C=C>>>0,k=k>>>0,Y||ae(C,k,this.length);let q=this[C+--k],re=1;for(;k>0&&(re*=256);)q+=this[C+--k]*re;return q},c.prototype.readUint8=c.prototype.readUInt8=function(C,k){return C=C>>>0,k||ae(C,1,this.length),this[C]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(C,k){return C=C>>>0,k||ae(C,2,this.length),this[C]|this[C+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(C,k){return C=C>>>0,k||ae(C,2,this.length),this[C]<<8|this[C+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(C,k){return C=C>>>0,k||ae(C,4,this.length),(this[C]|this[C+1]<<8|this[C+2]<<16)+this[C+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(C,k){return C=C>>>0,k||ae(C,4,this.length),this[C]*16777216+(this[C+1]<<16|this[C+2]<<8|this[C+3])},c.prototype.readBigUInt64LE=wt(function(C){C=C>>>0,ke(C,"offset");const k=this[C],Y=this[C+7];(k===void 0||Y===void 0)&&Oe(C,this.length-8);const q=k+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24,re=this[++C]+this[++C]*2**8+this[++C]*2**16+Y*2**24;return BigInt(q)+(BigInt(re)<<BigInt(32))}),c.prototype.readBigUInt64BE=wt(function(C){C=C>>>0,ke(C,"offset");const k=this[C],Y=this[C+7];(k===void 0||Y===void 0)&&Oe(C,this.length-8);const q=k*2**24+this[++C]*2**16+this[++C]*2**8+this[++C],re=this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+Y;return(BigInt(q)<<BigInt(32))+BigInt(re)}),c.prototype.readIntLE=function(C,k,Y){C=C>>>0,k=k>>>0,Y||ae(C,k,this.length);let q=this[C],re=1,me=0;for(;++me<k&&(re*=256);)q+=this[C+me]*re;return re*=128,q>=re&&(q-=Math.pow(2,8*k)),q},c.prototype.readIntBE=function(C,k,Y){C=C>>>0,k=k>>>0,Y||ae(C,k,this.length);let q=k,re=1,me=this[C+--q];for(;q>0&&(re*=256);)me+=this[C+--q]*re;return re*=128,me>=re&&(me-=Math.pow(2,8*k)),me},c.prototype.readInt8=function(C,k){return C=C>>>0,k||ae(C,1,this.length),this[C]&128?(255-this[C]+1)*-1:this[C]},c.prototype.readInt16LE=function(C,k){C=C>>>0,k||ae(C,2,this.length);const Y=this[C]|this[C+1]<<8;return Y&32768?Y|4294901760:Y},c.prototype.readInt16BE=function(C,k){C=C>>>0,k||ae(C,2,this.length);const Y=this[C+1]|this[C]<<8;return Y&32768?Y|4294901760:Y},c.prototype.readInt32LE=function(C,k){return C=C>>>0,k||ae(C,4,this.length),this[C]|this[C+1]<<8|this[C+2]<<16|this[C+3]<<24},c.prototype.readInt32BE=function(C,k){return C=C>>>0,k||ae(C,4,this.length),this[C]<<24|this[C+1]<<16|this[C+2]<<8|this[C+3]},c.prototype.readBigInt64LE=wt(function(C){C=C>>>0,ke(C,"offset");const k=this[C],Y=this[C+7];(k===void 0||Y===void 0)&&Oe(C,this.length-8);const q=this[C+4]+this[C+5]*2**8+this[C+6]*2**16+(Y<<24);return(BigInt(q)<<BigInt(32))+BigInt(k+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24)}),c.prototype.readBigInt64BE=wt(function(C){C=C>>>0,ke(C,"offset");const k=this[C],Y=this[C+7];(k===void 0||Y===void 0)&&Oe(C,this.length-8);const q=(k<<24)+this[++C]*2**16+this[++C]*2**8+this[++C];return(BigInt(q)<<BigInt(32))+BigInt(this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+Y)}),c.prototype.readFloatLE=function(C,k){return C=C>>>0,k||ae(C,4,this.length),r.read(this,C,!0,23,4)},c.prototype.readFloatBE=function(C,k){return C=C>>>0,k||ae(C,4,this.length),r.read(this,C,!1,23,4)},c.prototype.readDoubleLE=function(C,k){return C=C>>>0,k||ae(C,8,this.length),r.read(this,C,!0,52,8)},c.prototype.readDoubleBE=function(C,k){return C=C>>>0,k||ae(C,8,this.length),r.read(this,C,!1,52,8)};function Ce(L,C,k,Y,q,re){if(!c.isBuffer(L))throw new TypeError('"buffer" argument must be a Buffer instance');if(C>q||C<re)throw new RangeError('"value" argument is out of bounds');if(k+Y>L.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(C,k,Y,q){if(C=+C,k=k>>>0,Y=Y>>>0,!q){const Ne=Math.pow(2,8*Y)-1;Ce(this,C,k,Y,Ne,0)}let re=1,me=0;for(this[k]=C&255;++me<Y&&(re*=256);)this[k+me]=C/re&255;return k+Y},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(C,k,Y,q){if(C=+C,k=k>>>0,Y=Y>>>0,!q){const Ne=Math.pow(2,8*Y)-1;Ce(this,C,k,Y,Ne,0)}let re=Y-1,me=1;for(this[k+re]=C&255;--re>=0&&(me*=256);)this[k+re]=C/me&255;return k+Y},c.prototype.writeUint8=c.prototype.writeUInt8=function(C,k,Y){return C=+C,k=k>>>0,Y||Ce(this,C,k,1,255,0),this[k]=C&255,k+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(C,k,Y){return C=+C,k=k>>>0,Y||Ce(this,C,k,2,65535,0),this[k]=C&255,this[k+1]=C>>>8,k+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(C,k,Y){return C=+C,k=k>>>0,Y||Ce(this,C,k,2,65535,0),this[k]=C>>>8,this[k+1]=C&255,k+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(C,k,Y){return C=+C,k=k>>>0,Y||Ce(this,C,k,4,4294967295,0),this[k+3]=C>>>24,this[k+2]=C>>>16,this[k+1]=C>>>8,this[k]=C&255,k+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(C,k,Y){return C=+C,k=k>>>0,Y||Ce(this,C,k,4,4294967295,0),this[k]=C>>>24,this[k+1]=C>>>16,this[k+2]=C>>>8,this[k+3]=C&255,k+4};function Z(L,C,k,Y,q){De(C,Y,q,L,k,7);let re=Number(C&BigInt(4294967295));L[k++]=re,re=re>>8,L[k++]=re,re=re>>8,L[k++]=re,re=re>>8,L[k++]=re;let me=Number(C>>BigInt(32)&BigInt(4294967295));return L[k++]=me,me=me>>8,L[k++]=me,me=me>>8,L[k++]=me,me=me>>8,L[k++]=me,k}function N(L,C,k,Y,q){De(C,Y,q,L,k,7);let re=Number(C&BigInt(4294967295));L[k+7]=re,re=re>>8,L[k+6]=re,re=re>>8,L[k+5]=re,re=re>>8,L[k+4]=re;let me=Number(C>>BigInt(32)&BigInt(4294967295));return L[k+3]=me,me=me>>8,L[k+2]=me,me=me>>8,L[k+1]=me,me=me>>8,L[k]=me,k+8}c.prototype.writeBigUInt64LE=wt(function(C,k=0){return Z(this,C,k,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=wt(function(C,k=0){return N(this,C,k,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(C,k,Y,q){if(C=+C,k=k>>>0,!q){const Le=Math.pow(2,8*Y-1);Ce(this,C,k,Y,Le-1,-Le)}let re=0,me=1,Ne=0;for(this[k]=C&255;++re<Y&&(me*=256);)C<0&&Ne===0&&this[k+re-1]!==0&&(Ne=1),this[k+re]=(C/me>>0)-Ne&255;return k+Y},c.prototype.writeIntBE=function(C,k,Y,q){if(C=+C,k=k>>>0,!q){const Le=Math.pow(2,8*Y-1);Ce(this,C,k,Y,Le-1,-Le)}let re=Y-1,me=1,Ne=0;for(this[k+re]=C&255;--re>=0&&(me*=256);)C<0&&Ne===0&&this[k+re+1]!==0&&(Ne=1),this[k+re]=(C/me>>0)-Ne&255;return k+Y},c.prototype.writeInt8=function(C,k,Y){return C=+C,k=k>>>0,Y||Ce(this,C,k,1,127,-128),C<0&&(C=255+C+1),this[k]=C&255,k+1},c.prototype.writeInt16LE=function(C,k,Y){return C=+C,k=k>>>0,Y||Ce(this,C,k,2,32767,-32768),this[k]=C&255,this[k+1]=C>>>8,k+2},c.prototype.writeInt16BE=function(C,k,Y){return C=+C,k=k>>>0,Y||Ce(this,C,k,2,32767,-32768),this[k]=C>>>8,this[k+1]=C&255,k+2},c.prototype.writeInt32LE=function(C,k,Y){return C=+C,k=k>>>0,Y||Ce(this,C,k,4,2147483647,-2147483648),this[k]=C&255,this[k+1]=C>>>8,this[k+2]=C>>>16,this[k+3]=C>>>24,k+4},c.prototype.writeInt32BE=function(C,k,Y){return C=+C,k=k>>>0,Y||Ce(this,C,k,4,2147483647,-2147483648),C<0&&(C=4294967295+C+1),this[k]=C>>>24,this[k+1]=C>>>16,this[k+2]=C>>>8,this[k+3]=C&255,k+4},c.prototype.writeBigInt64LE=wt(function(C,k=0){return Z(this,C,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=wt(function(C,k=0){return N(this,C,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function O(L,C,k,Y,q,re){if(k+Y>L.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("Index out of range")}function K(L,C,k,Y,q){return C=+C,k=k>>>0,q||O(L,C,k,4),r.write(L,C,k,Y,23,4),k+4}c.prototype.writeFloatLE=function(C,k,Y){return K(this,C,k,!0,Y)},c.prototype.writeFloatBE=function(C,k,Y){return K(this,C,k,!1,Y)};function V(L,C,k,Y,q){return C=+C,k=k>>>0,q||O(L,C,k,8),r.write(L,C,k,Y,52,8),k+8}c.prototype.writeDoubleLE=function(C,k,Y){return V(this,C,k,!0,Y)},c.prototype.writeDoubleBE=function(C,k,Y){return V(this,C,k,!1,Y)},c.prototype.copy=function(C,k,Y,q){if(!c.isBuffer(C))throw new TypeError("argument should be a Buffer");if(Y||(Y=0),!q&&q!==0&&(q=this.length),k>=C.length&&(k=C.length),k||(k=0),q>0&&q<Y&&(q=Y),q===Y||C.length===0||this.length===0)return 0;if(k<0)throw new RangeError("targetStart out of bounds");if(Y<0||Y>=this.length)throw new RangeError("Index out of range");if(q<0)throw new RangeError("sourceEnd out of bounds");q>this.length&&(q=this.length),C.length-k<q-Y&&(q=C.length-k+Y);const re=q-Y;return this===C&&typeof o.prototype.copyWithin=="function"?this.copyWithin(k,Y,q):o.prototype.set.call(C,this.subarray(Y,q),k),re},c.prototype.fill=function(C,k,Y,q){if(typeof C=="string"){if(typeof k=="string"?(q=k,k=0,Y=this.length):typeof Y=="string"&&(q=Y,Y=this.length),q!==void 0&&typeof q!="string")throw new TypeError("encoding must be a string");if(typeof q=="string"&&!c.isEncoding(q))throw new TypeError("Unknown encoding: "+q);if(C.length===1){const me=C.charCodeAt(0);(q==="utf8"&&me<128||q==="latin1")&&(C=me)}}else typeof C=="number"?C=C&255:typeof C=="boolean"&&(C=Number(C));if(k<0||this.length<k||this.length<Y)throw new RangeError("Out of range index");if(Y<=k)return this;k=k>>>0,Y=Y===void 0?this.length:Y>>>0,C||(C=0);let re;if(typeof C=="number")for(re=k;re<Y;++re)this[re]=C;else{const me=c.isBuffer(C)?C:c.from(C,q),Ne=me.length;if(Ne===0)throw new TypeError('The value "'+C+'" is invalid for argument "value"');for(re=0;re<Y-k;++re)this[re+k]=me[re%Ne]}return this};const $={};function U(L,C,k){$[L]=class extends k{constructor(){super(),Object.defineProperty(this,"message",{value:C.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${L}]`,this.stack,delete this.name}get code(){return L}set code(q){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:q,writable:!0})}toString(){return`${this.name} [${L}]: ${this.message}`}}}U("ERR_BUFFER_OUT_OF_BOUNDS",function(L){return L?`${L} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),U("ERR_INVALID_ARG_TYPE",function(L,C){return`The "${L}" argument must be of type number. Received type ${typeof C}`},TypeError),U("ERR_OUT_OF_RANGE",function(L,C,k){let Y=`The value of "${L}" is out of range.`,q=k;return Number.isInteger(k)&&Math.abs(k)>2**32?q=pe(String(k)):typeof k=="bigint"&&(q=String(k),(k>BigInt(2)**BigInt(32)||k<-(BigInt(2)**BigInt(32)))&&(q=pe(q)),q+="n"),Y+=` It must be ${C}. Received ${q}`,Y},RangeError);function pe(L){let C="",k=L.length;const Y=L[0]==="-"?1:0;for(;k>=Y+4;k-=3)C=`_${L.slice(k-3,k)}${C}`;return`${L.slice(0,k)}${C}`}function Re(L,C,k){ke(C,"offset"),(L[C]===void 0||L[C+k]===void 0)&&Oe(C,L.length-(k+1))}function De(L,C,k,Y,q,re){if(L>k||L<C){const me=typeof C=="bigint"?"n":"";let Ne;throw C===0||C===BigInt(0)?Ne=`>= 0${me} and < 2${me} ** ${(re+1)*8}${me}`:Ne=`>= -(2${me} ** ${(re+1)*8-1}${me}) and < 2 ** ${(re+1)*8-1}${me}`,new $.ERR_OUT_OF_RANGE("value",Ne,L)}Re(Y,q,re)}function ke(L,C){if(typeof L!="number")throw new $.ERR_INVALID_ARG_TYPE(C,"number",L)}function Oe(L,C,k){throw Math.floor(L)!==L?(ke(L,k),new $.ERR_OUT_OF_RANGE("offset","an integer",L)):C<0?new $.ERR_BUFFER_OUT_OF_BOUNDS:new $.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${C}`,L)}const Be=/[^+/0-9A-Za-z-_]/g;function Se(L){if(L=L.split("=")[0],L=L.trim().replace(Be,""),L.length<2)return"";for(;L.length%4!==0;)L=L+"=";return L}function Ye(L,C){C=C||1/0;let k;const Y=L.length;let q=null;const re=[];for(let me=0;me<Y;++me){if(k=L.charCodeAt(me),k>55295&&k<57344){if(!q){if(k>56319){(C-=3)>-1&&re.push(239,191,189);continue}else if(me+1===Y){(C-=3)>-1&&re.push(239,191,189);continue}q=k;continue}if(k<56320){(C-=3)>-1&&re.push(239,191,189),q=k;continue}k=(q-55296<<10|k-56320)+65536}else q&&(C-=3)>-1&&re.push(239,191,189);if(q=null,k<128){if((C-=1)<0)break;re.push(k)}else if(k<2048){if((C-=2)<0)break;re.push(k>>6|192,k&63|128)}else if(k<65536){if((C-=3)<0)break;re.push(k>>12|224,k>>6&63|128,k&63|128)}else if(k<1114112){if((C-=4)<0)break;re.push(k>>18|240,k>>12&63|128,k>>6&63|128,k&63|128)}else throw new Error("Invalid code point")}return re}function Qe(L){const C=[];for(let k=0;k<L.length;++k)C.push(L.charCodeAt(k)&255);return C}function he(L,C){let k,Y,q;const re=[];for(let me=0;me<L.length&&!((C-=2)<0);++me)k=L.charCodeAt(me),Y=k>>8,q=k%256,re.push(q),re.push(Y);return re}function Pe(L){return t.toByteArray(Se(L))}function We(L,C,k,Y){let q;for(q=0;q<Y&&!(q+k>=C.length||q>=L.length);++q)C[q+k]=L[q];return q}function Xe(L,C){return L instanceof C||L!=null&&L.constructor!=null&&L.constructor.name!=null&&L.constructor.name===C.name}function at(L){return L!==L}const _t=(function(){const L="0123456789abcdef",C=new Array(256);for(let k=0;k<16;++k){const Y=k*16;for(let q=0;q<16;++q)C[Y+q]=L[k]+L[q]}return C})();function wt(L){return typeof BigInt>"u"?Qt:L}function Qt(){throw new Error("BigInt not supported")}})(ym);const Dn=ym.Buffer;var sc,bm;function wm(){return bm||(bm=1,sc=typeof ve=="object"&&ve.env&&ve.env.NODE_DEBUG&&/\bsemver\b/i.test(ve.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),sc}var ac,Sm;function Em(){if(Sm)return ac;Sm=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,i=t-6;return ac={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},ac}var Ls={exports:{}},Tm;function xR(){return Tm||(Tm=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Em(),o=wm();t=e.exports={};const s=t.re=[],a=t.safeRe=[],l=t.src=[],u=t.safeSrc=[],c=t.t={};let d=0;const f="[a-zA-Z0-9-]",m=[["\\s",1],["\\d",i],[f,n]],w=E=>{for(const[b,g]of m)E=E.split(`${b}*`).join(`${b}{0,${g}}`).split(`${b}+`).join(`${b}{1,${g}}`);return E},v=(E,b,g)=>{const y=w(b),p=d++;o(E,p,b),c[E]=p,l[p]=b,u[p]=y,s[p]=new RegExp(b,g?"g":void 0),a[p]=new RegExp(y,g?"g":void 0)};v("NUMERICIDENTIFIER","0|[1-9]\\d*"),v("NUMERICIDENTIFIERLOOSE","\\d+"),v("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),v("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),v("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASEIDENTIFIER",`(?:${l[c.NONNUMERICIDENTIFIER]}|${l[c.NUMERICIDENTIFIER]})`),v("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NONNUMERICIDENTIFIER]}|${l[c.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),v("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),v("BUILDIDENTIFIER",`${f}+`),v("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),v("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),v("FULL",`^${l[c.FULLPLAIN]}$`),v("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),v("LOOSE",`^${l[c.LOOSEPLAIN]}$`),v("GTLT","((?:<|>)?=?)"),v("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),v("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),v("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),v("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),v("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),v("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),v("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),v("COERCE",`${l[c.COERCEPLAIN]}(?:$|[^\\d])`),v("COERCEFULL",l[c.COERCEPLAIN]+`(?:${l[c.PRERELEASE]})?(?:${l[c.BUILD]})?(?:$|[^\\d])`),v("COERCERTL",l[c.COERCE],!0),v("COERCERTLFULL",l[c.COERCEFULL],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",v("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),v("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),v("LONECARET","(?:\\^)"),v("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",v("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),v("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),v("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),v("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),v("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),v("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Ls,Ls.exports)),Ls.exports}var lc,Am;function NR(){if(Am)return lc;Am=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return lc=n=>n?typeof n!="object"?e:n:t,lc}var cc,Rm;function DR(){if(Rm)return cc;Rm=1;const e=/^[0-9]+$/,t=(n,i)=>{const o=e.test(n),s=e.test(i);return o&&s&&(n=+n,i=+i),n===i?0:o&&!s?-1:s&&!o?1:n<i?-1:1};return cc={compareIdentifiers:t,rcompareIdentifiers:(n,i)=>t(i,n)},cc}var uc,Cm;function Im(){if(Cm)return uc;Cm=1;const e=wm(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=Em(),{safeRe:n,t:i}=xR(),o=NR(),{compareIdentifiers:s}=DR();class a{constructor(u,c){if(c=o(c),u instanceof a){if(u.loose===!!c.loose&&u.includePrerelease===!!c.includePrerelease)return u;u=u.version}else if(typeof u!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof u}".`);if(u.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",u,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const d=u.trim().match(c.loose?n[i.LOOSE]:n[i.FULL]);if(!d)throw new TypeError(`Invalid Version: ${u}`);if(this.raw=u,this.major=+d[1],this.minor=+d[2],this.patch=+d[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");d[4]?this.prerelease=d[4].split(".").map(f=>{if(/^[0-9]+$/.test(f)){const m=+f;if(m>=0&&m<r)return m}return f}):this.prerelease=[],this.build=d[5]?d[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(u){if(e("SemVer.compare",this.version,this.options,u),!(u instanceof a)){if(typeof u=="string"&&u===this.version)return 0;u=new a(u,this.options)}return u.version===this.version?0:this.compareMain(u)||this.comparePre(u)}compareMain(u){return u instanceof a||(u=new a(u,this.options)),s(this.major,u.major)||s(this.minor,u.minor)||s(this.patch,u.patch)}comparePre(u){if(u instanceof a||(u=new a(u,this.options)),this.prerelease.length&&!u.prerelease.length)return-1;if(!this.prerelease.length&&u.prerelease.length)return 1;if(!this.prerelease.length&&!u.prerelease.length)return 0;let c=0;do{const d=this.prerelease[c],f=u.prerelease[c];if(e("prerelease compare",c,d,f),d===void 0&&f===void 0)return 0;if(f===void 0)return 1;if(d===void 0)return-1;if(d===f)continue;return s(d,f)}while(++c)}compareBuild(u){u instanceof a||(u=new a(u,this.options));let c=0;do{const d=this.build[c],f=u.build[c];if(e("build compare",c,d,f),d===void 0&&f===void 0)return 0;if(f===void 0)return 1;if(d===void 0)return-1;if(d===f)continue;return s(d,f)}while(++c)}inc(u,c,d){if(u.startsWith("pre")){if(!c&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(c){const f=`-${c}`.match(this.options.loose?n[i.PRERELEASELOOSE]:n[i.PRERELEASE]);if(!f||f[1]!==c)throw new Error(`invalid identifier: ${c}`)}}switch(u){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",c,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",c,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",c,d),this.inc("pre",c,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",c,d),this.inc("pre",c,d);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const f=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[f];else{let m=this.prerelease.length;for(;--m>=0;)typeof this.prerelease[m]=="number"&&(this.prerelease[m]++,m=-2);if(m===-1){if(c===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(f)}}if(c){let m=[c,f];d===!1&&(m=[c]),s(this.prerelease[0],c)===0?isNaN(this.prerelease[1])&&(this.prerelease=m):this.prerelease=m}break}default:throw new Error(`invalid increment argument: ${u}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return uc=a,uc}var fc,_m;function $R(){if(_m)return fc;_m=1;const e=Im();return fc=(r,n)=>new e(r,n).major,fc}var LR=$R();const Om=Cl(LR);var dc,Pm;function MR(){if(Pm)return dc;Pm=1;const e=Im();return dc=(r,n,i)=>new e(r,i).compare(new e(n,i)),dc}var pc,km;function BR(){if(km)return pc;km=1;const e=MR();return pc=(r,n,i)=>e(n,r,i),pc}var jR=BR();const UR=Cl(jR);class Ii extends Error{name="RuntimeError";constructor(t,...r){super([t,...r].filter(Boolean).join(", ")),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class qR extends Ii{name="ApiError"}const hc=(e,t)=>{const r=document.createElement("a");r.style.display="none",document.body.appendChild(r),r.href=e,r.setAttribute("download",t),r.click(),document.body.removeChild(r)};class VR{clientService;userStore;serverUrl;capability;available;fileIdsSupported;constructor(t,r,n,i=le([])){this.clientService=t,this.userStore=r,this.serverUrl=n,this.capability=B(()=>{const o=h(i).filter(s=>s.enabled).sort((s,a)=>UR(s.version,a.version));return o.length?o[0]:null}),this.available=B(()=>!!h(this.capability)?.version),this.fileIdsSupported=B(()=>Om(h(this.capability)?.version)>=2)}async triggerDownload(t){if(!h(this.available))throw new Ii("no archiver available");if((t.fileIds?.length||0)+(t.files?.length||0)===0)throw new Ii("requested archive with empty list of resources");const r=this.buildDownloadUrl({...t});if(!r)throw new Ii("download url could not be built");const n=t.publicToken?r:await this.clientService.ocsUserContext.signUrl(r,this.userStore.user?.onPremisesSamAccountName);try{const i=await fetch(n,{headers:{...this.clientService.getRequestHeaders({useAuth:!t.publicLinkPassword}),...!!t.publicLinkPassword&&{Authorization:"Basic "+Dn.from(["public",t.publicLinkPassword].join(":")).toString("base64")}}});if(!i.ok)throw new te.HttpError("",i);const o=await i.blob(),s=URL.createObjectURL(o),a=this.getFileNameFromResponseHeaders(i.headers);return hc(s,a),n}catch(i){throw new te.HttpError("archive could not be fetched",i.response)}}buildDownloadUrl(t){const r=[];switch(t.publicToken&&r.push(`public-token=${t.publicToken}`),Om(h(this.capability).version)){case 2:return r.push(...t.fileIds.map(i=>`id=${i}`)),this.url+"?"+r.join("&");case 1:{const i=Math.random().toString(36).substring(2);return r.push(`dir=${encodeURIComponent(t.dir)}`,...t.files.map(o=>`files[]=${encodeURIComponent(o)}`),`downloadStartSecret=${i}`),this.url+"?"+r.join("&")}default:return}}get url(){if(!this.available)throw new Ii("no archiver available");const t=h(this.capability);return/^https?:\/\//i.test(t.archiver_url)?t.archiver_url:te.urlJoin(this.serverUrl,t.archiver_url)}getFileNameFromResponseHeaders(t){const r=t.get("content-disposition")?.split('"')[1];return decodeURI(r)}}const zR=new Yl({ttl:10*1e3,capacity:250}),WR=new Yl({ttl:10*1e3,capacity:250});class HR{get avatarUrl(){return WR}get filePreview(){return zR}}const mc=new HR;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 "+Dn.from(["public",this.publicLinkPassword].join(":")).toString("base64")},...this.accessToken&&!this.publicLinkPassword&&!this.publicLinkToken&&{Authorization:"Bearer "+this.accessToken}}}}class yc{instance;cancelToken;constructor(t,r){this.cancelToken=Xo.CancelToken.source(),this.instance=Xo.create(t),r&&this.instance.interceptors.request.use(r)}cancel(t){this.cancelToken.cancel(t)}async delete(t,r,n){return await this.internalRequestWithData("delete",t,r,n)}get(t,r){return this.internalRequest("get",t,r)}head(t,r){return this.internalRequest("head",t,r)}options(t,r){return this.internalRequest("options",t,r)}patch(t,r,n){return this.internalRequestWithData("patch",t,r,n)}post(t,r,n){return this.internalRequestWithData("post",t,r,n)}put(t,r,n){return this.internalRequestWithData("put",t,r,n)}async request(t){const r=await this.instance.request(this.obtainConfig(t));return this.processResponse(r,t)}obtainConfig(t){return po({cancelToken:this.cancelToken.token},t)}processResponse(t,r){if(r?.schema){const n=r.schema.parse(t.data);return{...t,data:n}}return t}async internalRequest(t,r,n){const i=await this.instance[t](r,this.obtainConfig(n));return this.processResponse(i,n)}async internalRequestWithData(t,r,n,i){const o=await this.instance[t](r,n,this.obtainConfig(i));return this.processResponse(o,i)}}class GR extends Error{name="RetriableError"}const KR=15e3;class QR{url;fetchOptions;abortController;eventListenerMap;readyState;withCredentials;CONNECTING;OPEN;CLOSED;onerror;onmessage;onopen;constructor(t,r){this.url=t,this.fetchOptions=r,this.abortController=new AbortController,this.eventListenerMap={},this.readyState=this.CONNECTING,this.connect()}connect(){return bS.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 r=new MessageEvent("message",{data:t.data});this.onmessage?.bind(this)(r);const n=t.event;this.eventListenerMap[n]?.forEach(o=>o(r))},onclose:()=>{throw this.readyState=this.CLOSED,new GR},onerror:t=>{console.error(t);const r=new CustomEvent("error",{detail:t});return this.onerror?.bind(this)(r),3e4+Math.floor(Math.random()*KR)}})}fetchProvider(...t){const[r,n]=t,i={...n,...this.fetchOptions};return window.fetch(r,i)}close(){this.abortController.abort("closed")}addEventListener(t,r){this.eventListenerMap[t]=this.eventListenerMap[t]||[],this.eventListenerMap[t].push(r)}removeEventListener(t,r){this.eventListenerMap[t]=this.eventListenerMap[t]?.filter(n=>n!==r)}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 XR=(e,t)=>(vc||(vc=new QR(new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse",e).href,t)),vc),YR=(e,t)=>({headers:{Authorization:`Bearer ${e.accessToken}`,"Accept-Language":t,"X-Request-ID":Xt.v4(),"X-Requested-With":"XMLHttpRequest"}});class JR{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},r=>(Object.assign(r.headers,this.getDynamicHeaders()),r)),this.httpUnAuthenticatedClient=new yc({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},r=>(Object.assign(r.headers,this.getDynamicHeaders({useAuth:!1})),r))}get httpAuthenticated(){return this.httpAuthenticatedClient}get httpUnAuthenticated(){return this.httpUnAuthenticatedClient}get graphAuthenticated(){return this.graphClient}get sseAuthenticated(){return XR(this.configStore.serverUrl,YR({accessToken:this.authStore.accessToken},this.currentLanguage))}get ocs(){return this.ocsClient}get ocsUserContext(){return this.ocs}ocsPublicLinkContext(t){return this.ocs}get webdav(){return this.webDavClient}get currentLanguage(){return this.language.current}getRequestHeaders=({useAuth:t=!0}={})=>({...this.staticHeaders,...this.getDynamicHeaders({useAuth:t})});initGraphClient(){const t=Xo.create({headers:this.staticHeaders});t.interceptors.request.use(r=>(Object.assign(r.headers,this.getDynamicHeaders()),r)),this.graphClient=te.graph(this.configStore.serverUrl,t)}initOcsClient(){const t=Xo.create({headers:this.staticHeaders});t.interceptors.request.use(r=>(Object.assign(r.headers,this.getDynamicHeaders()),r)),this.ocsClient=te.ocs(this.configStore.serverUrl,t)}initWebDavClient(){this.webDavClient=te.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 "+Dn.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 Fm{topics;constructor(){this.topics=new Map}subscribe(t,r){const n={token:Xt.v4(),callback:r},i=[n,...this.topics.get(t)||[]];return this.topics.set(t,i),n.token}publish(t,r){(this.topics.get(t)||[]).forEach(i=>i.callback(r))}unsubscribe(t,r){this.topics.has(t)&&this.topics.set(t,this.topics.get(t).filter(n=>n.token!==r))}}const ze=new Fm;class xm{isEnabled(){return!0}isActive(t){return gt(t,"files-spaces-projects")?!1:gt(t,"files-spaces-generic")||Rr(t,"files-public-link")}getTask(t){const{router:r,clientService:n,resourcesStore:i,authService:o,spacesStore:s,sharesStore:a,configStore:l}=t,{webdav:u,graphAuthenticated:c}=n,{replaceInvalidFileRoute:d}=da({router:r});return or.useTask(function*(f,m,w,v=null,E=null,b={}){try{i.clearResourceList();let{resource:g,children:y}=yield*te.call(u.listFiles(w,{path:v,fileId:E},{signal:f}));g.id&&d({space:w,resource:g,path:v,fileId:E});let p;v==="/"&&(te.isShareSpaceResource(w)?(p=yield*te.call(Ns({graphClient:c,spacesStore:s,space:w,signal:f})),p&&(g=te.buildIncomingShareResource({graphRoles:a.graphRoles,driveItem:p,serverUrl:l.serverUrl}))):!te.isPersonalSpaceResource(w)&&!te.isPublicSpaceResource(w)&&(g=w)),yield i.loadAncestorMetaData({folder:g,space:w,client:u,signal:f}),te.isProjectSpaceResource(w)&&(yield s.loadGraphPermissions({ids:[w.id],graphClient:c})),te.isShareSpaceResource(w)&&(y.forEach(S=>S.remoteItemId=w.id),w.graphPermissions===void 0&&(p||(p=yield*te.call(Ns({graphClient:c,spacesStore:s,space:w,signal:f}))),om({sharesStore:a,spacesStore:s,space:w,sharedDriveItem:p}))),i.initResourceList({currentFolder:g,resources:y})}catch(g){if(i.setCurrentFolder(null),console.error(g),g.statusCode===401)return o.handleAuthError(h(r.currentRoute))}}).restartable()}}class Nm{isEnabled(){return!0}isActive(t){const r=h(t.currentRoute);return It(t,"files-common-favorites")||r?.query?.contextRouteName==="files-common-favorites"}getTask(t){const{resourcesStore:r,clientService:n,userStore:i}=t;return or.useTask(function*(o,s){r.clearResourceList(),r.setAncestorMetaData({});let a=yield n.webdav.listFavoriteFiles({username:i.user?.onPremisesSamAccountName,signal:o});a=a.map(te.buildResource),r.initResourceList({currentFolder:null,resources:a})})}}class Dm{isEnabled(){return!0}isActive(t){const r=h(t.currentRoute);return Lt(t,"files-shares-via-link")||r?.query?.contextRouteName==="files-shares-via-link"}getTask(t){const{userStore:r,spacesStore:n,clientService:i,configStore:o,resourcesStore:s}=t;return or.useTask(function*(a,l){s.clearResourceList(),s.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:i.graphAuthenticated,signal:a}));const c=(yield*te.call(i.graphAuthenticated.driveItems.listSharedByMe({expand:new Set(["thumbnails"])},{signal:a}))).filter(d=>d.permissions.some(({link:f})=>!!f)).map(d=>te.buildOutgoingShareResource({driveItem:d,user:r.user,serverUrl:o.serverUrl}));s.initResourceList({currentFolder:null,resources:c})})}}class $m{isEnabled(){return!0}isActive(t){const r=h(t.currentRoute);return Lt(t,"files-shares-with-me")||r?.query?.contextRouteName==="files-shares-with-me"}getTask(t){const{spacesStore:r,clientService:n,configStore:i,resourcesStore:o,sharesStore:s}=t;return or.useTask(function*(a,l){o.clearResourceList(),o.setAncestorMetaData({}),i.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:n.graphAuthenticated,signal:a}));const c=(yield*te.call(n.graphAuthenticated.driveItems.listSharedWithMe({expand:new Set(["thumbnails"])},{signal:a}))).map(d=>te.buildIncomingShareResource({driveItem:d,graphRoles:s.graphRoles,serverUrl:i.serverUrl}));o.initResourceList({currentFolder:null,resources:c})})}}class Lm{isEnabled(){return!0}isActive(t){const r=h(t.currentRoute);return Lt(t,"files-shares-with-others")||r?.query?.contextRouteName==="files-shares-with-others"}getTask(t){const{userStore:r,spacesStore:n,clientService:i,configStore:o,resourcesStore:s}=t;return or.useTask(function*(a,l){s.clearResourceList(),s.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:i.graphAuthenticated,signal:a}));const c=(yield*te.call(i.graphAuthenticated.driveItems.listSharedByMe({expand:new Set(["thumbnails"])},{signal:a}))).filter(d=>d.permissions.some(({link:f})=>!f)).map(d=>te.buildOutgoingShareResource({driveItem:d,user:r.user,serverUrl:o.serverUrl}));s.initResourceList({currentFolder:null,resources:c})})}}class Mm{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 Ms=e=>({value:e,type:null}),ZR=e=>Ms(e),yt=e=>Ms(e),Bs=e=>Ms(e),eC=e=>Ms(e),tC={Permissions:yt("permissions"),IsFavorite:Bs("favorite"),FileId:yt("fileid"),FileParent:yt("file-parent"),Name:yt("name"),OwnerId:yt("owner-id"),OwnerDisplayName:yt("owner-display-name"),PrivateLink:yt("privatelink"),ContentLength:Bs("getcontentlength"),ContentSize:Bs("size"),LastModifiedDate:yt("getlastmodified"),Tags:ZR("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:yt("getetag"),MimeType:yt("getcontenttype"),ResourceType:eC("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:yt("owner"),LockTime:yt("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:yt("downloadURL"),Highlights:yt("highlights"),MetaPathForUser:yt("meta-path-for-user"),RemoteItemId:yt("remote-item-id"),HasPreview:Bs("has-preview"),ShareId:yt("shareid"),ShareRoot:yt("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:yt("share-permissions"),TrashbinOriginalFilename:yt("trashbin-original-filename"),TrashbinOriginalLocation:yt("trashbin-original-location"),TrashbinDeletedDate:yt("trashbin-delete-datetime"),PublicLinkItemType:yt("public-link-item-type"),PublicLinkPermission:yt("public-link-permission"),PublicLinkExpiration:yt("public-link-expiration"),PublicLinkShareDate:yt("public-link-share-datetime"),PublicLinkShareOwner:yt("public-link-share-owner")},Me=Object.fromEntries(Object.entries(tC).map(([e,t])=>[e,t.value]));class js{static Default=[Me.Permissions,Me.IsFavorite,Me.FileId,Me.FileParent,Me.Name,Me.LockDiscovery,Me.ActiveLock,Me.OwnerId,Me.OwnerDisplayName,Me.RemoteItemId,Me.ShareRoot,Me.ShareTypes,Me.PrivateLink,Me.ContentLength,Me.ContentSize,Me.LastModifiedDate,Me.ETag,Me.MimeType,Me.ResourceType,Me.DownloadURL,Me.Tags,Me.Audio,Me.Location,Me.Image,Me.Photo,Me.HasPreview];static PublicLink=js.Default.concat([Me.PublicLinkItemType,Me.PublicLinkPermission,Me.PublicLinkExpiration,Me.PublicLinkShareDate,Me.PublicLinkShareOwner]);static Trashbin=[Me.ContentLength,Me.ResourceType,Me.TrashbinOriginalLocation,Me.TrashbinOriginalFilename,Me.TrashbinDeletedDate,Me.Permissions,Me.FileParent];static DavNamespace=[Me.ContentLength,Me.LastModifiedDate,Me.ETag,Me.MimeType,Me.ResourceType,Me.LockDiscovery,Me.ActiveLock]}var bc={},Us={exports:{}},Bm;function wc(){if(Bm)return Us.exports;Bm=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(S,T,R){return Function.prototype.apply.call(S,T,R)},r;e&&typeof e.ownKeys=="function"?r=e.ownKeys:Object.getOwnPropertySymbols?r=function(S){return Object.getOwnPropertyNames(S).concat(Object.getOwnPropertySymbols(S))}:r=function(S){return Object.getOwnPropertyNames(S)};function n(p){console&&console.warn&&console.warn(p)}var i=Number.isNaN||function(S){return S!==S};function o(){o.init.call(this)}Us.exports=o,Us.exports.once=b,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(p){if(typeof p!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof p)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(p){if(typeof p!="number"||p<0||i(p))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+p+".");s=p}}),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(S){if(typeof S!="number"||S<0||i(S))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+S+".");return this._maxListeners=S,this};function l(p){return p._maxListeners===void 0?o.defaultMaxListeners:p._maxListeners}o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(S){for(var T=[],R=1;R<arguments.length;R++)T.push(arguments[R]);var I=S==="error",A=this._events;if(A!==void 0)I=I&&A.error===void 0;else if(!I)return!1;if(I){var D;if(T.length>0&&(D=T[0]),D instanceof Error)throw D;var H=new Error("Unhandled error."+(D?" ("+D.message+")":""));throw H.context=D,H}var _=A[S];if(_===void 0)return!1;if(typeof _=="function")t(_,this,T);else for(var x=_.length,z=w(_,x),R=0;R<x;++R)t(z[R],this,T);return!0};function u(p,S,T,R){var I,A,D;if(a(T),A=p._events,A===void 0?(A=p._events=Object.create(null),p._eventsCount=0):(A.newListener!==void 0&&(p.emit("newListener",S,T.listener?T.listener:T),A=p._events),D=A[S]),D===void 0)D=A[S]=T,++p._eventsCount;else if(typeof D=="function"?D=A[S]=R?[T,D]:[D,T]:R?D.unshift(T):D.push(T),I=l(p),I>0&&D.length>I&&!D.warned){D.warned=!0;var H=new Error("Possible EventEmitter memory leak detected. "+D.length+" "+String(S)+" listeners added. Use emitter.setMaxListeners() to increase limit");H.name="MaxListenersExceededWarning",H.emitter=p,H.type=S,H.count=D.length,n(H)}return p}o.prototype.addListener=function(S,T){return u(this,S,T,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(S,T){return u(this,S,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 d(p,S,T){var R={fired:!1,wrapFn:void 0,target:p,type:S,listener:T},I=c.bind(R);return I.listener=T,R.wrapFn=I,I}o.prototype.once=function(S,T){return a(T),this.on(S,d(this,S,T)),this},o.prototype.prependOnceListener=function(S,T){return a(T),this.prependListener(S,d(this,S,T)),this},o.prototype.removeListener=function(S,T){var R,I,A,D,H;if(a(T),I=this._events,I===void 0)return this;if(R=I[S],R===void 0)return this;if(R===T||R.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete I[S],I.removeListener&&this.emit("removeListener",S,R.listener||T));else if(typeof R!="function"){for(A=-1,D=R.length-1;D>=0;D--)if(R[D]===T||R[D].listener===T){H=R[D].listener,A=D;break}if(A<0)return this;A===0?R.shift():v(R,A),R.length===1&&(I[S]=R[0]),I.removeListener!==void 0&&this.emit("removeListener",S,H||T)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(S){var T,R,I;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[S]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete R[S]),this;if(arguments.length===0){var A=Object.keys(R),D;for(I=0;I<A.length;++I)D=A[I],D!=="removeListener"&&this.removeAllListeners(D);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=R[S],typeof T=="function")this.removeListener(S,T);else if(T!==void 0)for(I=T.length-1;I>=0;I--)this.removeListener(S,T[I]);return this};function f(p,S,T){var R=p._events;if(R===void 0)return[];var I=R[S];return I===void 0?[]:typeof I=="function"?T?[I.listener||I]:[I]:T?E(I):w(I,I.length)}o.prototype.listeners=function(S){return f(this,S,!0)},o.prototype.rawListeners=function(S){return f(this,S,!1)},o.listenerCount=function(p,S){return typeof p.listenerCount=="function"?p.listenerCount(S):m.call(p,S)},o.prototype.listenerCount=m;function m(p){var S=this._events;if(S!==void 0){var T=S[p];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function w(p,S){for(var T=new Array(S),R=0;R<S;++R)T[R]=p[R];return T}function v(p,S){for(;S+1<p.length;S++)p[S]=p[S+1];p.pop()}function E(p){for(var S=new Array(p.length),T=0;T<S.length;++T)S[T]=p[T].listener||p[T];return S}function b(p,S){return new Promise(function(T,R){function I(D){p.removeListener(S,A),R(D)}function A(){typeof p.removeListener=="function"&&p.removeListener("error",I),T([].slice.call(arguments))}y(p,S,A,{once:!0}),S!=="error"&&g(p,I,{once:!0})})}function g(p,S,T){typeof p.on=="function"&&y(p,"error",S,T)}function y(p,S,T,R){if(typeof p.on=="function")R.once?p.once(S,T):p.on(S,T);else if(typeof p.addEventListener=="function")p.addEventListener(S,function I(A){R.once&&p.removeEventListener(S,I),T(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof p)}return Us.exports}var qs={exports:{}},jm;function Yn(){return jm||(jm=1,typeof Object.create=="function"?qs.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:qs.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}}),qs.exports}var Sc,Um;function qm(){return Um||(Um=1,Sc=wc().EventEmitter),Sc}var Ec={},Vm;function Vs(){return Vm||(Vm=1,(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},r={};r.byteLength=c,r.toByteArray=f,r.fromByteArray=v;for(var n=[],i=[],o=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a<l;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;i[45]=62,i[95]=63;function u(g){var y=g.length;if(y%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var p=g.indexOf("=");p===-1&&(p=y);var S=p===y?0:4-p%4;return[p,S]}function c(g){var y=u(g),p=y[0],S=y[1];return(p+S)*3/4-S}function d(g,y,p){return(y+p)*3/4-p}function f(g){var y,p=u(g),S=p[0],T=p[1],R=new o(d(g,S,T)),I=0,A=T>0?S-4:S,D;for(D=0;D<A;D+=4)y=i[g.charCodeAt(D)]<<18|i[g.charCodeAt(D+1)]<<12|i[g.charCodeAt(D+2)]<<6|i[g.charCodeAt(D+3)],R[I++]=y>>16&255,R[I++]=y>>8&255,R[I++]=y&255;return T===2&&(y=i[g.charCodeAt(D)]<<2|i[g.charCodeAt(D+1)]>>4,R[I++]=y&255),T===1&&(y=i[g.charCodeAt(D)]<<10|i[g.charCodeAt(D+1)]<<4|i[g.charCodeAt(D+2)]>>2,R[I++]=y>>8&255,R[I++]=y&255),R}function m(g){return n[g>>18&63]+n[g>>12&63]+n[g>>6&63]+n[g&63]}function w(g,y,p){for(var S,T=[],R=y;R<p;R+=3)S=(g[R]<<16&16711680)+(g[R+1]<<8&65280)+(g[R+2]&255),T.push(m(S));return T.join("")}function v(g){for(var y,p=g.length,S=p%3,T=[],R=16383,I=0,A=p-S;I<A;I+=R)T.push(w(g,I,I+R>A?A:I+R));return S===1?(y=g[p-1],T.push(n[y>>2]+n[y<<4&63]+"==")):S===2&&(y=(g[p-2]<<8)+g[p-1],T.push(n[y>>10]+n[y>>4&63]+n[y<<2&63]+"=")),T.join("")}var E={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */E.read=function(g,y,p,S,T){var R,I,A=T*8-S-1,D=(1<<A)-1,H=D>>1,_=-7,x=p?T-1:0,z=p?-1:1,G=g[y+x];for(x+=z,R=G&(1<<-_)-1,G>>=-_,_+=A;_>0;R=R*256+g[y+x],x+=z,_-=8);for(I=R&(1<<-_)-1,R>>=-_,_+=S;_>0;I=I*256+g[y+x],x+=z,_-=8);if(R===0)R=1-H;else{if(R===D)return I?NaN:(G?-1:1)*(1/0);I=I+Math.pow(2,S),R=R-H}return(G?-1:1)*I*Math.pow(2,R-S)},E.write=function(g,y,p,S,T,R){var I,A,D,H=R*8-T-1,_=(1<<H)-1,x=_>>1,z=T===23?Math.pow(2,-24)-Math.pow(2,-77):0,G=S?0:R-1,ne=S?1:-1,ie=y<0||y===0&&1/y<0?1:0;for(y=Math.abs(y),isNaN(y)||y===1/0?(A=isNaN(y)?1:0,I=_):(I=Math.floor(Math.log(y)/Math.LN2),y*(D=Math.pow(2,-I))<1&&(I--,D*=2),I+x>=1?y+=z/D:y+=z*Math.pow(2,1-x),y*D>=2&&(I++,D/=2),I+x>=_?(A=0,I=_):I+x>=1?(A=(y*D-1)*Math.pow(2,T),I=I+x):(A=y*Math.pow(2,x-1)*Math.pow(2,T),I=0));T>=8;g[p+G]=A&255,G+=ne,A/=256,T-=8);for(I=I<<T|A,H+=T;H>0;g[p+G]=I&255,G+=ne,I/=256,H-=8);g[p+G-ne]|=ie*128};/*!
12
12
  * The buffer module from node.js, for the browser.
13
13
  *
14
14
  * @author Feross Aboukhadijeh <https://feross.org>
15
15
  * @license MIT
16
- */(function(g){const v=n,h=E,S=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;g.Buffer=N,g.SlowBuffer=ne,g.INSPECT_MAX_BYTES=50;const T=2147483647;g.kMaxLength=T;const{Uint8Array:I,ArrayBuffer:_,SharedArrayBuffer:A}=globalThis;N.TYPED_ARRAY_SUPPORT=$(),!N.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 $(){try{const U=new I(1),P={foo:function(){return 42}};return Object.setPrototypeOf(P,I.prototype),Object.setPrototypeOf(U,P),U.foo()===42}catch{return!1}}Object.defineProperty(N.prototype,"parent",{enumerable:!0,get:function(){if(N.isBuffer(this))return this.buffer}}),Object.defineProperty(N.prototype,"offset",{enumerable:!0,get:function(){if(N.isBuffer(this))return this.byteOffset}});function D(U){if(U>T)throw new RangeError('The value "'+U+'" is invalid for option "size"');const P=new I(U);return Object.setPrototypeOf(P,N.prototype),P}function N(U,P,k){if(typeof U=="number"){if(typeof P=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ae(U)}return x(U,P,k)}N.poolSize=8192;function x(U,P,k){if(typeof U=="string")return ye(U,P);if(_.isView(U))return te(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(jn(U,_)||U&&jn(U.buffer,_)||typeof A<"u"&&(jn(U,A)||U&&jn(U.buffer,A)))return ce(U,P,k);if(typeof U=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Y=U.valueOf&&U.valueOf();if(Y!=null&&Y!==U)return N.from(Y,P,k);const ie=oe(U);if(ie)return ie;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof U[Symbol.toPrimitive]=="function")return N.from(U[Symbol.toPrimitive]("string"),P,k);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U)}N.from=function(U,P,k){return x(U,P,k)},Object.setPrototypeOf(N.prototype,I.prototype),Object.setPrototypeOf(N,I);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 G(U,P,k){return V(U),U<=0?D(U):P!==void 0?typeof k=="string"?D(U).fill(P,k):D(U).fill(P):D(U)}N.alloc=function(U,P,k){return G(U,P,k)};function ae(U){return V(U),D(U<0?0:J(U)|0)}N.allocUnsafe=function(U){return ae(U)},N.allocUnsafeSlow=function(U){return ae(U)};function ye(U,P){if((typeof P!="string"||P==="")&&(P="utf8"),!N.isEncoding(P))throw new TypeError("Unknown encoding: "+P);const k=se(U,P)|0;let Y=D(k);const ie=Y.write(U,P);return ie!==k&&(Y=Y.slice(0,ie)),Y}function ue(U){const P=U.length<0?0:J(U.length)|0,k=D(P);for(let Y=0;Y<P;Y+=1)k[Y]=U[Y]&255;return k}function te(U){if(jn(U,I)){const P=new I(U);return ce(P.buffer,P.byteOffset,P.byteLength)}return ue(U)}function ce(U,P,k){if(P<0||U.byteLength<P)throw new RangeError('"offset" is outside of buffer bounds');if(U.byteLength<P+(k||0))throw new RangeError('"length" is outside of buffer bounds');let Y;return P===void 0&&k===void 0?Y=new I(U):k===void 0?Y=new I(U,P):Y=new I(U,P,k),Object.setPrototypeOf(Y,N.prototype),Y}function oe(U){if(N.isBuffer(U)){const P=J(U.length)|0,k=D(P);return k.length===0||U.copy(k,0,0,P),k}if(U.length!==void 0)return typeof U.length!="number"||$e(U.length)?D(0):ue(U);if(U.type==="Buffer"&&Array.isArray(U.data))return ue(U.data)}function J(U){if(U>=T)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+T.toString(16)+" bytes");return U|0}function ne(U){return+U!=U&&(U=0),N.alloc(+U)}N.isBuffer=function(P){return P!=null&&P._isBuffer===!0&&P!==N.prototype},N.compare=function(P,k){if(jn(P,I)&&(P=N.from(P,P.offset,P.byteLength)),jn(k,I)&&(k=N.from(k,k.offset,k.byteLength)),!N.isBuffer(P)||!N.isBuffer(k))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(P===k)return 0;let Y=P.length,ie=k.length;for(let we=0,Ie=Math.min(Y,ie);we<Ie;++we)if(P[we]!==k[we]){Y=P[we],ie=k[we];break}return Y<ie?-1:ie<Y?1:0},N.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}},N.concat=function(P,k){if(!Array.isArray(P))throw new TypeError('"list" argument must be an Array of Buffers');if(P.length===0)return N.alloc(0);let Y;if(k===void 0)for(k=0,Y=0;Y<P.length;++Y)k+=P[Y].length;const ie=N.allocUnsafe(k);let we=0;for(Y=0;Y<P.length;++Y){let Ie=P[Y];if(jn(Ie,I))we+Ie.length>ie.length?(N.isBuffer(Ie)||(Ie=N.from(Ie)),Ie.copy(ie,we)):I.prototype.set.call(ie,Ie,we);else if(N.isBuffer(Ie))Ie.copy(ie,we);else throw new TypeError('"list" argument must be an Array of Buffers');we+=Ie.length}return ie};function se(U,P){if(N.isBuffer(U))return U.length;if(_.isView(U)||jn(U,_))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 k=U.length,Y=arguments.length>2&&arguments[2]===!0;if(!Y&&k===0)return 0;let ie=!1;for(;;)switch(P){case"ascii":case"latin1":case"binary":return k;case"utf8":case"utf-8":return ut(U).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k*2;case"hex":return k>>>1;case"base64":return it(U).length;default:if(ie)return Y?-1:ut(U).length;P=(""+P).toLowerCase(),ie=!0}}N.byteLength=se;function Re(U,P,k){let Y=!1;if((P===void 0||P<0)&&(P=0),P>this.length||((k===void 0||k>this.length)&&(k=this.length),k<=0)||(k>>>=0,P>>>=0,k<=P))return"";for(U||(U="utf8");;)switch(U){case"hex":return xe(this,P,k);case"utf8":case"utf-8":return Le(this,P,k);case"ascii":return De(this,P,k);case"latin1":case"binary":return Z(this,P,k);case"base64":return _e(this,P,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Me(this,P,k);default:if(Y)throw new TypeError("Unknown encoding: "+U);U=(U+"").toLowerCase(),Y=!0}}N.prototype._isBuffer=!0;function H(U,P,k){const Y=U[P];U[P]=U[k],U[k]=Y}N.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 k=0;k<P;k+=2)H(this,k,k+1);return this},N.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 k=0;k<P;k+=4)H(this,k,k+3),H(this,k+1,k+2);return this},N.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 k=0;k<P;k+=8)H(this,k,k+7),H(this,k+1,k+6),H(this,k+2,k+5),H(this,k+3,k+4);return this},N.prototype.toString=function(){const P=this.length;return P===0?"":arguments.length===0?Le(this,0,P):Re.apply(this,arguments)},N.prototype.toLocaleString=N.prototype.toString,N.prototype.equals=function(P){if(!N.isBuffer(P))throw new TypeError("Argument must be a Buffer");return this===P?!0:N.compare(this,P)===0},N.prototype.inspect=function(){let P="";const k=g.INSPECT_MAX_BYTES;return P=this.toString("hex",0,k).replace(/(.{2})/g,"$1 ").trim(),this.length>k&&(P+=" ... "),"<Buffer "+P+">"},S&&(N.prototype[S]=N.prototype.inspect),N.prototype.compare=function(P,k,Y,ie,we){if(jn(P,I)&&(P=N.from(P,P.offset,P.byteLength)),!N.isBuffer(P))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof P);if(k===void 0&&(k=0),Y===void 0&&(Y=P?P.length:0),ie===void 0&&(ie=0),we===void 0&&(we=this.length),k<0||Y>P.length||ie<0||we>this.length)throw new RangeError("out of range index");if(ie>=we&&k>=Y)return 0;if(ie>=we)return-1;if(k>=Y)return 1;if(k>>>=0,Y>>>=0,ie>>>=0,we>>>=0,this===P)return 0;let Ie=we-ie,nt=Y-k;const Dt=Math.min(Ie,nt),Ft=this.slice(ie,we),Lt=P.slice(k,Y);for(let vt=0;vt<Dt;++vt)if(Ft[vt]!==Lt[vt]){Ie=Ft[vt],nt=Lt[vt];break}return Ie<nt?-1:nt<Ie?1:0};function R(U,P,k,Y,ie){if(U.length===0)return-1;if(typeof k=="string"?(Y=k,k=0):k>2147483647?k=2147483647:k<-2147483648&&(k=-2147483648),k=+k,$e(k)&&(k=ie?0:U.length-1),k<0&&(k=U.length+k),k>=U.length){if(ie)return-1;k=U.length-1}else if(k<0)if(ie)k=0;else return-1;if(typeof P=="string"&&(P=N.from(P,Y)),N.isBuffer(P))return P.length===0?-1:F(U,P,k,Y,ie);if(typeof P=="number")return P=P&255,typeof I.prototype.indexOf=="function"?ie?I.prototype.indexOf.call(U,P,k):I.prototype.lastIndexOf.call(U,P,k):F(U,[P],k,Y,ie);throw new TypeError("val must be string, number or Buffer")}function F(U,P,k,Y,ie){let we=1,Ie=U.length,nt=P.length;if(Y!==void 0&&(Y=String(Y).toLowerCase(),Y==="ucs2"||Y==="ucs-2"||Y==="utf16le"||Y==="utf-16le")){if(U.length<2||P.length<2)return-1;we=2,Ie/=2,nt/=2,k/=2}function Dt(Lt,vt){return we===1?Lt[vt]:Lt.readUInt16BE(vt*we)}let Ft;if(ie){let Lt=-1;for(Ft=k;Ft<Ie;Ft++)if(Dt(U,Ft)===Dt(P,Lt===-1?0:Ft-Lt)){if(Lt===-1&&(Lt=Ft),Ft-Lt+1===nt)return Lt*we}else Lt!==-1&&(Ft-=Ft-Lt),Lt=-1}else for(k+nt>Ie&&(k=Ie-nt),Ft=k;Ft>=0;Ft--){let Lt=!0;for(let vt=0;vt<nt;vt++)if(Dt(U,Ft+vt)!==Dt(P,vt)){Lt=!1;break}if(Lt)return Ft}return-1}N.prototype.includes=function(P,k,Y){return this.indexOf(P,k,Y)!==-1},N.prototype.indexOf=function(P,k,Y){return R(this,P,k,Y,!0)},N.prototype.lastIndexOf=function(P,k,Y){return R(this,P,k,Y,!1)};function K(U,P,k,Y){k=Number(k)||0;const ie=U.length-k;Y?(Y=Number(Y),Y>ie&&(Y=ie)):Y=ie;const we=P.length;Y>we/2&&(Y=we/2);let Ie;for(Ie=0;Ie<Y;++Ie){const nt=parseInt(P.substr(Ie*2,2),16);if($e(nt))return Ie;U[k+Ie]=nt}return Ie}function z(U,P,k,Y){return Vi(ut(P,U.length-k),U,k,Y)}function M(U,P,k,Y){return Vi(ft(P),U,k,Y)}function q(U,P,k,Y){return Vi(it(P),U,k,Y)}function ge(U,P,k,Y){return Vi(bt(P,U.length-k),U,k,Y)}N.prototype.write=function(P,k,Y,ie){if(k===void 0)ie="utf8",Y=this.length,k=0;else if(Y===void 0&&typeof k=="string")ie=k,Y=this.length,k=0;else if(isFinite(k))k=k>>>0,isFinite(Y)?(Y=Y>>>0,ie===void 0&&(ie="utf8")):(ie=Y,Y=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const we=this.length-k;if((Y===void 0||Y>we)&&(Y=we),P.length>0&&(Y<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");ie||(ie="utf8");let Ie=!1;for(;;)switch(ie){case"hex":return K(this,P,k,Y);case"utf8":case"utf-8":return z(this,P,k,Y);case"ascii":case"latin1":case"binary":return M(this,P,k,Y);case"base64":return q(this,P,k,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ge(this,P,k,Y);default:if(Ie)throw new TypeError("Unknown encoding: "+ie);ie=(""+ie).toLowerCase(),Ie=!0}},N.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function _e(U,P,k){return P===0&&k===U.length?v.fromByteArray(U):v.fromByteArray(U.slice(P,k))}function Le(U,P,k){k=Math.min(U.length,k);const Y=[];let ie=P;for(;ie<k;){const we=U[ie];let Ie=null,nt=we>239?4:we>223?3:we>191?2:1;if(ie+nt<=k){let Dt,Ft,Lt,vt;switch(nt){case 1:we<128&&(Ie=we);break;case 2:Dt=U[ie+1],(Dt&192)===128&&(vt=(we&31)<<6|Dt&63,vt>127&&(Ie=vt));break;case 3:Dt=U[ie+1],Ft=U[ie+2],(Dt&192)===128&&(Ft&192)===128&&(vt=(we&15)<<12|(Dt&63)<<6|Ft&63,vt>2047&&(vt<55296||vt>57343)&&(Ie=vt));break;case 4:Dt=U[ie+1],Ft=U[ie+2],Lt=U[ie+3],(Dt&192)===128&&(Ft&192)===128&&(Lt&192)===128&&(vt=(we&15)<<18|(Dt&63)<<12|(Ft&63)<<6|Lt&63,vt>65535&&vt<1114112&&(Ie=vt))}}Ie===null?(Ie=65533,nt=1):Ie>65535&&(Ie-=65536,Y.push(Ie>>>10&1023|55296),Ie=56320|Ie&1023),Y.push(Ie),ie+=nt}return Pe(Y)}const ke=4096;function Pe(U){const P=U.length;if(P<=ke)return String.fromCharCode.apply(String,U);let k="",Y=0;for(;Y<P;)k+=String.fromCharCode.apply(String,U.slice(Y,Y+=ke));return k}function De(U,P,k){let Y="";k=Math.min(U.length,k);for(let ie=P;ie<k;++ie)Y+=String.fromCharCode(U[ie]&127);return Y}function Z(U,P,k){let Y="";k=Math.min(U.length,k);for(let ie=P;ie<k;++ie)Y+=String.fromCharCode(U[ie]);return Y}function xe(U,P,k){const Y=U.length;(!P||P<0)&&(P=0),(!k||k<0||k>Y)&&(k=Y);let ie="";for(let we=P;we<k;++we)ie+=Je[U[we]];return ie}function Me(U,P,k){const Y=U.slice(P,k);let ie="";for(let we=0;we<Y.length-1;we+=2)ie+=String.fromCharCode(Y[we]+Y[we+1]*256);return ie}N.prototype.slice=function(P,k){const Y=this.length;P=~~P,k=k===void 0?Y:~~k,P<0?(P+=Y,P<0&&(P=0)):P>Y&&(P=Y),k<0?(k+=Y,k<0&&(k=0)):k>Y&&(k=Y),k<P&&(k=P);const ie=this.subarray(P,k);return Object.setPrototypeOf(ie,N.prototype),ie};function Ge(U,P,k){if(U%1!==0||U<0)throw new RangeError("offset is not uint");if(U+P>k)throw new RangeError("Trying to access beyond buffer length")}N.prototype.readUintLE=N.prototype.readUIntLE=function(P,k,Y){P=P>>>0,k=k>>>0,Y||Ge(P,k,this.length);let ie=this[P],we=1,Ie=0;for(;++Ie<k&&(we*=256);)ie+=this[P+Ie]*we;return ie},N.prototype.readUintBE=N.prototype.readUIntBE=function(P,k,Y){P=P>>>0,k=k>>>0,Y||Ge(P,k,this.length);let ie=this[P+--k],we=1;for(;k>0&&(we*=256);)ie+=this[P+--k]*we;return ie},N.prototype.readUint8=N.prototype.readUInt8=function(P,k){return P=P>>>0,k||Ge(P,1,this.length),this[P]},N.prototype.readUint16LE=N.prototype.readUInt16LE=function(P,k){return P=P>>>0,k||Ge(P,2,this.length),this[P]|this[P+1]<<8},N.prototype.readUint16BE=N.prototype.readUInt16BE=function(P,k){return P=P>>>0,k||Ge(P,2,this.length),this[P]<<8|this[P+1]},N.prototype.readUint32LE=N.prototype.readUInt32LE=function(P,k){return P=P>>>0,k||Ge(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+this[P+3]*16777216},N.prototype.readUint32BE=N.prototype.readUInt32BE=function(P,k){return P=P>>>0,k||Ge(P,4,this.length),this[P]*16777216+(this[P+1]<<16|this[P+2]<<8|this[P+3])},N.prototype.readBigUInt64LE=at(function(P){P=P>>>0,re(P,"offset");const k=this[P],Y=this[P+7];(k===void 0||Y===void 0)&&me(P,this.length-8);const ie=k+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24,we=this[++P]+this[++P]*2**8+this[++P]*2**16+Y*2**24;return BigInt(ie)+(BigInt(we)<<BigInt(32))}),N.prototype.readBigUInt64BE=at(function(P){P=P>>>0,re(P,"offset");const k=this[P],Y=this[P+7];(k===void 0||Y===void 0)&&me(P,this.length-8);const ie=k*2**24+this[++P]*2**16+this[++P]*2**8+this[++P],we=this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+Y;return(BigInt(ie)<<BigInt(32))+BigInt(we)}),N.prototype.readIntLE=function(P,k,Y){P=P>>>0,k=k>>>0,Y||Ge(P,k,this.length);let ie=this[P],we=1,Ie=0;for(;++Ie<k&&(we*=256);)ie+=this[P+Ie]*we;return we*=128,ie>=we&&(ie-=Math.pow(2,8*k)),ie},N.prototype.readIntBE=function(P,k,Y){P=P>>>0,k=k>>>0,Y||Ge(P,k,this.length);let ie=k,we=1,Ie=this[P+--ie];for(;ie>0&&(we*=256);)Ie+=this[P+--ie]*we;return we*=128,Ie>=we&&(Ie-=Math.pow(2,8*k)),Ie},N.prototype.readInt8=function(P,k){return P=P>>>0,k||Ge(P,1,this.length),this[P]&128?(255-this[P]+1)*-1:this[P]},N.prototype.readInt16LE=function(P,k){P=P>>>0,k||Ge(P,2,this.length);const Y=this[P]|this[P+1]<<8;return Y&32768?Y|4294901760:Y},N.prototype.readInt16BE=function(P,k){P=P>>>0,k||Ge(P,2,this.length);const Y=this[P+1]|this[P]<<8;return Y&32768?Y|4294901760:Y},N.prototype.readInt32LE=function(P,k){return P=P>>>0,k||Ge(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},N.prototype.readInt32BE=function(P,k){return P=P>>>0,k||Ge(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},N.prototype.readBigInt64LE=at(function(P){P=P>>>0,re(P,"offset");const k=this[P],Y=this[P+7];(k===void 0||Y===void 0)&&me(P,this.length-8);const ie=this[P+4]+this[P+5]*2**8+this[P+6]*2**16+(Y<<24);return(BigInt(ie)<<BigInt(32))+BigInt(k+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24)}),N.prototype.readBigInt64BE=at(function(P){P=P>>>0,re(P,"offset");const k=this[P],Y=this[P+7];(k===void 0||Y===void 0)&&me(P,this.length-8);const ie=(k<<24)+this[++P]*2**16+this[++P]*2**8+this[++P];return(BigInt(ie)<<BigInt(32))+BigInt(this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+Y)}),N.prototype.readFloatLE=function(P,k){return P=P>>>0,k||Ge(P,4,this.length),h.read(this,P,!0,23,4)},N.prototype.readFloatBE=function(P,k){return P=P>>>0,k||Ge(P,4,this.length),h.read(this,P,!1,23,4)},N.prototype.readDoubleLE=function(P,k){return P=P>>>0,k||Ge(P,8,this.length),h.read(this,P,!0,52,8)},N.prototype.readDoubleBE=function(P,k){return P=P>>>0,k||Ge(P,8,this.length),h.read(this,P,!1,52,8)};function et(U,P,k,Y,ie,we){if(!N.isBuffer(U))throw new TypeError('"buffer" argument must be a Buffer instance');if(P>ie||P<we)throw new RangeError('"value" argument is out of bounds');if(k+Y>U.length)throw new RangeError("Index out of range")}N.prototype.writeUintLE=N.prototype.writeUIntLE=function(P,k,Y,ie){if(P=+P,k=k>>>0,Y=Y>>>0,!ie){const nt=Math.pow(2,8*Y)-1;et(this,P,k,Y,nt,0)}let we=1,Ie=0;for(this[k]=P&255;++Ie<Y&&(we*=256);)this[k+Ie]=P/we&255;return k+Y},N.prototype.writeUintBE=N.prototype.writeUIntBE=function(P,k,Y,ie){if(P=+P,k=k>>>0,Y=Y>>>0,!ie){const nt=Math.pow(2,8*Y)-1;et(this,P,k,Y,nt,0)}let we=Y-1,Ie=1;for(this[k+we]=P&255;--we>=0&&(Ie*=256);)this[k+we]=P/Ie&255;return k+Y},N.prototype.writeUint8=N.prototype.writeUInt8=function(P,k,Y){return P=+P,k=k>>>0,Y||et(this,P,k,1,255,0),this[k]=P&255,k+1},N.prototype.writeUint16LE=N.prototype.writeUInt16LE=function(P,k,Y){return P=+P,k=k>>>0,Y||et(this,P,k,2,65535,0),this[k]=P&255,this[k+1]=P>>>8,k+2},N.prototype.writeUint16BE=N.prototype.writeUInt16BE=function(P,k,Y){return P=+P,k=k>>>0,Y||et(this,P,k,2,65535,0),this[k]=P>>>8,this[k+1]=P&255,k+2},N.prototype.writeUint32LE=N.prototype.writeUInt32LE=function(P,k,Y){return P=+P,k=k>>>0,Y||et(this,P,k,4,4294967295,0),this[k+3]=P>>>24,this[k+2]=P>>>16,this[k+1]=P>>>8,this[k]=P&255,k+4},N.prototype.writeUint32BE=N.prototype.writeUInt32BE=function(P,k,Y){return P=+P,k=k>>>0,Y||et(this,P,k,4,4294967295,0),this[k]=P>>>24,this[k+1]=P>>>16,this[k+2]=P>>>8,this[k+3]=P&255,k+4};function Nt(U,P,k,Y,ie){Q(P,Y,ie,U,k,7);let we=Number(P&BigInt(4294967295));U[k++]=we,we=we>>8,U[k++]=we,we=we>>8,U[k++]=we,we=we>>8,U[k++]=we;let Ie=Number(P>>BigInt(32)&BigInt(4294967295));return U[k++]=Ie,Ie=Ie>>8,U[k++]=Ie,Ie=Ie>>8,U[k++]=Ie,Ie=Ie>>8,U[k++]=Ie,k}function _t(U,P,k,Y,ie){Q(P,Y,ie,U,k,7);let we=Number(P&BigInt(4294967295));U[k+7]=we,we=we>>8,U[k+6]=we,we=we>>8,U[k+5]=we,we=we>>8,U[k+4]=we;let Ie=Number(P>>BigInt(32)&BigInt(4294967295));return U[k+3]=Ie,Ie=Ie>>8,U[k+2]=Ie,Ie=Ie>>8,U[k+1]=Ie,Ie=Ie>>8,U[k]=Ie,k+8}N.prototype.writeBigUInt64LE=at(function(P,k=0){return Nt(this,P,k,BigInt(0),BigInt("0xffffffffffffffff"))}),N.prototype.writeBigUInt64BE=at(function(P,k=0){return _t(this,P,k,BigInt(0),BigInt("0xffffffffffffffff"))}),N.prototype.writeIntLE=function(P,k,Y,ie){if(P=+P,k=k>>>0,!ie){const Dt=Math.pow(2,8*Y-1);et(this,P,k,Y,Dt-1,-Dt)}let we=0,Ie=1,nt=0;for(this[k]=P&255;++we<Y&&(Ie*=256);)P<0&&nt===0&&this[k+we-1]!==0&&(nt=1),this[k+we]=(P/Ie>>0)-nt&255;return k+Y},N.prototype.writeIntBE=function(P,k,Y,ie){if(P=+P,k=k>>>0,!ie){const Dt=Math.pow(2,8*Y-1);et(this,P,k,Y,Dt-1,-Dt)}let we=Y-1,Ie=1,nt=0;for(this[k+we]=P&255;--we>=0&&(Ie*=256);)P<0&&nt===0&&this[k+we+1]!==0&&(nt=1),this[k+we]=(P/Ie>>0)-nt&255;return k+Y},N.prototype.writeInt8=function(P,k,Y){return P=+P,k=k>>>0,Y||et(this,P,k,1,127,-128),P<0&&(P=255+P+1),this[k]=P&255,k+1},N.prototype.writeInt16LE=function(P,k,Y){return P=+P,k=k>>>0,Y||et(this,P,k,2,32767,-32768),this[k]=P&255,this[k+1]=P>>>8,k+2},N.prototype.writeInt16BE=function(P,k,Y){return P=+P,k=k>>>0,Y||et(this,P,k,2,32767,-32768),this[k]=P>>>8,this[k+1]=P&255,k+2},N.prototype.writeInt32LE=function(P,k,Y){return P=+P,k=k>>>0,Y||et(this,P,k,4,2147483647,-2147483648),this[k]=P&255,this[k+1]=P>>>8,this[k+2]=P>>>16,this[k+3]=P>>>24,k+4},N.prototype.writeInt32BE=function(P,k,Y){return P=+P,k=k>>>0,Y||et(this,P,k,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),this[k]=P>>>24,this[k+1]=P>>>16,this[k+2]=P>>>8,this[k+3]=P&255,k+4},N.prototype.writeBigInt64LE=at(function(P,k=0){return Nt(this,P,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),N.prototype.writeBigInt64BE=at(function(P,k=0){return _t(this,P,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function $t(U,P,k,Y,ie,we){if(k+Y>U.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("Index out of range")}function Be(U,P,k,Y,ie){return P=+P,k=k>>>0,ie||$t(U,P,k,4),h.write(U,P,k,Y,23,4),k+4}N.prototype.writeFloatLE=function(P,k,Y){return Be(this,P,k,!0,Y)},N.prototype.writeFloatBE=function(P,k,Y){return Be(this,P,k,!1,Y)};function Ve(U,P,k,Y,ie){return P=+P,k=k>>>0,ie||$t(U,P,k,8),h.write(U,P,k,Y,52,8),k+8}N.prototype.writeDoubleLE=function(P,k,Y){return Ve(this,P,k,!0,Y)},N.prototype.writeDoubleBE=function(P,k,Y){return Ve(this,P,k,!1,Y)},N.prototype.copy=function(P,k,Y,ie){if(!N.isBuffer(P))throw new TypeError("argument should be a Buffer");if(Y||(Y=0),!ie&&ie!==0&&(ie=this.length),k>=P.length&&(k=P.length),k||(k=0),ie>0&&ie<Y&&(ie=Y),ie===Y||P.length===0||this.length===0)return 0;if(k<0)throw new RangeError("targetStart out of bounds");if(Y<0||Y>=this.length)throw new RangeError("Index out of range");if(ie<0)throw new RangeError("sourceEnd out of bounds");ie>this.length&&(ie=this.length),P.length-k<ie-Y&&(ie=P.length-k+Y);const we=ie-Y;return this===P&&typeof I.prototype.copyWithin=="function"?this.copyWithin(k,Y,ie):I.prototype.set.call(P,this.subarray(Y,ie),k),we},N.prototype.fill=function(P,k,Y,ie){if(typeof P=="string"){if(typeof k=="string"?(ie=k,k=0,Y=this.length):typeof Y=="string"&&(ie=Y,Y=this.length),ie!==void 0&&typeof ie!="string")throw new TypeError("encoding must be a string");if(typeof ie=="string"&&!N.isEncoding(ie))throw new TypeError("Unknown encoding: "+ie);if(P.length===1){const Ie=P.charCodeAt(0);(ie==="utf8"&&Ie<128||ie==="latin1")&&(P=Ie)}}else typeof P=="number"?P=P&255:typeof P=="boolean"&&(P=Number(P));if(k<0||this.length<k||this.length<Y)throw new RangeError("Out of range index");if(Y<=k)return this;k=k>>>0,Y=Y===void 0?this.length:Y>>>0,P||(P=0);let we;if(typeof P=="number")for(we=k;we<Y;++we)this[we]=P;else{const Ie=N.isBuffer(P)?P:N.from(P,ie),nt=Ie.length;if(nt===0)throw new TypeError('The value "'+P+'" is invalid for argument "value"');for(we=0;we<Y-k;++we)this[we+k]=Ie[we%nt]}return this};const dn={};function j(U,P,k){dn[U]=class extends k{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(ie){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ie,writable:!0})}toString(){return`${this.name} [${U}]: ${this.message}`}}}j("ERR_BUFFER_OUT_OF_BOUNDS",function(U){return U?`${U} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),j("ERR_INVALID_ARG_TYPE",function(U,P){return`The "${U}" argument must be of type number. Received type ${typeof P}`},TypeError),j("ERR_OUT_OF_RANGE",function(U,P,k){let Y=`The value of "${U}" is out of range.`,ie=k;return Number.isInteger(k)&&Math.abs(k)>2**32?ie=C(String(k)):typeof k=="bigint"&&(ie=String(k),(k>BigInt(2)**BigInt(32)||k<-(BigInt(2)**BigInt(32)))&&(ie=C(ie)),ie+="n"),Y+=` It must be ${P}. Received ${ie}`,Y},RangeError);function C(U){let P="",k=U.length;const Y=U[0]==="-"?1:0;for(;k>=Y+4;k-=3)P=`_${U.slice(k-3,k)}${P}`;return`${U.slice(0,k)}${P}`}function O(U,P,k){re(P,"offset"),(U[P]===void 0||U[P+k]===void 0)&&me(P,U.length-(k+1))}function Q(U,P,k,Y,ie,we){if(U>k||U<P){const Ie=typeof P=="bigint"?"n":"";let nt;throw P===0||P===BigInt(0)?nt=`>= 0${Ie} and < 2${Ie} ** ${(we+1)*8}${Ie}`:nt=`>= -(2${Ie} ** ${(we+1)*8-1}${Ie}) and < 2 ** ${(we+1)*8-1}${Ie}`,new dn.ERR_OUT_OF_RANGE("value",nt,U)}O(Y,ie,we)}function re(U,P){if(typeof U!="number")throw new dn.ERR_INVALID_ARG_TYPE(P,"number",U)}function me(U,P,k){throw Math.floor(U)!==U?(re(U,k),new dn.ERR_OUT_OF_RANGE("offset","an integer",U)):P<0?new dn.ERR_BUFFER_OUT_OF_BOUNDS:new dn.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${P}`,U)}const Te=/[^+/0-9A-Za-z-_]/g;function Ye(U){if(U=U.split("=")[0],U=U.trim().replace(Te,""),U.length<2)return"";for(;U.length%4!==0;)U=U+"=";return U}function ut(U,P){P=P||1/0;let k;const Y=U.length;let ie=null;const we=[];for(let Ie=0;Ie<Y;++Ie){if(k=U.charCodeAt(Ie),k>55295&&k<57344){if(!ie){if(k>56319){(P-=3)>-1&&we.push(239,191,189);continue}else if(Ie+1===Y){(P-=3)>-1&&we.push(239,191,189);continue}ie=k;continue}if(k<56320){(P-=3)>-1&&we.push(239,191,189),ie=k;continue}k=(ie-55296<<10|k-56320)+65536}else ie&&(P-=3)>-1&&we.push(239,191,189);if(ie=null,k<128){if((P-=1)<0)break;we.push(k)}else if(k<2048){if((P-=2)<0)break;we.push(k>>6|192,k&63|128)}else if(k<65536){if((P-=3)<0)break;we.push(k>>12|224,k>>6&63|128,k&63|128)}else if(k<1114112){if((P-=4)<0)break;we.push(k>>18|240,k>>12&63|128,k>>6&63|128,k&63|128)}else throw new Error("Invalid code point")}return we}function ft(U){const P=[];for(let k=0;k<U.length;++k)P.push(U.charCodeAt(k)&255);return P}function bt(U,P){let k,Y,ie;const we=[];for(let Ie=0;Ie<U.length&&!((P-=2)<0);++Ie)k=U.charCodeAt(Ie),Y=k>>8,ie=k%256,we.push(ie),we.push(Y);return we}function it(U){return v.toByteArray(Ye(U))}function Vi(U,P,k,Y){let ie;for(ie=0;ie<Y&&!(ie+k>=P.length||ie>=U.length);++ie)P[ie+k]=U[ie];return ie}function jn(U,P){return U instanceof P||U!=null&&U.constructor!=null&&U.constructor.name!=null&&U.constructor.name===P.name}function $e(U){return U!==U}const Je=function(){const U="0123456789abcdef",P=new Array(256);for(let k=0;k<16;++k){const Y=k*16;for(let ie=0;ie<16;++ie)P[Y+ie]=U[k]+U[ie]}return P}();function at(U){return typeof BigInt>"u"?Un:U}function Un(){throw new Error("BigInt not supported")}})(t);const b=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=b,e.isAscii=t.isAscii,e.isUtf8=t.isUtf8,e.kMaxLength=t.kMaxLength,e.kStringMaxLength=t.kStringMaxLength,e.resolveObjectURL=t.resolveObjectURL,e.transcode=t.transcode}(sc)),sc}var ac={},lc={},cc,lg;function cg(){return lg||(lg=1,cc=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 o=42;t[n]=o;for(var i 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!==o||a.enumerable!==!0)return!1}return!0}),cc}var uc,ug;function Cs(){if(ug)return uc;ug=1;var e=cg();return uc=function(){return e()&&!!Symbol.toStringTag},uc}var fc,fg;function dg(){return fg||(fg=1,fc=Object),fc}var dc,pg;function NA(){return pg||(pg=1,dc=Error),dc}var pc,hg;function $A(){return hg||(hg=1,pc=EvalError),pc}var hc,gg;function DA(){return gg||(gg=1,hc=RangeError),hc}var gc,mg;function LA(){return mg||(mg=1,gc=ReferenceError),gc}var mc,yg;function bg(){return yg||(yg=1,mc=SyntaxError),mc}var yc,vg;function ho(){return vg||(vg=1,yc=TypeError),yc}var bc,wg;function MA(){return wg||(wg=1,bc=URIError),bc}var vc,Sg;function BA(){return Sg||(Sg=1,vc=Math.abs),vc}var wc,Eg;function jA(){return Eg||(Eg=1,wc=Math.floor),wc}var Sc,Tg;function UA(){return Tg||(Tg=1,Sc=Math.max),Sc}var Ec,Ag;function qA(){return Ag||(Ag=1,Ec=Math.min),Ec}var Tc,Rg;function VA(){return Rg||(Rg=1,Tc=Math.pow),Tc}var Ac,_g;function zA(){return _g||(_g=1,Ac=Math.round),Ac}var Rc,Ig;function WA(){return Ig||(Ig=1,Rc=Number.isNaN||function(t){return t!==t}),Rc}var _c,Cg;function HA(){if(Cg)return _c;Cg=1;var e=WA();return _c=function(n){return e(n)||n===0?n:n<0?-1:1},_c}var Ic,Pg;function GA(){return Pg||(Pg=1,Ic=Object.getOwnPropertyDescriptor),Ic}var Cc,Fg;function xi(){if(Fg)return Cc;Fg=1;var e=GA();if(e)try{e([],"length")}catch{e=null}return Cc=e,Cc}var Pc,Og;function Ps(){if(Og)return Pc;Og=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Pc=e,Pc}var Fc,kg;function KA(){if(kg)return Fc;kg=1;var e=typeof Symbol<"u"&&Symbol,t=cg();return Fc=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Fc}var Oc,xg;function Ng(){return xg||(xg=1,Oc=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Oc}var kc,$g;function Dg(){if($g)return kc;$g=1;var e=dg();return kc=e.getPrototypeOf||null,kc}var xc,Lg;function QA(){if(Lg)return xc;Lg=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,n=Math.max,r="[object Function]",o=function(c,u){for(var l=[],d=0;d<c.length;d+=1)l[d]=c[d];for(var f=0;f<u.length;f+=1)l[f+c.length]=u[f];return l},i=function(c,u){for(var l=[],d=u,f=0;d<c.length;d+=1,f+=1)l[f]=c[d];return l},s=function(a,c){for(var u="",l=0;l<a.length;l+=1)u+=a[l],l+1<a.length&&(u+=c);return u};return xc=function(c){var u=this;if(typeof u!="function"||t.apply(u)!==r)throw new TypeError(e+u);for(var l=i(arguments,1),d,f=function(){if(this instanceof d){var b=u.apply(this,o(l,arguments));return Object(b)===b?b:this}return u.apply(c,o(l,arguments))},m=n(0,u.length-l.length),w=[],y=0;y<m;y++)w[y]="$"+y;if(d=Function("binder","return function ("+s(w,",")+"){ return binder.apply(this,arguments); }")(f),u.prototype){var E=function(){};E.prototype=u.prototype,d.prototype=new E,E.prototype=null}return d},xc}var Nc,Mg;function go(){if(Mg)return Nc;Mg=1;var e=QA();return Nc=Function.prototype.bind||e,Nc}var $c,Bg;function Dc(){return Bg||(Bg=1,$c=Function.prototype.call),$c}var Lc,jg;function Mc(){return jg||(jg=1,Lc=Function.prototype.apply),Lc}var Bc,Ug;function XA(){return Ug||(Ug=1,Bc=typeof Reflect<"u"&&Reflect&&Reflect.apply),Bc}var jc,qg;function Vg(){if(qg)return jc;qg=1;var e=go(),t=Mc(),n=Dc(),r=XA();return jc=r||e.call(n,t),jc}var Uc,zg;function qc(){if(zg)return Uc;zg=1;var e=go(),t=ho(),n=Dc(),r=Vg();return Uc=function(i){if(i.length<1||typeof i[0]!="function")throw new t("a function is required");return r(e,n,i)},Uc}var Vc,Wg;function YA(){if(Wg)return Vc;Wg=1;var e=qc(),t=xi(),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__"),o=Object,i=o.getPrototypeOf;return Vc=r&&typeof r.get=="function"?e([r.get]):typeof i=="function"?function(a){return i(a==null?a:o(a))}:!1,Vc}var zc,Hg;function Wc(){if(Hg)return zc;Hg=1;var e=Ng(),t=Dg(),n=YA();return zc=e?function(o){return e(o)}:t?function(o){if(!o||typeof o!="object"&&typeof o!="function")throw new TypeError("getProto: not an object");return t(o)}:n?function(o){return n(o)}:null,zc}var Hc,Gg;function Kg(){if(Gg)return Hc;Gg=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,n=go();return Hc=n.call(e,t),Hc}var Gc,Qg;function Xg(){if(Qg)return Gc;Qg=1;var e,t=dg(),n=NA(),r=$A(),o=DA(),i=LA(),s=bg(),a=ho(),c=MA(),u=BA(),l=jA(),d=UA(),f=qA(),m=VA(),w=zA(),y=HA(),E=Function,b=function(K){try{return E('"use strict"; return ('+K+").constructor;")()}catch{}},g=xi(),v=Ps(),h=function(){throw new a},S=g?function(){try{return arguments.callee,h}catch{try{return g(arguments,"callee").get}catch{return h}}}():h,T=KA()(),I=Wc(),_=Dg(),A=Ng(),$=Mc(),D=Dc(),N={},x=typeof Uint8Array>"u"||!I?e:I(Uint8Array),V={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":T&&I?I([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":N,"%AsyncGenerator%":N,"%AsyncGeneratorFunction%":N,"%AsyncIteratorPrototype%":N,"%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%":E,"%GeneratorFunction%":N,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":T&&I?I(I([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!T||!I?e:I(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%":o,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!T||!I?e:I(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":T&&I?I(""[Symbol.iterator]()):e,"%Symbol%":T?Symbol:e,"%SyntaxError%":s,"%ThrowTypeError%":S,"%TypedArray%":x,"%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%":c,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":D,"%Function.prototype.apply%":$,"%Object.defineProperty%":v,"%Object.getPrototypeOf%":_,"%Math.abs%":u,"%Math.floor%":l,"%Math.max%":d,"%Math.min%":f,"%Math.pow%":m,"%Math.round%":w,"%Math.sign%":y,"%Reflect.getPrototypeOf%":A};if(I)try{null.error}catch(K){var G=I(I(K));V["%Error.prototype%"]=G}var ae=function K(z){var M;if(z==="%AsyncFunction%")M=b("async function () {}");else if(z==="%GeneratorFunction%")M=b("function* () {}");else if(z==="%AsyncGeneratorFunction%")M=b("async function* () {}");else if(z==="%AsyncGenerator%"){var q=K("%AsyncGeneratorFunction%");q&&(M=q.prototype)}else if(z==="%AsyncIteratorPrototype%"){var ge=K("%AsyncGenerator%");ge&&I&&(M=I(ge.prototype))}return V[z]=M,M},ye={__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"]},ue=go(),te=Kg(),ce=ue.call(D,Array.prototype.concat),oe=ue.call($,Array.prototype.splice),J=ue.call(D,String.prototype.replace),ne=ue.call(D,String.prototype.slice),se=ue.call(D,RegExp.prototype.exec),Re=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,R=function(z){var M=ne(z,0,1),q=ne(z,-1);if(M==="%"&&q!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(q==="%"&&M!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var ge=[];return J(z,Re,function(_e,Le,ke,Pe){ge[ge.length]=ke?J(Pe,H,"$1"):Le||_e}),ge},F=function(z,M){var q=z,ge;if(te(ye,q)&&(ge=ye[q],q="%"+ge[0]+"%"),te(V,q)){var _e=V[q];if(_e===N&&(_e=ae(q)),typeof _e>"u"&&!M)throw new a("intrinsic "+z+" exists, but is not available. Please file an issue!");return{alias:ge,name:q,value:_e}}throw new s("intrinsic "+z+" does not exist!")};return Gc=function(z,M){if(typeof z!="string"||z.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof M!="boolean")throw new a('"allowMissing" argument must be a boolean');if(se(/^%?[^%]*%?$/,z)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var q=R(z),ge=q.length>0?q[0]:"",_e=F("%"+ge+"%",M),Le=_e.name,ke=_e.value,Pe=!1,De=_e.alias;De&&(ge=De[0],oe(q,ce([0,1],De)));for(var Z=1,xe=!0;Z<q.length;Z+=1){var Me=q[Z],Ge=ne(Me,0,1),et=ne(Me,-1);if((Ge==='"'||Ge==="'"||Ge==="`"||et==='"'||et==="'"||et==="`")&&Ge!==et)throw new s("property names with quotes must have matching quotes");if((Me==="constructor"||!xe)&&(Pe=!0),ge+="."+Me,Le="%"+ge+"%",te(V,Le))ke=V[Le];else if(ke!=null){if(!(Me in ke)){if(!M)throw new a("base intrinsic for "+z+" exists, but the property is not available.");return}if(g&&Z+1>=q.length){var Nt=g(ke,Me);xe=!!Nt,xe&&"get"in Nt&&!("originalValue"in Nt.get)?ke=Nt.get:ke=ke[Me]}else xe=te(ke,Me),ke=ke[Me];xe&&!Pe&&(V[Le]=ke)}}return ke},Gc}var Kc,Yg;function mo(){if(Yg)return Kc;Yg=1;var e=Xg(),t=qc(),n=t([e("%String.prototype.indexOf%")]);return Kc=function(o,i){var s=e(o,!!i);return typeof s=="function"&&n(o,".prototype.")>-1?t([s]):s},Kc}var Qc,Jg;function JA(){if(Jg)return Qc;Jg=1;var e=Cs()(),t=mo(),n=t("Object.prototype.toString"),r=function(a){return e&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:n(a)==="[object Arguments]"},o=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]"},i=function(){return r(arguments)}();return r.isLegacyArguments=o,Qc=i?r:o,Qc}var Xc,Zg;function ZA(){if(Zg)return Xc;Zg=1;var e=mo(),t=Cs()(),n=Kg(),r=xi(),o;if(t){var i=e("RegExp.prototype.exec"),s={},a=function(){throw s},c={toString:a,valueOf:a};typeof Symbol.toPrimitive=="symbol"&&(c[Symbol.toPrimitive]=a),o=function(f){if(!f||typeof f!="object")return!1;var m=r(f,"lastIndex"),w=m&&n(m,"value");if(!w)return!1;try{i(f,c)}catch(y){return y===s}}}else{var u=e("Object.prototype.toString"),l="[object RegExp]";o=function(f){return!f||typeof f!="object"&&typeof f!="function"?!1:u(f)===l}}return Xc=o,Xc}var Yc,em;function eR(){if(em)return Yc;em=1;var e=mo(),t=ZA(),n=e("RegExp.prototype.exec"),r=ho();return Yc=function(i){if(!t(i))throw new r("`regex` must be a RegExp");return function(a){return n(i,a)!==null}},Yc}var Jc,tm;function tR(){if(tm)return Jc;tm=1;var e=mo(),t=eR(),n=t(/^\s*(?:function)?\*/),r=Cs()(),o=Wc(),i=e("Object.prototype.toString"),s=e("Function.prototype.toString"),a=function(){if(!r)return!1;try{return Function("return function*() {}")()}catch{}},c;return Jc=function(l){if(typeof l!="function")return!1;if(n(s(l)))return!0;if(!r){var d=i(l);return d==="[object GeneratorFunction]"}if(!o)return!1;if(typeof c>"u"){var f=a();c=f?o(f):!1}return o(l)===c},Jc}var Zc,nm;function nR(){if(nm)return Zc;nm=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 o=/^\s*class\b/,i=function(v){try{var h=e.call(v);return o.test(h)}catch{return!1}},s=function(v){try{return i(v)?!1:(e.call(v),!0)}catch{return!1}},a=Object.prototype.toString,c="[object Object]",u="[object Function]",l="[object GeneratorFunction]",d="[object HTMLAllCollection]",f="[object HTML document.all class]",m="[object HTMLCollection]",w=typeof Symbol=="function"&&!!Symbol.toStringTag,y=!(0 in[,]),E=function(){return!1};if(typeof document=="object"){var b=document.all;a.call(b)===a.call(document.all)&&(E=function(v){if((y||!v)&&(typeof v>"u"||typeof v=="object"))try{var h=a.call(v);return(h===d||h===f||h===m||h===c)&&v("")==null}catch{}return!1})}return Zc=t?function(v){if(E(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!i(v)&&s(v)}:function(v){if(E(v))return!0;if(!v||typeof v!="function"&&typeof v!="object")return!1;if(w)return s(v);if(i(v))return!1;var h=a.call(v);return h!==u&&h!==l&&!/^\[object HTML/.test(h)?!1:s(v)},Zc}var eu,rm;function rR(){if(rm)return eu;rm=1;var e=nR(),t=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(c,u,l){for(var d=0,f=c.length;d<f;d++)n.call(c,d)&&(l==null?u(c[d],d,c):u.call(l,c[d],d,c))},o=function(c,u,l){for(var d=0,f=c.length;d<f;d++)l==null?u(c.charAt(d),d,c):u.call(l,c.charAt(d),d,c)},i=function(c,u,l){for(var d in c)n.call(c,d)&&(l==null?u(c[d],d,c):u.call(l,c[d],d,c))};function s(a){return t.call(a)==="[object Array]"}return eu=function(c,u,l){if(!e(u))throw new TypeError("iterator must be a function");var d;arguments.length>=3&&(d=l),s(c)?r(c,u,d):typeof c=="string"?o(c,u,d):i(c,u,d)},eu}var tu,im;function iR(){return im||(im=1,tu=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),tu}var nu,om;function oR(){if(om)return nu;om=1;var e=iR(),t=typeof globalThis>"u"?$r:globalThis;return nu=function(){for(var r=[],o=0;o<e.length;o++)typeof t[e[o]]=="function"&&(r[r.length]=e[o]);return r},nu}var ru={exports:{}},iu,sm;function sR(){if(sm)return iu;sm=1;var e=Ps(),t=bg(),n=ho(),r=xi();return iu=function(i,s,a){if(!i||typeof i!="object"&&typeof i!="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 c=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,f=!!r&&r(i,s);if(e)e(i,s,{configurable:l===null&&f?f.configurable:!l,enumerable:c===null&&f?f.enumerable:!c,value:a,writable:u===null&&f?f.writable:!u});else if(d||!c&&!u&&!l)i[s]=a;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},iu}var ou,am;function aR(){if(am)return ou;am=1;var e=Ps(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},ou=t,ou}var su,lm;function lR(){if(lm)return su;lm=1;var e=Xg(),t=sR(),n=aR()(),r=xi(),o=ho(),i=e("%Math.floor%");return su=function(a,c){if(typeof a!="function")throw new o("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||i(c)!==c)throw new o("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],l=!0,d=!0;if("length"in a&&r){var f=r(a,"length");f&&!f.configurable&&(l=!1),f&&!f.writable&&(d=!1)}return(l||d||!u)&&(n?t(a,"length",c,!0,!0):t(a,"length",c)),a},su}var au,cm;function cR(){if(cm)return au;cm=1;var e=go(),t=Mc(),n=Vg();return au=function(){return n(e,t,arguments)},au}var um;function uR(){return um||(um=1,function(e){var t=lR(),n=Ps(),r=qc(),o=cR();e.exports=function(s){var a=r(arguments),c=s.length-(arguments.length-1);return t(a,1+(c>0?c:0),!0)},n?n(e.exports,"apply",{value:o}):e.exports.apply=o}(ru)),ru.exports}var lu,fm;function dm(){if(fm)return lu;fm=1;var e=rR(),t=oR(),n=uR(),r=mo(),o=xi(),i=Wc(),s=r("Object.prototype.toString"),a=Cs()(),c=typeof globalThis>"u"?$r:globalThis,u=t(),l=r("String.prototype.slice"),d=r("Array.prototype.indexOf",!0)||function(E,b){for(var g=0;g<E.length;g+=1)if(E[g]===b)return g;return-1},f={__proto__:null};a&&o&&i?e(u,function(y){var E=new c[y];if(Symbol.toStringTag in E&&i){var b=i(E),g=o(b,Symbol.toStringTag);if(!g&&b){var v=i(b);g=o(v,Symbol.toStringTag)}f["$"+y]=n(g.get)}}):e(u,function(y){var E=new c[y],b=E.slice||E.set;b&&(f["$"+y]=n(b))});var m=function(E){var b=!1;return e(f,function(g,v){if(!b)try{"$"+g(E)===v&&(b=l(v,1))}catch{}}),b},w=function(E){var b=!1;return e(f,function(g,v){if(!b)try{g(E),b=l(v,1)}catch{}}),b};return lu=function(E){if(!E||typeof E!="object")return!1;if(!a){var b=l(s(E),8,-1);return d(u,b)>-1?b:b!=="Object"?!1:w(E)}return o?m(E):null},lu}var cu,pm;function fR(){if(pm)return cu;pm=1;var e=dm();return cu=function(n){return!!e(n)},cu}var hm;function dR(){return hm||(hm=1,function(e){var t=JA(),n=tR(),r=dm(),o=fR();function i(Z){return Z.call.bind(Z)}var s=typeof BigInt<"u",a=typeof Symbol<"u",c=i(Object.prototype.toString),u=i(Number.prototype.valueOf),l=i(String.prototype.valueOf),d=i(Boolean.prototype.valueOf);if(s)var f=i(BigInt.prototype.valueOf);if(a)var m=i(Symbol.prototype.valueOf);function w(Z,xe){if(typeof Z!="object")return!1;try{return xe(Z),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=n,e.isTypedArray=o;function y(Z){return typeof Promise<"u"&&Z instanceof Promise||Z!==null&&typeof Z=="object"&&typeof Z.then=="function"&&typeof Z.catch=="function"}e.isPromise=y;function E(Z){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Z):o(Z)||ne(Z)}e.isArrayBufferView=E;function b(Z){return r(Z)==="Uint8Array"}e.isUint8Array=b;function g(Z){return r(Z)==="Uint8ClampedArray"}e.isUint8ClampedArray=g;function v(Z){return r(Z)==="Uint16Array"}e.isUint16Array=v;function h(Z){return r(Z)==="Uint32Array"}e.isUint32Array=h;function S(Z){return r(Z)==="Int8Array"}e.isInt8Array=S;function T(Z){return r(Z)==="Int16Array"}e.isInt16Array=T;function I(Z){return r(Z)==="Int32Array"}e.isInt32Array=I;function _(Z){return r(Z)==="Float32Array"}e.isFloat32Array=_;function A(Z){return r(Z)==="Float64Array"}e.isFloat64Array=A;function $(Z){return r(Z)==="BigInt64Array"}e.isBigInt64Array=$;function D(Z){return r(Z)==="BigUint64Array"}e.isBigUint64Array=D;function N(Z){return c(Z)==="[object Map]"}N.working=typeof Map<"u"&&N(new Map);function x(Z){return typeof Map>"u"?!1:N.working?N(Z):Z instanceof Map}e.isMap=x;function V(Z){return c(Z)==="[object Set]"}V.working=typeof Set<"u"&&V(new Set);function G(Z){return typeof Set>"u"?!1:V.working?V(Z):Z instanceof Set}e.isSet=G;function ae(Z){return c(Z)==="[object WeakMap]"}ae.working=typeof WeakMap<"u"&&ae(new WeakMap);function ye(Z){return typeof WeakMap>"u"?!1:ae.working?ae(Z):Z instanceof WeakMap}e.isWeakMap=ye;function ue(Z){return c(Z)==="[object WeakSet]"}ue.working=typeof WeakSet<"u"&&ue(new WeakSet);function te(Z){return ue(Z)}e.isWeakSet=te;function ce(Z){return c(Z)==="[object ArrayBuffer]"}ce.working=typeof ArrayBuffer<"u"&&ce(new ArrayBuffer);function oe(Z){return typeof ArrayBuffer>"u"?!1:ce.working?ce(Z):Z instanceof ArrayBuffer}e.isArrayBuffer=oe;function J(Z){return c(Z)==="[object DataView]"}J.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&J(new DataView(new ArrayBuffer(1),0,1));function ne(Z){return typeof DataView>"u"?!1:J.working?J(Z):Z instanceof DataView}e.isDataView=ne;var se=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Re(Z){return c(Z)==="[object SharedArrayBuffer]"}function H(Z){return typeof se>"u"?!1:(typeof Re.working>"u"&&(Re.working=Re(new se)),Re.working?Re(Z):Z instanceof se)}e.isSharedArrayBuffer=H;function R(Z){return c(Z)==="[object AsyncFunction]"}e.isAsyncFunction=R;function F(Z){return c(Z)==="[object Map Iterator]"}e.isMapIterator=F;function K(Z){return c(Z)==="[object Set Iterator]"}e.isSetIterator=K;function z(Z){return c(Z)==="[object Generator]"}e.isGeneratorObject=z;function M(Z){return c(Z)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=M;function q(Z){return w(Z,u)}e.isNumberObject=q;function ge(Z){return w(Z,l)}e.isStringObject=ge;function _e(Z){return w(Z,d)}e.isBooleanObject=_e;function Le(Z){return s&&w(Z,f)}e.isBigIntObject=Le;function ke(Z){return a&&w(Z,m)}e.isSymbolObject=ke;function Pe(Z){return q(Z)||ge(Z)||_e(Z)||Le(Z)||ke(Z)}e.isBoxedPrimitive=Pe;function De(Z){return typeof Uint8Array<"u"&&(oe(Z)||H(Z))}e.isAnyArrayBuffer=De,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Z){Object.defineProperty(e,Z,{enumerable:!1,value:function(){throw new Error(Z+" is not supported in userland")}})})}(lc)),lc}var uu,gm;function pR(){return gm||(gm=1,uu=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),uu}var mm;function ym(){return mm||(mm=1,function(e){var t=Object.getOwnPropertyDescriptors||function(ne){for(var se=Object.keys(ne),Re={},H=0;H<se.length;H++)Re[se[H]]=Object.getOwnPropertyDescriptor(ne,se[H]);return Re},n=/%[sdj%]/g;e.format=function(J){if(!S(J)){for(var ne=[],se=0;se<arguments.length;se++)ne.push(s(arguments[se]));return ne.join(" ")}for(var se=1,Re=arguments,H=Re.length,R=String(J).replace(n,function(K){if(K==="%%")return"%";if(se>=H)return K;switch(K){case"%s":return String(Re[se++]);case"%d":return Number(Re[se++]);case"%j":try{return JSON.stringify(Re[se++])}catch{return"[Circular]"}default:return K}}),F=Re[se];se<H;F=Re[++se])g(F)||!A(F)?R+=" "+F:R+=" "+s(F);return R},e.deprecate=function(J,ne){if(typeof ve<"u"&&ve.noDeprecation===!0)return J;if(typeof ve>"u")return function(){return e.deprecate(J,ne).apply(this,arguments)};var se=!1;function Re(){if(!se){if(ve.throwDeprecation)throw new Error(ne);ve.traceDeprecation?console.trace(ne):console.error(ne),se=!0}return J.apply(this,arguments)}return Re};var r={},o=/^$/;if(ve.env.NODE_DEBUG){var i=ve.env.NODE_DEBUG;i=i.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+i+"$","i")}e.debuglog=function(J){if(J=J.toUpperCase(),!r[J])if(o.test(J)){var ne=ve.pid;r[J]=function(){var se=e.format.apply(e,arguments);console.error("%s %d: %s",J,ne,se)}}else r[J]=function(){};return r[J]};function s(J,ne){var se={seen:[],stylize:c};return arguments.length>=3&&(se.depth=arguments[2]),arguments.length>=4&&(se.colors=arguments[3]),b(ne)?se.showHidden=ne:ne&&e._extend(se,ne),I(se.showHidden)&&(se.showHidden=!1),I(se.depth)&&(se.depth=2),I(se.colors)&&(se.colors=!1),I(se.customInspect)&&(se.customInspect=!0),se.colors&&(se.stylize=a),l(se,J,se.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(J,ne){var se=s.styles[ne];return se?"\x1B["+s.colors[se][0]+"m"+J+"\x1B["+s.colors[se][1]+"m":J}function c(J,ne){return J}function u(J){var ne={};return J.forEach(function(se,Re){ne[se]=!0}),ne}function l(J,ne,se){if(J.customInspect&&ne&&N(ne.inspect)&&ne.inspect!==e.inspect&&!(ne.constructor&&ne.constructor.prototype===ne)){var Re=ne.inspect(se,J);return S(Re)||(Re=l(J,Re,se)),Re}var H=d(J,ne);if(H)return H;var R=Object.keys(ne),F=u(R);if(J.showHidden&&(R=Object.getOwnPropertyNames(ne)),D(ne)&&(R.indexOf("message")>=0||R.indexOf("description")>=0))return f(ne);if(R.length===0){if(N(ne)){var K=ne.name?": "+ne.name:"";return J.stylize("[Function"+K+"]","special")}if(_(ne))return J.stylize(RegExp.prototype.toString.call(ne),"regexp");if($(ne))return J.stylize(Date.prototype.toString.call(ne),"date");if(D(ne))return f(ne)}var z="",M=!1,q=["{","}"];if(E(ne)&&(M=!0,q=["[","]"]),N(ne)){var ge=ne.name?": "+ne.name:"";z=" [Function"+ge+"]"}if(_(ne)&&(z=" "+RegExp.prototype.toString.call(ne)),$(ne)&&(z=" "+Date.prototype.toUTCString.call(ne)),D(ne)&&(z=" "+f(ne)),R.length===0&&(!M||ne.length==0))return q[0]+z+q[1];if(se<0)return _(ne)?J.stylize(RegExp.prototype.toString.call(ne),"regexp"):J.stylize("[Object]","special");J.seen.push(ne);var _e;return M?_e=m(J,ne,se,F,R):_e=R.map(function(Le){return w(J,ne,se,F,Le,M)}),J.seen.pop(),y(_e,z,q)}function d(J,ne){if(I(ne))return J.stylize("undefined","undefined");if(S(ne)){var se="'"+JSON.stringify(ne).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return J.stylize(se,"string")}if(h(ne))return J.stylize(""+ne,"number");if(b(ne))return J.stylize(""+ne,"boolean");if(g(ne))return J.stylize("null","null")}function f(J){return"["+Error.prototype.toString.call(J)+"]"}function m(J,ne,se,Re,H){for(var R=[],F=0,K=ne.length;F<K;++F)ue(ne,String(F))?R.push(w(J,ne,se,Re,String(F),!0)):R.push("");return H.forEach(function(z){z.match(/^\d+$/)||R.push(w(J,ne,se,Re,z,!0))}),R}function w(J,ne,se,Re,H,R){var F,K,z;if(z=Object.getOwnPropertyDescriptor(ne,H)||{value:ne[H]},z.get?z.set?K=J.stylize("[Getter/Setter]","special"):K=J.stylize("[Getter]","special"):z.set&&(K=J.stylize("[Setter]","special")),ue(Re,H)||(F="["+H+"]"),K||(J.seen.indexOf(z.value)<0?(g(se)?K=l(J,z.value,null):K=l(J,z.value,se-1),K.indexOf(`
17
- `)>-1&&(R?K=K.split(`
18
- `).map(function(M){return" "+M}).join(`
16
+ */(function(g){const y=r,p=E,S=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;g.Buffer=_,g.SlowBuffer=oe,g.INSPECT_MAX_BYTES=50;const T=2147483647;g.kMaxLength=T;const{Uint8Array:R,ArrayBuffer:I,SharedArrayBuffer:A}=globalThis;_.TYPED_ARRAY_SUPPORT=D(),!_.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 D(){try{const j=new R(1),P={foo:function(){return 42}};return Object.setPrototypeOf(P,R.prototype),Object.setPrototypeOf(j,P),j.foo()===42}catch{return!1}}Object.defineProperty(_.prototype,"parent",{enumerable:!0,get:function(){if(_.isBuffer(this))return this.buffer}}),Object.defineProperty(_.prototype,"offset",{enumerable:!0,get:function(){if(_.isBuffer(this))return this.byteOffset}});function H(j){if(j>T)throw new RangeError('The value "'+j+'" is invalid for option "size"');const P=new R(j);return Object.setPrototypeOf(P,_.prototype),P}function _(j,P,F){if(typeof j=="number"){if(typeof P=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ne(j)}return x(j,P,F)}_.poolSize=8192;function x(j,P,F){if(typeof j=="string")return ie(j,P);if(I.isView(j))return ue(j);if(j==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof j);if(qt(j,I)||j&&qt(j.buffer,I)||typeof A<"u"&&(qt(j,A)||j&&qt(j.buffer,A)))return de(j,P,F);if(typeof j=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const J=j.valueOf&&j.valueOf();if(J!=null&&J!==j)return _.from(J,P,F);const se=ce(j);if(se)return se;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof j[Symbol.toPrimitive]=="function")return _.from(j[Symbol.toPrimitive]("string"),P,F);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof j)}_.from=function(j,P,F){return x(j,P,F)},Object.setPrototypeOf(_.prototype,R.prototype),Object.setPrototypeOf(_,R);function z(j){if(typeof j!="number")throw new TypeError('"size" argument must be of type number');if(j<0)throw new RangeError('The value "'+j+'" is invalid for option "size"')}function G(j,P,F){return z(j),j<=0?H(j):P!==void 0?typeof F=="string"?H(j).fill(P,F):H(j).fill(P):H(j)}_.alloc=function(j,P,F){return G(j,P,F)};function ne(j){return z(j),H(j<0?0:X(j)|0)}_.allocUnsafe=function(j){return ne(j)},_.allocUnsafeSlow=function(j){return ne(j)};function ie(j,P){if((typeof P!="string"||P==="")&&(P="utf8"),!_.isEncoding(P))throw new TypeError("Unknown encoding: "+P);const F=ae(j,P)|0;let J=H(F);const se=J.write(j,P);return se!==F&&(J=J.slice(0,se)),J}function ee(j){const P=j.length<0?0:X(j.length)|0,F=H(P);for(let J=0;J<P;J+=1)F[J]=j[J]&255;return F}function ue(j){if(qt(j,R)){const P=new R(j);return de(P.buffer,P.byteOffset,P.byteLength)}return ee(j)}function de(j,P,F){if(P<0||j.byteLength<P)throw new RangeError('"offset" is outside of buffer bounds');if(j.byteLength<P+(F||0))throw new RangeError('"length" is outside of buffer bounds');let J;return P===void 0&&F===void 0?J=new R(j):F===void 0?J=new R(j,P):J=new R(j,P,F),Object.setPrototypeOf(J,_.prototype),J}function ce(j){if(_.isBuffer(j)){const P=X(j.length)|0,F=H(P);return F.length===0||j.copy(F,0,0,P),F}if(j.length!==void 0)return typeof j.length!="number"||$e(j.length)?H(0):ee(j);if(j.type==="Buffer"&&Array.isArray(j.data))return ee(j.data)}function X(j){if(j>=T)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+T.toString(16)+" bytes");return j|0}function oe(j){return+j!=j&&(j=0),_.alloc(+j)}_.isBuffer=function(P){return P!=null&&P._isBuffer===!0&&P!==_.prototype},_.compare=function(P,F){if(qt(P,R)&&(P=_.from(P,P.offset,P.byteLength)),qt(F,R)&&(F=_.from(F,F.offset,F.byteLength)),!_.isBuffer(P)||!_.isBuffer(F))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(P===F)return 0;let J=P.length,se=F.length;for(let Ee=0,Ie=Math.min(J,se);Ee<Ie;++Ee)if(P[Ee]!==F[Ee]){J=P[Ee],se=F[Ee];break}return J<se?-1:se<J?1:0},_.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}},_.concat=function(P,F){if(!Array.isArray(P))throw new TypeError('"list" argument must be an Array of Buffers');if(P.length===0)return _.alloc(0);let J;if(F===void 0)for(F=0,J=0;J<P.length;++J)F+=P[J].length;const se=_.allocUnsafe(F);let Ee=0;for(J=0;J<P.length;++J){let Ie=P[J];if(qt(Ie,R))Ee+Ie.length>se.length?(_.isBuffer(Ie)||(Ie=_.from(Ie)),Ie.copy(se,Ee)):R.prototype.set.call(se,Ie,Ee);else if(_.isBuffer(Ie))Ie.copy(se,Ee);else throw new TypeError('"list" argument must be an Array of Buffers');Ee+=Ie.length}return se};function ae(j,P){if(_.isBuffer(j))return j.length;if(I.isView(j)||qt(j,I))return j.byteLength;if(typeof j!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof j);const F=j.length,J=arguments.length>2&&arguments[2]===!0;if(!J&&F===0)return 0;let se=!1;for(;;)switch(P){case"ascii":case"latin1":case"binary":return F;case"utf8":case"utf-8":return Le(j).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F*2;case"hex":return F>>>1;case"base64":return tt(j).length;default:if(se)return J?-1:Le(j).length;P=(""+P).toLowerCase(),se=!0}}_.byteLength=ae;function Ce(j,P,F){let J=!1;if((P===void 0||P<0)&&(P=0),P>this.length||((F===void 0||F>this.length)&&(F=this.length),F<=0)||(F>>>=0,P>>>=0,F<=P))return"";for(j||(j="utf8");;)switch(j){case"hex":return Ye(this,P,F);case"utf8":case"utf-8":return De(this,P,F);case"ascii":return Be(this,P,F);case"latin1":case"binary":return Se(this,P,F);case"base64":return Re(this,P,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Qe(this,P,F);default:if(J)throw new TypeError("Unknown encoding: "+j);j=(j+"").toLowerCase(),J=!0}}_.prototype._isBuffer=!0;function Z(j,P,F){const J=j[P];j[P]=j[F],j[F]=J}_.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 F=0;F<P;F+=2)Z(this,F,F+1);return this},_.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 F=0;F<P;F+=4)Z(this,F,F+3),Z(this,F+1,F+2);return this},_.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 F=0;F<P;F+=8)Z(this,F,F+7),Z(this,F+1,F+6),Z(this,F+2,F+5),Z(this,F+3,F+4);return this},_.prototype.toString=function(){const P=this.length;return P===0?"":arguments.length===0?De(this,0,P):Ce.apply(this,arguments)},_.prototype.toLocaleString=_.prototype.toString,_.prototype.equals=function(P){if(!_.isBuffer(P))throw new TypeError("Argument must be a Buffer");return this===P?!0:_.compare(this,P)===0},_.prototype.inspect=function(){let P="";const F=g.INSPECT_MAX_BYTES;return P=this.toString("hex",0,F).replace(/(.{2})/g,"$1 ").trim(),this.length>F&&(P+=" ... "),"<Buffer "+P+">"},S&&(_.prototype[S]=_.prototype.inspect),_.prototype.compare=function(P,F,J,se,Ee){if(qt(P,R)&&(P=_.from(P,P.offset,P.byteLength)),!_.isBuffer(P))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof P);if(F===void 0&&(F=0),J===void 0&&(J=P?P.length:0),se===void 0&&(se=0),Ee===void 0&&(Ee=this.length),F<0||J>P.length||se<0||Ee>this.length)throw new RangeError("out of range index");if(se>=Ee&&F>=J)return 0;if(se>=Ee)return-1;if(F>=J)return 1;if(F>>>=0,J>>>=0,se>>>=0,Ee>>>=0,this===P)return 0;let Ie=Ee-se,ot=J-F;const xt=Math.min(Ie,ot),Ot=this.slice(se,Ee),Nt=P.slice(F,J);for(let St=0;St<xt;++St)if(Ot[St]!==Nt[St]){Ie=Ot[St],ot=Nt[St];break}return Ie<ot?-1:ot<Ie?1:0};function N(j,P,F,J,se){if(j.length===0)return-1;if(typeof F=="string"?(J=F,F=0):F>2147483647?F=2147483647:F<-2147483648&&(F=-2147483648),F=+F,$e(F)&&(F=se?0:j.length-1),F<0&&(F=j.length+F),F>=j.length){if(se)return-1;F=j.length-1}else if(F<0)if(se)F=0;else return-1;if(typeof P=="string"&&(P=_.from(P,J)),_.isBuffer(P))return P.length===0?-1:O(j,P,F,J,se);if(typeof P=="number")return P=P&255,typeof R.prototype.indexOf=="function"?se?R.prototype.indexOf.call(j,P,F):R.prototype.lastIndexOf.call(j,P,F):O(j,[P],F,J,se);throw new TypeError("val must be string, number or Buffer")}function O(j,P,F,J,se){let Ee=1,Ie=j.length,ot=P.length;if(J!==void 0&&(J=String(J).toLowerCase(),J==="ucs2"||J==="ucs-2"||J==="utf16le"||J==="utf-16le")){if(j.length<2||P.length<2)return-1;Ee=2,Ie/=2,ot/=2,F/=2}function xt(Nt,St){return Ee===1?Nt[St]:Nt.readUInt16BE(St*Ee)}let Ot;if(se){let Nt=-1;for(Ot=F;Ot<Ie;Ot++)if(xt(j,Ot)===xt(P,Nt===-1?0:Ot-Nt)){if(Nt===-1&&(Nt=Ot),Ot-Nt+1===ot)return Nt*Ee}else Nt!==-1&&(Ot-=Ot-Nt),Nt=-1}else for(F+ot>Ie&&(F=Ie-ot),Ot=F;Ot>=0;Ot--){let Nt=!0;for(let St=0;St<ot;St++)if(xt(j,Ot+St)!==xt(P,St)){Nt=!1;break}if(Nt)return Ot}return-1}_.prototype.includes=function(P,F,J){return this.indexOf(P,F,J)!==-1},_.prototype.indexOf=function(P,F,J){return N(this,P,F,J,!0)},_.prototype.lastIndexOf=function(P,F,J){return N(this,P,F,J,!1)};function K(j,P,F,J){F=Number(F)||0;const se=j.length-F;J?(J=Number(J),J>se&&(J=se)):J=se;const Ee=P.length;J>Ee/2&&(J=Ee/2);let Ie;for(Ie=0;Ie<J;++Ie){const ot=parseInt(P.substr(Ie*2,2),16);if($e(ot))return Ie;j[F+Ie]=ot}return Ie}function V(j,P,F,J){return _n(Le(P,j.length-F),j,F,J)}function $(j,P,F,J){return _n(Je(P),j,F,J)}function U(j,P,F,J){return _n(tt(P),j,F,J)}function pe(j,P,F,J){return _n(et(P,j.length-F),j,F,J)}_.prototype.write=function(P,F,J,se){if(F===void 0)se="utf8",J=this.length,F=0;else if(J===void 0&&typeof F=="string")se=F,J=this.length,F=0;else if(isFinite(F))F=F>>>0,isFinite(J)?(J=J>>>0,se===void 0&&(se="utf8")):(se=J,J=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Ee=this.length-F;if((J===void 0||J>Ee)&&(J=Ee),P.length>0&&(J<0||F<0)||F>this.length)throw new RangeError("Attempt to write outside buffer bounds");se||(se="utf8");let Ie=!1;for(;;)switch(se){case"hex":return K(this,P,F,J);case"utf8":case"utf-8":return V(this,P,F,J);case"ascii":case"latin1":case"binary":return $(this,P,F,J);case"base64":return U(this,P,F,J);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,P,F,J);default:if(Ie)throw new TypeError("Unknown encoding: "+se);se=(""+se).toLowerCase(),Ie=!0}},_.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Re(j,P,F){return P===0&&F===j.length?y.fromByteArray(j):y.fromByteArray(j.slice(P,F))}function De(j,P,F){F=Math.min(j.length,F);const J=[];let se=P;for(;se<F;){const Ee=j[se];let Ie=null,ot=Ee>239?4:Ee>223?3:Ee>191?2:1;if(se+ot<=F){let xt,Ot,Nt,St;switch(ot){case 1:Ee<128&&(Ie=Ee);break;case 2:xt=j[se+1],(xt&192)===128&&(St=(Ee&31)<<6|xt&63,St>127&&(Ie=St));break;case 3:xt=j[se+1],Ot=j[se+2],(xt&192)===128&&(Ot&192)===128&&(St=(Ee&15)<<12|(xt&63)<<6|Ot&63,St>2047&&(St<55296||St>57343)&&(Ie=St));break;case 4:xt=j[se+1],Ot=j[se+2],Nt=j[se+3],(xt&192)===128&&(Ot&192)===128&&(Nt&192)===128&&(St=(Ee&15)<<18|(xt&63)<<12|(Ot&63)<<6|Nt&63,St>65535&&St<1114112&&(Ie=St))}}Ie===null?(Ie=65533,ot=1):Ie>65535&&(Ie-=65536,J.push(Ie>>>10&1023|55296),Ie=56320|Ie&1023),J.push(Ie),se+=ot}return Oe(J)}const ke=4096;function Oe(j){const P=j.length;if(P<=ke)return String.fromCharCode.apply(String,j);let F="",J=0;for(;J<P;)F+=String.fromCharCode.apply(String,j.slice(J,J+=ke));return F}function Be(j,P,F){let J="";F=Math.min(j.length,F);for(let se=P;se<F;++se)J+=String.fromCharCode(j[se]&127);return J}function Se(j,P,F){let J="";F=Math.min(j.length,F);for(let se=P;se<F;++se)J+=String.fromCharCode(j[se]);return J}function Ye(j,P,F){const J=j.length;(!P||P<0)&&(P=0),(!F||F<0||F>J)&&(F=J);let se="";for(let Ee=P;Ee<F;++Ee)se+=Ze[j[Ee]];return se}function Qe(j,P,F){const J=j.slice(P,F);let se="";for(let Ee=0;Ee<J.length-1;Ee+=2)se+=String.fromCharCode(J[Ee]+J[Ee+1]*256);return se}_.prototype.slice=function(P,F){const J=this.length;P=~~P,F=F===void 0?J:~~F,P<0?(P+=J,P<0&&(P=0)):P>J&&(P=J),F<0?(F+=J,F<0&&(F=0)):F>J&&(F=J),F<P&&(F=P);const se=this.subarray(P,F);return Object.setPrototypeOf(se,_.prototype),se};function he(j,P,F){if(j%1!==0||j<0)throw new RangeError("offset is not uint");if(j+P>F)throw new RangeError("Trying to access beyond buffer length")}_.prototype.readUintLE=_.prototype.readUIntLE=function(P,F,J){P=P>>>0,F=F>>>0,J||he(P,F,this.length);let se=this[P],Ee=1,Ie=0;for(;++Ie<F&&(Ee*=256);)se+=this[P+Ie]*Ee;return se},_.prototype.readUintBE=_.prototype.readUIntBE=function(P,F,J){P=P>>>0,F=F>>>0,J||he(P,F,this.length);let se=this[P+--F],Ee=1;for(;F>0&&(Ee*=256);)se+=this[P+--F]*Ee;return se},_.prototype.readUint8=_.prototype.readUInt8=function(P,F){return P=P>>>0,F||he(P,1,this.length),this[P]},_.prototype.readUint16LE=_.prototype.readUInt16LE=function(P,F){return P=P>>>0,F||he(P,2,this.length),this[P]|this[P+1]<<8},_.prototype.readUint16BE=_.prototype.readUInt16BE=function(P,F){return P=P>>>0,F||he(P,2,this.length),this[P]<<8|this[P+1]},_.prototype.readUint32LE=_.prototype.readUInt32LE=function(P,F){return P=P>>>0,F||he(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+this[P+3]*16777216},_.prototype.readUint32BE=_.prototype.readUInt32BE=function(P,F){return P=P>>>0,F||he(P,4,this.length),this[P]*16777216+(this[P+1]<<16|this[P+2]<<8|this[P+3])},_.prototype.readBigUInt64LE=it(function(P){P=P>>>0,q(P,"offset");const F=this[P],J=this[P+7];(F===void 0||J===void 0)&&re(P,this.length-8);const se=F+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24,Ee=this[++P]+this[++P]*2**8+this[++P]*2**16+J*2**24;return BigInt(se)+(BigInt(Ee)<<BigInt(32))}),_.prototype.readBigUInt64BE=it(function(P){P=P>>>0,q(P,"offset");const F=this[P],J=this[P+7];(F===void 0||J===void 0)&&re(P,this.length-8);const se=F*2**24+this[++P]*2**16+this[++P]*2**8+this[++P],Ee=this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+J;return(BigInt(se)<<BigInt(32))+BigInt(Ee)}),_.prototype.readIntLE=function(P,F,J){P=P>>>0,F=F>>>0,J||he(P,F,this.length);let se=this[P],Ee=1,Ie=0;for(;++Ie<F&&(Ee*=256);)se+=this[P+Ie]*Ee;return Ee*=128,se>=Ee&&(se-=Math.pow(2,8*F)),se},_.prototype.readIntBE=function(P,F,J){P=P>>>0,F=F>>>0,J||he(P,F,this.length);let se=F,Ee=1,Ie=this[P+--se];for(;se>0&&(Ee*=256);)Ie+=this[P+--se]*Ee;return Ee*=128,Ie>=Ee&&(Ie-=Math.pow(2,8*F)),Ie},_.prototype.readInt8=function(P,F){return P=P>>>0,F||he(P,1,this.length),this[P]&128?(255-this[P]+1)*-1:this[P]},_.prototype.readInt16LE=function(P,F){P=P>>>0,F||he(P,2,this.length);const J=this[P]|this[P+1]<<8;return J&32768?J|4294901760:J},_.prototype.readInt16BE=function(P,F){P=P>>>0,F||he(P,2,this.length);const J=this[P+1]|this[P]<<8;return J&32768?J|4294901760:J},_.prototype.readInt32LE=function(P,F){return P=P>>>0,F||he(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},_.prototype.readInt32BE=function(P,F){return P=P>>>0,F||he(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},_.prototype.readBigInt64LE=it(function(P){P=P>>>0,q(P,"offset");const F=this[P],J=this[P+7];(F===void 0||J===void 0)&&re(P,this.length-8);const se=this[P+4]+this[P+5]*2**8+this[P+6]*2**16+(J<<24);return(BigInt(se)<<BigInt(32))+BigInt(F+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24)}),_.prototype.readBigInt64BE=it(function(P){P=P>>>0,q(P,"offset");const F=this[P],J=this[P+7];(F===void 0||J===void 0)&&re(P,this.length-8);const se=(F<<24)+this[++P]*2**16+this[++P]*2**8+this[++P];return(BigInt(se)<<BigInt(32))+BigInt(this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+J)}),_.prototype.readFloatLE=function(P,F){return P=P>>>0,F||he(P,4,this.length),p.read(this,P,!0,23,4)},_.prototype.readFloatBE=function(P,F){return P=P>>>0,F||he(P,4,this.length),p.read(this,P,!1,23,4)},_.prototype.readDoubleLE=function(P,F){return P=P>>>0,F||he(P,8,this.length),p.read(this,P,!0,52,8)},_.prototype.readDoubleBE=function(P,F){return P=P>>>0,F||he(P,8,this.length),p.read(this,P,!1,52,8)};function Pe(j,P,F,J,se,Ee){if(!_.isBuffer(j))throw new TypeError('"buffer" argument must be a Buffer instance');if(P>se||P<Ee)throw new RangeError('"value" argument is out of bounds');if(F+J>j.length)throw new RangeError("Index out of range")}_.prototype.writeUintLE=_.prototype.writeUIntLE=function(P,F,J,se){if(P=+P,F=F>>>0,J=J>>>0,!se){const ot=Math.pow(2,8*J)-1;Pe(this,P,F,J,ot,0)}let Ee=1,Ie=0;for(this[F]=P&255;++Ie<J&&(Ee*=256);)this[F+Ie]=P/Ee&255;return F+J},_.prototype.writeUintBE=_.prototype.writeUIntBE=function(P,F,J,se){if(P=+P,F=F>>>0,J=J>>>0,!se){const ot=Math.pow(2,8*J)-1;Pe(this,P,F,J,ot,0)}let Ee=J-1,Ie=1;for(this[F+Ee]=P&255;--Ee>=0&&(Ie*=256);)this[F+Ee]=P/Ie&255;return F+J},_.prototype.writeUint8=_.prototype.writeUInt8=function(P,F,J){return P=+P,F=F>>>0,J||Pe(this,P,F,1,255,0),this[F]=P&255,F+1},_.prototype.writeUint16LE=_.prototype.writeUInt16LE=function(P,F,J){return P=+P,F=F>>>0,J||Pe(this,P,F,2,65535,0),this[F]=P&255,this[F+1]=P>>>8,F+2},_.prototype.writeUint16BE=_.prototype.writeUInt16BE=function(P,F,J){return P=+P,F=F>>>0,J||Pe(this,P,F,2,65535,0),this[F]=P>>>8,this[F+1]=P&255,F+2},_.prototype.writeUint32LE=_.prototype.writeUInt32LE=function(P,F,J){return P=+P,F=F>>>0,J||Pe(this,P,F,4,4294967295,0),this[F+3]=P>>>24,this[F+2]=P>>>16,this[F+1]=P>>>8,this[F]=P&255,F+4},_.prototype.writeUint32BE=_.prototype.writeUInt32BE=function(P,F,J){return P=+P,F=F>>>0,J||Pe(this,P,F,4,4294967295,0),this[F]=P>>>24,this[F+1]=P>>>16,this[F+2]=P>>>8,this[F+3]=P&255,F+4};function We(j,P,F,J,se){Y(P,J,se,j,F,7);let Ee=Number(P&BigInt(4294967295));j[F++]=Ee,Ee=Ee>>8,j[F++]=Ee,Ee=Ee>>8,j[F++]=Ee,Ee=Ee>>8,j[F++]=Ee;let Ie=Number(P>>BigInt(32)&BigInt(4294967295));return j[F++]=Ie,Ie=Ie>>8,j[F++]=Ie,Ie=Ie>>8,j[F++]=Ie,Ie=Ie>>8,j[F++]=Ie,F}function Xe(j,P,F,J,se){Y(P,J,se,j,F,7);let Ee=Number(P&BigInt(4294967295));j[F+7]=Ee,Ee=Ee>>8,j[F+6]=Ee,Ee=Ee>>8,j[F+5]=Ee,Ee=Ee>>8,j[F+4]=Ee;let Ie=Number(P>>BigInt(32)&BigInt(4294967295));return j[F+3]=Ie,Ie=Ie>>8,j[F+2]=Ie,Ie=Ie>>8,j[F+1]=Ie,Ie=Ie>>8,j[F]=Ie,F+8}_.prototype.writeBigUInt64LE=it(function(P,F=0){return We(this,P,F,BigInt(0),BigInt("0xffffffffffffffff"))}),_.prototype.writeBigUInt64BE=it(function(P,F=0){return Xe(this,P,F,BigInt(0),BigInt("0xffffffffffffffff"))}),_.prototype.writeIntLE=function(P,F,J,se){if(P=+P,F=F>>>0,!se){const xt=Math.pow(2,8*J-1);Pe(this,P,F,J,xt-1,-xt)}let Ee=0,Ie=1,ot=0;for(this[F]=P&255;++Ee<J&&(Ie*=256);)P<0&&ot===0&&this[F+Ee-1]!==0&&(ot=1),this[F+Ee]=(P/Ie>>0)-ot&255;return F+J},_.prototype.writeIntBE=function(P,F,J,se){if(P=+P,F=F>>>0,!se){const xt=Math.pow(2,8*J-1);Pe(this,P,F,J,xt-1,-xt)}let Ee=J-1,Ie=1,ot=0;for(this[F+Ee]=P&255;--Ee>=0&&(Ie*=256);)P<0&&ot===0&&this[F+Ee+1]!==0&&(ot=1),this[F+Ee]=(P/Ie>>0)-ot&255;return F+J},_.prototype.writeInt8=function(P,F,J){return P=+P,F=F>>>0,J||Pe(this,P,F,1,127,-128),P<0&&(P=255+P+1),this[F]=P&255,F+1},_.prototype.writeInt16LE=function(P,F,J){return P=+P,F=F>>>0,J||Pe(this,P,F,2,32767,-32768),this[F]=P&255,this[F+1]=P>>>8,F+2},_.prototype.writeInt16BE=function(P,F,J){return P=+P,F=F>>>0,J||Pe(this,P,F,2,32767,-32768),this[F]=P>>>8,this[F+1]=P&255,F+2},_.prototype.writeInt32LE=function(P,F,J){return P=+P,F=F>>>0,J||Pe(this,P,F,4,2147483647,-2147483648),this[F]=P&255,this[F+1]=P>>>8,this[F+2]=P>>>16,this[F+3]=P>>>24,F+4},_.prototype.writeInt32BE=function(P,F,J){return P=+P,F=F>>>0,J||Pe(this,P,F,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),this[F]=P>>>24,this[F+1]=P>>>16,this[F+2]=P>>>8,this[F+3]=P&255,F+4},_.prototype.writeBigInt64LE=it(function(P,F=0){return We(this,P,F,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),_.prototype.writeBigInt64BE=it(function(P,F=0){return Xe(this,P,F,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function at(j,P,F,J,se,Ee){if(F+J>j.length)throw new RangeError("Index out of range");if(F<0)throw new RangeError("Index out of range")}function _t(j,P,F,J,se){return P=+P,F=F>>>0,se||at(j,P,F,4),p.write(j,P,F,J,23,4),F+4}_.prototype.writeFloatLE=function(P,F,J){return _t(this,P,F,!0,J)},_.prototype.writeFloatBE=function(P,F,J){return _t(this,P,F,!1,J)};function wt(j,P,F,J,se){return P=+P,F=F>>>0,se||at(j,P,F,8),p.write(j,P,F,J,52,8),F+8}_.prototype.writeDoubleLE=function(P,F,J){return wt(this,P,F,!0,J)},_.prototype.writeDoubleBE=function(P,F,J){return wt(this,P,F,!1,J)},_.prototype.copy=function(P,F,J,se){if(!_.isBuffer(P))throw new TypeError("argument should be a Buffer");if(J||(J=0),!se&&se!==0&&(se=this.length),F>=P.length&&(F=P.length),F||(F=0),se>0&&se<J&&(se=J),se===J||P.length===0||this.length===0)return 0;if(F<0)throw new RangeError("targetStart out of bounds");if(J<0||J>=this.length)throw new RangeError("Index out of range");if(se<0)throw new RangeError("sourceEnd out of bounds");se>this.length&&(se=this.length),P.length-F<se-J&&(se=P.length-F+J);const Ee=se-J;return this===P&&typeof R.prototype.copyWithin=="function"?this.copyWithin(F,J,se):R.prototype.set.call(P,this.subarray(J,se),F),Ee},_.prototype.fill=function(P,F,J,se){if(typeof P=="string"){if(typeof F=="string"?(se=F,F=0,J=this.length):typeof J=="string"&&(se=J,J=this.length),se!==void 0&&typeof se!="string")throw new TypeError("encoding must be a string");if(typeof se=="string"&&!_.isEncoding(se))throw new TypeError("Unknown encoding: "+se);if(P.length===1){const Ie=P.charCodeAt(0);(se==="utf8"&&Ie<128||se==="latin1")&&(P=Ie)}}else typeof P=="number"?P=P&255:typeof P=="boolean"&&(P=Number(P));if(F<0||this.length<F||this.length<J)throw new RangeError("Out of range index");if(J<=F)return this;F=F>>>0,J=J===void 0?this.length:J>>>0,P||(P=0);let Ee;if(typeof P=="number")for(Ee=F;Ee<J;++Ee)this[Ee]=P;else{const Ie=_.isBuffer(P)?P:_.from(P,se),ot=Ie.length;if(ot===0)throw new TypeError('The value "'+P+'" is invalid for argument "value"');for(Ee=0;Ee<J-F;++Ee)this[Ee+F]=Ie[Ee%ot]}return this};const Qt={};function L(j,P,F){Qt[j]=class extends F{constructor(){super(),Object.defineProperty(this,"message",{value:P.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${j}]`,this.stack,delete this.name}get code(){return j}set code(se){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:se,writable:!0})}toString(){return`${this.name} [${j}]: ${this.message}`}}}L("ERR_BUFFER_OUT_OF_BOUNDS",function(j){return j?`${j} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),L("ERR_INVALID_ARG_TYPE",function(j,P){return`The "${j}" argument must be of type number. Received type ${typeof P}`},TypeError),L("ERR_OUT_OF_RANGE",function(j,P,F){let J=`The value of "${j}" is out of range.`,se=F;return Number.isInteger(F)&&Math.abs(F)>2**32?se=C(String(F)):typeof F=="bigint"&&(se=String(F),(F>BigInt(2)**BigInt(32)||F<-(BigInt(2)**BigInt(32)))&&(se=C(se)),se+="n"),J+=` It must be ${P}. Received ${se}`,J},RangeError);function C(j){let P="",F=j.length;const J=j[0]==="-"?1:0;for(;F>=J+4;F-=3)P=`_${j.slice(F-3,F)}${P}`;return`${j.slice(0,F)}${P}`}function k(j,P,F){q(P,"offset"),(j[P]===void 0||j[P+F]===void 0)&&re(P,j.length-(F+1))}function Y(j,P,F,J,se,Ee){if(j>F||j<P){const Ie=typeof P=="bigint"?"n":"";let ot;throw P===0||P===BigInt(0)?ot=`>= 0${Ie} and < 2${Ie} ** ${(Ee+1)*8}${Ie}`:ot=`>= -(2${Ie} ** ${(Ee+1)*8-1}${Ie}) and < 2 ** ${(Ee+1)*8-1}${Ie}`,new Qt.ERR_OUT_OF_RANGE("value",ot,j)}k(J,se,Ee)}function q(j,P){if(typeof j!="number")throw new Qt.ERR_INVALID_ARG_TYPE(P,"number",j)}function re(j,P,F){throw Math.floor(j)!==j?(q(j,F),new Qt.ERR_OUT_OF_RANGE("offset","an integer",j)):P<0?new Qt.ERR_BUFFER_OUT_OF_BOUNDS:new Qt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${P}`,j)}const me=/[^+/0-9A-Za-z-_]/g;function Ne(j){if(j=j.split("=")[0],j=j.trim().replace(me,""),j.length<2)return"";for(;j.length%4!==0;)j=j+"=";return j}function Le(j,P){P=P||1/0;let F;const J=j.length;let se=null;const Ee=[];for(let Ie=0;Ie<J;++Ie){if(F=j.charCodeAt(Ie),F>55295&&F<57344){if(!se){if(F>56319){(P-=3)>-1&&Ee.push(239,191,189);continue}else if(Ie+1===J){(P-=3)>-1&&Ee.push(239,191,189);continue}se=F;continue}if(F<56320){(P-=3)>-1&&Ee.push(239,191,189),se=F;continue}F=(se-55296<<10|F-56320)+65536}else se&&(P-=3)>-1&&Ee.push(239,191,189);if(se=null,F<128){if((P-=1)<0)break;Ee.push(F)}else if(F<2048){if((P-=2)<0)break;Ee.push(F>>6|192,F&63|128)}else if(F<65536){if((P-=3)<0)break;Ee.push(F>>12|224,F>>6&63|128,F&63|128)}else if(F<1114112){if((P-=4)<0)break;Ee.push(F>>18|240,F>>12&63|128,F>>6&63|128,F&63|128)}else throw new Error("Invalid code point")}return Ee}function Je(j){const P=[];for(let F=0;F<j.length;++F)P.push(j.charCodeAt(F)&255);return P}function et(j,P){let F,J,se;const Ee=[];for(let Ie=0;Ie<j.length&&!((P-=2)<0);++Ie)F=j.charCodeAt(Ie),J=F>>8,se=F%256,Ee.push(se),Ee.push(J);return Ee}function tt(j){return y.toByteArray(Ne(j))}function _n(j,P,F,J){let se;for(se=0;se<J&&!(se+F>=P.length||se>=j.length);++se)P[se+F]=j[se];return se}function qt(j,P){return j instanceof P||j!=null&&j.constructor!=null&&j.constructor.name!=null&&j.constructor.name===P.name}function $e(j){return j!==j}const Ze=(function(){const j="0123456789abcdef",P=new Array(256);for(let F=0;F<16;++F){const J=F*16;for(let se=0;se<16;++se)P[J+se]=j[F]+j[se]}return P})();function it(j){return typeof BigInt>"u"?Er:j}function Er(){throw new Error("BigInt not supported")}})(t);const b=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=b,e.isAscii=t.isAscii,e.isUtf8=t.isUtf8,e.kMaxLength=t.kMaxLength,e.kStringMaxLength=t.kStringMaxLength,e.resolveObjectURL=t.resolveObjectURL,e.transcode=t.transcode})(Ec)),Ec}var Tc={},Ac={},Rc,zm;function Wm(){return zm||(zm=1,Rc=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=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]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,r);if(a.value!==i||a.enumerable!==!0)return!1}return!0}),Rc}var Cc,Hm;function zs(){if(Hm)return Cc;Hm=1;var e=Wm();return Cc=function(){return e()&&!!Symbol.toStringTag},Cc}var Ic,Gm;function Km(){return Gm||(Gm=1,Ic=Object),Ic}var _c,Qm;function rC(){return Qm||(Qm=1,_c=Error),_c}var Oc,Xm;function nC(){return Xm||(Xm=1,Oc=EvalError),Oc}var Pc,Ym;function iC(){return Ym||(Ym=1,Pc=RangeError),Pc}var kc,Jm;function oC(){return Jm||(Jm=1,kc=ReferenceError),kc}var Fc,Zm;function eg(){return Zm||(Zm=1,Fc=SyntaxError),Fc}var xc,tg;function yo(){return tg||(tg=1,xc=TypeError),xc}var Nc,rg;function sC(){return rg||(rg=1,Nc=URIError),Nc}var Dc,ng;function aC(){return ng||(ng=1,Dc=Math.abs),Dc}var $c,ig;function lC(){return ig||(ig=1,$c=Math.floor),$c}var Lc,og;function cC(){return og||(og=1,Lc=Math.max),Lc}var Mc,sg;function uC(){return sg||(sg=1,Mc=Math.min),Mc}var Bc,ag;function fC(){return ag||(ag=1,Bc=Math.pow),Bc}var jc,lg;function dC(){return lg||(lg=1,jc=Math.round),jc}var Uc,cg;function pC(){return cg||(cg=1,Uc=Number.isNaN||function(t){return t!==t}),Uc}var qc,ug;function hC(){if(ug)return qc;ug=1;var e=pC();return qc=function(r){return e(r)||r===0?r:r<0?-1:1},qc}var Vc,fg;function mC(){return fg||(fg=1,Vc=Object.getOwnPropertyDescriptor),Vc}var zc,dg;function _i(){if(dg)return zc;dg=1;var e=mC();if(e)try{e([],"length")}catch{e=null}return zc=e,zc}var Wc,pg;function Ws(){if(pg)return Wc;pg=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Wc=e,Wc}var Hc,hg;function gC(){if(hg)return Hc;hg=1;var e=typeof Symbol<"u"&&Symbol,t=Wm();return Hc=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Hc}var Gc,mg;function gg(){return mg||(mg=1,Gc=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Gc}var Kc,yg;function vg(){if(yg)return Kc;yg=1;var e=Km();return Kc=e.getPrototypeOf||null,Kc}var Qc,bg;function yC(){if(bg)return Qc;bg=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(l,u){for(var c=[],d=0;d<l.length;d+=1)c[d]=l[d];for(var f=0;f<u.length;f+=1)c[f+l.length]=u[f];return c},o=function(l,u){for(var c=[],d=u,f=0;d<l.length;d+=1,f+=1)c[f]=l[d];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 Qc=function(l){var u=this;if(typeof u!="function"||t.apply(u)!==n)throw new TypeError(e+u);for(var c=o(arguments,1),d,f=function(){if(this instanceof d){var b=u.apply(this,i(c,arguments));return Object(b)===b?b:this}return u.apply(l,i(c,arguments))},m=r(0,u.length-c.length),w=[],v=0;v<m;v++)w[v]="$"+v;if(d=Function("binder","return function ("+s(w,",")+"){ return binder.apply(this,arguments); }")(f),u.prototype){var E=function(){};E.prototype=u.prototype,d.prototype=new E,E.prototype=null}return d},Qc}var Xc,wg;function vo(){if(wg)return Xc;wg=1;var e=yC();return Xc=Function.prototype.bind||e,Xc}var Yc,Sg;function Jc(){return Sg||(Sg=1,Yc=Function.prototype.call),Yc}var Zc,Eg;function eu(){return Eg||(Eg=1,Zc=Function.prototype.apply),Zc}var tu,Tg;function vC(){return Tg||(Tg=1,tu=typeof Reflect<"u"&&Reflect&&Reflect.apply),tu}var ru,Ag;function Rg(){if(Ag)return ru;Ag=1;var e=vo(),t=eu(),r=Jc(),n=vC();return ru=n||e.call(r,t),ru}var nu,Cg;function iu(){if(Cg)return nu;Cg=1;var e=vo(),t=yo(),r=Jc(),n=Rg();return nu=function(o){if(o.length<1||typeof o[0]!="function")throw new t("a function is required");return n(e,r,o)},nu}var ou,Ig;function bC(){if(Ig)return ou;Ig=1;var e=iu(),t=_i(),r;try{r=[].__proto__===Array.prototype}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ERR_PROTO_ACCESS")throw s}var n=!!r&&t&&t(Object.prototype,"__proto__"),i=Object,o=i.getPrototypeOf;return ou=n&&typeof n.get=="function"?e([n.get]):typeof o=="function"?function(a){return o(a==null?a:i(a))}:!1,ou}var su,_g;function au(){if(_g)return su;_g=1;var e=gg(),t=vg(),r=bC();return su=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)}:r?function(i){return r(i)}:null,su}var lu,Og;function Pg(){if(Og)return lu;Og=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=vo();return lu=r.call(e,t),lu}var cu,kg;function Fg(){if(kg)return cu;kg=1;var e,t=Km(),r=rC(),n=nC(),i=iC(),o=oC(),s=eg(),a=yo(),l=sC(),u=aC(),c=lC(),d=cC(),f=uC(),m=fC(),w=dC(),v=hC(),E=Function,b=function(K){try{return E('"use strict"; return ('+K+").constructor;")()}catch{}},g=_i(),y=Ws(),p=function(){throw new a},S=g?(function(){try{return arguments.callee,p}catch{try{return g(arguments,"callee").get}catch{return p}}})():p,T=gC()(),R=au(),I=vg(),A=gg(),D=eu(),H=Jc(),_={},x=typeof Uint8Array>"u"||!R?e:R(Uint8Array),z={__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%":_,"%AsyncGenerator%":_,"%AsyncGeneratorFunction%":_,"%AsyncIteratorPrototype%":_,"%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%":r,"%eval%":eval,"%EvalError%":n,"%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%":E,"%GeneratorFunction%":_,"%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%":S,"%TypedArray%":x,"%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%":H,"%Function.prototype.apply%":D,"%Object.defineProperty%":y,"%Object.getPrototypeOf%":I,"%Math.abs%":u,"%Math.floor%":c,"%Math.max%":d,"%Math.min%":f,"%Math.pow%":m,"%Math.round%":w,"%Math.sign%":v,"%Reflect.getPrototypeOf%":A};if(R)try{null.error}catch(K){var G=R(R(K));z["%Error.prototype%"]=G}var ne=function K(V){var $;if(V==="%AsyncFunction%")$=b("async function () {}");else if(V==="%GeneratorFunction%")$=b("function* () {}");else if(V==="%AsyncGeneratorFunction%")$=b("async function* () {}");else if(V==="%AsyncGenerator%"){var U=K("%AsyncGeneratorFunction%");U&&($=U.prototype)}else if(V==="%AsyncIteratorPrototype%"){var pe=K("%AsyncGenerator%");pe&&R&&($=R(pe.prototype))}return z[V]=$,$},ie={__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"]},ee=vo(),ue=Pg(),de=ee.call(H,Array.prototype.concat),ce=ee.call(D,Array.prototype.splice),X=ee.call(H,String.prototype.replace),oe=ee.call(H,String.prototype.slice),ae=ee.call(H,RegExp.prototype.exec),Ce=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Z=/\\(\\)?/g,N=function(V){var $=oe(V,0,1),U=oe(V,-1);if($==="%"&&U!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(U==="%"&&$!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var pe=[];return X(V,Ce,function(Re,De,ke,Oe){pe[pe.length]=ke?X(Oe,Z,"$1"):De||Re}),pe},O=function(V,$){var U=V,pe;if(ue(ie,U)&&(pe=ie[U],U="%"+pe[0]+"%"),ue(z,U)){var Re=z[U];if(Re===_&&(Re=ne(U)),typeof Re>"u"&&!$)throw new a("intrinsic "+V+" exists, but is not available. Please file an issue!");return{alias:pe,name:U,value:Re}}throw new s("intrinsic "+V+" does not exist!")};return cu=function(V,$){if(typeof V!="string"||V.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof $!="boolean")throw new a('"allowMissing" argument must be a boolean');if(ae(/^%?[^%]*%?$/,V)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var U=N(V),pe=U.length>0?U[0]:"",Re=O("%"+pe+"%",$),De=Re.name,ke=Re.value,Oe=!1,Be=Re.alias;Be&&(pe=Be[0],ce(U,de([0,1],Be)));for(var Se=1,Ye=!0;Se<U.length;Se+=1){var Qe=U[Se],he=oe(Qe,0,1),Pe=oe(Qe,-1);if((he==='"'||he==="'"||he==="`"||Pe==='"'||Pe==="'"||Pe==="`")&&he!==Pe)throw new s("property names with quotes must have matching quotes");if((Qe==="constructor"||!Ye)&&(Oe=!0),pe+="."+Qe,De="%"+pe+"%",ue(z,De))ke=z[De];else if(ke!=null){if(!(Qe in ke)){if(!$)throw new a("base intrinsic for "+V+" exists, but the property is not available.");return}if(g&&Se+1>=U.length){var We=g(ke,Qe);Ye=!!We,Ye&&"get"in We&&!("originalValue"in We.get)?ke=We.get:ke=ke[Qe]}else Ye=ue(ke,Qe),ke=ke[Qe];Ye&&!Oe&&(z[De]=ke)}}return ke},cu}var uu,xg;function bo(){if(xg)return uu;xg=1;var e=Fg(),t=iu(),r=t([e("%String.prototype.indexOf%")]);return uu=function(i,o){var s=e(i,!!o);return typeof s=="function"&&r(i,".prototype.")>-1?t([s]):s},uu}var fu,Ng;function wC(){if(Ng)return fu;Ng=1;var e=zs()(),t=bo(),r=t("Object.prototype.toString"),n=function(a){return e&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:r(a)==="[object Arguments]"},i=function(a){return n(a)?!0:a!==null&&typeof a=="object"&&"length"in a&&typeof a.length=="number"&&a.length>=0&&r(a)!=="[object Array]"&&"callee"in a&&r(a.callee)==="[object Function]"},o=(function(){return n(arguments)})();return n.isLegacyArguments=i,fu=o?n:i,fu}var du,Dg;function SC(){if(Dg)return du;Dg=1;var e=bo(),t=zs()(),r=Pg(),n=_i(),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(f){if(!f||typeof f!="object")return!1;var m=n(f,"lastIndex"),w=m&&r(m,"value");if(!w)return!1;try{o(f,l)}catch(v){return v===s}}}else{var u=e("Object.prototype.toString"),c="[object RegExp]";i=function(f){return!f||typeof f!="object"&&typeof f!="function"?!1:u(f)===c}}return du=i,du}var pu,$g;function EC(){if($g)return pu;$g=1;var e=bo(),t=SC(),r=e("RegExp.prototype.exec"),n=yo();return pu=function(o){if(!t(o))throw new n("`regex` must be a RegExp");return function(a){return r(o,a)!==null}},pu}var hu,Lg;function TC(){if(Lg)return hu;Lg=1;var e=bo(),t=EC(),r=t(/^\s*(?:function)?\*/),n=zs()(),i=au(),o=e("Object.prototype.toString"),s=e("Function.prototype.toString"),a=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch{}},l;return hu=function(c){if(typeof c!="function")return!1;if(r(s(c)))return!0;if(!n){var d=o(c);return d==="[object GeneratorFunction]"}if(!i)return!1;if(typeof l>"u"){var f=a();l=f?i(f):!1}return i(c)===l},hu}var mu,Mg;function AC(){if(Mg)return mu;Mg=1;var e=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,r,n;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},t(function(){throw 42},null,r)}catch(g){g!==n&&(t=null)}else t=null;var i=/^\s*class\b/,o=function(y){try{var p=e.call(y);return i.test(p)}catch{return!1}},s=function(y){try{return o(y)?!1:(e.call(y),!0)}catch{return!1}},a=Object.prototype.toString,l="[object Object]",u="[object Function]",c="[object GeneratorFunction]",d="[object HTMLAllCollection]",f="[object HTML document.all class]",m="[object HTMLCollection]",w=typeof Symbol=="function"&&!!Symbol.toStringTag,v=!(0 in[,]),E=function(){return!1};if(typeof document=="object"){var b=document.all;a.call(b)===a.call(document.all)&&(E=function(y){if((v||!y)&&(typeof y>"u"||typeof y=="object"))try{var p=a.call(y);return(p===d||p===f||p===m||p===l)&&y("")==null}catch{}return!1})}return mu=t?function(y){if(E(y))return!0;if(!y||typeof y!="function"&&typeof y!="object")return!1;try{t(y,null,r)}catch(p){if(p!==n)return!1}return!o(y)&&s(y)}:function(y){if(E(y))return!0;if(!y||typeof y!="function"&&typeof y!="object")return!1;if(w)return s(y);if(o(y))return!1;var p=a.call(y);return p!==u&&p!==c&&!/^\[object HTML/.test(p)?!1:s(y)},mu}var gu,Bg;function RC(){if(Bg)return gu;Bg=1;var e=AC(),t=Object.prototype.toString,r=Object.prototype.hasOwnProperty,n=function(l,u,c){for(var d=0,f=l.length;d<f;d++)r.call(l,d)&&(c==null?u(l[d],d,l):u.call(c,l[d],d,l))},i=function(l,u,c){for(var d=0,f=l.length;d<f;d++)c==null?u(l.charAt(d),d,l):u.call(c,l.charAt(d),d,l)},o=function(l,u,c){for(var d in l)r.call(l,d)&&(c==null?u(l[d],d,l):u.call(c,l[d],d,l))};function s(a){return t.call(a)==="[object Array]"}return gu=function(l,u,c){if(!e(u))throw new TypeError("iterator must be a function");var d;arguments.length>=3&&(d=c),s(l)?n(l,u,d):typeof l=="string"?i(l,u,d):o(l,u,d)},gu}var yu,jg;function CC(){return jg||(jg=1,yu=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),yu}var vu,Ug;function IC(){if(Ug)return vu;Ug=1;var e=CC(),t=typeof globalThis>"u"?xn:globalThis;return vu=function(){for(var n=[],i=0;i<e.length;i++)typeof t[e[i]]=="function"&&(n[n.length]=e[i]);return n},vu}var bu={exports:{}},wu,qg;function _C(){if(qg)return wu;qg=1;var e=Ws(),t=eg(),r=yo(),n=_i();return wu=function(o,s,a){if(!o||typeof o!="object"&&typeof o!="function")throw new r("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`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,d=arguments.length>6?arguments[6]:!1,f=!!n&&n(o,s);if(e)e(o,s,{configurable:c===null&&f?f.configurable:!c,enumerable:l===null&&f?f.enumerable:!l,value:a,writable:u===null&&f?f.writable:!u});else if(d||!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.")},wu}var Su,Vg;function OC(){if(Vg)return Su;Vg=1;var e=Ws(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},Su=t,Su}var Eu,zg;function PC(){if(zg)return Eu;zg=1;var e=Fg(),t=_C(),r=OC()(),n=_i(),i=yo(),o=e("%Math.floor%");return Eu=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,d=!0;if("length"in a&&n){var f=n(a,"length");f&&!f.configurable&&(c=!1),f&&!f.writable&&(d=!1)}return(c||d||!u)&&(r?t(a,"length",l,!0,!0):t(a,"length",l)),a},Eu}var Tu,Wg;function kC(){if(Wg)return Tu;Wg=1;var e=vo(),t=eu(),r=Rg();return Tu=function(){return r(e,t,arguments)},Tu}var Hg;function FC(){return Hg||(Hg=1,(function(e){var t=PC(),r=Ws(),n=iu(),i=kC();e.exports=function(s){var a=n(arguments),l=s.length-(arguments.length-1);return t(a,1+(l>0?l:0),!0)},r?r(e.exports,"apply",{value:i}):e.exports.apply=i})(bu)),bu.exports}var Au,Gg;function Kg(){if(Gg)return Au;Gg=1;var e=RC(),t=IC(),r=FC(),n=bo(),i=_i(),o=au(),s=n("Object.prototype.toString"),a=zs()(),l=typeof globalThis>"u"?xn:globalThis,u=t(),c=n("String.prototype.slice"),d=n("Array.prototype.indexOf",!0)||function(E,b){for(var g=0;g<E.length;g+=1)if(E[g]===b)return g;return-1},f={__proto__:null};a&&i&&o?e(u,function(v){var E=new l[v];if(Symbol.toStringTag in E&&o){var b=o(E),g=i(b,Symbol.toStringTag);if(!g&&b){var y=o(b);g=i(y,Symbol.toStringTag)}f["$"+v]=r(g.get)}}):e(u,function(v){var E=new l[v],b=E.slice||E.set;b&&(f["$"+v]=r(b))});var m=function(E){var b=!1;return e(f,function(g,y){if(!b)try{"$"+g(E)===y&&(b=c(y,1))}catch{}}),b},w=function(E){var b=!1;return e(f,function(g,y){if(!b)try{g(E),b=c(y,1)}catch{}}),b};return Au=function(E){if(!E||typeof E!="object")return!1;if(!a){var b=c(s(E),8,-1);return d(u,b)>-1?b:b!=="Object"?!1:w(E)}return i?m(E):null},Au}var Ru,Qg;function xC(){if(Qg)return Ru;Qg=1;var e=Kg();return Ru=function(r){return!!e(r)},Ru}var Xg;function NC(){return Xg||(Xg=1,(function(e){var t=wC(),r=TC(),n=Kg(),i=xC();function o(Se){return Se.call.bind(Se)}var s=typeof BigInt<"u",a=typeof Symbol<"u",l=o(Object.prototype.toString),u=o(Number.prototype.valueOf),c=o(String.prototype.valueOf),d=o(Boolean.prototype.valueOf);if(s)var f=o(BigInt.prototype.valueOf);if(a)var m=o(Symbol.prototype.valueOf);function w(Se,Ye){if(typeof Se!="object")return!1;try{return Ye(Se),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=r,e.isTypedArray=i;function v(Se){return typeof Promise<"u"&&Se instanceof Promise||Se!==null&&typeof Se=="object"&&typeof Se.then=="function"&&typeof Se.catch=="function"}e.isPromise=v;function E(Se){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Se):i(Se)||oe(Se)}e.isArrayBufferView=E;function b(Se){return n(Se)==="Uint8Array"}e.isUint8Array=b;function g(Se){return n(Se)==="Uint8ClampedArray"}e.isUint8ClampedArray=g;function y(Se){return n(Se)==="Uint16Array"}e.isUint16Array=y;function p(Se){return n(Se)==="Uint32Array"}e.isUint32Array=p;function S(Se){return n(Se)==="Int8Array"}e.isInt8Array=S;function T(Se){return n(Se)==="Int16Array"}e.isInt16Array=T;function R(Se){return n(Se)==="Int32Array"}e.isInt32Array=R;function I(Se){return n(Se)==="Float32Array"}e.isFloat32Array=I;function A(Se){return n(Se)==="Float64Array"}e.isFloat64Array=A;function D(Se){return n(Se)==="BigInt64Array"}e.isBigInt64Array=D;function H(Se){return n(Se)==="BigUint64Array"}e.isBigUint64Array=H;function _(Se){return l(Se)==="[object Map]"}_.working=typeof Map<"u"&&_(new Map);function x(Se){return typeof Map>"u"?!1:_.working?_(Se):Se instanceof Map}e.isMap=x;function z(Se){return l(Se)==="[object Set]"}z.working=typeof Set<"u"&&z(new Set);function G(Se){return typeof Set>"u"?!1:z.working?z(Se):Se instanceof Set}e.isSet=G;function ne(Se){return l(Se)==="[object WeakMap]"}ne.working=typeof WeakMap<"u"&&ne(new WeakMap);function ie(Se){return typeof WeakMap>"u"?!1:ne.working?ne(Se):Se instanceof WeakMap}e.isWeakMap=ie;function ee(Se){return l(Se)==="[object WeakSet]"}ee.working=typeof WeakSet<"u"&&ee(new WeakSet);function ue(Se){return ee(Se)}e.isWeakSet=ue;function de(Se){return l(Se)==="[object ArrayBuffer]"}de.working=typeof ArrayBuffer<"u"&&de(new ArrayBuffer);function ce(Se){return typeof ArrayBuffer>"u"?!1:de.working?de(Se):Se instanceof ArrayBuffer}e.isArrayBuffer=ce;function X(Se){return l(Se)==="[object DataView]"}X.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&X(new DataView(new ArrayBuffer(1),0,1));function oe(Se){return typeof DataView>"u"?!1:X.working?X(Se):Se instanceof DataView}e.isDataView=oe;var ae=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Ce(Se){return l(Se)==="[object SharedArrayBuffer]"}function Z(Se){return typeof ae>"u"?!1:(typeof Ce.working>"u"&&(Ce.working=Ce(new ae)),Ce.working?Ce(Se):Se instanceof ae)}e.isSharedArrayBuffer=Z;function N(Se){return l(Se)==="[object AsyncFunction]"}e.isAsyncFunction=N;function O(Se){return l(Se)==="[object Map Iterator]"}e.isMapIterator=O;function K(Se){return l(Se)==="[object Set Iterator]"}e.isSetIterator=K;function V(Se){return l(Se)==="[object Generator]"}e.isGeneratorObject=V;function $(Se){return l(Se)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=$;function U(Se){return w(Se,u)}e.isNumberObject=U;function pe(Se){return w(Se,c)}e.isStringObject=pe;function Re(Se){return w(Se,d)}e.isBooleanObject=Re;function De(Se){return s&&w(Se,f)}e.isBigIntObject=De;function ke(Se){return a&&w(Se,m)}e.isSymbolObject=ke;function Oe(Se){return U(Se)||pe(Se)||Re(Se)||De(Se)||ke(Se)}e.isBoxedPrimitive=Oe;function Be(Se){return typeof Uint8Array<"u"&&(ce(Se)||Z(Se))}e.isAnyArrayBuffer=Be,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Se){Object.defineProperty(e,Se,{enumerable:!1,value:function(){throw new Error(Se+" is not supported in userland")}})})})(Ac)),Ac}var Cu,Yg;function DC(){return Yg||(Yg=1,Cu=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),Cu}var Jg;function Zg(){return Jg||(Jg=1,(function(e){var t=Object.getOwnPropertyDescriptors||function(oe){for(var ae=Object.keys(oe),Ce={},Z=0;Z<ae.length;Z++)Ce[ae[Z]]=Object.getOwnPropertyDescriptor(oe,ae[Z]);return Ce},r=/%[sdj%]/g;e.format=function(X){if(!S(X)){for(var oe=[],ae=0;ae<arguments.length;ae++)oe.push(s(arguments[ae]));return oe.join(" ")}for(var ae=1,Ce=arguments,Z=Ce.length,N=String(X).replace(r,function(K){if(K==="%%")return"%";if(ae>=Z)return K;switch(K){case"%s":return String(Ce[ae++]);case"%d":return Number(Ce[ae++]);case"%j":try{return JSON.stringify(Ce[ae++])}catch{return"[Circular]"}default:return K}}),O=Ce[ae];ae<Z;O=Ce[++ae])g(O)||!A(O)?N+=" "+O:N+=" "+s(O);return N},e.deprecate=function(X,oe){if(typeof ve<"u"&&ve.noDeprecation===!0)return X;if(typeof ve>"u")return function(){return e.deprecate(X,oe).apply(this,arguments)};var ae=!1;function Ce(){if(!ae){if(ve.throwDeprecation)throw new Error(oe);ve.traceDeprecation?console.trace(oe):console.error(oe),ae=!0}return X.apply(this,arguments)}return Ce};var n={},i=/^$/;if(ve.env.NODE_DEBUG){var o=ve.env.NODE_DEBUG;o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),i=new RegExp("^"+o+"$","i")}e.debuglog=function(X){if(X=X.toUpperCase(),!n[X])if(i.test(X)){var oe=ve.pid;n[X]=function(){var ae=e.format.apply(e,arguments);console.error("%s %d: %s",X,oe,ae)}}else n[X]=function(){};return n[X]};function s(X,oe){var ae={seen:[],stylize:l};return arguments.length>=3&&(ae.depth=arguments[2]),arguments.length>=4&&(ae.colors=arguments[3]),b(oe)?ae.showHidden=oe:oe&&e._extend(ae,oe),R(ae.showHidden)&&(ae.showHidden=!1),R(ae.depth)&&(ae.depth=2),R(ae.colors)&&(ae.colors=!1),R(ae.customInspect)&&(ae.customInspect=!0),ae.colors&&(ae.stylize=a),c(ae,X,ae.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(X,oe){var ae=s.styles[oe];return ae?"\x1B["+s.colors[ae][0]+"m"+X+"\x1B["+s.colors[ae][1]+"m":X}function l(X,oe){return X}function u(X){var oe={};return X.forEach(function(ae,Ce){oe[ae]=!0}),oe}function c(X,oe,ae){if(X.customInspect&&oe&&_(oe.inspect)&&oe.inspect!==e.inspect&&!(oe.constructor&&oe.constructor.prototype===oe)){var Ce=oe.inspect(ae,X);return S(Ce)||(Ce=c(X,Ce,ae)),Ce}var Z=d(X,oe);if(Z)return Z;var N=Object.keys(oe),O=u(N);if(X.showHidden&&(N=Object.getOwnPropertyNames(oe)),H(oe)&&(N.indexOf("message")>=0||N.indexOf("description")>=0))return f(oe);if(N.length===0){if(_(oe)){var K=oe.name?": "+oe.name:"";return X.stylize("[Function"+K+"]","special")}if(I(oe))return X.stylize(RegExp.prototype.toString.call(oe),"regexp");if(D(oe))return X.stylize(Date.prototype.toString.call(oe),"date");if(H(oe))return f(oe)}var V="",$=!1,U=["{","}"];if(E(oe)&&($=!0,U=["[","]"]),_(oe)){var pe=oe.name?": "+oe.name:"";V=" [Function"+pe+"]"}if(I(oe)&&(V=" "+RegExp.prototype.toString.call(oe)),D(oe)&&(V=" "+Date.prototype.toUTCString.call(oe)),H(oe)&&(V=" "+f(oe)),N.length===0&&(!$||oe.length==0))return U[0]+V+U[1];if(ae<0)return I(oe)?X.stylize(RegExp.prototype.toString.call(oe),"regexp"):X.stylize("[Object]","special");X.seen.push(oe);var Re;return $?Re=m(X,oe,ae,O,N):Re=N.map(function(De){return w(X,oe,ae,O,De,$)}),X.seen.pop(),v(Re,V,U)}function d(X,oe){if(R(oe))return X.stylize("undefined","undefined");if(S(oe)){var ae="'"+JSON.stringify(oe).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return X.stylize(ae,"string")}if(p(oe))return X.stylize(""+oe,"number");if(b(oe))return X.stylize(""+oe,"boolean");if(g(oe))return X.stylize("null","null")}function f(X){return"["+Error.prototype.toString.call(X)+"]"}function m(X,oe,ae,Ce,Z){for(var N=[],O=0,K=oe.length;O<K;++O)ee(oe,String(O))?N.push(w(X,oe,ae,Ce,String(O),!0)):N.push("");return Z.forEach(function(V){V.match(/^\d+$/)||N.push(w(X,oe,ae,Ce,V,!0))}),N}function w(X,oe,ae,Ce,Z,N){var O,K,V;if(V=Object.getOwnPropertyDescriptor(oe,Z)||{value:oe[Z]},V.get?V.set?K=X.stylize("[Getter/Setter]","special"):K=X.stylize("[Getter]","special"):V.set&&(K=X.stylize("[Setter]","special")),ee(Ce,Z)||(O="["+Z+"]"),K||(X.seen.indexOf(V.value)<0?(g(ae)?K=c(X,V.value,null):K=c(X,V.value,ae-1),K.indexOf(`
17
+ `)>-1&&(N?K=K.split(`
18
+ `).map(function($){return" "+$}).join(`
19
19
  `).slice(2):K=`
20
20
  `+K.split(`
21
- `).map(function(M){return" "+M}).join(`
22
- `))):K=J.stylize("[Circular]","special")),I(F)){if(R&&H.match(/^\d+$/))return K;F=JSON.stringify(""+H),F.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(F=F.slice(1,-1),F=J.stylize(F,"name")):(F=F.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),F=J.stylize(F,"string"))}return F+": "+K}function y(J,ne,se){var Re=J.reduce(function(H,R){return R.indexOf(`
23
- `)>=0,H+R.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Re>60?se[0]+(ne===""?"":ne+`
24
- `)+" "+J.join(`,
25
- `)+" "+se[1]:se[0]+ne+" "+J.join(", ")+" "+se[1]}e.types=dR();function E(J){return Array.isArray(J)}e.isArray=E;function b(J){return typeof J=="boolean"}e.isBoolean=b;function g(J){return J===null}e.isNull=g;function v(J){return J==null}e.isNullOrUndefined=v;function h(J){return typeof J=="number"}e.isNumber=h;function S(J){return typeof J=="string"}e.isString=S;function T(J){return typeof J=="symbol"}e.isSymbol=T;function I(J){return J===void 0}e.isUndefined=I;function _(J){return A(J)&&V(J)==="[object RegExp]"}e.isRegExp=_,e.types.isRegExp=_;function A(J){return typeof J=="object"&&J!==null}e.isObject=A;function $(J){return A(J)&&V(J)==="[object Date]"}e.isDate=$,e.types.isDate=$;function D(J){return A(J)&&(V(J)==="[object Error]"||J instanceof Error)}e.isError=D,e.types.isNativeError=D;function N(J){return typeof J=="function"}e.isFunction=N;function x(J){return J===null||typeof J=="boolean"||typeof J=="number"||typeof J=="string"||typeof J=="symbol"||typeof J>"u"}e.isPrimitive=x,e.isBuffer=pR();function V(J){return Object.prototype.toString.call(J)}function G(J){return J<10?"0"+J.toString(10):J.toString(10)}var ae=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ye(){var J=new Date,ne=[G(J.getHours()),G(J.getMinutes()),G(J.getSeconds())].join(":");return[J.getDate(),ae[J.getMonth()],ne].join(" ")}e.log=function(){console.log("%s - %s",ye(),e.format.apply(e,arguments))},e.inherits=ni(),e._extend=function(J,ne){if(!ne||!A(ne))return J;for(var se=Object.keys(ne),Re=se.length;Re--;)J[se[Re]]=ne[se[Re]];return J};function ue(J,ne){return Object.prototype.hasOwnProperty.call(J,ne)}var te=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(ne){if(typeof ne!="function")throw new TypeError('The "original" argument must be of type Function');if(te&&ne[te]){var se=ne[te];if(typeof se!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(se,te,{value:se,enumerable:!1,writable:!1,configurable:!0}),se}function se(){for(var Re,H,R=new Promise(function(z,M){Re=z,H=M}),F=[],K=0;K<arguments.length;K++)F.push(arguments[K]);F.push(function(z,M){z?H(z):Re(M)});try{ne.apply(this,F)}catch(z){H(z)}return R}return Object.setPrototypeOf(se,Object.getPrototypeOf(ne)),te&&Object.defineProperty(se,te,{value:se,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(se,t(ne))},e.promisify.custom=te;function ce(J,ne){if(!J){var se=new Error("Promise was rejected with a falsy value");se.reason=J,J=se}return ne(J)}function oe(J){if(typeof J!="function")throw new TypeError('The "original" argument must be of type Function');function ne(){for(var se=[],Re=0;Re<arguments.length;Re++)se.push(arguments[Re]);var H=se.pop();if(typeof H!="function")throw new TypeError("The last argument must be of type Function");var R=this,F=function(){return H.apply(R,arguments)};J.apply(this,se).then(function(K){ve.nextTick(F.bind(null,null,K))},function(K){ve.nextTick(ce.bind(null,K,F))})}return Object.setPrototypeOf(ne,Object.getPrototypeOf(J)),Object.defineProperties(ne,t(J)),ne}e.callbackify=oe}(ac)),ac}var fu,bm;function hR(){if(bm)return fu;bm=1;function e(w,y){var E=Object.keys(w);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(w);y&&(b=b.filter(function(g){return Object.getOwnPropertyDescriptor(w,g).enumerable})),E.push.apply(E,b)}return E}function t(w){for(var y=1;y<arguments.length;y++){var E=arguments[y]!=null?arguments[y]:{};y%2?e(Object(E),!0).forEach(function(b){n(w,b,E[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(E)):e(Object(E)).forEach(function(b){Object.defineProperty(w,b,Object.getOwnPropertyDescriptor(E,b))})}return w}function n(w,y,E){return y=s(y),y in w?Object.defineProperty(w,y,{value:E,enumerable:!0,configurable:!0,writable:!0}):w[y]=E,w}function r(w,y){if(!(w instanceof y))throw new TypeError("Cannot call a class as a function")}function o(w,y){for(var E=0;E<y.length;E++){var b=y[E];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(w,s(b.key),b)}}function i(w,y,E){return y&&o(w.prototype,y),Object.defineProperty(w,"prototype",{writable:!1}),w}function s(w){var y=a(w,"string");return typeof y=="symbol"?y:String(y)}function a(w,y){if(typeof w!="object"||w===null)return w;var E=w[Symbol.toPrimitive];if(E!==void 0){var b=E.call(w,y);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(w)}var c=Is(),u=c.Buffer,l=ym(),d=l.inspect,f=d&&d.custom||"inspect";function m(w,y,E){u.prototype.copy.call(w,y,E)}return fu=function(){function w(){r(this,w),this.head=null,this.tail=null,this.length=0}return i(w,[{key:"push",value:function(E){var b={data:E,next:null};this.length>0?this.tail.next=b:this.head=b,this.tail=b,++this.length}},{key:"unshift",value:function(E){var b={data:E,next:this.head};this.length===0&&(this.tail=b),this.head=b,++this.length}},{key:"shift",value:function(){if(this.length!==0){var E=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,E}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(E){if(this.length===0)return"";for(var b=this.head,g=""+b.data;b=b.next;)g+=E+b.data;return g}},{key:"concat",value:function(E){if(this.length===0)return u.alloc(0);for(var b=u.allocUnsafe(E>>>0),g=this.head,v=0;g;)m(g.data,b,v),v+=g.data.length,g=g.next;return b}},{key:"consume",value:function(E,b){var g;return E<this.head.data.length?(g=this.head.data.slice(0,E),this.head.data=this.head.data.slice(E)):E===this.head.data.length?g=this.shift():g=b?this._getString(E):this._getBuffer(E),g}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(E){var b=this.head,g=1,v=b.data;for(E-=v.length;b=b.next;){var h=b.data,S=E>h.length?h.length:E;if(S===h.length?v+=h:v+=h.slice(0,E),E-=S,E===0){S===h.length?(++g,b.next?this.head=b.next:this.head=this.tail=null):(this.head=b,b.data=h.slice(S));break}++g}return this.length-=g,v}},{key:"_getBuffer",value:function(E){var b=u.allocUnsafe(E),g=this.head,v=1;for(g.data.copy(b),E-=g.data.length;g=g.next;){var h=g.data,S=E>h.length?h.length:E;if(h.copy(b,b.length-E,0,S),E-=S,E===0){S===h.length?(++v,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=h.slice(S));break}++v}return this.length-=v,b}},{key:f,value:function(E,b){return d(this,t(t({},b),{},{depth:0,customInspect:!1}))}}]),w}(),fu}var du,vm;function wm(){if(vm)return du;vm=1;function e(s,a){var c=this,u=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return u||l?(a?a(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,ve.nextTick(o,this,s)):ve.nextTick(o,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(d){!a&&d?c._writableState?c._writableState.errorEmitted?ve.nextTick(n,c):(c._writableState.errorEmitted=!0,ve.nextTick(t,c,d)):ve.nextTick(t,c,d):a?(ve.nextTick(n,c),a(d)):ve.nextTick(n,c)}),this)}function t(s,a){o(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 o(s,a){s.emit("error",a)}function i(s,a){var c=s._readableState,u=s._writableState;c&&c.autoDestroy||u&&u.autoDestroy?s.destroy(a):s.emit("error",a)}return du={destroy:e,undestroy:r,errorOrDestroy:i},du}var pu={},Sm;function Ni(){if(Sm)return pu;Sm=1;function e(a,c){a.prototype=Object.create(c.prototype),a.prototype.constructor=a,a.__proto__=c}var t={};function n(a,c,u){u||(u=Error);function l(f,m,w){return typeof c=="string"?c:c(f,m,w)}var d=function(f){e(m,f);function m(w,y,E){return f.call(this,l(w,y,E))||this}return m}(u);d.prototype.name=u.name,d.prototype.code=a,t[a]=d}function r(a,c){if(Array.isArray(a)){var u=a.length;return a=a.map(function(l){return String(l)}),u>2?"one of ".concat(c," ").concat(a.slice(0,u-1).join(", "),", or ")+a[u-1]:u===2?"one of ".concat(c," ").concat(a[0]," or ").concat(a[1]):"of ".concat(c," ").concat(a[0])}else return"of ".concat(c," ").concat(String(a))}function o(a,c,u){return a.substr(0,c.length)===c}function i(a,c,u){return(u===void 0||u>a.length)&&(u=a.length),a.substring(u-c.length,u)===c}function s(a,c,u){return typeof u!="number"&&(u=0),u+c.length>a.length?!1:a.indexOf(c,u)!==-1}return n("ERR_INVALID_OPT_VALUE",function(a,c){return'The value "'+c+'" is invalid for option "'+a+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(a,c,u){var l;typeof c=="string"&&o(c,"not ")?(l="must not be",c=c.replace(/^not /,"")):l="must be";var d;if(i(a," argument"))d="The ".concat(a," ").concat(l," ").concat(r(c,"type"));else{var f=s(a,".")?"property":"argument";d='The "'.concat(a,'" ').concat(f," ").concat(l," ").concat(r(c,"type"))}return d+=". Received type ".concat(typeof u),d},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"),pu.codes=t,pu}var hu,Em;function Tm(){if(Em)return hu;Em=1;var e=Ni().codes.ERR_INVALID_OPT_VALUE;function t(r,o,i){return r.highWaterMark!=null?r.highWaterMark:o?r[i]:null}function n(r,o,i,s){var a=t(o,s,i);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var c=s?i:"highWaterMark";throw new e(c,a)}return Math.floor(a)}return r.objectMode?16:16*1024}return hu={getHighWaterMark:n},hu}var gu,Am;function gR(){if(Am)return gu;Am=1,gu=e;function e(n,r){if(t("noDeprecation"))return n;var o=!1;function i(){if(!o){if(t("throwDeprecation"))throw new Error(r);t("traceDeprecation")?console.trace(r):console.warn(r),o=!0}return n.apply(this,arguments)}return i}function t(n){try{if(!$r.localStorage)return!1}catch{return!1}var r=$r.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return gu}var mu,Rm;function _m(){if(Rm)return mu;Rm=1,mu=_;function e(H){var R=this;this.next=null,this.entry=null,this.finish=function(){Re(R,H)}}var t;_.WritableState=T;var n={deprecate:gR()},r=sg(),o=Is().Buffer,i=(typeof $r<"u"?$r:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(H){return o.from(H)}function a(H){return o.isBuffer(H)||H instanceof i}var c=wm(),u=Tm(),l=u.getHighWaterMark,d=Ni().codes,f=d.ERR_INVALID_ARG_TYPE,m=d.ERR_METHOD_NOT_IMPLEMENTED,w=d.ERR_MULTIPLE_CALLBACK,y=d.ERR_STREAM_CANNOT_PIPE,E=d.ERR_STREAM_DESTROYED,b=d.ERR_STREAM_NULL_VALUES,g=d.ERR_STREAM_WRITE_AFTER_END,v=d.ERR_UNKNOWN_ENCODING,h=c.errorOrDestroy;ni()(_,r);function S(){}function T(H,R,F){t=t||$i(),H=H||{},typeof F!="boolean"&&(F=R instanceof t),this.objectMode=!!H.objectMode,F&&(this.objectMode=this.objectMode||!!H.writableObjectMode),this.highWaterMark=l(this,H,"writableHighWaterMark",F),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var K=H.decodeStrings===!1;this.decodeStrings=!K,this.defaultEncoding=H.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(z){ae(R,z)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=H.emitClose!==!1,this.autoDestroy=!!H.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}T.prototype.getBuffer=function(){for(var R=this.bufferedRequest,F=[];R;)F.push(R),R=R.next;return F},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 I;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(_,Symbol.hasInstance,{value:function(R){return I.call(this,R)?!0:this!==_?!1:R&&R._writableState instanceof T}})):I=function(R){return R instanceof this};function _(H){t=t||$i();var R=this instanceof t;if(!R&&!I.call(_,this))return new _(H);this._writableState=new T(H,this,R),this.writable=!0,H&&(typeof H.write=="function"&&(this._write=H.write),typeof H.writev=="function"&&(this._writev=H.writev),typeof H.destroy=="function"&&(this._destroy=H.destroy),typeof H.final=="function"&&(this._final=H.final)),r.call(this)}_.prototype.pipe=function(){h(this,new y)};function A(H,R){var F=new g;h(H,F),ve.nextTick(R,F)}function $(H,R,F,K){var z;return F===null?z=new b:typeof F!="string"&&!R.objectMode&&(z=new f("chunk",["string","Buffer"],F)),z?(h(H,z),ve.nextTick(K,z),!1):!0}_.prototype.write=function(H,R,F){var K=this._writableState,z=!1,M=!K.objectMode&&a(H);return M&&!o.isBuffer(H)&&(H=s(H)),typeof R=="function"&&(F=R,R=null),M?R="buffer":R||(R=K.defaultEncoding),typeof F!="function"&&(F=S),K.ending?A(this,F):(M||$(this,K,H,F))&&(K.pendingcb++,z=N(this,K,M,H,R,F)),z},_.prototype.cork=function(){this._writableState.corked++},_.prototype.uncork=function(){var H=this._writableState;H.corked&&(H.corked--,!H.writing&&!H.corked&&!H.bufferProcessing&&H.bufferedRequest&&te(this,H))},_.prototype.setDefaultEncoding=function(R){if(typeof R=="string"&&(R=R.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((R+"").toLowerCase())>-1))throw new v(R);return this._writableState.defaultEncoding=R,this},Object.defineProperty(_.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function D(H,R,F){return!H.objectMode&&H.decodeStrings!==!1&&typeof R=="string"&&(R=o.from(R,F)),R}Object.defineProperty(_.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function N(H,R,F,K,z,M){if(!F){var q=D(R,K,z);K!==q&&(F=!0,z="buffer",K=q)}var ge=R.objectMode?1:K.length;R.length+=ge;var _e=R.length<R.highWaterMark;if(_e||(R.needDrain=!0),R.writing||R.corked){var Le=R.lastBufferedRequest;R.lastBufferedRequest={chunk:K,encoding:z,isBuf:F,callback:M,next:null},Le?Le.next=R.lastBufferedRequest:R.bufferedRequest=R.lastBufferedRequest,R.bufferedRequestCount+=1}else x(H,R,!1,ge,K,z,M);return _e}function x(H,R,F,K,z,M,q){R.writelen=K,R.writecb=q,R.writing=!0,R.sync=!0,R.destroyed?R.onwrite(new E("write")):F?H._writev(z,R.onwrite):H._write(z,M,R.onwrite),R.sync=!1}function V(H,R,F,K,z){--R.pendingcb,F?(ve.nextTick(z,K),ve.nextTick(ne,H,R),H._writableState.errorEmitted=!0,h(H,K)):(z(K),H._writableState.errorEmitted=!0,h(H,K),ne(H,R))}function G(H){H.writing=!1,H.writecb=null,H.length-=H.writelen,H.writelen=0}function ae(H,R){var F=H._writableState,K=F.sync,z=F.writecb;if(typeof z!="function")throw new w;if(G(F),R)V(H,F,K,R,z);else{var M=ce(F)||H.destroyed;!M&&!F.corked&&!F.bufferProcessing&&F.bufferedRequest&&te(H,F),K?ve.nextTick(ye,H,F,M,z):ye(H,F,M,z)}}function ye(H,R,F,K){F||ue(H,R),R.pendingcb--,K(),ne(H,R)}function ue(H,R){R.length===0&&R.needDrain&&(R.needDrain=!1,H.emit("drain"))}function te(H,R){R.bufferProcessing=!0;var F=R.bufferedRequest;if(H._writev&&F&&F.next){var K=R.bufferedRequestCount,z=new Array(K),M=R.corkedRequestsFree;M.entry=F;for(var q=0,ge=!0;F;)z[q]=F,F.isBuf||(ge=!1),F=F.next,q+=1;z.allBuffers=ge,x(H,R,!0,R.length,z,"",M.finish),R.pendingcb++,R.lastBufferedRequest=null,M.next?(R.corkedRequestsFree=M.next,M.next=null):R.corkedRequestsFree=new e(R),R.bufferedRequestCount=0}else{for(;F;){var _e=F.chunk,Le=F.encoding,ke=F.callback,Pe=R.objectMode?1:_e.length;if(x(H,R,!1,Pe,_e,Le,ke),F=F.next,R.bufferedRequestCount--,R.writing)break}F===null&&(R.lastBufferedRequest=null)}R.bufferedRequest=F,R.bufferProcessing=!1}_.prototype._write=function(H,R,F){F(new m("_write()"))},_.prototype._writev=null,_.prototype.end=function(H,R,F){var K=this._writableState;return typeof H=="function"?(F=H,H=null,R=null):typeof R=="function"&&(F=R,R=null),H!=null&&this.write(H,R),K.corked&&(K.corked=1,this.uncork()),K.ending||se(this,K,F),this},Object.defineProperty(_.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ce(H){return H.ending&&H.length===0&&H.bufferedRequest===null&&!H.finished&&!H.writing}function oe(H,R){H._final(function(F){R.pendingcb--,F&&h(H,F),R.prefinished=!0,H.emit("prefinish"),ne(H,R)})}function J(H,R){!R.prefinished&&!R.finalCalled&&(typeof H._final=="function"&&!R.destroyed?(R.pendingcb++,R.finalCalled=!0,ve.nextTick(oe,H,R)):(R.prefinished=!0,H.emit("prefinish")))}function ne(H,R){var F=ce(R);if(F&&(J(H,R),R.pendingcb===0&&(R.finished=!0,H.emit("finish"),R.autoDestroy))){var K=H._readableState;(!K||K.autoDestroy&&K.endEmitted)&&H.destroy()}return F}function se(H,R,F){R.ending=!0,ne(H,R),F&&(R.finished?ve.nextTick(F):H.once("finish",F)),R.ended=!0,H.writable=!1}function Re(H,R,F){var K=H.entry;for(H.entry=null;K;){var z=K.callback;R.pendingcb--,z(F),K=K.next}R.corkedRequestsFree.next=H}return Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(R){this._writableState&&(this._writableState.destroyed=R)}}),_.prototype.destroy=c.destroy,_.prototype._undestroy=c.undestroy,_.prototype._destroy=function(H,R){R(H)},mu}var yu,Im;function $i(){if(Im)return yu;Im=1;var e=Object.keys||function(u){var l=[];for(var d in u)l.push(d);return l};yu=s;var t=Nm(),n=_m();ni()(s,t);for(var r=e(n.prototype),o=0;o<r.length;o++){var i=r[o];s.prototype[i]||(s.prototype[i]=n.prototype[i])}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||ve.nextTick(c,this)}function c(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(l){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=l,this._writableState.destroyed=l)}}),yu}var bu={},Fs={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var Cm;function mR(){return Cm||(Cm=1,function(e,t){var n=Is(),r=n.Buffer;function o(s,a){for(var c in s)a[c]=s[c]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=i);function i(s,a,c){return r(s,a,c)}i.prototype=Object.create(r.prototype),o(r,i),i.from=function(s,a,c){if(typeof s=="number")throw new TypeError("Argument must not be a number");return r(s,a,c)},i.alloc=function(s,a,c){if(typeof s!="number")throw new TypeError("Argument must be a number");var u=r(s);return a!==void 0?typeof c=="string"?u.fill(a,c):u.fill(a):u.fill(0),u},i.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r(s)},i.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(s)}}(Fs,Fs.exports)),Fs.exports}var Pm;function vu(){if(Pm)return bu;Pm=1;var e=mR().Buffer,t=e.isEncoding||function(b){switch(b=""+b,b&&b.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(b){if(!b)return"utf8";for(var g;;)switch(b){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 b;default:if(g)return;b=(""+b).toLowerCase(),g=!0}}function r(b){var g=n(b);if(typeof g!="string"&&(e.isEncoding===t||!t(b)))throw new Error("Unknown encoding: "+b);return g||b}bu.StringDecoder=o;function o(b){this.encoding=r(b);var g;switch(this.encoding){case"utf16le":this.text=d,this.end=f,g=4;break;case"utf8":this.fillLast=c,g=4;break;case"base64":this.text=m,this.end=w,g=3;break;default:this.write=y,this.end=E;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(g)}o.prototype.write=function(b){if(b.length===0)return"";var g,v;if(this.lastNeed){if(g=this.fillLast(b),g===void 0)return"";v=this.lastNeed,this.lastNeed=0}else v=0;return v<b.length?g?g+this.text(b,v):this.text(b,v):g||""},o.prototype.end=l,o.prototype.text=u,o.prototype.fillLast=function(b){if(this.lastNeed<=b.length)return b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,b.length),this.lastNeed-=b.length};function i(b){return b<=127?0:b>>5===6?2:b>>4===14?3:b>>3===30?4:b>>6===2?-1:-2}function s(b,g,v){var h=g.length-1;if(h<v)return 0;var S=i(g[h]);return S>=0?(S>0&&(b.lastNeed=S-1),S):--h<v||S===-2?0:(S=i(g[h]),S>=0?(S>0&&(b.lastNeed=S-2),S):--h<v||S===-2?0:(S=i(g[h]),S>=0?(S>0&&(S===2?S=0:b.lastNeed=S-3),S):0))}function a(b,g,v){if((g[0]&192)!==128)return b.lastNeed=0,"�";if(b.lastNeed>1&&g.length>1){if((g[1]&192)!==128)return b.lastNeed=1,"�";if(b.lastNeed>2&&g.length>2&&(g[2]&192)!==128)return b.lastNeed=2,"�"}}function c(b){var g=this.lastTotal-this.lastNeed,v=a(this,b);if(v!==void 0)return v;if(this.lastNeed<=b.length)return b.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,g,0,b.length),this.lastNeed-=b.length}function u(b,g){var v=s(this,b,g);if(!this.lastNeed)return b.toString("utf8",g);this.lastTotal=v;var h=b.length-(v-this.lastNeed);return b.copy(this.lastChar,0,h),b.toString("utf8",g,h)}function l(b){var g=b&&b.length?this.write(b):"";return this.lastNeed?g+"�":g}function d(b,g){if((b.length-g)%2===0){var v=b.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]=b[b.length-2],this.lastChar[1]=b[b.length-1],v.slice(0,-1)}return v}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=b[b.length-1],b.toString("utf16le",g,b.length-1)}function f(b){var g=b&&b.length?this.write(b):"";if(this.lastNeed){var v=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,v)}return g}function m(b,g){var v=(b.length-g)%3;return v===0?b.toString("base64",g):(this.lastNeed=3-v,this.lastTotal=3,v===1?this.lastChar[0]=b[b.length-1]:(this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1]),b.toString("base64",g,b.length-v))}function w(b){var g=b&&b.length?this.write(b):"";return this.lastNeed?g+this.lastChar.toString("base64",0,3-this.lastNeed):g}function y(b){return b.toString(this.encoding)}function E(b){return b&&b.length?this.write(b):""}return bu}var wu,Fm;function Su(){if(Fm)return wu;Fm=1;var e=Ni().codes.ERR_STREAM_PREMATURE_CLOSE;function t(i){var s=!1;return function(){if(!s){s=!0;for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];i.apply(this,c)}}}function n(){}function r(i){return i.setHeader&&typeof i.abort=="function"}function o(i,s,a){if(typeof s=="function")return o(i,null,s);s||(s={}),a=t(a||n);var c=s.readable||s.readable!==!1&&i.readable,u=s.writable||s.writable!==!1&&i.writable,l=function(){i.writable||f()},d=i._writableState&&i._writableState.finished,f=function(){u=!1,d=!0,c||a.call(i)},m=i._readableState&&i._readableState.endEmitted,w=function(){c=!1,m=!0,u||a.call(i)},y=function(v){a.call(i,v)},E=function(){var v;if(c&&!m)return(!i._readableState||!i._readableState.ended)&&(v=new e),a.call(i,v);if(u&&!d)return(!i._writableState||!i._writableState.ended)&&(v=new e),a.call(i,v)},b=function(){i.req.on("finish",f)};return r(i)?(i.on("complete",f),i.on("abort",E),i.req?b():i.on("request",b)):u&&!i._writableState&&(i.on("end",l),i.on("close",l)),i.on("end",w),i.on("finish",f),s.error!==!1&&i.on("error",y),i.on("close",E),function(){i.removeListener("complete",f),i.removeListener("abort",E),i.removeListener("request",b),i.req&&i.req.removeListener("finish",f),i.removeListener("end",l),i.removeListener("close",l),i.removeListener("finish",f),i.removeListener("end",w),i.removeListener("error",y),i.removeListener("close",E)}}return wu=o,wu}var Eu,Om;function yR(){if(Om)return Eu;Om=1;var e;function t(v,h,S){return h=n(h),h in v?Object.defineProperty(v,h,{value:S,enumerable:!0,configurable:!0,writable:!0}):v[h]=S,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 S=v[Symbol.toPrimitive];if(S!==void 0){var T=S.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 o=Su(),i=Symbol("lastResolve"),s=Symbol("lastReject"),a=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),l=Symbol("handlePromise"),d=Symbol("stream");function f(v,h){return{value:v,done:h}}function m(v){var h=v[i];if(h!==null){var S=v[d].read();S!==null&&(v[u]=null,v[i]=null,v[s]=null,h(f(S,!1)))}}function w(v){ve.nextTick(m,v)}function y(v,h){return function(S,T){v.then(function(){if(h[c]){S(f(void 0,!0));return}h[l](S,T)},T)}}var E=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((e={get stream(){return this[d]},next:function(){var h=this,S=this[a];if(S!==null)return Promise.reject(S);if(this[c])return Promise.resolve(f(void 0,!0));if(this[d].destroyed)return new Promise(function(A,$){ve.nextTick(function(){h[a]?$(h[a]):A(f(void 0,!0))})});var T=this[u],I;if(T)I=new Promise(y(T,this));else{var _=this[d].read();if(_!==null)return Promise.resolve(f(_,!1));I=new Promise(this[l])}return this[u]=I,I}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var h=this;return new Promise(function(S,T){h[d].destroy(null,function(I){if(I){T(I);return}S(f(void 0,!0))})})}),e),E),g=function(h){var S,T=Object.create(b,(S={},t(S,d,{value:h,writable:!0}),t(S,i,{value:null,writable:!0}),t(S,s,{value:null,writable:!0}),t(S,a,{value:null,writable:!0}),t(S,c,{value:h._readableState.endEmitted,writable:!0}),t(S,l,{value:function(_,A){var $=T[d].read();$?(T[u]=null,T[i]=null,T[s]=null,_(f($,!1))):(T[i]=_,T[s]=A)},writable:!0}),S));return T[u]=null,o(h,function(I){if(I&&I.code!=="ERR_STREAM_PREMATURE_CLOSE"){var _=T[s];_!==null&&(T[u]=null,T[i]=null,T[s]=null,_(I)),T[a]=I;return}var A=T[i];A!==null&&(T[u]=null,T[i]=null,T[s]=null,A(f(void 0,!0))),T[c]=!0}),h.on("readable",w.bind(null,T)),T};return Eu=g,Eu}var Tu,km;function bR(){return km||(km=1,Tu=function(){throw new Error("Readable.from is not available in the browser")}),Tu}var Au,xm;function Nm(){if(xm)return Au;xm=1,Au=A;var e;A.ReadableState=_,ic().EventEmitter;var t=function(q,ge){return q.listeners(ge).length},n=sg(),r=Is().Buffer,o=(typeof $r<"u"?$r:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i(M){return r.from(M)}function s(M){return r.isBuffer(M)||M instanceof o}var a=ym(),c;a&&a.debuglog?c=a.debuglog("stream"):c=function(){};var u=hR(),l=wm(),d=Tm(),f=d.getHighWaterMark,m=Ni().codes,w=m.ERR_INVALID_ARG_TYPE,y=m.ERR_STREAM_PUSH_AFTER_EOF,E=m.ERR_METHOD_NOT_IMPLEMENTED,b=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,g,v,h;ni()(A,n);var S=l.errorOrDestroy,T=["error","close","destroy","pause","resume"];function I(M,q,ge){if(typeof M.prependListener=="function")return M.prependListener(q,ge);!M._events||!M._events[q]?M.on(q,ge):Array.isArray(M._events[q])?M._events[q].unshift(ge):M._events[q]=[ge,M._events[q]]}function _(M,q,ge){e=e||$i(),M=M||{},typeof ge!="boolean"&&(ge=q instanceof e),this.objectMode=!!M.objectMode,ge&&(this.objectMode=this.objectMode||!!M.readableObjectMode),this.highWaterMark=f(this,M,"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=M.emitClose!==!1,this.autoDestroy=!!M.autoDestroy,this.destroyed=!1,this.defaultEncoding=M.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,M.encoding&&(g||(g=vu().StringDecoder),this.decoder=new g(M.encoding),this.encoding=M.encoding)}function A(M){if(e=e||$i(),!(this instanceof A))return new A(M);var q=this instanceof e;this._readableState=new _(M,this,q),this.readable=!0,M&&(typeof M.read=="function"&&(this._read=M.read),typeof M.destroy=="function"&&(this._destroy=M.destroy)),n.call(this)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(q){this._readableState&&(this._readableState.destroyed=q)}}),A.prototype.destroy=l.destroy,A.prototype._undestroy=l.undestroy,A.prototype._destroy=function(M,q){q(M)},A.prototype.push=function(M,q){var ge=this._readableState,_e;return ge.objectMode?_e=!0:typeof M=="string"&&(q=q||ge.defaultEncoding,q!==ge.encoding&&(M=r.from(M,q),q=""),_e=!0),$(this,M,q,!1,_e)},A.prototype.unshift=function(M){return $(this,M,null,!0,!1)};function $(M,q,ge,_e,Le){c("readableAddChunk",q);var ke=M._readableState;if(q===null)ke.reading=!1,ae(M,ke);else{var Pe;if(Le||(Pe=N(ke,q)),Pe)S(M,Pe);else if(ke.objectMode||q&&q.length>0)if(typeof q!="string"&&!ke.objectMode&&Object.getPrototypeOf(q)!==r.prototype&&(q=i(q)),_e)ke.endEmitted?S(M,new b):D(M,ke,q,!0);else if(ke.ended)S(M,new y);else{if(ke.destroyed)return!1;ke.reading=!1,ke.decoder&&!ge?(q=ke.decoder.write(q),ke.objectMode||q.length!==0?D(M,ke,q,!1):te(M,ke)):D(M,ke,q,!1)}else _e||(ke.reading=!1,te(M,ke))}return!ke.ended&&(ke.length<ke.highWaterMark||ke.length===0)}function D(M,q,ge,_e){q.flowing&&q.length===0&&!q.sync?(q.awaitDrain=0,M.emit("data",ge)):(q.length+=q.objectMode?1:ge.length,_e?q.buffer.unshift(ge):q.buffer.push(ge),q.needReadable&&ye(M)),te(M,q)}function N(M,q){var ge;return!s(q)&&typeof q!="string"&&q!==void 0&&!M.objectMode&&(ge=new w("chunk",["string","Buffer","Uint8Array"],q)),ge}A.prototype.isPaused=function(){return this._readableState.flowing===!1},A.prototype.setEncoding=function(M){g||(g=vu().StringDecoder);var q=new g(M);this._readableState.decoder=q,this._readableState.encoding=this._readableState.decoder.encoding;for(var ge=this._readableState.buffer.head,_e="";ge!==null;)_e+=q.write(ge.data),ge=ge.next;return this._readableState.buffer.clear(),_e!==""&&this._readableState.buffer.push(_e),this._readableState.length=_e.length,this};var x=1073741824;function V(M){return M>=x?M=x:(M--,M|=M>>>1,M|=M>>>2,M|=M>>>4,M|=M>>>8,M|=M>>>16,M++),M}function G(M,q){return M<=0||q.length===0&&q.ended?0:q.objectMode?1:M!==M?q.flowing&&q.length?q.buffer.head.data.length:q.length:(M>q.highWaterMark&&(q.highWaterMark=V(M)),M<=q.length?M:q.ended?q.length:(q.needReadable=!0,0))}A.prototype.read=function(M){c("read",M),M=parseInt(M,10);var q=this._readableState,ge=M;if(M!==0&&(q.emittedReadable=!1),M===0&&q.needReadable&&((q.highWaterMark!==0?q.length>=q.highWaterMark:q.length>0)||q.ended))return c("read: emitReadable",q.length,q.ended),q.length===0&&q.ended?F(this):ye(this),null;if(M=G(M,q),M===0&&q.ended)return q.length===0&&F(this),null;var _e=q.needReadable;c("need readable",_e),(q.length===0||q.length-M<q.highWaterMark)&&(_e=!0,c("length less than watermark",_e)),q.ended||q.reading?(_e=!1,c("reading or ended",_e)):_e&&(c("do read"),q.reading=!0,q.sync=!0,q.length===0&&(q.needReadable=!0),this._read(q.highWaterMark),q.sync=!1,q.reading||(M=G(ge,q)));var Le;return M>0?Le=R(M,q):Le=null,Le===null?(q.needReadable=q.length<=q.highWaterMark,M=0):(q.length-=M,q.awaitDrain=0),q.length===0&&(q.ended||(q.needReadable=!0),ge!==M&&q.ended&&F(this)),Le!==null&&this.emit("data",Le),Le};function ae(M,q){if(c("onEofChunk"),!q.ended){if(q.decoder){var ge=q.decoder.end();ge&&ge.length&&(q.buffer.push(ge),q.length+=q.objectMode?1:ge.length)}q.ended=!0,q.sync?ye(M):(q.needReadable=!1,q.emittedReadable||(q.emittedReadable=!0,ue(M)))}}function ye(M){var q=M._readableState;c("emitReadable",q.needReadable,q.emittedReadable),q.needReadable=!1,q.emittedReadable||(c("emitReadable",q.flowing),q.emittedReadable=!0,ve.nextTick(ue,M))}function ue(M){var q=M._readableState;c("emitReadable_",q.destroyed,q.length,q.ended),!q.destroyed&&(q.length||q.ended)&&(M.emit("readable"),q.emittedReadable=!1),q.needReadable=!q.flowing&&!q.ended&&q.length<=q.highWaterMark,H(M)}function te(M,q){q.readingMore||(q.readingMore=!0,ve.nextTick(ce,M,q))}function ce(M,q){for(;!q.reading&&!q.ended&&(q.length<q.highWaterMark||q.flowing&&q.length===0);){var ge=q.length;if(c("maybeReadMore read 0"),M.read(0),ge===q.length)break}q.readingMore=!1}A.prototype._read=function(M){S(this,new E("_read()"))},A.prototype.pipe=function(M,q){var ge=this,_e=this._readableState;switch(_e.pipesCount){case 0:_e.pipes=M;break;case 1:_e.pipes=[_e.pipes,M];break;default:_e.pipes.push(M);break}_e.pipesCount+=1,c("pipe count=%d opts=%j",_e.pipesCount,q);var Le=(!q||q.end!==!1)&&M!==ve.stdout&&M!==ve.stderr,ke=Le?De:$t;_e.endEmitted?ve.nextTick(ke):ge.once("end",ke),M.on("unpipe",Pe);function Pe(Be,Ve){c("onunpipe"),Be===ge&&Ve&&Ve.hasUnpiped===!1&&(Ve.hasUnpiped=!0,Me())}function De(){c("onend"),M.end()}var Z=oe(ge);M.on("drain",Z);var xe=!1;function Me(){c("cleanup"),M.removeListener("close",Nt),M.removeListener("finish",_t),M.removeListener("drain",Z),M.removeListener("error",et),M.removeListener("unpipe",Pe),ge.removeListener("end",De),ge.removeListener("end",$t),ge.removeListener("data",Ge),xe=!0,_e.awaitDrain&&(!M._writableState||M._writableState.needDrain)&&Z()}ge.on("data",Ge);function Ge(Be){c("ondata");var Ve=M.write(Be);c("dest.write",Ve),Ve===!1&&((_e.pipesCount===1&&_e.pipes===M||_e.pipesCount>1&&z(_e.pipes,M)!==-1)&&!xe&&(c("false write response, pause",_e.awaitDrain),_e.awaitDrain++),ge.pause())}function et(Be){c("onerror",Be),$t(),M.removeListener("error",et),t(M,"error")===0&&S(M,Be)}I(M,"error",et);function Nt(){M.removeListener("finish",_t),$t()}M.once("close",Nt);function _t(){c("onfinish"),M.removeListener("close",Nt),$t()}M.once("finish",_t);function $t(){c("unpipe"),ge.unpipe(M)}return M.emit("pipe",ge),_e.flowing||(c("pipe resume"),ge.resume()),M};function oe(M){return function(){var ge=M._readableState;c("pipeOnDrain",ge.awaitDrain),ge.awaitDrain&&ge.awaitDrain--,ge.awaitDrain===0&&t(M,"data")&&(ge.flowing=!0,H(M))}}A.prototype.unpipe=function(M){var q=this._readableState,ge={hasUnpiped:!1};if(q.pipesCount===0)return this;if(q.pipesCount===1)return M&&M!==q.pipes?this:(M||(M=q.pipes),q.pipes=null,q.pipesCount=0,q.flowing=!1,M&&M.emit("unpipe",this,ge),this);if(!M){var _e=q.pipes,Le=q.pipesCount;q.pipes=null,q.pipesCount=0,q.flowing=!1;for(var ke=0;ke<Le;ke++)_e[ke].emit("unpipe",this,{hasUnpiped:!1});return this}var Pe=z(q.pipes,M);return Pe===-1?this:(q.pipes.splice(Pe,1),q.pipesCount-=1,q.pipesCount===1&&(q.pipes=q.pipes[0]),M.emit("unpipe",this,ge),this)},A.prototype.on=function(M,q){var ge=n.prototype.on.call(this,M,q),_e=this._readableState;return M==="data"?(_e.readableListening=this.listenerCount("readable")>0,_e.flowing!==!1&&this.resume()):M==="readable"&&!_e.endEmitted&&!_e.readableListening&&(_e.readableListening=_e.needReadable=!0,_e.flowing=!1,_e.emittedReadable=!1,c("on readable",_e.length,_e.reading),_e.length?ye(this):_e.reading||ve.nextTick(ne,this)),ge},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(M,q){var ge=n.prototype.removeListener.call(this,M,q);return M==="readable"&&ve.nextTick(J,this),ge},A.prototype.removeAllListeners=function(M){var q=n.prototype.removeAllListeners.apply(this,arguments);return(M==="readable"||M===void 0)&&ve.nextTick(J,this),q};function J(M){var q=M._readableState;q.readableListening=M.listenerCount("readable")>0,q.resumeScheduled&&!q.paused?q.flowing=!0:M.listenerCount("data")>0&&M.resume()}function ne(M){c("readable nexttick read 0"),M.read(0)}A.prototype.resume=function(){var M=this._readableState;return M.flowing||(c("resume"),M.flowing=!M.readableListening,se(this,M)),M.paused=!1,this};function se(M,q){q.resumeScheduled||(q.resumeScheduled=!0,ve.nextTick(Re,M,q))}function Re(M,q){c("resume",q.reading),q.reading||M.read(0),q.resumeScheduled=!1,M.emit("resume"),H(M),q.flowing&&!q.reading&&M.read(0)}A.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function H(M){var q=M._readableState;for(c("flow",q.flowing);q.flowing&&M.read()!==null;);}A.prototype.wrap=function(M){var q=this,ge=this._readableState,_e=!1;M.on("end",function(){if(c("wrapped end"),ge.decoder&&!ge.ended){var Pe=ge.decoder.end();Pe&&Pe.length&&q.push(Pe)}q.push(null)}),M.on("data",function(Pe){if(c("wrapped data"),ge.decoder&&(Pe=ge.decoder.write(Pe)),!(ge.objectMode&&Pe==null)&&!(!ge.objectMode&&(!Pe||!Pe.length))){var De=q.push(Pe);De||(_e=!0,M.pause())}});for(var Le in M)this[Le]===void 0&&typeof M[Le]=="function"&&(this[Le]=function(De){return function(){return M[De].apply(M,arguments)}}(Le));for(var ke=0;ke<T.length;ke++)M.on(T[ke],this.emit.bind(this,T[ke]));return this._read=function(Pe){c("wrapped _read",Pe),_e&&(_e=!1,M.resume())},this},typeof Symbol=="function"&&(A.prototype[Symbol.asyncIterator]=function(){return v===void 0&&(v=yR()),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(q){this._readableState&&(this._readableState.flowing=q)}}),A._fromList=R,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function R(M,q){if(q.length===0)return null;var ge;return q.objectMode?ge=q.buffer.shift():!M||M>=q.length?(q.decoder?ge=q.buffer.join(""):q.buffer.length===1?ge=q.buffer.first():ge=q.buffer.concat(q.length),q.buffer.clear()):ge=q.buffer.consume(M,q.decoder),ge}function F(M){var q=M._readableState;c("endReadable",q.endEmitted),q.endEmitted||(q.ended=!0,ve.nextTick(K,q,M))}function K(M,q){if(c("endReadableNT",M.endEmitted,M.length),!M.endEmitted&&M.length===0&&(M.endEmitted=!0,q.readable=!1,q.emit("end"),M.autoDestroy)){var ge=q._writableState;(!ge||ge.autoDestroy&&ge.finished)&&q.destroy()}}typeof Symbol=="function"&&(A.from=function(M,q){return h===void 0&&(h=bR()),h(A,M,q)});function z(M,q){for(var ge=0,_e=M.length;ge<_e;ge++)if(M[ge]===q)return ge;return-1}return Au}var Ru,$m;function Dm(){if($m)return Ru;$m=1,Ru=a;var e=Ni().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,n=e.ERR_MULTIPLE_CALLBACK,r=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=e.ERR_TRANSFORM_WITH_LENGTH_0,i=$i();ni()(a,i);function s(l,d){var f=this._transformState;f.transforming=!1;var m=f.writecb;if(m===null)return this.emit("error",new n);f.writechunk=null,f.writecb=null,d!=null&&this.push(d),m(l);var w=this._readableState;w.reading=!1,(w.needReadable||w.length<w.highWaterMark)&&this._read(w.highWaterMark)}function a(l){if(!(this instanceof a))return new a(l);i.call(this,l),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,l&&(typeof l.transform=="function"&&(this._transform=l.transform),typeof l.flush=="function"&&(this._flush=l.flush)),this.on("prefinish",c)}function c(){var l=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(d,f){u(l,d,f)}):u(this,null,null)}a.prototype.push=function(l,d){return this._transformState.needTransform=!1,i.prototype.push.call(this,l,d)},a.prototype._transform=function(l,d,f){f(new t("_transform()"))},a.prototype._write=function(l,d,f){var m=this._transformState;if(m.writecb=f,m.writechunk=l,m.writeencoding=d,!m.transforming){var w=this._readableState;(m.needTransform||w.needReadable||w.length<w.highWaterMark)&&this._read(w.highWaterMark)}},a.prototype._read=function(l){var d=this._transformState;d.writechunk!==null&&!d.transforming?(d.transforming=!0,this._transform(d.writechunk,d.writeencoding,d.afterTransform)):d.needTransform=!0},a.prototype._destroy=function(l,d){i.prototype._destroy.call(this,l,function(f){d(f)})};function u(l,d,f){if(d)return l.emit("error",d);if(f!=null&&l.push(f),l._writableState.length)throw new o;if(l._transformState.transforming)throw new r;return l.push(null)}return Ru}var _u,Lm;function vR(){if(Lm)return _u;Lm=1,_u=t;var e=Dm();ni()(t,e);function t(n){if(!(this instanceof t))return new t(n);e.call(this,n)}return t.prototype._transform=function(n,r,o){o(null,n)},_u}var Iu,Mm;function wR(){if(Mm)return Iu;Mm=1;var e;function t(f){var m=!1;return function(){m||(m=!0,f.apply(void 0,arguments))}}var n=Ni().codes,r=n.ERR_MISSING_ARGS,o=n.ERR_STREAM_DESTROYED;function i(f){if(f)throw f}function s(f){return f.setHeader&&typeof f.abort=="function"}function a(f,m,w,y){y=t(y);var E=!1;f.on("close",function(){E=!0}),e===void 0&&(e=Su()),e(f,{readable:m,writable:w},function(g){if(g)return y(g);E=!0,y()});var b=!1;return function(g){if(!E&&!b){if(b=!0,s(f))return f.abort();if(typeof f.destroy=="function")return f.destroy();y(g||new o("pipe"))}}}function c(f){f()}function u(f,m){return f.pipe(m)}function l(f){return!f.length||typeof f[f.length-1]!="function"?i:f.pop()}function d(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];var y=l(m);if(Array.isArray(m[0])&&(m=m[0]),m.length<2)throw new r("streams");var E,b=m.map(function(g,v){var h=v<m.length-1,S=v>0;return a(g,h,S,function(T){E||(E=T),T&&b.forEach(c),!h&&(b.forEach(c),y(E))})});return m.reduce(u)}return Iu=d,Iu}var Cu,Bm;function SR(){if(Bm)return Cu;Bm=1,Cu=n;var e=ic().EventEmitter,t=ni();t(n,e),n.Readable=Nm(),n.Writable=_m(),n.Duplex=$i(),n.Transform=Dm(),n.PassThrough=vR(),n.finished=Su(),n.pipeline=wR(),n.Stream=n;function n(){e.call(this)}return n.prototype.pipe=function(r,o){var i=this;function s(m){r.writable&&r.write(m)===!1&&i.pause&&i.pause()}i.on("data",s);function a(){i.readable&&i.resume&&i.resume()}r.on("drain",a),!r._isStdio&&(!o||o.end!==!1)&&(i.on("end",u),i.on("close",l));var c=!1;function u(){c||(c=!0,r.end())}function l(){c||(c=!0,typeof r.destroy=="function"&&r.destroy())}function d(m){if(f(),e.listenerCount(this,"error")===0)throw m}i.on("error",d),r.on("error",d);function f(){i.removeListener("data",s),r.removeListener("drain",a),i.removeListener("end",u),i.removeListener("close",l),i.removeListener("error",d),r.removeListener("error",d),i.removeListener("end",f),i.removeListener("close",f),r.removeListener("close",f)}return i.on("end",f),i.on("close",f),r.on("close",f),r.emit("pipe",i),r},Cu}var jm;function ER(){return jm||(jm=1,function(e){(function(t){t.parser=function(R,F){return new r(R,F)},t.SAXParser=r,t.SAXStream=l,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(R,F){if(!(this instanceof r))return new r(R,F);var K=this;i(K),K.q=K.c="",K.bufferCheckPosition=t.MAX_BUFFER_LENGTH,K.opt=F||{},K.opt.lowercase=K.opt.lowercase||K.opt.lowercasetags,K.looseCase=K.opt.lowercase?"toLowerCase":"toUpperCase",K.tags=[],K.closed=K.closedRoot=K.sawRoot=!1,K.tag=K.error=null,K.strict=!!R,K.noscript=!!(R||K.opt.noscript),K.state=A.BEGIN,K.strictEntities=K.opt.strictEntities,K.ENTITIES=K.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),K.attribList=[],K.opt.xmlns&&(K.ns=Object.create(y)),K.opt.unquotedAttributeValues===void 0&&(K.opt.unquotedAttributeValues=!R),K.trackPosition=K.opt.position!==!1,K.trackPosition&&(K.position=K.line=K.column=0),D(K,"onready")}Object.create||(Object.create=function(R){function F(){}F.prototype=R;var K=new F;return K}),Object.keys||(Object.keys=function(R){var F=[];for(var K in R)R.hasOwnProperty(K)&&F.push(K);return F});function o(R){for(var F=Math.max(t.MAX_BUFFER_LENGTH,10),K=0,z=0,M=n.length;z<M;z++){var q=R[n[z]].length;if(q>F)switch(n[z]){case"textNode":x(R);break;case"cdata":N(R,"oncdata",R.cdata),R.cdata="";break;case"script":N(R,"onscript",R.script),R.script="";break;default:G(R,"Max buffer length exceeded: "+n[z])}K=Math.max(K,q)}var ge=t.MAX_BUFFER_LENGTH-K;R.bufferCheckPosition=ge+R.position}function i(R){for(var F=0,K=n.length;F<K;F++)R[n[F]]=""}function s(R){x(R),R.cdata!==""&&(N(R,"oncdata",R.cdata),R.cdata=""),R.script!==""&&(N(R,"onscript",R.script),R.script="")}r.prototype={end:function(){ae(this)},write:H,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){s(this)}};var a;try{a=SR().Stream}catch{a=function(){}}a||(a=function(){});var c=t.EVENTS.filter(function(R){return R!=="error"&&R!=="end"});function u(R,F){return new l(R,F)}function l(R,F){if(!(this instanceof l))return new l(R,F);a.apply(this),this._parser=new r(R,F),this.writable=!0,this.readable=!0;var K=this;this._parser.onend=function(){K.emit("end")},this._parser.onerror=function(z){K.emit("error",z),K._parser.error=null},this._decoder=null,c.forEach(function(z){Object.defineProperty(K,"on"+z,{get:function(){return K._parser["on"+z]},set:function(M){if(!M)return K.removeAllListeners(z),K._parser["on"+z]=M,M;K.on(z,M)},enumerable:!0,configurable:!1})})}l.prototype=Object.create(a.prototype,{constructor:{value:l}}),l.prototype.write=function(R){if(typeof vr=="function"&&typeof vr.isBuffer=="function"&&vr.isBuffer(R)){if(!this._decoder){var F=vu().StringDecoder;this._decoder=new F("utf8")}R=this._decoder.write(R)}return this._parser.write(R.toString()),this.emit("data",R),!0},l.prototype.end=function(R){return R&&R.length&&this.write(R),this._parser.end(),!0},l.prototype.on=function(R,F){var K=this;return!K._parser["on"+R]&&c.indexOf(R)!==-1&&(K._parser["on"+R]=function(){var z=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);z.splice(0,0,R),K.emit.apply(K,z)}),a.prototype.on.call(K,R,F)};var d="[CDATA[",f="DOCTYPE",m="http://www.w3.org/XML/1998/namespace",w="http://www.w3.org/2000/xmlns/",y={xml:m,xmlns:w},E=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,b=/[:_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(R){return R===" "||R===`
26
- `||R==="\r"||R===" "}function S(R){return R==='"'||R==="'"}function T(R){return R===">"||h(R)}function I(R,F){return R.test(F)}function _(R,F){return!I(R,F)}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(R){var F=t.ENTITIES[R],K=typeof F=="number"?String.fromCharCode(F):F;t.ENTITIES[R]=K});for(var $ in t.STATE)t.STATE[t.STATE[$]]=$;A=t.STATE;function D(R,F,K){R[F]&&R[F](K)}function N(R,F,K){R.textNode&&x(R),D(R,F,K)}function x(R){R.textNode=V(R.opt,R.textNode),R.textNode&&D(R,"ontext",R.textNode),R.textNode=""}function V(R,F){return R.trim&&(F=F.trim()),R.normalize&&(F=F.replace(/\s+/g," ")),F}function G(R,F){return x(R),R.trackPosition&&(F+=`
27
- Line: `+R.line+`
28
- Column: `+R.column+`
29
- Char: `+R.c),F=new Error(F),R.error=F,D(R,"onerror",F),R}function ae(R){return R.sawRoot&&!R.closedRoot&&ye(R,"Unclosed root tag"),R.state!==A.BEGIN&&R.state!==A.BEGIN_WHITESPACE&&R.state!==A.TEXT&&G(R,"Unexpected end"),x(R),R.c="",R.closed=!0,D(R,"onend"),r.call(R,R.strict,R.opt),R}function ye(R,F){if(typeof R!="object"||!(R instanceof r))throw new Error("bad call to strictFail");R.strict&&G(R,F)}function ue(R){R.strict||(R.tagName=R.tagName[R.looseCase]());var F=R.tags[R.tags.length-1]||R,K=R.tag={name:R.tagName,attributes:{}};R.opt.xmlns&&(K.ns=F.ns),R.attribList.length=0,N(R,"onopentagstart",K)}function te(R,F){var K=R.indexOf(":"),z=K<0?["",R]:R.split(":"),M=z[0],q=z[1];return F&&R==="xmlns"&&(M="xmlns",q=""),{prefix:M,local:q}}function ce(R){if(R.strict||(R.attribName=R.attribName[R.looseCase]()),R.attribList.indexOf(R.attribName)!==-1||R.tag.attributes.hasOwnProperty(R.attribName)){R.attribName=R.attribValue="";return}if(R.opt.xmlns){var F=te(R.attribName,!0),K=F.prefix,z=F.local;if(K==="xmlns")if(z==="xml"&&R.attribValue!==m)ye(R,"xml: prefix must be bound to "+m+`
30
- Actual: `+R.attribValue);else if(z==="xmlns"&&R.attribValue!==w)ye(R,"xmlns: prefix must be bound to "+w+`
31
- Actual: `+R.attribValue);else{var M=R.tag,q=R.tags[R.tags.length-1]||R;M.ns===q.ns&&(M.ns=Object.create(q.ns)),M.ns[z]=R.attribValue}R.attribList.push([R.attribName,R.attribValue])}else R.tag.attributes[R.attribName]=R.attribValue,N(R,"onattribute",{name:R.attribName,value:R.attribValue});R.attribName=R.attribValue=""}function oe(R,F){if(R.opt.xmlns){var K=R.tag,z=te(R.tagName);K.prefix=z.prefix,K.local=z.local,K.uri=K.ns[z.prefix]||"",K.prefix&&!K.uri&&(ye(R,"Unbound namespace prefix: "+JSON.stringify(R.tagName)),K.uri=z.prefix);var M=R.tags[R.tags.length-1]||R;K.ns&&M.ns!==K.ns&&Object.keys(K.ns).forEach(function(Ge){N(R,"onopennamespace",{prefix:Ge,uri:K.ns[Ge]})});for(var q=0,ge=R.attribList.length;q<ge;q++){var _e=R.attribList[q],Le=_e[0],ke=_e[1],Pe=te(Le,!0),De=Pe.prefix,Z=Pe.local,xe=De===""?"":K.ns[De]||"",Me={name:Le,value:ke,prefix:De,local:Z,uri:xe};De&&De!=="xmlns"&&!xe&&(ye(R,"Unbound namespace prefix: "+JSON.stringify(De)),Me.uri=De),R.tag.attributes[Le]=Me,N(R,"onattribute",Me)}R.attribList.length=0}R.tag.isSelfClosing=!!F,R.sawRoot=!0,R.tags.push(R.tag),N(R,"onopentag",R.tag),F||(!R.noscript&&R.tagName.toLowerCase()==="script"?R.state=A.SCRIPT:R.state=A.TEXT,R.tag=null,R.tagName=""),R.attribName=R.attribValue="",R.attribList.length=0}function J(R){if(!R.tagName){ye(R,"Weird empty close tag."),R.textNode+="</>",R.state=A.TEXT;return}if(R.script){if(R.tagName!=="script"){R.script+="</"+R.tagName+">",R.tagName="",R.state=A.SCRIPT;return}N(R,"onscript",R.script),R.script=""}var F=R.tags.length,K=R.tagName;R.strict||(K=K[R.looseCase]());for(var z=K;F--;){var M=R.tags[F];if(M.name!==z)ye(R,"Unexpected close tag");else break}if(F<0){ye(R,"Unmatched closing tag: "+R.tagName),R.textNode+="</"+R.tagName+">",R.state=A.TEXT;return}R.tagName=K;for(var q=R.tags.length;q-- >F;){var ge=R.tag=R.tags.pop();R.tagName=R.tag.name,N(R,"onclosetag",R.tagName);var _e={};for(var Le in ge.ns)_e[Le]=ge.ns[Le];var ke=R.tags[R.tags.length-1]||R;R.opt.xmlns&&ge.ns!==ke.ns&&Object.keys(ge.ns).forEach(function(Pe){var De=ge.ns[Pe];N(R,"onclosenamespace",{prefix:Pe,uri:De})})}F===0&&(R.closedRoot=!0),R.tagName=R.attribValue=R.attribName="",R.attribList.length=0,R.state=A.TEXT}function ne(R){var F=R.entity,K=F.toLowerCase(),z,M="";return R.ENTITIES[F]?R.ENTITIES[F]:R.ENTITIES[K]?R.ENTITIES[K]:(F=K,F.charAt(0)==="#"&&(F.charAt(1)==="x"?(F=F.slice(2),z=parseInt(F,16),M=z.toString(16)):(F=F.slice(1),z=parseInt(F,10),M=z.toString(10))),F=F.replace(/^0+/,""),isNaN(z)||M.toLowerCase()!==F?(ye(R,"Invalid character entity"),"&"+R.entity+";"):String.fromCodePoint(z))}function se(R,F){F==="<"?(R.state=A.OPEN_WAKA,R.startTagPosition=R.position):h(F)||(ye(R,"Non-whitespace before first tag."),R.textNode=F,R.state=A.TEXT)}function Re(R,F){var K="";return F<R.length&&(K=R.charAt(F)),K}function H(R){var F=this;if(this.error)throw this.error;if(F.closed)return G(F,"Cannot write after close. Assign an onready handler.");if(R===null)return ae(F);typeof R=="object"&&(R=R.toString());for(var K=0,z="";z=Re(R,K++),F.c=z,!!z;)switch(F.trackPosition&&(F.position++,z===`
32
- `?(F.line++,F.column=0):F.column++),F.state){case A.BEGIN:if(F.state=A.BEGIN_WHITESPACE,z==="\uFEFF")continue;se(F,z);continue;case A.BEGIN_WHITESPACE:se(F,z);continue;case A.TEXT:if(F.sawRoot&&!F.closedRoot){for(var M=K-1;z&&z!=="<"&&z!=="&";)z=Re(R,K++),z&&F.trackPosition&&(F.position++,z===`
33
- `?(F.line++,F.column=0):F.column++);F.textNode+=R.substring(M,K-1)}z==="<"&&!(F.sawRoot&&F.closedRoot&&!F.strict)?(F.state=A.OPEN_WAKA,F.startTagPosition=F.position):(!h(z)&&(!F.sawRoot||F.closedRoot)&&ye(F,"Text data outside of root node."),z==="&"?F.state=A.TEXT_ENTITY:F.textNode+=z);continue;case A.SCRIPT:z==="<"?F.state=A.SCRIPT_ENDING:F.script+=z;continue;case A.SCRIPT_ENDING:z==="/"?F.state=A.CLOSE_TAG:(F.script+="<"+z,F.state=A.SCRIPT);continue;case A.OPEN_WAKA:if(z==="!")F.state=A.SGML_DECL,F.sgmlDecl="";else if(!h(z))if(I(E,z))F.state=A.OPEN_TAG,F.tagName=z;else if(z==="/")F.state=A.CLOSE_TAG,F.tagName="";else if(z==="?")F.state=A.PROC_INST,F.procInstName=F.procInstBody="";else{if(ye(F,"Unencoded <"),F.startTagPosition+1<F.position){var q=F.position-F.startTagPosition;z=new Array(q).join(" ")+z}F.textNode+="<"+z,F.state=A.TEXT}continue;case A.SGML_DECL:if(F.sgmlDecl+z==="--"){F.state=A.COMMENT,F.comment="",F.sgmlDecl="";continue}F.doctype&&F.doctype!==!0&&F.sgmlDecl?(F.state=A.DOCTYPE_DTD,F.doctype+="<!"+F.sgmlDecl+z,F.sgmlDecl=""):(F.sgmlDecl+z).toUpperCase()===d?(N(F,"onopencdata"),F.state=A.CDATA,F.sgmlDecl="",F.cdata=""):(F.sgmlDecl+z).toUpperCase()===f?(F.state=A.DOCTYPE,(F.doctype||F.sawRoot)&&ye(F,"Inappropriately located doctype declaration"),F.doctype="",F.sgmlDecl=""):z===">"?(N(F,"onsgmldeclaration",F.sgmlDecl),F.sgmlDecl="",F.state=A.TEXT):(S(z)&&(F.state=A.SGML_DECL_QUOTED),F.sgmlDecl+=z);continue;case A.SGML_DECL_QUOTED:z===F.q&&(F.state=A.SGML_DECL,F.q=""),F.sgmlDecl+=z;continue;case A.DOCTYPE:z===">"?(F.state=A.TEXT,N(F,"ondoctype",F.doctype),F.doctype=!0):(F.doctype+=z,z==="["?F.state=A.DOCTYPE_DTD:S(z)&&(F.state=A.DOCTYPE_QUOTED,F.q=z));continue;case A.DOCTYPE_QUOTED:F.doctype+=z,z===F.q&&(F.q="",F.state=A.DOCTYPE);continue;case A.DOCTYPE_DTD:z==="]"?(F.doctype+=z,F.state=A.DOCTYPE):z==="<"?(F.state=A.OPEN_WAKA,F.startTagPosition=F.position):S(z)?(F.doctype+=z,F.state=A.DOCTYPE_DTD_QUOTED,F.q=z):F.doctype+=z;continue;case A.DOCTYPE_DTD_QUOTED:F.doctype+=z,z===F.q&&(F.state=A.DOCTYPE_DTD,F.q="");continue;case A.COMMENT:z==="-"?F.state=A.COMMENT_ENDING:F.comment+=z;continue;case A.COMMENT_ENDING:z==="-"?(F.state=A.COMMENT_ENDED,F.comment=V(F.opt,F.comment),F.comment&&N(F,"oncomment",F.comment),F.comment=""):(F.comment+="-"+z,F.state=A.COMMENT);continue;case A.COMMENT_ENDED:z!==">"?(ye(F,"Malformed comment"),F.comment+="--"+z,F.state=A.COMMENT):F.doctype&&F.doctype!==!0?F.state=A.DOCTYPE_DTD:F.state=A.TEXT;continue;case A.CDATA:z==="]"?F.state=A.CDATA_ENDING:F.cdata+=z;continue;case A.CDATA_ENDING:z==="]"?F.state=A.CDATA_ENDING_2:(F.cdata+="]"+z,F.state=A.CDATA);continue;case A.CDATA_ENDING_2:z===">"?(F.cdata&&N(F,"oncdata",F.cdata),N(F,"onclosecdata"),F.cdata="",F.state=A.TEXT):z==="]"?F.cdata+="]":(F.cdata+="]]"+z,F.state=A.CDATA);continue;case A.PROC_INST:z==="?"?F.state=A.PROC_INST_ENDING:h(z)?F.state=A.PROC_INST_BODY:F.procInstName+=z;continue;case A.PROC_INST_BODY:if(!F.procInstBody&&h(z))continue;z==="?"?F.state=A.PROC_INST_ENDING:F.procInstBody+=z;continue;case A.PROC_INST_ENDING:z===">"?(N(F,"onprocessinginstruction",{name:F.procInstName,body:F.procInstBody}),F.procInstName=F.procInstBody="",F.state=A.TEXT):(F.procInstBody+="?"+z,F.state=A.PROC_INST_BODY);continue;case A.OPEN_TAG:I(b,z)?F.tagName+=z:(ue(F),z===">"?oe(F):z==="/"?F.state=A.OPEN_TAG_SLASH:(h(z)||ye(F,"Invalid character in tag name"),F.state=A.ATTRIB));continue;case A.OPEN_TAG_SLASH:z===">"?(oe(F,!0),J(F)):(ye(F,"Forward-slash in opening tag not followed by >"),F.state=A.ATTRIB);continue;case A.ATTRIB:if(h(z))continue;z===">"?oe(F):z==="/"?F.state=A.OPEN_TAG_SLASH:I(E,z)?(F.attribName=z,F.attribValue="",F.state=A.ATTRIB_NAME):ye(F,"Invalid attribute name");continue;case A.ATTRIB_NAME:z==="="?F.state=A.ATTRIB_VALUE:z===">"?(ye(F,"Attribute without value"),F.attribValue=F.attribName,ce(F),oe(F)):h(z)?F.state=A.ATTRIB_NAME_SAW_WHITE:I(b,z)?F.attribName+=z:ye(F,"Invalid attribute name");continue;case A.ATTRIB_NAME_SAW_WHITE:if(z==="=")F.state=A.ATTRIB_VALUE;else{if(h(z))continue;ye(F,"Attribute without value"),F.tag.attributes[F.attribName]="",F.attribValue="",N(F,"onattribute",{name:F.attribName,value:""}),F.attribName="",z===">"?oe(F):I(E,z)?(F.attribName=z,F.state=A.ATTRIB_NAME):(ye(F,"Invalid attribute name"),F.state=A.ATTRIB)}continue;case A.ATTRIB_VALUE:if(h(z))continue;S(z)?(F.q=z,F.state=A.ATTRIB_VALUE_QUOTED):(F.opt.unquotedAttributeValues||G(F,"Unquoted attribute value"),F.state=A.ATTRIB_VALUE_UNQUOTED,F.attribValue=z);continue;case A.ATTRIB_VALUE_QUOTED:if(z!==F.q){z==="&"?F.state=A.ATTRIB_VALUE_ENTITY_Q:F.attribValue+=z;continue}ce(F),F.q="",F.state=A.ATTRIB_VALUE_CLOSED;continue;case A.ATTRIB_VALUE_CLOSED:h(z)?F.state=A.ATTRIB:z===">"?oe(F):z==="/"?F.state=A.OPEN_TAG_SLASH:I(E,z)?(ye(F,"No whitespace between attributes"),F.attribName=z,F.attribValue="",F.state=A.ATTRIB_NAME):ye(F,"Invalid attribute name");continue;case A.ATTRIB_VALUE_UNQUOTED:if(!T(z)){z==="&"?F.state=A.ATTRIB_VALUE_ENTITY_U:F.attribValue+=z;continue}ce(F),z===">"?oe(F):F.state=A.ATTRIB;continue;case A.CLOSE_TAG:if(F.tagName)z===">"?J(F):I(b,z)?F.tagName+=z:F.script?(F.script+="</"+F.tagName,F.tagName="",F.state=A.SCRIPT):(h(z)||ye(F,"Invalid tagname in closing tag"),F.state=A.CLOSE_TAG_SAW_WHITE);else{if(h(z))continue;_(E,z)?F.script?(F.script+="</"+z,F.state=A.SCRIPT):ye(F,"Invalid tagname in closing tag."):F.tagName=z}continue;case A.CLOSE_TAG_SAW_WHITE:if(h(z))continue;z===">"?J(F):ye(F,"Invalid characters in closing tag");continue;case A.TEXT_ENTITY:case A.ATTRIB_VALUE_ENTITY_Q:case A.ATTRIB_VALUE_ENTITY_U:var ge,_e;switch(F.state){case A.TEXT_ENTITY:ge=A.TEXT,_e="textNode";break;case A.ATTRIB_VALUE_ENTITY_Q:ge=A.ATTRIB_VALUE_QUOTED,_e="attribValue";break;case A.ATTRIB_VALUE_ENTITY_U:ge=A.ATTRIB_VALUE_UNQUOTED,_e="attribValue";break}if(z===";"){var Le=ne(F);F.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(Le)?(F.entity="",F.state=ge,F.write(Le)):(F[_e]+=Le,F.entity="",F.state=ge)}else I(F.entity.length?v:g,z)?F.entity+=z:(ye(F,"Invalid character in entity name"),F[_e]+="&"+F.entity+z,F.entity="",F.state=ge);continue;default:throw new Error(F,"Unknown state: "+F.state)}return F.position>=F.bufferCheckPosition&&o(F),F}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||function(){var R=String.fromCharCode,F=Math.floor,K=function(){var z=16384,M=[],q,ge,_e=-1,Le=arguments.length;if(!Le)return"";for(var ke="";++_e<Le;){var Pe=Number(arguments[_e]);if(!isFinite(Pe)||Pe<0||Pe>1114111||F(Pe)!==Pe)throw RangeError("Invalid code point: "+Pe);Pe<=65535?M.push(Pe):(Pe-=65536,q=(Pe>>10)+55296,ge=Pe%1024+56320,M.push(q,ge)),(_e+1===Le||M.length>z)&&(ke+=R.apply(null,M),M.length=0)}return ke};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:K,configurable:!0,writable:!0}):String.fromCodePoint=K}()})(e)}(rc)),rc}var Pu,Um;function Fu(){return Um||(Um=1,Pu={isArray:function(e){return Array.isArray?Array.isArray(e):Object.prototype.toString.call(e)==="[object Array]"}}),Pu}var Ou,qm;function ku(){if(qm)return Ou;qm=1;var e=Fu().isArray;return Ou={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}},Ou}var xu,Vm;function zm(){if(Vm)return xu;Vm=1;var e=ER(),t=ku(),n=Fu().isArray,r,o;function i(b){return r=t.copyOptions(b),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(b){var g=Number(b);if(!isNaN(g))return g;var v=b.toLowerCase();return v==="true"?!0:v==="false"?!1:b}function a(b,g){var v;if(r.compact){if(!o[r[b+"Key"]]&&(n(r.alwaysArray)?r.alwaysArray.indexOf(r[b+"Key"])!==-1:r.alwaysArray)&&(o[r[b+"Key"]]=[]),o[r[b+"Key"]]&&!n(o[r[b+"Key"]])&&(o[r[b+"Key"]]=[o[r[b+"Key"]]]),b+"Fn"in r&&typeof g=="string"&&(g=r[b+"Fn"](g,o)),b==="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,o);else{var h=g[v];delete g[v],g[r.instructionNameFn(v,h,o)]=h}}n(o[r[b+"Key"]])?o[r[b+"Key"]].push(g):o[r[b+"Key"]]=g}else{o[r.elementsKey]||(o[r.elementsKey]=[]);var S={};if(S[r.typeKey]=b,b==="instruction"){for(v in g)if(g.hasOwnProperty(v))break;S[r.nameKey]="instructionNameFn"in r?r.instructionNameFn(v,g,o):v,r.instructionHasAttributes?(S[r.attributesKey]=g[v][r.attributesKey],"instructionFn"in r&&(S[r.attributesKey]=r.instructionFn(S[r.attributesKey],v,o))):("instructionFn"in r&&(g[v]=r.instructionFn(g[v],v,o)),S[r.instructionKey]=g[v])}else b+"Fn"in r&&(g=r[b+"Fn"](g,o)),S[r[b+"Key"]]=g;r.addParent&&(S[r.parentKey]=o),o[r.elementsKey].push(S)}}function c(b){if("attributesFn"in r&&b&&(b=r.attributesFn(b,o)),(r.trim||"attributeValueFn"in r||"attributeNameFn"in r||r.nativeTypeAttributes)&&b){var g;for(g in b)if(b.hasOwnProperty(g)&&(r.trim&&(b[g]=b[g].trim()),r.nativeTypeAttributes&&(b[g]=s(b[g])),"attributeValueFn"in r&&(b[g]=r.attributeValueFn(b[g],g,o)),"attributeNameFn"in r)){var v=b[g];delete b[g],b[r.attributeNameFn(g,b[g],o)]=v}}return b}function u(b){var g={};if(b.body&&(b.name.toLowerCase()==="xml"||r.instructionHasAttributes)){for(var v=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,h;(h=v.exec(b.body))!==null;)g[h[1]]=h[2]||h[3]||h[4];g=c(g)}if(b.name.toLowerCase()==="xml"){if(r.ignoreDeclaration)return;o[r.declarationKey]={},Object.keys(g).length&&(o[r.declarationKey][r.attributesKey]=g),r.addParent&&(o[r.declarationKey][r.parentKey]=o)}else{if(r.ignoreInstruction)return;r.trim&&(b.body=b.body.trim());var S={};r.instructionHasAttributes&&Object.keys(g).length?(S[b.name]={},S[b.name][r.attributesKey]=g):S[b.name]=b.body,a("instruction",S)}}function l(b,g){var v;if(typeof b=="object"&&(g=b.attributes,b=b.name),g=c(g),"elementNameFn"in r&&(b=r.elementNameFn(b,o)),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])}!(b in o)&&(n(r.alwaysArray)?r.alwaysArray.indexOf(b)!==-1:r.alwaysArray)&&(o[b]=[]),o[b]&&!n(o[b])&&(o[b]=[o[b]]),n(o[b])?o[b].push(v):o[b]=v}else o[r.elementsKey]||(o[r.elementsKey]=[]),v={},v[r.typeKey]="element",v[r.nameKey]=b,!r.ignoreAttributes&&g&&Object.keys(g).length&&(v[r.attributesKey]=g),r.alwaysChildren&&(v[r.elementsKey]=[]),o[r.elementsKey].push(v);v[r.parentKey]=o,o=v}function d(b){r.ignoreText||!b.trim()&&!r.captureSpacesBetweenElements||(r.trim&&(b=b.trim()),r.nativeType&&(b=s(b)),r.sanitize&&(b=b.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")),a("text",b))}function f(b){r.ignoreComment||(r.trim&&(b=b.trim()),a("comment",b))}function m(b){var g=o[r.parentKey];r.addParent||delete o[r.parentKey],o=g}function w(b){r.ignoreCdata||(r.trim&&(b=b.trim()),a("cdata",b))}function y(b){r.ignoreDoctype||(b=b.replace(/^ /,""),r.trim&&(b=b.trim()),a("doctype",b))}function E(b){b.note=b}return xu=function(b,g){var v=e.parser(!0,{}),h={};if(o=h,r=i(g),v.opt={strictEntities:!0},v.onopentag=l,v.ontext=d,v.oncomment=f,v.onclosetag=m,v.onerror=E,v.oncdata=w,v.ondoctype=y,v.onprocessinginstruction=u,v.write(b).close(),h[r.elementsKey]){var S=h[r.elementsKey];delete h[r.elementsKey],h[r.elementsKey]=S,delete h.text}return h},xu}var Nu,Wm;function TR(){if(Wm)return Nu;Wm=1;var e=ku(),t=zm();function n(r){var o=e.copyOptions(r);return e.ensureSpacesExists(o),o}return Nu=function(r,o){var i,s,a,c;return i=n(o),s=t(r,i),c="compact"in i&&i.compact?"_parent":"parent","addParent"in i&&i.addParent?a=JSON.stringify(s,function(u,l){return u===c?"_":l},i.spaces):a=JSON.stringify(s,null,i.spaces),a.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")},Nu}var $u,Hm;function Gm(){if(Hm)return $u;Hm=1;var e=ku(),t=Fu().isArray,n,r;function o(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 i(v,h,S){return(!S&&v.spaces?`
34
- `:"")+Array(h+1).join(v.spaces)}function s(v,h,S){if(h.ignoreAttributes)return"";"attributesFn"in h&&(v=h.attributesFn(v,r,n));var T,I,_,A,$=[];for(T in v)v.hasOwnProperty(T)&&v[T]!==null&&v[T]!==void 0&&(A=h.noQuotesForNativeAttributes&&typeof v[T]!="string"?"":'"',I=""+v[T],I=I.replace(/"/g,"&quot;"),_="attributeNameFn"in h?h.attributeNameFn(T,I,r,n):T,$.push(h.spaces&&h.indentAttributes?i(h,S+1,!1):" "),$.push(_+"="+A+("attributeValueFn"in h?h.attributeValueFn(I,T,r,n):I)+A));return v&&Object.keys(v).length&&h.spaces&&h.indentAttributes&&$.push(i(h,S,!1)),$.join("")}function a(v,h,S){return n=v,r="xml",h.ignoreDeclaration?"":"<?xml"+s(v[h.attributesKey],h,S)+"?>"}function c(v,h,S){if(h.ignoreInstruction)return"";var T;for(T in v)if(v.hasOwnProperty(T))break;var I="instructionNameFn"in h?h.instructionNameFn(T,v[T],r,n):T;if(typeof v[T]=="object")return n=v,r=I,"<?"+I+s(v[T][h.attributesKey],h,S)+"?>";var _=v[T]?v[T]:"";return"instructionFn"in h&&(_=h.instructionFn(_,T,r,n)),"<?"+I+(_?" "+_:"")+"?>"}function u(v,h){return h.ignoreComment?"":"<!--"+("commentFn"in h?h.commentFn(v,r,n):v)+"-->"}function l(v,h){return h.ignoreCdata?"":"<![CDATA["+("cdataFn"in h?h.cdataFn(v,r,n):v.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function d(v,h){return h.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in h?h.doctypeFn(v,r,n):v)+">"}function f(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 S;if(v.elements&&v.elements.length)for(S=0;S<v.elements.length;++S)switch(v.elements[S][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 w(v,h,S){n=v,r=v.name;var T=[],I="elementNameFn"in h?h.elementNameFn(v.name,v):v.name;T.push("<"+I),v[h.attributesKey]&&T.push(s(v[h.attributesKey],h,S));var _=v[h.elementsKey]&&v[h.elementsKey].length||v[h.attributesKey]&&v[h.attributesKey]["xml:space"]==="preserve";return _||("fullTagEmptyElementFn"in h?_=h.fullTagEmptyElementFn(v.name,v):_=h.fullTagEmptyElement),_?(T.push(">"),v[h.elementsKey]&&v[h.elementsKey].length&&(T.push(y(v[h.elementsKey],h,S+1)),n=v,r=v.name),T.push(h.spaces&&m(v,h)?`
35
- `+Array(S+1).join(h.spaces):""),T.push("</"+I+">")):T.push("/>"),T.join("")}function y(v,h,S,T){return v.reduce(function(I,_){var A=i(h,S,T&&!I);switch(_.type){case"element":return I+A+w(_,h,S);case"comment":return I+A+u(_[h.commentKey],h);case"doctype":return I+A+d(_[h.doctypeKey],h);case"cdata":return I+(h.indentCdata?A:"")+l(_[h.cdataKey],h);case"text":return I+(h.indentText?A:"")+f(_[h.textKey],h);case"instruction":var $={};return $[_[h.nameKey]]=_[h.attributesKey]?_:_[h.instructionKey],I+(h.indentInstruction?A:"")+c($,h,S)}},"")}function E(v,h,S){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||S)return!0;break;case h.cdataKey:if(h.indentCdata||S)return!0;break;case h.instructionKey:if(h.indentInstruction||S)return!0;break;case h.doctypeKey:case h.commentKey:return!0;default:return!0}return!1}function b(v,h,S,T,I){n=v,r=h;var _="elementNameFn"in S?S.elementNameFn(h,v):h;if(typeof v>"u"||v===null||v==="")return"fullTagEmptyElementFn"in S&&S.fullTagEmptyElementFn(h,v)||S.fullTagEmptyElement?"<"+_+"></"+_+">":"<"+_+"/>";var A=[];if(h){if(A.push("<"+_),typeof v!="object")return A.push(">"+f(v,S)+"</"+_+">"),A.join("");v[S.attributesKey]&&A.push(s(v[S.attributesKey],S,T));var $=E(v,S,!0)||v[S.attributesKey]&&v[S.attributesKey]["xml:space"]==="preserve";if($||("fullTagEmptyElementFn"in S?$=S.fullTagEmptyElementFn(h,v):$=S.fullTagEmptyElement),$)A.push(">");else return A.push("/>"),A.join("")}return A.push(g(v,S,T+1,!1)),n=v,r=h,h&&A.push((I?i(S,T,!1):"")+"</"+_+">"),A.join("")}function g(v,h,S,T){var I,_,A,$=[];for(_ in v)if(v.hasOwnProperty(_))for(A=t(v[_])?v[_]:[v[_]],I=0;I<A.length;++I){switch(_){case h.declarationKey:$.push(a(A[I],h,S));break;case h.instructionKey:$.push((h.indentInstruction?i(h,S,T):"")+c(A[I],h,S));break;case h.attributesKey:case h.parentKey:break;case h.textKey:$.push((h.indentText?i(h,S,T):"")+f(A[I],h));break;case h.cdataKey:$.push((h.indentCdata?i(h,S,T):"")+l(A[I],h));break;case h.doctypeKey:$.push(i(h,S,T)+d(A[I],h));break;case h.commentKey:$.push(i(h,S,T)+u(A[I],h));break;default:$.push(i(h,S,T)+b(A[I],_,h,S,E(A[I],h)))}T=T&&!$.length}return $.join("")}return $u=function(v,h){h=o(h);var S=[];return n=v,r="_root_",h.compact?S.push(g(v,h,0,!0)):(v[h.declarationKey]&&S.push(a(v[h.declarationKey],h,0)),v[h.elementsKey]&&v[h.elementsKey].length&&S.push(y(v[h.elementsKey],h,0,!S.length))),S.join("")},$u}var Du,Km;function AR(){if(Km)return Du;Km=1;var e=Gm();return Du=function(t,n){t instanceof vr&&(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)},Du}var Lu,Qm;function RR(){if(Qm)return Lu;Qm=1;var e=zm(),t=TR(),n=Gm(),r=AR();return Lu={xml2js:e,xml2json:t,js2xml:n,json2xml:r},Lu}RR();/*! For license information please see index.js.LICENSE.txt */var _R={2:e=>{function t(o,i,s){o instanceof RegExp&&(o=n(o,s)),i instanceof RegExp&&(i=n(i,s));var a=r(o,i,s);return a&&{start:a[0],end:a[1],pre:s.slice(0,a[0]),body:s.slice(a[0]+o.length,a[1]),post:s.slice(a[1]+i.length)}}function n(o,i){var s=i.match(o);return s?s[0]:null}function r(o,i,s){var a,c,u,l,d,f=s.indexOf(o),m=s.indexOf(i,f+1),w=f;if(f>=0&&m>0){for(a=[],u=s.length;w>=0&&!d;)w==f?(a.push(w),f=s.indexOf(o,w+1)):a.length==1?d=[a.pop(),m]:((c=a.pop())<u&&(u=c,l=m),m=s.indexOf(i,w+1)),w=f<m&&f>=0?f:m;a.length&&(d=[u,l])}return d}e.exports=t,t.range=r},101:function(e,t,n){var r;e=n.nmd(e),function(o){var i=(e&&e.exports,typeof Dr=="object"&&Dr);i.global!==i&&i.window;var s=function(d){this.message=d};(s.prototype=new Error).name="InvalidCharacterError";var a=function(d){throw new s(d)},c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,l={encode:function(d){d=String(d),/[^\0-\xFF]/.test(d)&&a("The string to be encoded contains characters outside of the Latin1 range.");for(var f,m,w,y,E=d.length%3,b="",g=-1,v=d.length-E;++g<v;)f=d.charCodeAt(g)<<16,m=d.charCodeAt(++g)<<8,w=d.charCodeAt(++g),b+=c.charAt((y=f+m+w)>>18&63)+c.charAt(y>>12&63)+c.charAt(y>>6&63)+c.charAt(63&y);return E==2?(f=d.charCodeAt(g)<<8,m=d.charCodeAt(++g),b+=c.charAt((y=f+m)>>10)+c.charAt(y>>4&63)+c.charAt(y<<2&63)+"="):E==1&&(y=d.charCodeAt(g),b+=c.charAt(y>>2)+c.charAt(y<<4&63)+"=="),b},decode:function(d){var f=(d=String(d).replace(u,"")).length;f%4==0&&(f=(d=d.replace(/==?$/,"")).length),(f%4==1||/[^+a-zA-Z0-9/]/.test(d))&&a("Invalid character: the string to be decoded is not correctly encoded.");for(var m,w,y=0,E="",b=-1;++b<f;)w=c.indexOf(d.charAt(b)),m=y%4?64*m+w:w,y++%4&&(E+=String.fromCharCode(255&m>>(-2*y&6)));return E},version:"1.0.0"};(r=(function(){return l}).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,o=n.length;o--;){var i=n.charCodeAt(o);56320<=i&&i<=57343&&o--,127<i&&i<=2047?r++:2047<i&&i<=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=[],o=0;o<n.length;o++)r.push(255&n.charCodeAt(o));return r},bytesToString:function(n){for(var r=[],o=0;o<n.length;o++)r.push(String.fromCharCode(n[o]));return r.join("")}}};e.exports=t},298:e=>{var t,n;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(r,o){return r<<o|r>>>32-o},rotr:function(r,o){return r<<32-o|r>>>o},endian:function(r){if(r.constructor==Number)return 16711935&n.rotl(r,8)|4278255360&n.rotl(r,24);for(var o=0;o<r.length;o++)r[o]=n.endian(r[o]);return r},randomBytes:function(r){for(var o=[];r>0;r--)o.push(Math.floor(256*Math.random()));return o},bytesToWords:function(r){for(var o=[],i=0,s=0;i<r.length;i++,s+=8)o[s>>>5]|=r[i]<<24-s%32;return o},wordsToBytes:function(r){for(var o=[],i=0;i<32*r.length;i+=8)o.push(r[i>>>5]>>>24-i%32&255);return o},bytesToHex:function(r){for(var o=[],i=0;i<r.length;i++)o.push((r[i]>>>4).toString(16)),o.push((15&r[i]).toString(16));return o.join("")},hexToBytes:function(r){for(var o=[],i=0;i<r.length;i+=2)o.push(parseInt(r.substr(i,2),16));return o},bytesToBase64:function(r){for(var o=[],i=0;i<r.length;i+=3)for(var s=r[i]<<16|r[i+1]<<8|r[i+2],a=0;a<4;a++)8*i+6*a<=8*r.length?o.push(t.charAt(s>>>6*(3-a)&63)):o.push("=");return o.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/gi,"");for(var o=[],i=0,s=0;i<r.length;s=++i%4)s!=0&&o.push((t.indexOf(r.charAt(i-1))&Math.pow(2,-2*s+8)-1)<<2*s|t.indexOf(r.charAt(i))>>>6-2*s);return o}},e.exports=n},635:(e,t,n)=>{const r=n(31),o=n(338),i=n(221);e.exports={XMLParser:o,XMLValidator:r,XMLBuilder:i}},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]*",o=new RegExp("^"+r+"$");t.isExist=function(i){return i!==void 0},t.isEmptyObject=function(i){return Object.keys(i).length===0},t.merge=function(i,s,a){if(s){const c=Object.keys(s),u=c.length;for(let l=0;l<u;l++)i[c[l]]=a==="strict"?[s[c[l]]]:s[c[l]]}},t.getValue=function(i){return t.isExist(i)?i:""},t.isName=function(i){return o.exec(i)!=null},t.getAllMatches=function(i,s){const a=[];let c=s.exec(i);for(;c;){const u=[];u.startIndex=s.lastIndex-c[0].length;const l=c.length;for(let d=0;d<l;d++)u.push(c[d]);a.push(u),c=s.exec(i)}return a},t.nameRegexp=r},31:(e,t,n)=>{const r=n(705),o={allowBooleanAttributes:!1,unpairedTags:[]};function i(g){return g===" "||g===" "||g===`
36
- `||g==="\r"}function s(g,v){const h=v;for(;v<g.length;v++)if(!(g[v]!="?"&&g[v]!=" ")){const S=g.substr(h,v-h);if(v>5&&S==="xml")return w("InvalidXml","XML declaration allowed only at the start of the document.",E(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({},o,v);const h=[];let S=!1,T=!1;g[0]==="\uFEFF"&&(g=g.substr(1));for(let _=0;_<g.length;_++)if(g[_]==="<"&&g[_+1]==="?"){if(_+=2,_=s(g,_),_.err)return _}else{if(g[_]!=="<"){if(i(g[_]))continue;return w("InvalidChar","char '"+g[_]+"' is not expected.",E(g,_))}{let A=_;if(_++,g[_]==="!"){_=a(g,_);continue}{let $=!1;g[_]==="/"&&($=!0,_++);let D="";for(;_<g.length&&g[_]!==">"&&g[_]!==" "&&g[_]!==" "&&g[_]!==`
37
- `&&g[_]!=="\r";_++)D+=g[_];if(D=D.trim(),D[D.length-1]==="/"&&(D=D.substring(0,D.length-1),_--),I=D,!r.isName(I)){let V;return V=D.trim().length===0?"Invalid space after '<'.":"Tag '"+D+"' is an invalid name.",w("InvalidTag",V,E(g,_))}const N=l(g,_);if(N===!1)return w("InvalidAttr","Attributes for '"+D+"' have open quote.",E(g,_));let x=N.value;if(_=N.index,x[x.length-1]==="/"){const V=_-x.length;x=x.substring(0,x.length-1);const G=f(x,v);if(G!==!0)return w(G.err.code,G.err.msg,E(g,V+G.err.line));S=!0}else if($){if(!N.tagClosed)return w("InvalidTag","Closing tag '"+D+"' doesn't have proper closing.",E(g,_));if(x.trim().length>0)return w("InvalidTag","Closing tag '"+D+"' can't have attributes or invalid starting.",E(g,A));if(h.length===0)return w("InvalidTag","Closing tag '"+D+"' has not been opened.",E(g,A));{const V=h.pop();if(D!==V.tagName){let G=E(g,V.tagStartPos);return w("InvalidTag","Expected closing tag '"+V.tagName+"' (opened in line "+G.line+", col "+G.col+") instead of closing tag '"+D+"'.",E(g,A))}h.length==0&&(T=!0)}}else{const V=f(x,v);if(V!==!0)return w(V.err.code,V.err.msg,E(g,_-x.length+V.err.line));if(T===!0)return w("InvalidXml","Multiple possible root nodes found.",E(g,_));v.unpairedTags.indexOf(D)!==-1||h.push({tagName:D,tagStartPos:A}),S=!0}for(_++;_<g.length;_++)if(g[_]==="<"){if(g[_+1]==="!"){_++,_=a(g,_);continue}if(g[_+1]!=="?")break;if(_=s(g,++_),_.err)return _}else if(g[_]==="&"){const V=m(g,_);if(V==-1)return w("InvalidChar","char '&' is not expected.",E(g,_));_=V}else if(T===!0&&!i(g[_]))return w("InvalidXml","Extra text at the end",E(g,_));g[_]==="<"&&_--}}}var I;return S?h.length==1?w("InvalidTag","Unclosed tag '"+h[0].tagName+"'.",E(g,h[0].tagStartPos)):!(h.length>0)||w("InvalidXml","Invalid '"+JSON.stringify(h.map(_=>_.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):w("InvalidXml","Start tag expected.",1)};const c='"',u="'";function l(g,v){let h="",S="",T=!1;for(;v<g.length;v++){if(g[v]===c||g[v]===u)S===""?S=g[v]:S!==g[v]||(S="");else if(g[v]===">"&&S===""){T=!0;break}h+=g[v]}return S===""&&{value:h,index:v,tagClosed:T}}const d=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function f(g,v){const h=r.getAllMatches(g,d),S={};for(let T=0;T<h.length;T++){if(h[T][1].length===0)return w("InvalidAttr","Attribute '"+h[T][2]+"' has no space in starting.",b(h[T]));if(h[T][3]!==void 0&&h[T][4]===void 0)return w("InvalidAttr","Attribute '"+h[T][2]+"' is without value.",b(h[T]));if(h[T][3]===void 0&&!v.allowBooleanAttributes)return w("InvalidAttr","boolean attribute '"+h[T][2]+"' is not allowed.",b(h[T]));const I=h[T][2];if(!y(I))return w("InvalidAttr","Attribute '"+I+"' is an invalid name.",b(h[T]));if(S.hasOwnProperty(I))return w("InvalidAttr","Attribute '"+I+"' is repeated.",b(h[T]));S[I]=1}return!0}function m(g,v){if(g[++v]===";")return-1;if(g[v]==="#")return function(S,T){let I=/\d/;for(S[T]==="x"&&(T++,I=/[\da-fA-F]/);T<S.length;T++){if(S[T]===";")return T;if(!S[T].match(I))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 w(g,v,h){return{err:{code:g,msg:v,line:h.line||h,col:h.col}}}function y(g){return r.isName(g)}function E(g,v){const h=g.substring(0,v).split(/\r?\n/);return{line:h.length,col:h[h.length-1].length+1}}function b(g){return g.startIndex+g[1].length}},221:(e,t,n)=>{const r=n(87),o=n(118),i={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(l,d){return d},attributeValueProcessor:function(l,d){return d},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(l){this.options=Object.assign({},i,l),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=o(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=u),this.processTextOrObjNode=a,this.options.format?(this.indentate=c,this.tagEndChar=`>
21
+ `).map(function($){return" "+$}).join(`
22
+ `))):K=X.stylize("[Circular]","special")),R(O)){if(N&&Z.match(/^\d+$/))return K;O=JSON.stringify(""+Z),O.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(O=O.slice(1,-1),O=X.stylize(O,"name")):(O=O.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),O=X.stylize(O,"string"))}return O+": "+K}function v(X,oe,ae){var Ce=X.reduce(function(Z,N){return N.indexOf(`
23
+ `)>=0,Z+N.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Ce>60?ae[0]+(oe===""?"":oe+`
24
+ `)+" "+X.join(`,
25
+ `)+" "+ae[1]:ae[0]+oe+" "+X.join(", ")+" "+ae[1]}e.types=NC();function E(X){return Array.isArray(X)}e.isArray=E;function b(X){return typeof X=="boolean"}e.isBoolean=b;function g(X){return X===null}e.isNull=g;function y(X){return X==null}e.isNullOrUndefined=y;function p(X){return typeof X=="number"}e.isNumber=p;function S(X){return typeof X=="string"}e.isString=S;function T(X){return typeof X=="symbol"}e.isSymbol=T;function R(X){return X===void 0}e.isUndefined=R;function I(X){return A(X)&&z(X)==="[object RegExp]"}e.isRegExp=I,e.types.isRegExp=I;function A(X){return typeof X=="object"&&X!==null}e.isObject=A;function D(X){return A(X)&&z(X)==="[object Date]"}e.isDate=D,e.types.isDate=D;function H(X){return A(X)&&(z(X)==="[object Error]"||X instanceof Error)}e.isError=H,e.types.isNativeError=H;function _(X){return typeof X=="function"}e.isFunction=_;function x(X){return X===null||typeof X=="boolean"||typeof X=="number"||typeof X=="string"||typeof X=="symbol"||typeof X>"u"}e.isPrimitive=x,e.isBuffer=DC();function z(X){return Object.prototype.toString.call(X)}function G(X){return X<10?"0"+X.toString(10):X.toString(10)}var ne=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ie(){var X=new Date,oe=[G(X.getHours()),G(X.getMinutes()),G(X.getSeconds())].join(":");return[X.getDate(),ne[X.getMonth()],oe].join(" ")}e.log=function(){console.log("%s - %s",ie(),e.format.apply(e,arguments))},e.inherits=Yn(),e._extend=function(X,oe){if(!oe||!A(oe))return X;for(var ae=Object.keys(oe),Ce=ae.length;Ce--;)X[ae[Ce]]=oe[ae[Ce]];return X};function ee(X,oe){return Object.prototype.hasOwnProperty.call(X,oe)}var ue=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(oe){if(typeof oe!="function")throw new TypeError('The "original" argument must be of type Function');if(ue&&oe[ue]){var ae=oe[ue];if(typeof ae!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ae,ue,{value:ae,enumerable:!1,writable:!1,configurable:!0}),ae}function ae(){for(var Ce,Z,N=new Promise(function(V,$){Ce=V,Z=$}),O=[],K=0;K<arguments.length;K++)O.push(arguments[K]);O.push(function(V,$){V?Z(V):Ce($)});try{oe.apply(this,O)}catch(V){Z(V)}return N}return Object.setPrototypeOf(ae,Object.getPrototypeOf(oe)),ue&&Object.defineProperty(ae,ue,{value:ae,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(ae,t(oe))},e.promisify.custom=ue;function de(X,oe){if(!X){var ae=new Error("Promise was rejected with a falsy value");ae.reason=X,X=ae}return oe(X)}function ce(X){if(typeof X!="function")throw new TypeError('The "original" argument must be of type Function');function oe(){for(var ae=[],Ce=0;Ce<arguments.length;Ce++)ae.push(arguments[Ce]);var Z=ae.pop();if(typeof Z!="function")throw new TypeError("The last argument must be of type Function");var N=this,O=function(){return Z.apply(N,arguments)};X.apply(this,ae).then(function(K){ve.nextTick(O.bind(null,null,K))},function(K){ve.nextTick(de.bind(null,K,O))})}return Object.setPrototypeOf(oe,Object.getPrototypeOf(X)),Object.defineProperties(oe,t(X)),oe}e.callbackify=ce})(Tc)),Tc}var Iu,ey;function $C(){if(ey)return Iu;ey=1;function e(w,v){var E=Object.keys(w);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(w);v&&(b=b.filter(function(g){return Object.getOwnPropertyDescriptor(w,g).enumerable})),E.push.apply(E,b)}return E}function t(w){for(var v=1;v<arguments.length;v++){var E=arguments[v]!=null?arguments[v]:{};v%2?e(Object(E),!0).forEach(function(b){r(w,b,E[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(E)):e(Object(E)).forEach(function(b){Object.defineProperty(w,b,Object.getOwnPropertyDescriptor(E,b))})}return w}function r(w,v,E){return v=s(v),v in w?Object.defineProperty(w,v,{value:E,enumerable:!0,configurable:!0,writable:!0}):w[v]=E,w}function n(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function i(w,v){for(var E=0;E<v.length;E++){var b=v[E];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(w,s(b.key),b)}}function o(w,v,E){return v&&i(w.prototype,v),Object.defineProperty(w,"prototype",{writable:!1}),w}function s(w){var v=a(w,"string");return typeof v=="symbol"?v:String(v)}function a(w,v){if(typeof w!="object"||w===null)return w;var E=w[Symbol.toPrimitive];if(E!==void 0){var b=E.call(w,v);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(w)}var l=Vs(),u=l.Buffer,c=Zg(),d=c.inspect,f=d&&d.custom||"inspect";function m(w,v,E){u.prototype.copy.call(w,v,E)}return Iu=(function(){function w(){n(this,w),this.head=null,this.tail=null,this.length=0}return o(w,[{key:"push",value:function(E){var b={data:E,next:null};this.length>0?this.tail.next=b:this.head=b,this.tail=b,++this.length}},{key:"unshift",value:function(E){var b={data:E,next:this.head};this.length===0&&(this.tail=b),this.head=b,++this.length}},{key:"shift",value:function(){if(this.length!==0){var E=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,E}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(E){if(this.length===0)return"";for(var b=this.head,g=""+b.data;b=b.next;)g+=E+b.data;return g}},{key:"concat",value:function(E){if(this.length===0)return u.alloc(0);for(var b=u.allocUnsafe(E>>>0),g=this.head,y=0;g;)m(g.data,b,y),y+=g.data.length,g=g.next;return b}},{key:"consume",value:function(E,b){var g;return E<this.head.data.length?(g=this.head.data.slice(0,E),this.head.data=this.head.data.slice(E)):E===this.head.data.length?g=this.shift():g=b?this._getString(E):this._getBuffer(E),g}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(E){var b=this.head,g=1,y=b.data;for(E-=y.length;b=b.next;){var p=b.data,S=E>p.length?p.length:E;if(S===p.length?y+=p:y+=p.slice(0,E),E-=S,E===0){S===p.length?(++g,b.next?this.head=b.next:this.head=this.tail=null):(this.head=b,b.data=p.slice(S));break}++g}return this.length-=g,y}},{key:"_getBuffer",value:function(E){var b=u.allocUnsafe(E),g=this.head,y=1;for(g.data.copy(b),E-=g.data.length;g=g.next;){var p=g.data,S=E>p.length?p.length:E;if(p.copy(b,b.length-E,0,S),E-=S,E===0){S===p.length?(++y,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=p.slice(S));break}++y}return this.length-=y,b}},{key:f,value:function(E,b){return d(this,t(t({},b),{},{depth:0,customInspect:!1}))}}]),w})(),Iu}var _u,ty;function ry(){if(ty)return _u;ty=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,ve.nextTick(i,this,s)):ve.nextTick(i,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(d){!a&&d?l._writableState?l._writableState.errorEmitted?ve.nextTick(r,l):(l._writableState.errorEmitted=!0,ve.nextTick(t,l,d)):ve.nextTick(t,l,d):a?(ve.nextTick(r,l),a(d)):ve.nextTick(r,l)}),this)}function t(s,a){i(s,a),r(s)}function r(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function n(){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 _u={destroy:e,undestroy:n,errorOrDestroy:o},_u}var Ou={},ny;function Oi(){if(ny)return Ou;ny=1;function e(a,l){a.prototype=Object.create(l.prototype),a.prototype.constructor=a,a.__proto__=l}var t={};function r(a,l,u){u||(u=Error);function c(f,m,w){return typeof l=="string"?l:l(f,m,w)}var d=(function(f){e(m,f);function m(w,v,E){return f.call(this,c(w,v,E))||this}return m})(u);d.prototype.name=u.name,d.prototype.code=a,t[a]=d}function n(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 r("ERR_INVALID_OPT_VALUE",function(a,l){return'The value "'+l+'" is invalid for option "'+a+'"'},TypeError),r("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 d;if(o(a," argument"))d="The ".concat(a," ").concat(c," ").concat(n(l,"type"));else{var f=s(a,".")?"property":"argument";d='The "'.concat(a,'" ').concat(f," ").concat(c," ").concat(n(l,"type"))}return d+=". Received type ".concat(typeof u),d},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(a){return"The "+a+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(a){return"Cannot call "+a+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(a){return"Unknown encoding: "+a},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Ou.codes=t,Ou}var Pu,iy;function oy(){if(iy)return Pu;iy=1;var e=Oi().codes.ERR_INVALID_OPT_VALUE;function t(n,i,o){return n.highWaterMark!=null?n.highWaterMark:i?n[o]:null}function r(n,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 n.objectMode?16:16*1024}return Pu={getHighWaterMark:r},Pu}var ku,sy;function LC(){if(sy)return ku;sy=1,ku=e;function e(r,n){if(t("noDeprecation"))return r;var i=!1;function o(){if(!i){if(t("throwDeprecation"))throw new Error(n);t("traceDeprecation")?console.trace(n):console.warn(n),i=!0}return r.apply(this,arguments)}return o}function t(r){try{if(!xn.localStorage)return!1}catch{return!1}var n=xn.localStorage[r];return n==null?!1:String(n).toLowerCase()==="true"}return ku}var Fu,ay;function ly(){if(ay)return Fu;ay=1,Fu=I;function e(Z){var N=this;this.next=null,this.entry=null,this.finish=function(){Ce(N,Z)}}var t;I.WritableState=T;var r={deprecate:LC()},n=qm(),i=Vs().Buffer,o=(typeof xn<"u"?xn:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(Z){return i.from(Z)}function a(Z){return i.isBuffer(Z)||Z instanceof o}var l=ry(),u=oy(),c=u.getHighWaterMark,d=Oi().codes,f=d.ERR_INVALID_ARG_TYPE,m=d.ERR_METHOD_NOT_IMPLEMENTED,w=d.ERR_MULTIPLE_CALLBACK,v=d.ERR_STREAM_CANNOT_PIPE,E=d.ERR_STREAM_DESTROYED,b=d.ERR_STREAM_NULL_VALUES,g=d.ERR_STREAM_WRITE_AFTER_END,y=d.ERR_UNKNOWN_ENCODING,p=l.errorOrDestroy;Yn()(I,n);function S(){}function T(Z,N,O){t=t||Pi(),Z=Z||{},typeof O!="boolean"&&(O=N instanceof t),this.objectMode=!!Z.objectMode,O&&(this.objectMode=this.objectMode||!!Z.writableObjectMode),this.highWaterMark=c(this,Z,"writableHighWaterMark",O),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var K=Z.decodeStrings===!1;this.decodeStrings=!K,this.defaultEncoding=Z.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(V){ne(N,V)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Z.emitClose!==!1,this.autoDestroy=!!Z.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}T.prototype.getBuffer=function(){for(var N=this.bufferedRequest,O=[];N;)O.push(N),N=N.next;return O},(function(){try{Object.defineProperty(T.prototype,"buffer",{get:r.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(I,Symbol.hasInstance,{value:function(N){return R.call(this,N)?!0:this!==I?!1:N&&N._writableState instanceof T}})):R=function(N){return N instanceof this};function I(Z){t=t||Pi();var N=this instanceof t;if(!N&&!R.call(I,this))return new I(Z);this._writableState=new T(Z,this,N),this.writable=!0,Z&&(typeof Z.write=="function"&&(this._write=Z.write),typeof Z.writev=="function"&&(this._writev=Z.writev),typeof Z.destroy=="function"&&(this._destroy=Z.destroy),typeof Z.final=="function"&&(this._final=Z.final)),n.call(this)}I.prototype.pipe=function(){p(this,new v)};function A(Z,N){var O=new g;p(Z,O),ve.nextTick(N,O)}function D(Z,N,O,K){var V;return O===null?V=new b:typeof O!="string"&&!N.objectMode&&(V=new f("chunk",["string","Buffer"],O)),V?(p(Z,V),ve.nextTick(K,V),!1):!0}I.prototype.write=function(Z,N,O){var K=this._writableState,V=!1,$=!K.objectMode&&a(Z);return $&&!i.isBuffer(Z)&&(Z=s(Z)),typeof N=="function"&&(O=N,N=null),$?N="buffer":N||(N=K.defaultEncoding),typeof O!="function"&&(O=S),K.ending?A(this,O):($||D(this,K,Z,O))&&(K.pendingcb++,V=_(this,K,$,Z,N,O)),V},I.prototype.cork=function(){this._writableState.corked++},I.prototype.uncork=function(){var Z=this._writableState;Z.corked&&(Z.corked--,!Z.writing&&!Z.corked&&!Z.bufferProcessing&&Z.bufferedRequest&&ue(this,Z))},I.prototype.setDefaultEncoding=function(N){if(typeof N=="string"&&(N=N.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((N+"").toLowerCase())>-1))throw new y(N);return this._writableState.defaultEncoding=N,this},Object.defineProperty(I.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function H(Z,N,O){return!Z.objectMode&&Z.decodeStrings!==!1&&typeof N=="string"&&(N=i.from(N,O)),N}Object.defineProperty(I.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function _(Z,N,O,K,V,$){if(!O){var U=H(N,K,V);K!==U&&(O=!0,V="buffer",K=U)}var pe=N.objectMode?1:K.length;N.length+=pe;var Re=N.length<N.highWaterMark;if(Re||(N.needDrain=!0),N.writing||N.corked){var De=N.lastBufferedRequest;N.lastBufferedRequest={chunk:K,encoding:V,isBuf:O,callback:$,next:null},De?De.next=N.lastBufferedRequest:N.bufferedRequest=N.lastBufferedRequest,N.bufferedRequestCount+=1}else x(Z,N,!1,pe,K,V,$);return Re}function x(Z,N,O,K,V,$,U){N.writelen=K,N.writecb=U,N.writing=!0,N.sync=!0,N.destroyed?N.onwrite(new E("write")):O?Z._writev(V,N.onwrite):Z._write(V,$,N.onwrite),N.sync=!1}function z(Z,N,O,K,V){--N.pendingcb,O?(ve.nextTick(V,K),ve.nextTick(oe,Z,N),Z._writableState.errorEmitted=!0,p(Z,K)):(V(K),Z._writableState.errorEmitted=!0,p(Z,K),oe(Z,N))}function G(Z){Z.writing=!1,Z.writecb=null,Z.length-=Z.writelen,Z.writelen=0}function ne(Z,N){var O=Z._writableState,K=O.sync,V=O.writecb;if(typeof V!="function")throw new w;if(G(O),N)z(Z,O,K,N,V);else{var $=de(O)||Z.destroyed;!$&&!O.corked&&!O.bufferProcessing&&O.bufferedRequest&&ue(Z,O),K?ve.nextTick(ie,Z,O,$,V):ie(Z,O,$,V)}}function ie(Z,N,O,K){O||ee(Z,N),N.pendingcb--,K(),oe(Z,N)}function ee(Z,N){N.length===0&&N.needDrain&&(N.needDrain=!1,Z.emit("drain"))}function ue(Z,N){N.bufferProcessing=!0;var O=N.bufferedRequest;if(Z._writev&&O&&O.next){var K=N.bufferedRequestCount,V=new Array(K),$=N.corkedRequestsFree;$.entry=O;for(var U=0,pe=!0;O;)V[U]=O,O.isBuf||(pe=!1),O=O.next,U+=1;V.allBuffers=pe,x(Z,N,!0,N.length,V,"",$.finish),N.pendingcb++,N.lastBufferedRequest=null,$.next?(N.corkedRequestsFree=$.next,$.next=null):N.corkedRequestsFree=new e(N),N.bufferedRequestCount=0}else{for(;O;){var Re=O.chunk,De=O.encoding,ke=O.callback,Oe=N.objectMode?1:Re.length;if(x(Z,N,!1,Oe,Re,De,ke),O=O.next,N.bufferedRequestCount--,N.writing)break}O===null&&(N.lastBufferedRequest=null)}N.bufferedRequest=O,N.bufferProcessing=!1}I.prototype._write=function(Z,N,O){O(new m("_write()"))},I.prototype._writev=null,I.prototype.end=function(Z,N,O){var K=this._writableState;return typeof Z=="function"?(O=Z,Z=null,N=null):typeof N=="function"&&(O=N,N=null),Z!=null&&this.write(Z,N),K.corked&&(K.corked=1,this.uncork()),K.ending||ae(this,K,O),this},Object.defineProperty(I.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function de(Z){return Z.ending&&Z.length===0&&Z.bufferedRequest===null&&!Z.finished&&!Z.writing}function ce(Z,N){Z._final(function(O){N.pendingcb--,O&&p(Z,O),N.prefinished=!0,Z.emit("prefinish"),oe(Z,N)})}function X(Z,N){!N.prefinished&&!N.finalCalled&&(typeof Z._final=="function"&&!N.destroyed?(N.pendingcb++,N.finalCalled=!0,ve.nextTick(ce,Z,N)):(N.prefinished=!0,Z.emit("prefinish")))}function oe(Z,N){var O=de(N);if(O&&(X(Z,N),N.pendingcb===0&&(N.finished=!0,Z.emit("finish"),N.autoDestroy))){var K=Z._readableState;(!K||K.autoDestroy&&K.endEmitted)&&Z.destroy()}return O}function ae(Z,N,O){N.ending=!0,oe(Z,N),O&&(N.finished?ve.nextTick(O):Z.once("finish",O)),N.ended=!0,Z.writable=!1}function Ce(Z,N,O){var K=Z.entry;for(Z.entry=null;K;){var V=K.callback;N.pendingcb--,V(O),K=K.next}N.corkedRequestsFree.next=Z}return Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(N){this._writableState&&(this._writableState.destroyed=N)}}),I.prototype.destroy=l.destroy,I.prototype._undestroy=l.undestroy,I.prototype._destroy=function(Z,N){N(Z)},Fu}var xu,cy;function Pi(){if(cy)return xu;cy=1;var e=Object.keys||function(u){var c=[];for(var d in u)c.push(d);return c};xu=s;var t=gy(),r=ly();Yn()(s,t);for(var n=e(r.prototype),i=0;i<n.length;i++){var o=n[i];s.prototype[o]||(s.prototype[o]=r.prototype[o])}function s(u){if(!(this instanceof s))return new s(u);t.call(this,u),r.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||ve.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)}}),xu}var Nu={},Hs={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var uy;function MC(){return uy||(uy=1,(function(e,t){var r=Vs(),n=r.Buffer;function i(s,a){for(var l in s)a[l]=s[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=o);function o(s,a,l){return n(s,a,l)}o.prototype=Object.create(n.prototype),i(n,o),o.from=function(s,a,l){if(typeof s=="number")throw new TypeError("Argument must not be a number");return n(s,a,l)},o.alloc=function(s,a,l){if(typeof s!="number")throw new TypeError("Argument must be a number");var u=n(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 n(s)},o.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(s)}})(Hs,Hs.exports)),Hs.exports}var fy;function Du(){if(fy)return Nu;fy=1;var e=MC().Buffer,t=e.isEncoding||function(b){switch(b=""+b,b&&b.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 r(b){if(!b)return"utf8";for(var g;;)switch(b){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 b;default:if(g)return;b=(""+b).toLowerCase(),g=!0}}function n(b){var g=r(b);if(typeof g!="string"&&(e.isEncoding===t||!t(b)))throw new Error("Unknown encoding: "+b);return g||b}Nu.StringDecoder=i;function i(b){this.encoding=n(b);var g;switch(this.encoding){case"utf16le":this.text=d,this.end=f,g=4;break;case"utf8":this.fillLast=l,g=4;break;case"base64":this.text=m,this.end=w,g=3;break;default:this.write=v,this.end=E;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(g)}i.prototype.write=function(b){if(b.length===0)return"";var g,y;if(this.lastNeed){if(g=this.fillLast(b),g===void 0)return"";y=this.lastNeed,this.lastNeed=0}else y=0;return y<b.length?g?g+this.text(b,y):this.text(b,y):g||""},i.prototype.end=c,i.prototype.text=u,i.prototype.fillLast=function(b){if(this.lastNeed<=b.length)return b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,b.length),this.lastNeed-=b.length};function o(b){return b<=127?0:b>>5===6?2:b>>4===14?3:b>>3===30?4:b>>6===2?-1:-2}function s(b,g,y){var p=g.length-1;if(p<y)return 0;var S=o(g[p]);return S>=0?(S>0&&(b.lastNeed=S-1),S):--p<y||S===-2?0:(S=o(g[p]),S>=0?(S>0&&(b.lastNeed=S-2),S):--p<y||S===-2?0:(S=o(g[p]),S>=0?(S>0&&(S===2?S=0:b.lastNeed=S-3),S):0))}function a(b,g,y){if((g[0]&192)!==128)return b.lastNeed=0,"�";if(b.lastNeed>1&&g.length>1){if((g[1]&192)!==128)return b.lastNeed=1,"�";if(b.lastNeed>2&&g.length>2&&(g[2]&192)!==128)return b.lastNeed=2,"�"}}function l(b){var g=this.lastTotal-this.lastNeed,y=a(this,b);if(y!==void 0)return y;if(this.lastNeed<=b.length)return b.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,g,0,b.length),this.lastNeed-=b.length}function u(b,g){var y=s(this,b,g);if(!this.lastNeed)return b.toString("utf8",g);this.lastTotal=y;var p=b.length-(y-this.lastNeed);return b.copy(this.lastChar,0,p),b.toString("utf8",g,p)}function c(b){var g=b&&b.length?this.write(b):"";return this.lastNeed?g+"�":g}function d(b,g){if((b.length-g)%2===0){var y=b.toString("utf16le",g);if(y){var p=y.charCodeAt(y.length-1);if(p>=55296&&p<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1],y.slice(0,-1)}return y}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=b[b.length-1],b.toString("utf16le",g,b.length-1)}function f(b){var g=b&&b.length?this.write(b):"";if(this.lastNeed){var y=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,y)}return g}function m(b,g){var y=(b.length-g)%3;return y===0?b.toString("base64",g):(this.lastNeed=3-y,this.lastTotal=3,y===1?this.lastChar[0]=b[b.length-1]:(this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1]),b.toString("base64",g,b.length-y))}function w(b){var g=b&&b.length?this.write(b):"";return this.lastNeed?g+this.lastChar.toString("base64",0,3-this.lastNeed):g}function v(b){return b.toString(this.encoding)}function E(b){return b&&b.length?this.write(b):""}return Nu}var $u,dy;function Lu(){if(dy)return $u;dy=1;var e=Oi().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 r(){}function n(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||r);var l=s.readable||s.readable!==!1&&o.readable,u=s.writable||s.writable!==!1&&o.writable,c=function(){o.writable||f()},d=o._writableState&&o._writableState.finished,f=function(){u=!1,d=!0,l||a.call(o)},m=o._readableState&&o._readableState.endEmitted,w=function(){l=!1,m=!0,u||a.call(o)},v=function(y){a.call(o,y)},E=function(){var y;if(l&&!m)return(!o._readableState||!o._readableState.ended)&&(y=new e),a.call(o,y);if(u&&!d)return(!o._writableState||!o._writableState.ended)&&(y=new e),a.call(o,y)},b=function(){o.req.on("finish",f)};return n(o)?(o.on("complete",f),o.on("abort",E),o.req?b():o.on("request",b)):u&&!o._writableState&&(o.on("end",c),o.on("close",c)),o.on("end",w),o.on("finish",f),s.error!==!1&&o.on("error",v),o.on("close",E),function(){o.removeListener("complete",f),o.removeListener("abort",E),o.removeListener("request",b),o.req&&o.req.removeListener("finish",f),o.removeListener("end",c),o.removeListener("close",c),o.removeListener("finish",f),o.removeListener("end",w),o.removeListener("error",v),o.removeListener("close",E)}}return $u=i,$u}var Mu,py;function BC(){if(py)return Mu;py=1;var e;function t(y,p,S){return p=r(p),p in y?Object.defineProperty(y,p,{value:S,enumerable:!0,configurable:!0,writable:!0}):y[p]=S,y}function r(y){var p=n(y,"string");return typeof p=="symbol"?p:String(p)}function n(y,p){if(typeof y!="object"||y===null)return y;var S=y[Symbol.toPrimitive];if(S!==void 0){var T=S.call(y,p);if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(y)}var i=Lu(),o=Symbol("lastResolve"),s=Symbol("lastReject"),a=Symbol("error"),l=Symbol("ended"),u=Symbol("lastPromise"),c=Symbol("handlePromise"),d=Symbol("stream");function f(y,p){return{value:y,done:p}}function m(y){var p=y[o];if(p!==null){var S=y[d].read();S!==null&&(y[u]=null,y[o]=null,y[s]=null,p(f(S,!1)))}}function w(y){ve.nextTick(m,y)}function v(y,p){return function(S,T){y.then(function(){if(p[l]){S(f(void 0,!0));return}p[c](S,T)},T)}}var E=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((e={get stream(){return this[d]},next:function(){var p=this,S=this[a];if(S!==null)return Promise.reject(S);if(this[l])return Promise.resolve(f(void 0,!0));if(this[d].destroyed)return new Promise(function(A,D){ve.nextTick(function(){p[a]?D(p[a]):A(f(void 0,!0))})});var T=this[u],R;if(T)R=new Promise(v(T,this));else{var I=this[d].read();if(I!==null)return Promise.resolve(f(I,!1));R=new Promise(this[c])}return this[u]=R,R}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var p=this;return new Promise(function(S,T){p[d].destroy(null,function(R){if(R){T(R);return}S(f(void 0,!0))})})}),e),E),g=function(p){var S,T=Object.create(b,(S={},t(S,d,{value:p,writable:!0}),t(S,o,{value:null,writable:!0}),t(S,s,{value:null,writable:!0}),t(S,a,{value:null,writable:!0}),t(S,l,{value:p._readableState.endEmitted,writable:!0}),t(S,c,{value:function(I,A){var D=T[d].read();D?(T[u]=null,T[o]=null,T[s]=null,I(f(D,!1))):(T[o]=I,T[s]=A)},writable:!0}),S));return T[u]=null,i(p,function(R){if(R&&R.code!=="ERR_STREAM_PREMATURE_CLOSE"){var I=T[s];I!==null&&(T[u]=null,T[o]=null,T[s]=null,I(R)),T[a]=R;return}var A=T[o];A!==null&&(T[u]=null,T[o]=null,T[s]=null,A(f(void 0,!0))),T[l]=!0}),p.on("readable",w.bind(null,T)),T};return Mu=g,Mu}var Bu,hy;function jC(){return hy||(hy=1,Bu=function(){throw new Error("Readable.from is not available in the browser")}),Bu}var ju,my;function gy(){if(my)return ju;my=1,ju=A;var e;A.ReadableState=I,wc().EventEmitter;var t=function(U,pe){return U.listeners(pe).length},r=qm(),n=Vs().Buffer,i=(typeof xn<"u"?xn:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o($){return n.from($)}function s($){return n.isBuffer($)||$ instanceof i}var a=Zg(),l;a&&a.debuglog?l=a.debuglog("stream"):l=function(){};var u=$C(),c=ry(),d=oy(),f=d.getHighWaterMark,m=Oi().codes,w=m.ERR_INVALID_ARG_TYPE,v=m.ERR_STREAM_PUSH_AFTER_EOF,E=m.ERR_METHOD_NOT_IMPLEMENTED,b=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,g,y,p;Yn()(A,r);var S=c.errorOrDestroy,T=["error","close","destroy","pause","resume"];function R($,U,pe){if(typeof $.prependListener=="function")return $.prependListener(U,pe);!$._events||!$._events[U]?$.on(U,pe):Array.isArray($._events[U])?$._events[U].unshift(pe):$._events[U]=[pe,$._events[U]]}function I($,U,pe){e=e||Pi(),$=$||{},typeof pe!="boolean"&&(pe=U instanceof e),this.objectMode=!!$.objectMode,pe&&(this.objectMode=this.objectMode||!!$.readableObjectMode),this.highWaterMark=f(this,$,"readableHighWaterMark",pe),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=$.emitClose!==!1,this.autoDestroy=!!$.autoDestroy,this.destroyed=!1,this.defaultEncoding=$.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,$.encoding&&(g||(g=Du().StringDecoder),this.decoder=new g($.encoding),this.encoding=$.encoding)}function A($){if(e=e||Pi(),!(this instanceof A))return new A($);var U=this instanceof e;this._readableState=new I($,this,U),this.readable=!0,$&&(typeof $.read=="function"&&(this._read=$.read),typeof $.destroy=="function"&&(this._destroy=$.destroy)),r.call(this)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(U){this._readableState&&(this._readableState.destroyed=U)}}),A.prototype.destroy=c.destroy,A.prototype._undestroy=c.undestroy,A.prototype._destroy=function($,U){U($)},A.prototype.push=function($,U){var pe=this._readableState,Re;return pe.objectMode?Re=!0:typeof $=="string"&&(U=U||pe.defaultEncoding,U!==pe.encoding&&($=n.from($,U),U=""),Re=!0),D(this,$,U,!1,Re)},A.prototype.unshift=function($){return D(this,$,null,!0,!1)};function D($,U,pe,Re,De){l("readableAddChunk",U);var ke=$._readableState;if(U===null)ke.reading=!1,ne($,ke);else{var Oe;if(De||(Oe=_(ke,U)),Oe)S($,Oe);else if(ke.objectMode||U&&U.length>0)if(typeof U!="string"&&!ke.objectMode&&Object.getPrototypeOf(U)!==n.prototype&&(U=o(U)),Re)ke.endEmitted?S($,new b):H($,ke,U,!0);else if(ke.ended)S($,new v);else{if(ke.destroyed)return!1;ke.reading=!1,ke.decoder&&!pe?(U=ke.decoder.write(U),ke.objectMode||U.length!==0?H($,ke,U,!1):ue($,ke)):H($,ke,U,!1)}else Re||(ke.reading=!1,ue($,ke))}return!ke.ended&&(ke.length<ke.highWaterMark||ke.length===0)}function H($,U,pe,Re){U.flowing&&U.length===0&&!U.sync?(U.awaitDrain=0,$.emit("data",pe)):(U.length+=U.objectMode?1:pe.length,Re?U.buffer.unshift(pe):U.buffer.push(pe),U.needReadable&&ie($)),ue($,U)}function _($,U){var pe;return!s(U)&&typeof U!="string"&&U!==void 0&&!$.objectMode&&(pe=new w("chunk",["string","Buffer","Uint8Array"],U)),pe}A.prototype.isPaused=function(){return this._readableState.flowing===!1},A.prototype.setEncoding=function($){g||(g=Du().StringDecoder);var U=new g($);this._readableState.decoder=U,this._readableState.encoding=this._readableState.decoder.encoding;for(var pe=this._readableState.buffer.head,Re="";pe!==null;)Re+=U.write(pe.data),pe=pe.next;return this._readableState.buffer.clear(),Re!==""&&this._readableState.buffer.push(Re),this._readableState.length=Re.length,this};var x=1073741824;function z($){return $>=x?$=x:($--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++),$}function G($,U){return $<=0||U.length===0&&U.ended?0:U.objectMode?1:$!==$?U.flowing&&U.length?U.buffer.head.data.length:U.length:($>U.highWaterMark&&(U.highWaterMark=z($)),$<=U.length?$:U.ended?U.length:(U.needReadable=!0,0))}A.prototype.read=function($){l("read",$),$=parseInt($,10);var U=this._readableState,pe=$;if($!==0&&(U.emittedReadable=!1),$===0&&U.needReadable&&((U.highWaterMark!==0?U.length>=U.highWaterMark:U.length>0)||U.ended))return l("read: emitReadable",U.length,U.ended),U.length===0&&U.ended?O(this):ie(this),null;if($=G($,U),$===0&&U.ended)return U.length===0&&O(this),null;var Re=U.needReadable;l("need readable",Re),(U.length===0||U.length-$<U.highWaterMark)&&(Re=!0,l("length less than watermark",Re)),U.ended||U.reading?(Re=!1,l("reading or ended",Re)):Re&&(l("do read"),U.reading=!0,U.sync=!0,U.length===0&&(U.needReadable=!0),this._read(U.highWaterMark),U.sync=!1,U.reading||($=G(pe,U)));var De;return $>0?De=N($,U):De=null,De===null?(U.needReadable=U.length<=U.highWaterMark,$=0):(U.length-=$,U.awaitDrain=0),U.length===0&&(U.ended||(U.needReadable=!0),pe!==$&&U.ended&&O(this)),De!==null&&this.emit("data",De),De};function ne($,U){if(l("onEofChunk"),!U.ended){if(U.decoder){var pe=U.decoder.end();pe&&pe.length&&(U.buffer.push(pe),U.length+=U.objectMode?1:pe.length)}U.ended=!0,U.sync?ie($):(U.needReadable=!1,U.emittedReadable||(U.emittedReadable=!0,ee($)))}}function ie($){var U=$._readableState;l("emitReadable",U.needReadable,U.emittedReadable),U.needReadable=!1,U.emittedReadable||(l("emitReadable",U.flowing),U.emittedReadable=!0,ve.nextTick(ee,$))}function ee($){var U=$._readableState;l("emitReadable_",U.destroyed,U.length,U.ended),!U.destroyed&&(U.length||U.ended)&&($.emit("readable"),U.emittedReadable=!1),U.needReadable=!U.flowing&&!U.ended&&U.length<=U.highWaterMark,Z($)}function ue($,U){U.readingMore||(U.readingMore=!0,ve.nextTick(de,$,U))}function de($,U){for(;!U.reading&&!U.ended&&(U.length<U.highWaterMark||U.flowing&&U.length===0);){var pe=U.length;if(l("maybeReadMore read 0"),$.read(0),pe===U.length)break}U.readingMore=!1}A.prototype._read=function($){S(this,new E("_read()"))},A.prototype.pipe=function($,U){var pe=this,Re=this._readableState;switch(Re.pipesCount){case 0:Re.pipes=$;break;case 1:Re.pipes=[Re.pipes,$];break;default:Re.pipes.push($);break}Re.pipesCount+=1,l("pipe count=%d opts=%j",Re.pipesCount,U);var De=(!U||U.end!==!1)&&$!==ve.stdout&&$!==ve.stderr,ke=De?Be:at;Re.endEmitted?ve.nextTick(ke):pe.once("end",ke),$.on("unpipe",Oe);function Oe(_t,wt){l("onunpipe"),_t===pe&&wt&&wt.hasUnpiped===!1&&(wt.hasUnpiped=!0,Qe())}function Be(){l("onend"),$.end()}var Se=ce(pe);$.on("drain",Se);var Ye=!1;function Qe(){l("cleanup"),$.removeListener("close",We),$.removeListener("finish",Xe),$.removeListener("drain",Se),$.removeListener("error",Pe),$.removeListener("unpipe",Oe),pe.removeListener("end",Be),pe.removeListener("end",at),pe.removeListener("data",he),Ye=!0,Re.awaitDrain&&(!$._writableState||$._writableState.needDrain)&&Se()}pe.on("data",he);function he(_t){l("ondata");var wt=$.write(_t);l("dest.write",wt),wt===!1&&((Re.pipesCount===1&&Re.pipes===$||Re.pipesCount>1&&V(Re.pipes,$)!==-1)&&!Ye&&(l("false write response, pause",Re.awaitDrain),Re.awaitDrain++),pe.pause())}function Pe(_t){l("onerror",_t),at(),$.removeListener("error",Pe),t($,"error")===0&&S($,_t)}R($,"error",Pe);function We(){$.removeListener("finish",Xe),at()}$.once("close",We);function Xe(){l("onfinish"),$.removeListener("close",We),at()}$.once("finish",Xe);function at(){l("unpipe"),pe.unpipe($)}return $.emit("pipe",pe),Re.flowing||(l("pipe resume"),pe.resume()),$};function ce($){return function(){var pe=$._readableState;l("pipeOnDrain",pe.awaitDrain),pe.awaitDrain&&pe.awaitDrain--,pe.awaitDrain===0&&t($,"data")&&(pe.flowing=!0,Z($))}}A.prototype.unpipe=function($){var U=this._readableState,pe={hasUnpiped:!1};if(U.pipesCount===0)return this;if(U.pipesCount===1)return $&&$!==U.pipes?this:($||($=U.pipes),U.pipes=null,U.pipesCount=0,U.flowing=!1,$&&$.emit("unpipe",this,pe),this);if(!$){var Re=U.pipes,De=U.pipesCount;U.pipes=null,U.pipesCount=0,U.flowing=!1;for(var ke=0;ke<De;ke++)Re[ke].emit("unpipe",this,{hasUnpiped:!1});return this}var Oe=V(U.pipes,$);return Oe===-1?this:(U.pipes.splice(Oe,1),U.pipesCount-=1,U.pipesCount===1&&(U.pipes=U.pipes[0]),$.emit("unpipe",this,pe),this)},A.prototype.on=function($,U){var pe=r.prototype.on.call(this,$,U),Re=this._readableState;return $==="data"?(Re.readableListening=this.listenerCount("readable")>0,Re.flowing!==!1&&this.resume()):$==="readable"&&!Re.endEmitted&&!Re.readableListening&&(Re.readableListening=Re.needReadable=!0,Re.flowing=!1,Re.emittedReadable=!1,l("on readable",Re.length,Re.reading),Re.length?ie(this):Re.reading||ve.nextTick(oe,this)),pe},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function($,U){var pe=r.prototype.removeListener.call(this,$,U);return $==="readable"&&ve.nextTick(X,this),pe},A.prototype.removeAllListeners=function($){var U=r.prototype.removeAllListeners.apply(this,arguments);return($==="readable"||$===void 0)&&ve.nextTick(X,this),U};function X($){var U=$._readableState;U.readableListening=$.listenerCount("readable")>0,U.resumeScheduled&&!U.paused?U.flowing=!0:$.listenerCount("data")>0&&$.resume()}function oe($){l("readable nexttick read 0"),$.read(0)}A.prototype.resume=function(){var $=this._readableState;return $.flowing||(l("resume"),$.flowing=!$.readableListening,ae(this,$)),$.paused=!1,this};function ae($,U){U.resumeScheduled||(U.resumeScheduled=!0,ve.nextTick(Ce,$,U))}function Ce($,U){l("resume",U.reading),U.reading||$.read(0),U.resumeScheduled=!1,$.emit("resume"),Z($),U.flowing&&!U.reading&&$.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 Z($){var U=$._readableState;for(l("flow",U.flowing);U.flowing&&$.read()!==null;);}A.prototype.wrap=function($){var U=this,pe=this._readableState,Re=!1;$.on("end",function(){if(l("wrapped end"),pe.decoder&&!pe.ended){var Oe=pe.decoder.end();Oe&&Oe.length&&U.push(Oe)}U.push(null)}),$.on("data",function(Oe){if(l("wrapped data"),pe.decoder&&(Oe=pe.decoder.write(Oe)),!(pe.objectMode&&Oe==null)&&!(!pe.objectMode&&(!Oe||!Oe.length))){var Be=U.push(Oe);Be||(Re=!0,$.pause())}});for(var De in $)this[De]===void 0&&typeof $[De]=="function"&&(this[De]=(function(Be){return function(){return $[Be].apply($,arguments)}})(De));for(var ke=0;ke<T.length;ke++)$.on(T[ke],this.emit.bind(this,T[ke]));return this._read=function(Oe){l("wrapped _read",Oe),Re&&(Re=!1,$.resume())},this},typeof Symbol=="function"&&(A.prototype[Symbol.asyncIterator]=function(){return y===void 0&&(y=BC()),y(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(U){this._readableState&&(this._readableState.flowing=U)}}),A._fromList=N,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function N($,U){if(U.length===0)return null;var pe;return U.objectMode?pe=U.buffer.shift():!$||$>=U.length?(U.decoder?pe=U.buffer.join(""):U.buffer.length===1?pe=U.buffer.first():pe=U.buffer.concat(U.length),U.buffer.clear()):pe=U.buffer.consume($,U.decoder),pe}function O($){var U=$._readableState;l("endReadable",U.endEmitted),U.endEmitted||(U.ended=!0,ve.nextTick(K,U,$))}function K($,U){if(l("endReadableNT",$.endEmitted,$.length),!$.endEmitted&&$.length===0&&($.endEmitted=!0,U.readable=!1,U.emit("end"),$.autoDestroy)){var pe=U._writableState;(!pe||pe.autoDestroy&&pe.finished)&&U.destroy()}}typeof Symbol=="function"&&(A.from=function($,U){return p===void 0&&(p=jC()),p(A,$,U)});function V($,U){for(var pe=0,Re=$.length;pe<Re;pe++)if($[pe]===U)return pe;return-1}return ju}var Uu,yy;function vy(){if(yy)return Uu;yy=1,Uu=a;var e=Oi().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,r=e.ERR_MULTIPLE_CALLBACK,n=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=e.ERR_TRANSFORM_WITH_LENGTH_0,o=Pi();Yn()(a,o);function s(c,d){var f=this._transformState;f.transforming=!1;var m=f.writecb;if(m===null)return this.emit("error",new r);f.writechunk=null,f.writecb=null,d!=null&&this.push(d),m(c);var w=this._readableState;w.reading=!1,(w.needReadable||w.length<w.highWaterMark)&&this._read(w.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(d,f){u(c,d,f)}):u(this,null,null)}a.prototype.push=function(c,d){return this._transformState.needTransform=!1,o.prototype.push.call(this,c,d)},a.prototype._transform=function(c,d,f){f(new t("_transform()"))},a.prototype._write=function(c,d,f){var m=this._transformState;if(m.writecb=f,m.writechunk=c,m.writeencoding=d,!m.transforming){var w=this._readableState;(m.needTransform||w.needReadable||w.length<w.highWaterMark)&&this._read(w.highWaterMark)}},a.prototype._read=function(c){var d=this._transformState;d.writechunk!==null&&!d.transforming?(d.transforming=!0,this._transform(d.writechunk,d.writeencoding,d.afterTransform)):d.needTransform=!0},a.prototype._destroy=function(c,d){o.prototype._destroy.call(this,c,function(f){d(f)})};function u(c,d,f){if(d)return c.emit("error",d);if(f!=null&&c.push(f),c._writableState.length)throw new i;if(c._transformState.transforming)throw new n;return c.push(null)}return Uu}var qu,by;function UC(){if(by)return qu;by=1,qu=t;var e=vy();Yn()(t,e);function t(r){if(!(this instanceof t))return new t(r);e.call(this,r)}return t.prototype._transform=function(r,n,i){i(null,r)},qu}var Vu,wy;function qC(){if(wy)return Vu;wy=1;var e;function t(f){var m=!1;return function(){m||(m=!0,f.apply(void 0,arguments))}}var r=Oi().codes,n=r.ERR_MISSING_ARGS,i=r.ERR_STREAM_DESTROYED;function o(f){if(f)throw f}function s(f){return f.setHeader&&typeof f.abort=="function"}function a(f,m,w,v){v=t(v);var E=!1;f.on("close",function(){E=!0}),e===void 0&&(e=Lu()),e(f,{readable:m,writable:w},function(g){if(g)return v(g);E=!0,v()});var b=!1;return function(g){if(!E&&!b){if(b=!0,s(f))return f.abort();if(typeof f.destroy=="function")return f.destroy();v(g||new i("pipe"))}}}function l(f){f()}function u(f,m){return f.pipe(m)}function c(f){return!f.length||typeof f[f.length-1]!="function"?o:f.pop()}function d(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];var v=c(m);if(Array.isArray(m[0])&&(m=m[0]),m.length<2)throw new n("streams");var E,b=m.map(function(g,y){var p=y<m.length-1,S=y>0;return a(g,p,S,function(T){E||(E=T),T&&b.forEach(l),!p&&(b.forEach(l),v(E))})});return m.reduce(u)}return Vu=d,Vu}var zu,Sy;function VC(){if(Sy)return zu;Sy=1,zu=r;var e=wc().EventEmitter,t=Yn();t(r,e),r.Readable=gy(),r.Writable=ly(),r.Duplex=Pi(),r.Transform=vy(),r.PassThrough=UC(),r.finished=Lu(),r.pipeline=qC(),r.Stream=r;function r(){e.call(this)}return r.prototype.pipe=function(n,i){var o=this;function s(m){n.writable&&n.write(m)===!1&&o.pause&&o.pause()}o.on("data",s);function a(){o.readable&&o.resume&&o.resume()}n.on("drain",a),!n._isStdio&&(!i||i.end!==!1)&&(o.on("end",u),o.on("close",c));var l=!1;function u(){l||(l=!0,n.end())}function c(){l||(l=!0,typeof n.destroy=="function"&&n.destroy())}function d(m){if(f(),e.listenerCount(this,"error")===0)throw m}o.on("error",d),n.on("error",d);function f(){o.removeListener("data",s),n.removeListener("drain",a),o.removeListener("end",u),o.removeListener("close",c),o.removeListener("error",d),n.removeListener("error",d),o.removeListener("end",f),o.removeListener("close",f),n.removeListener("close",f)}return o.on("end",f),o.on("close",f),n.on("close",f),n.emit("pipe",o),n},zu}var Ey;function zC(){return Ey||(Ey=1,(function(e){(function(t){t.parser=function(N,O){return new n(N,O)},t.SAXParser=n,t.SAXStream=c,t.createStream=u,t.MAX_BUFFER_LENGTH=64*1024;var r=["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 n(N,O){if(!(this instanceof n))return new n(N,O);var K=this;o(K),K.q=K.c="",K.bufferCheckPosition=t.MAX_BUFFER_LENGTH,K.opt=O||{},K.opt.lowercase=K.opt.lowercase||K.opt.lowercasetags,K.looseCase=K.opt.lowercase?"toLowerCase":"toUpperCase",K.tags=[],K.closed=K.closedRoot=K.sawRoot=!1,K.tag=K.error=null,K.strict=!!N,K.noscript=!!(N||K.opt.noscript),K.state=A.BEGIN,K.strictEntities=K.opt.strictEntities,K.ENTITIES=K.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),K.attribList=[],K.opt.xmlns&&(K.ns=Object.create(v)),K.opt.unquotedAttributeValues===void 0&&(K.opt.unquotedAttributeValues=!N),K.trackPosition=K.opt.position!==!1,K.trackPosition&&(K.position=K.line=K.column=0),H(K,"onready")}Object.create||(Object.create=function(N){function O(){}O.prototype=N;var K=new O;return K}),Object.keys||(Object.keys=function(N){var O=[];for(var K in N)N.hasOwnProperty(K)&&O.push(K);return O});function i(N){for(var O=Math.max(t.MAX_BUFFER_LENGTH,10),K=0,V=0,$=r.length;V<$;V++){var U=N[r[V]].length;if(U>O)switch(r[V]){case"textNode":x(N);break;case"cdata":_(N,"oncdata",N.cdata),N.cdata="";break;case"script":_(N,"onscript",N.script),N.script="";break;default:G(N,"Max buffer length exceeded: "+r[V])}K=Math.max(K,U)}var pe=t.MAX_BUFFER_LENGTH-K;N.bufferCheckPosition=pe+N.position}function o(N){for(var O=0,K=r.length;O<K;O++)N[r[O]]=""}function s(N){x(N),N.cdata!==""&&(_(N,"oncdata",N.cdata),N.cdata=""),N.script!==""&&(_(N,"onscript",N.script),N.script="")}n.prototype={end:function(){ne(this)},write:Z,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){s(this)}};var a;try{a=VC().Stream}catch{a=function(){}}a||(a=function(){});var l=t.EVENTS.filter(function(N){return N!=="error"&&N!=="end"});function u(N,O){return new c(N,O)}function c(N,O){if(!(this instanceof c))return new c(N,O);a.apply(this),this._parser=new n(N,O),this.writable=!0,this.readable=!0;var K=this;this._parser.onend=function(){K.emit("end")},this._parser.onerror=function(V){K.emit("error",V),K._parser.error=null},this._decoder=null,l.forEach(function(V){Object.defineProperty(K,"on"+V,{get:function(){return K._parser["on"+V]},set:function($){if(!$)return K.removeAllListeners(V),K._parser["on"+V]=$,$;K.on(V,$)},enumerable:!0,configurable:!1})})}c.prototype=Object.create(a.prototype,{constructor:{value:c}}),c.prototype.write=function(N){if(typeof Dn=="function"&&typeof Dn.isBuffer=="function"&&Dn.isBuffer(N)){if(!this._decoder){var O=Du().StringDecoder;this._decoder=new O("utf8")}N=this._decoder.write(N)}return this._parser.write(N.toString()),this.emit("data",N),!0},c.prototype.end=function(N){return N&&N.length&&this.write(N),this._parser.end(),!0},c.prototype.on=function(N,O){var K=this;return!K._parser["on"+N]&&l.indexOf(N)!==-1&&(K._parser["on"+N]=function(){var V=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);V.splice(0,0,N),K.emit.apply(K,V)}),a.prototype.on.call(K,N,O)};var d="[CDATA[",f="DOCTYPE",m="http://www.w3.org/XML/1998/namespace",w="http://www.w3.org/2000/xmlns/",v={xml:m,xmlns:w},E=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,b=/[:_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]/,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-]/;function p(N){return N===" "||N===`
26
+ `||N==="\r"||N===" "}function S(N){return N==='"'||N==="'"}function T(N){return N===">"||p(N)}function R(N,O){return N.test(O)}function I(N,O){return!R(N,O)}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(N){var O=t.ENTITIES[N],K=typeof O=="number"?String.fromCharCode(O):O;t.ENTITIES[N]=K});for(var D in t.STATE)t.STATE[t.STATE[D]]=D;A=t.STATE;function H(N,O,K){N[O]&&N[O](K)}function _(N,O,K){N.textNode&&x(N),H(N,O,K)}function x(N){N.textNode=z(N.opt,N.textNode),N.textNode&&H(N,"ontext",N.textNode),N.textNode=""}function z(N,O){return N.trim&&(O=O.trim()),N.normalize&&(O=O.replace(/\s+/g," ")),O}function G(N,O){return x(N),N.trackPosition&&(O+=`
27
+ Line: `+N.line+`
28
+ Column: `+N.column+`
29
+ Char: `+N.c),O=new Error(O),N.error=O,H(N,"onerror",O),N}function ne(N){return N.sawRoot&&!N.closedRoot&&ie(N,"Unclosed root tag"),N.state!==A.BEGIN&&N.state!==A.BEGIN_WHITESPACE&&N.state!==A.TEXT&&G(N,"Unexpected end"),x(N),N.c="",N.closed=!0,H(N,"onend"),n.call(N,N.strict,N.opt),N}function ie(N,O){if(typeof N!="object"||!(N instanceof n))throw new Error("bad call to strictFail");N.strict&&G(N,O)}function ee(N){N.strict||(N.tagName=N.tagName[N.looseCase]());var O=N.tags[N.tags.length-1]||N,K=N.tag={name:N.tagName,attributes:{}};N.opt.xmlns&&(K.ns=O.ns),N.attribList.length=0,_(N,"onopentagstart",K)}function ue(N,O){var K=N.indexOf(":"),V=K<0?["",N]:N.split(":"),$=V[0],U=V[1];return O&&N==="xmlns"&&($="xmlns",U=""),{prefix:$,local:U}}function de(N){if(N.strict||(N.attribName=N.attribName[N.looseCase]()),N.attribList.indexOf(N.attribName)!==-1||N.tag.attributes.hasOwnProperty(N.attribName)){N.attribName=N.attribValue="";return}if(N.opt.xmlns){var O=ue(N.attribName,!0),K=O.prefix,V=O.local;if(K==="xmlns")if(V==="xml"&&N.attribValue!==m)ie(N,"xml: prefix must be bound to "+m+`
30
+ Actual: `+N.attribValue);else if(V==="xmlns"&&N.attribValue!==w)ie(N,"xmlns: prefix must be bound to "+w+`
31
+ Actual: `+N.attribValue);else{var $=N.tag,U=N.tags[N.tags.length-1]||N;$.ns===U.ns&&($.ns=Object.create(U.ns)),$.ns[V]=N.attribValue}N.attribList.push([N.attribName,N.attribValue])}else N.tag.attributes[N.attribName]=N.attribValue,_(N,"onattribute",{name:N.attribName,value:N.attribValue});N.attribName=N.attribValue=""}function ce(N,O){if(N.opt.xmlns){var K=N.tag,V=ue(N.tagName);K.prefix=V.prefix,K.local=V.local,K.uri=K.ns[V.prefix]||"",K.prefix&&!K.uri&&(ie(N,"Unbound namespace prefix: "+JSON.stringify(N.tagName)),K.uri=V.prefix);var $=N.tags[N.tags.length-1]||N;K.ns&&$.ns!==K.ns&&Object.keys(K.ns).forEach(function(he){_(N,"onopennamespace",{prefix:he,uri:K.ns[he]})});for(var U=0,pe=N.attribList.length;U<pe;U++){var Re=N.attribList[U],De=Re[0],ke=Re[1],Oe=ue(De,!0),Be=Oe.prefix,Se=Oe.local,Ye=Be===""?"":K.ns[Be]||"",Qe={name:De,value:ke,prefix:Be,local:Se,uri:Ye};Be&&Be!=="xmlns"&&!Ye&&(ie(N,"Unbound namespace prefix: "+JSON.stringify(Be)),Qe.uri=Be),N.tag.attributes[De]=Qe,_(N,"onattribute",Qe)}N.attribList.length=0}N.tag.isSelfClosing=!!O,N.sawRoot=!0,N.tags.push(N.tag),_(N,"onopentag",N.tag),O||(!N.noscript&&N.tagName.toLowerCase()==="script"?N.state=A.SCRIPT:N.state=A.TEXT,N.tag=null,N.tagName=""),N.attribName=N.attribValue="",N.attribList.length=0}function X(N){if(!N.tagName){ie(N,"Weird empty close tag."),N.textNode+="</>",N.state=A.TEXT;return}if(N.script){if(N.tagName!=="script"){N.script+="</"+N.tagName+">",N.tagName="",N.state=A.SCRIPT;return}_(N,"onscript",N.script),N.script=""}var O=N.tags.length,K=N.tagName;N.strict||(K=K[N.looseCase]());for(var V=K;O--;){var $=N.tags[O];if($.name!==V)ie(N,"Unexpected close tag");else break}if(O<0){ie(N,"Unmatched closing tag: "+N.tagName),N.textNode+="</"+N.tagName+">",N.state=A.TEXT;return}N.tagName=K;for(var U=N.tags.length;U-- >O;){var pe=N.tag=N.tags.pop();N.tagName=N.tag.name,_(N,"onclosetag",N.tagName);var Re={};for(var De in pe.ns)Re[De]=pe.ns[De];var ke=N.tags[N.tags.length-1]||N;N.opt.xmlns&&pe.ns!==ke.ns&&Object.keys(pe.ns).forEach(function(Oe){var Be=pe.ns[Oe];_(N,"onclosenamespace",{prefix:Oe,uri:Be})})}O===0&&(N.closedRoot=!0),N.tagName=N.attribValue=N.attribName="",N.attribList.length=0,N.state=A.TEXT}function oe(N){var O=N.entity,K=O.toLowerCase(),V,$="";return N.ENTITIES[O]?N.ENTITIES[O]:N.ENTITIES[K]?N.ENTITIES[K]:(O=K,O.charAt(0)==="#"&&(O.charAt(1)==="x"?(O=O.slice(2),V=parseInt(O,16),$=V.toString(16)):(O=O.slice(1),V=parseInt(O,10),$=V.toString(10))),O=O.replace(/^0+/,""),isNaN(V)||$.toLowerCase()!==O?(ie(N,"Invalid character entity"),"&"+N.entity+";"):String.fromCodePoint(V))}function ae(N,O){O==="<"?(N.state=A.OPEN_WAKA,N.startTagPosition=N.position):p(O)||(ie(N,"Non-whitespace before first tag."),N.textNode=O,N.state=A.TEXT)}function Ce(N,O){var K="";return O<N.length&&(K=N.charAt(O)),K}function Z(N){var O=this;if(this.error)throw this.error;if(O.closed)return G(O,"Cannot write after close. Assign an onready handler.");if(N===null)return ne(O);typeof N=="object"&&(N=N.toString());for(var K=0,V="";V=Ce(N,K++),O.c=V,!!V;)switch(O.trackPosition&&(O.position++,V===`
32
+ `?(O.line++,O.column=0):O.column++),O.state){case A.BEGIN:if(O.state=A.BEGIN_WHITESPACE,V==="\uFEFF")continue;ae(O,V);continue;case A.BEGIN_WHITESPACE:ae(O,V);continue;case A.TEXT:if(O.sawRoot&&!O.closedRoot){for(var $=K-1;V&&V!=="<"&&V!=="&";)V=Ce(N,K++),V&&O.trackPosition&&(O.position++,V===`
33
+ `?(O.line++,O.column=0):O.column++);O.textNode+=N.substring($,K-1)}V==="<"&&!(O.sawRoot&&O.closedRoot&&!O.strict)?(O.state=A.OPEN_WAKA,O.startTagPosition=O.position):(!p(V)&&(!O.sawRoot||O.closedRoot)&&ie(O,"Text data outside of root node."),V==="&"?O.state=A.TEXT_ENTITY:O.textNode+=V);continue;case A.SCRIPT:V==="<"?O.state=A.SCRIPT_ENDING:O.script+=V;continue;case A.SCRIPT_ENDING:V==="/"?O.state=A.CLOSE_TAG:(O.script+="<"+V,O.state=A.SCRIPT);continue;case A.OPEN_WAKA:if(V==="!")O.state=A.SGML_DECL,O.sgmlDecl="";else if(!p(V))if(R(E,V))O.state=A.OPEN_TAG,O.tagName=V;else if(V==="/")O.state=A.CLOSE_TAG,O.tagName="";else if(V==="?")O.state=A.PROC_INST,O.procInstName=O.procInstBody="";else{if(ie(O,"Unencoded <"),O.startTagPosition+1<O.position){var U=O.position-O.startTagPosition;V=new Array(U).join(" ")+V}O.textNode+="<"+V,O.state=A.TEXT}continue;case A.SGML_DECL:if(O.sgmlDecl+V==="--"){O.state=A.COMMENT,O.comment="",O.sgmlDecl="";continue}O.doctype&&O.doctype!==!0&&O.sgmlDecl?(O.state=A.DOCTYPE_DTD,O.doctype+="<!"+O.sgmlDecl+V,O.sgmlDecl=""):(O.sgmlDecl+V).toUpperCase()===d?(_(O,"onopencdata"),O.state=A.CDATA,O.sgmlDecl="",O.cdata=""):(O.sgmlDecl+V).toUpperCase()===f?(O.state=A.DOCTYPE,(O.doctype||O.sawRoot)&&ie(O,"Inappropriately located doctype declaration"),O.doctype="",O.sgmlDecl=""):V===">"?(_(O,"onsgmldeclaration",O.sgmlDecl),O.sgmlDecl="",O.state=A.TEXT):(S(V)&&(O.state=A.SGML_DECL_QUOTED),O.sgmlDecl+=V);continue;case A.SGML_DECL_QUOTED:V===O.q&&(O.state=A.SGML_DECL,O.q=""),O.sgmlDecl+=V;continue;case A.DOCTYPE:V===">"?(O.state=A.TEXT,_(O,"ondoctype",O.doctype),O.doctype=!0):(O.doctype+=V,V==="["?O.state=A.DOCTYPE_DTD:S(V)&&(O.state=A.DOCTYPE_QUOTED,O.q=V));continue;case A.DOCTYPE_QUOTED:O.doctype+=V,V===O.q&&(O.q="",O.state=A.DOCTYPE);continue;case A.DOCTYPE_DTD:V==="]"?(O.doctype+=V,O.state=A.DOCTYPE):V==="<"?(O.state=A.OPEN_WAKA,O.startTagPosition=O.position):S(V)?(O.doctype+=V,O.state=A.DOCTYPE_DTD_QUOTED,O.q=V):O.doctype+=V;continue;case A.DOCTYPE_DTD_QUOTED:O.doctype+=V,V===O.q&&(O.state=A.DOCTYPE_DTD,O.q="");continue;case A.COMMENT:V==="-"?O.state=A.COMMENT_ENDING:O.comment+=V;continue;case A.COMMENT_ENDING:V==="-"?(O.state=A.COMMENT_ENDED,O.comment=z(O.opt,O.comment),O.comment&&_(O,"oncomment",O.comment),O.comment=""):(O.comment+="-"+V,O.state=A.COMMENT);continue;case A.COMMENT_ENDED:V!==">"?(ie(O,"Malformed comment"),O.comment+="--"+V,O.state=A.COMMENT):O.doctype&&O.doctype!==!0?O.state=A.DOCTYPE_DTD:O.state=A.TEXT;continue;case A.CDATA:V==="]"?O.state=A.CDATA_ENDING:O.cdata+=V;continue;case A.CDATA_ENDING:V==="]"?O.state=A.CDATA_ENDING_2:(O.cdata+="]"+V,O.state=A.CDATA);continue;case A.CDATA_ENDING_2:V===">"?(O.cdata&&_(O,"oncdata",O.cdata),_(O,"onclosecdata"),O.cdata="",O.state=A.TEXT):V==="]"?O.cdata+="]":(O.cdata+="]]"+V,O.state=A.CDATA);continue;case A.PROC_INST:V==="?"?O.state=A.PROC_INST_ENDING:p(V)?O.state=A.PROC_INST_BODY:O.procInstName+=V;continue;case A.PROC_INST_BODY:if(!O.procInstBody&&p(V))continue;V==="?"?O.state=A.PROC_INST_ENDING:O.procInstBody+=V;continue;case A.PROC_INST_ENDING:V===">"?(_(O,"onprocessinginstruction",{name:O.procInstName,body:O.procInstBody}),O.procInstName=O.procInstBody="",O.state=A.TEXT):(O.procInstBody+="?"+V,O.state=A.PROC_INST_BODY);continue;case A.OPEN_TAG:R(b,V)?O.tagName+=V:(ee(O),V===">"?ce(O):V==="/"?O.state=A.OPEN_TAG_SLASH:(p(V)||ie(O,"Invalid character in tag name"),O.state=A.ATTRIB));continue;case A.OPEN_TAG_SLASH:V===">"?(ce(O,!0),X(O)):(ie(O,"Forward-slash in opening tag not followed by >"),O.state=A.ATTRIB);continue;case A.ATTRIB:if(p(V))continue;V===">"?ce(O):V==="/"?O.state=A.OPEN_TAG_SLASH:R(E,V)?(O.attribName=V,O.attribValue="",O.state=A.ATTRIB_NAME):ie(O,"Invalid attribute name");continue;case A.ATTRIB_NAME:V==="="?O.state=A.ATTRIB_VALUE:V===">"?(ie(O,"Attribute without value"),O.attribValue=O.attribName,de(O),ce(O)):p(V)?O.state=A.ATTRIB_NAME_SAW_WHITE:R(b,V)?O.attribName+=V:ie(O,"Invalid attribute name");continue;case A.ATTRIB_NAME_SAW_WHITE:if(V==="=")O.state=A.ATTRIB_VALUE;else{if(p(V))continue;ie(O,"Attribute without value"),O.tag.attributes[O.attribName]="",O.attribValue="",_(O,"onattribute",{name:O.attribName,value:""}),O.attribName="",V===">"?ce(O):R(E,V)?(O.attribName=V,O.state=A.ATTRIB_NAME):(ie(O,"Invalid attribute name"),O.state=A.ATTRIB)}continue;case A.ATTRIB_VALUE:if(p(V))continue;S(V)?(O.q=V,O.state=A.ATTRIB_VALUE_QUOTED):(O.opt.unquotedAttributeValues||G(O,"Unquoted attribute value"),O.state=A.ATTRIB_VALUE_UNQUOTED,O.attribValue=V);continue;case A.ATTRIB_VALUE_QUOTED:if(V!==O.q){V==="&"?O.state=A.ATTRIB_VALUE_ENTITY_Q:O.attribValue+=V;continue}de(O),O.q="",O.state=A.ATTRIB_VALUE_CLOSED;continue;case A.ATTRIB_VALUE_CLOSED:p(V)?O.state=A.ATTRIB:V===">"?ce(O):V==="/"?O.state=A.OPEN_TAG_SLASH:R(E,V)?(ie(O,"No whitespace between attributes"),O.attribName=V,O.attribValue="",O.state=A.ATTRIB_NAME):ie(O,"Invalid attribute name");continue;case A.ATTRIB_VALUE_UNQUOTED:if(!T(V)){V==="&"?O.state=A.ATTRIB_VALUE_ENTITY_U:O.attribValue+=V;continue}de(O),V===">"?ce(O):O.state=A.ATTRIB;continue;case A.CLOSE_TAG:if(O.tagName)V===">"?X(O):R(b,V)?O.tagName+=V:O.script?(O.script+="</"+O.tagName,O.tagName="",O.state=A.SCRIPT):(p(V)||ie(O,"Invalid tagname in closing tag"),O.state=A.CLOSE_TAG_SAW_WHITE);else{if(p(V))continue;I(E,V)?O.script?(O.script+="</"+V,O.state=A.SCRIPT):ie(O,"Invalid tagname in closing tag."):O.tagName=V}continue;case A.CLOSE_TAG_SAW_WHITE:if(p(V))continue;V===">"?X(O):ie(O,"Invalid characters in closing tag");continue;case A.TEXT_ENTITY:case A.ATTRIB_VALUE_ENTITY_Q:case A.ATTRIB_VALUE_ENTITY_U:var pe,Re;switch(O.state){case A.TEXT_ENTITY:pe=A.TEXT,Re="textNode";break;case A.ATTRIB_VALUE_ENTITY_Q:pe=A.ATTRIB_VALUE_QUOTED,Re="attribValue";break;case A.ATTRIB_VALUE_ENTITY_U:pe=A.ATTRIB_VALUE_UNQUOTED,Re="attribValue";break}if(V===";"){var De=oe(O);O.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(De)?(O.entity="",O.state=pe,O.write(De)):(O[Re]+=De,O.entity="",O.state=pe)}else R(O.entity.length?y:g,V)?O.entity+=V:(ie(O,"Invalid character in entity name"),O[Re]+="&"+O.entity+V,O.entity="",O.state=pe);continue;default:throw new Error(O,"Unknown state: "+O.state)}return O.position>=O.bufferCheckPosition&&i(O),O}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||(function(){var N=String.fromCharCode,O=Math.floor,K=function(){var V=16384,$=[],U,pe,Re=-1,De=arguments.length;if(!De)return"";for(var ke="";++Re<De;){var Oe=Number(arguments[Re]);if(!isFinite(Oe)||Oe<0||Oe>1114111||O(Oe)!==Oe)throw RangeError("Invalid code point: "+Oe);Oe<=65535?$.push(Oe):(Oe-=65536,U=(Oe>>10)+55296,pe=Oe%1024+56320,$.push(U,pe)),(Re+1===De||$.length>V)&&(ke+=N.apply(null,$),$.length=0)}return ke};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:K,configurable:!0,writable:!0}):String.fromCodePoint=K})()})(e)})(bc)),bc}var Wu,Ty;function Hu(){return Ty||(Ty=1,Wu={isArray:function(e){return Array.isArray?Array.isArray(e):Object.prototype.toString.call(e)==="[object Array]"}}),Wu}var Gu,Ay;function Ku(){if(Ay)return Gu;Ay=1;var e=Hu().isArray;return Gu={copyOptions:function(t){var r,n={};for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n},ensureFlagExists:function(t,r){(!(t in r)||typeof r[t]!="boolean")&&(r[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,r){(!(t+"Key"in r)||typeof r[t+"Key"]!="string")&&(r[t+"Key"]=r.compact?"_"+t:t)},checkFnExists:function(t,r){return t+"Fn"in r}},Gu}var Qu,Ry;function Cy(){if(Ry)return Qu;Ry=1;var e=zC(),t=Ku(),r=Hu().isArray,n,i;function o(b){return n=t.copyOptions(b),t.ensureFlagExists("ignoreDeclaration",n),t.ensureFlagExists("ignoreInstruction",n),t.ensureFlagExists("ignoreAttributes",n),t.ensureFlagExists("ignoreText",n),t.ensureFlagExists("ignoreComment",n),t.ensureFlagExists("ignoreCdata",n),t.ensureFlagExists("ignoreDoctype",n),t.ensureFlagExists("compact",n),t.ensureFlagExists("alwaysChildren",n),t.ensureFlagExists("addParent",n),t.ensureFlagExists("trim",n),t.ensureFlagExists("nativeType",n),t.ensureFlagExists("nativeTypeAttributes",n),t.ensureFlagExists("sanitize",n),t.ensureFlagExists("instructionHasAttributes",n),t.ensureFlagExists("captureSpacesBetweenElements",n),t.ensureAlwaysArrayExists(n),t.ensureKeyExists("declaration",n),t.ensureKeyExists("instruction",n),t.ensureKeyExists("attributes",n),t.ensureKeyExists("text",n),t.ensureKeyExists("comment",n),t.ensureKeyExists("cdata",n),t.ensureKeyExists("doctype",n),t.ensureKeyExists("type",n),t.ensureKeyExists("name",n),t.ensureKeyExists("elements",n),t.ensureKeyExists("parent",n),t.checkFnExists("doctype",n),t.checkFnExists("instruction",n),t.checkFnExists("cdata",n),t.checkFnExists("comment",n),t.checkFnExists("text",n),t.checkFnExists("instructionName",n),t.checkFnExists("elementName",n),t.checkFnExists("attributeName",n),t.checkFnExists("attributeValue",n),t.checkFnExists("attributes",n),n}function s(b){var g=Number(b);if(!isNaN(g))return g;var y=b.toLowerCase();return y==="true"?!0:y==="false"?!1:b}function a(b,g){var y;if(n.compact){if(!i[n[b+"Key"]]&&(r(n.alwaysArray)?n.alwaysArray.indexOf(n[b+"Key"])!==-1:n.alwaysArray)&&(i[n[b+"Key"]]=[]),i[n[b+"Key"]]&&!r(i[n[b+"Key"]])&&(i[n[b+"Key"]]=[i[n[b+"Key"]]]),b+"Fn"in n&&typeof g=="string"&&(g=n[b+"Fn"](g,i)),b==="instruction"&&("instructionFn"in n||"instructionNameFn"in n)){for(y in g)if(g.hasOwnProperty(y))if("instructionFn"in n)g[y]=n.instructionFn(g[y],y,i);else{var p=g[y];delete g[y],g[n.instructionNameFn(y,p,i)]=p}}r(i[n[b+"Key"]])?i[n[b+"Key"]].push(g):i[n[b+"Key"]]=g}else{i[n.elementsKey]||(i[n.elementsKey]=[]);var S={};if(S[n.typeKey]=b,b==="instruction"){for(y in g)if(g.hasOwnProperty(y))break;S[n.nameKey]="instructionNameFn"in n?n.instructionNameFn(y,g,i):y,n.instructionHasAttributes?(S[n.attributesKey]=g[y][n.attributesKey],"instructionFn"in n&&(S[n.attributesKey]=n.instructionFn(S[n.attributesKey],y,i))):("instructionFn"in n&&(g[y]=n.instructionFn(g[y],y,i)),S[n.instructionKey]=g[y])}else b+"Fn"in n&&(g=n[b+"Fn"](g,i)),S[n[b+"Key"]]=g;n.addParent&&(S[n.parentKey]=i),i[n.elementsKey].push(S)}}function l(b){if("attributesFn"in n&&b&&(b=n.attributesFn(b,i)),(n.trim||"attributeValueFn"in n||"attributeNameFn"in n||n.nativeTypeAttributes)&&b){var g;for(g in b)if(b.hasOwnProperty(g)&&(n.trim&&(b[g]=b[g].trim()),n.nativeTypeAttributes&&(b[g]=s(b[g])),"attributeValueFn"in n&&(b[g]=n.attributeValueFn(b[g],g,i)),"attributeNameFn"in n)){var y=b[g];delete b[g],b[n.attributeNameFn(g,b[g],i)]=y}}return b}function u(b){var g={};if(b.body&&(b.name.toLowerCase()==="xml"||n.instructionHasAttributes)){for(var y=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,p;(p=y.exec(b.body))!==null;)g[p[1]]=p[2]||p[3]||p[4];g=l(g)}if(b.name.toLowerCase()==="xml"){if(n.ignoreDeclaration)return;i[n.declarationKey]={},Object.keys(g).length&&(i[n.declarationKey][n.attributesKey]=g),n.addParent&&(i[n.declarationKey][n.parentKey]=i)}else{if(n.ignoreInstruction)return;n.trim&&(b.body=b.body.trim());var S={};n.instructionHasAttributes&&Object.keys(g).length?(S[b.name]={},S[b.name][n.attributesKey]=g):S[b.name]=b.body,a("instruction",S)}}function c(b,g){var y;if(typeof b=="object"&&(g=b.attributes,b=b.name),g=l(g),"elementNameFn"in n&&(b=n.elementNameFn(b,i)),n.compact){if(y={},!n.ignoreAttributes&&g&&Object.keys(g).length){y[n.attributesKey]={};var p;for(p in g)g.hasOwnProperty(p)&&(y[n.attributesKey][p]=g[p])}!(b in i)&&(r(n.alwaysArray)?n.alwaysArray.indexOf(b)!==-1:n.alwaysArray)&&(i[b]=[]),i[b]&&!r(i[b])&&(i[b]=[i[b]]),r(i[b])?i[b].push(y):i[b]=y}else i[n.elementsKey]||(i[n.elementsKey]=[]),y={},y[n.typeKey]="element",y[n.nameKey]=b,!n.ignoreAttributes&&g&&Object.keys(g).length&&(y[n.attributesKey]=g),n.alwaysChildren&&(y[n.elementsKey]=[]),i[n.elementsKey].push(y);y[n.parentKey]=i,i=y}function d(b){n.ignoreText||!b.trim()&&!n.captureSpacesBetweenElements||(n.trim&&(b=b.trim()),n.nativeType&&(b=s(b)),n.sanitize&&(b=b.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")),a("text",b))}function f(b){n.ignoreComment||(n.trim&&(b=b.trim()),a("comment",b))}function m(b){var g=i[n.parentKey];n.addParent||delete i[n.parentKey],i=g}function w(b){n.ignoreCdata||(n.trim&&(b=b.trim()),a("cdata",b))}function v(b){n.ignoreDoctype||(b=b.replace(/^ /,""),n.trim&&(b=b.trim()),a("doctype",b))}function E(b){b.note=b}return Qu=function(b,g){var y=e.parser(!0,{}),p={};if(i=p,n=o(g),y.opt={strictEntities:!0},y.onopentag=c,y.ontext=d,y.oncomment=f,y.onclosetag=m,y.onerror=E,y.oncdata=w,y.ondoctype=v,y.onprocessinginstruction=u,y.write(b).close(),p[n.elementsKey]){var S=p[n.elementsKey];delete p[n.elementsKey],p[n.elementsKey]=S,delete p.text}return p},Qu}var Xu,Iy;function WC(){if(Iy)return Xu;Iy=1;var e=Ku(),t=Cy();function r(n){var i=e.copyOptions(n);return e.ensureSpacesExists(i),i}return Xu=function(n,i){var o,s,a,l;return o=r(i),s=t(n,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")},Xu}var Yu,_y;function Oy(){if(_y)return Yu;_y=1;var e=Ku(),t=Hu().isArray,r,n;function i(y){var p=e.copyOptions(y);return e.ensureFlagExists("ignoreDeclaration",p),e.ensureFlagExists("ignoreInstruction",p),e.ensureFlagExists("ignoreAttributes",p),e.ensureFlagExists("ignoreText",p),e.ensureFlagExists("ignoreComment",p),e.ensureFlagExists("ignoreCdata",p),e.ensureFlagExists("ignoreDoctype",p),e.ensureFlagExists("compact",p),e.ensureFlagExists("indentText",p),e.ensureFlagExists("indentCdata",p),e.ensureFlagExists("indentAttributes",p),e.ensureFlagExists("indentInstruction",p),e.ensureFlagExists("fullTagEmptyElement",p),e.ensureFlagExists("noQuotesForNativeAttributes",p),e.ensureSpacesExists(p),typeof p.spaces=="number"&&(p.spaces=Array(p.spaces+1).join(" ")),e.ensureKeyExists("declaration",p),e.ensureKeyExists("instruction",p),e.ensureKeyExists("attributes",p),e.ensureKeyExists("text",p),e.ensureKeyExists("comment",p),e.ensureKeyExists("cdata",p),e.ensureKeyExists("doctype",p),e.ensureKeyExists("type",p),e.ensureKeyExists("name",p),e.ensureKeyExists("elements",p),e.checkFnExists("doctype",p),e.checkFnExists("instruction",p),e.checkFnExists("cdata",p),e.checkFnExists("comment",p),e.checkFnExists("text",p),e.checkFnExists("instructionName",p),e.checkFnExists("elementName",p),e.checkFnExists("attributeName",p),e.checkFnExists("attributeValue",p),e.checkFnExists("attributes",p),e.checkFnExists("fullTagEmptyElement",p),p}function o(y,p,S){return(!S&&y.spaces?`
34
+ `:"")+Array(p+1).join(y.spaces)}function s(y,p,S){if(p.ignoreAttributes)return"";"attributesFn"in p&&(y=p.attributesFn(y,n,r));var T,R,I,A,D=[];for(T in y)y.hasOwnProperty(T)&&y[T]!==null&&y[T]!==void 0&&(A=p.noQuotesForNativeAttributes&&typeof y[T]!="string"?"":'"',R=""+y[T],R=R.replace(/"/g,"&quot;"),I="attributeNameFn"in p?p.attributeNameFn(T,R,n,r):T,D.push(p.spaces&&p.indentAttributes?o(p,S+1,!1):" "),D.push(I+"="+A+("attributeValueFn"in p?p.attributeValueFn(R,T,n,r):R)+A));return y&&Object.keys(y).length&&p.spaces&&p.indentAttributes&&D.push(o(p,S,!1)),D.join("")}function a(y,p,S){return r=y,n="xml",p.ignoreDeclaration?"":"<?xml"+s(y[p.attributesKey],p,S)+"?>"}function l(y,p,S){if(p.ignoreInstruction)return"";var T;for(T in y)if(y.hasOwnProperty(T))break;var R="instructionNameFn"in p?p.instructionNameFn(T,y[T],n,r):T;if(typeof y[T]=="object")return r=y,n=R,"<?"+R+s(y[T][p.attributesKey],p,S)+"?>";var I=y[T]?y[T]:"";return"instructionFn"in p&&(I=p.instructionFn(I,T,n,r)),"<?"+R+(I?" "+I:"")+"?>"}function u(y,p){return p.ignoreComment?"":"<!--"+("commentFn"in p?p.commentFn(y,n,r):y)+"-->"}function c(y,p){return p.ignoreCdata?"":"<![CDATA["+("cdataFn"in p?p.cdataFn(y,n,r):y.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function d(y,p){return p.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in p?p.doctypeFn(y,n,r):y)+">"}function f(y,p){return p.ignoreText?"":(y=""+y,y=y.replace(/&amp;/g,"&"),y=y.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"textFn"in p?p.textFn(y,n,r):y)}function m(y,p){var S;if(y.elements&&y.elements.length)for(S=0;S<y.elements.length;++S)switch(y.elements[S][p.typeKey]){case"text":if(p.indentText)return!0;break;case"cdata":if(p.indentCdata)return!0;break;case"instruction":if(p.indentInstruction)return!0;break;case"doctype":case"comment":case"element":return!0;default:return!0}return!1}function w(y,p,S){r=y,n=y.name;var T=[],R="elementNameFn"in p?p.elementNameFn(y.name,y):y.name;T.push("<"+R),y[p.attributesKey]&&T.push(s(y[p.attributesKey],p,S));var I=y[p.elementsKey]&&y[p.elementsKey].length||y[p.attributesKey]&&y[p.attributesKey]["xml:space"]==="preserve";return I||("fullTagEmptyElementFn"in p?I=p.fullTagEmptyElementFn(y.name,y):I=p.fullTagEmptyElement),I?(T.push(">"),y[p.elementsKey]&&y[p.elementsKey].length&&(T.push(v(y[p.elementsKey],p,S+1)),r=y,n=y.name),T.push(p.spaces&&m(y,p)?`
35
+ `+Array(S+1).join(p.spaces):""),T.push("</"+R+">")):T.push("/>"),T.join("")}function v(y,p,S,T){return y.reduce(function(R,I){var A=o(p,S,T&&!R);switch(I.type){case"element":return R+A+w(I,p,S);case"comment":return R+A+u(I[p.commentKey],p);case"doctype":return R+A+d(I[p.doctypeKey],p);case"cdata":return R+(p.indentCdata?A:"")+c(I[p.cdataKey],p);case"text":return R+(p.indentText?A:"")+f(I[p.textKey],p);case"instruction":var D={};return D[I[p.nameKey]]=I[p.attributesKey]?I:I[p.instructionKey],R+(p.indentInstruction?A:"")+l(D,p,S)}},"")}function E(y,p,S){var T;for(T in y)if(y.hasOwnProperty(T))switch(T){case p.parentKey:case p.attributesKey:break;case p.textKey:if(p.indentText||S)return!0;break;case p.cdataKey:if(p.indentCdata||S)return!0;break;case p.instructionKey:if(p.indentInstruction||S)return!0;break;case p.doctypeKey:case p.commentKey:return!0;default:return!0}return!1}function b(y,p,S,T,R){r=y,n=p;var I="elementNameFn"in S?S.elementNameFn(p,y):p;if(typeof y>"u"||y===null||y==="")return"fullTagEmptyElementFn"in S&&S.fullTagEmptyElementFn(p,y)||S.fullTagEmptyElement?"<"+I+"></"+I+">":"<"+I+"/>";var A=[];if(p){if(A.push("<"+I),typeof y!="object")return A.push(">"+f(y,S)+"</"+I+">"),A.join("");y[S.attributesKey]&&A.push(s(y[S.attributesKey],S,T));var D=E(y,S,!0)||y[S.attributesKey]&&y[S.attributesKey]["xml:space"]==="preserve";if(D||("fullTagEmptyElementFn"in S?D=S.fullTagEmptyElementFn(p,y):D=S.fullTagEmptyElement),D)A.push(">");else return A.push("/>"),A.join("")}return A.push(g(y,S,T+1,!1)),r=y,n=p,p&&A.push((R?o(S,T,!1):"")+"</"+I+">"),A.join("")}function g(y,p,S,T){var R,I,A,D=[];for(I in y)if(y.hasOwnProperty(I))for(A=t(y[I])?y[I]:[y[I]],R=0;R<A.length;++R){switch(I){case p.declarationKey:D.push(a(A[R],p,S));break;case p.instructionKey:D.push((p.indentInstruction?o(p,S,T):"")+l(A[R],p,S));break;case p.attributesKey:case p.parentKey:break;case p.textKey:D.push((p.indentText?o(p,S,T):"")+f(A[R],p));break;case p.cdataKey:D.push((p.indentCdata?o(p,S,T):"")+c(A[R],p));break;case p.doctypeKey:D.push(o(p,S,T)+d(A[R],p));break;case p.commentKey:D.push(o(p,S,T)+u(A[R],p));break;default:D.push(o(p,S,T)+b(A[R],I,p,S,E(A[R],p)))}T=T&&!D.length}return D.join("")}return Yu=function(y,p){p=i(p);var S=[];return r=y,n="_root_",p.compact?S.push(g(y,p,0,!0)):(y[p.declarationKey]&&S.push(a(y[p.declarationKey],p,0)),y[p.elementsKey]&&y[p.elementsKey].length&&S.push(v(y[p.elementsKey],p,0,!S.length))),S.join("")},Yu}var Ju,Py;function HC(){if(Py)return Ju;Py=1;var e=Oy();return Ju=function(t,r){t instanceof Dn&&(t=t.toString());var n=null;if(typeof t=="string")try{n=JSON.parse(t)}catch{throw new Error("The JSON structure is invalid")}else n=t;return e(n,r)},Ju}var Zu,ky;function GC(){if(ky)return Zu;ky=1;var e=Cy(),t=WC(),r=Oy(),n=HC();return Zu={xml2js:e,xml2json:t,js2xml:r,json2xml:n},Zu}GC();/*! For license information please see index.js.LICENSE.txt */var KC={2:e=>{function t(i,o,s){i instanceof RegExp&&(i=r(i,s)),o instanceof RegExp&&(o=r(o,s));var a=n(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 r(i,o){var s=o.match(i);return s?s[0]:null}function n(i,o,s){var a,l,u,c,d,f=s.indexOf(i),m=s.indexOf(o,f+1),w=f;if(f>=0&&m>0){for(a=[],u=s.length;w>=0&&!d;)w==f?(a.push(w),f=s.indexOf(i,w+1)):a.length==1?d=[a.pop(),m]:((l=a.pop())<u&&(u=l,c=m),m=s.indexOf(o,w+1)),w=f<m&&f>=0?f:m;a.length&&(d=[u,c])}return d}e.exports=t,t.range=n},101:function(e,t,r){var n;e=r.nmd(e),(function(i){var o=(e&&e.exports,typeof Nn=="object"&&Nn);o.global!==o&&o.window;var s=function(d){this.message=d};(s.prototype=new Error).name="InvalidCharacterError";var a=function(d){throw new s(d)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,c={encode:function(d){d=String(d),/[^\0-\xFF]/.test(d)&&a("The string to be encoded contains characters outside of the Latin1 range.");for(var f,m,w,v,E=d.length%3,b="",g=-1,y=d.length-E;++g<y;)f=d.charCodeAt(g)<<16,m=d.charCodeAt(++g)<<8,w=d.charCodeAt(++g),b+=l.charAt((v=f+m+w)>>18&63)+l.charAt(v>>12&63)+l.charAt(v>>6&63)+l.charAt(63&v);return E==2?(f=d.charCodeAt(g)<<8,m=d.charCodeAt(++g),b+=l.charAt((v=f+m)>>10)+l.charAt(v>>4&63)+l.charAt(v<<2&63)+"="):E==1&&(v=d.charCodeAt(g),b+=l.charAt(v>>2)+l.charAt(v<<4&63)+"=="),b},decode:function(d){var f=(d=String(d).replace(u,"")).length;f%4==0&&(f=(d=d.replace(/==?$/,"")).length),(f%4==1||/[^+a-zA-Z0-9/]/.test(d))&&a("Invalid character: the string to be decoded is not correctly encoded.");for(var m,w,v=0,E="",b=-1;++b<f;)w=l.indexOf(d.charAt(b)),m=v%4?64*m+w:w,v++%4&&(E+=String.fromCharCode(255&m>>(-2*v&6)));return E},version:"1.0.0"};(n=(function(){return c}).call(t,r,t,e))===void 0||(e.exports=n)})()},172:(e,t)=>{t.d=function(r){if(!r)return 0;for(var n=(r=r.toString()).length,i=r.length;i--;){var o=r.charCodeAt(i);56320<=o&&o<=57343&&i--,127<o&&o<=2047?n++:2047<o&&o<=65535&&(n+=2)}return n}},526:e=>{var t={utf8:{stringToBytes:function(r){return t.bin.stringToBytes(unescape(encodeURIComponent(r)))},bytesToString:function(r){return decodeURIComponent(escape(t.bin.bytesToString(r)))}},bin:{stringToBytes:function(r){for(var n=[],i=0;i<r.length;i++)n.push(255&r.charCodeAt(i));return n},bytesToString:function(r){for(var n=[],i=0;i<r.length;i++)n.push(String.fromCharCode(r[i]));return n.join("")}}};e.exports=t},298:e=>{var t,r;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(n,i){return n<<i|n>>>32-i},rotr:function(n,i){return n<<32-i|n>>>i},endian:function(n){if(n.constructor==Number)return 16711935&r.rotl(n,8)|4278255360&r.rotl(n,24);for(var i=0;i<n.length;i++)n[i]=r.endian(n[i]);return n},randomBytes:function(n){for(var i=[];n>0;n--)i.push(Math.floor(256*Math.random()));return i},bytesToWords:function(n){for(var i=[],o=0,s=0;o<n.length;o++,s+=8)i[s>>>5]|=n[o]<<24-s%32;return i},wordsToBytes:function(n){for(var i=[],o=0;o<32*n.length;o+=8)i.push(n[o>>>5]>>>24-o%32&255);return i},bytesToHex:function(n){for(var i=[],o=0;o<n.length;o++)i.push((n[o]>>>4).toString(16)),i.push((15&n[o]).toString(16));return i.join("")},hexToBytes:function(n){for(var i=[],o=0;o<n.length;o+=2)i.push(parseInt(n.substr(o,2),16));return i},bytesToBase64:function(n){for(var i=[],o=0;o<n.length;o+=3)for(var s=n[o]<<16|n[o+1]<<8|n[o+2],a=0;a<4;a++)8*o+6*a<=8*n.length?i.push(t.charAt(s>>>6*(3-a)&63)):i.push("=");return i.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/gi,"");for(var i=[],o=0,s=0;o<n.length;s=++o%4)s!=0&&i.push((t.indexOf(n.charAt(o-1))&Math.pow(2,-2*s+8)-1)<<2*s|t.indexOf(n.charAt(o))>>>6-2*s);return i}},e.exports=r},635:(e,t,r)=>{const n=r(31),i=r(338),o=r(221);e.exports={XMLParser:i,XMLValidator:n,XMLBuilder:o}},118:e=>{e.exports=function(t){return typeof t=="function"?t:Array.isArray(t)?r=>{for(const n of t)if(typeof n=="string"&&r===n||n instanceof RegExp&&n.test(r))return!0}:()=>!1}},705:(e,t)=>{const r=":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="["+r+"]["+r+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",i=new RegExp("^"+n+"$");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 d=0;d<c;d++)u.push(l[d]);a.push(u),l=s.exec(o)}return a},t.nameRegexp=n},31:(e,t,r)=>{const n=r(705),i={allowBooleanAttributes:!1,unpairedTags:[]};function o(g){return g===" "||g===" "||g===`
36
+ `||g==="\r"}function s(g,y){const p=y;for(;y<g.length;y++)if(!(g[y]!="?"&&g[y]!=" ")){const S=g.substr(p,y-p);if(y>5&&S==="xml")return w("InvalidXml","XML declaration allowed only at the start of the document.",E(g,y));if(g[y]=="?"&&g[y+1]==">"){y++;break}}return y}function a(g,y){if(g.length>y+5&&g[y+1]==="-"&&g[y+2]==="-"){for(y+=3;y<g.length;y++)if(g[y]==="-"&&g[y+1]==="-"&&g[y+2]===">"){y+=2;break}}else if(g.length>y+8&&g[y+1]==="D"&&g[y+2]==="O"&&g[y+3]==="C"&&g[y+4]==="T"&&g[y+5]==="Y"&&g[y+6]==="P"&&g[y+7]==="E"){let p=1;for(y+=8;y<g.length;y++)if(g[y]==="<")p++;else if(g[y]===">"&&(p--,p===0))break}else if(g.length>y+9&&g[y+1]==="["&&g[y+2]==="C"&&g[y+3]==="D"&&g[y+4]==="A"&&g[y+5]==="T"&&g[y+6]==="A"&&g[y+7]==="["){for(y+=8;y<g.length;y++)if(g[y]==="]"&&g[y+1]==="]"&&g[y+2]===">"){y+=2;break}}return y}t.validate=function(g,y){y=Object.assign({},i,y);const p=[];let S=!1,T=!1;g[0]==="\uFEFF"&&(g=g.substr(1));for(let I=0;I<g.length;I++)if(g[I]==="<"&&g[I+1]==="?"){if(I+=2,I=s(g,I),I.err)return I}else{if(g[I]!=="<"){if(o(g[I]))continue;return w("InvalidChar","char '"+g[I]+"' is not expected.",E(g,I))}{let A=I;if(I++,g[I]==="!"){I=a(g,I);continue}{let D=!1;g[I]==="/"&&(D=!0,I++);let H="";for(;I<g.length&&g[I]!==">"&&g[I]!==" "&&g[I]!==" "&&g[I]!==`
37
+ `&&g[I]!=="\r";I++)H+=g[I];if(H=H.trim(),H[H.length-1]==="/"&&(H=H.substring(0,H.length-1),I--),R=H,!n.isName(R)){let z;return z=H.trim().length===0?"Invalid space after '<'.":"Tag '"+H+"' is an invalid name.",w("InvalidTag",z,E(g,I))}const _=c(g,I);if(_===!1)return w("InvalidAttr","Attributes for '"+H+"' have open quote.",E(g,I));let x=_.value;if(I=_.index,x[x.length-1]==="/"){const z=I-x.length;x=x.substring(0,x.length-1);const G=f(x,y);if(G!==!0)return w(G.err.code,G.err.msg,E(g,z+G.err.line));S=!0}else if(D){if(!_.tagClosed)return w("InvalidTag","Closing tag '"+H+"' doesn't have proper closing.",E(g,I));if(x.trim().length>0)return w("InvalidTag","Closing tag '"+H+"' can't have attributes or invalid starting.",E(g,A));if(p.length===0)return w("InvalidTag","Closing tag '"+H+"' has not been opened.",E(g,A));{const z=p.pop();if(H!==z.tagName){let G=E(g,z.tagStartPos);return w("InvalidTag","Expected closing tag '"+z.tagName+"' (opened in line "+G.line+", col "+G.col+") instead of closing tag '"+H+"'.",E(g,A))}p.length==0&&(T=!0)}}else{const z=f(x,y);if(z!==!0)return w(z.err.code,z.err.msg,E(g,I-x.length+z.err.line));if(T===!0)return w("InvalidXml","Multiple possible root nodes found.",E(g,I));y.unpairedTags.indexOf(H)!==-1||p.push({tagName:H,tagStartPos:A}),S=!0}for(I++;I<g.length;I++)if(g[I]==="<"){if(g[I+1]==="!"){I++,I=a(g,I);continue}if(g[I+1]!=="?")break;if(I=s(g,++I),I.err)return I}else if(g[I]==="&"){const z=m(g,I);if(z==-1)return w("InvalidChar","char '&' is not expected.",E(g,I));I=z}else if(T===!0&&!o(g[I]))return w("InvalidXml","Extra text at the end",E(g,I));g[I]==="<"&&I--}}}var R;return S?p.length==1?w("InvalidTag","Unclosed tag '"+p[0].tagName+"'.",E(g,p[0].tagStartPos)):!(p.length>0)||w("InvalidXml","Invalid '"+JSON.stringify(p.map((I=>I.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):w("InvalidXml","Start tag expected.",1)};const l='"',u="'";function c(g,y){let p="",S="",T=!1;for(;y<g.length;y++){if(g[y]===l||g[y]===u)S===""?S=g[y]:S!==g[y]||(S="");else if(g[y]===">"&&S===""){T=!0;break}p+=g[y]}return S===""&&{value:p,index:y,tagClosed:T}}const d=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function f(g,y){const p=n.getAllMatches(g,d),S={};for(let T=0;T<p.length;T++){if(p[T][1].length===0)return w("InvalidAttr","Attribute '"+p[T][2]+"' has no space in starting.",b(p[T]));if(p[T][3]!==void 0&&p[T][4]===void 0)return w("InvalidAttr","Attribute '"+p[T][2]+"' is without value.",b(p[T]));if(p[T][3]===void 0&&!y.allowBooleanAttributes)return w("InvalidAttr","boolean attribute '"+p[T][2]+"' is not allowed.",b(p[T]));const R=p[T][2];if(!v(R))return w("InvalidAttr","Attribute '"+R+"' is an invalid name.",b(p[T]));if(S.hasOwnProperty(R))return w("InvalidAttr","Attribute '"+R+"' is repeated.",b(p[T]));S[R]=1}return!0}function m(g,y){if(g[++y]===";")return-1;if(g[y]==="#")return(function(S,T){let R=/\d/;for(S[T]==="x"&&(T++,R=/[\da-fA-F]/);T<S.length;T++){if(S[T]===";")return T;if(!S[T].match(R))break}return-1})(g,++y);let p=0;for(;y<g.length;y++,p++)if(!(g[y].match(/\w/)&&p<20)){if(g[y]===";")break;return-1}return y}function w(g,y,p){return{err:{code:g,msg:y,line:p.line||p,col:p.col}}}function v(g){return n.isName(g)}function E(g,y){const p=g.substring(0,y).split(/\r?\n/);return{line:p.length,col:p[p.length-1].length+1}}function b(g){return g.startIndex+g[1].length}},221:(e,t,r)=>{const n=r(87),i=r(118),o={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(c,d){return d},attributeValueProcessor:function(c,d){return d},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=`>
38
38
  `,this.newLine=`
39
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function a(l,d,f,m){const w=this.j2x(l,f+1,m.concat(d));return l[this.options.textNodeName]!==void 0&&Object.keys(l).length===1?this.buildTextValNode(l[this.options.textNodeName],d,w.attrStr,f):this.buildObjectNode(w.val,d,w.attrStr,f)}function c(l){return this.options.indentBy.repeat(l)}function u(l){return!(!l.startsWith(this.options.attributeNamePrefix)||l===this.options.textNodeName)&&l.substr(this.attrPrefixLen)}s.prototype.build=function(l){return this.options.preserveOrder?r(l,this.options):(Array.isArray(l)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(l={[this.options.arrayNodeName]:l}),this.j2x(l,0,[]).val)},s.prototype.j2x=function(l,d,f){let m="",w="";const y=f.join(".");for(let E in l)if(Object.prototype.hasOwnProperty.call(l,E))if(l[E]===void 0)this.isAttribute(E)&&(w+="");else if(l[E]===null)this.isAttribute(E)?w+="":E[0]==="?"?w+=this.indentate(d)+"<"+E+"?"+this.tagEndChar:w+=this.indentate(d)+"<"+E+"/"+this.tagEndChar;else if(l[E]instanceof Date)w+=this.buildTextValNode(l[E],E,"",d);else if(typeof l[E]!="object"){const b=this.isAttribute(E);if(b&&!this.ignoreAttributesFn(b,y))m+=this.buildAttrPairStr(b,""+l[E]);else if(!b)if(E===this.options.textNodeName){let g=this.options.tagValueProcessor(E,""+l[E]);w+=this.replaceEntitiesValue(g)}else w+=this.buildTextValNode(l[E],E,"",d)}else if(Array.isArray(l[E])){const b=l[E].length;let g="",v="";for(let h=0;h<b;h++){const S=l[E][h];if(S!==void 0)if(S===null)E[0]==="?"?w+=this.indentate(d)+"<"+E+"?"+this.tagEndChar:w+=this.indentate(d)+"<"+E+"/"+this.tagEndChar;else if(typeof S=="object")if(this.options.oneListGroup){const T=this.j2x(S,d+1,f.concat(E));g+=T.val,this.options.attributesGroupName&&S.hasOwnProperty(this.options.attributesGroupName)&&(v+=T.attrStr)}else g+=this.processTextOrObjNode(S,E,d,f);else if(this.options.oneListGroup){let T=this.options.tagValueProcessor(E,S);T=this.replaceEntitiesValue(T),g+=T}else g+=this.buildTextValNode(S,E,"",d)}this.options.oneListGroup&&(g=this.buildObjectNode(g,E,v,d)),w+=g}else if(this.options.attributesGroupName&&E===this.options.attributesGroupName){const b=Object.keys(l[E]),g=b.length;for(let v=0;v<g;v++)m+=this.buildAttrPairStr(b[v],""+l[E][b[v]])}else w+=this.processTextOrObjNode(l[E],E,d,f);return{attrStr:m,val:w}},s.prototype.buildAttrPairStr=function(l,d){return d=this.options.attributeValueProcessor(l,""+d),d=this.replaceEntitiesValue(d),this.options.suppressBooleanAttributes&&d==="true"?" "+l:" "+l+'="'+d+'"'},s.prototype.buildObjectNode=function(l,d,f,m){if(l==="")return d[0]==="?"?this.indentate(m)+"<"+d+f+"?"+this.tagEndChar:this.indentate(m)+"<"+d+f+this.closeTag(d)+this.tagEndChar;{let w="</"+d+this.tagEndChar,y="";return d[0]==="?"&&(y="?",w=""),!f&&f!==""||l.indexOf("<")!==-1?this.options.commentPropName!==!1&&d===this.options.commentPropName&&y.length===0?this.indentate(m)+`<!--${l}-->`+this.newLine:this.indentate(m)+"<"+d+f+y+this.tagEndChar+l+this.indentate(m)+w:this.indentate(m)+"<"+d+f+y+">"+l+w}},s.prototype.closeTag=function(l){let d="";return this.options.unpairedTags.indexOf(l)!==-1?this.options.suppressUnpairedNode||(d="/"):d=this.options.suppressEmptyNode?"/":`></${l}`,d},s.prototype.buildTextValNode=function(l,d,f,m){if(this.options.cdataPropName!==!1&&d===this.options.cdataPropName)return this.indentate(m)+`<![CDATA[${l}]]>`+this.newLine;if(this.options.commentPropName!==!1&&d===this.options.commentPropName)return this.indentate(m)+`<!--${l}-->`+this.newLine;if(d[0]==="?")return this.indentate(m)+"<"+d+f+"?"+this.tagEndChar;{let w=this.options.tagValueProcessor(d,l);return w=this.replaceEntitiesValue(w),w===""?this.indentate(m)+"<"+d+f+this.closeTag(d)+this.tagEndChar:this.indentate(m)+"<"+d+f+">"+w+"</"+d+this.tagEndChar}},s.prototype.replaceEntitiesValue=function(l){if(l&&l.length>0&&this.options.processEntities)for(let d=0;d<this.options.entities.length;d++){const f=this.options.entities[d];l=l.replace(f.regex,f.val)}return l},e.exports=s},87:e=>{function t(s,a,c,u){let l="",d=!1;for(let f=0;f<s.length;f++){const m=s[f],w=n(m);if(w===void 0)continue;let y="";if(y=c.length===0?w:`${c}.${w}`,w===a.textNodeName){let v=m[w];o(y,a)||(v=a.tagValueProcessor(w,v),v=i(v,a)),d&&(l+=u),l+=v,d=!1;continue}if(w===a.cdataPropName){d&&(l+=u),l+=`<![CDATA[${m[w][0][a.textNodeName]}]]>`,d=!1;continue}if(w===a.commentPropName){l+=u+`<!--${m[w][0][a.textNodeName]}-->`,d=!0;continue}if(w[0]==="?"){const v=r(m[":@"],a),h=w==="?xml"?"":u;let S=m[w][0][a.textNodeName];S=S.length!==0?" "+S:"",l+=h+`<${w}${S}${v}?>`,d=!0;continue}let E=u;E!==""&&(E+=a.indentBy);const b=u+`<${w}${r(m[":@"],a)}`,g=t(m[w],a,y,E);a.unpairedTags.indexOf(w)!==-1?a.suppressUnpairedNode?l+=b+">":l+=b+"/>":g&&g.length!==0||!a.suppressEmptyNode?g&&g.endsWith(">")?l+=b+`>${g}${u}</${w}>`:(l+=b+">",g&&u!==""&&(g.includes("/>")||g.includes("</"))?l+=u+a.indentBy+g+u:l+=g,l+=`</${w}>`):l+=b+"/>",d=!0}return l}function n(s){const a=Object.keys(s);for(let c=0;c<a.length;c++){const u=a[c];if(s.hasOwnProperty(u)&&u!==":@")return u}}function r(s,a){let c="";if(s&&!a.ignoreAttributes)for(let u in s){if(!s.hasOwnProperty(u))continue;let l=a.attributeValueProcessor(u,s[u]);l=i(l,a),l===!0&&a.suppressBooleanAttributes?c+=` ${u.substr(a.attributeNamePrefix.length)}`:c+=` ${u.substr(a.attributeNamePrefix.length)}="${l}"`}return c}function o(s,a){let c=(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]==="*."+c)return!0;return!1}function i(s,a){if(s&&s.length>0&&a.processEntities)for(let c=0;c<a.entities.length;c++){const u=a.entities[c];s=s.replace(u.regex,u.val)}return s}e.exports=function(s,a){let c="";return a.format&&a.indentBy.length>0&&(c=`
40
- `),t(s,a,"",c)}},193:(e,t,n)=>{const r=n(705);function o(d,f){let m="";for(;f<d.length&&d[f]!=="'"&&d[f]!=='"';f++)m+=d[f];if(m=m.trim(),m.indexOf(" ")!==-1)throw new Error("External entites are not supported");const w=d[f++];let y="";for(;f<d.length&&d[f]!==w;f++)y+=d[f];return[m,y,f]}function i(d,f){return d[f+1]==="!"&&d[f+2]==="-"&&d[f+3]==="-"}function s(d,f){return d[f+1]==="!"&&d[f+2]==="E"&&d[f+3]==="N"&&d[f+4]==="T"&&d[f+5]==="I"&&d[f+6]==="T"&&d[f+7]==="Y"}function a(d,f){return d[f+1]==="!"&&d[f+2]==="E"&&d[f+3]==="L"&&d[f+4]==="E"&&d[f+5]==="M"&&d[f+6]==="E"&&d[f+7]==="N"&&d[f+8]==="T"}function c(d,f){return d[f+1]==="!"&&d[f+2]==="A"&&d[f+3]==="T"&&d[f+4]==="T"&&d[f+5]==="L"&&d[f+6]==="I"&&d[f+7]==="S"&&d[f+8]==="T"}function u(d,f){return d[f+1]==="!"&&d[f+2]==="N"&&d[f+3]==="O"&&d[f+4]==="T"&&d[f+5]==="A"&&d[f+6]==="T"&&d[f+7]==="I"&&d[f+8]==="O"&&d[f+9]==="N"}function l(d){if(r.isName(d))return d;throw new Error(`Invalid entity name ${d}`)}e.exports=function(d,f){const m={};if(d[f+3]!=="O"||d[f+4]!=="C"||d[f+5]!=="T"||d[f+6]!=="Y"||d[f+7]!=="P"||d[f+8]!=="E")throw new Error("Invalid Tag instead of DOCTYPE");{f+=9;let w=1,y=!1,E=!1,b="";for(;f<d.length;f++)if(d[f]!=="<"||E)if(d[f]===">"){if(E?d[f-1]==="-"&&d[f-2]==="-"&&(E=!1,w--):w--,w===0)break}else d[f]==="["?y=!0:b+=d[f];else{if(y&&s(d,f)){let g,v;f+=7,[g,v,f]=o(d,f+1),v.indexOf("&")===-1&&(m[l(g)]={regx:RegExp(`&${g};`,"g"),val:v})}else if(y&&a(d,f))f+=8;else if(y&&c(d,f))f+=8;else if(y&&u(d,f))f+=9;else{if(!i)throw new Error("Invalid DOCTYPE");E=!0}w++,b=""}if(w!==0)throw new Error("Unclosed DOCTYPE")}return{entities:m,i:f}}},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,o){return o},attributeValueProcessor:function(r,o){return o},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(r,o,i){return r}};t.buildOptions=function(r){return Object.assign({},n,r)},t.defaultOptions=n},299:(e,t,n)=>{const r=n(705),o=n(365),i=n(193),s=n(494),a=n(118);function c(T){const I=Object.keys(T);for(let _=0;_<I.length;_++){const A=I[_];this.lastEntities[A]={regex:new RegExp("&"+A+";","g"),val:T[A]}}}function u(T,I,_,A,$,D,N){if(T!==void 0&&(this.options.trimValues&&!A&&(T=T.trim()),T.length>0)){N||(T=this.replaceEntitiesValue(T));const x=this.options.tagValueProcessor(I,T,_,$,D);return x==null?T:typeof x!=typeof T||x!==T?x:this.options.trimValues||T.trim()===T?S(T,this.options.parseTagValue,this.options.numberParseOptions):T}}function l(T){if(this.options.removeNSPrefix){const I=T.split(":"),_=T.charAt(0)==="/"?"/":"";if(I[0]==="xmlns")return"";I.length===2&&(T=_+I[1])}return T}const d=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function f(T,I,_){if(this.options.ignoreAttributes!==!0&&typeof T=="string"){const A=r.getAllMatches(T,d),$=A.length,D={};for(let N=0;N<$;N++){const x=this.resolveNameSpace(A[N][1]);if(this.ignoreAttributesFn(x,I))continue;let V=A[N][4],G=this.options.attributeNamePrefix+x;if(x.length)if(this.options.transformAttributeName&&(G=this.options.transformAttributeName(G)),G==="__proto__"&&(G="#__proto__"),V!==void 0){this.options.trimValues&&(V=V.trim()),V=this.replaceEntitiesValue(V);const ae=this.options.attributeValueProcessor(x,V,I);D[G]=ae==null?V:typeof ae!=typeof V||ae!==V?ae:S(V,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(D[G]=!0)}if(!Object.keys(D).length)return;if(this.options.attributesGroupName){const N={};return N[this.options.attributesGroupName]=D,N}return D}}const m=function(T){T=T.replace(/\r\n?/g,`
41
- `);const I=new o("!xml");let _=I,A="",$="";for(let D=0;D<T.length;D++)if(T[D]==="<")if(T[D+1]==="/"){const N=g(T,">",D,"Closing Tag is not closed.");let x=T.substring(D+2,N).trim();if(this.options.removeNSPrefix){const ae=x.indexOf(":");ae!==-1&&(x=x.substr(ae+1))}this.options.transformTagName&&(x=this.options.transformTagName(x)),_&&(A=this.saveTextToParentTag(A,_,$));const V=$.substring($.lastIndexOf(".")+1);if(x&&this.options.unpairedTags.indexOf(x)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${x}>`);let G=0;V&&this.options.unpairedTags.indexOf(V)!==-1?(G=$.lastIndexOf(".",$.lastIndexOf(".")-1),this.tagsNodeStack.pop()):G=$.lastIndexOf("."),$=$.substring(0,G),_=this.tagsNodeStack.pop(),A="",D=N}else if(T[D+1]==="?"){let N=v(T,D,!1,"?>");if(!N)throw new Error("Pi Tag is not closed.");if(A=this.saveTextToParentTag(A,_,$),!(this.options.ignoreDeclaration&&N.tagName==="?xml"||this.options.ignorePiTags)){const x=new o(N.tagName);x.add(this.options.textNodeName,""),N.tagName!==N.tagExp&&N.attrExpPresent&&(x[":@"]=this.buildAttributesMap(N.tagExp,$,N.tagName)),this.addChild(_,x,$)}D=N.closeIndex+1}else if(T.substr(D+1,3)==="!--"){const N=g(T,"-->",D+4,"Comment is not closed.");if(this.options.commentPropName){const x=T.substring(D+4,N-2);A=this.saveTextToParentTag(A,_,$),_.add(this.options.commentPropName,[{[this.options.textNodeName]:x}])}D=N}else if(T.substr(D+1,2)==="!D"){const N=i(T,D);this.docTypeEntities=N.entities,D=N.i}else if(T.substr(D+1,2)==="!["){const N=g(T,"]]>",D,"CDATA is not closed.")-2,x=T.substring(D+9,N);A=this.saveTextToParentTag(A,_,$);let V=this.parseTextData(x,_.tagname,$,!0,!1,!0,!0);V==null&&(V=""),this.options.cdataPropName?_.add(this.options.cdataPropName,[{[this.options.textNodeName]:x}]):_.add(this.options.textNodeName,V),D=N+2}else{let N=v(T,D,this.options.removeNSPrefix),x=N.tagName;const V=N.rawTagName;let G=N.tagExp,ae=N.attrExpPresent,ye=N.closeIndex;this.options.transformTagName&&(x=this.options.transformTagName(x)),_&&A&&_.tagname!=="!xml"&&(A=this.saveTextToParentTag(A,_,$,!1));const ue=_;if(ue&&this.options.unpairedTags.indexOf(ue.tagname)!==-1&&(_=this.tagsNodeStack.pop(),$=$.substring(0,$.lastIndexOf("."))),x!==I.tagname&&($+=$?"."+x:x),this.isItStopNode(this.options.stopNodes,$,x)){let te="";if(G.length>0&&G.lastIndexOf("/")===G.length-1)x[x.length-1]==="/"?(x=x.substr(0,x.length-1),$=$.substr(0,$.length-1),G=x):G=G.substr(0,G.length-1),D=N.closeIndex;else if(this.options.unpairedTags.indexOf(x)!==-1)D=N.closeIndex;else{const oe=this.readStopNodeData(T,V,ye+1);if(!oe)throw new Error(`Unexpected end of ${V}`);D=oe.i,te=oe.tagContent}const ce=new o(x);x!==G&&ae&&(ce[":@"]=this.buildAttributesMap(G,$,x)),te&&(te=this.parseTextData(te,x,$,!0,ae,!0,!0)),$=$.substr(0,$.lastIndexOf(".")),ce.add(this.options.textNodeName,te),this.addChild(_,ce,$)}else{if(G.length>0&&G.lastIndexOf("/")===G.length-1){x[x.length-1]==="/"?(x=x.substr(0,x.length-1),$=$.substr(0,$.length-1),G=x):G=G.substr(0,G.length-1),this.options.transformTagName&&(x=this.options.transformTagName(x));const te=new o(x);x!==G&&ae&&(te[":@"]=this.buildAttributesMap(G,$,x)),this.addChild(_,te,$),$=$.substr(0,$.lastIndexOf("."))}else{const te=new o(x);this.tagsNodeStack.push(_),x!==G&&ae&&(te[":@"]=this.buildAttributesMap(G,$,x)),this.addChild(_,te,$),_=te}A="",D=ye}}else A+=T[D];return I.child};function w(T,I,_){const A=this.options.updateTag(I.tagname,_,I[":@"]);A===!1||(typeof A=="string"&&(I.tagname=A),T.addChild(I))}const y=function(T){if(this.options.processEntities){for(let I in this.docTypeEntities){const _=this.docTypeEntities[I];T=T.replace(_.regx,_.val)}for(let I in this.lastEntities){const _=this.lastEntities[I];T=T.replace(_.regex,_.val)}if(this.options.htmlEntities)for(let I in this.htmlEntities){const _=this.htmlEntities[I];T=T.replace(_.regex,_.val)}T=T.replace(this.ampEntity.regex,this.ampEntity.val)}return T};function E(T,I,_,A){return T&&(A===void 0&&(A=Object.keys(I.child).length===0),(T=this.parseTextData(T,I.tagname,_,!1,!!I[":@"]&&Object.keys(I[":@"]).length!==0,A))!==void 0&&T!==""&&I.add(this.options.textNodeName,T),T=""),T}function b(T,I,_){const A="*."+_;for(const $ in T){const D=T[$];if(A===D||I===D)return!0}return!1}function g(T,I,_,A){const $=T.indexOf(I,_);if($===-1)throw new Error(A);return $+I.length-1}function v(T,I,_){const A=function(ae,ye){let ue,te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",ce="";for(let oe=ye;oe<ae.length;oe++){let J=ae[oe];if(ue)J===ue&&(ue="");else if(J==='"'||J==="'")ue=J;else if(J===te[0]){if(!te[1])return{data:ce,index:oe};if(ae[oe+1]===te[1])return{data:ce,index:oe}}else J===" "&&(J=" ");ce+=J}}(T,I+1,arguments.length>3&&arguments[3]!==void 0?arguments[3]:">");if(!A)return;let $=A.data;const D=A.index,N=$.search(/\s/);let x=$,V=!0;N!==-1&&(x=$.substring(0,N),$=$.substring(N+1).trimStart());const G=x;if(_){const ae=x.indexOf(":");ae!==-1&&(x=x.substr(ae+1),V=x!==A.data.substr(ae+1))}return{tagName:x,tagExp:$,closeIndex:D,attrExpPresent:V,rawTagName:G}}function h(T,I,_){const A=_;let $=1;for(;_<T.length;_++)if(T[_]==="<")if(T[_+1]==="/"){const D=g(T,">",_,`${I} is not closed`);if(T.substring(_+2,D).trim()===I&&($--,$===0))return{tagContent:T.substring(A,_),i:D};_=D}else if(T[_+1]==="?")_=g(T,"?>",_+1,"StopNode is not closed.");else if(T.substr(_+1,3)==="!--")_=g(T,"-->",_+3,"StopNode is not closed.");else if(T.substr(_+1,2)==="![")_=g(T,"]]>",_,"StopNode is not closed.")-2;else{const D=v(T,_,">");D&&((D&&D.tagName)===I&&D.tagExp[D.tagExp.length-1]!=="/"&&$++,_=D.closeIndex)}}function S(T,I,_){if(I&&typeof T=="string"){const A=T.trim();return A==="true"||A!=="false"&&s(T,_)}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:(I,_)=>String.fromCharCode(Number.parseInt(_,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(I,_)=>String.fromCharCode(Number.parseInt(_,16))}},this.addExternalEntities=c,this.parseXml=m,this.parseTextData=u,this.resolveNameSpace=l,this.buildAttributesMap=f,this.isItStopNode=b,this.replaceEntitiesValue=y,this.readStopNodeData=h,this.saveTextToParentTag=E,this.addChild=w,this.ignoreAttributesFn=a(this.options.ignoreAttributes)}}},338:(e,t,n)=>{const{buildOptions:r}=n(63),o=n(299),{prettify:i}=n(728),s=n(31);e.exports=class{constructor(a){this.externalEntities={},this.options=r(a)}parse(a,c){if(typeof a!="string"){if(!a.toString)throw new Error("XML data is accepted in String or Bytes[] form.");a=a.toString()}if(c){c===!0&&(c={});const d=s.validate(a,c);if(d!==!0)throw Error(`${d.err.msg}:${d.err.line}:${d.err.col}`)}const u=new o(this.options);u.addExternalEntities(this.externalEntities);const l=u.parseXml(a);return this.options.preserveOrder||l===void 0?l:i(l,this.options)}addEntity(a,c){if(c.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(c==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[a]=c}}},728:(e,t)=>{function n(s,a,c){let u;const l={};for(let d=0;d<s.length;d++){const f=s[d],m=r(f);let w="";if(w=c===void 0?m:c+"."+m,m===a.textNodeName)u===void 0?u=f[m]:u+=""+f[m];else{if(m===void 0)continue;if(f[m]){let y=n(f[m],a,w);const E=i(y,a);f[":@"]?o(y,f[":@"],w,a):Object.keys(y).length!==1||y[a.textNodeName]===void 0||a.alwaysCreateTextNode?Object.keys(y).length===0&&(a.alwaysCreateTextNode?y[a.textNodeName]="":y=""):y=y[a.textNodeName],l[m]!==void 0&&l.hasOwnProperty(m)?(Array.isArray(l[m])||(l[m]=[l[m]]),l[m].push(y)):a.isArray(m,w,E)?l[m]=[y]:l[m]=y}}}return typeof u=="string"?u.length>0&&(l[a.textNodeName]=u):u!==void 0&&(l[a.textNodeName]=u),l}function r(s){const a=Object.keys(s);for(let c=0;c<a.length;c++){const u=a[c];if(u!==":@")return u}}function o(s,a,c,u){if(a){const l=Object.keys(a),d=l.length;for(let f=0;f<d;f++){const m=l[f];u.isArray(m,c+"."+m,!0,!0)?s[m]=[a[m]]:s[m]=a[m]}}}function i(s,a){const{textNodeName:c}=a,u=Object.keys(s).length;return u===0||!(u!==1||!s[c]&&typeof s[c]!="boolean"&&s[c]!==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),o=n(526).utf8,i=n(135),s=n(526).bin,a=function(c,u){c.constructor==String?c=u&&u.encoding==="binary"?s.stringToBytes(c):o.stringToBytes(c):i(c)?c=Array.prototype.slice.call(c,0):Array.isArray(c)||c.constructor===Uint8Array||(c=c.toString());for(var l=r.bytesToWords(c),d=8*c.length,f=1732584193,m=-271733879,w=-1732584194,y=271733878,E=0;E<l.length;E++)l[E]=16711935&(l[E]<<8|l[E]>>>24)|4278255360&(l[E]<<24|l[E]>>>8);l[d>>>5]|=128<<d%32,l[14+(d+64>>>9<<4)]=d;var b=a._ff,g=a._gg,v=a._hh,h=a._ii;for(E=0;E<l.length;E+=16){var S=f,T=m,I=w,_=y;f=b(f,m,w,y,l[E+0],7,-680876936),y=b(y,f,m,w,l[E+1],12,-389564586),w=b(w,y,f,m,l[E+2],17,606105819),m=b(m,w,y,f,l[E+3],22,-1044525330),f=b(f,m,w,y,l[E+4],7,-176418897),y=b(y,f,m,w,l[E+5],12,1200080426),w=b(w,y,f,m,l[E+6],17,-1473231341),m=b(m,w,y,f,l[E+7],22,-45705983),f=b(f,m,w,y,l[E+8],7,1770035416),y=b(y,f,m,w,l[E+9],12,-1958414417),w=b(w,y,f,m,l[E+10],17,-42063),m=b(m,w,y,f,l[E+11],22,-1990404162),f=b(f,m,w,y,l[E+12],7,1804603682),y=b(y,f,m,w,l[E+13],12,-40341101),w=b(w,y,f,m,l[E+14],17,-1502002290),f=g(f,m=b(m,w,y,f,l[E+15],22,1236535329),w,y,l[E+1],5,-165796510),y=g(y,f,m,w,l[E+6],9,-1069501632),w=g(w,y,f,m,l[E+11],14,643717713),m=g(m,w,y,f,l[E+0],20,-373897302),f=g(f,m,w,y,l[E+5],5,-701558691),y=g(y,f,m,w,l[E+10],9,38016083),w=g(w,y,f,m,l[E+15],14,-660478335),m=g(m,w,y,f,l[E+4],20,-405537848),f=g(f,m,w,y,l[E+9],5,568446438),y=g(y,f,m,w,l[E+14],9,-1019803690),w=g(w,y,f,m,l[E+3],14,-187363961),m=g(m,w,y,f,l[E+8],20,1163531501),f=g(f,m,w,y,l[E+13],5,-1444681467),y=g(y,f,m,w,l[E+2],9,-51403784),w=g(w,y,f,m,l[E+7],14,1735328473),f=v(f,m=g(m,w,y,f,l[E+12],20,-1926607734),w,y,l[E+5],4,-378558),y=v(y,f,m,w,l[E+8],11,-2022574463),w=v(w,y,f,m,l[E+11],16,1839030562),m=v(m,w,y,f,l[E+14],23,-35309556),f=v(f,m,w,y,l[E+1],4,-1530992060),y=v(y,f,m,w,l[E+4],11,1272893353),w=v(w,y,f,m,l[E+7],16,-155497632),m=v(m,w,y,f,l[E+10],23,-1094730640),f=v(f,m,w,y,l[E+13],4,681279174),y=v(y,f,m,w,l[E+0],11,-358537222),w=v(w,y,f,m,l[E+3],16,-722521979),m=v(m,w,y,f,l[E+6],23,76029189),f=v(f,m,w,y,l[E+9],4,-640364487),y=v(y,f,m,w,l[E+12],11,-421815835),w=v(w,y,f,m,l[E+15],16,530742520),f=h(f,m=v(m,w,y,f,l[E+2],23,-995338651),w,y,l[E+0],6,-198630844),y=h(y,f,m,w,l[E+7],10,1126891415),w=h(w,y,f,m,l[E+14],15,-1416354905),m=h(m,w,y,f,l[E+5],21,-57434055),f=h(f,m,w,y,l[E+12],6,1700485571),y=h(y,f,m,w,l[E+3],10,-1894986606),w=h(w,y,f,m,l[E+10],15,-1051523),m=h(m,w,y,f,l[E+1],21,-2054922799),f=h(f,m,w,y,l[E+8],6,1873313359),y=h(y,f,m,w,l[E+15],10,-30611744),w=h(w,y,f,m,l[E+6],15,-1560198380),m=h(m,w,y,f,l[E+13],21,1309151649),f=h(f,m,w,y,l[E+4],6,-145523070),y=h(y,f,m,w,l[E+11],10,-1120210379),w=h(w,y,f,m,l[E+2],15,718787259),m=h(m,w,y,f,l[E+9],21,-343485551),f=f+S>>>0,m=m+T>>>0,w=w+I>>>0,y=y+_>>>0}return r.endian([f,m,w,y])};a._ff=function(c,u,l,d,f,m,w){var y=c+(u&l|~u&d)+(f>>>0)+w;return(y<<m|y>>>32-m)+u},a._gg=function(c,u,l,d,f,m,w){var y=c+(u&d|l&~d)+(f>>>0)+w;return(y<<m|y>>>32-m)+u},a._hh=function(c,u,l,d,f,m,w){var y=c+(u^l^d)+(f>>>0)+w;return(y<<m|y>>>32-m)+u},a._ii=function(c,u,l,d,f,m,w){var y=c+(l^(u|~d))+(f>>>0)+w;return(y<<m|y>>>32-m)+u},a._blocksize=16,a._digestsize=16,e.exports=function(c,u){if(c==null)throw new Error("Illegal argument "+c);var l=r.wordsToBytes(a(c,u));return u&&u.asBytes?l:u&&u.asString?s.bytesToString(l):r.bytesToHex(l)}})()},285:(e,t,n)=>{var r=n(2);e.exports=function(b){return b?(b.substr(0,2)==="{}"&&(b="\\{\\}"+b.substr(2)),E(function(g){return g.split("\\\\").join(o).split("\\{").join(i).split("\\}").join(s).split("\\,").join(a).split("\\.").join(c)}(b),!0).map(l)):[]};var o="\0SLASH"+Math.random()+"\0",i="\0OPEN"+Math.random()+"\0",s="\0CLOSE"+Math.random()+"\0",a="\0COMMA"+Math.random()+"\0",c="\0PERIOD"+Math.random()+"\0";function u(b){return parseInt(b,10)==b?parseInt(b,10):b.charCodeAt(0)}function l(b){return b.split(o).join("\\").split(i).join("{").split(s).join("}").split(a).join(",").split(c).join(".")}function d(b){if(!b)return[""];var g=[],v=r("{","}",b);if(!v)return b.split(",");var h=v.pre,S=v.body,T=v.post,I=h.split(",");I[I.length-1]+="{"+S+"}";var _=d(T);return T.length&&(I[I.length-1]+=_.shift(),I.push.apply(I,_)),g.push.apply(g,I),g}function f(b){return"{"+b+"}"}function m(b){return/^-?0\d/.test(b)}function w(b,g){return b<=g}function y(b,g){return b>=g}function E(b,g){var v=[],h=r("{","}",b);if(!h)return[b];var S=h.pre,T=h.post.length?E(h.post,!1):[""];if(/\$$/.test(h.pre))for(var I=0;I<T.length;I++){var _=S+"{"+h.body+"}"+T[I];v.push(_)}else{var A,$,D=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(h.body),N=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(h.body),x=D||N,V=h.body.indexOf(",")>=0;if(!x&&!V)return h.post.match(/,.*\}/)?E(b=h.pre+"{"+h.body+s+h.post):[b];if(x)A=h.body.split(/\.\./);else if((A=d(h.body)).length===1&&(A=E(A[0],!1).map(f)).length===1)return T.map(function(H){return h.pre+A[0]+H});if(x){var G=u(A[0]),ae=u(A[1]),ye=Math.max(A[0].length,A[1].length),ue=A.length==3?Math.abs(u(A[2])):1,te=w;ae<G&&(ue*=-1,te=y);var ce=A.some(m);$=[];for(var oe=G;te(oe,ae);oe+=ue){var J;if(N)(J=String.fromCharCode(oe))==="\\"&&(J="");else if(J=String(oe),ce){var ne=ye-J.length;if(ne>0){var se=new Array(ne+1).join("0");J=oe<0?"-"+se+J.slice(1):se+J}}$.push(J)}}else{$=[];for(var Re=0;Re<A.length;Re++)$.push.apply($,E(A[Re],!1))}for(Re=0;Re<$.length;Re++)for(I=0;I<T.length;I++)_=S+$[Re]+T[I],(!g||x||_)&&v.push(_)}return v}},829:e=>{function t(u){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},t(u)}function n(u){var l=typeof Map=="function"?new Map:void 0;return n=function(d){if(d===null||(f=d,Function.toString.call(f).indexOf("[native code]")===-1))return d;var f;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(l!==void 0){if(l.has(d))return l.get(d);l.set(d,m)}function m(){return r(d,arguments,i(this).constructor)}return m.prototype=Object.create(d.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),o(m,d)},n(u)}function r(u,l,d){return r=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}()?Reflect.construct:function(f,m,w){var y=[null];y.push.apply(y,m);var E=new(Function.bind.apply(f,y));return w&&o(E,w.prototype),E},r.apply(null,arguments)}function o(u,l){return o=Object.setPrototypeOf||function(d,f){return d.__proto__=f,d},o(u,l)}function i(u){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},i(u)}var s=function(u){function l(d){var f;return function(m,w){if(!(m instanceof w))throw new TypeError("Cannot call a class as a function")}(this,l),(f=function(m,w){return!w||t(w)!=="object"&&typeof w!="function"?function(y){if(y===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y}(m):w}(this,i(l).call(this,d))).name="ObjectPrototypeMutationError",f}return function(d,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(f&&f.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),f&&o(d,f)}(l,u),l}(n(Error));function a(u,l){for(var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},f=l.split("."),m=f.length,w=function(b){var g=f[b];if(!u)return{v:void 0};if(g==="+"){if(Array.isArray(u))return{v:u.map(function(h,S){var T=f.slice(b+1);return T.length>0?a(h,T.join("."),d):d(u,S,f,b)})};var v=f.slice(0,b).join(".");throw new Error("Object at wildcard (".concat(v,") is not an array"))}u=d(u,g,f,b)},y=0;y<m;y++){var E=w(y);if(t(E)==="object")return E.v}return u}function c(u,l){return u.length===l+1}e.exports={set:function(u,l,d){if(t(u)!="object"||u===null||l===void 0)return u;if(typeof l=="number")return u[l]=d,u[l];try{return a(u,l,function(f,m,w,y){if(f===Reflect.getPrototypeOf({}))throw new s("Attempting to mutate Object.prototype");if(!f[m]){var E=Number.isInteger(Number(w[y+1])),b=w[y+1]==="+";f[m]=E||b?[]:{}}return c(w,y)&&(f[m]=d),f[m]})}catch(f){if(f instanceof s)throw f;return u}},get:function(u,l){if(t(u)!="object"||u===null||l===void 0)return u;if(typeof l=="number")return u[l];try{return a(u,l,function(d,f){return d[f]})}catch{return u}},has:function(u,l){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t(u)!="object"||u===null||l===void 0)return!1;if(typeof l=="number")return l in u;try{var f=!1;return a(u,l,function(m,w,y,E){if(!c(y,E))return m&&m[w];f=d.own?m.hasOwnProperty(w):w in m}),f}catch{return!1}},hasOwn:function(u,l,d){return this.has(u,l,d||{own:!0})},isIn:function(u,l,d){var f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(u)!="object"||u===null||l===void 0)return!1;try{var m=!1,w=!1;return a(u,l,function(y,E,b,g){return m=m||y===d||!!y&&y[E]===d,w=c(b,g)&&t(y)==="object"&&E in y,y&&y[E]}),f.validPath?m&&w:m}catch{return!1}},ObjectPrototypeMutationError:s}},47:(e,t,n)=>{var r=n(410),o=function(u){return typeof u=="string"};function i(u,l){for(var d=[],f=0;f<u.length;f++){var m=u[f];m&&m!=="."&&(m===".."?d.length&&d[d.length-1]!==".."?d.pop():l&&d.push(".."):d.push(m))}return d}var s=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a={};function c(u){return s.exec(u).slice(1)}a.resolve=function(){for(var u="",l=!1,d=arguments.length-1;d>=-1&&!l;d--){var f=d>=0?arguments[d]:ve.cwd();if(!o(f))throw new TypeError("Arguments to path.resolve must be strings");f&&(u=f+"/"+u,l=f.charAt(0)==="/")}return(l?"/":"")+(u=i(u.split("/"),!l).join("/"))||"."},a.normalize=function(u){var l=a.isAbsolute(u),d=u.substr(-1)==="/";return(u=i(u.split("/"),!l).join("/"))||l||(u="."),u&&d&&(u+="/"),(l?"/":"")+u},a.isAbsolute=function(u){return u.charAt(0)==="/"},a.join=function(){for(var u="",l=0;l<arguments.length;l++){var d=arguments[l];if(!o(d))throw new TypeError("Arguments to path.join must be strings");d&&(u+=u?"/"+d:d)}return a.normalize(u)},a.relative=function(u,l){function d(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),l=a.resolve(l).substr(1);for(var f=d(u.split("/")),m=d(l.split("/")),w=Math.min(f.length,m.length),y=w,E=0;E<w;E++)if(f[E]!==m[E]){y=E;break}var b=[];for(E=y;E<f.length;E++)b.push("..");return(b=b.concat(m.slice(y))).join("/")},a._makeLong=function(u){return u},a.dirname=function(u){var l=c(u),d=l[0],f=l[1];return d||f?(f&&(f=f.substr(0,f.length-1)),d+f):"."},a.basename=function(u,l){var d=c(u)[2];return l&&d.substr(-1*l.length)===l&&(d=d.substr(0,d.length-l.length)),d},a.extname=function(u){return c(u)[3]},a.format=function(u){if(!r.isObject(u))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof u);var l=u.root||"";if(!o(l))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(!o(u))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof u);var l=c(u);if(!l||l.length!==4)throw new TypeError("Invalid path '"+u+"'");return l[1]=l[1]||"",l[2]=l[2]||"",l[3]=l[3]||"",{root:l[0],dir:l[0]+l[1].slice(0,l[1].length-1),base:l[2],ext:l[3],name:l[2].slice(0,l[2].length-l[3].length)}},a.sep="/",a.delimiter=":",e.exports=a},647:(e,t)=>{var n=Object.prototype.hasOwnProperty;function r(i){try{return decodeURIComponent(i.replace(/\+/g," "))}catch{return null}}function o(i){try{return encodeURIComponent(i)}catch{return null}}t.stringify=function(i,s){s=s||"";var a,c,u=[];for(c in typeof s!="string"&&(s="?"),i)if(n.call(i,c)){if((a=i[c])||a!=null&&!isNaN(a)||(a=""),c=o(c),a=o(a),c===null||a===null)continue;u.push(c+"="+a)}return u.length?s+u.join("&"):""},t.parse=function(i){for(var s,a=/([^=?#&]+)=?([^&]*)/g,c={};s=a.exec(i);){var u=r(s[1]),l=r(s[2]);u===null||l===null||u in c||(c[u]=l)}return c}},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(o){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(i=Object.assign({},r,i),!o||typeof o!="string")return o;let s=o.trim();if(i.skipLike!==void 0&&i.skipLike.test(s))return o;if(i.hex&&t.test(s))return Number.parseInt(s,16);{const c=n.exec(s);if(c){const u=c[1],l=c[2];let d=((a=c[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 f=c[4]||c[6];if(!i.leadingZeros&&l.length>0&&u&&s[2]!=="."||!i.leadingZeros&&l.length>0&&!u&&s[1]!==".")return o;{const m=Number(s),w=""+m;return w.search(/[eE]/)!==-1||f?i.eNotation?m:o:s.indexOf(".")!==-1?w==="0"&&d===""||w===d||u&&w==="-"+d?m:o:l?d===w||u+d===w?m:o:s===w||s===u+w?m:o}}return o}var a}},737:(e,t,n)=>{var r=n(670),o=n(647),i=/^[\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+-.]*:\/\//,c=/:\d+$/,u=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,l=/^[a-zA-Z]:/;function d(g){return(g||"").toString().replace(i,"")}var f=[["#","hash"],["?","query"],function(g,v){return y(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 w(g){var v,h=(typeof window<"u"?window:typeof Dr<"u"?Dr:typeof self<"u"?self:{}).location||{},S={},T=typeof(g=g||h);if(g.protocol==="blob:")S=new b(unescape(g.pathname),{});else if(T==="string")for(v in S=new b(g,{}),m)delete S[v];else if(T==="object"){for(v in g)v in m||(S[v]=g[v]);S.slashes===void 0&&(S.slashes=a.test(g.href))}return S}function y(g){return g==="file:"||g==="ftp:"||g==="http:"||g==="https:"||g==="ws:"||g==="wss:"}function E(g,v){g=(g=d(g)).replace(s,""),v=v||{};var h,S=u.exec(g),T=S[1]?S[1].toLowerCase():"",I=!!S[2],_=!!S[3],A=0;return I?_?(h=S[2]+S[3]+S[4],A=S[2].length+S[3].length):(h=S[2]+S[4],A=S[2].length):_?(h=S[3]+S[4],A=S[3].length):h=S[4],T==="file:"?A>=2&&(h=h.slice(2)):y(T)?h=S[4]:T?I&&(h=h.slice(2)):A>=2&&y(v.protocol)&&(h=S[4]),{protocol:T,slashes:I||y(T),slashesCount:A,rest:h}}function b(g,v,h){if(g=(g=d(g)).replace(s,""),!(this instanceof b))return new b(g,v,h);var S,T,I,_,A,$,D=f.slice(),N=typeof v,x=this,V=0;for(N!=="object"&&N!=="string"&&(h=v,v=null),h&&typeof h!="function"&&(h=o.parse),S=!(T=E(g||"",v=w(v))).protocol&&!T.slashes,x.slashes=T.slashes||S&&v.slashes,x.protocol=T.protocol||v.protocol||"",g=T.rest,(T.protocol==="file:"&&(T.slashesCount!==2||l.test(g))||!T.slashes&&(T.protocol||T.slashesCount<2||!y(x.protocol)))&&(D[3]=[/(.*)/,"pathname"]);V<D.length;V++)typeof(_=D[V])!="function"?(I=_[0],$=_[1],I!=I?x[$]=g:typeof I=="string"?~(A=I==="@"?g.lastIndexOf(I):g.indexOf(I))&&(typeof _[2]=="number"?(x[$]=g.slice(0,A),g=g.slice(A+_[2])):(x[$]=g.slice(A),g=g.slice(0,A))):(A=I.exec(g))&&(x[$]=A[1],g=g.slice(0,A.index)),x[$]=x[$]||S&&_[3]&&v[$]||"",_[4]&&(x[$]=x[$].toLowerCase())):g=_(g,x);h&&(x.query=h(x.query)),S&&v.slashes&&x.pathname.charAt(0)!=="/"&&(x.pathname!==""||v.pathname!=="")&&(x.pathname=function(G,ae){if(G==="")return ae;for(var ye=(ae||"/").split("/").slice(0,-1).concat(G.split("/")),ue=ye.length,te=ye[ue-1],ce=!1,oe=0;ue--;)ye[ue]==="."?ye.splice(ue,1):ye[ue]===".."?(ye.splice(ue,1),oe++):oe&&(ue===0&&(ce=!0),ye.splice(ue,1),oe--);return ce&&ye.unshift(""),te!=="."&&te!==".."||ye.push(""),ye.join("/")}(x.pathname,v.pathname)),x.pathname.charAt(0)!=="/"&&y(x.protocol)&&(x.pathname="/"+x.pathname),r(x.port,x.protocol)||(x.host=x.hostname,x.port=""),x.username=x.password="",x.auth&&(~(A=x.auth.indexOf(":"))?(x.username=x.auth.slice(0,A),x.username=encodeURIComponent(decodeURIComponent(x.username)),x.password=x.auth.slice(A+1),x.password=encodeURIComponent(decodeURIComponent(x.password))):x.username=encodeURIComponent(decodeURIComponent(x.auth)),x.auth=x.password?x.username+":"+x.password:x.username),x.origin=x.protocol!=="file:"&&y(x.protocol)&&x.host?x.protocol+"//"+x.host:"null",x.href=x.toString()}b.prototype={set:function(g,v,h){var S=this;switch(g){case"query":typeof v=="string"&&v.length&&(v=(h||o.parse)(v)),S[g]=v;break;case"port":S[g]=v,r(v,S.protocol)?v&&(S.host=S.hostname+":"+v):(S.host=S.hostname,S[g]="");break;case"hostname":S[g]=v,S.port&&(v+=":"+S.port),S.host=v;break;case"host":S[g]=v,c.test(v)?(v=v.split(":"),S.port=v.pop(),S.hostname=v.join(":")):(S.hostname=v,S.port="");break;case"protocol":S.protocol=v.toLowerCase(),S.slashes=!h;break;case"pathname":case"hash":if(v){var T=g==="pathname"?"/":"#";S[g]=v.charAt(0)!==T?T+v:v}else S[g]=v;break;case"username":case"password":S[g]=encodeURIComponent(v);break;case"auth":var I=v.indexOf(":");~I?(S.username=v.slice(0,I),S.username=encodeURIComponent(decodeURIComponent(S.username)),S.password=v.slice(I+1),S.password=encodeURIComponent(decodeURIComponent(S.password))):S.username=encodeURIComponent(decodeURIComponent(v))}for(var _=0;_<f.length;_++){var A=f[_];A[4]&&(S[A[1]]=S[A[1]].toLowerCase())}return S.auth=S.password?S.username+":"+S.password:S.username,S.origin=S.protocol!=="file:"&&y(S.protocol)&&S.host?S.protocol+"//"+S.host:"null",S.href=S.toString(),S},toString:function(g){g&&typeof g=="function"||(g=o.stringify);var v,h=this,S=h.host,T=h.protocol;T&&T.charAt(T.length-1)!==":"&&(T+=":");var I=T+(h.protocol&&h.slashes||y(h.protocol)?"//":"");return h.username?(I+=h.username,h.password&&(I+=":"+h.password),I+="@"):h.password?(I+=":"+h.password,I+="@"):h.protocol!=="file:"&&y(h.protocol)&&!S&&h.pathname!=="/"&&(I+="@"),(S[S.length-1]===":"||c.test(h.hostname)&&!h.port)&&(S+=":"),I+=S+h.pathname,(v=typeof h.query=="object"?g(h.query):h.query)&&(I+=v.charAt(0)!=="?"?"?"+v:v),h.hash&&(I+=h.hash),I}},b.extractProtocol=E,b.location=w,b.trimLeft=d,b.qs=o,e.exports=b},410:()=>{},388:()=>{},805:()=>{},345:()=>{},800:()=>{}},Xm={};function mt(e){var t=Xm[e];if(t!==void 0)return t.exports;var n=Xm[e]={id:e,loaded:!1,exports:{}};return _R[e].call(n.exports,n,n.exports,mt),n.loaded=!0,n.exports}mt.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return mt.d(t,{a:t}),t},mt.d=(e,t)=>{for(var n in t)mt.o(t,n)&&!mt.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},mt.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),mt.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var Ln={};mt.d(Ln,{hT:()=>bn,O4:()=>wr,Kd:()=>$R,YK:()=>DR,UU:()=>q_,Gu:()=>ay,ky:()=>Ty,h4:()=>So,ch:()=>Bs,hq:()=>ri,i5:()=>Ay});var IR=mt(737),CR=mt.n(IR);function Mu(e){if(!Bu(e))throw new Error("Parameter was not an error")}function Bu(e){return!!e&&typeof e=="object"&&(t=e,Object.prototype.toString.call(t)==="[object Error]")||e instanceof Error;var t}class yn extends Error{constructor(t,n){const r=[...arguments],{options:o,shortMessage:i}=function(a){let c,u="";if(a.length===0)c={};else if(Bu(a[0]))c={cause:a[0]},u=a.slice(1).join(" ")||"";else if(a[0]&&typeof a[0]=="object")c=Object.assign({},a[0]),u=a.slice(1).join(" ")||"";else{if(typeof a[0]!="string")throw new Error("Invalid arguments passed to Layerr");c={},u=u=a.join(" ")||""}return{options:c,shortMessage:u}}(r);let s=i;if(o.cause&&(s=`${s}: ${o.cause.message}`),super(s),this.message=s,o.name&&typeof o.name=="string"?this.name=o.name:this.name="Layerr",o.cause&&Object.defineProperty(this,"_cause",{value:o.cause}),Object.defineProperty(this,"_info",{value:{}}),o.info&&typeof o.info=="object"&&Object.assign(this._info,o.info),Error.captureStackTrace){const a=o.constructorOpt||this.constructor;Error.captureStackTrace(this,a)}}static cause(t){return Mu(t),t._cause&&Bu(t._cause)?t._cause:null}static fullStack(t){Mu(t);const n=yn.cause(t);return n?`${t.stack}
42
- caused by: ${yn.fullStack(n)}`:t.stack??""}static info(t){Mu(t);const n={},r=yn.cause(t);return r&&Object.assign(n,yn.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 PR=mt(47),Os=mt.n(PR);const Ym="__PATH_SEPARATOR_POSIX__",Jm="__PATH_SEPARATOR_WINDOWS__";function kt(e){try{const t=e.replace(/\//g,Ym).replace(/\\\\/g,Jm);return encodeURIComponent(t).split(Jm).join("\\\\").split(Ym).join("/")}catch(t){throw new yn(t,"Failed encoding path")}}function Zm(e){return e.startsWith("/")?e:"/"+e}function yo(e){let t=e;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function FR(e){let t=new(CR())(e).pathname;return t.length<=0&&(t="/"),yo(t)}function xt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){return function(r){var o=[];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 i=r.shift();r[0]=i+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(/[\/]+$/,"/"),o.push(a))}var c=o.join("/"),u=(c=c.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return u.shift()+(u.length>0?"?":"")+u.join("&")}(typeof arguments[0]=="object"?arguments[0]:[].slice.call(arguments))}(t.reduce((r,o,i)=>((i===0||o!=="/"||o==="/"&&r[r.length-1]!=="/")&&r.push(o),r),[]))}var OR=mt(542),bo=mt.n(OR);const kR="abcdef0123456789";function ey(e,t){const n=e.url.replace("//",""),r=n.indexOf("/")==-1?"/":n.slice(n.indexOf("/")),o=e.method?e.method.toUpperCase():"GET",i=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&"auth",s=`00000000${t.nc}`.slice(-8),a=function(f,m,w,y,E,b,g){const v=g||bo()(`${m}:${w}:${y}`);return f&&f.toLowerCase()==="md5-sess"?bo()(`${v}:${E}:${b}`):v}(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),c=bo()(`${o}:${r}`),u=i?bo()(`${a}:${t.nonce}:${s}:${t.cnonce}:${i}:${c}`):bo()(`${a}:${t.nonce}:${c}`),l={username:t.username,realm:t.realm,nonce:t.nonce,uri:r,qop:i,response:u,nc:s,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},d=[];for(const f in l)l[f]&&(f==="qop"||f==="nc"||f==="algorithm"?d.push(`${f}=${l[f]}`):d.push(`${f}="${l[f]}"`));return`Digest ${d.join(", ")}`}function ty(e){return(e.headers&&e.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var xR=mt(101),ny=mt.n(xR);function ry(e){return ny().decode(e)}function iy(e,t){var n;return`Basic ${n=`${e}:${t}`,ny().encode(n)}`}const ks=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,NR=ks.fetch.bind(ks),$R=ks.Request,DR=ks.Response;let bn=function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e}({}),wr=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 oy(e,t,n,r,o){switch(e.authType){case bn.Auto:t&&n&&(e.headers.Authorization=iy(t,n));break;case bn.Digest:e.digest=function(s,a,c){return{username:s,password:a,ha1:c,nc:0,algorithm:"md5",hasDigestAuth:!1}}(t,n,o);break;case bn.None:break;case bn.Password:e.headers.Authorization=iy(t,n);break;case bn.Token:e.headers.Authorization=`${(i=r).token_type} ${i.access_token}`;break;default:throw new yn({info:{code:wr.InvalidAuthType}},`Invalid auth type: ${e.authType}`)}var i}mt(345),mt(800);const sy="@@HOTPATCHER",LR=()=>{};function ju(e){return{original:e,methods:[e],final:!1}}class MR{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=sy}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__!==sy)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)||LR;for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return n(...o)}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,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];if(o.length===0)throw new Error("Failed creating sequence: No functions provided");return function(){for(var s=arguments.length,a=new Array(s),c=0;c<s;c++)a[c]=arguments[c];let u=a;const l=this;for(;o.length>0;)u=[o.shift().apply(l,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:o=!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(o)this.configuration.registry[t]?this.configuration.registry[t].methods.push(n):this.configuration.registry[t]=ju(n);else if(this.isPatched(t)){const{original:i}=this.configuration.registry[t];this.configuration.registry[t]=Object.assign(ju(n),{original:i})}else this.configuration.registry[t]=ju(n);return this}patchInline(t,n){this.isPatched(t)||this.patch(t,n);for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];return this.execute(t,...o)}plugin(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.forEach(i=>{this.patch(t,i,{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 Uu=null;function ay(){return Uu||(Uu=new MR),Uu}function xs(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 ly(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];let r=null,o=[...t];for(;o.length>0;){const i=o.shift();r=r?cy(r,i):xs(i)}return r}function cy(e,t){const n=xs(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]?cy(n[r],t[r]):xs(t[r]):n[r]=t[r]:n[r]=t[r]}),n}function BR(e){const t={};for(const n of e.keys())t[n]=e.get(n);return t}function qu(){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((o,i)=>(Object.keys(i).forEach(s=>{const a=s.toLowerCase();r.hasOwnProperty(a)?o[r[a]]=i[s]:(r[a]=s,o[s]=i[s])}),o),{})}mt(805);const jR=typeof ArrayBuffer=="function",{toString:UR}=Object.prototype;function uy(e){return jR&&(e instanceof ArrayBuffer||UR.call(e)==="[object ArrayBuffer]")}function fy(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function Vu(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 zu(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const dy=Vu(function(e){const t=e._digest;return delete e._digest,t.hasDigestAuth&&(e=ly(e,{headers:{Authorization:ey(e,t)}})),zu(Ns(e),function(n){let r=!1;return o=function(s){return r?s:n},(i=function(){if(n.status==401)return t.hasDigestAuth=function(s,a){if(!ty(s))return!1;const c=/([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;for(;;){const u=s.headers&&s.headers.get("www-authenticate")||"",l=c.exec(u);if(!l)break;a[l[1]]=l[2]||l[3]}return a.nc+=1,a.cnonce=function(){let u="";for(let l=0;l<32;++l)u=`${u}${kR[Math.floor(16*Math.random())]}`;return u}(),!0}(n,t),function(){if(t.hasDigestAuth)return zu(Ns(e=ly(e,{headers:{Authorization:ey(e,t)}})),function(s){return s.status==401?t.hasDigestAuth=!1:t.nc++,r=!0,s})}();t.nc++}())&&i.then?i.then(o):o(i);var o,i})}),qR=Vu(function(e,t){return zu(Ns(e),function(n){return n.ok?(t.authType=bn.Password,n):n.status==401&&ty(n)?(t.authType=bn.Digest,oy(t,t.username,t.password,void 0,void 0),e._digest=t.digest,dy(e)):n})}),Qt=Vu(function(e,t){return t.authType===bn.Auto?qR(e,t):e._digest?dy(e):Ns(e)});function Xt(e,t,n){const r=xs(e);return r.headers=qu(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 Ns(e){const t=ay();return t.patchInline("request",n=>t.patchInline("fetch",NR,n.url,function(r){let o={};const i={method:r.method};if(r.headers&&(o=qu(o,r.headers)),r.data!==void 0){const[s,a]=function(c){if(typeof c=="string")return[c,{}];if(fy(c))return[c,{}];if(uy(c))return[c,{}];if(c&&typeof c=="object")return[JSON.stringify(c),{"content-type":"application/json"}];throw new Error("Unable to convert request body: Unexpected body type: "+typeof c)}(r.data);i.body=s,o=qu(o,a)}return r.signal&&(i.signal=r.signal),r.withCredentials&&(i.credentials="include"),i.headers=o,i}(n)),e)}var VR=mt(285);const $s=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},zR={"[: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]},vo=e=>e.replace(/[[\]\\-]/g,"\\$&"),py=e=>e.join(""),WR=(e,t)=>{const n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");const r=[],o=[];let i=n+1,s=!1,a=!1,c=!1,u=!1,l=n,d="";e:for(;i<e.length;){const y=e.charAt(i);if(y!=="!"&&y!=="^"||i!==n+1){if(y==="]"&&s&&!c){l=i+1;break}if(s=!0,y!=="\\"||c){if(y==="["&&!c){for(const[E,[b,g,v]]of Object.entries(zR))if(e.startsWith(E,i)){if(d)return["$.",!1,e.length-n,!0];i+=E.length,v?o.push(b):r.push(b),a=a||g;continue e}}c=!1,d?(y>d?r.push(vo(d)+"-"+vo(y)):y===d&&r.push(vo(y)),d="",i++):e.startsWith("-]",i+1)?(r.push(vo(y+"-")),i+=2):e.startsWith("-",i+1)?(d=y,i+=2):(r.push(vo(y)),i++)}else c=!0,i++}else u=!0,i++}if(l<i)return["",!1,0,!1];if(!r.length&&!o.length)return["$.",!1,e.length-n,!0];if(o.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u)return[(f=r[0].length===2?r[0].slice(-1):r[0],f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,l-n,!1];var f;const m="["+(u?"^":"")+py(r)+"]",w="["+(u?"":"^")+py(o)+"]";return[r.length&&o.length?"("+m+"|"+w+")":r.length?m:w,a,l-n,!0]},wo=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")},HR=new Set(["!","?","+","*","@"]),hy=e=>HR.has(e),Wu="(?!\\.)",GR=new Set(["[","."]),KR=new Set(["..","."]),QR=new Set("().*{}+?[]^$\\!"),Hu="[^/]",gy=Hu+"*?",my=Hu+"+?",Sn=class Sn{constructor(t,n){Rn(this,mi);Ee(this,"type");Rn(this,Zt);Rn(this,nn);Rn(this,Pr,!1);Rn(this,Pt,[]);Rn(this,Wt);Rn(this,Br);Rn(this,hi);Rn(this,jr,!1);Rn(this,sr);Rn(this,gi);Rn(this,Do,!1);let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&Ut(this,nn,!0),Ut(this,Wt,n),Ut(this,Zt,Oe(this,Wt)?Oe(Oe(this,Wt),Zt):this),Ut(this,sr,Oe(this,Zt)===this?r:Oe(Oe(this,Zt),sr)),Ut(this,hi,Oe(this,Zt)===this?[]:Oe(Oe(this,Zt),hi)),t!=="!"||Oe(Oe(this,Zt),jr)||Oe(this,hi).push(this),Ut(this,Br,Oe(this,Wt)?Oe(Oe(this,Wt),Pt).length:0)}get hasMagic(){if(Oe(this,nn)!==void 0)return Oe(this,nn);for(const t of Oe(this,Pt))if(typeof t!="string"&&(t.type||t.hasMagic))return Ut(this,nn,!0);return Oe(this,nn)}toString(){return Oe(this,gi)!==void 0?Oe(this,gi):this.type?Ut(this,gi,this.type+"("+Oe(this,Pt).map(t=>String(t)).join("|")+")"):Ut(this,gi,Oe(this,Pt).map(t=>String(t)).join(""))}push(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(const o of n)if(o!==""){if(typeof o!="string"&&!(o instanceof Sn&&Oe(o,Wt)===this))throw new Error("invalid part: "+o);Oe(this,Pt).push(o)}}toJSON(){var n;const t=this.type===null?Oe(this,Pt).slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...Oe(this,Pt).map(r=>r.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===Oe(this,Zt)||Oe(Oe(this,Zt),jr)&&((n=Oe(this,Wt))==null?void 0:n.type)==="!")&&t.push({}),t}isStart(){var n;if(Oe(this,Zt)===this)return!0;if(!((n=Oe(this,Wt))!=null&&n.isStart()))return!1;if(Oe(this,Br)===0)return!0;const t=Oe(this,Wt);for(let r=0;r<Oe(this,Br);r++){const o=Oe(t,Pt)[r];if(!(o instanceof Sn&&o.type==="!"))return!1}return!0}isEnd(){var n,r,o;if(Oe(this,Zt)===this||((n=Oe(this,Wt))==null?void 0:n.type)==="!")return!0;if(!((r=Oe(this,Wt))!=null&&r.isEnd()))return!1;if(!this.type)return(o=Oe(this,Wt))==null?void 0:o.isEnd();const t=Oe(this,Wt)?Oe(Oe(this,Wt),Pt).length:0;return Oe(this,Br)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const n=new Sn(this.type,t);for(const r of Oe(this,Pt))n.copyIn(r);return n}static fromGlob(t){var o;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=new Sn(null,void 0,n);return qr(o=Sn,Ur,Aa).call(o,t,r,0,n),r}toMMPattern(){if(this!==Oe(this,Zt))return Oe(this,Zt).toMMPattern();const t=this.toString(),[n,r,o,i]=this.toRegExpSource();if(!(o||Oe(this,nn)||Oe(this,sr).nocase&&!Oe(this,sr).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;const s=(Oe(this,sr).nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${n}$`,s),{_src:n,_glob:t})}get options(){return Oe(this,sr)}toRegExpSource(t){var c;const n=t??!!Oe(this,sr).dot;if(Oe(this,Zt)===this&&qr(this,mi,G0).call(this),!this.type){const u=this.isStart()&&this.isEnd(),l=Oe(this,Pt).map(m=>{var g;const[w,y,E,b]=typeof m=="string"?qr(g=Sn,Ur,K0).call(g,m,Oe(this,nn),u):m.toRegExpSource(t);return Ut(this,nn,Oe(this,nn)||E),Ut(this,Pr,Oe(this,Pr)||b),w}).join("");let d="";if(this.isStart()&&typeof Oe(this,Pt)[0]=="string"&&(Oe(this,Pt).length!==1||!KR.has(Oe(this,Pt)[0]))){const m=GR,w=n&&m.has(l.charAt(0))||l.startsWith("\\.")&&m.has(l.charAt(2))||l.startsWith("\\.\\.")&&m.has(l.charAt(4)),y=!n&&!t&&m.has(l.charAt(0));d=w?"(?!(?:^|/)\\.\\.?(?:$|/))":y?Wu:""}let f="";return this.isEnd()&&Oe(Oe(this,Zt),jr)&&((c=Oe(this,Wt))==null?void 0:c.type)==="!"&&(f="(?:$|\\/)"),[d+l+f,wo(l),Ut(this,nn,!!Oe(this,nn)),Oe(this,Pr)]}const r=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:";let i=qr(this,mi,fd).call(this,n);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){const u=this.toString();return Ut(this,Pt,[u]),this.type=null,Ut(this,nn,void 0),[u,wo(this.toString()),!1,!1]}let s=!r||t||n?"":qr(this,mi,fd).call(this,!0);s===i&&(s=""),s&&(i=`(?:${i})(?:${s})*?`);let a="";return a=this.type==="!"&&Oe(this,Do)?(this.isStart()&&!n?Wu:"")+my:o+i+(this.type==="!"?"))"+(!this.isStart()||n||t?"":Wu)+gy+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`),[a,wo(i),Ut(this,nn,!!Oe(this,nn)),Oe(this,Pr)]}};Zt=new WeakMap,nn=new WeakMap,Pr=new WeakMap,Pt=new WeakMap,Wt=new WeakMap,Br=new WeakMap,hi=new WeakMap,jr=new WeakMap,sr=new WeakMap,gi=new WeakMap,Do=new WeakMap,mi=new WeakSet,G0=function(){if(this!==Oe(this,Zt))throw new Error("should only call on root");if(Oe(this,jr))return this;let t;for(this.toString(),Ut(this,jr,!0);t=Oe(this,hi).pop();){if(t.type!=="!")continue;let n=t,r=Oe(n,Wt);for(;r;){for(let o=Oe(n,Br)+1;!r.type&&o<Oe(r,Pt).length;o++)for(const i of Oe(t,Pt)){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(Oe(r,Pt)[o])}n=r,r=Oe(n,Wt)}}return this},Ur=new WeakSet,Aa=function(t,n,r,o){var m,w;let i=!1,s=!1,a=-1,c=!1;if(n.type===null){let y=r,E="";for(;y<t.length;){const b=t.charAt(y++);if(i||b==="\\")i=!i,E+=b;else if(s)y===a+1?b!=="^"&&b!=="!"||(c=!0):b!=="]"||y===a+2&&c||(s=!1),E+=b;else if(b!=="[")if(o.noext||!hy(b)||t.charAt(y)!=="(")E+=b;else{n.push(E),E="";const g=new Sn(b,n);y=qr(m=Sn,Ur,Aa).call(m,t,g,y,o),n.push(g)}else s=!0,a=y,c=!1,E+=b}return n.push(E),y}let u=r+1,l=new Sn(null,n);const d=[];let f="";for(;u<t.length;){const y=t.charAt(u++);if(i||y==="\\")i=!i,f+=y;else if(s)u===a+1?y!=="^"&&y!=="!"||(c=!0):y!=="]"||u===a+2&&c||(s=!1),f+=y;else if(y!=="[")if(hy(y)&&t.charAt(u)==="("){l.push(f),f="";const E=new Sn(y,l);l.push(E),u=qr(w=Sn,Ur,Aa).call(w,t,E,u,o)}else if(y!=="|"){if(y===")")return f===""&&Oe(n,Pt).length===0&&Ut(n,Do,!0),l.push(f),f="",n.push(...d,l),u;f+=y}else l.push(f),f="",d.push(l),l=new Sn(null,n);else s=!0,a=u,c=!1,f+=y}return n.type=null,Ut(n,nn,void 0),Ut(n,Pt,[t.substring(r-1)]),u},fd=function(t){return Oe(this,Pt).map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");const[r,o,i,s]=n.toRegExpSource(t);return Ut(this,Pr,Oe(this,Pr)||s),r}).filter(n=>!(this.isStart()&&this.isEnd()&&!n)).join("|")},K0=function(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=!1,i="",s=!1;for(let a=0;a<t.length;a++){const c=t.charAt(a);if(o)o=!1,i+=(QR.has(c)?"\\":"")+c;else if(c!=="\\"){if(c==="["){const[u,l,d,f]=WR(t,a);if(d){i+=u,s=s||l,a+=d-1,n=n||f;continue}}c!=="*"?c!=="?"?i+=c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(i+=Hu,n=!0):(i+=r&&t==="*"?my:gy,n=!0)}else a===t.length-1?i+="\\\\":o=!0}return[i,wo(t),!!n,s]},Rn(Sn,Ur);let Ds=Sn;const cn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return $s(t),!(!n.nocomment&&t.charAt(0)==="#")&&new Ls(t,n).match(e)},XR=/^\*+([^+@!?\*\[\(]*)$/,YR=e=>t=>!t.startsWith(".")&&t.endsWith(e),JR=e=>t=>t.endsWith(e),ZR=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),e_=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),t_=/^\*+\.\*+$/,n_=e=>!e.startsWith(".")&&e.includes("."),r_=e=>e!=="."&&e!==".."&&e.includes("."),i_=/^\.\*+$/,o_=e=>e!=="."&&e!==".."&&e.startsWith("."),s_=/^\*+$/,a_=e=>e.length!==0&&!e.startsWith("."),l_=e=>e.length!==0&&e!=="."&&e!=="..",c_=/^\?+([^+@!?\*\[\(]*)?$/,u_=e=>{let[t,n=""]=e;const r=yy([t]);return n?(n=n.toLowerCase(),o=>r(o)&&o.toLowerCase().endsWith(n)):r},f_=e=>{let[t,n=""]=e;const r=by([t]);return n?(n=n.toLowerCase(),o=>r(o)&&o.toLowerCase().endsWith(n)):r},d_=e=>{let[t,n=""]=e;const r=by([t]);return n?o=>r(o)&&o.endsWith(n):r},p_=e=>{let[t,n=""]=e;const r=yy([t]);return n?o=>r(o)&&o.endsWith(n):r},yy=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&!r.startsWith(".")},by=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&r!=="."&&r!==".."},vy=typeof ve=="object"&&ve?typeof ve.env=="object"&&ve.env&&ve.env.__MINIMATCH_TESTING_PLATFORM__||ve.platform:"posix";cn.sep=vy==="win32"?"\\":"/";const Mn=Symbol("globstar **");cn.GLOBSTAR=Mn,cn.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>cn(n,e,t)};const Bn=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};cn.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return cn;const t=cn;return Object.assign(function(n,r){return t(n,r,Bn(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))},{Minimatch:class extends t.Minimatch{constructor(n){super(n,Bn(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(n){return t.defaults(Bn(e,n)).Minimatch}},AST:class extends t.AST{constructor(n,r){super(n,r,Bn(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,Bn(e,r))}},unescape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(n,Bn(e,r))},escape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(n,Bn(e,r))},filter:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(n,Bn(e,r))},defaults:n=>t.defaults(Bn(e,n)),makeRe:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(n,Bn(e,r))},braceExpand:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(n,Bn(e,r))},match:function(n,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(n,r,Bn(e,o))},sep:t.sep,GLOBSTAR:Mn})};const wy=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return $s(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:VR(e)};cn.braceExpand=wy,cn.makeRe=function(e){return new Ls(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},cn.match=function(e,t){const n=new Ls(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 Sy=/[?*]|[+@!]\(.*?\)|\[|\]/;class Ls{constructor(t){Ee(this,"options");Ee(this,"set");Ee(this,"pattern");Ee(this,"windowsPathsNoEscape");Ee(this,"nonegate");Ee(this,"negate");Ee(this,"comment");Ee(this,"empty");Ee(this,"preserveMultipleSlashes");Ee(this,"partial");Ee(this,"globSet");Ee(this,"globParts");Ee(this,"nocase");Ee(this,"isWindows");Ee(this,"platform");Ee(this,"windowsNoMagicRoot");Ee(this,"regexp");let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};$s(t),n=n||{},this.options=n,this.pattern=t,this.platform=n.platform||vy,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(i=>this.slashSplit(i));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let o=this.globParts.map((i,s,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){const c=!(i[0]!==""||i[1]!==""||i[2]!=="?"&&Sy.test(i[2])||Sy.test(i[3])),u=/^[a-z]:/i.test(i[0]);if(c)return[...i.slice(0,4),...i.slice(4).map(l=>this.parse(l))];if(u)return[i[0],...i.slice(1).map(l=>this.parse(l))]}return i.map(c=>this.parse(c))});if(this.debug(this.pattern,o),this.set=o.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){const s=this.set[i];s[0]===""&&s[1]===""&&this.globParts[i][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 o=0;o<t[r].length;o++)t[r][o]==="**"&&(t[r][o]="*");const{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=n>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let o=r;for(;n[o+1]==="**";)o++;o!==r&&n.splice(r,o-r)}return n})}levelOneOptimize(t){return t.map(n=>(n=n.reduce((r,o)=>{const i=r[r.length-1];return o==="**"&&i==="**"?r:o===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(r.pop(),r):(r.push(o),r)},[])).length===0?[""]:n)}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let o=1;o<t.length-1;o++){const i=t[o];o===1&&i===""&&t[0]===""||i!=="."&&i!==""||(n=!0,t.splice(o,1),o--)}t[0]!=="."||t.length!==2||t[1]!=="."&&t[1]!==""||(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){const o=t[r-1];o&&o!=="."&&o!==".."&&o!=="**"&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let o=-1;for(;(o=r.indexOf("**",o+1))!==-1;){let s=o;for(;r[s+1]==="**";)s++;s>o&&r.splice(o+1,s-o);let a=r[o+1];const c=r[o+2],u=r[o+3];if(a!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;n=!0,r.splice(o,1);const l=r.slice(0);l[o]="**",t.push(l),o--}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 i=0;for(;(i=r.indexOf("..",i+1))!==-1;){const s=r[i-1];if(s&&s!=="."&&s!==".."&&s!=="**"){n=!0;const a=i===1&&r[i+1]==="**"?["."]:[];r.splice(i-1,2,...a),r.length===0&&r.push(""),i-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){const o=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(o){t[n]=[],t[r]=o;break}}return t.filter(n=>n.length)}partsMatch(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=0,i=0,s=[],a="";for(;o<t.length&&i<n.length;)if(t[o]===n[i])s.push(a==="b"?n[i]:t[o]),o++,i++;else if(r&&t[o]==="**"&&n[i]===t[o+1])s.push(t[o]),o++;else if(r&&n[i]==="**"&&t[o]===n[i+1])s.push(n[i]),i++;else if(t[o]!=="*"||!n[i]||!this.options.dot&&n[i].startsWith(".")||n[i]==="**"){if(n[i]!=="*"||!t[o]||!this.options.dot&&t[o].startsWith(".")||t[o]==="**"||a==="a")return!1;a="b",s.push(n[i]),o++,i++}else{if(a==="b")return!1;a="a",s.push(t[o]),o++,i++}return t.length===n.length&&s}parseNegate(){if(this.nonegate)return;const t=this.pattern;let n=!1,r=0;for(let o=0;o<t.length&&t.charAt(o)==="!";o++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const o=this.options;if(this.isWindows){const y=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),E=!y&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),b=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),g=E?3:y?0:void 0,v=!b&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])?3:b?0:void 0;if(typeof g=="number"&&typeof v=="number"){const[h,S]=[t[g],n[v]];h.toLowerCase()===S.toLowerCase()&&(n[v]=h,v>g?n=n.slice(v):g>v&&(t=t.slice(g)))}}const{optimizationLevel:i=1}=this.options;i>=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,c=t.length,u=n.length;s<c&&a<u;s++,a++){this.debug("matchOne loop");var l=n[a],d=t[s];if(this.debug(n,l,d),l===!1)return!1;if(l===Mn){this.debug("GLOBSTAR",[n,l,d]);var f=s,m=a+1;if(m===u){for(this.debug("** at the end");s<c;s++)if(t[s]==="."||t[s]===".."||!o.dot&&t[s].charAt(0)===".")return!1;return!0}for(;f<c;){var w=t[f];if(this.debug(`
43
- globstar while`,t,f,n,m,w),this.matchOne(t.slice(f),n.slice(m),r))return this.debug("globstar found match!",f,c,w),!0;if(w==="."||w===".."||!o.dot&&w.charAt(0)==="."){this.debug("dot detected!",t,f,n,m);break}this.debug("globstar swallow a segment, and continue"),f++}return!(!r||(this.debug(`
44
- >>> no match, partial?`,t,f,n,m),f!==c))}let y;if(typeof l=="string"?(y=d===l,this.debug("string match",l,d,y)):(y=l.test(d),this.debug("pattern match",l,d,y)),!y)return!1}if(s===c&&a===u)return!0;if(s===c)return r;if(a===u)return s===c-1&&t[s]==="";throw new Error("wtf?")}braceExpand(){return wy(this.pattern,this.options)}parse(t){$s(t);const n=this.options;if(t==="**")return Mn;if(t==="")return"";let r,o=null;(r=t.match(s_))?o=n.dot?l_:a_:(r=t.match(XR))?o=(n.nocase?n.dot?e_:ZR:n.dot?JR:YR)(r[1]):(r=t.match(c_))?o=(n.nocase?n.dot?f_:u_:n.dot?d_:p_)(r):(r=t.match(t_))?o=n.dot?r_:n_:(r=t.match(i_))&&(o=o_);const i=Ds.fromGlob(t,this.options).toMMPattern();return o&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:o}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const n=this.options,r=n.noglobstar?"[^/]*?":n.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",o=new Set(n.nocase?["i"]:[]);let i=t.map(c=>{const u=c.map(l=>{if(l instanceof RegExp)for(const d of l.flags.split(""))o.add(d);return typeof l=="string"?l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):l===Mn?Mn:l._src});return u.forEach((l,d)=>{const f=u[d+1],m=u[d-1];l===Mn&&m!==Mn&&(m===void 0?f!==void 0&&f!==Mn?u[d+1]="(?:\\/|"+r+"\\/)?"+f:u[d]=r:f===void 0?u[d-1]=m+"(?:\\/|"+r+")?":f!==Mn&&(u[d-1]=m+"(?:\\/|\\/"+r+"\\/)"+f,u[d+1]=Mn))}),u.filter(l=>l!==Mn).join("/")}).join("|");const[s,a]=t.length>1?["(?:",")"]:["",""];i="^"+s+i+a+"$",this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.partial;if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;const r=this.options;this.isWindows&&(t=t.split("\\").join("/"));const o=this.slashSplit(t);this.debug(this.pattern,"split",o);const i=this.set;this.debug(this.pattern,"set",i);let s=o[o.length-1];if(!s)for(let a=o.length-2;!s&&a>=0;a--)s=o[a];for(let a=0;a<i.length;a++){const c=i[a];let u=o;if(r.matchBase&&c.length===1&&(u=[s]),this.matchOne(u,c,n))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate}static defaults(t){return cn.defaults(t).Minimatch}}function Gu(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 Yt(e,t){const{status:n}=t;if(n===401&&e.digest)return t;if(n>=400)throw Gu(t);return t}function ri(e,t){return arguments.length>2&&arguments[2]!==void 0&&arguments[2]?{data:t,headers:e.headers?BR(e.headers):{},status:e.status,statusText:e.statusText}:t}cn.AST=Ds,cn.Minimatch=Ls,cn.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},cn.unescape=wo;const h_=(Ey=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=Xt({url:xt(e.remoteURL,kt(t)),method:"COPY",headers:{Destination:xt(e.remoteURL,kt(n)),Overwrite:r.overwrite===!1?"F":"T",Depth:r.shallow?"0":"infinity"}},e,r);return s=function(a){Yt(e,a)},(i=Qt(o,e))&&i.then||(i=Promise.resolve(i)),s?i.then(s):i;var i,s},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(Ey.apply(this,e))}catch(n){return Promise.reject(n)}});var Ey,Ku=mt(635),g_=mt(829),Sr=mt.n(g_),Di=function(e){return e.Array="array",e.Object="object",e.Original="original",e}(Di||{});function Ms(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Di.Original;const r=Sr().get(e,t);return n==="array"&&Array.isArray(r)===!1?[r]:n==="object"&&Array.isArray(r)?r[0]:r}function So(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 o={multistatus:Array.isArray(r)?r[0]:r};return Sr().set(o,"multistatus.response",Ms(o,"multistatus.response",Di.Array)),Sr().set(o,"multistatus.response",Sr().get(o,"multistatus.response").map(i=>function(s){const a=Object.assign({},s);return a.status?Sr().set(a,"status",Ms(a,"status",Di.Object)):(Sr().set(a,"propstat",Ms(a,"propstat",Di.Object)),Sr().set(a,"propstat.prop",Ms(a,"propstat.prop",Di.Object))),a}(i))),o}(new Ku.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",textNodeName:"text",ignoreAttributes:!1,removeNSPrefix:!0,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor:(n,r,o)=>r==="true"||r==="false"?r==="true":r,tagValueProcessor(n,r,o){if(!o.endsWith("propstat.prop.displayname"))return r}}).parse(e)))})}function Bs(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const{getlastmodified:r=null,getcontentlength:o="0",resourcetype:i=null,getcontenttype:s=null,getetag:a=null}=e,c=i&&typeof i=="object"&&i.collection!==void 0?"directory":"file",u={filename:t,basename:Os().basename(t),lastmod:r,size:parseInt(o,10),type:c,etag:typeof a=="string"?a.replace(/"/g,""):null};return c==="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 Ty(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:o,status:i}}=r,[s,a,c]=i.split(" ",3),u=parseInt(a,10);if(u>=400){const l=new Error(`Invalid response: ${u} ${c}`);throw l.status=u,l}return Bs(o,yo(t),n)}function Ay(e){switch(String(e)){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(String(e),10)}}function Qu(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const Xu=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,o=Xt({url:xt(e.remoteURL,kt(t)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,n);return Qu(Qt(o,e),function(i){return Yt(e,i),Qu(i.text(),function(s){return Qu(So(s),function(a){const c=Ty(a,t,r);return ri(i,c,r)})})})});function Ry(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const m_=_y(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=function(i){if(!i||i==="/")return[];let s=i;const a=[];do a.push(s),s=Os().dirname(s);while(s&&s!=="/");return a}(yo(t));r.sort((i,s)=>i.length>s.length?1:s.length>i.length?-1:0);let o=!1;return function(i,s,a){if(typeof i[Cy]=="function"){let y=function(E){try{for(;!(c=d.next()).done;)if((E=s(c.value))&&E.then){if(!Py(E))return void E.then(y,l||(l=vn.bind(null,u=new Li,2)));E=E.v}u?vn(u,1,E):u=E}catch(b){vn(u||(u=new Li),2,b)}};var c,u,l,d=i[Cy]();if(y(),d.return){var f=function(E){try{c.done||d.return()}catch{}return E};if(u&&u.then)return u.then(f,function(E){throw f(E)});f()}return u}if(!("length"in i))throw new TypeError("Object is not iterable");for(var m=[],w=0;w<i.length;w++)m.push(i[w]);return function(y,E,b){var g,v,h=-1;return function S(T){try{for(;++h<y.length&&(!b||!b());)if((T=E(h))&&T.then){if(!Py(T))return void T.then(S,v||(v=vn.bind(null,g=new Li,2)));T=T.v}g?vn(g,1,T):g=T}catch(I){vn(g||(g=new Li),2,I)}}(),g}(m,function(y){return s(m[y])},a)}(r,function(i){return s=function(){return function(c,u){try{var l=Ry(Xu(e,i),function(d){if(d.type!=="directory")throw new Error(`Path includes a file: ${t}`)})}catch(d){return u(d)}return l&&l.then?l.then(void 0,u):l}(0,function(c){const u=c;return function(){if(u.status===404)return o=!0,Iy(Yu(e,i,{...n,recursive:!1}));throw c}()})},(a=function(){if(o)return Iy(Yu(e,i,{...n,recursive:!1}))}())&&a.then?a.then(s):s();var s,a},function(){return!1})});function _y(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 y_(){}function Iy(e,t){return e&&e.then?e.then(y_):Promise.resolve()}const Cy=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function vn(e,t,n){if(!e.s){if(n instanceof Li){if(!n.s)return void(n.o=vn.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(vn.bind(null,e,t),vn.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const Li=function(){function e(){}return e.prototype.then=function(t,n){const r=new e,o=this.s;if(o){const i=1&o?t:n;if(i){try{vn(r,1,i(this.v))}catch(s){vn(r,2,s)}return r}return this}return this.o=function(i){try{const s=i.v;1&i.s?vn(r,1,t?t(s):s):n?vn(r,1,n(s)):vn(r,2,s)}catch(s){vn(r,2,s)}},r},e}();function Py(e){return e instanceof Li&&1&e.s}const Yu=_y(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(n.recursive===!0)return m_(e,t,n);const r=Xt({url:xt(e.remoteURL,(o=kt(t),o.endsWith("/")?o:o+"/")),method:"MKCOL"},e,n);var o;return Ry(Qt(r,e),function(i){Yt(e,i)})});var b_=mt(388),Fy=mt.n(b_);const v_=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 o=Xt({url:xt(e.remoteURL,kt(t)),method:"GET",headers:r},e,n);return s=function(a){if(Yt(e,a),r.Range&&a.status!==206){const c=new Error(`Invalid response code for partial request: ${a.status}`);throw c.status=a.status,c}return n.callback&&setTimeout(()=>{n.callback(a)},0),a.body},(i=Qt(o,e))&&i.then||(i=Promise.resolve(i)),s?i.then(s):i;var i,s}),w_=()=>{},S_=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=xt(e.remoteURL,kt(t)));const r=Xt(n,e,{});return i=function(s){return Yt(e,s),s},(o=Qt(r,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i}),E_=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=Xt({url:xt(e.remoteURL,kt(t)),method:"DELETE"},e,n);return i=function(s){Yt(e,s)},(o=Qt(r,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i}),T_=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,o){try{var i=(s=Xu(e,t,n),a=function(){return!0},c?a?a(s):s:(s&&s.then||(s=Promise.resolve(s)),a?s.then(a):s))}catch(u){return o(u)}var s,a,c;return i&&i.then?i.then(void 0,o):i}(0,function(r){if(r.status===404)return!1;throw r})});function Ju(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const A_=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=Xt({url:xt(e.remoteURL,kt(t),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:n.deep?"infinity":"1"}},e,n);return Ju(Qt(r,e),function(o){return Yt(e,o),Ju(o.text(),function(i){if(!i)throw new Error("Failed parsing directory contents: Empty response");return Ju(So(i),function(s){const a=Zm(t);let c=function(u,l,d){let f=arguments.length>3&&arguments[3]!==void 0&&arguments[3],m=arguments.length>4&&arguments[4]!==void 0&&arguments[4];const w=Os().join(l,"/"),{multistatus:{response:y}}=u,E=y.map(b=>{const g=function(h){try{return h.replace(/^https?:\/\/[^\/]+/,"")}catch(S){throw new yn(S,"Failed normalising HREF")}}(b.href),{propstat:{prop:v}}=b;return Bs(v,w==="/"?decodeURIComponent(yo(g)):yo(Os().relative(decodeURIComponent(w),decodeURIComponent(g))),f)});return m?E:E.filter(b=>b.basename&&(b.type==="file"||b.filename!==d.replace(/\/$/,"")))}(s,Zm(e.remoteBasePath||e.remotePath),a,n.details,n.includeSelf);return n.glob&&(c=function(u,l){return u.filter(d=>cn(d.filename,l,{matchBase:!0}))}(c,n.glob)),ri(o,c,n.details)})})})});function Zu(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 R_=Zu(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Xt({url:xt(e.remoteURL,kt(t)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[C_]},e,n);return js(Qt(r,e),function(o){return Yt(e,o),js(o.text(),function(i){return ri(o,i,n.details)})})});function js(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const __=Zu(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Xt({url:xt(e.remoteURL,kt(t)),method:"GET"},e,n);return js(Qt(r,e),function(o){let i;return Yt(e,o),function(s,a){var c=s();return c&&c.then?c.then(a):a()}(function(){return js(o.arrayBuffer(),function(s){i=s})},function(){return ri(o,i,n.details)})})}),I_=Zu(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 yn({info:{code:wr.InvalidOutputFormat}},`Invalid output format: ${r}`);return r==="text"?R_(e,t,n):__(e,t,n)}),C_=e=>e;function P_(e){return new Ku.XMLBuilder({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(Oy({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:e}}},"d"))}function Oy(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}`]=Oy(n[r],t),delete n[r]):/^@_/.test(r)===!1&&(n[`${t}:${r}`]=n[r],delete n[r]));return n}function ef(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function ky(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 F_=ky(function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=Xt({url:xt(e.remoteURL,kt(t)),method:"UNLOCK",headers:{"Lock-Token":n}},e,r);return ef(Qt(o,e),function(i){if(Yt(e,i),i.status!==204&&i.status!==200)throw Gu(i)})}),O_=ky(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{refreshToken:r,timeout:o=k_}=n,i={Accept:"text/plain,application/xml",Timeout:o};r&&(i.If=r);const s=Xt({url:xt(e.remoteURL,kt(t)),method:"LOCK",headers:i,data:P_(e.contactHref)},e,n);return ef(Qt(s,e),function(a){return Yt(e,a),ef(a.text(),function(c){const u=(f=c,new Ku.XMLParser({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(f)),l=Sr().get(u,"prop.lockdiscovery.activelock.locktoken.href"),d=Sr().get(u,"prop.lockdiscovery.activelock.timeout");var f;if(!l)throw Gu(a,"No lock token received: ");return{token:l,serverTimeout:d}})})}),k_="Infinite, Second-4100000000";function tf(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const x_=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=Xt({url:xt(e.remoteURL,n),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,t);return tf(Qt(r,e),function(o){return Yt(e,o),tf(o.text(),function(i){return tf(So(i),function(s){const a=function(c){try{const[u]=c.multistatus.response,{propstat:{prop:{"quota-used-bytes":l,"quota-available-bytes":d}}}=u;return l!==void 0&&d!==void 0?{used:parseInt(String(l),10),available:Ay(d)}:null}catch{}return null}(s);return ri(o,a,t.details)})})})});function nf(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const N_=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,o=Xt({url:xt(e.remoteURL,kt(t)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":e.headers["Content-Type"]||"application/xml; charset=utf-8"}},e,n);return nf(Qt(o,e),function(i){return Yt(e,i),nf(i.text(),function(s){return nf(So(s),function(a){const c=function(u,l,d){const f={truncated:!1,results:[]};return f.truncated=u.multistatus.response.some(m=>{var w,y;return((y=(m.status||((w=m.propstat)==null?void 0:w.status)).split(" ",3))==null?void 0:y[1])==="507"&&m.href.replace(/\/$/,"").endsWith(kt(l).replace(/\/$/,""))}),u.multistatus.response.forEach(m=>{if(m.propstat===void 0)return;const w=m.href.split("/").map(decodeURIComponent).join("/");f.results.push(Bs(m.propstat.prop,w,d))}),f}(a,t,r);return ri(i,c,r)})})})}),$_=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 o=Xt({url:xt(e.remoteURL,kt(t)),method:"MOVE",headers:{Destination:xt(e.remoteURL,kt(n)),Overwrite:r.overwrite===!1?"F":"T"}},e,r);return s=function(a){Yt(e,a)},(i=Qt(o,e))&&i.then||(i=Promise.resolve(i)),s?i.then(s):i;var i,s});var D_=mt(172);const L_=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:o=!0,overwrite:i=!0}=r,s={"Content-Type":"application/octet-stream"};o===!1||(s["Content-Length"]=typeof o=="number"?`${o}`:`${function(l){if(uy(l))return l.byteLength;if(fy(l))return l.length;if(typeof l=="string")return(0,D_.d)(l);throw new yn({info:{code:wr.DataTypeNoLength}},"Cannot calculate data length: Invalid type")}(n)}`),i||(s["If-None-Match"]="*");const a=Xt({url:xt(e.remoteURL,kt(t)),method:"PUT",headers:s,data:n},e,r);return u=function(l){try{Yt(e,l)}catch(d){const f=d;if(f.status!==412||i)throw f;return!1}return!0},(c=Qt(a,e))&&c.then||(c=Promise.resolve(c)),u?c.then(u):c;var c,u}),xy=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=Xt({url:xt(e.remoteURL,kt(t)),method:"OPTIONS"},e,n);return i=function(s){try{Yt(e,s)}catch(a){throw a}return{compliance:(s.headers.get("DAV")??"").split(",").map(a=>a.trim()),server:s.headers.get("Server")??""}},(o=Qt(r,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i});function Eo(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const M_=rf(function(e,t,n,r,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new yn({info:{code:wr.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=Xt({url:xt(e.remoteURL,kt(t)),method:"PUT",headers:s,data:o},e,i);return Eo(Qt(a,e),function(c){Yt(e,c)})});function Ny(e,t){var n=e();return n&&n.then?n.then(t):t(n)}const B_=rf(function(e,t,n,r,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new yn({info:{code:wr.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=Xt({url:xt(e.remoteURL,kt(t)),method:"PATCH",headers:s,data:o},e,i);return Eo(Qt(a,e),function(c){Yt(e,c)})});function rf(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 j_=rf(function(e,t,n,r,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};return Eo(xy(e,t,i),function(s){let a=!1;return Ny(function(){if(s.compliance.includes("sabredav-partialupdate"))return Eo(B_(e,t,n,r,o,i),function(c){return a=!0,c})},function(c){let u=!1;return a?c:Ny(function(){if(s.server.includes("Apache")&&s.compliance.includes("<http://apache.org/dav/propset/fs/1>"))return Eo(M_(e,t,n,r,o,i),function(l){return u=!0,l})},function(l){if(u)return l;throw new yn({info:{code:wr.NotSupported}},"Not supported")})})})}),U_="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function q_(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{authType:n=null,remoteBasePath:r,contactHref:o=U_,ha1:i,headers:s={},httpAgent:a,httpsAgent:c,password:u,token:l,username:d,withCredentials:f}=t;let m=n;m||(m=d||u?bn.Password:bn.None);const w={authType:m,remoteBasePath:r,contactHref:o,ha1:i,headers:Object.assign({},s),httpAgent:a,httpsAgent:c,password:u,remotePath:FR(e),remoteURL:e,token:l,username:d,withCredentials:f};return oy(w,d,u,l,i),{copyFile:(y,E,b)=>h_(w,y,E,b),createDirectory:(y,E)=>Yu(w,y,E),createReadStream:(y,E)=>function(b,g){let v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const h=new(Fy()).PassThrough;return v_(b,g,v).then(S=>{S.pipe(h)}).catch(S=>{h.emit("error",S)}),h}(w,y,E),createWriteStream:(y,E,b)=>function(g,v){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},S=arguments.length>3&&arguments[3]!==void 0?arguments[3]:w_;const T=new(Fy()).PassThrough,I={};h.overwrite===!1&&(I["If-None-Match"]="*");const _=Xt({url:xt(g.remoteURL,kt(v)),method:"PUT",headers:I,data:T,maxRedirects:0},g,h);return Qt(_,g).then(A=>Yt(g,A)).then(A=>{setTimeout(()=>{S(A)},0)}).catch(A=>{T.emit("error",A)}),T}(w,y,E,b),customRequest:(y,E)=>S_(w,y,E),deleteFile:(y,E)=>E_(w,y,E),exists:(y,E)=>T_(w,y,E),getDirectoryContents:(y,E)=>A_(w,y,E),getFileContents:(y,E)=>I_(w,y,E),getFileDownloadLink:y=>function(E,b){let g=xt(E.remoteURL,kt(b));const v=/^https:/i.test(g)?"https":"http";switch(E.authType){case bn.None:break;case bn.Password:{const h=ry(E.headers.Authorization.replace(/^Basic /i,"").trim());g=g.replace(/^https?:\/\//,`${v}://${h}@`);break}default:throw new yn({info:{code:wr.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${E.authType}`)}return g}(w,y),getFileUploadLink:y=>function(E,b){let g=`${xt(E.remoteURL,kt(b))}?Content-Type=application/octet-stream`;const v=/^https:/i.test(g)?"https":"http";switch(E.authType){case bn.None:break;case bn.Password:{const h=ry(E.headers.Authorization.replace(/^Basic /i,"").trim());g=g.replace(/^https?:\/\//,`${v}://${h}@`);break}default:throw new yn({info:{code:wr.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${E.authType}`)}return g}(w,y),getHeaders:()=>Object.assign({},w.headers),getQuota:y=>x_(w,y),lock:(y,E)=>O_(w,y,E),moveFile:(y,E,b)=>$_(w,y,E,b),putFileContents:(y,E,b)=>L_(w,y,E,b),partialUpdateFileContents:(y,E,b,g,v)=>j_(w,y,E,b,g,v),getDAVCompliance:y=>xy(w,y),search:(y,E)=>N_(w,y,E),setHeaders:y=>{w.headers=Object.assign({},y)},stat:(y,E)=>Xu(w,y,E),unlock:(y,E,b)=>F_(w,y,E,b)}}Ln.hT,Ln.O4,Ln.Kd,Ln.YK,Ln.UU,Ln.Gu,Ln.ky,Ln.h4,Ln.ch,Ln.hq,Ln.i5;var of={},sf={},$y;function af(){return $y||($y=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+"]*",o=new RegExp("^"+r+"$"),i=function(a,c){const u=[];let l=c.exec(a);for(;l;){const d=[];d.startIndex=c.lastIndex-l[0].length;const f=l.length;for(let m=0;m<f;m++)d.push(l[m]);u.push(d),l=c.exec(a)}return u},s=function(a){const c=o.exec(a);return!(c===null||typeof c>"u")};e.isExist=function(a){return typeof a<"u"},e.isEmptyObject=function(a){return Object.keys(a).length===0},e.merge=function(a,c,u){if(c){const l=Object.keys(c),d=l.length;for(let f=0;f<d;f++)u==="strict"?a[l[f]]=[c[l[f]]]:a[l[f]]=c[l[f]]}},e.getValue=function(a){return e.isExist(a)?a:""},e.isName=s,e.getAllMatches=i,e.nameRegexp=r}(sf)),sf}var Dy;function Ly(){if(Dy)return of;Dy=1;const e=af(),t={allowBooleanAttributes:!1,unpairedTags:[]};of.validate=function(b,g){g=Object.assign({},t,g);const v=[];let h=!1,S=!1;b[0]==="\uFEFF"&&(b=b.substr(1));for(let T=0;T<b.length;T++)if(b[T]==="<"&&b[T+1]==="?"){if(T+=2,T=r(b,T),T.err)return T}else if(b[T]==="<"){let I=T;if(T++,b[T]==="!"){T=o(b,T);continue}else{let _=!1;b[T]==="/"&&(_=!0,T++);let A="";for(;T<b.length&&b[T]!==">"&&b[T]!==" "&&b[T]!==" "&&b[T]!==`
45
- `&&b[T]!=="\r";T++)A+=b[T];if(A=A.trim(),A[A.length-1]==="/"&&(A=A.substring(0,A.length-1),T--),!w(A)){let N;return A.trim().length===0?N="Invalid space after '<'.":N="Tag '"+A+"' is an invalid name.",f("InvalidTag",N,y(b,T))}const $=a(b,T);if($===!1)return f("InvalidAttr","Attributes for '"+A+"' have open quote.",y(b,T));let D=$.value;if(T=$.index,D[D.length-1]==="/"){const N=T-D.length;D=D.substring(0,D.length-1);const x=u(D,g);if(x===!0)h=!0;else return f(x.err.code,x.err.msg,y(b,N+x.err.line))}else if(_)if($.tagClosed){if(D.trim().length>0)return f("InvalidTag","Closing tag '"+A+"' can't have attributes or invalid starting.",y(b,I));if(v.length===0)return f("InvalidTag","Closing tag '"+A+"' has not been opened.",y(b,I));{const N=v.pop();if(A!==N.tagName){let x=y(b,N.tagStartPos);return f("InvalidTag","Expected closing tag '"+N.tagName+"' (opened in line "+x.line+", col "+x.col+") instead of closing tag '"+A+"'.",y(b,I))}v.length==0&&(S=!0)}}else return f("InvalidTag","Closing tag '"+A+"' doesn't have proper closing.",y(b,T));else{const N=u(D,g);if(N!==!0)return f(N.err.code,N.err.msg,y(b,T-D.length+N.err.line));if(S===!0)return f("InvalidXml","Multiple possible root nodes found.",y(b,T));g.unpairedTags.indexOf(A)!==-1||v.push({tagName:A,tagStartPos:I}),h=!0}for(T++;T<b.length;T++)if(b[T]==="<")if(b[T+1]==="!"){T++,T=o(b,T);continue}else if(b[T+1]==="?"){if(T=r(b,++T),T.err)return T}else break;else if(b[T]==="&"){const N=d(b,T);if(N==-1)return f("InvalidChar","char '&' is not expected.",y(b,T));T=N}else if(S===!0&&!n(b[T]))return f("InvalidXml","Extra text at the end",y(b,T));b[T]==="<"&&T--}}else{if(n(b[T]))continue;return f("InvalidChar","char '"+b[T]+"' is not expected.",y(b,T))}if(h){if(v.length==1)return f("InvalidTag","Unclosed tag '"+v[0].tagName+"'.",y(b,v[0].tagStartPos));if(v.length>0)return f("InvalidXml","Invalid '"+JSON.stringify(v.map(T=>T.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return f("InvalidXml","Start tag expected.",1);return!0};function n(b){return b===" "||b===" "||b===`
46
- `||b==="\r"}function r(b,g){const v=g;for(;g<b.length;g++)if(b[g]=="?"||b[g]==" "){const h=b.substr(v,g-v);if(g>5&&h==="xml")return f("InvalidXml","XML declaration allowed only at the start of the document.",y(b,g));if(b[g]=="?"&&b[g+1]==">"){g++;break}else continue}return g}function o(b,g){if(b.length>g+5&&b[g+1]==="-"&&b[g+2]==="-"){for(g+=3;g<b.length;g++)if(b[g]==="-"&&b[g+1]==="-"&&b[g+2]===">"){g+=2;break}}else if(b.length>g+8&&b[g+1]==="D"&&b[g+2]==="O"&&b[g+3]==="C"&&b[g+4]==="T"&&b[g+5]==="Y"&&b[g+6]==="P"&&b[g+7]==="E"){let v=1;for(g+=8;g<b.length;g++)if(b[g]==="<")v++;else if(b[g]===">"&&(v--,v===0))break}else if(b.length>g+9&&b[g+1]==="["&&b[g+2]==="C"&&b[g+3]==="D"&&b[g+4]==="A"&&b[g+5]==="T"&&b[g+6]==="A"&&b[g+7]==="["){for(g+=8;g<b.length;g++)if(b[g]==="]"&&b[g+1]==="]"&&b[g+2]===">"){g+=2;break}}return g}const i='"',s="'";function a(b,g){let v="",h="",S=!1;for(;g<b.length;g++){if(b[g]===i||b[g]===s)h===""?h=b[g]:h!==b[g]||(h="");else if(b[g]===">"&&h===""){S=!0;break}v+=b[g]}return h!==""?!1:{value:v,index:g,tagClosed:S}}const c=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function u(b,g){const v=e.getAllMatches(b,c),h={};for(let S=0;S<v.length;S++){if(v[S][1].length===0)return f("InvalidAttr","Attribute '"+v[S][2]+"' has no space in starting.",E(v[S]));if(v[S][3]!==void 0&&v[S][4]===void 0)return f("InvalidAttr","Attribute '"+v[S][2]+"' is without value.",E(v[S]));if(v[S][3]===void 0&&!g.allowBooleanAttributes)return f("InvalidAttr","boolean attribute '"+v[S][2]+"' is not allowed.",E(v[S]));const T=v[S][2];if(!m(T))return f("InvalidAttr","Attribute '"+T+"' is an invalid name.",E(v[S]));if(!h.hasOwnProperty(T))h[T]=1;else return f("InvalidAttr","Attribute '"+T+"' is repeated.",E(v[S]))}return!0}function l(b,g){let v=/\d/;for(b[g]==="x"&&(g++,v=/[\da-fA-F]/);g<b.length;g++){if(b[g]===";")return g;if(!b[g].match(v))break}return-1}function d(b,g){if(g++,b[g]===";")return-1;if(b[g]==="#")return g++,l(b,g);let v=0;for(;g<b.length;g++,v++)if(!(b[g].match(/\w/)&&v<20)){if(b[g]===";")break;return-1}return g}function f(b,g,v){return{err:{code:b,msg:g,line:v.line||v,col:v.col}}}function m(b){return e.isName(b)}function w(b){return e.isName(b)}function y(b,g){const v=b.substring(0,g).split(/\r?\n/);return{line:v.length,col:v[v.length-1].length+1}}function E(b){return b.startIndex+b[1].length}return of}var Us={},My;function V_(){if(My)return Us;My=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,o){return n}},t=function(n){return Object.assign({},e,n)};return Us.buildOptions=t,Us.defaultOptions=e,Us}var lf,By;function z_(){if(By)return lf;By=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 lf=e,lf}var cf,jy;function W_(){if(jy)return cf;jy=1;const e=af();function t(u,l){const d={};if(u[l+3]==="O"&&u[l+4]==="C"&&u[l+5]==="T"&&u[l+6]==="Y"&&u[l+7]==="P"&&u[l+8]==="E"){l=l+9;let f=1,m=!1,w=!1,y="";for(;l<u.length;l++)if(u[l]==="<"&&!w){if(m&&o(u,l)){l+=7;let E,b;[E,b,l]=n(u,l+1),b.indexOf("&")===-1&&(d[c(E)]={regx:RegExp(`&${E};`,"g"),val:b})}else if(m&&i(u,l))l+=8;else if(m&&s(u,l))l+=8;else if(m&&a(u,l))l+=9;else if(r)w=!0;else throw new Error("Invalid DOCTYPE");f++,y=""}else if(u[l]===">"){if(w?u[l-1]==="-"&&u[l-2]==="-"&&(w=!1,f--):f--,f===0)break}else u[l]==="["?m=!0:y+=u[l];if(f!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:d,i:l}}function n(u,l){let d="";for(;l<u.length&&u[l]!=="'"&&u[l]!=='"';l++)d+=u[l];if(d=d.trim(),d.indexOf(" ")!==-1)throw new Error("External entites are not supported");const f=u[l++];let m="";for(;l<u.length&&u[l]!==f;l++)m+=u[l];return[d,m,l]}function r(u,l){return u[l+1]==="!"&&u[l+2]==="-"&&u[l+3]==="-"}function o(u,l){return u[l+1]==="!"&&u[l+2]==="E"&&u[l+3]==="N"&&u[l+4]==="T"&&u[l+5]==="I"&&u[l+6]==="T"&&u[l+7]==="Y"}function i(u,l){return u[l+1]==="!"&&u[l+2]==="E"&&u[l+3]==="L"&&u[l+4]==="E"&&u[l+5]==="M"&&u[l+6]==="E"&&u[l+7]==="N"&&u[l+8]==="T"}function s(u,l){return u[l+1]==="!"&&u[l+2]==="A"&&u[l+3]==="T"&&u[l+4]==="T"&&u[l+5]==="L"&&u[l+6]==="I"&&u[l+7]==="S"&&u[l+8]==="T"}function a(u,l){return u[l+1]==="!"&&u[l+2]==="N"&&u[l+3]==="O"&&u[l+4]==="T"&&u[l+5]==="A"&&u[l+6]==="T"&&u[l+7]==="I"&&u[l+8]==="O"&&u[l+9]==="N"}function c(u){if(e.isName(u))return u;throw new Error(`Invalid entity name ${u}`)}return cf=t,cf}var uf,Uy;function H_(){if(Uy)return uf;Uy=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 c=s.trim();if(a.skipLike!==void 0&&a.skipLike.test(c))return s;if(s==="0")return 0;if(a.hex&&e.test(c))return i(c,16);if(c.search(/[eE]/)!==-1){const u=c.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);if(u){if(a.leadingZeros)c=(u[1]||"")+u[3];else if(!(u[2]==="0"&&u[3][0]==="."))return s;return a.eNotation?Number(c):s}else return s}else{const u=t.exec(c);if(u){const l=u[1],d=u[2];let f=o(u[3]);if(!a.leadingZeros&&d.length>0&&l&&c[2]!==".")return s;if(!a.leadingZeros&&d.length>0&&!l&&c[1]!==".")return s;if(a.leadingZeros&&d===s)return 0;{const m=Number(c),w=""+m;return w.search(/[eE]/)!==-1?a.eNotation?m:s:c.indexOf(".")!==-1?w==="0"&&f===""||w===f||l&&w==="-"+f?m:s:d?f===w||l+f===w?m:s:c===w||c===l+w?m:s}}else return s}}function o(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 i(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 uf=r,uf}var ff,qy;function Vy(){if(qy)return ff;qy=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 ff=e,ff}var df,zy;function G_(){if(zy)return df;zy=1;const e=af(),t=z_(),n=W_(),r=H_(),o=Vy();class i{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:(I,_)=>String.fromCharCode(Number.parseInt(_,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(I,_)=>String.fromCharCode(Number.parseInt(_,16))}},this.addExternalEntities=s,this.parseXml=d,this.parseTextData=a,this.resolveNameSpace=c,this.buildAttributesMap=l,this.isItStopNode=y,this.replaceEntitiesValue=m,this.readStopNodeData=v,this.saveTextToParentTag=w,this.addChild=f,this.ignoreAttributesFn=o(this.options.ignoreAttributes)}}function s(S){const T=Object.keys(S);for(let I=0;I<T.length;I++){const _=T[I];this.lastEntities[_]={regex:new RegExp("&"+_+";","g"),val:S[_]}}}function a(S,T,I,_,A,$,D){if(S!==void 0&&(this.options.trimValues&&!_&&(S=S.trim()),S.length>0)){D||(S=this.replaceEntitiesValue(S));const N=this.options.tagValueProcessor(T,S,I,A,$);return N==null?S:typeof N!=typeof S||N!==S?N:this.options.trimValues?h(S,this.options.parseTagValue,this.options.numberParseOptions):S.trim()===S?h(S,this.options.parseTagValue,this.options.numberParseOptions):S}}function c(S){if(this.options.removeNSPrefix){const T=S.split(":"),I=S.charAt(0)==="/"?"/":"";if(T[0]==="xmlns")return"";T.length===2&&(S=I+T[1])}return S}const u=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function l(S,T,I){if(this.options.ignoreAttributes!==!0&&typeof S=="string"){const _=e.getAllMatches(S,u),A=_.length,$={};for(let D=0;D<A;D++){const N=this.resolveNameSpace(_[D][1]);if(this.ignoreAttributesFn(N,T))continue;let x=_[D][4],V=this.options.attributeNamePrefix+N;if(N.length)if(this.options.transformAttributeName&&(V=this.options.transformAttributeName(V)),V==="__proto__"&&(V="#__proto__"),x!==void 0){this.options.trimValues&&(x=x.trim()),x=this.replaceEntitiesValue(x);const G=this.options.attributeValueProcessor(N,x,T);G==null?$[V]=x:typeof G!=typeof x||G!==x?$[V]=G:$[V]=h(x,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&($[V]=!0)}if(!Object.keys($).length)return;if(this.options.attributesGroupName){const D={};return D[this.options.attributesGroupName]=$,D}return $}}const d=function(S){S=S.replace(/\r\n?/g,`
47
- `);const T=new t("!xml");let I=T,_="",A="";for(let $=0;$<S.length;$++)if(S[$]==="<")if(S[$+1]==="/"){const N=b(S,">",$,"Closing Tag is not closed.");let x=S.substring($+2,N).trim();if(this.options.removeNSPrefix){const ae=x.indexOf(":");ae!==-1&&(x=x.substr(ae+1))}this.options.transformTagName&&(x=this.options.transformTagName(x)),I&&(_=this.saveTextToParentTag(_,I,A));const V=A.substring(A.lastIndexOf(".")+1);if(x&&this.options.unpairedTags.indexOf(x)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${x}>`);let G=0;V&&this.options.unpairedTags.indexOf(V)!==-1?(G=A.lastIndexOf(".",A.lastIndexOf(".")-1),this.tagsNodeStack.pop()):G=A.lastIndexOf("."),A=A.substring(0,G),I=this.tagsNodeStack.pop(),_="",$=N}else if(S[$+1]==="?"){let N=g(S,$,!1,"?>");if(!N)throw new Error("Pi Tag is not closed.");if(_=this.saveTextToParentTag(_,I,A),!(this.options.ignoreDeclaration&&N.tagName==="?xml"||this.options.ignorePiTags)){const x=new t(N.tagName);x.add(this.options.textNodeName,""),N.tagName!==N.tagExp&&N.attrExpPresent&&(x[":@"]=this.buildAttributesMap(N.tagExp,A,N.tagName)),this.addChild(I,x,A)}$=N.closeIndex+1}else if(S.substr($+1,3)==="!--"){const N=b(S,"-->",$+4,"Comment is not closed.");if(this.options.commentPropName){const x=S.substring($+4,N-2);_=this.saveTextToParentTag(_,I,A),I.add(this.options.commentPropName,[{[this.options.textNodeName]:x}])}$=N}else if(S.substr($+1,2)==="!D"){const N=n(S,$);this.docTypeEntities=N.entities,$=N.i}else if(S.substr($+1,2)==="!["){const N=b(S,"]]>",$,"CDATA is not closed.")-2,x=S.substring($+9,N);_=this.saveTextToParentTag(_,I,A);let V=this.parseTextData(x,I.tagname,A,!0,!1,!0,!0);V==null&&(V=""),this.options.cdataPropName?I.add(this.options.cdataPropName,[{[this.options.textNodeName]:x}]):I.add(this.options.textNodeName,V),$=N+2}else{let N=g(S,$,this.options.removeNSPrefix),x=N.tagName;const V=N.rawTagName;let G=N.tagExp,ae=N.attrExpPresent,ye=N.closeIndex;this.options.transformTagName&&(x=this.options.transformTagName(x)),I&&_&&I.tagname!=="!xml"&&(_=this.saveTextToParentTag(_,I,A,!1));const ue=I;if(ue&&this.options.unpairedTags.indexOf(ue.tagname)!==-1&&(I=this.tagsNodeStack.pop(),A=A.substring(0,A.lastIndexOf("."))),x!==T.tagname&&(A+=A?"."+x:x),this.isItStopNode(this.options.stopNodes,A,x)){let te="";if(G.length>0&&G.lastIndexOf("/")===G.length-1)x[x.length-1]==="/"?(x=x.substr(0,x.length-1),A=A.substr(0,A.length-1),G=x):G=G.substr(0,G.length-1),$=N.closeIndex;else if(this.options.unpairedTags.indexOf(x)!==-1)$=N.closeIndex;else{const oe=this.readStopNodeData(S,V,ye+1);if(!oe)throw new Error(`Unexpected end of ${V}`);$=oe.i,te=oe.tagContent}const ce=new t(x);x!==G&&ae&&(ce[":@"]=this.buildAttributesMap(G,A,x)),te&&(te=this.parseTextData(te,x,A,!0,ae,!0,!0)),A=A.substr(0,A.lastIndexOf(".")),ce.add(this.options.textNodeName,te),this.addChild(I,ce,A)}else{if(G.length>0&&G.lastIndexOf("/")===G.length-1){x[x.length-1]==="/"?(x=x.substr(0,x.length-1),A=A.substr(0,A.length-1),G=x):G=G.substr(0,G.length-1),this.options.transformTagName&&(x=this.options.transformTagName(x));const te=new t(x);x!==G&&ae&&(te[":@"]=this.buildAttributesMap(G,A,x)),this.addChild(I,te,A),A=A.substr(0,A.lastIndexOf("."))}else{const te=new t(x);this.tagsNodeStack.push(I),x!==G&&ae&&(te[":@"]=this.buildAttributesMap(G,A,x)),this.addChild(I,te,A),I=te}_="",$=ye}}else _+=S[$];return T.child};function f(S,T,I){const _=this.options.updateTag(T.tagname,I,T[":@"]);_===!1||(typeof _=="string"&&(T.tagname=_),S.addChild(T))}const m=function(S){if(this.options.processEntities){for(let T in this.docTypeEntities){const I=this.docTypeEntities[T];S=S.replace(I.regx,I.val)}for(let T in this.lastEntities){const I=this.lastEntities[T];S=S.replace(I.regex,I.val)}if(this.options.htmlEntities)for(let T in this.htmlEntities){const I=this.htmlEntities[T];S=S.replace(I.regex,I.val)}S=S.replace(this.ampEntity.regex,this.ampEntity.val)}return S};function w(S,T,I,_){return S&&(_===void 0&&(_=T.child.length===0),S=this.parseTextData(S,T.tagname,I,!1,T[":@"]?Object.keys(T[":@"]).length!==0:!1,_),S!==void 0&&S!==""&&T.add(this.options.textNodeName,S),S=""),S}function y(S,T,I){const _="*."+I;for(const A in S){const $=S[A];if(_===$||T===$)return!0}return!1}function E(S,T,I=">"){let _,A="";for(let $=T;$<S.length;$++){let D=S[$];if(_)D===_&&(_="");else if(D==='"'||D==="'")_=D;else if(D===I[0])if(I[1]){if(S[$+1]===I[1])return{data:A,index:$}}else return{data:A,index:$};else D===" "&&(D=" ");A+=D}}function b(S,T,I,_){const A=S.indexOf(T,I);if(A===-1)throw new Error(_);return A+T.length-1}function g(S,T,I,_=">"){const A=E(S,T+1,_);if(!A)return;let $=A.data;const D=A.index,N=$.search(/\s/);let x=$,V=!0;N!==-1&&(x=$.substring(0,N),$=$.substring(N+1).trimStart());const G=x;if(I){const ae=x.indexOf(":");ae!==-1&&(x=x.substr(ae+1),V=x!==A.data.substr(ae+1))}return{tagName:x,tagExp:$,closeIndex:D,attrExpPresent:V,rawTagName:G}}function v(S,T,I){const _=I;let A=1;for(;I<S.length;I++)if(S[I]==="<")if(S[I+1]==="/"){const $=b(S,">",I,`${T} is not closed`);if(S.substring(I+2,$).trim()===T&&(A--,A===0))return{tagContent:S.substring(_,I),i:$};I=$}else if(S[I+1]==="?")I=b(S,"?>",I+1,"StopNode is not closed.");else if(S.substr(I+1,3)==="!--")I=b(S,"-->",I+3,"StopNode is not closed.");else if(S.substr(I+1,2)==="![")I=b(S,"]]>",I,"StopNode is not closed.")-2;else{const $=g(S,I,">");$&&(($&&$.tagName)===T&&$.tagExp[$.tagExp.length-1]!=="/"&&A++,I=$.closeIndex)}}function h(S,T,I){if(T&&typeof S=="string"){const _=S.trim();return _==="true"?!0:_==="false"?!1:r(S,I)}else return e.isExist(S)?S:""}return df=i,df}var pf={},Wy;function K_(){if(Wy)return pf;Wy=1;function e(i,s){return t(i,s)}function t(i,s,a){let c;const u={};for(let l=0;l<i.length;l++){const d=i[l],f=n(d);let m="";if(a===void 0?m=f:m=a+"."+f,f===s.textNodeName)c===void 0?c=d[f]:c+=""+d[f];else{if(f===void 0)continue;if(d[f]){let w=t(d[f],s,m);const y=o(w,s);d[":@"]?r(w,d[":@"],m,s):Object.keys(w).length===1&&w[s.textNodeName]!==void 0&&!s.alwaysCreateTextNode?w=w[s.textNodeName]:Object.keys(w).length===0&&(s.alwaysCreateTextNode?w[s.textNodeName]="":w=""),u[f]!==void 0&&u.hasOwnProperty(f)?(Array.isArray(u[f])||(u[f]=[u[f]]),u[f].push(w)):s.isArray(f,m,y)?u[f]=[w]:u[f]=w}}}return typeof c=="string"?c.length>0&&(u[s.textNodeName]=c):c!==void 0&&(u[s.textNodeName]=c),u}function n(i){const s=Object.keys(i);for(let a=0;a<s.length;a++){const c=s[a];if(c!==":@")return c}}function r(i,s,a,c){if(s){const u=Object.keys(s),l=u.length;for(let d=0;d<l;d++){const f=u[d];c.isArray(f,a+"."+f,!0,!0)?i[f]=[s[f]]:i[f]=s[f]}}}function o(i,s){const{textNodeName:a}=s,c=Object.keys(i).length;return!!(c===0||c===1&&(i[a]||typeof i[a]=="boolean"||i[a]===0))}return pf.prettify=e,pf}var hf,Hy;function Q_(){if(Hy)return hf;Hy=1;const{buildOptions:e}=V_(),t=G_(),{prettify:n}=K_(),r=Ly();class o{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 l=r.validate(s,a);if(l!==!0)throw Error(`${l.err.msg}:${l.err.line}:${l.err.col}`)}const c=new t(this.options);c.addExternalEntities(this.externalEntities);const u=c.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 hf=o,hf}var gf,Gy;function X_(){if(Gy)return gf;Gy=1;const e=`
48
- `;function t(a,c){let u="";return c.format&&c.indentBy.length>0&&(u=e),n(a,c,"",u)}function n(a,c,u,l){let d="",f=!1;for(let m=0;m<a.length;m++){const w=a[m],y=r(w);if(y===void 0)continue;let E="";if(u.length===0?E=y:E=`${u}.${y}`,y===c.textNodeName){let S=w[y];i(E,c)||(S=c.tagValueProcessor(y,S),S=s(S,c)),f&&(d+=l),d+=S,f=!1;continue}else if(y===c.cdataPropName){f&&(d+=l),d+=`<![CDATA[${w[y][0][c.textNodeName]}]]>`,f=!1;continue}else if(y===c.commentPropName){d+=l+`<!--${w[y][0][c.textNodeName]}-->`,f=!0;continue}else if(y[0]==="?"){const S=o(w[":@"],c),T=y==="?xml"?"":l;let I=w[y][0][c.textNodeName];I=I.length!==0?" "+I:"",d+=T+`<${y}${I}${S}?>`,f=!0;continue}let b=l;b!==""&&(b+=c.indentBy);const g=o(w[":@"],c),v=l+`<${y}${g}`,h=n(w[y],c,E,b);c.unpairedTags.indexOf(y)!==-1?c.suppressUnpairedNode?d+=v+">":d+=v+"/>":(!h||h.length===0)&&c.suppressEmptyNode?d+=v+"/>":h&&h.endsWith(">")?d+=v+`>${h}${l}</${y}>`:(d+=v+">",h&&l!==""&&(h.includes("/>")||h.includes("</"))?d+=l+c.indentBy+h+l:d+=h,d+=`</${y}>`),f=!0}return d}function r(a){const c=Object.keys(a);for(let u=0;u<c.length;u++){const l=c[u];if(a.hasOwnProperty(l)&&l!==":@")return l}}function o(a,c){let u="";if(a&&!c.ignoreAttributes)for(let l in a){if(!a.hasOwnProperty(l))continue;let d=c.attributeValueProcessor(l,a[l]);d=s(d,c),d===!0&&c.suppressBooleanAttributes?u+=` ${l.substr(c.attributeNamePrefix.length)}`:u+=` ${l.substr(c.attributeNamePrefix.length)}="${d}"`}return u}function i(a,c){a=a.substr(0,a.length-c.textNodeName.length-1);let u=a.substr(a.lastIndexOf(".")+1);for(let l in c.stopNodes)if(c.stopNodes[l]===a||c.stopNodes[l]==="*."+u)return!0;return!1}function s(a,c){if(a&&a.length>0&&c.processEntities)for(let u=0;u<c.entities.length;u++){const l=c.entities[u];a=a.replace(l.regex,l.val)}return a}return gf=t,gf}var mf,Ky;function Y_(){if(Ky)return mf;Ky=1;const e=X_(),t=Vy(),n={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(a,c){return c},attributeValueProcessor:function(a,c){return c},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=o,this.options.format?(this.indentate=i,this.tagEndChar=`>
39
+ `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function a(c,d,f,m){const w=this.j2x(c,f+1,m.concat(d));return c[this.options.textNodeName]!==void 0&&Object.keys(c).length===1?this.buildTextValNode(c[this.options.textNodeName],d,w.attrStr,f):this.buildObjectNode(w.val,d,w.attrStr,f)}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?n(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,d,f){let m="",w="";const v=f.join(".");for(let E in c)if(Object.prototype.hasOwnProperty.call(c,E))if(c[E]===void 0)this.isAttribute(E)&&(w+="");else if(c[E]===null)this.isAttribute(E)?w+="":E[0]==="?"?w+=this.indentate(d)+"<"+E+"?"+this.tagEndChar:w+=this.indentate(d)+"<"+E+"/"+this.tagEndChar;else if(c[E]instanceof Date)w+=this.buildTextValNode(c[E],E,"",d);else if(typeof c[E]!="object"){const b=this.isAttribute(E);if(b&&!this.ignoreAttributesFn(b,v))m+=this.buildAttrPairStr(b,""+c[E]);else if(!b)if(E===this.options.textNodeName){let g=this.options.tagValueProcessor(E,""+c[E]);w+=this.replaceEntitiesValue(g)}else w+=this.buildTextValNode(c[E],E,"",d)}else if(Array.isArray(c[E])){const b=c[E].length;let g="",y="";for(let p=0;p<b;p++){const S=c[E][p];if(S!==void 0)if(S===null)E[0]==="?"?w+=this.indentate(d)+"<"+E+"?"+this.tagEndChar:w+=this.indentate(d)+"<"+E+"/"+this.tagEndChar;else if(typeof S=="object")if(this.options.oneListGroup){const T=this.j2x(S,d+1,f.concat(E));g+=T.val,this.options.attributesGroupName&&S.hasOwnProperty(this.options.attributesGroupName)&&(y+=T.attrStr)}else g+=this.processTextOrObjNode(S,E,d,f);else if(this.options.oneListGroup){let T=this.options.tagValueProcessor(E,S);T=this.replaceEntitiesValue(T),g+=T}else g+=this.buildTextValNode(S,E,"",d)}this.options.oneListGroup&&(g=this.buildObjectNode(g,E,y,d)),w+=g}else if(this.options.attributesGroupName&&E===this.options.attributesGroupName){const b=Object.keys(c[E]),g=b.length;for(let y=0;y<g;y++)m+=this.buildAttrPairStr(b[y],""+c[E][b[y]])}else w+=this.processTextOrObjNode(c[E],E,d,f);return{attrStr:m,val:w}},s.prototype.buildAttrPairStr=function(c,d){return d=this.options.attributeValueProcessor(c,""+d),d=this.replaceEntitiesValue(d),this.options.suppressBooleanAttributes&&d==="true"?" "+c:" "+c+'="'+d+'"'},s.prototype.buildObjectNode=function(c,d,f,m){if(c==="")return d[0]==="?"?this.indentate(m)+"<"+d+f+"?"+this.tagEndChar:this.indentate(m)+"<"+d+f+this.closeTag(d)+this.tagEndChar;{let w="</"+d+this.tagEndChar,v="";return d[0]==="?"&&(v="?",w=""),!f&&f!==""||c.indexOf("<")!==-1?this.options.commentPropName!==!1&&d===this.options.commentPropName&&v.length===0?this.indentate(m)+`<!--${c}-->`+this.newLine:this.indentate(m)+"<"+d+f+v+this.tagEndChar+c+this.indentate(m)+w:this.indentate(m)+"<"+d+f+v+">"+c+w}},s.prototype.closeTag=function(c){let d="";return this.options.unpairedTags.indexOf(c)!==-1?this.options.suppressUnpairedNode||(d="/"):d=this.options.suppressEmptyNode?"/":`></${c}`,d},s.prototype.buildTextValNode=function(c,d,f,m){if(this.options.cdataPropName!==!1&&d===this.options.cdataPropName)return this.indentate(m)+`<![CDATA[${c}]]>`+this.newLine;if(this.options.commentPropName!==!1&&d===this.options.commentPropName)return this.indentate(m)+`<!--${c}-->`+this.newLine;if(d[0]==="?")return this.indentate(m)+"<"+d+f+"?"+this.tagEndChar;{let w=this.options.tagValueProcessor(d,c);return w=this.replaceEntitiesValue(w),w===""?this.indentate(m)+"<"+d+f+this.closeTag(d)+this.tagEndChar:this.indentate(m)+"<"+d+f+">"+w+"</"+d+this.tagEndChar}},s.prototype.replaceEntitiesValue=function(c){if(c&&c.length>0&&this.options.processEntities)for(let d=0;d<this.options.entities.length;d++){const f=this.options.entities[d];c=c.replace(f.regex,f.val)}return c},e.exports=s},87:e=>{function t(s,a,l,u){let c="",d=!1;for(let f=0;f<s.length;f++){const m=s[f],w=r(m);if(w===void 0)continue;let v="";if(v=l.length===0?w:`${l}.${w}`,w===a.textNodeName){let y=m[w];i(v,a)||(y=a.tagValueProcessor(w,y),y=o(y,a)),d&&(c+=u),c+=y,d=!1;continue}if(w===a.cdataPropName){d&&(c+=u),c+=`<![CDATA[${m[w][0][a.textNodeName]}]]>`,d=!1;continue}if(w===a.commentPropName){c+=u+`<!--${m[w][0][a.textNodeName]}-->`,d=!0;continue}if(w[0]==="?"){const y=n(m[":@"],a),p=w==="?xml"?"":u;let S=m[w][0][a.textNodeName];S=S.length!==0?" "+S:"",c+=p+`<${w}${S}${y}?>`,d=!0;continue}let E=u;E!==""&&(E+=a.indentBy);const b=u+`<${w}${n(m[":@"],a)}`,g=t(m[w],a,v,E);a.unpairedTags.indexOf(w)!==-1?a.suppressUnpairedNode?c+=b+">":c+=b+"/>":g&&g.length!==0||!a.suppressEmptyNode?g&&g.endsWith(">")?c+=b+`>${g}${u}</${w}>`:(c+=b+">",g&&u!==""&&(g.includes("/>")||g.includes("</"))?c+=u+a.indentBy+g+u:c+=g,c+=`</${w}>`):c+=b+"/>",d=!0}return c}function r(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 n(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=`
40
+ `),t(s,a,"",l)}},193:(e,t,r)=>{const n=r(705);function i(d,f){let m="";for(;f<d.length&&d[f]!=="'"&&d[f]!=='"';f++)m+=d[f];if(m=m.trim(),m.indexOf(" ")!==-1)throw new Error("External entites are not supported");const w=d[f++];let v="";for(;f<d.length&&d[f]!==w;f++)v+=d[f];return[m,v,f]}function o(d,f){return d[f+1]==="!"&&d[f+2]==="-"&&d[f+3]==="-"}function s(d,f){return d[f+1]==="!"&&d[f+2]==="E"&&d[f+3]==="N"&&d[f+4]==="T"&&d[f+5]==="I"&&d[f+6]==="T"&&d[f+7]==="Y"}function a(d,f){return d[f+1]==="!"&&d[f+2]==="E"&&d[f+3]==="L"&&d[f+4]==="E"&&d[f+5]==="M"&&d[f+6]==="E"&&d[f+7]==="N"&&d[f+8]==="T"}function l(d,f){return d[f+1]==="!"&&d[f+2]==="A"&&d[f+3]==="T"&&d[f+4]==="T"&&d[f+5]==="L"&&d[f+6]==="I"&&d[f+7]==="S"&&d[f+8]==="T"}function u(d,f){return d[f+1]==="!"&&d[f+2]==="N"&&d[f+3]==="O"&&d[f+4]==="T"&&d[f+5]==="A"&&d[f+6]==="T"&&d[f+7]==="I"&&d[f+8]==="O"&&d[f+9]==="N"}function c(d){if(n.isName(d))return d;throw new Error(`Invalid entity name ${d}`)}e.exports=function(d,f){const m={};if(d[f+3]!=="O"||d[f+4]!=="C"||d[f+5]!=="T"||d[f+6]!=="Y"||d[f+7]!=="P"||d[f+8]!=="E")throw new Error("Invalid Tag instead of DOCTYPE");{f+=9;let w=1,v=!1,E=!1,b="";for(;f<d.length;f++)if(d[f]!=="<"||E)if(d[f]===">"){if(E?d[f-1]==="-"&&d[f-2]==="-"&&(E=!1,w--):w--,w===0)break}else d[f]==="["?v=!0:b+=d[f];else{if(v&&s(d,f)){let g,y;f+=7,[g,y,f]=i(d,f+1),y.indexOf("&")===-1&&(m[c(g)]={regx:RegExp(`&${g};`,"g"),val:y})}else if(v&&a(d,f))f+=8;else if(v&&l(d,f))f+=8;else if(v&&u(d,f))f+=9;else{if(!o)throw new Error("Invalid DOCTYPE");E=!0}w++,b=""}if(w!==0)throw new Error("Unclosed DOCTYPE")}return{entities:m,i:f}}},63:(e,t)=>{const r={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,i){return i},attributeValueProcessor:function(n,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(n,i,o){return n}};t.buildOptions=function(n){return Object.assign({},r,n)},t.defaultOptions=r},299:(e,t,r)=>{const n=r(705),i=r(365),o=r(193),s=r(494),a=r(118);function l(T){const R=Object.keys(T);for(let I=0;I<R.length;I++){const A=R[I];this.lastEntities[A]={regex:new RegExp("&"+A+";","g"),val:T[A]}}}function u(T,R,I,A,D,H,_){if(T!==void 0&&(this.options.trimValues&&!A&&(T=T.trim()),T.length>0)){_||(T=this.replaceEntitiesValue(T));const x=this.options.tagValueProcessor(R,T,I,D,H);return x==null?T:typeof x!=typeof T||x!==T?x:this.options.trimValues||T.trim()===T?S(T,this.options.parseTagValue,this.options.numberParseOptions):T}}function c(T){if(this.options.removeNSPrefix){const R=T.split(":"),I=T.charAt(0)==="/"?"/":"";if(R[0]==="xmlns")return"";R.length===2&&(T=I+R[1])}return T}const d=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function f(T,R,I){if(this.options.ignoreAttributes!==!0&&typeof T=="string"){const A=n.getAllMatches(T,d),D=A.length,H={};for(let _=0;_<D;_++){const x=this.resolveNameSpace(A[_][1]);if(this.ignoreAttributesFn(x,R))continue;let z=A[_][4],G=this.options.attributeNamePrefix+x;if(x.length)if(this.options.transformAttributeName&&(G=this.options.transformAttributeName(G)),G==="__proto__"&&(G="#__proto__"),z!==void 0){this.options.trimValues&&(z=z.trim()),z=this.replaceEntitiesValue(z);const ne=this.options.attributeValueProcessor(x,z,R);H[G]=ne==null?z:typeof ne!=typeof z||ne!==z?ne:S(z,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(H[G]=!0)}if(!Object.keys(H).length)return;if(this.options.attributesGroupName){const _={};return _[this.options.attributesGroupName]=H,_}return H}}const m=function(T){T=T.replace(/\r\n?/g,`
41
+ `);const R=new i("!xml");let I=R,A="",D="";for(let H=0;H<T.length;H++)if(T[H]==="<")if(T[H+1]==="/"){const _=g(T,">",H,"Closing Tag is not closed.");let x=T.substring(H+2,_).trim();if(this.options.removeNSPrefix){const ne=x.indexOf(":");ne!==-1&&(x=x.substr(ne+1))}this.options.transformTagName&&(x=this.options.transformTagName(x)),I&&(A=this.saveTextToParentTag(A,I,D));const z=D.substring(D.lastIndexOf(".")+1);if(x&&this.options.unpairedTags.indexOf(x)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${x}>`);let G=0;z&&this.options.unpairedTags.indexOf(z)!==-1?(G=D.lastIndexOf(".",D.lastIndexOf(".")-1),this.tagsNodeStack.pop()):G=D.lastIndexOf("."),D=D.substring(0,G),I=this.tagsNodeStack.pop(),A="",H=_}else if(T[H+1]==="?"){let _=y(T,H,!1,"?>");if(!_)throw new Error("Pi Tag is not closed.");if(A=this.saveTextToParentTag(A,I,D),!(this.options.ignoreDeclaration&&_.tagName==="?xml"||this.options.ignorePiTags)){const x=new i(_.tagName);x.add(this.options.textNodeName,""),_.tagName!==_.tagExp&&_.attrExpPresent&&(x[":@"]=this.buildAttributesMap(_.tagExp,D,_.tagName)),this.addChild(I,x,D)}H=_.closeIndex+1}else if(T.substr(H+1,3)==="!--"){const _=g(T,"-->",H+4,"Comment is not closed.");if(this.options.commentPropName){const x=T.substring(H+4,_-2);A=this.saveTextToParentTag(A,I,D),I.add(this.options.commentPropName,[{[this.options.textNodeName]:x}])}H=_}else if(T.substr(H+1,2)==="!D"){const _=o(T,H);this.docTypeEntities=_.entities,H=_.i}else if(T.substr(H+1,2)==="!["){const _=g(T,"]]>",H,"CDATA is not closed.")-2,x=T.substring(H+9,_);A=this.saveTextToParentTag(A,I,D);let z=this.parseTextData(x,I.tagname,D,!0,!1,!0,!0);z==null&&(z=""),this.options.cdataPropName?I.add(this.options.cdataPropName,[{[this.options.textNodeName]:x}]):I.add(this.options.textNodeName,z),H=_+2}else{let _=y(T,H,this.options.removeNSPrefix),x=_.tagName;const z=_.rawTagName;let G=_.tagExp,ne=_.attrExpPresent,ie=_.closeIndex;this.options.transformTagName&&(x=this.options.transformTagName(x)),I&&A&&I.tagname!=="!xml"&&(A=this.saveTextToParentTag(A,I,D,!1));const ee=I;if(ee&&this.options.unpairedTags.indexOf(ee.tagname)!==-1&&(I=this.tagsNodeStack.pop(),D=D.substring(0,D.lastIndexOf("."))),x!==R.tagname&&(D+=D?"."+x:x),this.isItStopNode(this.options.stopNodes,D,x)){let ue="";if(G.length>0&&G.lastIndexOf("/")===G.length-1)x[x.length-1]==="/"?(x=x.substr(0,x.length-1),D=D.substr(0,D.length-1),G=x):G=G.substr(0,G.length-1),H=_.closeIndex;else if(this.options.unpairedTags.indexOf(x)!==-1)H=_.closeIndex;else{const ce=this.readStopNodeData(T,z,ie+1);if(!ce)throw new Error(`Unexpected end of ${z}`);H=ce.i,ue=ce.tagContent}const de=new i(x);x!==G&&ne&&(de[":@"]=this.buildAttributesMap(G,D,x)),ue&&(ue=this.parseTextData(ue,x,D,!0,ne,!0,!0)),D=D.substr(0,D.lastIndexOf(".")),de.add(this.options.textNodeName,ue),this.addChild(I,de,D)}else{if(G.length>0&&G.lastIndexOf("/")===G.length-1){x[x.length-1]==="/"?(x=x.substr(0,x.length-1),D=D.substr(0,D.length-1),G=x):G=G.substr(0,G.length-1),this.options.transformTagName&&(x=this.options.transformTagName(x));const ue=new i(x);x!==G&&ne&&(ue[":@"]=this.buildAttributesMap(G,D,x)),this.addChild(I,ue,D),D=D.substr(0,D.lastIndexOf("."))}else{const ue=new i(x);this.tagsNodeStack.push(I),x!==G&&ne&&(ue[":@"]=this.buildAttributesMap(G,D,x)),this.addChild(I,ue,D),I=ue}A="",H=ie}}else A+=T[H];return R.child};function w(T,R,I){const A=this.options.updateTag(R.tagname,I,R[":@"]);A===!1||(typeof A=="string"&&(R.tagname=A),T.addChild(R))}const v=function(T){if(this.options.processEntities){for(let R in this.docTypeEntities){const I=this.docTypeEntities[R];T=T.replace(I.regx,I.val)}for(let R in this.lastEntities){const I=this.lastEntities[R];T=T.replace(I.regex,I.val)}if(this.options.htmlEntities)for(let R in this.htmlEntities){const I=this.htmlEntities[R];T=T.replace(I.regex,I.val)}T=T.replace(this.ampEntity.regex,this.ampEntity.val)}return T};function E(T,R,I,A){return T&&(A===void 0&&(A=Object.keys(R.child).length===0),(T=this.parseTextData(T,R.tagname,I,!1,!!R[":@"]&&Object.keys(R[":@"]).length!==0,A))!==void 0&&T!==""&&R.add(this.options.textNodeName,T),T=""),T}function b(T,R,I){const A="*."+I;for(const D in T){const H=T[D];if(A===H||R===H)return!0}return!1}function g(T,R,I,A){const D=T.indexOf(R,I);if(D===-1)throw new Error(A);return D+R.length-1}function y(T,R,I){const A=(function(ne,ie){let ee,ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",de="";for(let ce=ie;ce<ne.length;ce++){let X=ne[ce];if(ee)X===ee&&(ee="");else if(X==='"'||X==="'")ee=X;else if(X===ue[0]){if(!ue[1])return{data:de,index:ce};if(ne[ce+1]===ue[1])return{data:de,index:ce}}else X===" "&&(X=" ");de+=X}})(T,R+1,arguments.length>3&&arguments[3]!==void 0?arguments[3]:">");if(!A)return;let D=A.data;const H=A.index,_=D.search(/\s/);let x=D,z=!0;_!==-1&&(x=D.substring(0,_),D=D.substring(_+1).trimStart());const G=x;if(I){const ne=x.indexOf(":");ne!==-1&&(x=x.substr(ne+1),z=x!==A.data.substr(ne+1))}return{tagName:x,tagExp:D,closeIndex:H,attrExpPresent:z,rawTagName:G}}function p(T,R,I){const A=I;let D=1;for(;I<T.length;I++)if(T[I]==="<")if(T[I+1]==="/"){const H=g(T,">",I,`${R} is not closed`);if(T.substring(I+2,H).trim()===R&&(D--,D===0))return{tagContent:T.substring(A,I),i:H};I=H}else if(T[I+1]==="?")I=g(T,"?>",I+1,"StopNode is not closed.");else if(T.substr(I+1,3)==="!--")I=g(T,"-->",I+3,"StopNode is not closed.");else if(T.substr(I+1,2)==="![")I=g(T,"]]>",I,"StopNode is not closed.")-2;else{const H=y(T,I,">");H&&((H&&H.tagName)===R&&H.tagExp[H.tagExp.length-1]!=="/"&&D++,I=H.closeIndex)}}function S(T,R,I){if(R&&typeof T=="string"){const A=T.trim();return A==="true"||A!=="false"&&s(T,I)}return n.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,I)=>String.fromCharCode(Number.parseInt(I,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(R,I)=>String.fromCharCode(Number.parseInt(I,16))}},this.addExternalEntities=l,this.parseXml=m,this.parseTextData=u,this.resolveNameSpace=c,this.buildAttributesMap=f,this.isItStopNode=b,this.replaceEntitiesValue=v,this.readStopNodeData=p,this.saveTextToParentTag=E,this.addChild=w,this.ignoreAttributesFn=a(this.options.ignoreAttributes)}}},338:(e,t,r)=>{const{buildOptions:n}=r(63),i=r(299),{prettify:o}=r(728),s=r(31);e.exports=class{constructor(a){this.externalEntities={},this.options=n(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 d=s.validate(a,l);if(d!==!0)throw Error(`${d.err.msg}:${d.err.line}:${d.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 r(s,a,l){let u;const c={};for(let d=0;d<s.length;d++){const f=s[d],m=n(f);let w="";if(w=l===void 0?m:l+"."+m,m===a.textNodeName)u===void 0?u=f[m]:u+=""+f[m];else{if(m===void 0)continue;if(f[m]){let v=r(f[m],a,w);const E=o(v,a);f[":@"]?i(v,f[":@"],w,a):Object.keys(v).length!==1||v[a.textNodeName]===void 0||a.alwaysCreateTextNode?Object.keys(v).length===0&&(a.alwaysCreateTextNode?v[a.textNodeName]="":v=""):v=v[a.textNodeName],c[m]!==void 0&&c.hasOwnProperty(m)?(Array.isArray(c[m])||(c[m]=[c[m]]),c[m].push(v)):a.isArray(m,w,E)?c[m]=[v]:c[m]=v}}}return typeof u=="string"?u.length>0&&(c[a.textNodeName]=u):u!==void 0&&(c[a.textNodeName]=u),c}function n(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),d=c.length;for(let f=0;f<d;f++){const m=c[f];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 r(s,a)}},365:e=>{e.exports=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,r){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:r})}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(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}e.exports=function(r){return r!=null&&(t(r)||(function(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&t(n.slice(0,0))})(r)||!!r._isBuffer)}},542:(e,t,r)=>{(function(){var n=r(298),i=r(526).utf8,o=r(135),s=r(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=n.bytesToWords(l),d=8*l.length,f=1732584193,m=-271733879,w=-1732584194,v=271733878,E=0;E<c.length;E++)c[E]=16711935&(c[E]<<8|c[E]>>>24)|4278255360&(c[E]<<24|c[E]>>>8);c[d>>>5]|=128<<d%32,c[14+(d+64>>>9<<4)]=d;var b=a._ff,g=a._gg,y=a._hh,p=a._ii;for(E=0;E<c.length;E+=16){var S=f,T=m,R=w,I=v;f=b(f,m,w,v,c[E+0],7,-680876936),v=b(v,f,m,w,c[E+1],12,-389564586),w=b(w,v,f,m,c[E+2],17,606105819),m=b(m,w,v,f,c[E+3],22,-1044525330),f=b(f,m,w,v,c[E+4],7,-176418897),v=b(v,f,m,w,c[E+5],12,1200080426),w=b(w,v,f,m,c[E+6],17,-1473231341),m=b(m,w,v,f,c[E+7],22,-45705983),f=b(f,m,w,v,c[E+8],7,1770035416),v=b(v,f,m,w,c[E+9],12,-1958414417),w=b(w,v,f,m,c[E+10],17,-42063),m=b(m,w,v,f,c[E+11],22,-1990404162),f=b(f,m,w,v,c[E+12],7,1804603682),v=b(v,f,m,w,c[E+13],12,-40341101),w=b(w,v,f,m,c[E+14],17,-1502002290),f=g(f,m=b(m,w,v,f,c[E+15],22,1236535329),w,v,c[E+1],5,-165796510),v=g(v,f,m,w,c[E+6],9,-1069501632),w=g(w,v,f,m,c[E+11],14,643717713),m=g(m,w,v,f,c[E+0],20,-373897302),f=g(f,m,w,v,c[E+5],5,-701558691),v=g(v,f,m,w,c[E+10],9,38016083),w=g(w,v,f,m,c[E+15],14,-660478335),m=g(m,w,v,f,c[E+4],20,-405537848),f=g(f,m,w,v,c[E+9],5,568446438),v=g(v,f,m,w,c[E+14],9,-1019803690),w=g(w,v,f,m,c[E+3],14,-187363961),m=g(m,w,v,f,c[E+8],20,1163531501),f=g(f,m,w,v,c[E+13],5,-1444681467),v=g(v,f,m,w,c[E+2],9,-51403784),w=g(w,v,f,m,c[E+7],14,1735328473),f=y(f,m=g(m,w,v,f,c[E+12],20,-1926607734),w,v,c[E+5],4,-378558),v=y(v,f,m,w,c[E+8],11,-2022574463),w=y(w,v,f,m,c[E+11],16,1839030562),m=y(m,w,v,f,c[E+14],23,-35309556),f=y(f,m,w,v,c[E+1],4,-1530992060),v=y(v,f,m,w,c[E+4],11,1272893353),w=y(w,v,f,m,c[E+7],16,-155497632),m=y(m,w,v,f,c[E+10],23,-1094730640),f=y(f,m,w,v,c[E+13],4,681279174),v=y(v,f,m,w,c[E+0],11,-358537222),w=y(w,v,f,m,c[E+3],16,-722521979),m=y(m,w,v,f,c[E+6],23,76029189),f=y(f,m,w,v,c[E+9],4,-640364487),v=y(v,f,m,w,c[E+12],11,-421815835),w=y(w,v,f,m,c[E+15],16,530742520),f=p(f,m=y(m,w,v,f,c[E+2],23,-995338651),w,v,c[E+0],6,-198630844),v=p(v,f,m,w,c[E+7],10,1126891415),w=p(w,v,f,m,c[E+14],15,-1416354905),m=p(m,w,v,f,c[E+5],21,-57434055),f=p(f,m,w,v,c[E+12],6,1700485571),v=p(v,f,m,w,c[E+3],10,-1894986606),w=p(w,v,f,m,c[E+10],15,-1051523),m=p(m,w,v,f,c[E+1],21,-2054922799),f=p(f,m,w,v,c[E+8],6,1873313359),v=p(v,f,m,w,c[E+15],10,-30611744),w=p(w,v,f,m,c[E+6],15,-1560198380),m=p(m,w,v,f,c[E+13],21,1309151649),f=p(f,m,w,v,c[E+4],6,-145523070),v=p(v,f,m,w,c[E+11],10,-1120210379),w=p(w,v,f,m,c[E+2],15,718787259),m=p(m,w,v,f,c[E+9],21,-343485551),f=f+S>>>0,m=m+T>>>0,w=w+R>>>0,v=v+I>>>0}return n.endian([f,m,w,v])};a._ff=function(l,u,c,d,f,m,w){var v=l+(u&c|~u&d)+(f>>>0)+w;return(v<<m|v>>>32-m)+u},a._gg=function(l,u,c,d,f,m,w){var v=l+(u&d|c&~d)+(f>>>0)+w;return(v<<m|v>>>32-m)+u},a._hh=function(l,u,c,d,f,m,w){var v=l+(u^c^d)+(f>>>0)+w;return(v<<m|v>>>32-m)+u},a._ii=function(l,u,c,d,f,m,w){var v=l+(c^(u|~d))+(f>>>0)+w;return(v<<m|v>>>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=n.wordsToBytes(a(l,u));return u&&u.asBytes?c:u&&u.asString?s.bytesToString(c):n.bytesToHex(c)}})()},285:(e,t,r)=>{var n=r(2);e.exports=function(b){return b?(b.substr(0,2)==="{}"&&(b="\\{\\}"+b.substr(2)),E((function(g){return g.split("\\\\").join(i).split("\\{").join(o).split("\\}").join(s).split("\\,").join(a).split("\\.").join(l)})(b),!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(b){return parseInt(b,10)==b?parseInt(b,10):b.charCodeAt(0)}function c(b){return b.split(i).join("\\").split(o).join("{").split(s).join("}").split(a).join(",").split(l).join(".")}function d(b){if(!b)return[""];var g=[],y=n("{","}",b);if(!y)return b.split(",");var p=y.pre,S=y.body,T=y.post,R=p.split(",");R[R.length-1]+="{"+S+"}";var I=d(T);return T.length&&(R[R.length-1]+=I.shift(),R.push.apply(R,I)),g.push.apply(g,R),g}function f(b){return"{"+b+"}"}function m(b){return/^-?0\d/.test(b)}function w(b,g){return b<=g}function v(b,g){return b>=g}function E(b,g){var y=[],p=n("{","}",b);if(!p)return[b];var S=p.pre,T=p.post.length?E(p.post,!1):[""];if(/\$$/.test(p.pre))for(var R=0;R<T.length;R++){var I=S+"{"+p.body+"}"+T[R];y.push(I)}else{var A,D,H=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(p.body),_=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(p.body),x=H||_,z=p.body.indexOf(",")>=0;if(!x&&!z)return p.post.match(/,.*\}/)?E(b=p.pre+"{"+p.body+s+p.post):[b];if(x)A=p.body.split(/\.\./);else if((A=d(p.body)).length===1&&(A=E(A[0],!1).map(f)).length===1)return T.map((function(Z){return p.pre+A[0]+Z}));if(x){var G=u(A[0]),ne=u(A[1]),ie=Math.max(A[0].length,A[1].length),ee=A.length==3?Math.abs(u(A[2])):1,ue=w;ne<G&&(ee*=-1,ue=v);var de=A.some(m);D=[];for(var ce=G;ue(ce,ne);ce+=ee){var X;if(_)(X=String.fromCharCode(ce))==="\\"&&(X="");else if(X=String(ce),de){var oe=ie-X.length;if(oe>0){var ae=new Array(oe+1).join("0");X=ce<0?"-"+ae+X.slice(1):ae+X}}D.push(X)}}else{D=[];for(var Ce=0;Ce<A.length;Ce++)D.push.apply(D,E(A[Ce],!1))}for(Ce=0;Ce<D.length;Ce++)for(R=0;R<T.length;R++)I=S+D[Ce]+T[R],(!g||x||I)&&y.push(I)}return y}},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 r(u){var c=typeof Map=="function"?new Map:void 0;return r=function(d){if(d===null||(f=d,Function.toString.call(f).indexOf("[native code]")===-1))return d;var f;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(c!==void 0){if(c.has(d))return c.get(d);c.set(d,m)}function m(){return n(d,arguments,o(this).constructor)}return m.prototype=Object.create(d.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),i(m,d)},r(u)}function n(u,c,d){return n=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch{return!1}})()?Reflect.construct:function(f,m,w){var v=[null];v.push.apply(v,m);var E=new(Function.bind.apply(f,v));return w&&i(E,w.prototype),E},n.apply(null,arguments)}function i(u,c){return i=Object.setPrototypeOf||function(d,f){return d.__proto__=f,d},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(d){var f;return(function(m,w){if(!(m instanceof w))throw new TypeError("Cannot call a class as a function")})(this,c),(f=(function(m,w){return!w||t(w)!=="object"&&typeof w!="function"?(function(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v})(m):w})(this,o(c).call(this,d))).name="ObjectPrototypeMutationError",f}return(function(d,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(f&&f.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),f&&i(d,f)})(c,u),c})(r(Error));function a(u,c){for(var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},f=c.split("."),m=f.length,w=function(b){var g=f[b];if(!u)return{v:void 0};if(g==="+"){if(Array.isArray(u))return{v:u.map((function(p,S){var T=f.slice(b+1);return T.length>0?a(p,T.join("."),d):d(u,S,f,b)}))};var y=f.slice(0,b).join(".");throw new Error("Object at wildcard (".concat(y,") is not an array"))}u=d(u,g,f,b)},v=0;v<m;v++){var E=w(v);if(t(E)==="object")return E.v}return u}function l(u,c){return u.length===c+1}e.exports={set:function(u,c,d){if(t(u)!="object"||u===null||c===void 0)return u;if(typeof c=="number")return u[c]=d,u[c];try{return a(u,c,(function(f,m,w,v){if(f===Reflect.getPrototypeOf({}))throw new s("Attempting to mutate Object.prototype");if(!f[m]){var E=Number.isInteger(Number(w[v+1])),b=w[v+1]==="+";f[m]=E||b?[]:{}}return l(w,v)&&(f[m]=d),f[m]}))}catch(f){if(f instanceof s)throw f;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(d,f){return d[f]}))}catch{return u}},has:function(u,c){var d=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 f=!1;return a(u,c,(function(m,w,v,E){if(!l(v,E))return m&&m[w];f=d.own?m.hasOwnProperty(w):w in m})),f}catch{return!1}},hasOwn:function(u,c,d){return this.has(u,c,d||{own:!0})},isIn:function(u,c,d){var f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(u)!="object"||u===null||c===void 0)return!1;try{var m=!1,w=!1;return a(u,c,(function(v,E,b,g){return m=m||v===d||!!v&&v[E]===d,w=l(b,g)&&t(v)==="object"&&E in v,v&&v[E]})),f.validPath?m&&w:m}catch{return!1}},ObjectPrototypeMutationError:s}},47:(e,t,r)=>{var n=r(410),i=function(u){return typeof u=="string"};function o(u,c){for(var d=[],f=0;f<u.length;f++){var m=u[f];m&&m!=="."&&(m===".."?d.length&&d[d.length-1]!==".."?d.pop():c&&d.push(".."):d.push(m))}return d}var s=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a={};function l(u){return s.exec(u).slice(1)}a.resolve=function(){for(var u="",c=!1,d=arguments.length-1;d>=-1&&!c;d--){var f=d>=0?arguments[d]:ve.cwd();if(!i(f))throw new TypeError("Arguments to path.resolve must be strings");f&&(u=f+"/"+u,c=f.charAt(0)==="/")}return(c?"/":"")+(u=o(u.split("/"),!c).join("/"))||"."},a.normalize=function(u){var c=a.isAbsolute(u),d=u.substr(-1)==="/";return(u=o(u.split("/"),!c).join("/"))||c||(u="."),u&&d&&(u+="/"),(c?"/":"")+u},a.isAbsolute=function(u){return u.charAt(0)==="/"},a.join=function(){for(var u="",c=0;c<arguments.length;c++){var d=arguments[c];if(!i(d))throw new TypeError("Arguments to path.join must be strings");d&&(u+=u?"/"+d:d)}return a.normalize(u)},a.relative=function(u,c){function d(g){for(var y=0;y<g.length&&g[y]==="";y++);for(var p=g.length-1;p>=0&&g[p]==="";p--);return y>p?[]:g.slice(y,p+1)}u=a.resolve(u).substr(1),c=a.resolve(c).substr(1);for(var f=d(u.split("/")),m=d(c.split("/")),w=Math.min(f.length,m.length),v=w,E=0;E<w;E++)if(f[E]!==m[E]){v=E;break}var b=[];for(E=v;E<f.length;E++)b.push("..");return(b=b.concat(m.slice(v))).join("/")},a._makeLong=function(u){return u},a.dirname=function(u){var c=l(u),d=c[0],f=c[1];return d||f?(f&&(f=f.substr(0,f.length-1)),d+f):"."},a.basename=function(u,c){var d=l(u)[2];return c&&d.substr(-1*c.length)===c&&(d=d.substr(0,d.length-c.length)),d},a.extname=function(u){return l(u)[3]},a.format=function(u){if(!n.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 r=Object.prototype.hasOwnProperty;function n(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(r.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=n(s[1]),c=n(s[2]);u===null||c===null||u in l||(l[u]=c)}return l}},670:e=>{e.exports=function(t,r){if(r=r.split(":")[0],!(t=+t))return!1;switch(r){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]+$/,r=/^([\-\+])?(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 n={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({},n,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=r.exec(s);if(l){const u=l[1],c=l[2];let d=((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 f=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),w=""+m;return w.search(/[eE]/)!==-1||f?o.eNotation?m:i:s.indexOf(".")!==-1?w==="0"&&d===""||w===d||u&&w==="-"+d?m:i:c?d===w||u+d===w?m:i:s===w||s===u+w?m:i}}return i}var a}},737:(e,t,r)=>{var n=r(670),i=r(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 d(g){return(g||"").toString().replace(o,"")}var f=[["#","hash"],["?","query"],function(g,y){return v(y.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 w(g){var y,p=(typeof window<"u"?window:typeof Nn<"u"?Nn:typeof self<"u"?self:{}).location||{},S={},T=typeof(g=g||p);if(g.protocol==="blob:")S=new b(unescape(g.pathname),{});else if(T==="string")for(y in S=new b(g,{}),m)delete S[y];else if(T==="object"){for(y in g)y in m||(S[y]=g[y]);S.slashes===void 0&&(S.slashes=a.test(g.href))}return S}function v(g){return g==="file:"||g==="ftp:"||g==="http:"||g==="https:"||g==="ws:"||g==="wss:"}function E(g,y){g=(g=d(g)).replace(s,""),y=y||{};var p,S=u.exec(g),T=S[1]?S[1].toLowerCase():"",R=!!S[2],I=!!S[3],A=0;return R?I?(p=S[2]+S[3]+S[4],A=S[2].length+S[3].length):(p=S[2]+S[4],A=S[2].length):I?(p=S[3]+S[4],A=S[3].length):p=S[4],T==="file:"?A>=2&&(p=p.slice(2)):v(T)?p=S[4]:T?R&&(p=p.slice(2)):A>=2&&v(y.protocol)&&(p=S[4]),{protocol:T,slashes:R||v(T),slashesCount:A,rest:p}}function b(g,y,p){if(g=(g=d(g)).replace(s,""),!(this instanceof b))return new b(g,y,p);var S,T,R,I,A,D,H=f.slice(),_=typeof y,x=this,z=0;for(_!=="object"&&_!=="string"&&(p=y,y=null),p&&typeof p!="function"&&(p=i.parse),S=!(T=E(g||"",y=w(y))).protocol&&!T.slashes,x.slashes=T.slashes||S&&y.slashes,x.protocol=T.protocol||y.protocol||"",g=T.rest,(T.protocol==="file:"&&(T.slashesCount!==2||c.test(g))||!T.slashes&&(T.protocol||T.slashesCount<2||!v(x.protocol)))&&(H[3]=[/(.*)/,"pathname"]);z<H.length;z++)typeof(I=H[z])!="function"?(R=I[0],D=I[1],R!=R?x[D]=g:typeof R=="string"?~(A=R==="@"?g.lastIndexOf(R):g.indexOf(R))&&(typeof I[2]=="number"?(x[D]=g.slice(0,A),g=g.slice(A+I[2])):(x[D]=g.slice(A),g=g.slice(0,A))):(A=R.exec(g))&&(x[D]=A[1],g=g.slice(0,A.index)),x[D]=x[D]||S&&I[3]&&y[D]||"",I[4]&&(x[D]=x[D].toLowerCase())):g=I(g,x);p&&(x.query=p(x.query)),S&&y.slashes&&x.pathname.charAt(0)!=="/"&&(x.pathname!==""||y.pathname!=="")&&(x.pathname=(function(G,ne){if(G==="")return ne;for(var ie=(ne||"/").split("/").slice(0,-1).concat(G.split("/")),ee=ie.length,ue=ie[ee-1],de=!1,ce=0;ee--;)ie[ee]==="."?ie.splice(ee,1):ie[ee]===".."?(ie.splice(ee,1),ce++):ce&&(ee===0&&(de=!0),ie.splice(ee,1),ce--);return de&&ie.unshift(""),ue!=="."&&ue!==".."||ie.push(""),ie.join("/")})(x.pathname,y.pathname)),x.pathname.charAt(0)!=="/"&&v(x.protocol)&&(x.pathname="/"+x.pathname),n(x.port,x.protocol)||(x.host=x.hostname,x.port=""),x.username=x.password="",x.auth&&(~(A=x.auth.indexOf(":"))?(x.username=x.auth.slice(0,A),x.username=encodeURIComponent(decodeURIComponent(x.username)),x.password=x.auth.slice(A+1),x.password=encodeURIComponent(decodeURIComponent(x.password))):x.username=encodeURIComponent(decodeURIComponent(x.auth)),x.auth=x.password?x.username+":"+x.password:x.username),x.origin=x.protocol!=="file:"&&v(x.protocol)&&x.host?x.protocol+"//"+x.host:"null",x.href=x.toString()}b.prototype={set:function(g,y,p){var S=this;switch(g){case"query":typeof y=="string"&&y.length&&(y=(p||i.parse)(y)),S[g]=y;break;case"port":S[g]=y,n(y,S.protocol)?y&&(S.host=S.hostname+":"+y):(S.host=S.hostname,S[g]="");break;case"hostname":S[g]=y,S.port&&(y+=":"+S.port),S.host=y;break;case"host":S[g]=y,l.test(y)?(y=y.split(":"),S.port=y.pop(),S.hostname=y.join(":")):(S.hostname=y,S.port="");break;case"protocol":S.protocol=y.toLowerCase(),S.slashes=!p;break;case"pathname":case"hash":if(y){var T=g==="pathname"?"/":"#";S[g]=y.charAt(0)!==T?T+y:y}else S[g]=y;break;case"username":case"password":S[g]=encodeURIComponent(y);break;case"auth":var R=y.indexOf(":");~R?(S.username=y.slice(0,R),S.username=encodeURIComponent(decodeURIComponent(S.username)),S.password=y.slice(R+1),S.password=encodeURIComponent(decodeURIComponent(S.password))):S.username=encodeURIComponent(decodeURIComponent(y))}for(var I=0;I<f.length;I++){var A=f[I];A[4]&&(S[A[1]]=S[A[1]].toLowerCase())}return S.auth=S.password?S.username+":"+S.password:S.username,S.origin=S.protocol!=="file:"&&v(S.protocol)&&S.host?S.protocol+"//"+S.host:"null",S.href=S.toString(),S},toString:function(g){g&&typeof g=="function"||(g=i.stringify);var y,p=this,S=p.host,T=p.protocol;T&&T.charAt(T.length-1)!==":"&&(T+=":");var R=T+(p.protocol&&p.slashes||v(p.protocol)?"//":"");return p.username?(R+=p.username,p.password&&(R+=":"+p.password),R+="@"):p.password?(R+=":"+p.password,R+="@"):p.protocol!=="file:"&&v(p.protocol)&&!S&&p.pathname!=="/"&&(R+="@"),(S[S.length-1]===":"||l.test(p.hostname)&&!p.port)&&(S+=":"),R+=S+p.pathname,(y=typeof p.query=="object"?g(p.query):p.query)&&(R+=y.charAt(0)!=="?"?"?"+y:y),p.hash&&(R+=p.hash),R}},b.extractProtocol=E,b.location=w,b.trimLeft=d,b.qs=i,e.exports=b},410:()=>{},388:()=>{},805:()=>{},345:()=>{},800:()=>{}},Fy={};function vt(e){var t=Fy[e];if(t!==void 0)return t.exports;var r=Fy[e]={id:e,loaded:!1,exports:{}};return KC[e].call(r.exports,r,r.exports,vt),r.loaded=!0,r.exports}vt.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return vt.d(t,{a:t}),t},vt.d=(e,t)=>{for(var r in t)vt.o(t,r)&&!vt.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},vt.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),vt.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var xr={};vt.d(xr,{hT:()=>dr,O4:()=>wn,Kd:()=>nI,YK:()=>iI,UU:()=>u_,Gu:()=>Vy,ky:()=>ov,h4:()=>Ao,ch:()=>ea,hq:()=>Jn,i5:()=>sv});var QC=vt(737),XC=vt.n(QC);function ef(e){if(!tf(e))throw new Error("Parameter was not an error")}function tf(e){return!!e&&typeof e=="object"&&(t=e,Object.prototype.toString.call(t)==="[object Error]")||e instanceof Error;var t}class fr extends Error{constructor(t,r){const n=[...arguments],{options:i,shortMessage:o}=(function(a){let l,u="";if(a.length===0)l={};else if(tf(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}})(n);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 ef(t),t._cause&&tf(t._cause)?t._cause:null}static fullStack(t){ef(t);const r=fr.cause(t);return r?`${t.stack}
42
+ caused by: ${fr.fullStack(r)}`:t.stack??""}static info(t){ef(t);const r={},n=fr.cause(t);return n&&Object.assign(r,fr.info(n)),t._info&&Object.assign(r,t._info),r}toString(){let t=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t=`${t}: ${this.message}`),t}}var YC=vt(47),Gs=vt.n(YC);const xy="__PATH_SEPARATOR_POSIX__",Ny="__PATH_SEPARATOR_WINDOWS__";function kt(e){try{const t=e.replace(/\//g,xy).replace(/\\\\/g,Ny);return encodeURIComponent(t).split(Ny).join("\\\\").split(xy).join("/")}catch(t){throw new fr(t,"Failed encoding path")}}function Dy(e){return e.startsWith("/")?e:"/"+e}function wo(e){let t=e;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function JC(e){let t=new(XC())(e).pathname;return t.length<=0&&(t="/"),wo(t)}function Ft(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return(function(){return(function(n){var i=[];if(n.length===0)return"";if(typeof n[0]!="string")throw new TypeError("Url must be a string. Received "+n[0]);if(n[0].match(/^[^/:]+:\/*$/)&&n.length>1){var o=n.shift();n[0]=o+n[0]}n[0].match(/^file:\/\/\//)?n[0]=n[0].replace(/^([^/:]+):\/*/,"$1:///"):n[0]=n[0].replace(/^([^/:]+):\/*/,"$1://");for(var s=0;s<n.length;s++){var a=n[s];if(typeof a!="string")throw new TypeError("Url must be a string. Received "+a);a!==""&&(s>0&&(a=a.replace(/^[\/]+/,"")),a=s<n.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(((n,i,o)=>((o===0||i!=="/"||i==="/"&&n[n.length-1]!=="/")&&n.push(i),n)),[]))}var ZC=vt(542),So=vt.n(ZC);const eI="abcdef0123456789";function $y(e,t){const r=e.url.replace("//",""),n=r.indexOf("/")==-1?"/":r.slice(r.indexOf("/")),i=e.method?e.method.toUpperCase():"GET",o=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&"auth",s=`00000000${t.nc}`.slice(-8),a=(function(f,m,w,v,E,b,g){const y=g||So()(`${m}:${w}:${v}`);return f&&f.toLowerCase()==="md5-sess"?So()(`${y}:${E}:${b}`):y})(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),l=So()(`${i}:${n}`),u=o?So()(`${a}:${t.nonce}:${s}:${t.cnonce}:${o}:${l}`):So()(`${a}:${t.nonce}:${l}`),c={username:t.username,realm:t.realm,nonce:t.nonce,uri:n,qop:o,response:u,nc:s,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},d=[];for(const f in c)c[f]&&(f==="qop"||f==="nc"||f==="algorithm"?d.push(`${f}=${c[f]}`):d.push(`${f}="${c[f]}"`));return`Digest ${d.join(", ")}`}function Ly(e){return(e.headers&&e.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var tI=vt(101),My=vt.n(tI);function By(e){return My().decode(e)}function jy(e,t){var r;return`Basic ${r=`${e}:${t}`,My().encode(r)}`}const Ks=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,rI=Ks.fetch.bind(Ks),nI=Ks.Request,iI=Ks.Response;let dr=(function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e})({}),wn=(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 Uy(e,t,r,n,i){switch(e.authType){case dr.Auto:t&&r&&(e.headers.Authorization=jy(t,r));break;case dr.Digest:e.digest=(function(s,a,l){return{username:s,password:a,ha1:l,nc:0,algorithm:"md5",hasDigestAuth:!1}})(t,r,i);break;case dr.None:break;case dr.Password:e.headers.Authorization=jy(t,r);break;case dr.Token:e.headers.Authorization=`${(o=n).token_type} ${o.access_token}`;break;default:throw new fr({info:{code:wn.InvalidAuthType}},`Invalid auth type: ${e.authType}`)}var o}vt(345),vt(800);const qy="@@HOTPATCHER",oI=()=>{};function rf(e){return{original:e,methods:[e],final:!1}}class sI{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=qy}get configuration(){return this._configuration}get getEmptyAction(){return this.configuration.getEmptyAction}set getEmptyAction(t){this.configuration.getEmptyAction=t}control(t){let r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!t||t.__type__!==qy)throw new Error("Failed taking control of target HotPatcher instance: Invalid type or object");return Object.keys(t.configuration.registry).forEach((n=>{this.configuration.registry.hasOwnProperty(n)?r&&(this.configuration.registry[n]=Object.assign({},t.configuration.registry[n])):this.configuration.registry[n]=Object.assign({},t.configuration.registry[n])})),t._configuration=this.configuration,this}execute(t){const r=this.get(t)||oI;for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return r(...i)}get(t){const r=this.configuration.registry[t];if(!r)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 n=arguments.length,i=new Array(n),o=0;o<n;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]}})(...r.methods)}isPatched(t){return!!this.configuration.registry[t]}patch(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{chain:i=!1}=n;if(this.configuration.registry[t]&&this.configuration.registry[t].final)throw new Error(`Failed patching '${t}': Method marked as being final`);if(typeof r!="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(r):this.configuration.registry[t]=rf(r);else if(this.isPatched(t)){const{original:o}=this.configuration.registry[t];this.configuration.registry[t]=Object.assign(rf(r),{original:o})}else this.configuration.registry[t]=rf(r);return this}patchInline(t,r){this.isPatched(t)||this.patch(t,r);for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];return this.execute(t,...i)}plugin(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return n.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 nf=null;function Vy(){return nf||(nf=new sI),nf}function Qs(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 r=t;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(t)===r})(e)?Object.assign({},e):Object.setPrototypeOf(Object.assign({},e),Object.getPrototypeOf(e))}function zy(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];let n=null,i=[...t];for(;i.length>0;){const o=i.shift();n=n?Wy(n,o):Qs(o)}return n}function Wy(e,t){const r=Qs(e);return Object.keys(t).forEach((n=>{r.hasOwnProperty(n)?Array.isArray(t[n])?r[n]=Array.isArray(r[n])?[...r[n],...t[n]]:[...t[n]]:typeof t[n]=="object"&&t[n]?r[n]=typeof r[n]=="object"&&r[n]?Wy(r[n],t[n]):Qs(t[n]):r[n]=t[n]:r[n]=t[n]})),r}function aI(e){const t={};for(const r of e.keys())t[r]=e.get(r);return t}function of(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length===0)return{};const n={};return t.reduce(((i,o)=>(Object.keys(o).forEach((s=>{const a=s.toLowerCase();n.hasOwnProperty(a)?i[n[a]]=o[s]:(n[a]=s,i[s]=o[s])})),i)),{})}vt(805);const lI=typeof ArrayBuffer=="function",{toString:cI}=Object.prototype;function Hy(e){return lI&&(e instanceof ArrayBuffer||cI.call(e)==="[object ArrayBuffer]")}function Gy(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function sf(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}function af(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const Ky=sf((function(e){const t=e._digest;return delete e._digest,t.hasDigestAuth&&(e=zy(e,{headers:{Authorization:$y(e,t)}})),af(Xs(e),(function(r){let n=!1;return i=function(s){return n?s:r},(o=(function(){if(r.status==401)return t.hasDigestAuth=(function(s,a){if(!Ly(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}${eI[Math.floor(16*Math.random())]}`;return u})(),!0})(r,t),(function(){if(t.hasDigestAuth)return af(Xs(e=zy(e,{headers:{Authorization:$y(e,t)}})),(function(s){return s.status==401?t.hasDigestAuth=!1:t.nc++,n=!0,s}))})();t.nc++})())&&o.then?o.then(i):i(o);var i,o}))})),uI=sf((function(e,t){return af(Xs(e),(function(r){return r.ok?(t.authType=dr.Password,r):r.status==401&&Ly(r)?(t.authType=dr.Digest,Uy(t,t.username,t.password,void 0,void 0),e._digest=t.digest,Ky(e)):r}))})),Wt=sf((function(e,t){return t.authType===dr.Auto?uI(e,t):e._digest?Ky(e):Xs(e)}));function Ht(e,t,r){const n=Qs(e);return n.headers=of(t.headers,n.headers||{},r.headers||{}),r.data!==void 0&&(n.data=r.data),r.signal&&(n.signal=r.signal),t.httpAgent&&(n.httpAgent=t.httpAgent),t.httpsAgent&&(n.httpsAgent=t.httpsAgent),t.digest&&(n._digest=t.digest),typeof t.withCredentials=="boolean"&&(n.withCredentials=t.withCredentials),n}function Xs(e){const t=Vy();return t.patchInline("request",(r=>t.patchInline("fetch",rI,r.url,(function(n){let i={};const o={method:n.method};if(n.headers&&(i=of(i,n.headers)),n.data!==void 0){const[s,a]=(function(l){if(typeof l=="string")return[l,{}];if(Gy(l))return[l,{}];if(Hy(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)})(n.data);o.body=s,i=of(i,a)}return n.signal&&(o.signal=n.signal),n.withCredentials&&(o.credentials="include"),o.headers=i,o})(r))),e)}var fI=vt(285);const Ys=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},dI={"[: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]},Eo=e=>e.replace(/[[\]\\-]/g,"\\$&"),Qy=e=>e.join(""),pI=(e,t)=>{const r=t;if(e.charAt(r)!=="[")throw new Error("not in a brace expression");const n=[],i=[];let o=r+1,s=!1,a=!1,l=!1,u=!1,c=r,d="";e:for(;o<e.length;){const v=e.charAt(o);if(v!=="!"&&v!=="^"||o!==r+1){if(v==="]"&&s&&!l){c=o+1;break}if(s=!0,v!=="\\"||l){if(v==="["&&!l){for(const[E,[b,g,y]]of Object.entries(dI))if(e.startsWith(E,o)){if(d)return["$.",!1,e.length-r,!0];o+=E.length,y?i.push(b):n.push(b),a=a||g;continue e}}l=!1,d?(v>d?n.push(Eo(d)+"-"+Eo(v)):v===d&&n.push(Eo(v)),d="",o++):e.startsWith("-]",o+1)?(n.push(Eo(v+"-")),o+=2):e.startsWith("-",o+1)?(d=v,o+=2):(n.push(Eo(v)),o++)}else l=!0,o++}else u=!0,o++}if(c<o)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,e.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u)return[(f=n[0].length===2?n[0].slice(-1):n[0],f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,c-r,!1];var f;const m="["+(u?"^":"")+Qy(n)+"]",w="["+(u?"":"^")+Qy(i)+"]";return[n.length&&i.length?"("+m+"|"+w+")":n.length?m:w,a,c-r,!0]},To=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")},hI=new Set(["!","?","+","*","@"]),Xy=e=>hI.has(e),lf="(?!\\.)",mI=new Set(["[","."]),gI=new Set(["..","."]),yI=new Set("().*{}+?[]^$\\!"),cf="[^/]",Yy=cf+"*?",Jy=cf+"+?";class pr{type;#r;#n;#o=!1;#e=[];#t;#s;#l;#a=!1;#i;#c;#f=!1;constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&(this.#n=!0),this.#t=r,this.#r=this.#t?this.#t.#r:this,this.#i=this.#r===this?n:this.#r.#i,this.#l=this.#r===this?[]:this.#r.#l,t!=="!"||this.#r.#a||this.#l.push(this),this.#s=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(const t of this.#e)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}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.#r)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 r=t,n=r.#t;for(;n;){for(let i=r.#s+1;!n.type&&i<n.#e.length;i++)for(const o of t.#e){if(typeof o=="string")throw new Error("string part in extglob AST??");o.copyIn(n.#e[i])}r=n,n=r.#t}}return this}push(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];for(const i of r)if(i!==""){if(typeof i!="string"&&!(i instanceof pr&&i.#t===this))throw new Error("invalid part: "+i);this.#e.push(i)}}toJSON(){const t=this.type===null?this.#e.slice().map((r=>typeof r=="string"?r:r.toJSON())):[this.type,...this.#e.map((r=>r.toJSON()))];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#r||this.#r.#a&&this.#t?.type==="!")&&t.push({}),t}isStart(){if(this.#r===this)return!0;if(!this.#t?.isStart())return!1;if(this.#s===0)return!0;const t=this.#t;for(let r=0;r<this.#s;r++){const n=t.#e[r];if(!(n instanceof pr&&n.type==="!"))return!1}return!0}isEnd(){if(this.#r===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 r=new pr(this.type,t);for(const n of this.#e)r.copyIn(n);return r}static#u(t,r,n,i){let o=!1,s=!1,a=-1,l=!1;if(r.type===null){let m=n,w="";for(;m<t.length;){const v=t.charAt(m++);if(o||v==="\\")o=!o,w+=v;else if(s)m===a+1?v!=="^"&&v!=="!"||(l=!0):v!=="]"||m===a+2&&l||(s=!1),w+=v;else if(v!=="[")if(i.noext||!Xy(v)||t.charAt(m)!=="(")w+=v;else{r.push(w),w="";const E=new pr(v,r);m=pr.#u(t,E,m,i),r.push(E)}else s=!0,a=m,l=!1,w+=v}return r.push(w),m}let u=n+1,c=new pr(null,r);const d=[];let f="";for(;u<t.length;){const m=t.charAt(u++);if(o||m==="\\")o=!o,f+=m;else if(s)u===a+1?m!=="^"&&m!=="!"||(l=!0):m!=="]"||u===a+2&&l||(s=!1),f+=m;else if(m!=="[")if(Xy(m)&&t.charAt(u)==="("){c.push(f),f="";const w=new pr(m,c);c.push(w),u=pr.#u(t,w,u,i)}else if(m!=="|"){if(m===")")return f===""&&r.#e.length===0&&(r.#f=!0),c.push(f),f="",r.push(...d,c),u;f+=m}else c.push(f),f="",d.push(c),c=new pr(null,r);else s=!0,a=u,l=!1,f+=m}return r.type=null,r.#n=void 0,r.#e=[t.substring(n-1)],u}static fromGlob(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=new pr(null,void 0,r);return pr.#u(t,n,0,r),n}toMMPattern(){if(this!==this.#r)return this.#r.toMMPattern();const t=this.toString(),[r,n,i,o]=this.toRegExpSource();if(!(i||this.#n||this.#i.nocase&&!this.#i.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;const s=(this.#i.nocase?"i":"")+(o?"u":"");return Object.assign(new RegExp(`^${r}$`,s),{_src:r,_glob:t})}get options(){return this.#i}toRegExpSource(t){const r=t??!!this.#i.dot;if(this.#r===this&&this.#p(),!this.type){const l=this.isStart()&&this.isEnd(),u=this.#e.map((f=>{const[m,w,v,E]=typeof f=="string"?pr.#h(f,this.#n,l):f.toRegExpSource(t);return this.#n=this.#n||v,this.#o=this.#o||E,m})).join("");let c="";if(this.isStart()&&typeof this.#e[0]=="string"&&(this.#e.length!==1||!gI.has(this.#e[0]))){const f=mI,m=r&&f.has(u.charAt(0))||u.startsWith("\\.")&&f.has(u.charAt(2))||u.startsWith("\\.\\.")&&f.has(u.charAt(4)),w=!r&&!t&&f.has(u.charAt(0));c=m?"(?!(?:^|/)\\.\\.?(?:$|/))":w?lf:""}let d="";return this.isEnd()&&this.#r.#a&&this.#t?.type==="!"&&(d="(?:$|\\/)"),[c+u+d,To(u),this.#n=!!this.#n,this.#o]}const n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:";let o=this.#d(r);if(this.isStart()&&this.isEnd()&&!o&&this.type!=="!"){const l=this.toString();return this.#e=[l],this.type=null,this.#n=void 0,[l,To(this.toString()),!1,!1]}let s=!n||t||r?"":this.#d(!0);s===o&&(s=""),s&&(o=`(?:${o})(?:${s})*?`);let a="";return a=this.type==="!"&&this.#f?(this.isStart()&&!r?lf:"")+Jy:i+o+(this.type==="!"?"))"+(!this.isStart()||r||t?"":lf)+Yy+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`),[a,To(o),this.#n=!!this.#n,this.#o]}#d(t){return this.#e.map((r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");const[n,i,o,s]=r.toRegExpSource(t);return this.#o=this.#o||s,n})).filter((r=>!(this.isStart()&&this.isEnd()&&!r))).join("|")}static#h(t,r){let n=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+=(yI.has(l)?"\\":"")+l;else if(l!=="\\"){if(l==="["){const[u,c,d,f]=pI(t,a);if(d){o+=u,s=s||c,a+=d-1,r=r||f;continue}}l!=="*"?l!=="?"?o+=l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(o+=cf,r=!0):(o+=n&&t==="*"?Jy:Yy,r=!0)}else a===t.length-1?o+="\\\\":i=!0}return[o,To(t),!!r,s]}}const nr=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Ys(t),!(!r.nocomment&&t.charAt(0)==="#")&&new Js(t,r).match(e)},vI=/^\*+([^+@!?\*\[\(]*)$/,bI=e=>t=>!t.startsWith(".")&&t.endsWith(e),wI=e=>t=>t.endsWith(e),SI=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),EI=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),TI=/^\*+\.\*+$/,AI=e=>!e.startsWith(".")&&e.includes("."),RI=e=>e!=="."&&e!==".."&&e.includes("."),CI=/^\.\*+$/,II=e=>e!=="."&&e!==".."&&e.startsWith("."),_I=/^\*+$/,OI=e=>e.length!==0&&!e.startsWith("."),PI=e=>e.length!==0&&e!=="."&&e!=="..",kI=/^\?+([^+@!?\*\[\(]*)?$/,FI=e=>{let[t,r=""]=e;const n=Zy([t]);return r?(r=r.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(r)):n},xI=e=>{let[t,r=""]=e;const n=ev([t]);return r?(r=r.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(r)):n},NI=e=>{let[t,r=""]=e;const n=ev([t]);return r?i=>n(i)&&i.endsWith(r):n},DI=e=>{let[t,r=""]=e;const n=Zy([t]);return r?i=>n(i)&&i.endsWith(r):n},Zy=e=>{let[t]=e;const r=t.length;return n=>n.length===r&&!n.startsWith(".")},ev=e=>{let[t]=e;const r=t.length;return n=>n.length===r&&n!=="."&&n!==".."},tv=typeof ve=="object"&&ve?typeof ve.env=="object"&&ve.env&&ve.env.__MINIMATCH_TESTING_PLATFORM__||ve.platform:"posix";nr.sep=tv==="win32"?"\\":"/";const Nr=Symbol("globstar **");nr.GLOBSTAR=Nr,nr.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return r=>nr(r,e,t)};const Dr=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};nr.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return nr;const t=nr;return Object.assign((function(r,n){return t(r,n,Dr(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}),{Minimatch:class extends t.Minimatch{constructor(r){super(r,Dr(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(r){return t.defaults(Dr(e,r)).Minimatch}},AST:class extends t.AST{constructor(r,n){super(r,n,Dr(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}static fromGlob(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.AST.fromGlob(r,Dr(e,n))}},unescape:function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(r,Dr(e,n))},escape:function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(r,Dr(e,n))},filter:function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(r,Dr(e,n))},defaults:r=>t.defaults(Dr(e,r)),makeRe:function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(r,Dr(e,n))},braceExpand:function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(r,Dr(e,n))},match:function(r,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(r,n,Dr(e,i))},sep:t.sep,GLOBSTAR:Nr})};const rv=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ys(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:fI(e)};nr.braceExpand=rv,nr.makeRe=function(e){return new Js(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},nr.match=function(e,t){const r=new Js(t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{});return e=e.filter((n=>r.match(n))),r.options.nonull&&!e.length&&e.push(t),e};const nv=/[?*]|[+@!]\(.*?\)|\[|\]/;class Js{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ys(t),r=r||{},this.options=r,this.pattern=t,this.platform=r.platform||tv,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.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 r of t)if(typeof r!="string")return!0;return!1}debug(){}make(){const t=this.pattern,r=this.options;if(!r.nocomment&&t.charAt(0)==="#")return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=function(){return console.error(...arguments)}),this.debug(this.pattern,this.globSet);const n=this.globSet.map((o=>this.slashSplit(o)));this.globParts=this.preprocess(n),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]!=="?"&&nv.test(o[2])||nv.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 n=0;n<t.length;n++)for(let i=0;i<t[n].length;i++)t[n][i]==="**"&&(t[n][i]="*");const{optimizationLevel:r=1}=this.options;return r>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=r>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map((r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let i=n;for(;r[i+1]==="**";)i++;i!==n&&r.splice(n,i-n)}return r}))}levelOneOptimize(t){return t.map((r=>(r=r.reduce(((n,i)=>{const o=n[n.length-1];return i==="**"&&o==="**"?n:i===".."&&o&&o!==".."&&o!=="."&&o!=="**"?(n.pop(),n):(n.push(i),n)}),[])).length===0?[""]:r))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){const o=t[i];i===1&&o===""&&t[0]===""||o!=="."&&o!==""||(r=!0,t.splice(i,1),i--)}t[0]!=="."||t.length!==2||t[1]!=="."&&t[1]!==""||(r=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){const i=t[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&(r=!0,t.splice(n-1,2),n-=2)}}while(r);return t.length===0?[""]:t}firstPhasePreProcess(t){let r=!1;do{r=!1;for(let n of t){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let s=i;for(;n[s+1]==="**";)s++;s>i&&n.splice(i+1,s-i);let a=n[i+1];const l=n[i+2],u=n[i+3];if(a!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;r=!0,n.splice(i,1);const c=n.slice(0);c[i]="**",t.push(c),i--}if(!this.preserveMultipleSlashes){for(let s=1;s<n.length-1;s++){const a=n[s];s===1&&a===""&&n[0]===""||a!=="."&&a!==""||(r=!0,n.splice(s,1),s--)}n[0]!=="."||n.length!==2||n[1]!=="."&&n[1]!==""||(r=!0,n.pop())}let o=0;for(;(o=n.indexOf("..",o+1))!==-1;){const s=n[o-1];if(s&&s!=="."&&s!==".."&&s!=="**"){r=!0;const a=o===1&&n[o+1]==="**"?["."]:[];n.splice(o-1,2,...a),n.length===0&&n.push(""),o-=2}}}}while(r);return t}secondPhasePreProcess(t){for(let r=0;r<t.length-1;r++)for(let n=r+1;n<t.length;n++){const i=this.partsMatch(t[r],t[n],!this.preserveMultipleSlashes);if(i){t[r]=[],t[n]=i;break}}return t.filter((r=>r.length))}partsMatch(t,r){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],i=0,o=0,s=[],a="";for(;i<t.length&&o<r.length;)if(t[i]===r[o])s.push(a==="b"?r[o]:t[i]),i++,o++;else if(n&&t[i]==="**"&&r[o]===t[i+1])s.push(t[i]),i++;else if(n&&r[o]==="**"&&t[i]===r[o+1])s.push(r[o]),o++;else if(t[i]!=="*"||!r[o]||!this.options.dot&&r[o].startsWith(".")||r[o]==="**"){if(r[o]!=="*"||!t[i]||!this.options.dot&&t[i].startsWith(".")||t[i]==="**"||a==="a")return!1;a="b",s.push(r[o]),i++,o++}else{if(a==="b")return!1;a="a",s.push(t[i]),i++,o++}return t.length===r.length&&s}parseNegate(){if(this.nonegate)return;const t=this.pattern;let r=!1,n=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)r=!r,n++;n&&(this.pattern=t.slice(n)),this.negate=r}matchOne(t,r){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const i=this.options;if(this.isWindows){const v=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),E=!v&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),b=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),g=E?3:v?0:void 0,y=!b&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3])?3:b?0:void 0;if(typeof g=="number"&&typeof y=="number"){const[p,S]=[t[g],r[y]];p.toLowerCase()===S.toLowerCase()&&(r[y]=p,y>g?r=r.slice(y):g>y&&(t=t.slice(g)))}}const{optimizationLevel:o=1}=this.options;o>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:r}),this.debug("matchOne",t.length,r.length);for(var s=0,a=0,l=t.length,u=r.length;s<l&&a<u;s++,a++){this.debug("matchOne loop");var c=r[a],d=t[s];if(this.debug(r,c,d),c===!1)return!1;if(c===Nr){this.debug("GLOBSTAR",[r,c,d]);var f=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(;f<l;){var w=t[f];if(this.debug(`
43
+ globstar while`,t,f,r,m,w),this.matchOne(t.slice(f),r.slice(m),n))return this.debug("globstar found match!",f,l,w),!0;if(w==="."||w===".."||!i.dot&&w.charAt(0)==="."){this.debug("dot detected!",t,f,r,m);break}this.debug("globstar swallow a segment, and continue"),f++}return!(!n||(this.debug(`
44
+ >>> no match, partial?`,t,f,r,m),f!==l))}let v;if(typeof c=="string"?(v=d===c,this.debug("string match",c,d,v)):(v=c.test(d),this.debug("pattern match",c,d,v)),!v)return!1}if(s===l&&a===u)return!0;if(s===l)return n;if(a===u)return s===l-1&&t[s]==="";throw new Error("wtf?")}braceExpand(){return rv(this.pattern,this.options)}parse(t){Ys(t);const r=this.options;if(t==="**")return Nr;if(t==="")return"";let n,i=null;(n=t.match(_I))?i=r.dot?PI:OI:(n=t.match(vI))?i=(r.nocase?r.dot?EI:SI:r.dot?wI:bI)(n[1]):(n=t.match(kI))?i=(r.nocase?r.dot?xI:FI:r.dot?NI:DI)(n):(n=t.match(TI))?i=r.dot?RI:AI:(n=t.match(CI))&&(i=II);const o=pr.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 r=this.options,n=r.noglobstar?"[^/]*?":r.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",i=new Set(r.nocase?["i"]:[]);let o=t.map((l=>{const u=l.map((c=>{if(c instanceof RegExp)for(const d of c.flags.split(""))i.add(d);return typeof c=="string"?c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):c===Nr?Nr:c._src}));return u.forEach(((c,d)=>{const f=u[d+1],m=u[d-1];c===Nr&&m!==Nr&&(m===void 0?f!==void 0&&f!==Nr?u[d+1]="(?:\\/|"+n+"\\/)?"+f:u[d]=n:f===void 0?u[d-1]=m+"(?:\\/|"+n+")?":f!==Nr&&(u[d-1]=m+"(?:\\/|\\/"+n+"\\/)"+f,u[d+1]=Nr))})),u.filter((c=>c!==Nr)).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 r=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==="/"&&r)return!0;const n=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(n.matchBase&&l.length===1&&(u=[s]),this.matchOne(u,l,r))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate}static defaults(t){return nr.defaults(t).Minimatch}}function uf(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 Gt(e,t){const{status:r}=t;if(r===401&&e.digest)return t;if(r>=400)throw uf(t);return t}function Jn(e,t){return arguments.length>2&&arguments[2]!==void 0&&arguments[2]?{data:t,headers:e.headers?aI(e.headers):{},status:e.status,statusText:e.statusText}:t}nr.AST=pr,nr.Minimatch=Js,nr.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},nr.unescape=To;const $I=(iv=function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=Ht({url:Ft(e.remoteURL,kt(t)),method:"COPY",headers:{Destination:Ft(e.remoteURL,kt(r)),Overwrite:n.overwrite===!1?"F":"T",Depth:n.shallow?"0":"infinity"}},e,n);return s=function(a){Gt(e,a)},(o=Wt(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(iv.apply(this,e))}catch(r){return Promise.reject(r)}});var iv,ff=vt(635),LI=vt(829),Sn=vt.n(LI),ki=(function(e){return e.Array="array",e.Object="object",e.Original="original",e})(ki||{});function Zs(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ki.Original;const n=Sn().get(e,t);return r==="array"&&Array.isArray(n)===!1?[n]:r==="object"&&Array.isArray(n)?n[0]:n}function Ao(e){return new Promise((t=>{t((function(r){const{multistatus:n}=r;if(n==="")return{multistatus:{response:[]}};if(!n)throw new Error("Invalid response: No root multistatus found");const i={multistatus:Array.isArray(n)?n[0]:n};return Sn().set(i,"multistatus.response",Zs(i,"multistatus.response",ki.Array)),Sn().set(i,"multistatus.response",Sn().get(i,"multistatus.response").map((o=>(function(s){const a=Object.assign({},s);return a.status?Sn().set(a,"status",Zs(a,"status",ki.Object)):(Sn().set(a,"propstat",Zs(a,"propstat",ki.Object)),Sn().set(a,"propstat.prop",Zs(a,"propstat.prop",ki.Object))),a})(o)))),i})(new ff.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",textNodeName:"text",ignoreAttributes:!1,removeNSPrefix:!0,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor:(r,n,i)=>n==="true"||n==="false"?n==="true":n,tagValueProcessor(r,n,i){if(!i.endsWith("propstat.prop.displayname"))return n}}).parse(e)))}))}function ea(e,t){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const{getlastmodified:n=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:Gs().basename(t),lastmod:n,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]:""),r&&(e.displayname!==void 0&&(e.displayname=String(e.displayname)),u.props=e),u}function ov(e,t){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],n=null;try{e.multistatus.response[0].propstat&&(n=e.multistatus.response[0])}catch{}if(!n)throw new Error("Failed getting item stat: bad response");const{propstat:{prop:i,status:o}}=n,[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 ea(i,wo(t),r)}function sv(e){switch(String(e)){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(String(e),10)}}function df(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const pf=(function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}})((function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{details:n=!1}=r,i=Ht({url:Ft(e.remoteURL,kt(t)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,r);return df(Wt(i,e),(function(o){return Gt(e,o),df(o.text(),(function(s){return df(Ao(s),(function(a){const l=ov(a,t,n);return Jn(o,l,n)}))}))}))}));function av(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const MI=lv((function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=(function(o){if(!o||o==="/")return[];let s=o;const a=[];do a.push(s),s=Gs().dirname(s);while(s&&s!=="/");return a})(wo(t));n.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[uv]=="function"){let v=function(E){try{for(;!(l=d.next()).done;)if((E=s(l.value))&&E.then){if(!fv(E))return void E.then(v,c||(c=hr.bind(null,u=new Fi,2)));E=E.v}u?hr(u,1,E):u=E}catch(b){hr(u||(u=new Fi),2,b)}};var l,u,c,d=o[uv]();if(v(),d.return){var f=function(E){try{l.done||d.return()}catch{}return E};if(u&&u.then)return u.then(f,(function(E){throw f(E)}));f()}return u}if(!("length"in o))throw new TypeError("Object is not iterable");for(var m=[],w=0;w<o.length;w++)m.push(o[w]);return(function(v,E,b){var g,y,p=-1;return(function S(T){try{for(;++p<v.length&&(!b||!b());)if((T=E(p))&&T.then){if(!fv(T))return void T.then(S,y||(y=hr.bind(null,g=new Fi,2)));T=T.v}g?hr(g,1,T):g=T}catch(R){hr(g||(g=new Fi),2,R)}})(),g})(m,(function(v){return s(m[v])}),a)})(n,(function(o){return s=function(){return(function(l,u){try{var c=av(pf(e,o),(function(d){if(d.type!=="directory")throw new Error(`Path includes a file: ${t}`)}))}catch(d){return u(d)}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,cv(hf(e,o,{...r,recursive:!1}));throw l})()}))},(a=(function(){if(i)return cv(hf(e,o,{...r,recursive:!1}))})())&&a.then?a.then(s):s();var s,a}),(function(){return!1}))}));function lv(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}function BI(){}function cv(e,t){return e&&e.then?e.then(BI):Promise.resolve()}const uv=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function hr(e,t,r){if(!e.s){if(r instanceof Fi){if(!r.s)return void(r.o=hr.bind(null,e,t));1&t&&(t=r.s),r=r.v}if(r&&r.then)return void r.then(hr.bind(null,e,t),hr.bind(null,e,2));e.s=t,e.v=r;const n=e.o;n&&n(e)}}const Fi=(function(){function e(){}return e.prototype.then=function(t,r){const n=new e,i=this.s;if(i){const o=1&i?t:r;if(o){try{hr(n,1,o(this.v))}catch(s){hr(n,2,s)}return n}return this}return this.o=function(o){try{const s=o.v;1&o.s?hr(n,1,t?t(s):s):r?hr(n,1,r(s)):hr(n,2,s)}catch(s){hr(n,2,s)}},n},e})();function fv(e){return e instanceof Fi&&1&e.s}const hf=lv((function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(r.recursive===!0)return MI(e,t,r);const n=Ht({url:Ft(e.remoteURL,(i=kt(t),i.endsWith("/")?i:i+"/")),method:"MKCOL"},e,r);var i;return av(Wt(n,e),(function(o){Gt(e,o)}))}));var jI=vt(388),dv=vt.n(jI);const UI=(function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}})((function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n={};if(typeof r.range=="object"&&typeof r.range.start=="number"){let a=`bytes=${r.range.start}-`;typeof r.range.end=="number"&&(a=`${a}${r.range.end}`),n.Range=a}const i=Ht({url:Ft(e.remoteURL,kt(t)),method:"GET",headers:n},e,r);return s=function(a){if(Gt(e,a),n.Range&&a.status!==206){const l=new Error(`Invalid response code for partial request: ${a.status}`);throw l.status=a.status,l}return r.callback&&setTimeout((()=>{r.callback(a)}),0),a.body},(o=Wt(i,e))&&o.then||(o=Promise.resolve(o)),s?o.then(s):o;var o,s})),qI=()=>{},VI=(function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}})((function(e,t,r){r.url||(r.url=Ft(e.remoteURL,kt(t)));const n=Ht(r,e,{});return o=function(s){return Gt(e,s),s},(i=Wt(n,e))&&i.then||(i=Promise.resolve(i)),o?i.then(o):i;var i,o})),zI=(function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}})((function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=Ht({url:Ft(e.remoteURL,kt(t)),method:"DELETE"},e,r);return o=function(s){Gt(e,s)},(i=Wt(n,e))&&i.then||(i=Promise.resolve(i)),o?i.then(o):i;var i,o})),WI=(function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}})((function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return(function(n,i){try{var o=(s=pf(e,t,r),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(n){if(n.status===404)return!1;throw n}))}));function mf(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const HI=(function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}})((function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=Ht({url:Ft(e.remoteURL,kt(t),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:r.deep?"infinity":"1"}},e,r);return mf(Wt(n,e),(function(i){return Gt(e,i),mf(i.text(),(function(o){if(!o)throw new Error("Failed parsing directory contents: Empty response");return mf(Ao(o),(function(s){const a=Dy(t);let l=(function(u,c,d){let f=arguments.length>3&&arguments[3]!==void 0&&arguments[3],m=arguments.length>4&&arguments[4]!==void 0&&arguments[4];const w=Gs().join(c,"/"),{multistatus:{response:v}}=u,E=v.map((b=>{const g=(function(p){try{return p.replace(/^https?:\/\/[^\/]+/,"")}catch(S){throw new fr(S,"Failed normalising HREF")}})(b.href),{propstat:{prop:y}}=b;return ea(y,w==="/"?decodeURIComponent(wo(g)):wo(Gs().relative(decodeURIComponent(w),decodeURIComponent(g))),f)}));return m?E:E.filter((b=>b.basename&&(b.type==="file"||b.filename!==d.replace(/\/$/,""))))})(s,Dy(e.remoteBasePath||e.remotePath),a,r.details,r.includeSelf);return r.glob&&(l=(function(u,c){return u.filter((d=>nr(d.filename,c,{matchBase:!0})))})(l,r.glob)),Jn(i,l,r.details)}))}))}))}));function gf(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}const GI=gf((function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=Ht({url:Ft(e.remoteURL,kt(t)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[XI]},e,r);return ta(Wt(n,e),(function(i){return Gt(e,i),ta(i.text(),(function(o){return Jn(i,o,r.details)}))}))}));function ta(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const KI=gf((function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=Ht({url:Ft(e.remoteURL,kt(t)),method:"GET"},e,r);return ta(Wt(n,e),(function(i){let o;return Gt(e,i),(function(s,a){var l=s();return l&&l.then?l.then(a):a()})((function(){return ta(i.arrayBuffer(),(function(s){o=s}))}),(function(){return Jn(i,o,r.details)}))}))})),QI=gf((function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{format:n="binary"}=r;if(n!=="binary"&&n!=="text")throw new fr({info:{code:wn.InvalidOutputFormat}},`Invalid output format: ${n}`);return n==="text"?GI(e,t,r):KI(e,t,r)})),XI=e=>e;function YI(e){return new ff.XMLBuilder({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(pv({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:e}}},"d"))}function pv(e,t){const r={...e};for(const n in r)r.hasOwnProperty(n)&&(r[n]&&typeof r[n]=="object"&&n.indexOf(":")===-1?(r[`${t}:${n}`]=pv(r[n],t),delete r[n]):/^@_/.test(n)===!1&&(r[`${t}:${n}`]=r[n],delete r[n]));return r}function yf(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function hv(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}const JI=hv((function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=Ht({url:Ft(e.remoteURL,kt(t)),method:"UNLOCK",headers:{"Lock-Token":r}},e,n);return yf(Wt(i,e),(function(o){if(Gt(e,o),o.status!==204&&o.status!==200)throw uf(o)}))})),ZI=hv((function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{refreshToken:n,timeout:i=e_}=r,o={Accept:"text/plain,application/xml",Timeout:i};n&&(o.If=n);const s=Ht({url:Ft(e.remoteURL,kt(t)),method:"LOCK",headers:o,data:YI(e.contactHref)},e,r);return yf(Wt(s,e),(function(a){return Gt(e,a),yf(a.text(),(function(l){const u=(f=l,new ff.XMLParser({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(f)),c=Sn().get(u,"prop.lockdiscovery.activelock.locktoken.href"),d=Sn().get(u,"prop.lockdiscovery.activelock.timeout");var f;if(!c)throw uf(a,"No lock token received: ");return{token:c,serverTimeout:d}}))}))})),e_="Infinite, Second-4100000000";function vf(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const t_=(function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}})((function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=t.path||"/",n=Ht({url:Ft(e.remoteURL,r),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,t);return vf(Wt(n,e),(function(i){return Gt(e,i),vf(i.text(),(function(o){return vf(Ao(o),(function(s){const a=(function(l){try{const[u]=l.multistatus.response,{propstat:{prop:{"quota-used-bytes":c,"quota-available-bytes":d}}}=u;return c!==void 0&&d!==void 0?{used:parseInt(String(c),10),available:sv(d)}:null}catch{}return null})(s);return Jn(i,a,t.details)}))}))}))}));function bf(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const r_=(function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}})((function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{details:n=!1}=r,i=Ht({url:Ft(e.remoteURL,kt(t)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":e.headers["Content-Type"]||"application/xml; charset=utf-8"}},e,r);return bf(Wt(i,e),(function(o){return Gt(e,o),bf(o.text(),(function(s){return bf(Ao(s),(function(a){const l=(function(u,c,d){const f={truncated:!1,results:[]};return f.truncated=u.multistatus.response.some((m=>(m.status||m.propstat?.status).split(" ",3)?.[1]==="507"&&m.href.replace(/\/$/,"").endsWith(kt(c).replace(/\/$/,"")))),u.multistatus.response.forEach((m=>{if(m.propstat===void 0)return;const w=m.href.split("/").map(decodeURIComponent).join("/");f.results.push(ea(m.propstat.prop,w,d))})),f})(a,t,n);return Jn(o,l,n)}))}))}))})),n_=(function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}})((function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=Ht({url:Ft(e.remoteURL,kt(t)),method:"MOVE",headers:{Destination:Ft(e.remoteURL,kt(r)),Overwrite:n.overwrite===!1?"F":"T"}},e,n);return s=function(a){Gt(e,a)},(o=Wt(i,e))&&o.then||(o=Promise.resolve(o)),s?o.then(s):o;var o,s}));var i_=vt(172);const o_=(function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}})((function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const{contentLength:i=!0,overwrite:o=!0}=n,s={"Content-Type":"application/octet-stream"};i===!1||(s["Content-Length"]=typeof i=="number"?`${i}`:`${(function(c){if(Hy(c))return c.byteLength;if(Gy(c))return c.length;if(typeof c=="string")return(0,i_.d)(c);throw new fr({info:{code:wn.DataTypeNoLength}},"Cannot calculate data length: Invalid type")})(r)}`),o||(s["If-None-Match"]="*");const a=Ht({url:Ft(e.remoteURL,kt(t)),method:"PUT",headers:s,data:r},e,n);return u=function(c){try{Gt(e,c)}catch(d){const f=d;if(f.status!==412||o)throw f;return!1}return!0},(l=Wt(a,e))&&l.then||(l=Promise.resolve(l)),u?l.then(u):l;var l,u})),mv=(function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}})((function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=Ht({url:Ft(e.remoteURL,kt(t)),method:"OPTIONS"},e,r);return o=function(s){try{Gt(e,s)}catch(a){throw a}return{compliance:(s.headers.get("DAV")??"").split(",").map((a=>a.trim())),server:s.headers.get("Server")??""}},(i=Wt(n,e))&&i.then||(i=Promise.resolve(i)),o?i.then(o):i;var i,o}));function Ro(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const s_=wf((function(e,t,r,n,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(r>n||r<0)throw new fr({info:{code:wn.InvalidUpdateRange}},`Invalid update range ${r} for partial update`);const s={"Content-Type":"application/octet-stream","Content-Length":""+(n-r+1),"Content-Range":`bytes ${r}-${n}/*`},a=Ht({url:Ft(e.remoteURL,kt(t)),method:"PUT",headers:s,data:i},e,o);return Ro(Wt(a,e),(function(l){Gt(e,l)}))}));function gv(e,t){var r=e();return r&&r.then?r.then(t):t(r)}const a_=wf((function(e,t,r,n,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(r>n||r<0)throw new fr({info:{code:wn.InvalidUpdateRange}},`Invalid update range ${r} for partial update`);const s={"Content-Type":"application/x-sabredav-partialupdate","Content-Length":""+(n-r+1),"X-Update-Range":`bytes=${r}-${n}`},a=Ht({url:Ft(e.remoteURL,kt(t)),method:"PATCH",headers:s,data:i},e,o);return Ro(Wt(a,e),(function(l){Gt(e,l)}))}));function wf(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}const l_=wf((function(e,t,r,n,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};return Ro(mv(e,t,o),(function(s){let a=!1;return gv((function(){if(s.compliance.includes("sabredav-partialupdate"))return Ro(a_(e,t,r,n,i,o),(function(l){return a=!0,l}))}),(function(l){let u=!1;return a?l:gv((function(){if(s.server.includes("Apache")&&s.compliance.includes("<http://apache.org/dav/propset/fs/1>"))return Ro(s_(e,t,r,n,i,o),(function(c){return u=!0,c}))}),(function(c){if(u)return c;throw new fr({info:{code:wn.NotSupported}},"Not supported")}))}))}))})),c_="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function u_(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{authType:r=null,remoteBasePath:n,contactHref:i=c_,ha1:o,headers:s={},httpAgent:a,httpsAgent:l,password:u,token:c,username:d,withCredentials:f}=t;let m=r;m||(m=d||u?dr.Password:dr.None);const w={authType:m,remoteBasePath:n,contactHref:i,ha1:o,headers:Object.assign({},s),httpAgent:a,httpsAgent:l,password:u,remotePath:JC(e),remoteURL:e,token:c,username:d,withCredentials:f};return Uy(w,d,u,c,o),{copyFile:(v,E,b)=>$I(w,v,E,b),createDirectory:(v,E)=>hf(w,v,E),createReadStream:(v,E)=>(function(b,g){let y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const p=new(dv()).PassThrough;return UI(b,g,y).then((S=>{S.pipe(p)})).catch((S=>{p.emit("error",S)})),p})(w,v,E),createWriteStream:(v,E,b)=>(function(g,y){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},S=arguments.length>3&&arguments[3]!==void 0?arguments[3]:qI;const T=new(dv()).PassThrough,R={};p.overwrite===!1&&(R["If-None-Match"]="*");const I=Ht({url:Ft(g.remoteURL,kt(y)),method:"PUT",headers:R,data:T,maxRedirects:0},g,p);return Wt(I,g).then((A=>Gt(g,A))).then((A=>{setTimeout((()=>{S(A)}),0)})).catch((A=>{T.emit("error",A)})),T})(w,v,E,b),customRequest:(v,E)=>VI(w,v,E),deleteFile:(v,E)=>zI(w,v,E),exists:(v,E)=>WI(w,v,E),getDirectoryContents:(v,E)=>HI(w,v,E),getFileContents:(v,E)=>QI(w,v,E),getFileDownloadLink:v=>(function(E,b){let g=Ft(E.remoteURL,kt(b));const y=/^https:/i.test(g)?"https":"http";switch(E.authType){case dr.None:break;case dr.Password:{const p=By(E.headers.Authorization.replace(/^Basic /i,"").trim());g=g.replace(/^https?:\/\//,`${y}://${p}@`);break}default:throw new fr({info:{code:wn.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${E.authType}`)}return g})(w,v),getFileUploadLink:v=>(function(E,b){let g=`${Ft(E.remoteURL,kt(b))}?Content-Type=application/octet-stream`;const y=/^https:/i.test(g)?"https":"http";switch(E.authType){case dr.None:break;case dr.Password:{const p=By(E.headers.Authorization.replace(/^Basic /i,"").trim());g=g.replace(/^https?:\/\//,`${y}://${p}@`);break}default:throw new fr({info:{code:wn.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${E.authType}`)}return g})(w,v),getHeaders:()=>Object.assign({},w.headers),getQuota:v=>t_(w,v),lock:(v,E)=>ZI(w,v,E),moveFile:(v,E,b)=>n_(w,v,E,b),putFileContents:(v,E,b)=>o_(w,v,E,b),partialUpdateFileContents:(v,E,b,g,y)=>l_(w,v,E,b,g,y),getDAVCompliance:v=>mv(w,v),search:(v,E)=>r_(w,v,E),setHeaders:v=>{w.headers=Object.assign({},v)},stat:(v,E)=>pf(w,v,E),unlock:(v,E,b)=>JI(w,v,E,b)}}xr.hT,xr.O4,xr.Kd,xr.YK,xr.UU,xr.Gu,xr.ky,xr.h4,xr.ch,xr.hq,xr.i5;var Sf={},Ef={},yv;function Tf(){return yv||(yv=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",r=t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",n="["+t+"]["+r+"]*",i=new RegExp("^"+n+"$"),o=function(a,l){const u=[];let c=l.exec(a);for(;c;){const d=[];d.startIndex=l.lastIndex-c[0].length;const f=c.length;for(let m=0;m<f;m++)d.push(c[m]);u.push(d),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),d=c.length;for(let f=0;f<d;f++)u==="strict"?a[c[f]]=[l[c[f]]]:a[c[f]]=l[c[f]]}},e.getValue=function(a){return e.isExist(a)?a:""},e.isName=s,e.getAllMatches=o,e.nameRegexp=n})(Ef)),Ef}var vv;function bv(){if(vv)return Sf;vv=1;const e=Tf(),t={allowBooleanAttributes:!1,unpairedTags:[]};Sf.validate=function(b,g){g=Object.assign({},t,g);const y=[];let p=!1,S=!1;b[0]==="\uFEFF"&&(b=b.substr(1));for(let T=0;T<b.length;T++)if(b[T]==="<"&&b[T+1]==="?"){if(T+=2,T=n(b,T),T.err)return T}else if(b[T]==="<"){let R=T;if(T++,b[T]==="!"){T=i(b,T);continue}else{let I=!1;b[T]==="/"&&(I=!0,T++);let A="";for(;T<b.length&&b[T]!==">"&&b[T]!==" "&&b[T]!==" "&&b[T]!==`
45
+ `&&b[T]!=="\r";T++)A+=b[T];if(A=A.trim(),A[A.length-1]==="/"&&(A=A.substring(0,A.length-1),T--),!w(A)){let _;return A.trim().length===0?_="Invalid space after '<'.":_="Tag '"+A+"' is an invalid name.",f("InvalidTag",_,v(b,T))}const D=a(b,T);if(D===!1)return f("InvalidAttr","Attributes for '"+A+"' have open quote.",v(b,T));let H=D.value;if(T=D.index,H[H.length-1]==="/"){const _=T-H.length;H=H.substring(0,H.length-1);const x=u(H,g);if(x===!0)p=!0;else return f(x.err.code,x.err.msg,v(b,_+x.err.line))}else if(I)if(D.tagClosed){if(H.trim().length>0)return f("InvalidTag","Closing tag '"+A+"' can't have attributes or invalid starting.",v(b,R));if(y.length===0)return f("InvalidTag","Closing tag '"+A+"' has not been opened.",v(b,R));{const _=y.pop();if(A!==_.tagName){let x=v(b,_.tagStartPos);return f("InvalidTag","Expected closing tag '"+_.tagName+"' (opened in line "+x.line+", col "+x.col+") instead of closing tag '"+A+"'.",v(b,R))}y.length==0&&(S=!0)}}else return f("InvalidTag","Closing tag '"+A+"' doesn't have proper closing.",v(b,T));else{const _=u(H,g);if(_!==!0)return f(_.err.code,_.err.msg,v(b,T-H.length+_.err.line));if(S===!0)return f("InvalidXml","Multiple possible root nodes found.",v(b,T));g.unpairedTags.indexOf(A)!==-1||y.push({tagName:A,tagStartPos:R}),p=!0}for(T++;T<b.length;T++)if(b[T]==="<")if(b[T+1]==="!"){T++,T=i(b,T);continue}else if(b[T+1]==="?"){if(T=n(b,++T),T.err)return T}else break;else if(b[T]==="&"){const _=d(b,T);if(_==-1)return f("InvalidChar","char '&' is not expected.",v(b,T));T=_}else if(S===!0&&!r(b[T]))return f("InvalidXml","Extra text at the end",v(b,T));b[T]==="<"&&T--}}else{if(r(b[T]))continue;return f("InvalidChar","char '"+b[T]+"' is not expected.",v(b,T))}if(p){if(y.length==1)return f("InvalidTag","Unclosed tag '"+y[0].tagName+"'.",v(b,y[0].tagStartPos));if(y.length>0)return f("InvalidXml","Invalid '"+JSON.stringify(y.map(T=>T.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return f("InvalidXml","Start tag expected.",1);return!0};function r(b){return b===" "||b===" "||b===`
46
+ `||b==="\r"}function n(b,g){const y=g;for(;g<b.length;g++)if(b[g]=="?"||b[g]==" "){const p=b.substr(y,g-y);if(g>5&&p==="xml")return f("InvalidXml","XML declaration allowed only at the start of the document.",v(b,g));if(b[g]=="?"&&b[g+1]==">"){g++;break}else continue}return g}function i(b,g){if(b.length>g+5&&b[g+1]==="-"&&b[g+2]==="-"){for(g+=3;g<b.length;g++)if(b[g]==="-"&&b[g+1]==="-"&&b[g+2]===">"){g+=2;break}}else if(b.length>g+8&&b[g+1]==="D"&&b[g+2]==="O"&&b[g+3]==="C"&&b[g+4]==="T"&&b[g+5]==="Y"&&b[g+6]==="P"&&b[g+7]==="E"){let y=1;for(g+=8;g<b.length;g++)if(b[g]==="<")y++;else if(b[g]===">"&&(y--,y===0))break}else if(b.length>g+9&&b[g+1]==="["&&b[g+2]==="C"&&b[g+3]==="D"&&b[g+4]==="A"&&b[g+5]==="T"&&b[g+6]==="A"&&b[g+7]==="["){for(g+=8;g<b.length;g++)if(b[g]==="]"&&b[g+1]==="]"&&b[g+2]===">"){g+=2;break}}return g}const o='"',s="'";function a(b,g){let y="",p="",S=!1;for(;g<b.length;g++){if(b[g]===o||b[g]===s)p===""?p=b[g]:p!==b[g]||(p="");else if(b[g]===">"&&p===""){S=!0;break}y+=b[g]}return p!==""?!1:{value:y,index:g,tagClosed:S}}const l=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function u(b,g){const y=e.getAllMatches(b,l),p={};for(let S=0;S<y.length;S++){if(y[S][1].length===0)return f("InvalidAttr","Attribute '"+y[S][2]+"' has no space in starting.",E(y[S]));if(y[S][3]!==void 0&&y[S][4]===void 0)return f("InvalidAttr","Attribute '"+y[S][2]+"' is without value.",E(y[S]));if(y[S][3]===void 0&&!g.allowBooleanAttributes)return f("InvalidAttr","boolean attribute '"+y[S][2]+"' is not allowed.",E(y[S]));const T=y[S][2];if(!m(T))return f("InvalidAttr","Attribute '"+T+"' is an invalid name.",E(y[S]));if(!p.hasOwnProperty(T))p[T]=1;else return f("InvalidAttr","Attribute '"+T+"' is repeated.",E(y[S]))}return!0}function c(b,g){let y=/\d/;for(b[g]==="x"&&(g++,y=/[\da-fA-F]/);g<b.length;g++){if(b[g]===";")return g;if(!b[g].match(y))break}return-1}function d(b,g){if(g++,b[g]===";")return-1;if(b[g]==="#")return g++,c(b,g);let y=0;for(;g<b.length;g++,y++)if(!(b[g].match(/\w/)&&y<20)){if(b[g]===";")break;return-1}return g}function f(b,g,y){return{err:{code:b,msg:g,line:y.line||y,col:y.col}}}function m(b){return e.isName(b)}function w(b){return e.isName(b)}function v(b,g){const y=b.substring(0,g).split(/\r?\n/);return{line:y.length,col:y[y.length-1].length+1}}function E(b){return b.startIndex+b[1].length}return Sf}var ra={},wv;function f_(){if(wv)return ra;wv=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(r,n){return n},attributeValueProcessor:function(r,n){return n},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(r,n,i){return r}},t=function(r){return Object.assign({},e,r)};return ra.buildOptions=t,ra.defaultOptions=e,ra}var Af,Sv;function d_(){if(Sv)return Af;Sv=1;class e{constructor(r){this.tagname=r,this.child=[],this[":@"]={}}add(r,n){r==="__proto__"&&(r="#__proto__"),this.child.push({[r]:n})}addChild(r){r.tagname==="__proto__"&&(r.tagname="#__proto__"),r[":@"]&&Object.keys(r[":@"]).length>0?this.child.push({[r.tagname]:r.child,":@":r[":@"]}):this.child.push({[r.tagname]:r.child})}}return Af=e,Af}var Rf,Ev;function p_(){if(Ev)return Rf;Ev=1;const e=Tf();function t(u,c){const d={};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 f=1,m=!1,w=!1,v="";for(;c<u.length;c++)if(u[c]==="<"&&!w){if(m&&i(u,c)){c+=7;let E,b;[E,b,c]=r(u,c+1),b.indexOf("&")===-1&&(d[l(E)]={regx:RegExp(`&${E};`,"g"),val:b})}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(n)w=!0;else throw new Error("Invalid DOCTYPE");f++,v=""}else if(u[c]===">"){if(w?u[c-1]==="-"&&u[c-2]==="-"&&(w=!1,f--):f--,f===0)break}else u[c]==="["?m=!0:v+=u[c];if(f!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:d,i:c}}function r(u,c){let d="";for(;c<u.length&&u[c]!=="'"&&u[c]!=='"';c++)d+=u[c];if(d=d.trim(),d.indexOf(" ")!==-1)throw new Error("External entites are not supported");const f=u[c++];let m="";for(;c<u.length&&u[c]!==f;c++)m+=u[c];return[d,m,c]}function n(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 Rf=t,Rf}var Cf,Tv;function h_(){if(Tv)return Cf;Tv=1;const e=/^[-+]?0x[a-fA-F0-9]+$/,t=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,r={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function n(s,a={}){if(a=Object.assign({},r,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],d=u[2];let f=i(u[3]);if(!a.leadingZeros&&d.length>0&&c&&l[2]!==".")return s;if(!a.leadingZeros&&d.length>0&&!c&&l[1]!==".")return s;if(a.leadingZeros&&d===s)return 0;{const m=Number(l),w=""+m;return w.search(/[eE]/)!==-1?a.eNotation?m:s:l.indexOf(".")!==-1?w==="0"&&f===""||w===f||c&&w==="-"+f?m:s:d?f===w||c+f===w?m:s:l===w||l===c+w?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 Cf=n,Cf}var If,Av;function Rv(){if(Av)return If;Av=1;function e(t){return typeof t=="function"?t:Array.isArray(t)?r=>{for(const n of t)if(typeof n=="string"&&r===n||n instanceof RegExp&&n.test(r))return!0}:()=>!1}return If=e,If}var _f,Cv;function m_(){if(Cv)return _f;Cv=1;const e=Tf(),t=d_(),r=p_(),n=h_(),i=Rv();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,I)=>String.fromCharCode(Number.parseInt(I,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(R,I)=>String.fromCharCode(Number.parseInt(I,16))}},this.addExternalEntities=s,this.parseXml=d,this.parseTextData=a,this.resolveNameSpace=l,this.buildAttributesMap=c,this.isItStopNode=v,this.replaceEntitiesValue=m,this.readStopNodeData=y,this.saveTextToParentTag=w,this.addChild=f,this.ignoreAttributesFn=i(this.options.ignoreAttributes)}}function s(S){const T=Object.keys(S);for(let R=0;R<T.length;R++){const I=T[R];this.lastEntities[I]={regex:new RegExp("&"+I+";","g"),val:S[I]}}}function a(S,T,R,I,A,D,H){if(S!==void 0&&(this.options.trimValues&&!I&&(S=S.trim()),S.length>0)){H||(S=this.replaceEntitiesValue(S));const _=this.options.tagValueProcessor(T,S,R,A,D);return _==null?S:typeof _!=typeof S||_!==S?_:this.options.trimValues?p(S,this.options.parseTagValue,this.options.numberParseOptions):S.trim()===S?p(S,this.options.parseTagValue,this.options.numberParseOptions):S}}function l(S){if(this.options.removeNSPrefix){const T=S.split(":"),R=S.charAt(0)==="/"?"/":"";if(T[0]==="xmlns")return"";T.length===2&&(S=R+T[1])}return S}const u=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function c(S,T,R){if(this.options.ignoreAttributes!==!0&&typeof S=="string"){const I=e.getAllMatches(S,u),A=I.length,D={};for(let H=0;H<A;H++){const _=this.resolveNameSpace(I[H][1]);if(this.ignoreAttributesFn(_,T))continue;let x=I[H][4],z=this.options.attributeNamePrefix+_;if(_.length)if(this.options.transformAttributeName&&(z=this.options.transformAttributeName(z)),z==="__proto__"&&(z="#__proto__"),x!==void 0){this.options.trimValues&&(x=x.trim()),x=this.replaceEntitiesValue(x);const G=this.options.attributeValueProcessor(_,x,T);G==null?D[z]=x:typeof G!=typeof x||G!==x?D[z]=G:D[z]=p(x,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(D[z]=!0)}if(!Object.keys(D).length)return;if(this.options.attributesGroupName){const H={};return H[this.options.attributesGroupName]=D,H}return D}}const d=function(S){S=S.replace(/\r\n?/g,`
47
+ `);const T=new t("!xml");let R=T,I="",A="";for(let D=0;D<S.length;D++)if(S[D]==="<")if(S[D+1]==="/"){const _=b(S,">",D,"Closing Tag is not closed.");let x=S.substring(D+2,_).trim();if(this.options.removeNSPrefix){const ne=x.indexOf(":");ne!==-1&&(x=x.substr(ne+1))}this.options.transformTagName&&(x=this.options.transformTagName(x)),R&&(I=this.saveTextToParentTag(I,R,A));const z=A.substring(A.lastIndexOf(".")+1);if(x&&this.options.unpairedTags.indexOf(x)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${x}>`);let G=0;z&&this.options.unpairedTags.indexOf(z)!==-1?(G=A.lastIndexOf(".",A.lastIndexOf(".")-1),this.tagsNodeStack.pop()):G=A.lastIndexOf("."),A=A.substring(0,G),R=this.tagsNodeStack.pop(),I="",D=_}else if(S[D+1]==="?"){let _=g(S,D,!1,"?>");if(!_)throw new Error("Pi Tag is not closed.");if(I=this.saveTextToParentTag(I,R,A),!(this.options.ignoreDeclaration&&_.tagName==="?xml"||this.options.ignorePiTags)){const x=new t(_.tagName);x.add(this.options.textNodeName,""),_.tagName!==_.tagExp&&_.attrExpPresent&&(x[":@"]=this.buildAttributesMap(_.tagExp,A,_.tagName)),this.addChild(R,x,A)}D=_.closeIndex+1}else if(S.substr(D+1,3)==="!--"){const _=b(S,"-->",D+4,"Comment is not closed.");if(this.options.commentPropName){const x=S.substring(D+4,_-2);I=this.saveTextToParentTag(I,R,A),R.add(this.options.commentPropName,[{[this.options.textNodeName]:x}])}D=_}else if(S.substr(D+1,2)==="!D"){const _=r(S,D);this.docTypeEntities=_.entities,D=_.i}else if(S.substr(D+1,2)==="!["){const _=b(S,"]]>",D,"CDATA is not closed.")-2,x=S.substring(D+9,_);I=this.saveTextToParentTag(I,R,A);let z=this.parseTextData(x,R.tagname,A,!0,!1,!0,!0);z==null&&(z=""),this.options.cdataPropName?R.add(this.options.cdataPropName,[{[this.options.textNodeName]:x}]):R.add(this.options.textNodeName,z),D=_+2}else{let _=g(S,D,this.options.removeNSPrefix),x=_.tagName;const z=_.rawTagName;let G=_.tagExp,ne=_.attrExpPresent,ie=_.closeIndex;this.options.transformTagName&&(x=this.options.transformTagName(x)),R&&I&&R.tagname!=="!xml"&&(I=this.saveTextToParentTag(I,R,A,!1));const ee=R;if(ee&&this.options.unpairedTags.indexOf(ee.tagname)!==-1&&(R=this.tagsNodeStack.pop(),A=A.substring(0,A.lastIndexOf("."))),x!==T.tagname&&(A+=A?"."+x:x),this.isItStopNode(this.options.stopNodes,A,x)){let ue="";if(G.length>0&&G.lastIndexOf("/")===G.length-1)x[x.length-1]==="/"?(x=x.substr(0,x.length-1),A=A.substr(0,A.length-1),G=x):G=G.substr(0,G.length-1),D=_.closeIndex;else if(this.options.unpairedTags.indexOf(x)!==-1)D=_.closeIndex;else{const ce=this.readStopNodeData(S,z,ie+1);if(!ce)throw new Error(`Unexpected end of ${z}`);D=ce.i,ue=ce.tagContent}const de=new t(x);x!==G&&ne&&(de[":@"]=this.buildAttributesMap(G,A,x)),ue&&(ue=this.parseTextData(ue,x,A,!0,ne,!0,!0)),A=A.substr(0,A.lastIndexOf(".")),de.add(this.options.textNodeName,ue),this.addChild(R,de,A)}else{if(G.length>0&&G.lastIndexOf("/")===G.length-1){x[x.length-1]==="/"?(x=x.substr(0,x.length-1),A=A.substr(0,A.length-1),G=x):G=G.substr(0,G.length-1),this.options.transformTagName&&(x=this.options.transformTagName(x));const ue=new t(x);x!==G&&ne&&(ue[":@"]=this.buildAttributesMap(G,A,x)),this.addChild(R,ue,A),A=A.substr(0,A.lastIndexOf("."))}else{const ue=new t(x);this.tagsNodeStack.push(R),x!==G&&ne&&(ue[":@"]=this.buildAttributesMap(G,A,x)),this.addChild(R,ue,A),R=ue}I="",D=ie}}else I+=S[D];return T.child};function f(S,T,R){const I=this.options.updateTag(T.tagname,R,T[":@"]);I===!1||(typeof I=="string"&&(T.tagname=I),S.addChild(T))}const m=function(S){if(this.options.processEntities){for(let T in this.docTypeEntities){const R=this.docTypeEntities[T];S=S.replace(R.regx,R.val)}for(let T in this.lastEntities){const R=this.lastEntities[T];S=S.replace(R.regex,R.val)}if(this.options.htmlEntities)for(let T in this.htmlEntities){const R=this.htmlEntities[T];S=S.replace(R.regex,R.val)}S=S.replace(this.ampEntity.regex,this.ampEntity.val)}return S};function w(S,T,R,I){return S&&(I===void 0&&(I=T.child.length===0),S=this.parseTextData(S,T.tagname,R,!1,T[":@"]?Object.keys(T[":@"]).length!==0:!1,I),S!==void 0&&S!==""&&T.add(this.options.textNodeName,S),S=""),S}function v(S,T,R){const I="*."+R;for(const A in S){const D=S[A];if(I===D||T===D)return!0}return!1}function E(S,T,R=">"){let I,A="";for(let D=T;D<S.length;D++){let H=S[D];if(I)H===I&&(I="");else if(H==='"'||H==="'")I=H;else if(H===R[0])if(R[1]){if(S[D+1]===R[1])return{data:A,index:D}}else return{data:A,index:D};else H===" "&&(H=" ");A+=H}}function b(S,T,R,I){const A=S.indexOf(T,R);if(A===-1)throw new Error(I);return A+T.length-1}function g(S,T,R,I=">"){const A=E(S,T+1,I);if(!A)return;let D=A.data;const H=A.index,_=D.search(/\s/);let x=D,z=!0;_!==-1&&(x=D.substring(0,_),D=D.substring(_+1).trimStart());const G=x;if(R){const ne=x.indexOf(":");ne!==-1&&(x=x.substr(ne+1),z=x!==A.data.substr(ne+1))}return{tagName:x,tagExp:D,closeIndex:H,attrExpPresent:z,rawTagName:G}}function y(S,T,R){const I=R;let A=1;for(;R<S.length;R++)if(S[R]==="<")if(S[R+1]==="/"){const D=b(S,">",R,`${T} is not closed`);if(S.substring(R+2,D).trim()===T&&(A--,A===0))return{tagContent:S.substring(I,R),i:D};R=D}else if(S[R+1]==="?")R=b(S,"?>",R+1,"StopNode is not closed.");else if(S.substr(R+1,3)==="!--")R=b(S,"-->",R+3,"StopNode is not closed.");else if(S.substr(R+1,2)==="![")R=b(S,"]]>",R,"StopNode is not closed.")-2;else{const D=g(S,R,">");D&&((D&&D.tagName)===T&&D.tagExp[D.tagExp.length-1]!=="/"&&A++,R=D.closeIndex)}}function p(S,T,R){if(T&&typeof S=="string"){const I=S.trim();return I==="true"?!0:I==="false"?!1:n(S,R)}else return e.isExist(S)?S:""}return _f=o,_f}var Of={},Iv;function g_(){if(Iv)return Of;Iv=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 d=o[c],f=r(d);let m="";if(a===void 0?m=f:m=a+"."+f,f===s.textNodeName)l===void 0?l=d[f]:l+=""+d[f];else{if(f===void 0)continue;if(d[f]){let w=t(d[f],s,m);const v=i(w,s);d[":@"]?n(w,d[":@"],m,s):Object.keys(w).length===1&&w[s.textNodeName]!==void 0&&!s.alwaysCreateTextNode?w=w[s.textNodeName]:Object.keys(w).length===0&&(s.alwaysCreateTextNode?w[s.textNodeName]="":w=""),u[f]!==void 0&&u.hasOwnProperty(f)?(Array.isArray(u[f])||(u[f]=[u[f]]),u[f].push(w)):s.isArray(f,m,v)?u[f]=[w]:u[f]=w}}}return typeof l=="string"?l.length>0&&(u[s.textNodeName]=l):l!==void 0&&(u[s.textNodeName]=l),u}function r(o){const s=Object.keys(o);for(let a=0;a<s.length;a++){const l=s[a];if(l!==":@")return l}}function n(o,s,a,l){if(s){const u=Object.keys(s),c=u.length;for(let d=0;d<c;d++){const f=u[d];l.isArray(f,a+"."+f,!0,!0)?o[f]=[s[f]]:o[f]=s[f]}}}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 Of.prettify=e,Of}var Pf,_v;function y_(){if(_v)return Pf;_v=1;const{buildOptions:e}=f_(),t=m_(),{prettify:r}=g_(),n=bv();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=n.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:r(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 Pf=i,Pf}var kf,Ov;function v_(){if(Ov)return kf;Ov=1;const e=`
48
+ `;function t(a,l){let u="";return l.format&&l.indentBy.length>0&&(u=e),r(a,l,"",u)}function r(a,l,u,c){let d="",f=!1;for(let m=0;m<a.length;m++){const w=a[m],v=n(w);if(v===void 0)continue;let E="";if(u.length===0?E=v:E=`${u}.${v}`,v===l.textNodeName){let S=w[v];o(E,l)||(S=l.tagValueProcessor(v,S),S=s(S,l)),f&&(d+=c),d+=S,f=!1;continue}else if(v===l.cdataPropName){f&&(d+=c),d+=`<![CDATA[${w[v][0][l.textNodeName]}]]>`,f=!1;continue}else if(v===l.commentPropName){d+=c+`<!--${w[v][0][l.textNodeName]}-->`,f=!0;continue}else if(v[0]==="?"){const S=i(w[":@"],l),T=v==="?xml"?"":c;let R=w[v][0][l.textNodeName];R=R.length!==0?" "+R:"",d+=T+`<${v}${R}${S}?>`,f=!0;continue}let b=c;b!==""&&(b+=l.indentBy);const g=i(w[":@"],l),y=c+`<${v}${g}`,p=r(w[v],l,E,b);l.unpairedTags.indexOf(v)!==-1?l.suppressUnpairedNode?d+=y+">":d+=y+"/>":(!p||p.length===0)&&l.suppressEmptyNode?d+=y+"/>":p&&p.endsWith(">")?d+=y+`>${p}${c}</${v}>`:(d+=y+">",p&&c!==""&&(p.includes("/>")||p.includes("</"))?d+=c+l.indentBy+p+c:d+=p,d+=`</${v}>`),f=!0}return d}function n(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 d=l.attributeValueProcessor(c,a[c]);d=s(d,l),d===!0&&l.suppressBooleanAttributes?u+=` ${c.substr(l.attributeNamePrefix.length)}`:u+=` ${c.substr(l.attributeNamePrefix.length)}="${d}"`}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 kf=t,kf}var Ff,Pv;function b_(){if(Pv)return Ff;Pv=1;const e=v_(),t=Rv(),r={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 n(a){this.options=Object.assign({},r,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=`>
49
49
  `,this.newLine=`
50
- `):(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,c,u){let l="",d="";const f=u.join(".");for(let m in a)if(Object.prototype.hasOwnProperty.call(a,m))if(typeof a[m]>"u")this.isAttribute(m)&&(d+="");else if(a[m]===null)this.isAttribute(m)||m===this.options.cdataPropName?d+="":m[0]==="?"?d+=this.indentate(c)+"<"+m+"?"+this.tagEndChar:d+=this.indentate(c)+"<"+m+"/"+this.tagEndChar;else if(a[m]instanceof Date)d+=this.buildTextValNode(a[m],m,"",c);else if(typeof a[m]!="object"){const w=this.isAttribute(m);if(w&&!this.ignoreAttributesFn(w,f))l+=this.buildAttrPairStr(w,""+a[m]);else if(!w)if(m===this.options.textNodeName){let y=this.options.tagValueProcessor(m,""+a[m]);d+=this.replaceEntitiesValue(y)}else d+=this.buildTextValNode(a[m],m,"",c)}else if(Array.isArray(a[m])){const w=a[m].length;let y="",E="";for(let b=0;b<w;b++){const g=a[m][b];if(!(typeof g>"u"))if(g===null)m[0]==="?"?d+=this.indentate(c)+"<"+m+"?"+this.tagEndChar:d+=this.indentate(c)+"<"+m+"/"+this.tagEndChar;else if(typeof g=="object")if(this.options.oneListGroup){const v=this.j2x(g,c+1,u.concat(m));y+=v.val,this.options.attributesGroupName&&g.hasOwnProperty(this.options.attributesGroupName)&&(E+=v.attrStr)}else y+=this.processTextOrObjNode(g,m,c,u);else if(this.options.oneListGroup){let v=this.options.tagValueProcessor(m,g);v=this.replaceEntitiesValue(v),y+=v}else y+=this.buildTextValNode(g,m,"",c)}this.options.oneListGroup&&(y=this.buildObjectNode(y,m,E,c)),d+=y}else if(this.options.attributesGroupName&&m===this.options.attributesGroupName){const w=Object.keys(a[m]),y=w.length;for(let E=0;E<y;E++)l+=this.buildAttrPairStr(w[E],""+a[m][w[E]])}else d+=this.processTextOrObjNode(a[m],m,c,u);return{attrStr:l,val:d}},r.prototype.buildAttrPairStr=function(a,c){return c=this.options.attributeValueProcessor(a,""+c),c=this.replaceEntitiesValue(c),this.options.suppressBooleanAttributes&&c==="true"?" "+a:" "+a+'="'+c+'"'};function o(a,c,u,l){const d=this.j2x(a,u+1,l.concat(c));return a[this.options.textNodeName]!==void 0&&Object.keys(a).length===1?this.buildTextValNode(a[this.options.textNodeName],c,d.attrStr,u):this.buildObjectNode(d.val,c,d.attrStr,u)}r.prototype.buildObjectNode=function(a,c,u,l){if(a==="")return c[0]==="?"?this.indentate(l)+"<"+c+u+"?"+this.tagEndChar:this.indentate(l)+"<"+c+u+this.closeTag(c)+this.tagEndChar;{let d="</"+c+this.tagEndChar,f="";return c[0]==="?"&&(f="?",d=""),(u||u==="")&&a.indexOf("<")===-1?this.indentate(l)+"<"+c+u+f+">"+a+d:this.options.commentPropName!==!1&&c===this.options.commentPropName&&f.length===0?this.indentate(l)+`<!--${a}-->`+this.newLine:this.indentate(l)+"<"+c+u+f+this.tagEndChar+a+this.indentate(l)+d}},r.prototype.closeTag=function(a){let c="";return this.options.unpairedTags.indexOf(a)!==-1?this.options.suppressUnpairedNode||(c="/"):this.options.suppressEmptyNode?c="/":c=`></${a}`,c},r.prototype.buildTextValNode=function(a,c,u,l){if(this.options.cdataPropName!==!1&&c===this.options.cdataPropName)return this.indentate(l)+`<![CDATA[${a}]]>`+this.newLine;if(this.options.commentPropName!==!1&&c===this.options.commentPropName)return this.indentate(l)+`<!--${a}-->`+this.newLine;if(c[0]==="?")return this.indentate(l)+"<"+c+u+"?"+this.tagEndChar;{let d=this.options.tagValueProcessor(c,a);return d=this.replaceEntitiesValue(d),d===""?this.indentate(l)+"<"+c+u+this.closeTag(c)+this.tagEndChar:this.indentate(l)+"<"+c+u+">"+d+"</"+c+this.tagEndChar}},r.prototype.replaceEntitiesValue=function(a){if(a&&a.length>0&&this.options.processEntities)for(let c=0;c<this.options.entities.length;c++){const u=this.options.entities[c];a=a.replace(u.regex,u.val)}return a};function i(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 mf=r,mf}var yf,Qy;function J_(){if(Qy)return yf;Qy=1;const e=Ly(),t=Q_(),n=Y_();return yf={XMLParser:t,XMLValidator:e,XMLBuilder:n},yf}J_();class Xy{isEnabled(){return!0}isActive(t){return Fn(t,"files-trash-generic")}getTask(t){const{resourcesStore:n,spacesStore:r,clientService:{webdav:o,graphAuthenticated:i}}=t;return pn.useTask(function*(s,a,c){n.clearResourceList(),n.setAncestorMetaData({});const{resource:u,children:l}=yield o.listFiles(c,{},{depth:1,davProperties:As.Trashbin,isTrash:!0,signal:s});ee.isProjectSpaceResource(c)&&(yield r.loadGraphPermissions({ids:[c.id],graphClient:i})),n.initResourceList({currentFolder:u,resources:l})})}}class Yy{constructor(){Ee(this,"loaders");this.loaders=[new Jh,new Zh,new eg,new tg,new ng,new Xy]}getTask(){const t=yt(),n=ct(),r=sn(),o=We(),i=He(),s=st(),a=Qe(),c=Er(),u=Of(),l=this.loaders.find(d=>d.isEnabled()&&d.isActive(p(o)));if(!l){console.debug("No folder loader found for route");return}return pn.useTask(function*(...d){const f={clientService:i,configStore:s,userStore:t,spacesStore:n,capabilityStore:r,resourcesStore:a,sharesStore:c,router:o,authService:u};try{yield l.getTask(f).perform(...d)}catch(m){console.error(m)}})}}const Jy=new Yy;var Lr=(e=>(e.add="loading-service.add",e.remove="loading-service.remove",e.setProgress="loading-service.set-progress",e))(Lr||{});const Z_=200;class eI{constructor(){Ee(this,"tasks",[])}get isLoading(){return this.tasks.some(t=>t.active)}get currentProgress(){if(this.tasks.some(r=>!r.state&&r.active))return null;const t=this.tasks.filter(r=>!!r.state&&r.active);if(!t.length)return null;const n=t.reduce((r,o)=>(r+=o.state.current/o.state.total,r),0);return Math.round(n/t.length*100)}addTask(t,{debounceTime:n=Z_,indeterminate:r=!0}={}){const o={id:en.v4(),active:!1,...!r&&{state:{total:0,current:0}}};return this.tasks.length||window.addEventListener("beforeunload",this.onBeforeUnload),this.tasks.push(o),It.debounce(()=>{o.active=!0,Ke.publish("loading-service.add")},n)(),t({setProgress:({total:a,current:c})=>{r||this.setProgress({task:o,total:a,current:c})}}).finally(()=>{this.removeTask(o.id)})}removeTask(t){this.tasks=this.tasks.filter(n=>n.id!==t),this.tasks.length||window.removeEventListener("beforeunload",this.onBeforeUnload),Ke.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,Ke.publish("loading-service.set-progress")}onBeforeUnload(t){t.preventDefault()}}var tI="__lodash_hash_undefined__";function nI(e){return this.__data__.set(e,tI),this}function rI(e){return this.__data__.has(e)}function qs(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new yr;++t<n;)this.add(e[t])}qs.prototype.add=qs.prototype.push=nI,qs.prototype.has=rI;function iI(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 oI(e,t){return e.has(t)}var sI=1,aI=2;function Zy(e,t,n,r,o,i){var s=n&sI,a=e.length,c=t.length;if(a!=c&&!(s&&c>a))return!1;var u=i.get(e),l=i.get(t);if(u&&l)return u==t&&l==e;var d=-1,f=!0,m=n&aI?new qs:void 0;for(i.set(e,t),i.set(t,e);++d<a;){var w=e[d],y=t[d];if(r)var E=s?r(y,w,d,t,e,i):r(w,y,d,e,t,i);if(E!==void 0){if(E)continue;f=!1;break}if(m){if(!iI(t,function(b,g){if(!oI(m,g)&&(w===b||o(w,b,n,r,i)))return m.push(g)})){f=!1;break}}else if(!(w===y||o(w,y,n,r,i))){f=!1;break}}return i.delete(e),i.delete(t),f}function lI(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}function cI(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var uI=1,fI=2,dI="[object Boolean]",pI="[object Date]",hI="[object Error]",gI="[object Map]",mI="[object Number]",yI="[object RegExp]",bI="[object Set]",vI="[object String]",wI="[object Symbol]",SI="[object ArrayBuffer]",EI="[object DataView]",eb=xn?xn.prototype:void 0,bf=eb?eb.valueOf:void 0;function TI(e,t,n,r,o,i,s){switch(n){case EI:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case SI:return!(e.byteLength!=t.byteLength||!i(new gs(e),new gs(t)));case dI:case pI:case mI:return io(+e,+t);case hI:return e.name==t.name&&e.message==t.message;case yI:case vI:return e==t+"";case gI:var a=lI;case bI:var c=r&uI;if(a||(a=cI),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;r|=fI,s.set(e,t);var l=Zy(a(e),a(t),r,o,i,s);return s.delete(e),l;case wI:if(bf)return bf.call(e)==bf.call(t)}return!1}function vf(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function tb(e,t,n){var r=t(e);return Hn(e)?r:vf(r,n(e))}function AI(e,t){for(var n=-1,r=e==null?0:e.length,o=0,i=[];++n<r;){var s=e[n];t(s,n,e)&&(i[o++]=s)}return i}function nb(){return[]}var RI=Object.prototype,_I=RI.propertyIsEnumerable,rb=Object.getOwnPropertySymbols,ib=rb?function(e){return e==null?[]:(e=Object(e),AI(rb(e),function(t){return _I.call(e,t)}))}:nb,II=Yp(Object.keys,Object),CI=Object.prototype,PI=CI.hasOwnProperty;function FI(e){if(!Sl(e))return II(e);var t=[];for(var n in Object(e))PI.call(e,n)&&n!="constructor"&&t.push(n);return t}function OI(e){return ys(e)?uh(e):FI(e)}function ob(e){return tb(e,OI,ib)}var kI=1,xI=Object.prototype,NI=xI.hasOwnProperty;function $I(e,t,n,r,o,i){var s=n&kI,a=ob(e),c=a.length,u=ob(t),l=u.length;if(c!=l&&!s)return!1;for(var d=c;d--;){var f=a[d];if(!(s?f in t:NI.call(t,f)))return!1}var m=i.get(e),w=i.get(t);if(m&&w)return m==t&&w==e;var y=!0;i.set(e,t),i.set(t,e);for(var E=s;++d<c;){f=a[d];var b=e[f],g=t[f];if(r)var v=s?r(g,b,f,t,e,i):r(b,g,f,e,t,i);if(!(v===void 0?b===g||o(b,g,n,r,i):v)){y=!1;break}E||(E=f=="constructor")}if(y&&!E){var h=e.constructor,S=t.constructor;h!=S&&"constructor"in e&&"constructor"in t&&!(typeof h=="function"&&h instanceof h&&typeof S=="function"&&S instanceof S)&&(y=!1)}return i.delete(e),i.delete(t),y}var wf=Jr(Zn,"DataView"),Sf=Jr(Zn,"Promise"),Ef=Jr(Zn,"Set"),Tf=Jr(Zn,"WeakMap"),sb="[object Map]",DI="[object Object]",ab="[object Promise]",lb="[object Set]",cb="[object WeakMap]",ub="[object DataView]",LI=Yr(wf),MI=Yr(so),BI=Yr(Sf),jI=Yr(Ef),UI=Yr(Tf),Gn=Xr;(wf&&Gn(new wf(new ArrayBuffer(1)))!=ub||so&&Gn(new so)!=sb||Sf&&Gn(Sf.resolve())!=ab||Ef&&Gn(new Ef)!=lb||Tf&&Gn(new Tf)!=cb)&&(Gn=function(e){var t=Xr(e),n=t==DI?e.constructor:void 0,r=n?Yr(n):"";if(r)switch(r){case LI:return ub;case MI:return sb;case BI:return ab;case jI:return lb;case UI:return cb}return t});var qI=1,fb="[object Arguments]",db="[object Array]",Vs="[object Object]",VI=Object.prototype,pb=VI.hasOwnProperty;function zI(e,t,n,r,o,i){var s=Hn(e),a=Hn(t),c=s?db:Gn(e),u=a?db:Gn(t);c=c==fb?Vs:c,u=u==fb?Vs:u;var l=c==Vs,d=u==Vs,f=c==u;if(f&&lo(e)){if(!lo(t))return!1;s=!0,l=!1}if(f&&!l)return i||(i=new tr),s||Rl(e)?Zy(e,t,n,r,o,i):TI(e,t,c,n,r,o,i);if(!(n&qI)){var m=l&&pb.call(e,"__wrapped__"),w=d&&pb.call(t,"__wrapped__");if(m||w){var y=m?e.value():e,E=w?t.value():t;return i||(i=new tr),o(y,E,n,r,i)}}return f?(i||(i=new tr),$I(e,t,n,r,o,i)):!1}function hb(e,t,n,r,o){return e===t?!0:e==null||t==null||!nr(e)&&!nr(t)?e!==e&&t!==t:zI(e,t,n,r,hb,o)}function gb(e,t){return hb(e,t)}const Af=(e="")=>e.split("/").map(encodeURIComponent).join("/"),WI=e=>{const t=[],n=(r,o="")=>Object.keys(r).forEach(i=>{El(r[i])?n(r[i],`${o}${i}.`):t.push(`${o}${i}`)});return n(e),t};class HI{constructor({clientService:t,userStore:n,authStore:r,capabilityStore:o,configStore:i}){Ee(this,"clientService");Ee(this,"configStore");Ee(this,"userStore");Ee(this,"authStore");Ee(this,"capabilityStore");Ee(this,"capability");this.clientService=t,this.userStore=n,this.authStore=r,this.configStore=i,this.capability=o.filesThumbnail||{enabled:!0,version:"v0.1",supportedMimeTypes:["image/gif","image/png","image/jpeg","image/tiff","image/bmp","image/x-ms-bmp","application/vnd.geogebra.slides","application/vnd.geogebra.pinboard"]}}get available(){var t;return!!((t=this.capability)!=null&&t.version)}get supportedMimeTypes(){var t;return((t=this.capability)==null?void 0:t.supportedMimeTypes)||[]}get user(){return this.userStore.user}isMimetypeSupported(t,n=!1){return this.supportedMimeTypes.length?this.getSupportedMimeTypes(n?"image/":null).includes(t):!0}getSupportedMimeTypes(t){return t?this.supportedMimeTypes.filter(n=>n.startsWith(t)):this.supportedMimeTypes}async loadPreview(t,n=!1,r=!0,o){const{space:i,resource:s}=t,a=this.available&&this.isMimetypeSupported(s.mimeType),c=s.type!=="folder"&&s.extension&&s.canDownload();if(!a||!c)return;const u=ee.isPublicSpaceResource(i);if(!(!u&&(!this.configStore.serverUrl||!this.user.onPremisesSamAccountName||!this.authStore.accessToken))){if(u)return this.publicPreviewUrl(t,o);try{return await this.privatePreviewBlob(t,n,r,o)}catch(l){if(r)return;throw l}}}async cacheFactory(t,n,r){const{resource:o,dimensions:i}=t,s=Zl.filePreview.get(o.id.toString());if(s&&s.etag===o.etag&&gb(i,s.dimensions))return s.src;try{const a=await this.privatePreviewBlob(t,!1,!0,r);return Zl.filePreview.set(o.id.toString(),{src:a,etag:o.etag,dimensions:i},0).src}catch(a){if(n)return;throw a}}buildQueryString(t){return Y0.stringify({scalingup:t.scalingup||0,preview:Object.hasOwnProperty.call(t,"preview")?t.preview:1,a:Object.hasOwnProperty.call(t,"a")?t.a:1,...t.processor&&{processor:t.processor},...t.etag&&{c:t.etag.replaceAll('"',"")},...t.dimensions&&t.dimensions[0]&&{x:t.dimensions[0]},...t.dimensions&&t.dimensions[1]&&{y:t.dimensions[1]}})}async privatePreviewBlob(t,n=!1,r=!0,o){var u,l;const{resource:i,dimensions:s,processor:a}=t;if(n)return this.cacheFactory(t,r,o);const c=[this.configStore.serverUrl,"remote.php/dav",Af(i.webDavPath),"?",this.buildQueryString({etag:i.etag,dimensions:s,processor:a})].join("");try{const{data:d}=await this.clientService.httpAuthenticated.get(c,{responseType:"blob",signal:o});return window.URL.createObjectURL(d)}catch(d){if([425,429].includes(d.status)){const f=((l=(u=d.response)==null?void 0:u.headers)==null?void 0:l["retry-after"])||5;return await new Promise(m=>setTimeout(m,f*1e3)),this.privatePreviewBlob(t,n,r,o)}throw d}}async publicPreviewUrl(t,n){var l,d;const{resource:r,dimensions:o,processor:i}=t,[s,a]=r.downloadURL.split("?"),c=[this.buildQueryString({etag:r.etag,dimensions:o,processor:i}),a].filter(Boolean).join("&"),u=[s,c].filter(Boolean).join("?");try{const{status:f}=await this.clientService.httpUnAuthenticated.head(u,{signal:n});if(f!==404)return u}catch(f){if([425,429].includes(f.status)){const m=((d=(l=f.response)==null?void 0:l.headers)==null?void 0:d["retry-after"])||5;return await new Promise(w=>setTimeout(w,m*1e3)),this.publicPreviewUrl(t,n)}throw f}}}const zs=be.z.enum(["fit","resize","fill","thumbnail"]);class GI{constructor({$gettext:t}){Ee(this,"$gettext");this.$gettext=t}explain(t,n){return{code:"mustNotBeEmpty",message:this.$gettext("Must not be empty"),format:[],...It.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 KI{constructor({$gettext:t}){Ee(this,"$gettext");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],...It.isBoolean(n)&&{verified:n}}}assert(t,n){return Array.from(n).filter(o=>t.characters.includes(o)).length>=t.minLength}validate(t){if(!It.isObject(t))throw new Error("options should be an object");if(!It.isNumber(t.minLength)||It.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");if(!It.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 Ws{constructor({$gettext:t}){Ee(this,"$gettext");this.$gettext=t}assert(t,n){throw new Error("Method not implemented.")}explain(t,n){throw new Error("Method not implemented.")}validate(t){if(!It.isObject(t))throw new Error("options should be an object");if(!It.isNumber(t.minLength)||It.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 QI extends Ws{constructor(t){super(t)}explain(t,n){return{code:"atLeastCharacters",message:this.$gettext("%{param1}+ letters"),format:[t.minLength],...It.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>=t.minLength}}class XI extends Ws{constructor(t){super(t)}explain(t,n){return{code:"atLeastUppercaseCharacters",message:this.$gettext("%{param1}+ uppercase letters"),format:[t.minLength],...It.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/[A-Z\xC0-\xD6\xD8-\xDE]/g))==null?void 0:o.length)>=t.minLength}}class YI extends Ws{constructor(t){super(t)}explain(t,n){return{code:"atLeastLowercaseCharacters",message:this.$gettext("%{param1}+ lowercase letters"),format:[t.minLength],...It.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/[a-z\xDF-\xF6\xF8-\xFF]/g))==null?void 0:o.length)>=t.minLength}}class JI extends Ws{constructor(t){super(t)}explain(t,n){return{code:"atLeastDigits",message:this.$gettext("%{param1}+ numbers"),format:[t.minLength],...It.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/\d/g))==null?void 0:o.length)>=t.minLength}}var Rf={},mb;function ZI(){if(mb)return Rf;mb=1;var e=function(i){return Math.floor(Math.random()*i)},t=function(i){var s="",a="",c=i.length,u=i.lowercase,l=i.uppercase,d=i.numbers,f=i.symbols,m=i.minLengthLowercase,w=i.minLengthUppercase,y=i.minLengthNumbers,E=i.minLengthSymbols,b=i.exclude,g="abcdefghijklmnopqrstuvwxyz";g=n(g,b);var v="ABCDEFGHIJKLMNOPQRSTUVWXYZ";v=n(v,b);var h="0123456789";h=n(h,b);var S="!#$%&'()*+,-./:;<=>?@[]^_{|}~";S=n(S,b);for(var T=g.length,I=0;I<m;I++)a+=g.charAt(e(T));for(T=v.length,I=0;I<w;I++)a+=v.charAt(e(T));for(T=h.length,I=0;I<y;I++)a+=h.charAt(e(T));for(T=S.length,I=0;I<E;I++)a+=S.charAt(e(T));s+=function($){for(var D=$.split(""),N=D.length-1;N>0;N--){var x=Math.floor(Math.random()*(N+1)),V=D[N];D[N]=D[x],D[x]=V}return D.join("")}(a);var _="";_=u?_+g:_,_=l?_+v:_,_=d?_+h:_,_=f?_+S:_;var A=c-s.length;for(T=_.length,I=0;I<A;I++)s+=_.charAt(e(T));return s},n=function(i,s){return s==null||s.split("").forEach(function(a){i=i.replace(a,"")}),i},r=function(i){var s=i.length,a=i.lowercase,c=i.uppercase,u=i.numbers,l=i.symbols;if(i.minLengthLowercase+i.minLengthUppercase+i.minLengthNumbers+i.minLengthSymbols>s)throw new Error("Sum of Minimum Characters in the passwords greater than the length of the Password to be generated.");if(a==0&&c==0&&u==0&&l==0)throw new Error("Alphabets, Numbers and Symbols are all set to False. No valid Characters to generate the Password.")},o=function(i){return i.length=i.length===void 0?10:i.length,i.lowercase=i.lowercase===void 0||i.lowercase,i.uppercase=i.uppercase===void 0||i.uppercase,i.numbers=i.numbers===void 0||i.numbers,i.symbols=i.symbols!==void 0&&i.symbols,i.lowercase?i.minLengthLowercase=i.minLengthLowercase===void 0?1:i.minLengthLowercase:i.minLengthLowercase=0,i.uppercase?i.minLengthUppercase=i.minLengthUppercase===void 0?1:i.minLengthUppercase:i.minLengthUppercase=0,i.numbers?i.minLengthNumbers=i.minLengthNumbers===void 0?1:i.minLengthNumbers:i.minLengthNumbers=0,i.symbols?i.minLengthSymbols=i.minLengthSymbols===void 0?1:i.minLengthSymbols:i.minLengthSymbols=0,i.exclude=i.exclude===void 0?"":i.exclude,i};return Rf.GeneratePassword=function(i){return i?(i=o(i),r(i),t(i)):(i=o({length:10,lowercase:!0,uppercase:!0,numbers:!0,symbols:!1,exclude:"",minLengthLowercase:1,minLengthUppercase:1,minLengthNumbers:1,minLengthSymbols:0}),r(i),t(i))},Rf}var eC=ZI();class tC{constructor({language:t}){Ee(this,"language");Ee(this,"capability");Ee(this,"policy");Ee(this,"generatePasswordRules");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 QI({...this.language}),mustNotBeEmpty:new GI({...this.language}),atLeastUppercaseCharacters:new XI({...this.language}),atLeastLowercaseCharacters:new YI({...this.language}),atLeastDigits:new JI({...this.language}),mustContain:new KI({...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 J0.PasswordPolicy(r,n)}getPolicy({enforcePassword:t=!1}={}){return this.buildPolicy({enforcePassword:t}),this.policy}generatePassword(){return eC.GeneratePassword({symbols:!0,length:this.generatePasswordRules.length,minLengthLowercase:this.generatePasswordRules.minLowercaseCharacters,minLengthUppercase:this.generatePasswordRules.minUppercaseCharacters,minLengthNumbers:this.generatePasswordRules.minDigits,minLengthSymbols:this.generatePasswordRules.minSpecialCharacters})}}function nC(e){return e.charCodeAt(0).toString(32)}function yb(e){let t="";return e.replace(/[^A-Z0-9]/gi,n=>(t+=`-${nC(n)}`,"/"))+t}function bb(e,t){let n=t||"uppy";return typeof e.name=="string"&&(n+=`-${yb(e.name.toLowerCase())}`),e.type!==void 0&&(n+=`-${e.type}`),e.meta&&typeof e.meta.relativePath=="string"&&(n+=`-${yb(e.meta.relativePath.toLowerCase())}`),e.data.size!==void 0&&(n+=`-${e.data.size}`),e.data.lastModified!==void 0&&(n+=`-${e.data.lastModified}`),n}class rC{constructor({language:t}){Ee(this,"uppy");Ee(this,"uploadInputs",[]);Ee(this,"uploadFolderMap",{});Ee(this,"getRelativeFilePath",t=>{const n=t.data.relativePath||t.data.webkitRelativePath;return n?ee.urlJoin(n):void 0});const{$gettext:n}=t;this.uppy=new Z0({autoProceed:!1,onBeforeFileAdded:(r,o)=>(r.id in o&&(r.meta.retry=!0),r.meta.relativePath=this.getRelativeFilePath(r),r.id=bb(r,this.uppy.getID()),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()}addPlugin(t,...n){this.uppy.use(t,...n)}removePlugin(t){this.uppy.removePlugin(t)}getPlugin(t){return this.uppy.getPlugin(t)}useTus({chunkSize:t,overridePatchMethod:n,uploadDataDuringCreation:r,onBeforeRequest:o,headers:i}){const s={chunkSize:t,removeFingerprintOnSuccess:!0,overridePatchMethod:n,retryDelays:[0,500,1e3],uploadDataDuringCreation:r,limit:5,headers:i,onBeforeRequest:o,onShouldRetry:(u,l,d,f)=>{var m,w;return((m=u==null?void 0:u.originalResponse)==null?void 0:m.getStatus())>=500?!1:((w=u==null?void 0:u.originalResponse)==null?void 0:w.getStatus())===401?!0:f(u)}},a=this.uppy.getPlugin("XHRUpload");a&&this.uppy.removePlugin(a);const c=this.uppy.getPlugin("Tus");if(c){c.setOptions(s);return}this.uppy.use(ew,s)}useXhr({headers:t,timeout:n,endpoint:r}){const o={endpoint:r,method:"put",headers:t,formData:!1,timeout:n,getResponseData(){return{}}},i=this.uppy.getPlugin("Tus");i&&this.uppy.removePlugin(i);const s=this.uppy.getPlugin("XHRUpload");if(s){s.setOptions(o);return}this.uppy.use(tw,o)}tusActive(){return!!this.uppy.getPlugin("Tus")}useDropTarget({targetSelector:t}){this.uppy.getPlugin("DropTarget")||this.uppy.use(nw,{target:t,onDragOver:n=>{this.publish("drag-over",n)},onDragLeave:n=>{this.publish("drag-out",n)},onDrop:n=>{this.publish("drop",n)}})}removeDropTarget(){const t=this.uppy.getPlugin("DropTarget");t&&this.uppy.removePlugin(t)}subscribe(t,n){return Ke.subscribe(t,n)}unsubscribe(t,n){Ke.unsubscribe(t,n)}publish(t,n){Ke.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=>{!t||!t.successful.length&&!t.failed.length||(this.publish("uploadCompleted",t),t.successful.forEach(n=>{this.uppy.removeFile(n.id)}),this.clearInputs())}),this.uppy.on("upload-success",t=>{this.publish("uploadSuccess",t)}),this.uppy.on("upload-error",(t,n)=>{this.publish("uploadError",{file:t,error:n})})}registerUploadInput(t){t.getAttribute("listener")!=="true"&&(t.setAttribute("listener","true"),t.addEventListener("change",r=>{const o=r.target,i=Array.from(o.files);this.addFiles(i)}),this.uploadInputs.push(t))}removeUploadInput(t){this.uploadInputs=this.uploadInputs.filter(n=>n!==t)}generateUploadId(t){return bb(t,this.uppy.getID())}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()}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 iC(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var oC=Object.getOwnPropertySymbols,sC=oC?function(e){for(var t=[];e;)vf(t,ib(e)),e=wl(e);return t}:nb;function vb(e){return tb(e,Il,sC)}var aC=Object.prototype,lC=aC.hasOwnProperty;function cC(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&lC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function uC(e,t){var n=vl(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var fC=/\w*$/;function dC(e){var t=new e.constructor(e.source,fC.exec(e));return t.lastIndex=e.lastIndex,t}var wb=xn?xn.prototype:void 0,Sb=wb?wb.valueOf:void 0;function pC(e){return Sb?Object(Sb.call(e)):{}}var hC="[object Boolean]",gC="[object Date]",mC="[object Map]",yC="[object Number]",bC="[object RegExp]",vC="[object Set]",wC="[object String]",SC="[object Symbol]",EC="[object ArrayBuffer]",TC="[object DataView]",AC="[object Float32Array]",RC="[object Float64Array]",_C="[object Int8Array]",IC="[object Int16Array]",CC="[object Int32Array]",PC="[object Uint8Array]",FC="[object Uint8ClampedArray]",OC="[object Uint16Array]",kC="[object Uint32Array]";function xC(e,t,n){var r=e.constructor;switch(t){case EC:return vl(e);case hC:case gC:return new r(+e);case TC:return uC(e);case AC:case RC:case _C:case IC:case CC:case PC:case FC:case OC:case kC:return Qp(e,n);case mC:return new r;case yC:case wC:return new r(e);case bC:return dC(e);case vC:return new r;case SC:return pC(e)}}var NC="[object Map]";function $C(e){return nr(e)&&Gn(e)==NC}var Eb=Ii&&Ii.isMap,DC=Eb?Tl(Eb):$C,LC="[object Set]";function MC(e){return nr(e)&&Gn(e)==LC}var Tb=Ii&&Ii.isSet,BC=Tb?Tl(Tb):MC,jC=1,Ab="[object Arguments]",UC="[object Array]",qC="[object Boolean]",VC="[object Date]",zC="[object Error]",Rb="[object Function]",WC="[object GeneratorFunction]",HC="[object Map]",GC="[object Number]",_b="[object Object]",KC="[object RegExp]",QC="[object Set]",XC="[object String]",YC="[object Symbol]",JC="[object WeakMap]",ZC="[object ArrayBuffer]",eP="[object DataView]",tP="[object Float32Array]",nP="[object Float64Array]",rP="[object Int8Array]",iP="[object Int16Array]",oP="[object Int32Array]",sP="[object Uint8Array]",aP="[object Uint8ClampedArray]",lP="[object Uint16Array]",cP="[object Uint32Array]",Et={};Et[Ab]=Et[UC]=Et[ZC]=Et[eP]=Et[qC]=Et[VC]=Et[tP]=Et[nP]=Et[rP]=Et[iP]=Et[oP]=Et[HC]=Et[GC]=Et[_b]=Et[KC]=Et[QC]=Et[XC]=Et[YC]=Et[sP]=Et[aP]=Et[lP]=Et[cP]=!0,Et[zC]=Et[Rb]=Et[JC]=!1;function Hs(e,t,n,r,o,i){var s,a=t&jC;if(n&&(s=o?n(e,r,o,i):n(e)),s!==void 0)return s;if(!er(e))return e;var c=Hn(e);if(c)s=cC(e);else{var u=Gn(e),l=u==Rb||u==WC;if(lo(e))return Kp(e,a);if(u==_b||u==Ab||l&&!o)s={};else{if(!Et[u])return o?e:{};s=xC(e,u,a)}}i||(i=new tr);var d=i.get(e);if(d)return d;i.set(e,s),BC(e)?e.forEach(function(w){s.add(Hs(w,t,n,w,e,i))}):DC(e)&&e.forEach(function(w,y){s.set(y,Hs(w,t,n,y,e,i))});var f=vb,m=c?void 0:f(e);return iC(m||e,function(w,y){m&&(y=w,w=e[y]),ah(s,y,Hs(w,t,n,y,e,i))}),s}function uP(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}function fP(e,t){return t.length<2?e:Ph(e,uP(t,0,-1))}function dP(e,t){return t=Ml(t,e),e=fP(e,t),e==null||delete e[Ch(md(t))]}function pP(e){return El(e)?void 0:e}var Ib=xn?xn.isConcatSpreadable:void 0;function hP(e){return Hn(e)||ms(e)||!!(Ib&&e&&e[Ib])}function gP(e,t,n,r,o){var i=-1,s=e.length;for(n||(n=hP),o||(o=[]);++i<s;){var a=e[i];n(a)?vf(o,a):o[o.length]=a}return o}function mP(e){var t=e==null?0:e.length;return t?gP(e):[]}function yP(e){return gh(hh(e,void 0,mP),e+"")}var bP=1,vP=2,wP=4,Mi=yP(function(e,t){var n={};if(e==null)return n;var r=!1;t=Ah(t,function(i){return i=Ml(i,e),r||(r=i.length>1),i}),lh(e,vb(e),n),r&&(n=Hs(n,bP|vP|wP,pP));for(var o=t.length;o--;)dP(n,t[o]);return n});const SP=(e,t)=>{const n=(i="")=>i.split("/").filter(Boolean),r=n(e.path),o=n(t);return o.map((i,s)=>({id:en.v4(),allowContextActions:!0,text:i,to:{path:"/"+[...r].splice(0,r.length-o.length+s+1).join("/"),query:Mi(e.query,"fileId","page")},isStaticNav:!1}))},EP=(...e)=>{const t=e.pop();return[...e,{id:en.v4(),allowContextActions:t.allowContextActions,text:t.text,onClick:()=>Ke.publish("app.files.list.load"),isTruncationPlaceholder:t.isTruncationPlaceholder,isStaticNav:t.isStaticNav}]};class ii{}Ee(ii,"Cut","cut"),Ee(ii,"Copy","copy");const _f=e=>e.clientY===0,To=(e,t,n)=>{var i;const r=n.$el.getBoundingClientRect(),o=_f(t)?((i=t.target)==null?void 0:i.getBoundingClientRect().top)||0:t.clientY;e.setProps({getReferenceClientRect:()=>({width:0,height:0,top:o,bottom:o,left:t.type==="contextmenu"&&!_f(t)?t.clientX:r.x,right:t.type==="contextmenu"&&!_f(t)?t.clientX:r.x})}),e.show()},Gs=e=>(e||"").split("_")[0],oi=(e,t,n=qt.DateTime.DATETIME_MED)=>e.setLocale(Gs(t)).toLocaleString(n),Cb=(e,t,n=qt.DateTime.DATETIME_MED)=>oi(qt.DateTime.fromJSDate(e),t,n),TP=(e,t,n=qt.DateTime.DATETIME_MED)=>oi(qt.DateTime.fromHTTP(e),t,n),Pb=(e,t,n=qt.DateTime.DATETIME_MED)=>oi(qt.DateTime.fromISO(e),t,n),AP=(e,t,n=qt.DateTime.DATETIME_MED)=>oi(qt.DateTime.fromRFC2822(e),t,n),Ao=(e,t)=>e.setLocale(Gs(t)).toRelative(),Fb=(e,t)=>Ao(qt.DateTime.fromJSDate(e),t),RP=(e,t)=>Ao(qt.DateTime.fromHTTP(e),t),_P=(e,t)=>Ao(qt.DateTime.fromISO(e),t),IP=(e,t)=>Ao(qt.DateTime.fromRFC2822(e),t),CP=1048576,Tn=(e,t)=>{const n=typeof e=="string"?parseInt(e):e;return n<0?"--":isNaN(n)?"?":X0.filesize(n,{round:n<CP?0:1,locale:Gs(t),base:10,output:"string"})};function Ob(e="",t=!1){const n=ee.urlJoin(e,{leadingSlash:!0});if(n==="/")return[];const r=[],o=n.split("/");for(t&&r.push(n),o.pop();o.length>0;){if(!o.join("/")){o.pop();continue}r.push(o.join("/")),o.pop()}return r}var Tt=(e=>(e.open="sidebar.open",e.close="sidebar.close",e.toggle="sidebar.toggle",e.openWithPanel="sidebar.openWithPanel",e.setActivePanel="sidebar.setActivePanel",e))(Tt||{});const If=(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(()=>p(r),(o,i)=>{o!==i&&(o!==void 0?window.localStorage.setItem(e,typeof o=="string"?o:JSON.stringify(o)):window.localStorage.removeItem(e))},{deep:!0}),r},si=()=>{const e=st(),t=B(()=>{var f;return(f=e.options.embed)==null?void 0:f.enabled}),n=B(()=>{var f;return((f=e.options.embed)==null?void 0:f.target)==="location"}),r=B(()=>{var f;return(f=e.options.embed)==null?void 0:f.chooseFileName}),o=B(()=>{var f;return(f=e.options.embed)==null?void 0:f.chooseFileNameSuggestion}),i=B(()=>{var f;return((f=e.options.embed)==null?void 0:f.target)==="file"}),s=B(()=>{var f;return(f=e.options.embed)==null?void 0:f.fileTypes}),a=B(()=>{var f;return(f=e.options.embed)==null?void 0:f.messagesOrigin}),c=B(()=>{var f;return p(t)&&((f=e.options.embed)==null?void 0:f.delegateAuthentication)}),u=B(()=>{var f;return(f=e.options.embed)==null?void 0:f.delegateAuthenticationOrigin});return{isEnabled:t,isLocationPicker:n,chooseFileName:r,chooseFileNameSuggestion:o,isFilePicker:i,messagesTargetOrigin:a,isDelegatingAuthentication:c,fileTypes:s,postMessage:(f,m)=>{const w={};p(a)&&(w.targetOrigin=p(a)),window.parent.postMessage({name:f,data:m},w)},verifyDelegatedAuthenticationOrigin:f=>p(u)?p(u)===f:!0}},kb=e=>{const{isEnabled:t}=si(),n=(e==null?void 0:e.bus)||Ke,r=If("oc_sideBarOpen",!1),o=le(!1),i=B({get(){return p(t)?p(o):p(r)},set(w){if(p(t)){o.value=w;return}r.value=w}}),s=async()=>{await _n();const w=document.getElementById("app-sidebar");w&&w.focus()},a=le(null),c=n.subscribe(Tt.toggle,()=>{i.value=!p(i),p(i)&&s()}),u=n.subscribe(Tt.close,()=>{i.value=!1,a.value=null}),l=n.subscribe(Tt.open,()=>{i.value=!0,a.value=null,s()}),d=n.subscribe(Tt.openWithPanel,w=>{i.value=!0,a.value=w,s()}),f=n.subscribe(Tt.setActivePanel,w=>{a.value=w});Vn(()=>{n.unsubscribe(Tt.toggle,c),n.unsubscribe(Tt.close,u),n.unsubscribe(Tt.open,l),n.unsubscribe(Tt.openWithPanel,d),n.unsubscribe(Tt.setActivePanel,f)});const m=(w,y)=>{n.subscribe(Tt.setActivePanel,E=>{w===E&&setTimeout(()=>{y(E)},100)})};return{isSideBarOpen:fr(i),sideBarActivePanel:fr(a),onPanelActive:m}},An=e=>e,xb=e=>ee.ShareTypes.containsAnyValue(ee.ShareTypes.authenticated,e??[]),Nb=e=>ee.ShareTypes.containsAnyValue(ee.ShareTypes.unauthenticated,e??[]),PP=({isDirect:e})=>An(e?"This item is directly shared with others.":"This item is shared with others through one of the parent folders."),FP=({isDirect:e})=>An(e?"This item is directly shared via links.":"This item is shared via links through one of the parent folders."),OP=({resource:e,isDirect:t})=>({id:`files-sharing-${e.getDomSelector()}`,accessibleDescription:PP({isDirect:t}),label:An("Show invited people"),icon:"group",category:"sharing",type:t?"user-direct":"user-indirect",fillType:"line",handler:()=>{Ke.publish(Tt.openWithPanel,"sharing#peopleShares")}}),kP=({resource:e,isDirect:t})=>({id:`file-link-${e.getDomSelector()}`,accessibleDescription:FP({isDirect:t}),label:An("Show links"),icon:"link",category:"sharing",type:t?"link-direct":"link-indirect",fillType:"line",handler:()=>{Ke.publish(Tt.openWithPanel,"sharing#linkShares")}}),xP=({resource:e})=>({id:`resource-locked-${e.getDomSelector()}`,accessibleDescription:An("Item locked"),label:An("This item is locked"),icon:"lock",category:"system",type:"resource-locked",fillType:"line"}),NP=({resource:e})=>({id:`resource-processing-${e.getDomSelector()}`,accessibleDescription:An("Item in processing"),label:An("This item is in processing"),icon:"loop-right",category:"system",type:"resource-processing",fillType:"line"}),$P=({resource:e})=>({id:`resource-space-enabled-${e.getDomSelector()}`,accessibleDescription:An("Space is enabled"),label:An("This space is enabled"),icon:"play-circle",category:"space",type:"resource-space-enabled",fillType:"line"}),DP=({resource:e})=>({id:`resource-space-disabled-${e.getDomSelector()}`,accessibleDescription:An("Space is disabled"),label:An("This space is disabled"),icon:"stop-circle",category:"space",type:"resource-space-disabled",fillType:"line"}),$b=({space:e,resource:t,ancestorMetaData:n,user:r})=>{const o=[];if(t.locked&&o.push(xP({resource:t})),t.processing&&o.push(NP({resource:t})),ee.isProjectSpaceResource(t)&&!t.disabled&&o.push($P({resource:t})),ee.isProjectSpaceResource(t)&&t.disabled&&o.push(DP({resource:t})),ee.isProjectSpaceResource(e)||ee.isPersonalSpaceResource(e)&&e.isOwner(r)){const s=Object.values(n).reduce((u,l)=>(u.push(...l.shareTypes||[]),u),[]),a=xb(t.shareTypes);(a||xb(s))&&o.push(OP({resource:t,isDirect:a}));const c=Nb(t.shareTypes);(c||Nb(s))&&o.push(kP({resource:t,isDirect:c}))}return o},Db=e=>new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=o=>n(o),r.readAsArrayBuffer(e)}),Lb=e=>new Promise(t=>e.toBlob(t)),Ks=()=>window.navigator.platform.match("Mac"),tt=Ue.defineStore("messages",()=>{const e=le([]),t=i=>{const s={...i,id:en.v4()};return e.value.push(s),s},n=i=>{const s=a=>{var c,u;return(u=(c=a.response)==null?void 0:c.headers)==null?void 0:u.get("x-request-id")};return i.map(a=>s(a)).filter(Boolean).map(a=>`X-Request-Id: ${a}`).join(`\r
51
- `)};return{messages:e,showMessage:t,showErrorMessage:i=>{const s={id:en.v4(),status:"danger",timeout:0,...i.errors&&{errorLogContent:n(i.errors)},...i};return e.value.push(s),s},removeMessage:i=>{e.value=p(e).filter(({id:s})=>i.id!==s)}}}),Ro=Ue.defineStore("clipboard",()=>{const{$gettext:e}=Fe.useGettext(),{showMessage:t}=tt(),n=le(),r=le([]);return{action:n,resources:r,copyResources:a=>{a[0].canDownload()&&(n.value=ii.Copy,r.value=a,t({title:e("Copied to clipboard!"),status:"success"}))},cutResources:a=>{a[0].canDownload()&&(n.value=ii.Cut,r.value=a,t({title:e("Cut to clipboard!"),status:"success"}))},clearClipboard:()=>{n.value=void 0,r.value=[]}}}),Mb={cernFeatures:!1,concurrentRequests:{resourceBatchActions:4,shares:{create:4,list:2},sse:4,avatars:4},contextHelpers:!0,contextHelpersReadMore:!0,defaultExtension:"files",disabledExtensions:[],disableFeedbackLink:!0,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},st=Ue.defineStore("config",()=>{const e=ir(),t=le(""),n=le(""),r=le({...Mb}),o=le([]),i=le([]),s=le([]),a=le(),c=le(),u=le(),l=le([]),d=le([]),f=B(()=>ee.urlJoin(p(t)||window.location.origin,{trailingSlash:!0})),m=B(()=>!!p(a)),w=B(()=>!!p(c));return{options:r,oAuth2:a,openIdConnect:c,isOAuth2:m,isOIDC:w,customTranslations:s,apps:o,externalApps:i,sentry:u,theme:n,scripts:l,styles:d,serverUrl:f,loadConfig:E=>{var b;E.server&&(t.value=(b=E.server)!=null&&b.endsWith("/")?E.server:E.server+"/"),o.value=E.apps||[],s.value=E.customTranslations||[],a.value=E.auth,c.value=E.openIdConnect,u.value=E.sentry,l.value=E.scripts||[],d.value=E.styles||[],n.value=E.theme,E.options&&(r.value=uo({...Mb},E.options),p(r).ocm.openRemotely=p(r).cernFeatures,p(r).routing.idBased=!p(r).cernFeatures,p(r).routing.fullShareOwnerPaths=p(r).cernFeatures),E.external_apps&&(i.value=E.external_apps,E.external_apps.filter(Boolean).forEach(g=>{e.loadExternalAppConfig({appId:g.id,config:g.config})}))}}}),LP=be.z.object({url:be.z.string()}),MP=be.z.object({apiUrl:be.z.string().optional(),authUrl:be.z.string().optional(),clientId:be.z.string().optional(),clientSecret:be.z.string().optional(),logoutUrl:be.z.string().optional(),metaDataUrl:be.z.string().optional(),url:be.z.string().optional()}),BP=be.z.object({authority:be.z.string().optional(),client_id:be.z.string().optional(),client_secret:be.z.string().optional(),dynamic:be.z.string().optional(),metadata_url:be.z.string().optional(),post_logout_redirect_uri:be.z.string().optional(),response_type:be.z.string().optional(),scope:be.z.string().optional()}).passthrough(),jP=be.z.record(be.z.any()),UP=be.z.object({href:be.z.string().optional()}),qP=be.z.object({async:be.z.boolean().optional(),src:be.z.string().optional()}),VP=be.z.object({cernFeatures:be.z.boolean().optional(),concurrentRequests:be.z.object({resourceBatchActions:be.z.number().optional(),sse:be.z.number().optional(),shares:be.z.object({create:be.z.number().optional(),list:be.z.number().optional()}).optional(),avatars:be.z.number().optional()}).optional(),contextHelpers:be.z.boolean().optional(),contextHelpersReadMore:be.z.boolean().optional(),defaultExtension:be.z.string().optional(),disabledExtensions:be.z.array(be.z.string()).optional(),disableFeedbackLink:be.z.boolean().optional(),accountEditLink:be.z.object({href:be.z.string().optional()}).optional(),editor:be.z.object({autosaveEnabled:be.z.boolean().optional(),autosaveInterval:be.z.number().optional(),openAsPreview:be.z.union([be.z.boolean(),be.z.array(be.z.string())]).optional()}).optional(),embed:be.z.object({enabled:be.z.boolean().optional(),target:be.z.string().optional(),messagesOrigin:be.z.string().optional(),delegateAuthentication:be.z.boolean().optional(),delegateAuthenticationOrigin:be.z.string().optional(),fileTypes:be.z.array(be.z.string()).optional(),chooseFileName:be.z.boolean().optional(),chooseFileNameSuggestion:be.z.string().optional()}).optional(),feedbackLink:be.z.object({ariaLabel:be.z.string().optional(),description:be.z.string().optional(),href:be.z.string().optional()}).optional(),isRunningOnEos:be.z.boolean().optional(),loginUrl:be.z.string().optional(),logoutUrl:be.z.string().optional(),ocm:be.z.object({openRemotely:be.z.boolean().optional()}).optional(),routing:be.z.object({fullShareOwnerPaths:be.z.boolean().optional(),idBased:be.z.boolean().optional()}).optional(),runningOnEos:be.z.boolean().optional(),tokenStorageLocal:be.z.boolean().optional(),upload:be.z.object({companionUrl:be.z.string().optional()}).optional(),userListRequiresFilter:be.z.boolean().optional(),hideLogo:be.z.boolean().optional()}),zP=be.z.object({id:be.z.string(),path:be.z.string(),config:be.z.record(be.z.unknown()).optional()}),WP=be.z.object({server:be.z.string(),theme:be.z.string(),options:VP,apps:be.z.array(be.z.string()).optional(),external_apps:be.z.array(zP).optional(),customTranslations:be.z.array(LP).optional(),auth:MP.optional(),openIdConnect:BP.optional(),sentry:jP.optional(),scripts:be.z.array(qP).optional(),styles:be.z.array(UP).optional()}),Bb=Ue.defineStore("extensionPreferences",()=>{const e=Vr.useLocalStorage("extensionPreferences",{});return{extensionPreferences:e,extractDefaultExtensionIds:(o,i)=>o.multiple?i.map(s=>s.id):o.defaultExtensionId?[o.defaultExtensionId]:[],getExtensionPreference:(o,i)=>{const s=e.value[o];return s||{extensionPointId:o,selectedExtensionIds:i}},setSelectedExtensionIds:(o,i)=>{if(!Object.hasOwn(p(e),o)){e.value[o]={extensionPointId:o,selectedExtensionIds:i};return}e.value[o].selectedExtensionIds=i}}}),Bi=Ue.defineStore("extensionRegistry",()=>{const e=st(),t=le([]),n=u=>{t.value.push(u)},r=u=>{t.value=p(t).map(l=>le(p(l).filter(({id:d})=>!u.includes(d)))).filter(l=>p(l).length)},o=u=>{if(!u.id||!u.extensionType)throw new Error("ExtensionPoint must have an id and an extensionType");return p(t).flatMap(l=>p(l).filter(d=>{var f;return d.type===u.extensionType&&!e.options.disabledExtensions.includes(d.id)&&(!d.extensionPointIds||((f=d.extensionPointIds)==null?void 0:f.includes(u.id)))}))},i=le([]);return{extensions:t,registerExtensions:n,unregisterExtensions:r,requestExtensions:o,extensionPoints:i,registerExtensionPoints:u=>{i.value.push(u)},unregisterExtensionPoints:u=>{i.value=p(i).map(l=>le(p(l).filter(({id:d})=>!u.includes(d)))).filter(l=>p(l).length)},getExtensionPoints:(u={})=>p(i).flatMap(l=>p(l).filter(d=>!(Object.hasOwn(u,"extensionType")&&d.extensionType!==u.extensionType)))}}),pt=Ue.defineStore("modals",()=>{const e=le([]),t=B(()=>p(e).at(-1)),n=c=>p(e).find(u=>u.id===c);return{modals:e,activeModal:t,dispatchModal:c=>{const u={...c,id:en.v4()};return e.value.push(u),u},updateModal:(c,u,l)=>{const d=n(c);d[u]=l},removeModal:c=>{e.value=p(e).filter(u=>u.id!==c)},removeAllModals:()=>{e.value=[]},setModalActive:c=>{const u=p(e).findIndex(d=>d.id===c);if(u<0)return;const l=n(c);p(e).splice(u,1),e.value.push(l)}}}),yt=Ue.defineStore("user",()=>{const e=le();return{user:e,setUser:r=>{e.value=r,iw.setUser({username:r.onPremisesSamAccountName})},reset:()=>{e.value=null}}}),Qs=(e,t)=>{t!==void 0&&document.querySelector(":root").style.setProperty("--oc-"+e,t)},HP="thead-clicked",GP="highlight",KP="rowMounted",QP="contextmenuClicked",jb="itemDropped",XP="itemDragged",YP=["xsmall","small","medium","large","xlarge","xxlarge","xxxlarge"];let JP="";const ZP=()=>JP,eF={xxxsmall:"xxxs",xxsmall:"xxs",xsmall:"xs",small:"s",medium:"m",large:"l",xlarge:"xl",xxlarge:"xxl",xxxlarge:"xxxl",remove:"rm"};function Mr(e){return eF[e]}let Ub=0;const Xs=(e="")=>(e=e||"",Ub+=1,e+Ub);function tF(e,t,n,r){for(var o=-1,i=e==null?0:e.length;++o<i;)n=t(n,e[o],o,e);return n}function nF(e){return function(t){return e==null?void 0:e[t]}}var rF={À:"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"},iF=nF(rF),oF=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,sF="\\u0300-\\u036f",aF="\\ufe20-\\ufe2f",lF="\\u20d0-\\u20ff",cF=sF+aF+lF,uF="["+cF+"]",fF=RegExp(uF,"g");function dF(e){return e=Ll(e),e&&e.replace(oF,iF).replace(fF,"")}var pF=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function hF(e){return e.match(pF)||[]}var gF=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function mF(e){return gF.test(e)}var qb="\\ud800-\\udfff",yF="\\u0300-\\u036f",bF="\\ufe20-\\ufe2f",vF="\\u20d0-\\u20ff",wF=yF+bF+vF,Vb="\\u2700-\\u27bf",zb="a-z\\xdf-\\xf6\\xf8-\\xff",SF="\\xac\\xb1\\xd7\\xf7",EF="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",TF="\\u2000-\\u206f",AF=" \\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",Wb="A-Z\\xc0-\\xd6\\xd8-\\xde",RF="\\ufe0e\\ufe0f",Hb=SF+EF+TF+AF,Gb="['’]",Kb="["+Hb+"]",_F="["+wF+"]",Qb="\\d+",IF="["+Vb+"]",Xb="["+zb+"]",Yb="[^"+qb+Hb+Qb+Vb+zb+Wb+"]",CF="\\ud83c[\\udffb-\\udfff]",PF="(?:"+_F+"|"+CF+")",FF="[^"+qb+"]",Jb="(?:\\ud83c[\\udde6-\\uddff]){2}",Zb="[\\ud800-\\udbff][\\udc00-\\udfff]",ji="["+Wb+"]",OF="\\u200d",ev="(?:"+Xb+"|"+Yb+")",kF="(?:"+ji+"|"+Yb+")",tv="(?:"+Gb+"(?:d|ll|m|re|s|t|ve))?",nv="(?:"+Gb+"(?:D|LL|M|RE|S|T|VE))?",rv=PF+"?",iv="["+RF+"]?",xF="(?:"+OF+"(?:"+[FF,Jb,Zb].join("|")+")"+iv+rv+")*",NF="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",$F="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",DF=iv+rv+xF,LF="(?:"+[IF,Jb,Zb].join("|")+")"+DF,MF=RegExp([ji+"?"+Xb+"+"+tv+"(?="+[Kb,ji,"$"].join("|")+")",kF+"+"+nv+"(?="+[Kb,ji+ev,"$"].join("|")+")",ji+"?"+ev+"+"+tv,ji+"+"+nv,$F,NF,Qb,LF].join("|"),"g");function BF(e){return e.match(MF)||[]}function jF(e,t,n){return e=Ll(e),t=t,t===void 0?mF(e)?BF(e):hF(e):e.match(t)||[]}var UF="['’]",qF=RegExp(UF,"g");function VF(e){return function(t){return tF(jF(dF(t).replace(qF,"")),e,"")}}var ov=VF(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const sv=be.z.object({name:be.z.string().optional(),slogan:be.z.string().optional(),logo:be.z.string().optional(),urls:be.z.object({accessDeniedHelp:be.z.string().optional(),imprint:be.z.string().optional(),privacy:be.z.string().optional(),accessibility:be.z.string().optional()}).optional(),shareRoles:be.z.record(be.z.string(),be.z.object({iconName:be.z.string()})).optional()}),zF=be.z.object({breakpoints:be.z.record(be.z.string()).optional(),roles:be.z.record(be.z.string()).optional(),colorPalette:be.z.record(be.z.string()).optional(),fontFamily:be.z.string().optional(),fontSizes:be.z.record(be.z.string()).optional(),sizes:be.z.record(be.z.string()).optional(),spacing:be.z.record(be.z.string()).optional()}),av=sv.extend({designTokens:zF.optional(),favicon:be.z.string().optional(),background:be.z.string().optional()}),WF=av.extend({isDark:be.z.boolean(),label:be.z.string()}),lv=be.z.object({defaults:av,themes:be.z.array(WF)}),HF=be.z.object({common:sv.optional(),clients:be.z.object({web:lv})}),GF="oc_currentThemeName",ai=Ue.defineStore("theme",()=>{const e=Vr.useLocalStorage(GF,null),t=Vr.usePreferredDark(),n=le(),r=le([]),o=l=>{const d=gd(l.common,l.clients.web.defaults);r.value=l.clients.web.themes.map(f=>gd(d,f)),i()},i=()=>{const l=p(r).find(f=>!f.isDark),d=p(r).find(f=>f.isDark);c(p(r).find(f=>f.label===p(e))||(p(t)?d:l)||p(r)[0],!1)},s=()=>{e.value=null,i()},a=B(()=>e.value===null),c=(l,d=!0)=>{var m,w,y,E,b,g;n.value=l,d&&(e.value=p(n).label);const f=[{name:"breakpoints",prefix:"breakpoint"},{name:"roles",prefix:"role"},{name:"colorPalette",prefix:"color"},{name:"fontSizes",prefix:"font-size"},{name:"sizes",prefix:"size"},{name:"spacing",prefix:"spacing"}];Qs("font-family",p(n).designTokens.fontFamily),f.forEach(v=>{for(const h in p(n).designTokens[v.name])Qs(`${v.prefix}-${ov(h)}`,p(n).designTokens[v.name][h])}),(w=(m=p(n).designTokens)==null?void 0:m.roles)!=null&&w.chrome||(Qs("role-chrome",(E=(y=p(n).designTokens)==null?void 0:y.roles)==null?void 0:E.surfaceContainer),Qs("role-on-chrome",(g=(b=p(n).designTokens)==null?void 0:b.roles)==null?void 0:g.onSurface))};return{availableThemes:r,currentTheme:n,initializeThemes:o,setAndApplyTheme:c,setAutoSystemTheme:s,isCurrentThemeAutoSystem:a,getRoleIcon:l=>{var d;return((d=p(n).shareRoles[l.id])==null?void 0:d.iconName)||"user"}}}),Er=Ue.defineStore("shares",()=>{const e=Qe(),{getRoleIcon:t}=ai(),n=le(!1),r=le([]),o=le([]),i=le({}),s=_=>{i.value=_.reduce((A,$)=>(A[$.id]={...$,icon:t($)},A),{})},a=_=>{const A=p(r).find(({id:$})=>$===_.id);if(A){Object.assign(A,_);return}p(r).push(_)},c=_=>{r.value=_},u=_=>{p(r).push(..._)},l=_=>{r.value=p(r).filter(({id:A})=>A!==_.id)},d=()=>{r.value=[],o.value=[],n.value=void 0},f=()=>{const _=Object.values(e.ancestorMetaData).map(({id:A})=>A);if(!_.length){r.value=[],o.value=[];return}p(r).forEach(A=>{_.includes(A.resourceId)||l(A)}),p(o).forEach(A=>{_.includes(A.resourceId)||y(A)})},m=_=>{o.value=_},w=_=>{const A=p(o).find(({id:$})=>$===_.id);if(A){Object.assign(A,_);return}p(o).push(_)},y=_=>{o.value=p(o).filter(({id:A})=>A!==_.id)},E=_=>{n.value=_},b=_=>{const A=x=>{const V=new Set;return x.forEach(G=>{V.add(G.shareType)}),Array.from(V)},$=[...e.resources,e.currentFolder].find(x=>(x==null?void 0:x.id)===_);if(!$||ee.isProjectSpaceResource($))return;const D=[...p(r),...p(o)];e.updateResourceField({id:$.id,field:"shareTypes",value:A(D.filter(x=>!x.indirect))});const N=e.getAncestorById(_);N&&e.updateAncestorField({path:N.path,field:"shareTypes",value:A(D.filter(x=>!x.indirect))})};return{loading:n,collaboratorShares:r,linkShares:o,graphRoles:i,setGraphRoles:s,setLoading:E,setCollaboratorShares:c,setLinkShares:m,removeOrphanedShares:f,pruneShares:d,addShare:async({clientService:_,space:A,resource:$,options:D})=>{const x=await _.graphAuthenticated.permissions.createInvite(A.id,$.id,D,p(i));return u([x]),b($.id),x},updateShare:async({clientService:_,space:A,resource:$,collaboratorShare:D,options:N})=>{const x=_.graphAuthenticated.permissions,V={roles:N.roles,expirationDateTime:N.expirationDateTime},G=await x.updatePermission(A.id,$.id,D.id,V,p(i));return a(G),G},deleteShare:async({clientService:_,space:A,resource:$,collaboratorShare:D})=>{await _.graphAuthenticated.permissions.deletePermission(A.id,$.id,D.id),l(D),b($.id)},addLink:async({clientService:_,space:A,resource:$,options:D})=>{const x=await _.graphAuthenticated.permissions.createLink(A.id,$.id,D),V=e.selectedResources,G=V.some(({fileId:ae})=>ae===$.fileId)||V.length===0&&e.currentFolder.fileId===$.fileId;if(w(x),b($.id),!G){const ae=e.ancestorMetaData[$.path]??null;if(ae){const{shareTypes:ye}=ae;ye.includes(ee.ShareTypes.link.value)||e.updateAncestorField({path:ae.path,field:"shareTypes",value:[...ye,ee.ShareTypes.link.value]})}}return x},updateLink:async({clientService:_,space:A,resource:$,linkShare:D,options:N})=>{const x=_.graphAuthenticated.permissions;let V;if(Object.hasOwn(N,"password"))V=await x.setPermissionPassword(A.id,$.id,D.id,{password:N.password}),D.hasPassword=!!N.password;else{const G={link:{...N.type&&{type:N.type},...N.displayName&&{"@libre.graph.displayName":N.displayName}},...Object.hasOwn(N,"expirationDateTime")&&{expirationDateTime:N.expirationDateTime}};V=await x.updatePermission(A.id,$.id,D.id,G)}return w(V),V},deleteLink:async({clientService:_,space:A,resource:$,linkShare:D})=>{await _.graphAuthenticated.permissions.deletePermission(A.id,$.id,D.id),y(D),b($.id)}}}),wn={Internal:"internal",View:"view",Upload:"upload",Edit:"edit",CreateOnly:"createOnly"},cv={LibreGraphPermissionsActionsAllowedValues:"@libre.graph.permissions.actions.allowedValues",LibreGraphPermissionsRolesAllowedValues:"@libre.graph.permissions.roles.allowedValues"},uv=e=>e.sort((t,n)=>n.permissions.length-t.permissions.length),_o=async({graphClient:e,driveType:t,configStore:n,signal:r})=>{var a;const o=await e.drives.listMyDrives({orderBy:"name asc",filter:`driveType eq ${t}`},{signal:r});if(!o.length)return[];if(t!=="mountpoint"||!((a=n.options.routing)!=null&&a.fullShareOwnerPaths))return o;const i={};o.forEach(c=>{const{rootId:u,driveAlias:l}=c.root.remoteItem;i[u]=l});const s=Object.entries(i).map(([c,u])=>ee.buildSpace({id:ee.extractStorageId(c),name:u,driveType:u.split("/")[0],driveAlias:u,path:"/",serverUrl:n.serverUrl}));return[...o,...s]},ct=Ue.defineStore("spaces",()=>{const e=yt(),t=st(),n=Er(),r=le([]),o=le(),i=le(!1),s=le(!1),a=le(!1),c=le(null),u=le([]),l=le([]),d=B(()=>p(r).find(ce=>ee.isPersonalSpaceResource(ce)&&ce.isOwner(e.user))),f=ce=>{i.value=ce},m=ce=>{s.value=ce},w=ce=>{a.value=ce},y=ce=>{o.value=ce},E=ce=>{c.value=ce},b=ce=>{if(!ee.isProjectSpaceResource(ce))return[];const oe=n.collaboratorShares.filter(J=>J.resourceId===ce.id);return uv(oe)},g=ce=>{p(r).push(...ce)},v=ce=>{r.value=p(r).filter(({id:oe})=>oe!==ce.id)},h=ce=>p(r).find(oe=>ce==oe.id),S=async({graphClient:ce,space:oe,signal:J})=>(await $({graphClient:ce,signal:J}),p(r).find(ne=>{var se,Re;return ee.isMountPointSpaceResource(ne)&&((Re=(se=ne.root)==null?void 0:se.remoteItem)==null?void 0:Re.id)===oe.id})),T=({driveAliasPrefix:ce,id:oe,shareName:J})=>{const ne=ee.buildShareSpaceResource({driveAliasPrefix:ce,id:oe,shareName:J,serverUrl:t.serverUrl});return g([ne]),ne},I=ce=>{const oe=p(r).find(({id:J})=>J===ce.id);if(oe){Object.assign(oe,ce);return}g([ce])},_=({id:ce,field:oe,value:J})=>{const ne=p(r).find(se=>ce===se.id);ne&&(ne[oe]=J)},A=async({graphClient:ce})=>{a.value=!0;try{const[oe,J]=await Promise.all([_o({graphClient:ce,driveType:"personal",configStore:t}),_o({graphClient:ce,driveType:"project",configStore:t})]);g([...oe,...J]),i.value=!0}finally{a.value=!1}},$=async({graphClient:ce,signal:oe})=>{if(!p(s))try{const J=await _o({graphClient:ce,driveType:"mountpoint",configStore:t,signal:oe});g(J)}finally{s.value=!0}},D=async({graphClient:ce,signal:oe})=>{const J=await _o({graphClient:ce,driveType:"project",configStore:t,signal:oe});r.value=p(r).filter(ne=>!ee.isProjectSpaceResource(ne)),g(J)},N=ce=>{p(u).includes(ce)||p(u).push(ce)},x=ce=>{u.value=p(u).filter(oe=>oe!==ce)},V=()=>{u.value=[]},G=ce=>{p(l).includes(ce)||p(l).push(ce)},ae=ce=>{l.value=p(l).filter(oe=>oe!==ce)},ye=()=>{l.value=[]},ue=le({});return{spaces:r,spacesInitialized:i,mountPointsInitialized:s,spacesLoading:a,currentSpace:o,personalSpace:d,defaultSpaceImageBlobURL:c,imagesLoading:u,readmesLoading:l,getSpace:h,createShareSpace:T,setSpacesInitialized:f,setMountPointsInitialized:m,setSpacesLoading:w,setCurrentSpace:y,setDefaultSpaceImageBlobURL:E,getSpaceMembers:b,getMountPointForSpace:S,addSpaces:g,removeSpace:v,upsertSpace:I,updateSpaceField:_,loadSpaces:A,loadMountPoints:$,reloadProjectSpaces:D,addToImagesLoading:N,removeFromImagesLoading:x,purgeImagesLoading:V,addToReadmesLoading:G,removeFromReadmesLoading:ae,purgeReadmesLoading:ye,loadGraphPermissions:async({ids:ce,graphClient:oe,useCache:J=!0})=>{const ne=p(r).filter(se=>ce.includes(se.id)&&(se.graphPermissions===void 0||!J));if(ne.length){for(const{id:se,disabled:Re}of ne){if(Re){_({id:se,field:"graphPermissions",value:[]});continue}p(ue)[se]||(ue.value[se]=oe.permissions.listPermissions(se,se,n.graphRoles,{select:[cv.LibreGraphPermissionsActionsAllowedValues]}).then(({allowedActions:H})=>{_({id:se,field:"graphPermissions",value:H}),delete ue.value[se]}))}await Promise.all(Object.values(p(ue)))}}}}),Qe=Ue.defineStore("resources",()=>{const e=st(),t=ct(),n=yt(),r=le([]),o=le(),i=le({}),s=le([]),a=B(()=>{let H=p(r);return p(N)||(H=H.filter(R=>!R.name.startsWith("."))),H}),c=B(()=>{const H=p(r).filter(({type:M})=>M==="file").length,R=p(r).filter(({type:M,name:q})=>M==="file"&&q.startsWith(".")).length,F=p(r).filter(({type:M})=>M==="folder").length,K=p(r).filter(({type:M,name:q})=>M==="folder"&&q.startsWith(".")).length,z=p(r).filter(ee.isProjectSpaceResource).length;return{files:H,hiddenFiles:R,folders:F,hiddenFolders:K,spaces:z}}),u=H=>{r.value=H},l=H=>{r.value=p(r).filter(R=>!H.find(({id:F})=>F===R.id))},d=()=>{r.value=[]},f=H=>{const R=p(r).find(({id:F})=>F===H.id);if(R){Object.assign(R,H);return}p(r).push(H)},m=H=>{const R=p(r).filter(F=>!H.some(K=>K.path===F.path));r.value=[...R,...H]},w=({id:H,field:R,value:F})=>{const K=p(r).find(z=>H===z.id);K&&(K[R]=F)},y=H=>{o.value=H},E=()=>{o.value=void 0},b=H=>{r.value=H.resources,o.value=H.currentFolder},g=()=>{r.value=[],o.value=void 0,v.value=[]},v=le([]),h=le(null),S=B(()=>p(r).filter(H=>p(v).includes(H.id))),T=H=>{const R=H.find(F=>!p(v).includes(F));R&&(h.value=R),v.value=H},I=H=>{h.value=H,p(v).includes(H)||p(v).push(H)},_=H=>{h.value=H,p(v).includes(H)&&(v.value=p(v).filter(R=>R!==H))},A=H=>{p(v).includes(H)?_(H):I(H)},$=()=>{v.value=[]},D=H=>{h.value=H},N=le(!0),x=le(!0),V=le(!1),G=le(!0),ae=H=>{N.value=H,window.localStorage.setItem("oc_hiddenFilesShown",H.toString())},ye=H=>{x.value=H,window.localStorage.setItem("oc_fileExtensionsShown",H.toString())},ue=H=>{V.value=H,window.localStorage.setItem("oc_webDavDetailsShown",H.toString())},te=H=>{G.value=H,window.localStorage.setItem("oc_disabledSpacesShown",H.toString())},ce=H=>{i.value=H};return{resources:r,currentFolder:o,activeResources:a,totalResourcesCount:c,setResources:u,removeResources:l,clearResources:d,upsertResource:f,upsertResources:m,updateResourceField:w,setCurrentFolder:y,clearCurrentFolder:E,initResourceList:b,clearResourceList:g,selectedIds:v,latestSelectedId:h,selectedResources:S,setSelection:T,addSelection:I,removeSelection:_,toggleSelection:A,resetSelection:$,setLastSelectedId:D,areHiddenFilesShown:N,areFileExtensionsShown:x,areWebDavDetailsShown:V,areDisabledSpacesShown:G,setAreHiddenFilesShown:ae,setAreFileExtensionsShown:ye,setAreWebDavDetailsShown:ue,setAreDisabledSpacesShown:te,ancestorMetaData:i,setAncestorMetaData:ce,updateAncestorField:({path:H,field:R,value:F})=>{const K=p(i)[H]??null;K&&(K[R]=F)},loadAncestorMetaData:({folder:H,space:R,client:F,signal:K})=>{const z={[H.path]:{id:H.fileId,shareTypes:H.shareTypes,parentFolderId:H.parentFolderId,spaceId:R.id,path:H.path}},M=[],q=[je.FileId,je.ShareTypes,je.FileParent],ge=Ob(H.path),_e=t.spaces,Le=()=>_e.filter(Pe=>ee.isMountPointSpaceResource(Pe)&&ee.extractStorageId(Pe.root.remoteItem.rootId)===R.id);let ke=!0;if(e.options.routing.fullShareOwnerPaths){const Pe=_e.some(De=>ee.isProjectSpaceResource(De)&&De.id===R.id);ke=R.isOwner(n.user)||Pe}for(const Pe of ge){const De=p(i)[Pe]??null;if((De==null?void 0:De.spaceId)===R.id){z[Pe]=De;continue}if(!ke&&!Le().find(Z=>Pe.startsWith(Z.root.remoteItem.path)))break;M.push(F.listFiles(R,{path:Pe},{depth:0,davProperties:q,signal:K}).then(({resource:Z})=>{z[Pe]={id:Z.fileId,shareTypes:Z.shareTypes,parentFolderId:Z.parentFolderId,spaceId:R.id,path:Pe}}))}return Promise.all(M).then(()=>{if(!Object.keys(z).includes("/")){const Pe=p(i)["/"];if((Pe==null?void 0:Pe.spaceId)===R.id)z["/"]=Pe;else{const{parentFolderId:De}=Object.values(z)[0],Z=t.spaces.find(({id:xe})=>De.startsWith(xe));Z&&(z["/"]={id:Z.id,shareTypes:Z.shareTypes,parentFolderId:Z.id,spaceId:Z.id,path:"/"})}}ce(z)})},getAncestorById:H=>Object.values(p(i)).find(R=>H===R.id),deleteQueue:s,addResourcesIntoDeleteQueue:H=>{s.value=s.value.concat(H.filter(R=>!p(s).includes(R)))},removeResourcesFromDeleteQueue:H=>{s.value=s.value.filter(R=>!H.includes(R))}}}),Io=Ue.defineStore("webWorkers",()=>{const e=le([]);return{createWorker:(i,{needsTokenRenewal:s=!1}={})=>{const a=en.v4(),c=Vr.useWebWorker(i,{type:"module",name:a}),u={id:a,needsTokenRenewal:s,...c};return p(e).push(u),u},terminateWorker:i=>{const s=p(e).find(a=>i===a.id);s&&(s.terminate(),e.value=p(e).filter(a=>i!==a.id))},terminateAllWorkers:()=>{p(e).forEach(({terminate:i})=>{i()}),e.value=[]},updateAccessTokens:i=>{p(e).filter(({needsTokenRenewal:s})=>s).forEach(({post:s})=>{s(JSON.stringify({topic:"tokenUpdate",data:{accessToken:`Bearer ${i}`}}))})}}}),Ys=Ue.defineStore("avatars",()=>{const e=st(),t=le({}),n=Ld(new Fr({concurrency:e.options.concurrentRequests.avatars}));return{avatarMap:t,getAvatar:c=>p(t)[c],addAvatar:(c,u)=>{t.value[c]=u},removeAvatar:c=>{t.value[c]=null},reset:()=>{t.value={}},avatarsQueue:n,pendingAvatarsRequests:new Map}}),Js=(e={})=>{const t=e.router||We(),n=e.configStore||st();return{replaceInvalidFileRoute:({space:o,resource:i,path:s,fileId:a})=>{var u;if(!((u=n.options.routing)!=null&&u.idBased)||s===i.path&&a===i.fileId)return!1;const c=rr(o,i,{configStore:n});return t.replace(c),!0}}},Zs=()=>{const e=Kt();return B(()=>p(e).name)},fv=(e,t)=>{const n=Kt();return B(()=>p(n).meta[e]||t)},ea=(e,t)=>{const n=We();return B({get(){return Rt(p(n.currentRoute).params[e])||t},async set(r){p(n.currentRoute).params[e]!==r&&await n.replace({params:{...p(n.currentRoute).params,[e]:r}})}})};let dv=Promise.resolve();const an=(e,t)=>{const n=We();return B({get(){return p(n.currentRoute).query[e]||t},set(r){if(p(n.currentRoute).query[e]===r)return;dv=dv.then(async()=>{try{await n.replace({path:p(n.currentRoute).path,query:{...p(n.currentRoute).query,[e]:r}})}catch{}})}})},Tr=e=>{const t=an(e.name),n=If(KF(e));return St(()=>p(t)?{value:p(t),source:"route"}:p(n)?{value:p(n),source:"storage"}:{value:e.defaultValue,source:"default"},r=>{["route","default"].includes(r.source)&&(n.value=r.value===e.defaultValue?void 0:Rt(r.value)),["storage","default"].includes(r.source)&&(t.value=r.value)},{immediate:!0}),t},KF=e=>["oc-options",e.storagePrefix,e.name].filter(Boolean).join("_"),Ar=(e,...t)=>{const n=le(!1),r=We(),o=Kt();return St(o,()=>{n.value=e(r,...t)},{immediate:!0}),n},ta="contextRouteName",Cf="contextRouteParams",Pf="contextRouteQuery",na=e=>{var i;const{params:t,query:n}=e,r={},o=["fileId","shareId","q_share-visibility","page"].concat(((i=e.meta)==null?void 0:i.contextQueryItems)||[]);for(const s of o)r[s]=n[s];return{[ta]:e.name,[Cf]:t,[Pf]:r}},pv=e=>({routeName:Rt(e[ta]),routeParams:e[Cf],routeQuery:e[Pf]}),Rt=e=>Array.isArray(e)?e[0].toString():e==null?void 0:e.toString();function hv({router:e,currentFileContext:t}){const n=a=>{const{fileName:c,routeName:u,routeParams:l,routeQuery:d}=p(a);return p(u)?e.push({name:p(u),params:p(l),query:{...p(d),scrollTo:p(c)}}):e.push({path:"/"})},{replaceInvalidFileRoute:r}=Js({router:e}),o=(a,c)=>{const u=p(a);return r({space:p(u.space),resource:c,path:p(u.item),fileId:p(u.itemId)})},i=le(!1);return{replaceInvalidFileRoute:o,closeApp:()=>(i.value=!0,n(t)),closed:i}}const He=()=>br("$clientService");function Ff({clientService:e}){e=e||He();const t=sn(),n=yt();return{getUrlForResource:(c,u,l)=>{var d;return e.webdav.getFileUrl(c,u,{isUrlSigningEnabled:t.supportUrlSigning,username:(d=n.user)==null?void 0:d.onPremisesSamAccountName,...l})},revokeUrl:c=>e.webdav.revokeUrl(c),getFileContents:(c,u)=>e.webdav.getFileContents(p(p(c).space),{path:p(p(c).item)},{...u}),getFileInfo:(c,u={})=>e.webdav.getFileInfo(p(p(c).space),{path:p(p(c).item),fileId:p(p(c).itemId)},u),putFileContents:(c,u)=>e.webdav.putFileContents(p(p(c).space),{path:p(p(c).item),...u})}}const Of=()=>br("$authService");class Rr{}Ee(Rr,"allFiles","all-files"),Ee(Rr,"currentFolder","current-folder");const kf=()=>{const e=st(),t=He(),n=ct(),r=Qe(),o=sn(),i=B(()=>{var f;return(f=o.searchContent)==null?void 0:f.enabled}),s=B(()=>r.areHiddenFilesShown),a=B(()=>n.spaces.filter(ee.isProjectSpaceResource)),c=f=>p(a).find(m=>m.id===f),u=pn.useTask(function*(f,m,w=null){if(e.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:t.graphAuthenticated,signal:f})),!m)return{totalResults:null,values:[]};const{resources:y,totalResults:E}=yield*ee.call(t.webdav.search(m,{searchLimit:w,davProperties:As.Default,signal:f}));return{totalResults:E,values:y.map(b=>{const g=c(b.parentFolderId),v=g||b;return e.options.routing.fullShareOwnerPaths&&v.remoteItemPath&&(v.path=ee.urlJoin(v.remoteItemPath,v.path)),{id:v.id,data:v}}).filter(({data:b})=>!b.name.startsWith(".")||p(s))}}).restartable();return{search:async(f,m=null)=>await u.perform(f,m),buildSearchTerm:({term:f,isTitleOnlySearch:m,tags:w,lastModified:y,mediaType:E,scope:b,useScope:g})=>{const v=[],h=f,S=p(i)&&!m;if(h){let T=`name:"*${h}*"`;S&&(T=`(name:"*${h}*" OR content:"${h}")`),v.push(T)}if(g&&b&&v.push(`scope:${b}`),w){const T=w.split("+").map(I=>`"${I}"`);v.push(`tag:(${T.join(" OR ")})`)}if(y&&v.push(`mtime:${y}`),E){const T=E.split("+").map(I=>`"${I}"`);v.push(`mediatype:(${T.join(" OR ")})`)}return v.sort((T,I)=>Number(T.startsWith("scope:"))-Number(I.startsWith("scope:"))).join(" AND ")}}};function gv({currentRoute:e,clientService:t}){const n=le(!1),{webdav:r}=t,{replaceInvalidFileRoute:o}=Js(),{getFileInfo:i}=Ff({clientService:t}),s=Of(),a=ct(),{buildSearchTerm:c,search:u}=kf(),l=an("contextRouteQuery"),d=Qe(),{activeResources:f}=Ue.storeToRefs(d);return{isFolderLoading:n,loadFolderForFileContext:async w=>{var y,E;n.value=!0;try{if(w=p(w),(y=p(l))!=null&&y.term){const _=c({term:(E=p(l))==null?void 0:E.term}),{values:A}=await u(_,200),$=A.filter(({data:D})=>ee.isSearchResource(D)).map(D=>D.data);d.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(p(w.routeName))){await Jy.getTask().perform(),n.value=!1;return}d.clearResourceList();const g=p(w.space),v=await i(w,{davProperties:[je.FileId]});if(o({space:g,resource:v,path:p(w.item),fileId:p(w.itemId)}),a.spaces.some(_=>{var A;return ee.isMountPointSpaceResource(_)&&((A=_.root.remoteItem)==null?void 0:A.id)===v.id})){const _=await i(w);d.initResourceList({currentFolder:_,resources:[_]}),n.value=!1;return}const S=dt.dirname(v.path),{resource:T,children:I}=await r.listFiles(g,{path:S});T.type==="file"?d.initResourceList({currentFolder:T,resources:[T]}):d.initResourceList({currentFolder:T,resources:I})}catch(b){if(b.statusCode===401)return s.handleAuthError(p(e));d.setCurrentFolder(null),console.error(b)}n.value=!1},activeFiles:f}}function xf({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 li=()=>Ke;function mv({titleSegments:e,eventBus:t}){const n=ai(),{currentTheme:r}=Ue.storeToRefs(n);t=t||li(),St(e,o=>{const i=p(o),s=" - ",a={shortDocumentTitle:i.join(s),fullDocumentTitle:[...i,p(r).name].join(s)};t.publish("runtime.documentTitle.changed",a)},{immediate:!0,deep:!0})}function QF({appsStore:e,applicationId:t,applicationName:n,currentFileContext:r,currentRoute:o}){const i=xf({applicationId:t,appsStore:e}),{$gettext:s}=Fe.useGettext(),a=B(()=>{var l,d,f;const c=dt.basename(p((l=p(r))==null?void 0:l.fileName))||s(((f=(d=p(o))==null?void 0:d.meta)==null?void 0:f.title)||""),u=p(p(i).applicationMeta);return[c,p(n)||u.name||u.id].filter(Boolean)});mv({titleSegments:a})}function yv(e={}){const t=e.clientService??He(),n=e.authStore??ei();return{makeRequest:(o,i,s={})=>{const a=n.accessToken?t.httpAuthenticated:t.httpUnAuthenticated;return s.headers=s.headers||{},n.publicLinkContextReady&&(n.publicLinkPassword&&(s.headers.Authorization="Basic "+vr.from(["public",n.publicLinkPassword].join(":")).toString("base64")),n.publicLinkToken&&(s.headers["public-token"]=n.publicLinkToken)),s.method=o,s.url=i,a.request(s)}}}const bv=()=>{const e=ct();return{areSpacesLoading:B(()=>!e.spacesInitialized||e.spacesLoading)}},vv=(e={})=>{const t=ct(),{areSpacesLoading:n}=bv(),r=an("shareId"),o=an("fileId"),i=B(()=>Rt(p(o))),s=st(),a=He(),c=B(()=>t.spaces),u=le(null),l=le(null),d=le(!1),f=m=>{const w=m.split("/");return p(c).find(y=>{if(!m.startsWith(y.driveAlias))return!1;const E=y.driveAlias.split("/");return w.length<E.length||w.slice(0,E.length).join("/")!==y.driveAlias?!1:y})};return Ya(()=>{const m=p(e.driveAliasAndItem);!(m!=null&&m.startsWith("personal/"))&&!(m!=null&&m.startsWith("project/"))&&t.setCurrentSpace(null)}),St([e.driveAliasAndItem,n],async([m,w],[y,E])=>{if(m===y&&w===E)return;if(!m||m.startsWith("virtual/")){u.value=null,l.value=null;return}if(p(u)&&m.startsWith(p(u).driveAlias)){l.value=ee.urlJoin(m.slice(p(u).driveAlias.length),{leadingSlash:!0});return}let g=null,v=null;if(m.startsWith("public/")||m.startsWith("ocm/")){const[h,...S]=m.split("/").slice(1);g=p(c).find(T=>T.id===h),v=S.join("/")}else if(m.startsWith("share/")||m.startsWith("ocm-share/")){const[h,...S]=m.split("/").slice(1),T=m.startsWith("ocm-share/")?"ocm-share":"share";let I=Rt(p(r));I!=null&&I.includes(":")&&(I=[ee.SHARE_JAIL_ID,I].join("!")),g=t.getSpace(I)||t.createShareSpace({driveAliasPrefix:T,id:I,shareName:p(h)}),v=S.join("/")}else p(i)?g=p(c).find(h=>p(i).startsWith(`${h.fileId}`)):g=f(m),g||(!t.mountPointsInitialized&&s.options.routing.fullShareOwnerPaths&&(d.value=!0,await t.loadMountPoints({graphClient:a.graphAuthenticated})),g=f(m)),g&&(v=m.slice(g.driveAlias.length));u.value=g,l.value=ee.urlJoin(v,{leadingSlash:!0}),d.value=!1},{immediate:!0,deep:!0}),St(u,m=>{t.setCurrentSpace(m)},{immediate:!0}),{space:u,item:l,itemId:i,loading:d}};function wv(e){const t=We(),n=ir(),r=Kt(),o=e.clientService??He(),i=e.applicationId,s=ei(),{publicLinkContextReady:a}=Ue.storeToRefs(s),c=ea("driveAliasAndItem"),{space:u,item:l,itemId:d,loading:f}=vv({driveAliasAndItem:c}),m=B(()=>{if(p(f))return null;let w;return p(u)?w=ee.urlJoin(p(u).webDavPath,p(l)):w=ee.urlJoin(Rt(p(r).params.filePath)),{path:w,driveAliasAndItem:p(c),space:p(u),item:p(l),itemId:p(d),fileName:dt.basename(w),routeName:Rt(p(r).query[ta]),...pv(p(r).query)}});return QF({appsStore:n,applicationId:i,applicationName:e.applicationName,currentFileContext:m,currentRoute:r}),{isPublicLinkContext:a,currentFileContext:m,...Sh({appsStore:n,...e}),...hv({router:t,currentFileContext:m}),...Ff({clientService:o}),...gv({clientService:o,currentRoute:r}),...yv({clientService:o,currentRoute:p(r)})}}const XF=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}}),YF=()=>[{path:"/list",redirect:e=>Nn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:"personal/home"}})},{path:"/list/all/:item(.*)",redirect:e=>Nn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:ee.urlJoin("personal/home",Rt(e.params.item),{leadingSlash:!1})}})},{path:"/list/favorites",redirect:e=>Ci("files-common-favorites",e)},{path:"/list/shared-with-me",redirect:e=>$n("files-shares-with-me",e)},{path:"/list/shared-with-others",redirect:e=>$n("files-shares-with-others",e)},{path:"/list/shared-via-link",redirect:e=>$n("files-shares-via-link",e)},{path:"/trash-bin",redirect:e=>Fi("files-trash-generic",e)},{path:"/public/list/:item(.*)",redirect:e=>Pi("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(XF),JF=(e,...t)=>{const[n,...r]=t.map(o=>{const i={"files-personal":Nn("files-spaces-generic").name,"files-favorites":Ci("files-common-favorites").name,"files-shared-with-others":$n("files-shares-with-others").name,"files-shared-with-me":$n("files-shares-with-me").name,"files-trashbin ":Fi("files-trash-generic").name,"files-public-list":Pi("files-public-link").name}[o.name.toString()];return i&&console.warn(`route name "${name}" is deprecated, use "${i.toString()}" instead.`),{...o,...!!i&&{name:i}}});return Cl(e,n,...r)},ZF={name:"root",path:"/",redirect:e=>Nn("files-spaces-generic",e)},eO=e=>[ZF,...RT(e),...CT(e),...PT(e),..._T(e),...FT(e),...YF()],Sv="rowMounted",Nf="fileDropped",tO="contextmenuClicked";class Kn{}Ee(Kn,"Thumbnail",[36,36]),Ee(Kn,"Tile",[1e3,1e3]),Ee(Kn,"Preview",[1200,1200]),Ee(Kn,"Avatar",64);class ra{}Ee(ra,"Thumbnail","thumbnail"),Ee(ra,"Preview","preview"),Ee(ra,"Avatar","avatar");const $f=10,Co=63,ci=()=>{const{$gettext:e}=Fe.useGettext(),t=He();return{checkSpaceNameModalInput:(o,i)=>o.trim()===""?i(e("Space name cannot be empty")):o.length>Co?i(e("Space name cannot be longer than %{length} characters",{length:Co.toString()})):/[/\\.:?*"><|]/.test(o)?i(e(`Space name cannot contain the following characters: / \\\\ . : ? * " > < |'`)):i(null),getDefaultMetaFolder:async o=>{const{children:i}=await t.webdav.listFiles(o);return i.find(({name:s})=>s===".space")}}},un=e=>{const t=yt(),n=ct(),r=st(),o=B(()=>n.spaces),i=ea("driveAliasAndItem"),s=d=>p(e==null?void 0:e.space)||p(o).find(f=>f.id===d),a=d=>{var E,b,g,v,h;let f=d.storageId;((E=p(i))!=null&&E.startsWith("public/")||(b=p(i))!=null&&b.startsWith("ocm/"))&&(f=p(i).split("/")[1]);const m=s(f);if(m&&!ee.isMountPointSpaceResource(m))return m;const w=ee.isShareResource(d)&&d.shareTypes.includes(ee.ShareTypes.remote.value)||(g=d==null?void 0:d.id)!=null&&g.toString().startsWith(ee.OCM_PROVIDER_ID)?"ocm-share":"share";let y;return d.remoteItemPath?y=dt.basename(d.remoteItemPath):(v=p(i))!=null&&v.startsWith("share/")||(h=p(i))!=null&&h.startsWith("ocm-share/")?y=p(i).split("/")[1]:y=d.name,n.getSpace(d.remoteItemId)||n.createShareSpace({driveAliasPrefix:w,id:d.remoteItemId,shareName:y})},c=d=>p(o).filter(f=>ee.isMountPointSpaceResource(f)&&ee.extractStorageId(f.root.remoteItem.rootId)===d.id);return{getInternalSpace:s,getMatchingSpace:a,isPersonalSpaceRoot:d=>{var f;return(d==null?void 0:d.storageId)&&(d==null?void 0:d.storageId)===((f=n.personalSpace)==null?void 0:f.storageId)&&(d==null?void 0:d.path)==="/"},isResourceAccessible:({space:d,path:f})=>{if(!r.options.routing.fullShareOwnerPaths)return!0;const m=p(o).some(y=>ee.isProjectSpaceResource(y)&&y.id===d.id);return d.isOwner(t.user)||m||c(d).some(y=>f.startsWith(y.root.remoteItem.path))}}},Ui=()=>{const e=He(),t=Qe();return{createSpace:o=>{const{graphAuthenticated:i}=e;return i.drives.createDrive({name:o},{params:{template:"default"}})},createDefaultMetaFolder:async o=>{var s;const i=await e.webdav.createFolder(o,{path:".space"});return ee.extractStorageId(i.parentFolderId)===((s=t.currentFolder)==null?void 0:s.id)&&t.upsertResource(i),i}}},fn=()=>br("$loadingService"),ia=()=>{const e=ei(),t=He(),n=Fe.useGettext();return{headers:B(()=>{const o=new Xh({accessToken:e.accessToken,publicLinkToken:e.publicLinkToken,publicLinkPassword:e.publicLinkPassword});return{"Accept-Language":n.current,"Initiator-ID":t.initiatorId,"X-Request-ID":en.v4(),...o.getHeaders()}})}};function nO(e){return new Worker("/assets/worker-CBaruprk.js",{name:e==null?void 0:e.name})}const Ev=({concurrentRequests:e=4}={})=>{const t=st(),n=fn(),{headers:r}=ia(),{createWorker:o,terminateWorker:i}=Io(),s=({topic:c,space:u,resources:l},d)=>{const f=o(nO,{needsTokenRenewal:!0});let m;p(f.worker).onmessage=w=>{i(f.id),m==null||m(!0);const{successful:y,failed:E}=JSON.parse(w.data),b=E.map(({resource:g,...v})=>({resource:g,error:ee.createHttpError(v)}));d({successful:y,failed:b})},n.addTask(()=>new Promise(w=>{m=w})),f.post(a({topic:c,space:u,resources:l}))},a=({topic:c,space:u,resources:l})=>JSON.stringify({topic:c,data:{space:u,resources:l,concurrentRequests:e,baseUrl:t.serverUrl,headers:{...p(r),"X-Request-ID":void 0}}});return{startWorker:s}};function rO(e){return new Worker("/assets/worker-JjonBkWx.js",{name:e==null?void 0:e.name})}const Tv=()=>{const e=st(),t=fn(),{headers:n}=ia(),{createWorker:r,terminateWorker:o}=Io(),i=(a,c)=>{const u=r(rO,{needsTokenRenewal:!0});let l;p(u.worker).onmessage=d=>{o(u.id),l==null||l(!0);const{successful:f,failed:m}=JSON.parse(d.data),w=m.map(({resourceName:y,...E})=>({resourceName:y,error:ee.createHttpError(E)}));c({successful:f,failed:w})},t.addTask(()=>new Promise(d=>{l=d})),u.post(s(a))},s=a=>JSON.stringify({topic:"startProcess",data:{transferData:a,baseUrl:e.serverUrl,headers:{...p(n),"X-Request-ID":void 0}}});return{startWorker:i}};function iO(e){return new Worker("/assets/worker-DH0Knh62.js",{name:e==null?void 0:e.name})}const Av=()=>{const e=st(),t=fn(),{headers:n}=ia(),{createWorker:r,terminateWorker:o}=Io(),i=({space:a,resources:c,missingFolderPaths:u},l)=>{const d=r(iO,{needsTokenRenewal:!0});let f;p(d.worker).onmessage=m=>{o(d.id),f==null||f(!0);const{successful:w,failed:y}=JSON.parse(m.data),E=y.map(({resource:b,...g})=>({resource:b,error:ee.createHttpError(g)}));l({successful:w,failed:E})},t.addTask(()=>new Promise(m=>{f=m})),d.post(s({space:a,resources:c,missingFolderPaths:u}))},s=({space:a,resources:c,missingFolderPaths:u})=>JSON.stringify({topic:"startProcess",data:{space:a,resources:c,missingFolderPaths:u,baseUrl:e.serverUrl,headers:{...p(n),"X-Request-ID":void 0}}});return{startWorker:i}};function oO(e){return new Worker("/assets/worker-BBQqm_-D.js",{name:e==null?void 0:e.name})}const sO=({authService:e})=>{const{createWorker:t}=Io(),n=le();return{startWorker:()=>{n.value=t(oO),p(p(n).worker).onmessage=()=>{e.signinSilent().catch(async s=>{if(s instanceof rw.ErrorTimeout){console.warn("token renewal timed out, retrying in 5 seconds..."),p(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(!p(n)){console.error("token timer worker is not running");return}p(n).post(JSON.stringify({topic:"set",expiry:s,expiryThreshold:a}))},resetTokenTimer:()=>{if(!p(n)){console.error("token timer worker is not running");return}p(n).post(JSON.stringify({topic:"reset"}))}}},Rv=()=>{const e=st(),t=tt(),n=We(),r=Fe.useGettext(),{getMatchingSpace:o}=un(),{$gettext:i,$ngettext:s}=r,a=He(),{dispatchModal:c}=pt(),u=ct(),l=li(),{startWorker:d}=Ev({concurrentRequests:e.options.concurrentRequests.resourceBatchActions}),f=Qe(),{currentFolder:m}=Ue.storeToRefs(f),w=le([]),y=an("page","1"),E=B(()=>parseInt(Rt(p(y)))),b=an("items-per-page","1"),g=B(()=>parseInt(Rt(p(b)))),v=B(()=>kp(p(w))),h=B(()=>{const A=p(v),$=A[0].type==="folder";let D=null;return A.length===1?($?D=i('Permanently delete folder "%{name}"',{name:A[0].name},!0):D=i('Permanently delete file "%{name}"',{name:A[0].name},!0),D):s("Permanently delete selected resource?","Permanently delete %{amount} selected resources?",A.length,{amount:A.length.toString()},!1)}),S=B(()=>{const A=p(v),$=A[0].type==="folder";return A.length===1?i($?"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."):i("Are you sure you want to delete all selected resources? All their content will be permanently removed. This action cannot be undone.")}),T=A=>{const $=p(n.currentRoute);d({topic:"trashBinDelete",space:A,resources:p(v)},({successful:D,failed:N})=>{var x,V;if(D.length){const G=D.length===1&&p(v).length===1?i('"%{item}" was deleted successfully',{item:D[0].name}):s("%{itemCount} item was deleted successfully","%{itemCount} items were deleted successfully",D.length,{itemCount:D.length.toString()},!0);t.showMessage({title:G})}N.forEach(({resource:G})=>{const ae=i('Failed to delete "%{item}"',{item:G.name});t.showErrorMessage({title:ae,errors:[new Error]})}),$.name===p(n.currentRoute).name&&((x=$.query)==null?void 0:x.fileId)===((V=p(n.currentRoute).query)==null?void 0:V.fileId)&&(f.removeResources(D),f.resetSelection())})};return{displayDialog:(A,$)=>{w.value=[...$],c({title:p(h),message:p(S),confirmText:i("Delete"),onConfirm:()=>T(A)})},filesList_delete:A=>{var N;w.value=[...A],f.addResourcesIntoDeleteQueue(p(w).map(({id:x})=>x)),p(w).forEach(({id:x})=>f.removeSelection(x));const $=p(A).reduce((x,V)=>{if(V.storageId in x)return x[V.storageId].resources.push(V),x;const G=o(V);return G.id in x||(x[G.id]={space:G,resources:[]}),x[G.id].resources.push(V),x},{}),D=(N=p(m))==null?void 0:N.id;return Object.values($).map(({space:x,resources:V})=>{d({topic:"fileListDelete",space:x,resources:V},async({successful:G,failed:ae})=>{var ye;if(G.length){const ue=G.length===1&&A.length===1?i('"%{item}" was moved to trash bin',{item:G[0].name}):s("%{itemCount} item was moved to trash bin","%{itemCount} items were moved to trash bin",G.length,{itemCount:G.length.toString()},!0);t.showMessage({title:ue}),l.publish("runtime.resource.deleted",G)}if(f.removeResourcesFromDeleteQueue(ae.map(({resource:ue})=>ue.id)),f.removeResourcesFromDeleteQueue(G.map(({id:ue})=>ue)),ae.forEach(({error:ue,resource:te})=>{let ce=i('Failed to delete "%{resource}"',{resource:te.name});ue.statusCode===423&&(ce=i('Failed to delete "%{resource}" - the file is locked',{resource:te.name})),t.showErrorMessage({title:ce,errors:[ue]})}),D===((ye=p(m))==null?void 0:ye.id)){f.removeResources(G);const ue=f.activeResources.length,te=Math.ceil(p(ue)/p(g));p(E)>1&&p(E)>te&&(y.value=te.toString())}if(ht(n,"files-spaces-generic")&&!["public","share"].includes(x==null?void 0:x.driveType)){const te=await a.graphAuthenticated.drives.getDrive(p(A)[0].storageId);u.updateSpaceField({id:te.id,field:"spaceQuota",value:te.spaceQuota})}if(p(w).length&&ro(p(w)[0],p(m)))return n.push(rr(x,{path:dt.dirname(p(w)[0].path),fileId:p(w)[0].parentFolderId}))})})}}},_v=()=>{const e=Kt();return B(()=>{var t,n;return(n=(t=p(e))==null?void 0:t.query)==null?void 0:n.contextRouteName})},aO=e=>e==="files",_r=()=>{const e=Kt();return B(()=>aO(Nl(p(e))))},oa=()=>{const{$gettext:e}=Fe.useGettext(),t=Qe();return{isFileNameValid:(r,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(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(o.length>Co)return{isValid:!1,error:e("The name cannot be longer than %{length} characters",{length:Co.toString()})};const s=r.path.substring(0,r.path.length-r.name.length)+o;if((i||t.resources).some(c=>c.path===s&&c.name===o)){const c=e('The name "%{name}" is already taken');return{isValid:!1,error:e(c,{name:o},!0)}}return{isValid:!0,error:void 0}}}},sa=()=>B(()=>!!document.getElementById("files-global-search-options"));function lO(e){return e==null}const cO="edit",uO="create",Qn=()=>{const e=ir(),t=We(),{$gettext:n}=Fe.useGettext(),r=sa(),{isEnabled:o}=si(),{requestExtensions:i}=Bi(),s=_r(),{openUrl:a}=e0(),c=st(),{options:u}=Ue.storeToRefs(c),{actions:l}=aa(),{actions:d}=la(),{actions:f}=ca(),{actions:m}=Po(),{actions:w}=ua(),{actions:y}=fa(),{actions:E}=Fo(),{actions:b}=Bf(),{actions:g}=da(),{actions:v}=jf(),{actions:h}=pa(),{actions:S}=ha(),{actions:T}=zf(),I=B(()=>[...p(v),...p(y),...p(E),...p(m),...p(g),...p(f),...p(h),...p(T),...p(S),...p(l),...p(d),...p(w),...p(b)]),_=B(()=>i({id:"global.files.default-actions",extensionType:"action"}).map(te=>te.action)),A=B(()=>i({id:"global.files.context-actions",extensionType:"action"}).map(ue=>ue.action)),$=B(()=>[{name:"open",icon:"eye",label:()=>n("Open"),handler:({space:ue,resources:te})=>{const ce=ae({space:ue,resources:te,omitSystemActions:!0});ce&&ce.handler({space:ue,resources:te})},isVisible:ue=>{const te=ae({...ue,omitSystemActions:!0});return te?te.isVisible(ue):!1},class:"oc-files-actions-default-editor-trigger"}]),D=B(()=>p(o)?[]:e.fileExtensions.map(ue=>{const te=e.apps[ue.app];return{name:`editor-${ue.app}`,label:()=>ue.label?typeof ue.label=="function"?ue.label():ue.label:te.name,icon:ue.icon||te.icon,...te.iconFillType&&{iconFillType:te.iconFillType},img:te.img,route:({space:ce,resources:oe})=>N({appFileExtension:ue,space:ce,resource:oe[0]}),handler:ce=>V(ue,ce.space,ce.resources[0]),isVisible:({resources:ce})=>!p(s)||ce.length!==1||!ce[0].canDownload()&&!ue.secureView||!p(r)&&Fn(t,"files-trash-generic")?!1:ce[0].extension&&ue.extension?ce[0].extension.toLowerCase()===ue.extension.toLowerCase():ce[0].mimeType&&ue.mimeType?ce[0].mimeType.toLowerCase()===ue.mimeType.toLowerCase()||ce[0].mimeType.split("/")[0].toLowerCase()===ue.mimeType.toLowerCase():!1,hasPriority:ue.hasPriority,class:`oc-files-actions-${ov(te.name).toLowerCase()}-trigger`}}).sort((ue,te)=>te.hasPriority!==ue.hasPriority&&te.hasPriority?1:0)),N=({appFileExtension:ue,space:te,resource:ce})=>{const oe=ee.isShareSpaceResource(te)?te.id:void 0,J=ue.routeName||ue.app,ne=x(J,te,ce,oe);return t.resolve(ne)},x=(ue,te,ce,oe,J)=>({name:ue,params:{driveAliasAndItem:te==null?void 0:te.getDriveAliasAndItem(ce)},query:{...oe&&{shareId:oe},...ce.fileId&&p(u).routing.idBased&&{fileId:ce.fileId},...J&&{templateId:J},...na(p(t.currentRoute))}}),V=(ue,te,ce)=>{const oe=ee.isShareSpaceResource(te)?te.id:void 0,J=ue.routeName||ue.app,ne=x(J,te,ce,oe);if(p(u).cernFeatures){const se=t.resolve(ne).href,Re=`${ue.routeName}-${ce.path}`;a(se,Re,!0);return}t.push(ne)},G=ue=>{ae(ue).handler({...ue})},ae=ue=>{const te=ye(ue);if(te.length)return te[0]},ye=ue=>{const te=J=>J.isVisible(ue),ce=[...p(_),...p(D)].filter(te).sort((J,ne)=>Number(ne.hasPriority)-Number(J.hasPriority)),oe=ue.omitSystemActions?[]:p(I).filter(te);return[...ce,...oe,...p(A).filter(J=>J.isVisible(ue)&&(J.category==="actions"||lO(J.category)))]};return{editorActions:D,defaultEditorActions:$,systemActions:I,getDefaultAction:ae,getAllAvailableActions:ye,getEditorRouteOpts:x,openEditor:V,triggerDefaultAction:G}},aa=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=We(),{$gettext:r,$ngettext:o}=Fe.useGettext(),i=He(),s=fn(),a=st(),c=Qe(),{updateResourceField:u}=c,l=async({resources:f})=>{const m=[],w=[],y=new Fr({concurrency:a.options.concurrentRequests.resourceBatchActions});if(f.forEach(E=>{w.push(y.add(async()=>{try{const{graphAuthenticated:b}=i;await b.driveItems.createDriveItem(E.driveId,{name:E.name,remoteItem:{id:E.fileId}}),u({id:E.id,field:"syncEnabled",value:!0})}catch(b){console.error(b),m.push(b)}}))}),await Promise.all(w),m.length===0){c.resetSelection(),ht(n,"files-spaces-generic")&&e({title:o("Sync for the selected share was enabled successfully","Sync for the selected shares was enabled successfully",f.length)});return}t({title:o("Failed to enable sync for the the selected share","Failed to enable sync for the selected shares",f.length),errors:m})};return{actions:B(()=>[{name:"enable-sync",icon:"check",handler:f=>s.addTask(()=>l(f)),label:()=>r("Enable sync"),isVisible:({space:f,resources:m})=>{var w;return!jt(n,"files-shares-with-me")&&!ht(n,"files-spaces-generic")||m.length===0||ht(n,"files-spaces-generic")&&(((w=p(f))==null?void 0:w.driveType)!=="share"||m.length>1||m[0].path!=="/")?!1:m.some(y=>!y.syncEnabled)},class:"oc-files-actions-enable-sync-trigger"}])}},la=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=We(),{$gettext:r}=Fe.useGettext(),o=He(),i=fn(),s=st(),{updateResourceField:a,resetSelection:c}=Qe(),u=async({resources:d})=>{const f=[],m=[],w=new Fr({concurrency:s.options.concurrentRequests.resourceBatchActions}),y=!d[0].hidden;if(d.forEach(E=>{m.push(w.add(async()=>{try{await o.graphAuthenticated.driveItems.updateDriveItem(E.driveId,E.id,{"@UI.Hidden":y}),a({id:E.id,field:"hidden",value:y})}catch(b){console.error(b),f.push(b)}}))}),await Promise.all(m),f.length===0){c(),e({title:r(y?"The share was hidden successfully":"The share was unhidden successfully")});return}t({title:r(y?"Failed to hide the share":"Failed to unhide share share"),errors:f})};return{actions:B(()=>[{name:"toggle-hide-share",icon:"eye-off",handler:d=>i.addTask(()=>u(d)),label:({resources:d})=>d[0].hidden?r("Unhide"):r("Hide"),isVisible:({resources:d})=>d.length===0?!1:jt(n,"files-shares-with-me"),class:"oc-files-actions-hide-share-trigger"}])}},ca=()=>{const e=st(),t=We(),{copyResources:n}=Ro(),r=Fe.useGettext(),{$gettext:o}=r,i=Qe(),{currentFolder:s}=Ue.storeToRefs(i),a=B(()=>Ks()?o("⌘ + C"):o("Ctrl + C")),c=({resources:l})=>{Ct(t,"files-common-search")&&(l=l.filter(d=>!ee.isProjectSpaceResource(d))),n(l)};return{actions:B(()=>[{name:"copy",icon:"file-copy-2",handler:c,shortcut:p(a),label:()=>o("Copy"),isVisible:({resources:l})=>{var d,f;if(!ht(t,"files-spaces-generic")&&!Pn(t,"files-public-link")&&!Ct(t,"files-common-favorites")&&!Ct(t,"files-common-search")||ht(t,"files-spaces-projects")||l.length===0)return!1;if(Pn(t,"files-public-link"))return(d=p(s))==null?void 0:d.canCreate();if(Ct(t,"files-common-search")&&l.every(m=>ee.isProjectSpaceResource(m)))return!1;if(p(e.options.runningOnEos)){const m=((f=l[0].path)==null?void 0:f.split("/").filter(Boolean))||[];if(ht(t,"files-spaces-generic")&&m.length<5)return!1}return!!p(l)[0].canDownload()},class:"oc-files-actions-copy-trigger"}])}},Df=()=>({copyToClipboard:t=>{var n;if((n=navigator==null?void 0:navigator.clipboard)!=null&&n.write)return navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"})})]);{const{copy:r}=Vr.useClipboard({legacy:!0});return r(t)}}}),Lf=()=>{const{showMessage:e,showErrorMessage:t}=tt(),{$gettext:n}=Fe.useGettext(),{copyToClipboard:r}=Df(),o=async s=>{try{await r(s),e({title:n("The link has been copied to your clipboard.")})}catch(a){console.error(a),t({title:n("Copy link failed"),errors:[a]})}};return{actions:B(()=>[{name:"copy-permanent-link",icon:"link",label:()=>n("Copy permanent link"),handler:({resources:s})=>{const[a]=s,c=a.privateLink;return o(c)},isVisible:({space:s,resources:a})=>!(a.length!==1||ee.isPublicSpaceResource(s)||ee.isTrashResource(a[0])),class:"oc-files-actions-copy-permanent-link-trigger"}])}},ua=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=We(),{$gettext:r,$ngettext:o}=Fe.useGettext(),i=He(),s=fn(),a=st(),{updateResourceField:c}=Qe(),u=async({resources:d})=>{const f=[],m=[],w=new Fr({concurrency:a.options.concurrentRequests.resourceBatchActions});if(d.forEach(y=>{m.push(w.add(async()=>{try{const{graphAuthenticated:E}=i;await E.driveItems.deleteDriveItem(y.driveId,y.id),c({id:y.id,field:"syncEnabled",value:!1})}catch(E){console.error(E),f.push(E)}}))}),await Promise.all(m),f.length===0){ht(n,"files-spaces-generic")&&(e({title:o("Sync for the selected share was disabled successfully","Sync for the selected shares was disabled successfully",d.length)}),n.push($n("files-shares-with-me")));return}t({title:o("Failed to disable sync for the the selected share","Failed to disable sync for the selected shares",d.length),errors:f})};return{actions:B(()=>[{name:"disable-sync",icon:"spam-3",handler:d=>s.addTask(()=>u(d)),label:()=>r("Disable sync"),isVisible:({space:d,resources:f})=>!jt(n,"files-shares-with-me")&&!ht(n,"files-spaces-generic")||f.length===0||ht(n,"files-spaces-generic")&&((d==null?void 0:d.driveType)!=="share"||f.length>1||f[0].path!=="/")?!1:f.some(m=>m.syncEnabled),class:"oc-files-actions-disable-sync-trigger"}])}},Po=()=>{const e=yt(),t=sn(),n=We(),r=_v(),{displayDialog:o,filesList_delete:i}=Rv(),{$gettext:s}=Fe.useGettext(),a=({space:u,resources:l,deletePermanent:d})=>{if(Ct(n,"files-common-search")&&(l=l.filter(f=>f.canBeDeleted()&&!f.isShareRoot()&&!ee.isProjectSpaceResource(f))),d){o(u,l);return}i(l)};return{actions:B(()=>[{name:"delete",icon:"delete-bin-5",label:()=>s("Delete"),handler:({space:u,resources:l})=>a({space:u,resources:l,deletePermanent:!1}),isVisible:({space:u,resources:l})=>!ht(n,"files-spaces-generic")&&!Pn(n,"files-public-link")&&!Ct(n,"files-common-search")&&!p(r)||l.length===0||ht(n,"files-spaces-generic")&&(u==null?void 0:u.driveType)==="share"&&l[0].path==="/"||l.length===1&&l[0].locked?!1:Ct(n,"files-common-search")?l.some(f=>f.canBeDeleted()&&!f.isShareRoot()&&!ee.isProjectSpaceResource(f)):!l.some(f=>!f.canBeDeleted()),class:"oc-files-actions-delete-trigger"},{name:"delete-permanent",icon:"delete-bin-5",label:()=>s("Delete"),handler:({space:u,resources:l})=>a({space:u,resources:l,deletePermanent:!0}),isVisible:({space:u,resources:l})=>!Fn(n,"files-trash-generic")||!t.filesPermanentDeletion||ee.isProjectSpaceResource(u)&&!u.canDeleteFromTrashBin({user:e.user})?!1:l.length>0,class:"oc-files-actions-delete-permanent-trigger"}])}};function fO(e){return e&&e.length?e[0]:void 0}const Iv=()=>br("$archiverService"),fa=()=>{const{showErrorMessage:e}=tt(),t=We(),n=fn(),r=Iv(),{$ngettext:o,$gettext:i,current:s}=Fe.useGettext(),a=ei(),c=_r(),u=({space:f,resources:m})=>{m.length>1&&(m=m.filter(y=>y.canDownload()&&!ee.isProjectSpaceResource(y)));const w=p(r.fileIdsSupported)?{fileIds:m.map(y=>y.fileId)}:{dir:fs.dirname(fO(m).path)||"/",files:m.map(y=>y.name)};return r.triggerDownload({...w,...f&&ee.isPublicSpaceResource(f)&&{publicToken:f.id,publicLinkPassword:a.publicLinkPassword}}).catch(y=>{console.error(y),e({title:o("Failed to download the selected folder.","Failed to download the selected files.",m.length),errors:[y]})})},l=f=>{const m=p(r.capability);return m?f.reduce((y,E)=>y+parseInt(`${E.size}`),0)>parseInt(m.max_size):void 0};return{actions:B(()=>[{name:"download-archive",icon:"inbox-archive",handler:async f=>{await n.addTask(()=>u(f))},label:()=>i("Download"),disabledTooltip:({resources:f})=>l(f)?i("The selection exceeds the allowed archive size (max. %{maxSize})",{maxSize:Tn(p(r.capability).max_size,s)}):"",isDisabled:({resources:f})=>l(f),isVisible:({resources:f})=>p(c)&&!ht(t,"files-spaces-generic")&&!Pn(t,"files-public-link")&&!Ct(t,"files-common-favorites")&&!Ct(t,"files-common-search")&&!jt(t,"files-shares-with-me")&&!jt(t,"files-shares-with-others")&&!jt(t,"files-shares-via-link")&&!Ct(t,"files-common-search")||!p(r.available)||f.length===0||f.length===1&&!f[0].isFolder||f.length>1&&f.every(w=>ee.isProjectSpaceResource(w))||ee.isProjectSpaceResource(f[0])&&f[0].disabled||!p(r.fileIdsSupported)&&Ct(t,"files-common-favorites")?!1:!f.some(w=>!w.canDownload()),class:"oc-files-actions-download-archive-trigger"}])}},Cv=e=>{const{showErrorMessage:t}=tt(),n=(e==null?void 0:e.clientService)||He(),{$gettext:r}=Fe.useGettext(),o=sn(),i=yt();return{downloadFile:async(a,c,u=null)=>{var l;try{const d=await n.webdav.getFileUrl(a,c,{version:u,doHeadRequest:!0,isUrlSigningEnabled:o.supportUrlSigning,username:(l=i.user)==null?void 0:l.onPremisesSamAccountName});Jl(d,c.name)}catch(d){console.error(d),t({title:r("Download failed"),desc:r("File could not be located"),errors:[d]})}}}},Fo=()=>{const e=We(),{$gettext:t}=Fe.useGettext(),n=_r(),r=sa(),{downloadFile:o}=Cv(),i=({space:a,resources:c})=>{o(a,c[0])};return{actions:B(()=>[{name:"download-file",icon:"file-download",handler:i,label:()=>t("Download"),isVisible:({resources:a})=>p(n)&&!p(r)&&!ht(e,"files-spaces-generic")&&!Pn(e,"files-public-link")&&!Ct(e,"files-common-favorites")&&!Ct(e,"files-common-search")&&!jt(e,"files-shares-with-me")&&!jt(e,"files-shares-with-others")&&!jt(e,"files-shares-via-link")||a.length!==1||a[0].isFolder?!1:a[0].canDownload(),class:"oc-files-actions-download-file-trigger"}])}},Mf=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=yt(),r=sn(),o=We(),{$gettext:i}=Fe.useGettext(),s=He(),{dispatchModal:a}=pt(),c=Qe(),u=fn(),l=({space:m})=>s.webdav.clearTrashBin(m).then(()=>{e({title:i("All deleted files were removed")}),c.clearResources(),c.resetSelection()}).catch(w=>{console.error(w),t({title:i("Failed to empty trash bin"),errors:[w]})}),d=({space:m})=>{a({title:i("Empty trash bin"),confirmText:i("Delete"),message:i("Are you sure you want to permanently delete the listed items? You can’t undo this action."),hasInput:!1,onConfirm:()=>u.addTask(()=>l({space:m}))})};return{actions:B(()=>[{name:"empty-trash-bin",icon:"delete-bin-5",label:()=>i("Empty trash bin"),handler:d,isVisible:({space:m})=>!(!Fn(o,"files-trash-generic")||!r.filesPermanentDeletion||ee.isProjectSpaceResource(m)&&!m.canDeleteFromTrashBin({user:n.user})),isDisabled:()=>c.activeResources.length===0,class:"oc-files-actions-empty-trash-bin-trigger",appearance:"filled"}]),emptyTrashBin:l}},Bf=()=>{const{showErrorMessage:e}=tt(),t=sn(),n=We(),{$gettext:r}=Fe.useGettext(),o=He(),i=_r(),s=mn(),a=Qe(),c=li(),u=async({space:d,resources:f})=>{try{const m=!f[0].starred;await o.webdav.setFavorite(d,f[0],m),a.updateResourceField({id:f[0].id,field:"starred",value:m}),m||c.publish("app.files.list.removeFromFavorites",f[0].id)}catch(m){const w=r('Failed to change favorite state of "%{file}"',{file:f[0].name},!0);e({title:w,errors:[m]})}};return{actions:B(()=>[{name:"favorite",icon:"star",handler:u,label:({resources:d})=>d[0].starred?r("Remove from favorites"):r("Add to favorites"),isVisible:({resources:d})=>p(i)&&!ht(n,"files-spaces-generic")&&!Ct(n,"files-common-favorites")||d.length!==1?!1:t.filesFavorites&&s.can("create","Favorite"),class:"oc-files-actions-favorite-trigger"}])}};function dO(e,t){const n=e.isReceivedShare()||e.isMounted(),r=t===""&&n;return e.canBeDeleted()&&!r}const da=()=>{const e=We(),{cutResources:t}=Ro(),n=Fe.useGettext(),{$gettext:r}=n,o=Qe(),{currentFolder:i}=Ue.storeToRefs(o),s=B(()=>Ks()?r("⌘ + X"):r("Ctrl + X")),a=({resources:u})=>{t(u)};return{actions:B(()=>[{name:"cut",icon:"scissors",handler:a,shortcut:p(s),label:()=>r("Cut"),isVisible:({resources:u})=>!ht(e,"files-spaces-generic")&&!Pn(e,"files-public-link")&&!Ct(e,"files-common-favorites")||u.length===0||!p(i)||u.length===1&&u[0].locked?!1:!u.some(d=>dO(d,p(i).path)===!1),class:"oc-files-actions-move-trigger"}])}},jf=()=>{const e=We(),{$gettext:t}=Fe.useGettext(),{getMatchingSpace:n}=un(),r=Qe(),{currentFolder:o}=Ue.storeToRefs(r),i=c=>c||n(c),s=B(()=>Pn(e,"files-public-link")?Pi("files-public-link"):Nn("files-spaces-generic"));return{actions:B(()=>[{name:"navigate",icon:"folder-open",label:()=>t("Open"),isVisible:({resources:c})=>!(Fn(e,"files-trash-generic")||c.length!==1||p(o)!==null&&ro(c[0],p(o))||!c[0].isFolder||c[0].type==="space"),route:({space:c,resources:u})=>uo({},p(s),rr(i(c),{path:u[0].path,fileId:u[0].fileId})),class:"oc-files-actions-navigate-trigger"}])}},Pv=()=>{const e=We(),t=He(),{getMatchingSpace:n}=un(),{$gettext:r,$ngettext:o}=Fe.useGettext(),i=Ro(),{startWorker:s}=Tv(),a=Qe(),{currentFolder:c}=Ue.storeToRefs(a),u=B(()=>Ks()?r("⌘ + V"):r("Ctrl + V")),l=B(()=>i.action===ii.Cut?gr.MOVE:gr.COPY),d=async({targetSpace:w,sourceSpace:y,resources:E})=>{var h;const b=new Lp(y,E,w,p(c),c,t,r,o),g=await b.getTransferData(p(l));if(!g.length)return;const v=(h=p(c))==null?void 0:h.id;s(g,async({successful:S,failed:T})=>{if(b.showResultMessage(T,S,p(l)),!S.length||p(c)&&v!==p(c).id)return;const I=[],_=[];for(const A of S)I.push((async()=>{const $=await t.webdav.getFileInfo(w,A);_.push($)})());await Promise.allSettled(I),ee.isShareSpaceResource(w)&&_.forEach(A=>{A.remoteItemId=w.id}),a.upsertResources(_)})},f=async({space:w})=>{const y=i.resources.reduce((b,g)=>{if(g.storageId in b)return b[g.storageId].resources.push(g),b;const v=n(g);return v.id in b||(b[v.id]={space:v,resources:[]}),b[v.id].resources.push(g),b},{}),E=Object.values(y).map(({space:b,resources:g})=>d({targetSpace:w,sourceSpace:b,resources:g}));await Promise.all(E),i.clearClipboard()};return{actions:B(()=>[{name:"paste",icon:"clipboard",handler:f,label:()=>r("Paste"),shortcut:p(u),isVisible:({resources:w})=>{var y;return i.resources.length===0||!ht(e,"files-spaces-generic")&&!Pn(e,"files-public-link")&&!Ct(e,"files-common-favorites")||w.length===0?!1:Pn(e,"files-public-link")&&p(c)?(y=p(c))==null?void 0:y.canCreate():!0},class:"oc-files-actions-copy-trigger"}])}},pa=()=>{const{showErrorMessage:e}=tt(),t=sn(),n=We(),{$gettext:r}=Fe.useGettext(),o=He(),i=st(),{dispatchModal:s}=pt(),a=yt(),c=mn(),u=Qe(),{setCurrentFolder:l,upsertResource:d}=u,{isFileNameValid:f}=oa(),m=async(E,b,g)=>{let v=u.currentFolder;try{const h=dt.join(dt.dirname(b.path),g);await o.webdav.moveFiles(E,b,E,{path:h});const S=ro(b,v);if(ee.isShareSpaceResource(E)&&b.isReceivedShare()){if(E.rename(g),S)return v={...v},v.name=g,l(v),n.push(rr(E,{path:"",fileId:b.fileId}));const I={...b};I.name=g,d(I);return}if(S)return v={...v},hl(E,v,h),l(v),n.push(rr(E,{path:h,fileId:b.fileId}));const T={...b};hl(E,T,h),d(T)}catch(h){console.error(h);let S=r('Failed to rename "%{file}" to "%{newName}"',{file:b.name,newName:g},!0);h.statusCode===423&&(S=r('Failed to rename "%{file}" to "%{newName}" - the file is locked',{file:b.name,newName:g},!0)),e({title:S,errors:[h]})}},w=async({space:E,resources:b})=>{const g=u.currentFolder;let v;if(ro(b[0],g)){const N=dt.dirname(g.path);v=(await o.webdav.listFiles(E,{path:N})).children}const h=u.areFileExtensionsShown,S=async N=>{h||(N=`${N}.${b[0].extension}`),await m(E,b[0],N)},T=(N,x)=>{h||(N=`${N}.${b[0].extension}`);const{isValid:V,error:G}=f(b[0],N,v);x(V?null:G)},I=ee.extractNameWithoutExtension(b[0]),_=!b[0].isFolder&&!h?I:b[0].name,A=b[0].isFolder?r("Rename folder %{name}",{name:_}):r("Rename file %{name}",{name:_}),$=!b[0].isFolder&&!h?I:b[0].name,D=b[0].isFolder||!h?null:[0,I.length];s({title:A,confirmText:r("Rename"),hasInput:!0,inputValue:$,inputSelectionRange:D,inputLabel:b[0].isFolder?r("Folder name"):r("File name"),inputRequiredMark:!0,onConfirm:S,onInput:T})};return{actions:B(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:w,isVisible:({resources:E})=>Fn(n,"files-trash-generic")||jt(n,"files-shares-with-me")&&!t.sharingCanRename||E.length!==1||(i.options.routing.fullShareOwnerPaths?E.some(v=>v.remoteItemPath&&v.path):E.some(v=>v.remoteItemId&&v.path==="/"))||E.length===1&&E[0].locked?!1:!E.some(v=>!v.canRename({user:a.user,ability:c})||v.processing),class:"oc-files-actions-rename-trigger"}]),renameResource:m}},ha=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=yt(),r=We(),{$gettext:o,$ngettext:i}=Fe.useGettext(),s=He(),a=ct(),c=Qe(),{startWorker:u}=Av(),l=async(y,E)=>{const b={},g=[],v=[],h=[];for(const S of E){const T=dt.dirname(S.path);let I=[];if(T in b)I=b[T];else{try{I=(await s.webdav.listFiles(y,{path:T})).children}catch{h.push(T)}b[T]=I}I.some(A=>A.name===S.name)||v.filter(A=>A.id!==S.id).some(A=>A.path===S.path)?g.push(S):v.push(S)}return{existingResourcesByPath:b,conflicts:g,resolvedResources:v,missingFolderPaths:h.filter(S=>{var T;return!((T=b[S])!=null&&T.length)})}},d=async y=>{let E=0;const b=[],g=y.length;let v=!1,h;for(const S of y){const T=S.type==="folder";if(v){b.push({resource:S,strategy:h});continue}const I=g-E,A=await new dl(o,i).resolveFileExists({name:S.name,isFolder:T},I,!1);E++,A.doForAllConflicts&&(v=!0,h=A.strategy),b.push({resource:S,strategy:A.strategy})}return b},f=(y,E,b)=>{const g=p(r.currentRoute);u({space:y,resources:E,missingFolderPaths:b},async({successful:v,failed:h})=>{var S,T;if(v.length){let I;v.length===1?I=o("%{resource} was restored successfully",{resource:v[0].name}):I=o("%{resourceCount} files restored successfully",{resourceCount:v.length.toString()}),e({title:I}),g.name===p(r.currentRoute).name&&((S=g.query)==null?void 0:S.fileId)===((T=p(r.currentRoute).query)==null?void 0:T.fileId)&&(c.removeResources(v),c.resetSelection());const A=await s.graphAuthenticated.drives.getDrive(y.id);a.updateSpaceField({id:A.id,field:"spaceQuota",value:A.spaceQuota})}if(h.length){let I;const _={};h.length===1?(_.resource=h[0].resource.name,I=o('Failed to restore "%{resource}"',_,!0)):(_.resourceCount=h.length.toString(),I=o("Failed to restore %{resourceCount} files",_,!0)),t({title:I,errors:h.map(({error:A})=>A)})}})},m=async({space:y,resources:E})=>{const b=E.sort((A,$)=>A.path.length-$.path.length),{existingResourcesByPath:g,conflicts:v,resolvedResources:h,missingFolderPaths:S}=await l(y,b),T=await d(v),I=T.filter(A=>A.strategy===Wn.REPLACE).map(A=>A.resource);h.push(...I);const _=T.filter(A=>A.strategy===Wn.KEEP_BOTH).map(A=>A.resource);for(let A of _){A={...A};const $=dt.dirname(A.path),D=g[$]||[],N=ee.extractExtensionFromFile(A),x=zn(A.name,N,[...D,...T.map(V=>V.resource),...h]);A.name=x,A.path=ee.urlJoin($,x),h.push(A)}return f(y,h,S)};return{actions:B(()=>[{name:"restore",icon:"arrow-go-back",label:()=>o("Restore"),handler:m,isVisible:({space:y,resources:E})=>!Fn(r,"files-trash-generic")||!E.every(b=>ee.isTrashResource(b)&&b.canBeRestored())||ee.isProjectSpaceResource(y)&&!y.canRestoreFromTrashbin({user:n.user})?!1:E.length>0,class:"oc-files-actions-restore-trigger"}]),restoreResources:f,collectConflicts:l}},Uf=()=>br("$previewService"),pO={class:"space-image-modal"},hO={key:0,class:"space-image-modal-image-container"},gO=["src"],mO={class:"oc-text-small oc-text-muted oc-flex oc-flex-middle oc-mt-xs"},yO=["textContent"],Fv=Ne({__name:"SpaceImageModal",props:{modal:{},space:{},file:{}},setup(e,{expose:t}){const{showMessage:n,showErrorMessage:r}=tt(),{$gettext:o}=Fe.useGettext(),i=He(),s=ct(),{createDefaultMetaFolder:a}=Ui(),{getDefaultMetaFolder:c}=ci(),{setCropperInstance:u}=Yf(),l=le(null),d=Qa("imageRef"),f=le(null);t({onConfirm:async()=>{var g;const E=(g=p(l))==null?void 0:g.getCroppedCanvas({imageSmoothingQuality:"high"}),b=await w(E);await y(b)}});const w=async E=>(await new Promise(g=>E.toBlob(g,"image/png"))).arrayBuffer(),y=async E=>{const b=i.graphAuthenticated;s.addToImagesLoading(e.space.id);let g=await c(e.space);g||(g=await a(e.space));const v={"Content-Type":"application/offset+octet-stream"};try{const{fileId:h,processing:S}=await i.webdav.putFileContents(e.space,{parentFolderId:g.id,fileName:"image.png",content:E,headers:v,overwrite:!0}),T=await b.drives.updateDrive(e.space.id,{name:e.space.name,special:[{specialFolder:{name:"image"},id:h}]});S||s.removeFromImagesLoading(e.space.id),s.updateSpaceField({id:e.space.id,field:"spaceImageData",value:T.spaceImageData}),n({title:o("Space image was set successfully")}),Ke.publish("app.files.spaces.uploaded-image",T)}catch(h){s.removeFromImagesLoading(e.space.id),console.error(h),r({title:o("Failed to set space image"),errors:[h]})}};return Bt(async()=>{var E;try{f.value=URL.createObjectURL(e.file),p(l)&&((E=p(l))==null||E.destroy()),await _n(),l.value=new Ra(p(d),{aspectRatio:16/9,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1}),u(l)}catch(b){r({title:o("Failed to load space image"),errors:[b]})}}),(E,b)=>{const g=pe("oc-icon");return X(),de("div",pO,[f.value?(X(),de("div",hO,[fe("img",{ref_key:"imageRef",ref:d,src:f.value},null,8,gO),fe("div",mO,[he(g,{class:"oc-mr-xs",name:"information",size:"small","fill-type":"line"}),fe("span",{textContent:W.toDisplayString(p(o)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:p(o)("+-"),panKeys:p(o)("↑↓←→")}))},null,8,yO)])])):Ce("",!0)])}}}),Ov=()=>{const e=yt(),t=We(),{$gettext:n}=Fe.useGettext(),r=He(),o=fn(),i=Uf(),{dispatchModal:s}=pt(),a=async({space:u,resources:l})=>{const{getFileContents:d}=r.webdav,f=await d(u,l[0],{responseType:"blob"}),m=new File([f.body],l[0].name);s({title:n("Crop your Space image"),confirmText:n("Confirm"),customComponent:Fv,customComponentAttrs:()=>({file:m,space:u})})};return{actions:B(()=>[{name:"set-space-image",icon:"image-edit",handler:u=>o.addTask(()=>a(u)),label:()=>n("Set as space image"),isVisible:({space:u,resources:l})=>l.length!==1||!l[0].mimeType||!i.isMimetypeSupported(l[0].mimeType,!0)||!ht(t,"files-spaces-generic")||!u?!1:u.canEditImage({user:e.user}),class:"oc-files-actions-set-space-image-trigger"}])}},bO=()=>{const e=We(),{$gettext:t}=Fe.useGettext(),n=_r(),r=()=>{const i=Fn(e,"files-trash-generic")?null:"actions";Ke.publish(Tt.openWithPanel,i)};return{actions:B(()=>[{name:"show-actions",icon:"slideshow-3",label:()=>t("All Actions"),handler:r,isVisible:({resources:i})=>p(n)?i.length===1:!1,class:"oc-files-actions-show-actions-trigger"}])}},qf=()=>{const e=We(),t=Qe(),{$gettext:n}=Fe.useGettext();return{actions:B(()=>[{name:"show-details",icon:"information",class:"oc-files-actions-show-details-trigger",label:()=>n("Details"),isVisible:({resources:o})=>Fn(e,"files-trash-generic")?!1:o.length>0,handler({resources:o}){t.setSelection(o.map(({id:i})=>i)),Ke.publish(Tt.open)}}])}},kv=()=>{const e=sn(),{isPersonalSpaceRoot:t}=un();return{canListShares:({space:r,resource:o})=>{var i;return!e.sharingApiEnabled||ee.isPublicSpaceResource(r)||t(o)||ee.isTrashResource(o)?!1:ee.isIncomingShareResource(o)?o.sharePermissions.includes(ee.GraphSharePermission.readPermissions):ee.isShareSpaceResource(r)?(i=r.graphPermissions)==null?void 0:i.includes(ee.GraphSharePermission.readPermissions):!0}}},xv=()=>{const e=sn(),t=mn(),n=yt();return{canShare:({space:o,resource:i})=>!e.sharingApiEnabled||ee.isShareSpaceResource(o)||ee.isProjectSpaceResource(o)&&!o.canShare({user:n.user})?!1:i.canShare({ability:t,user:n.user})}},Vf=()=>{const e=We(),{$gettext:t}=Fe.useGettext(),{canShare:n}=xv(),r=Qe(),o=({resources:s})=>{r.setSelection(s.map(({id:a})=>a)),Ke.publish(Tt.openWithPanel,"sharing#peopleShares")};return{actions:B(()=>[{name:"show-shares",icon:"user-add",label:()=>t("Share"),handler:o,isVisible:({space:s,resources:a})=>Fn(e,"files-trash-generic")||a.length!==1?!1:n({space:s,resource:a[0]}),class:"oc-files-actions-show-shares-trigger"}])}},zf=()=>{const{showMessage:e,showErrorMessage:t}=tt(),{can:n}=mn(),{$gettext:r,$ngettext:o}=Fe.useGettext(),{createSpace:i}=Ui(),{checkSpaceNameModalInput:s}=ci(),a=He(),c=We(),u=B(()=>n("create-all","Drive")),{dispatchModal:l}=pt(),d=st(),f=ct(),m=Qe(),w=async({spaceName:b,resources:g,space:v})=>{const{webdav:h}=a,S=new Fr({concurrency:d.options.concurrentRequests.resourceBatchActions}),T=[];try{const I=await i(b);f.upsertSpace(I),g.length===1&&g[0].isFolder&&(g=(await h.listFiles(v,{path:g[0].path})).children);for(const _ of g)T.push(S.add(()=>h.copyFiles(v,_,I,{path:_.name})));await Promise.all(T),m.resetSelection(),e({title:r("Space was created successfully")})}catch(I){console.error(I),t({title:r("Creating space failed…"),errors:[I]})}},y=({resources:b,space:g})=>{l({title:o('Create Space from "%{resourceName}"',"Create Space from selection",b.length,{resourceName:b[0].name}),message:o('Create Space with the content of "%{resourceName}".',"Create Space with the selected files.",b.length,{resourceName:b[0].name}),contextualHelperLabel:r("The marked elements will be copied."),contextualHelperData:{title:r("Restrictions"),text:r("Shares, versions and tags will not be copied.")},confirmText:r("Create"),hasInput:!0,inputLabel:r("Space name"),inputRequiredMark:!0,onInput:s,onConfirm:v=>w({spaceName:v,space:g,resources:b})})};return{actions:B(()=>[{name:"create-space-from-resource",icon:"function",handler:y,label:()=>r("Create Space from selection"),isVisible:({resources:b,space:g})=>!(!b.length||!p(u)||!ht(c,"files-spaces-generic")||!ee.isPersonalSpaceResource(g)),class:"oc-files-actions-create-space-from-resource-trigger"}])}},Nv=()=>{const e=an("scrollTo"),t=an("details"),n=Qe(),r=B(()=>Rt(p(e))),o=B(()=>Rt(p(t))),i=(a,c={forceScroll:!1,topbarElement:null})=>{const u=document.querySelectorAll(`[data-item-id='${a}']`)[0];if(!u){Ke.publish("app.files.navigate.page",{resourceId:a,forceScroll:c.forceScroll,topbarElement:c.topbarElement});return}const l=document.getElementById(c.topbarElement),d=(l==null?void 0:l.offsetHeight)||0+u.offsetHeight*2;(u.getBoundingClientRect().bottom>window.innerHeight||u.getBoundingClientRect().top<d||c.forceScroll)&&u.scrollIntoView({behavior:"smooth",block:"center"})};return Ke.subscribe("app.files.navigate.scrollTo",a=>i(a.resourceId,{forceScroll:a.forceScroll,topbarElement:a.topbarElement})),{scrollToResource:i,scrollToResourceFromRoute:(a,c)=>{if(!p(r)||!a.length)return;const u=p(a).find(l=>ee.isIncomingShareResource(l)?l.remoteItemId===p(r):l.id===p(r));u&&u.processing!==!0&&(n.setSelection([u.id]),i(u.id,{forceScroll:!0,topbarElement:c}),p(o)&&Ke.publish(Tt.openWithPanel,p(o)))}}},vO=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=tt(),{dispatchModal:r}=pt(),{$gettext:o}=Fe.useGettext(),{scrollToResource:i}=Nv(),s=Qe(),{resources:a,currentFolder:c}=Ue.storeToRefs(s),u=He(),{isFileNameValid:l}=oa(),d=async w=>{w=w.trimEnd();try{const y=dt.join(p(c).path,w),E=await u.webdav.createFolder(p(e),{path:y});ee.isShareSpaceResource(p(e))&&(E.remoteItemId=p(e).id),s.upsertResource(E),t({title:o('"%{folderName}" was created successfully',{folderName:w})}),await _n(),i(E.id,{forceScroll:!0,topbarElement:"files-app-bar"})}catch(y){console.error(y),n({title:o("Failed to create folder"),errors:[y]})}},f=()=>{let w=o("New folder");p(a).some(y=>y.name===w)&&(w=zn(w,"",p(a))),r({title:o("Create a new folder"),confirmText:o("Create"),hasInput:!0,inputValue:w,inputLabel:o("Folder name"),inputRequiredMark:!0,onConfirm:d,onInput:(y,E)=>{const b={path:dt.join(p(c).path,y),name:y,isFolder:!0},{isValid:g,error:v}=l(b,y,p(a));return E(g?null:v)}})};return{actions:B(()=>[{name:"create-folder",icon:"folder",handler:f,label:()=>o("New Folder"),isVisible:()=>{var w;return(w=p(c))==null?void 0:w.canCreate()},class:"oc-files-actions-create-new-folder"}]),addNewFolder:d}},wO=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=tt(),r=yt(),{$gettext:o}=Fe.useGettext(),{dispatchModal:i}=pt(),s=ir(),{isEnabled:a}=si(),{openEditor:c}=Qn(),u=He(),l=Qe(),{resources:d,currentFolder:f,areFileExtensionsShown:m}=Ue.storeToRefs(l),{isFileNameValid:w}=oa(),y=B(()=>s.fileExtensions.filter(({newFileMenu:v})=>!!v)),E=(v,h)=>(l.upsertResource(v),c(h,p(e),v)),b=(v,h,S)=>{let T=o("New file")+`.${h}`;p(d).some(_=>_.name===T)&&(T=zn(T,h,p(d))),m.value||(T=ee.extractNameWithoutExtension({name:T,extension:h}));const I=m.value?[0,T.length-(h.length+1)]:null;i({title:o("Create a new file"),confirmText:o("Create"),hasInput:!0,inputValue:T,inputLabel:o("File name"),inputRequiredMark:!0,inputSelectionRange:I,onConfirm:async _=>{m.value||(_=`${_}.${h}`);try{let A;if(S.createFileHandler)A=await S.createFileHandler({fileName:_,space:p(e),currentFolder:p(f)});else{const $=dt.join(p(f).path,_);A=await u.webdav.putFileContents(p(e),{path:$})}return l.upsertResource(A),t({title:o('"%{fileName}" was created successfully',{fileName:A.name})}),p(a)?void 0:E(A,S)}catch(A){console.error(A),n({title:o("Failed to create file"),errors:[A]})}},onInput:(_,A)=>{const $=m.value?_:`${_}.${h}`,D={path:dt.join(p(f).path,$),name:$,extension:h},{isValid:N,error:x}=w(D,$);A(N?null:x)}})};return{actions:B(()=>{var S;const v=[],h={};for(const T of p(y)||[])T.hasPriority?h[T.extension]=T:h[T.extension]=h[T.extension]||T;for(const[,T]of Object.entries(h))v.push({name:"create-new-file",icon:"add",handler:I=>b(I,T.extension,T),label:()=>o(T.newFileMenu.menuTitle()),isVisible:()=>{var I;return(I=p(f))==null?void 0:I.canUpload({user:r.user})},class:"oc-files-actions-create-new-file",ext:T.extension,isExternal:(S=T.app)==null?void 0:S.startsWith("external-")});return v}),openFile:E}};class SO{constructor(t,n,r){Ee(this,"state");Ee(this,"observeEnter");Ee(this,"observeExit");Ee(this,"onEnterCallCount");Ee(this,"onExitCallCount");Ee(this,"onEnter");Ee(this,"onExit");Ee(this,"threshold");Ee(this,"unobserver");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 $v{constructor(t={}){Ee(this,"targets");Ee(this,"intersectionObserver");Ee(this,"options");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 SO(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 EO={name:"resource-type-folder",color:"var(--oc-color-icon-folder)"},TO={name:"layout-grid",color:"var(--oc-role-secondary)"},AO={name:"resource-type-file",color:"var(--oc-role-on-surface)"},RO=Bp(),_O=Ne({name:"ResourceIcon",props:{resource:{type:Object,required:!0},size:{type:String,default:"large",validator:e=>YP.some(t=>t===e)}},setup(e){const t=hr(Mp),n=B(()=>e.resource.type==="folder"||e.resource.isFolder),r=B(()=>e.resource.type==="space"),o=B(()=>{var c;return(c=e.resource.extension)==null?void 0:c.toLowerCase()}),i=B(()=>{var c;return(c=e.resource.mimeType)==null?void 0:c.toLowerCase()}),s=B(()=>{if(p(r))return TO;if(p(n))return EO;const c=RO[p(o)]||(t==null?void 0:t.mimeType[p(i)])||(t==null?void 0:t.extension[p(o)]);return{...AO,...c}}),a=B(()=>p(r)?"oc-resource-icon-space":p(n)?"oc-resource-icon-folder":"oc-resource-icon-file");return{icon:s,iconTypeClass:a}}});function IO(e,t,n,r,o,i){const s=pe("oc-icon");return X(),Ae(s,{key:`resource-icon-${e.icon.name}`,name:e.icon.name,color:e.icon.color,size:e.size,class:W.normalizeClass(["oc-resource-icon",e.iconTypeClass])},null,8,["name","color","size","class"])}const Oo=ze(_O,[["render",IO]]),CO={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=st(),{options:n}=Ue.storeToRefs(t);return{linkTarget:B(()=>p(n).cernFeatures&&e.link&&!e.resource.isFolder?"_blank":"_self")}},computed:{isNavigatable(){return(this.resource.isFolder||this.link)&&!this.resource.disabled},componentType(){return this.isNavigatable?"router-link":"oc-button"},componentProps(){return this.isNavigatable?{to:this.link}:{appearance:"raw",gapSize:"none",justifyContent:"left"}}},methods:{emitClick(){this.isNavigatable||this.$emit("click")}}},PO={key:1};function FO(e,t,n,r,o,i){return n.isResourceClickable?(X(),Ae(Nr(i.componentType),Gt({key:0},i.componentProps,{target:e.linkTarget,draggable:!1,class:"oc-resource-link","no-hover":"",onDragstart:t[0]||(t[0]=Cn(()=>{},["prevent","stop"])),onClick:i.emitClick}),{default:Se(()=>[Xe(e.$slots,"default")]),_:3},16,["target","onClick"])):(X(),de("span",PO,[Xe(e.$slots,"default")]))}const Wf=ze(CO,[["render",FO]]),OO=Ne({name:"ResourceName",props:{name:{type:String,required:!0},pathPrefix:{type:String,required:!1,default:""},extension:{type:String,required:!1,default:""},type:{type:String,required:!0},fullPath:{type:String,required:!0},isPathDisplayed:{type:Boolean,required:!1,default:!1},isExtensionDisplayed:{type:Boolean,required:!1,default:!0},truncateName:{type:Boolean,required:!1,default:!0}},computed:{tooltip(){return this.pathTooltip},fullName(){return(this.displayPath||"")+this.name},displayName(){return this.extension?this.name.slice(0,-this.extension.length-1):this.name},displayExtension(){return this.extension?"."+this.extension:""},displayPath(){if(!this.isPathDisplayed)return null;const e=this.fullPath.replace(/^\//,"").split("/");return e.length<2?null:e.length===2?e[0]+"/":`…/${e[e.length-2]}/`},pathTooltip(){return!this.isPathDisplayed||this.displayPath===this.fullPath?null:this.pathPrefix?fs.join(this.pathPrefix,this.fullPath):this.fullPath},htmlTitle(){if(!this.tooltip)return this.isExtensionDisplayed?`${this.displayName}${this.displayExtension}`:this.displayName}}}),kO=["data-test-resource-path","data-test-resource-name","data-test-resource-type","title"],xO={key:0,class:"oc-text-truncate"},NO=["textContent"],$O=["textContent"],DO=["textContent"];function LO(e,t,n,r,o,i){const s=ln("oc-tooltip");return ot((X(),de("span",{class:W.normalizeClass(["oc-resource-name",[{"oc-display-inline-block":!e.truncateName}]]),"data-test-resource-path":e.fullPath,"data-test-resource-name":e.fullName,"data-test-resource-type":e.type,title:e.htmlTitle},[e.truncateName?(X(),de("span",xO,[fe("span",{class:"oc-resource-basename",textContent:W.toDisplayString(e.displayName)},null,8,NO)])):(X(),de("span",{key:1,class:"oc-resource-basename oc-text-break",textContent:W.toDisplayString(e.displayName)},null,8,$O)),e.extension&&e.isExtensionDisplayed?(X(),de("span",{key:2,class:"oc-resource-extension",textContent:W.toDisplayString(e.displayExtension)},null,8,DO)):Ce("",!0)],10,kO)),[[s,e.tooltip]])}const Hf=ze(OO,[["render",LO]]),MO=Ne({name:"ResourceListItem",components:{ResourceIcon:Oo,ResourceLink:Wf,ResourceName:Hf},props:{resource:{type:Object,required:!0},pathPrefix:{type:String,required:!1,default:""},link:{type:Object,required:!1,default:null},isPathDisplayed:{type:Boolean,required:!1,default:!1},parentFolderLink:{type:Object,required:!1,default:null},parentFolderName:{type:String,required:!1,default:""},parentFolderLinkIconAdditionalAttributes:{type:Object,required:!1,default:()=>({})},isExtensionDisplayed:{type:Boolean,required:!1,default:!0},isThumbnailDisplayed:{type:Boolean,required:!1,default:!0},isIconDisplayed:{type:Boolean,required:!1,default:!0},isResourceClickable:{type:Boolean,required:!1,default:!0}},emits:["click"],computed:{parentFolderComponentType(){return this.parentFolderLink?"router-link":"span"},parentFolderStyle(){return{cursor:this.parentFolderLink?"pointer":"default"}},parentFolderLinkIconAttrs(){return{"fill-type":"line",name:"folder-2",size:"small",...this.parentFolderLinkIconAdditionalAttributes}},hasThumbnail(){return this.isThumbnailDisplayed&&Object.prototype.hasOwnProperty.call(this.resource,"thumbnail")},thumbnail(){return this.resource.thumbnail},tooltipLabelIcon(){return this.resource.locked?this.$gettext("This item is locked"):null}},methods:{emitClick(){this.$emit("click")}}}),BO={class:"oc-resource-indicators"},jO=["textContent"];function UO(e,t,n,r,o,i){const s=pe("oc-image"),a=pe("resource-icon"),c=pe("resource-link"),u=pe("resource-name"),l=pe("oc-icon"),d=ln("oc-tooltip");return X(),de("div",{class:W.normalizeClass(["oc-resource oc-text-overflow",{"oc-resource-no-interaction":!e.isResourceClickable}])},[e.isIconDisplayed?(X(),Ae(c,{key:0,resource:e.resource,link:e.link,"is-resource-clickable":e.isResourceClickable,class:"oc-resource-icon-link",onClick:e.emitClick},{default:Se(()=>[e.hasThumbnail?ot((X(),Ae(s,{key:e.thumbnail,src:e.thumbnail,class:"oc-resource-thumbnail",width:"40",height:"40","aria-label":e.tooltipLabelIcon},null,8,["src","aria-label"])),[[d,e.tooltipLabelIcon]]):ot((X(),Ae(a,{key:1,"aria-label":e.tooltipLabelIcon,resource:e.resource},null,8,["aria-label","resource"])),[[d,e.tooltipLabelIcon]])]),_:1},8,["resource","link","is-resource-clickable","onClick"])):Ce("",!0),fe("div",{class:W.normalizeClass(["oc-resource-details oc-text-overflow",{"oc-pl-s":e.isIconDisplayed}])},[he(c,{resource:e.resource,"is-resource-clickable":e.isResourceClickable,link:e.link,class:"oc-text-overflow",onClick:e.emitClick},{default:Se(()=>[(X(),Ae(u,{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","onClick"]),fe("div",BO,[e.isPathDisplayed?(X(),Ae(Nr(e.parentFolderComponentType),{key:0,to:e.parentFolderLink,style:W.normalizeStyle(e.parentFolderStyle),class:"parent-folder oc-text-truncate"},{default:Se(()=>[he(l,W.normalizeProps(rl(e.parentFolderLinkIconAttrs)),null,16),fe("span",{class:"text oc-text-truncate",textContent:W.toDisplayString(e.parentFolderName)},null,8,jO)]),_:1},8,["to","style"])):Ce("",!0)])],2)],2)}const ko=ze(MO,[["render",UO]]),Dv=Ne({__name:"ResourcePreview",props:{searchResult:{default:()=>({data:{}})},isClickable:{type:Boolean,default:!0},term:{default:""}},setup(e){const t=new $v,{triggerDefaultAction:n}=Qn(),{getMatchingSpace:r}=un(),{getDefaultAction:o}=Qn(),{loadPreview:i}=ed(),s=Qa("resourceListItem"),{getPathPrefix:a,getParentFolderName:c,getParentFolderLink:u,getParentFolderLinkIconAdditionalAttributes:l,getFolderLink:d}=ui(),f=Qe(),m=le(),w=B(()=>f.areFileExtensionsShown),y=B(()=>({...e.searchResult.data,...p(m)&&{thumbnail:p(m)}})),E=B(()=>r(p(y))),b=B(()=>{const _=p(y);return ee.isSpaceResource(_)&&_.disabled===!0}),g=()=>{n({space:p(E),resources:[p(y)]})},v=B(()=>e.isClickable?{parentFolderLink:u(p(y)),onClick:g}:{isResourceClickable:!1}),h=B(()=>{var $;if(p(y).isFolder)return d(p(y));const _=o({resources:[p(y)],space:p(E)});if(!(_!=null&&_.route))return null;const A=_.route({space:p(E),resources:[p(y)]});return A.query={...A.query,contextRouteQuery:{...(($=A.query)==null?void 0:$.contextRouteQuery)||{},term:e.term}},A}),S=a(p(y)),T=c(p(y)),I=l(p(y));return Bt(()=>{p(b)&&p(s).parentElement.classList.add("disabled");const _=async()=>{const $=await i({space:p(E),resource:p(y),dimensions:Kn.Thumbnail,cancelRunning:!0,updateStore:!1});$&&(m.value=$)},A=It.debounce(({unobserve:$})=>{$(),_()},250);t.observe(p(s).$el,{onEnter:A,onExit:A.cancel})}),Vn(()=>{t.disconnect()}),(_,A)=>(X(),Ae(ko,Gt({ref_key:"resourceListItem",ref:s,resource:y.value,"path-prefix":p(S),"is-path-displayed":!0,link:h.value,"is-extension-displayed":w.value,"parent-folder-link-icon-additional-attributes":p(I),"parent-folder-name":p(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"]))}}),qO=7,VO=200,zO=Ne({name:"CreateShortcutModal",components:{ResourcePreview:Dv},props:{modal:{type:Object,required:!0},space:{type:Object,required:!0}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:n}){const r=He(),{$gettext:o}=Fe.useGettext(),{showMessage:i,showErrorMessage:s}=tt(),a=We(),{search:c}=kf(),{getPathPrefix:u,getParentFolderName:l,getParentFolderLink:d,getParentFolderLinkIconAdditionalAttributes:f,getFolderLink:m}=ui(),w=Qe(),{resources:y,currentFolder:E}=Ue.storeToRefs(w),b=le(null),g=le(""),v=le(""),h=le(null),S=le(null),T=le(!1);let I=null;const _=K=>{const z=K.trim();return G(z)?z:`https://${z}`},A=B(()=>_(p(g))),$=B(()=>!!p(y).find(K=>K.name===`${p(v)}.url`)),D=B(()=>p($)||!p(v)||!p(g));St(D,()=>{t("update:confirmDisabled",p(D))},{immediate:!0});const N=B(()=>p($)?o("%{name} already exists",{name:`${p(v)}.url`}):/[/]/.test(p(v))?o('Shortcut name cannot contain "/"'):""),x=pn.useTask(function*(K,z){h.value=null,z=`name:"*${z}*" NOT name:"*.url"`;try{h.value=yield c(z,qO)}catch{}}),V=It.debounce(()=>{x.perform(p(g))},VO),G=K=>["http://","https://"].some(M=>M.startsWith(K)||K.startsWith(M)),ae=()=>{h.value=null,g.value=p(A);try{let K=new URL(p(A)).host;p(y).some(z=>z.name===`${K}.url`)&&(K=zn(`${K}.url`,"url",p(y)).slice(0,-4)),v.value=K}catch{}},ye=K=>{h.value=null;const z=new URL(window.location.href);let M=K.data.name;g.value=`${z.origin}/f/${K.id}`,p(y).some(q=>q.name===`${M}.url`)&&(M=zn(`${M}.url`,"url",p(y)).slice(0,-4)),v.value=M},ue=K=>p(S)===K,te=(K=!1)=>{const z=Array.from(document.querySelectorAll("li.selectable-item"));let M=p(S)!==null?p(S):K?z.length:-1;const q=K?-1:1;do if(M+=q,M<0||M>z.length-1)return null;while(z[M].classList.contains("disabled"));return M},ce=()=>{S.value=te(!0)},oe=()=>{S.value=te(!1)},J=K=>{p(T)&&(K.stopPropagation(),p(b).hide())},ne=K=>{var z,M;p(T)&&(K.stopPropagation(),p(S)!==null&&(p(S)===0?ae():ye((M=(z=p(h))==null?void 0:z.values)==null?void 0:M[p(S)-1]),p(b).hide()))},se=()=>{T.value=!1,S.value=null},Re=()=>{T.value=!0,S.value=0},H=()=>{g.value.trim().length&&p(b).show()},R=async()=>{if(await _n(),v.value=g.value.trim(),!g.value.trim().length){p(b).hide();return}p(b).show(),Pn(a,"files-public-link")||V()},F=async()=>{try{const z=`[InternetShortcut]
52
- URL=${pd.sanitize(_(p(g)),{USE_PROFILES:{html:!0}})}`,M=ee.urlJoin(p(E).path,`${p(v)}.url`),q=await r.webdav.putFileContents(e.space,{path:M,content:z});w.upsertResource(q),i({title:o("Shortcut was created successfully")})}catch(K){console.error(K),s({title:o("Failed to create shortcut"),errors:[K]})}};return Bt(async()=>{var K,z;await _n(),I=new hd((z=(K=p(b))==null?void 0:K.$refs)==null?void 0:z.drop)}),St(h,async()=>{await _n(),!(!p(T)||!I)&&(I.unmark(),I.mark(p(g),{element:"span",className:"mark-highlight",exclude:[".selectable-item-url *",".create-shortcut-modal-search-separator *"]}))},{deep:!0}),St(S,()=>{var z,M;if(!p(T)||typeof((M=(z=p(b))==null?void 0:z.$el)==null?void 0:M.scrollTo)!="function")return;const K=p(b).$el.querySelectorAll(".selectable-item");p(b).$el.scrollTo(0,p(S)===null?0:K[p(S)].getBoundingClientRect().y-K[p(S)].getBoundingClientRect().height)}),n({onConfirm:F}),{inputUrl:g,inputFilename:v,dropRef:b,dropItemUrl:A,searchResult:h,confirmButtonDisabled:D,inputFileNameErrorMessage:N,searchTask:x,dropItemUrlClicked:ae,dropItemResourceClicked:ye,getPathPrefix:u,getFolderLink:m,getParentFolderLink:d,getParentFolderName:l,getParentFolderLinkIconAdditionalAttributes:f,onKeyEnterDrop:ne,onKeyDownDrop:oe,onKeyUpDrop:ce,onKeyEscDrop:J,onHideDrop:se,onShowDrop:Re,onInputUrlInput:R,onClickUrlInput:H,isDropItemActive:ue,onConfirm:F}}}),WO={class:"oc-flex oc-flex-middle create-shortcut-modal-label"},HO={for:"create-shortcut-modal-url-input"},GO=["textContent"],KO={key:0,class:"oc-p-xs oc-flex oc-flex-center"},QO={class:"create-shortcut-modal-search-separator oc-text-muted oc-text-small oc-pl-xs"},XO=["textContent"],YO={key:0,class:"oc-flex oc-width-1-1 oc-mt-m"},JO={class:"oc-flex oc-flex-middle create-shortcut-modal-label"},ZO={for:"create-shortcut-modal-filename-input"};function ek(e,t,n,r,o,i){const s=pe("oc-contextual-helper"),a=pe("oc-text-input"),c=pe("oc-icon"),u=pe("oc-button"),l=pe("oc-spinner"),d=pe("resource-preview"),f=pe("oc-list"),m=pe("oc-drop");return X(),de(qe,null,[he(a,{id:"create-shortcut-modal-url-input",modelValue:e.inputUrl,"onUpdate:modelValue":[t[0]||(t[0]=w=>e.inputUrl=w),e.onInputUrlInput],placeholder:"example.org",label:e.$gettext("Webpage or file"),onKeydown:[no(e.onKeyUpDrop,["up"]),no(e.onKeyDownDrop,["down"]),no(e.onKeyEscDrop,["esc"]),no(e.onKeyEnterDrop,["enter"])],onClick:e.onClickUrlInput},{label:Se(()=>[fe("div",WO,[fe("label",HO,[Ot(W.toDisplayString(e.$gettext("Webpage or file"))+" ",1),t[2]||(t[2]=fe("span",{class:"oc-text-error","aria-hidden":"true"},"*",-1))]),he(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:"oc-ml-xs"},null,8,["text","title"])])]),_:1},8,["modelValue","label","onKeydown","onUpdate:modelValue","onClick"]),he(m,{ref:"dropRef",class:"oc-pt-s","padding-size":"remove","drop-id":"create-shortcut-modal-contextmenu",mode:"manual",position:"bottom-start","close-on-click":!0,onHideDrop:e.onHideDrop,onShowDrop:e.onShowDrop},{default:Se(()=>[he(f,null,{default:Se(()=>{var w,y;return[fe("li",{class:W.normalizeClass(["oc-p-xs selectable-item selectable-item-url",{active:e.isDropItemActive(0)}])},[he(u,{class:"oc-width-1-1",appearance:"raw","justify-content":"left",onClick:e.dropItemUrlClicked},{default:Se(()=>[he(c,{name:"external-link"}),fe("span",{textContent:W.toDisplayString(e.dropItemUrl)},null,8,GO)]),_:1},8,["onClick"])],2),e.searchTask.isRunning?(X(),de("li",KO,[he(l)])):Ce("",!0),(y=(w=e.searchResult)==null?void 0:w.values)!=null&&y.length?(X(),de(qe,{key:1},[fe("li",QO,[fe("span",{textContent:W.toDisplayString(e.$gettext("Link to a file"))},null,8,XO)]),(X(!0),de(qe,null,wt(e.searchResult.values,(E,b)=>(X(),de("li",{key:b,class:W.normalizeClass(["oc-p-xs selectable-item",{active:e.isDropItemActive(b+1)}])},[he(u,{class:"oc-width-1-1",appearance:"raw","justify-content":"left",onClick:g=>e.dropItemResourceClicked(E)},{default:Se(()=>[he(d,{"search-result":E,"is-clickable":!1},null,8,["search-result"])]),_:2},1032,["onClick"])],2))),128))],64)):Ce("",!0)]}),_:1})]),_:1},8,["onHideDrop","onShowDrop"]),e.inputFilename?(X(),de("div",YO,[he(a,{id:"create-shortcut-modal-filename-input",modelValue:e.inputFilename,"onUpdate:modelValue":t[1]||(t[1]=w=>e.inputFilename=w),label:e.$gettext("Shortcut name"),class:"oc-width-1-1","error-message":e.inputFileNameErrorMessage,"fix-message-line":!0},{label:Se(()=>[fe("div",JO,[fe("label",ZO,[Ot(W.toDisplayString(e.$gettext("Shortcut name"))+" ",1),t[3]||(t[3]=fe("span",{class:"oc-text-error","aria-hidden":"true"},"*",-1))]),he(s,{text:e.$gettext("Shortcut name as it will appear in the file list."),title:e.$gettext("Shortcut name"),class:"oc-ml-xs"},null,8,["text","title"])])]),_:1},8,["modelValue","label","error-message"])])):Ce("",!0)],64)}const Lv=ze(zO,[["render",ek]]),tk=({space:e})=>{const{dispatchModal:t}=pt(),{$gettext:n}=Fe.useGettext(),r=Qe(),{currentFolder:o}=Ue.storeToRefs(r);return{actions:B(()=>[{name:"create-shortcut",icon:"external-link",handler:()=>{t({title:n("Create a Shortcut"),confirmText:n("Create"),customComponent:Lv,customComponentAttrs:()=>({space:p(e)})})},label:()=>n("New Shortcut"),isVisible:()=>{var s;return(s=p(o))==null?void 0:s.canCreate()},class:"oc-files-actions-create-new-shortcut"}])}},nk=()=>{const{showErrorMessage:e}=tt(),t=We(),{$gettext:n}=Fe.useGettext(),r=_r(),o=sa(),i=He(),s=u=>{const l=/URL=(.+)/,d=u.match(l);if(d&&d[1])return d[1];throw new Error("unable to extract url")},a=async({resources:u,space:l})=>{try{const d=new URL(window.location.href),f=(await i.webdav.getFileContents(l,u[0])).body;let m=s(f);if(m=m.match(/^http[s]?:\/\//)?m:`https://${m}`,m=pd.sanitize(m,{USE_PROFILES:{html:!0}}),m.startsWith(d.origin)){window.location.href=m;return}window.open(m)}catch(d){console.error(d),e({title:n("Failed to open shortcut"),errors:[d]})}};return{actions:B(()=>[{name:"open-shortcut",icon:"external-link",category:"context",handler:a,label:()=>n("Open shortcut"),isVisible:({resources:u})=>p(r)&&!p(o)&&!ht(t,"files-spaces-generic")&&!Pn(t,"files-public-link")&&!Ct(t,"files-common-favorites")&&!Ct(t,"files-common-search")&&!jt(t,"files-shares-with-me")&&!jt(t,"files-shares-with-others")&&!jt(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}},ga=()=>{const{$gettext:e}=Fe.useGettext(),t=sn(),n=mn(),r=B(()=>n.can("create-all","PublicLink")),o=B(()=>wn.View),i=u=>u===wn.View?t.sharingPublicPasswordEnforcedFor.read_only:u===wn.Upload?t.sharingPublicPasswordEnforcedFor.upload_only:u===wn.CreateOnly?t.sharingPublicPasswordEnforcedFor.read_write:u===wn.Edit?t.sharingPublicPasswordEnforcedFor.read_write_delete:!1,s=({isFolder:u})=>p(r)?u?[wn.View,wn.Edit,wn.CreateOnly]:[wn.View,wn.Edit]:[],a=[{id:wn.Internal,displayName:e("Invited people"),description:e("Link works only for invited people. Login is required."),icon:"user"},{id:wn.View,displayName:e("Can view"),description:e("View, download"),icon:"eye"},{id:wn.Upload,displayName:e("Can upload"),description:e("View, upload, download"),icon:"upload"},{id:wn.Edit,displayName:e("Can edit"),description:e("View, upload, edit, download, delete"),icon:"pencil"},{id:wn.CreateOnly,displayName:e("Secret File Drop"),description:e("Upload only, existing content is not revealed"),icon:"inbox-unarchive"}];return{defaultLinkType:o,isPasswordEnforcedForLinkType:i,getAvailableLinkTypes:s,linkShareRoles:a,getLinkRoleByType:u=>a.find(({id:l})=>l===u)}},rk=Ne({name:"LinkRoleDropdown",props:{modelValue:{type:Object,required:!0},availableLinkTypeOptions:{type:Array,required:!0},dropOffset:{type:String,default:void 0}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=Fe.useGettext(),{getLinkRoleByType:r}=ga(),o=c=>e.modelValue===c,i=c=>{t("update:modelValue",c)},s=B(()=>{var c;return n((c=r(e.modelValue))==null?void 0:c.displayName)}),a=en.v4();return{isSelectedType:o,updateSelectedType:i,currentLinkRoleLabel:s,dropUuid:a,getLinkRoleByType:r}}}),ik=["textContent"],ok=["textContent"],sk={class:"oc-flex oc-flex-middle"},ak=["textContent"],lk={class:"oc-text-small"},ck={class:"oc-flex"};function uk(e,t,n,r,o,i){var d;const s=pe("oc-icon"),a=pe("oc-button"),c=pe("oc-list"),u=pe("oc-drop"),l=ln("oc-tooltip");return X(),de(qe,null,[e.availableLinkTypeOptions.length>1?(X(),Ae(a,{key:0,id:`link-role-dropdown-toggle-${e.dropUuid}`,appearance:"raw","gap-size":"none","no-hover":"",class:"oc-text-left link-role-dropdown-toggle"},{default:Se(()=>[fe("span",{class:"link-current-role",textContent:W.toDisplayString(e.currentLinkRoleLabel||e.$gettext("Select a role"))},null,8,ik),he(s,{name:"arrow-down-s"})]),_:1},8,["id"])):ot((X(),de("span",{key:1,class:"link-current-role oc-mr-m",textContent:W.toDisplayString(e.currentLinkRoleLabel)},null,8,ok)),[[l,(d=e.getLinkRoleByType(e.modelValue))==null?void 0:d.description]]),e.availableLinkTypeOptions.length>1?(X(),Ae(u,{key:2,class:"link-role-dropdown","drop-id":`link-role-dropdown-${e.dropUuid}`,toggle:`#link-role-dropdown-toggle-${e.dropUuid}`,"padding-size":"small",mode:"click",offset:e.dropOffset,"close-on-click":""},{default:Se(()=>[he(c,{class:"role-dropdown-list"},{default:Se(()=>[(X(!0),de(qe,null,wt(e.availableLinkTypeOptions,(f,m)=>(X(),de("li",{key:`role-dropdown-${m}`},[he(a,{id:`files-role-${e.getLinkRoleByType(f).id}`,class:W.normalizeClass([{selected:e.isSelectedType(f),"oc-secondary-container":e.isSelectedType(f)},"oc-p-s"]),appearance:"raw","justify-content":"space-between",onClick:w=>e.updateSelectedType(f)},{default:Se(()=>[fe("span",sk,[he(s,{name:e.getLinkRoleByType(f).icon,class:"oc-pl-s oc-pr-m"},null,8,["name"]),fe("span",null,[fe("span",{class:"role-dropdown-list-option-label oc-text-bold oc-display-block oc-width-1-1",textContent:W.toDisplayString(e.$gettext(e.getLinkRoleByType(f).displayName))},null,8,ak),fe("span",lk,W.toDisplayString(e.$gettext(e.getLinkRoleByType(f).description)),1)])]),fe("span",ck,[e.isSelectedType(f)?(X(),Ae(s,{key:0,name:"check"})):Ce("",!0)])]),_:2},1032,["id","class","onClick"])]))),128))]),_:1})]),_:1},8,["drop-id","toggle","offset"])):Ce("",!0)],64)}const Mv=ze(rk,[["render",uk],["__scopeId","data-v-dbec00f6"]]),fk=Ne({name:"CreateLinkModal",components:{LinkRoleDropdown:Mv},props:{modal:{type:Object,required:!0},resources:{type:Array,required:!0},space:{type:Object,default:void 0},callbackFn:{type:Function,default:void 0}},emits:["cancel","confirm"],setup(e,{expose:t}){const n=He(),r=Fe.useGettext(),{$gettext:o}=r,i=t0(),{isEnabled:s,postMessage:a}=si(),{defaultLinkType:c,getAvailableLinkTypes:u,getLinkRoleByType:l,isPasswordEnforcedForLinkType:d}=ga(),{addLink:f}=Er(),m=le(!1),w=le(!1),y=B(()=>e.resources.every(({isFolder:oe})=>oe)),E=B(()=>p(s)?o("Share link(s)"):o("Copy link")),b=le(en.v4()),g=le({}),v=le(),h=Ba({value:"",error:void 0}),S=le(p(c)),T=B(()=>o(l(p(S)).description)),I=B(()=>o(l(p(S)).displayName)),_=B(()=>l(p(S)).icon),A=B(()=>u({isFolder:p(y)})),$=B(()=>d(p(S))),D=i.getPolicy({enforcePassword:p($)}),N=()=>{m.value=!0},x=({date:oe,error:J})=>{v.value=oe,w.value=J},V=()=>Promise.allSettled(e.resources.map(oe=>{var J;return f({clientService:n,space:e.space,resource:oe,options:{type:p(S),"@libre.graph.quickLink":!1,password:p(h).value,expirationDateTime:(J=p(v))==null?void 0:J.toISO(),displayName:o("Unnamed link")}})})),G=B(()=>!!D.check(p(h).value)),ae=B(()=>!(p(G)&&!p(w))),ye=async(oe={})=>{const J=await V(),ne=J.filter(({status:H})=>H==="fulfilled");ne.length&&p(s)&&a("opencloud-embed:share",ne.map(({value:H})=>H.webUrl));const se=[],Re=J.filter(({status:H})=>H==="rejected");if(Re.length&&Re.map(({reason:H})=>H).forEach(H=>{var R;if(console.error(H),((R=H.response)==null?void 0:R.status)===400){const F=H.response.data.error;F.message=It.upperFirst(F.message),se.push(F)}}),se.length)return h.error=o(se[0].message),Promise.reject();e.callbackFn&&e.callbackFn({result:J,password:h.value,options:oe})};t({onConfirm:ye});const ue=oe=>p(S)===oe,te=oe=>{h.value=oe,h.error=void 0},ce=oe=>{S.value=oe};return Bt(()=>{const oe=p(g)[p(S)];oe&&oe.$el.focus(),p($)&&(h.value=i.generatePassword())}),{roleRefs:g,password:h,passwordEnforced:$,passwordPolicy:D,generatePasswordMethod:()=>i.generatePassword(),passwordInputKey:b,selectedExpiry:v,availableLinkTypes:A,selectedType:S,selectedTypeIcon:_,selectedTypeDisplayName:I,selectedTypeDescription:T,isSelectedLinkType:ue,updateSelectedLinkType:ce,updatePassword:te,getLinkRoleByType:l,confirmButtonText:E,isAdvancedMode:m,setAdvancedMode:N,onExpiryDateChanged:x,confirmButtonDisabled:ae,DateTime:qt.DateTime,onConfirm:ye}}}),dk={class:"oc-flex oc-button-justify-content-space-between oc-pb-s"},pk={key:0,class:"oc-flex oc-flex-middle"},hk={key:1,class:"oc-flex oc-flex-middle"},gk={class:"oc-flex oc-flex-column"},mk=["textContent"],yk=["textContent"],bk=["textContent"],vk={class:"link-modal-password oc-mb-m"},wk={key:1,class:"link-modal-password-text oc-text-small oc-text-muted"},Sk=["textContent"],Ek=["textContent"],Tk={class:"link-modal-actions oc-flex oc-flex-right oc-flex-middle oc-mt-s"},Ak={class:"oc-rounded oc-menu-item-hover"};function Rk(e,t,n,r,o,i){const s=pe("oc-icon"),a=pe("link-role-dropdown"),c=pe("oc-button"),u=pe("oc-text-input"),l=pe("oc-datepicker"),d=pe("oc-list"),f=pe("oc-drop");return X(),de(qe,null,[fe("div",dk,[e.isAdvancedMode?(X(),de("div",pk,[he(s,{class:"oc-mr-s",name:e.selectedTypeIcon,"fill-type":"line"},null,8,["name"]),he(a,{"model-value":e.selectedType,"available-link-type-options":e.availableLinkTypes,"onUpdate:modelValue":e.updateSelectedLinkType},null,8,["model-value","available-link-type-options","onUpdate:modelValue"])])):(X(),de("div",hk,[he(s,{class:"oc-mr-s",name:e.selectedTypeIcon,"fill-type":"line"},null,8,["name"]),fe("div",gk,[fe("span",{class:"oc-text-bold",textContent:W.toDisplayString(e.selectedTypeDisplayName)},null,8,mk),fe("span",{class:"oc-text-small",textContent:W.toDisplayString(e.selectedTypeDescription)},null,8,yk)])])),e.isAdvancedMode?Ce("",!0):(X(),Ae(c,{key:2,class:"link-modal-advanced-mode-button","gap-size":"xsmall",appearance:"raw","no-hover":"",onClick:t[0]||(t[0]=m=>e.setAdvancedMode())},{default:Se(()=>[he(s,{name:"settings-3",size:"small","fill-type":"fill"}),fe("span",{textContent:W.toDisplayString(e.$gettext("Options"))},null,8,bk)]),_:1}))]),fe("div",vk,[e.isAdvancedMode?(X(),Ae(u,{key:e.passwordInputKey,"model-value":e.password.value,type:"password","password-policy":e.passwordPolicy,"generate-password-method":e.generatePasswordMethod,"error-message":e.password.error,label:e.$gettext("Password"),"required-mark":e.passwordEnforced,class:"link-modal-password-input","onUpdate:modelValue":e.updatePassword},null,8,["model-value","password-policy","generate-password-method","error-message","label","required-mark","onUpdate:modelValue"])):e.password.value?(X(),de("div",wk,[fe("span",{textContent:W.toDisplayString(e.$gettext("Password:"))},null,8,Sk),fe("span",{textContent:W.toDisplayString(e.password.value)},null,8,Ek)])):Ce("",!0),e.isAdvancedMode?(X(),Ae(l,{key:2,class:"oc-mt-s","min-date":e.DateTime.now(),label:e.$gettext("Expiry date"),onDateChanged:e.onExpiryDateChanged},null,8,["min-date","label","onDateChanged"])):Ce("",!0)]),fe("div",Tk,[he(c,{class:"link-modal-cancel oc-modal-body-actions-cancel oc-ml-s",onClick:t[1]||(t[1]=m=>e.$emit("cancel"))},{default:Se(()=>[Ot(W.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),fe("div",{class:W.normalizeClass(["link-modal-confirm-button-group oc-ml-s",{"oc-button-group":e.password.value}])},[he(c,{class:"link-modal-confirm oc-modal-body-actions-confirm",appearance:"filled",disabled:e.confirmButtonDisabled,onClick:t[2]||(t[2]=m=>e.$emit("confirm"))},{default:Se(()=>[Ot(W.toDisplayString(e.confirmButtonText),1)]),_:1},8,["disabled"]),e.password.value?(X(),Ae(c,{key:0,class:"link-modal-confirm oc-modal-body-actions-confirm-secondary-trigger",appearance:"filled",disabled:e.confirmButtonDisabled},{default:Se(()=>[he(s,{size:"small",name:"arrow-down-s"})]),_:1},8,["disabled"])):Ce("",!0),e.password.value?(X(),Ae(f,{key:1,"drop-id":"oc-modal-body-actions-confirm-secondary-drop",toggle:".oc-modal-body-actions-confirm-secondary-trigger",mode:"click","padding-size":"small","close-on-click":""},{default:Se(()=>[he(d,{class:"oc-modal-body-actions-confirm-secondary-menu"},{default:Se(()=>[fe("li",Ak,[he(c,{class:"oc-modal-body-actions-confirm-password action-menu-item",appearance:"raw",onClick:t[3]||(t[3]=m=>e.$emit("confirm",{copyPassword:!0}))},{default:Se(()=>[Ot(W.toDisplayString(e.$gettext("Copy link and password")),1)]),_:1})])]),_:1})]),_:1})):Ce("",!0)],2)])],64)}const Bv=ze(fk,[["render",Rk],["__scopeId","data-v-6dfdb5d3"]]),_k=({enforceModal:e=!1}={})=>{const t=He(),n=yt(),{showMessage:r,showErrorMessage:o}=tt(),{$gettext:i,$ngettext:s}=Fe.useGettext(),a=sn(),c=mn(),u=fn(),{defaultLinkType:l}=ga(),{addLink:d}=Er(),{dispatchModal:f}=pt(),{copyToClipboard:m}=Df(),w=async({result:g,password:v,options:h={}})=>{const S=g.filter(I=>I.status==="fulfilled");if(S.length){let I=i("Link has been created successfully");if(g.length===1)try{const _=h.copyPassword?i("%{link} Password:%{password}",{link:S[0].value.webUrl,password:v},!0):S[0].value.webUrl;await m(_),I=i("The link has been copied to your clipboard.")}catch(_){console.warn("Unable to copy link to clipboard",_)}r({title:s(I,"Links have been created successfully.",S.length)})}const T=g.filter(({status:I})=>I==="rejected");T.length&&o({errors:T.map(({reason:I})=>I),title:s("Failed to create link","Failed to create links",T.length)})},y=async({space:g,resources:v})=>{const h=a.sharingPublicPasswordEnforcedFor.read_only===!0;if(e||h){f({title:s('Copy link for "%{resourceName}"',"Copy links for the selected items",v.length,{resourceName:v[0].name}),customComponent:Bv,customComponentAttrs:()=>({space:g,resources:v,callbackFn:w}),hideActions:!0});return}const S=v.map(I=>d({clientService:t,space:g,resource:I,options:{"@libre.graph.quickLink":!1,displayName:i("Unnamed link"),type:p(l)}})),T=await u.addTask(()=>Promise.allSettled(S));w({result:T})},E=({resources:g})=>{if(!g.length)return!1;for(const v of g)if(!v.canShare({user:n.user,ability:c})||ee.isProjectSpaceResource(v)&&v.disabled)return!1;return!0};return{actions:B(()=>[{name:"create-links",icon:"link",handler:y,label:()=>i("Create links"),isVisible:E,class:"oc-files-actions-create-links"}])}},Ik=Ne({name:"AppLoadingSpinner"}),Ck={class:"oc-flex oc-flex-middle oc-flex-center oc-height-1-1 oc-width-1-1"};function Pk(e,t,n,r,o,i){const s=pe("oc-spinner");return X(),de("div",Ck,[he(s,{id:"app-loading-spinner",size:"large","aria-hidden":!0,"aria-label":""})])}const Gf=ze(Ik,[["render",Pk]]),Fk=Ne({name:"FilePickerModal",components:{AppLoadingSpinner:Gf},props:{modal:{type:Object,required:!0},app:{type:Object,required:!0},parentFolderLink:{type:Object,required:!0}},setup(e){const t=le(),n=le(!0),r=We(),{removeModal:o}=pt(),{getMatchingSpace:i}=un(),s=ai(),{getEditorRouteOpts:a}=Qn(),c=r.resolve(e.parentFolderLink),u=e.app.extensions.map(y=>y.extension?y.extension:y.mimeType),l=s.currentTheme.name,d=new URL(c.href,window.location.origin);d.searchParams.append("hide-logo","true"),d.searchParams.append("embed","true"),d.searchParams.append("embed-target","file"),d.searchParams.append("embed-delegate-authentication","false"),d.searchParams.append("embed-file-types",u.join(","));const f=()=>{n.value=!1,p(t).contentWindow.focus()},m=({data:y})=>{if(y.name!=="opencloud-embed:file-pick")return;const{resource:E,locationQuery:b}=y.data,g=i(E),v=ee.isShareSpaceResource(g)?g.id:void 0,h=a(p(r.currentRoute).name,g,E,v);h.query={...h.query,...b};const S=r.resolve(h),T=new URL(S.href,window.location.origin);o(e.modal.id),window.open(T.href,"_blank")},w=({data:y})=>{y.name==="opencloud-embed:cancel"&&o(e.modal.id)};return Bt(()=>{window.addEventListener("message",m),window.addEventListener("message",w)}),Vn(()=>{window.removeEventListener("message",m),window.removeEventListener("message",w)}),{isLoading:n,onLoad:f,iframeTitle:l,iframeSrc:d.href,iframeRef:t,onFilePick:m}}}),Ok={class:"oc-height-1-1",tabindex:"0"},kk=["title","src"];function xk(e,t,n,r,o,i){const s=pe("app-loading-spinner");return X(),de("div",Ok,[e.isLoading?(X(),Ae(s,{key:0})):Ce("",!0),ot(fe("iframe",{ref:"iframeRef",class:"oc-width-1-1 oc-height-1-1",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...a)=>e.onLoad&&e.onLoad(...a))},null,40,kk),[[ll,!e.isLoading]])])}const jv=ze(Fk,[["render",xk]]),ma=(e={},t)=>{const n=e.targetRouteCallback,{getMatchingSpace:r}=un(e);return{createFileAction:s=>{const a=p(e.space)||r(s);t.emit("fileClick",{space:a,resources:[s]})},createFolderLink:s=>{if(p(n))return p(n)(s);const{path:a,fileId:c,resource:u}=s,l=p(e.space)||r(u);return l?Nn("files-spaces-generic",rr(l,{path:a,fileId:c})):{}}}},ui=(e={})=>{const t=sn(),{$gettext:n}=Fe.useGettext(),{getInternalSpace:r,getMatchingSpace:o,isResourceAccessible:i}=un(),{createFolderLink:s}=ma(e);return{getPathPrefix:f=>{const m=p(e.space)||o(f);return ee.isProjectSpaceResource(m)?fs.join(n("Spaces"),m.name):ee.isShareSpaceResource(m)?fs.join(n("Shares"),m.name):m.name},getFolderLink:f=>s({path:f.path,fileId:f.fileId,resource:f}),getParentFolderLink:f=>{const m=p(e.space)||o(f),w=i({space:m,path:dt.dirname(f.path)});return f.remoteItemId&&f.path==="/"||!w?$n("files-shares-with-me"):ee.isProjectSpaceResource(f)?Nn("files-spaces-projects"):s({path:dt.dirname(f.path),...f.parentFolderId&&{fileId:f.parentFolderId},resource:f})},getParentFolderName:f=>{const m=p(e.space)||o(f),w=i({space:m,path:dt.dirname(f.path)});if(ee.isShareRoot(f)||f.id===m.id&&ee.isShareSpaceResource(m)||!w)return n("Shared with me");const E=ee.extractParentFolderName(f);if(E)return E;if(ee.isShareSpaceResource(m))return m.name;if(t.spacesProjects){if(ee.isProjectSpaceResource(f))return n("Spaces");if((m==null?void 0:m.driveType)==="project")return m.name}return n("Personal")},getParentFolderLinkIconAdditionalAttributes:f=>ee.isProjectSpaceResource(f)||ee.isProjectSpaceResource(r(f.storageId)||{})&&f.path.split("/").length===2?{name:"layout-grid","fill-type":"fill"}:{}}},Uv=({appId:e})=>{const{$gettext:t}=Fe.useGettext(),n=_r(),{dispatchModal:r}=pt(),o=ir(),{apps:i}=Ue.storeToRefs(o),{getParentFolderLink:s}=ui(),a=({resources:u})=>{const l=p(i)[e],d=s(u[0]);r({elementClass:"open-with-app-modal",title:t("Open file in %{app}",{app:l.name}),customComponent:jv,hideActions:!0,customComponentAttrs:()=>({app:l,parentFolderLink:d}),focusTrapInitial:!1})};return{actions:B(()=>[{name:"open-with-app",icon:"folder-open",handler:a,label:()=>t("Open"),isVisible:()=>!p(n),class:"oc-files-actions-open-with-app-trigger"}])}},Nk=Ne({name:"SaveAsModal",components:{AppLoadingSpinner:Gf},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=ai(),{$gettext:o}=Fe.useGettext(),i=We(),s=He(),{removeModal:a}=pt(),{showMessage:c,showErrorMessage:u}=tt(),{getMatchingSpace:l}=un(),{getEditorRouteOpts:d}=Qn(),f=i.resolve(e.parentFolderLink),m=r.currentTheme.name,w=new URL(f.href,window.location.origin);w.searchParams.append("hide-logo","true"),w.searchParams.append("embed","true"),w.searchParams.append("embed-target","location"),w.searchParams.append("embed-choose-file-name","true"),w.searchParams.append("embed-delegate-authentication","false"),w.searchParams.append("embed-choose-file-name-suggestion",e.originalResource.name);const y=()=>{n.value=!1,p(t).contentWindow.focus()},E=async({data:h})=>{if(h.name!=="opencloud-embed:select")return;const{resources:S,fileName:T,locationQuery:I}=h.data,_=S[0],A=l(_);try{const $=await b({destinationFolder:_,fileName:T,space:A});c({title:o('"%{fileName}" was saved successfully',{fileName:$.name})}),g({resource:$,space:A,locationQuery:I})}catch($){console.error($),u({title:o('Unable to save "%{fileName}"',{fileName:T}),errors:[$]}),console.error($)}a(e.modal.id)},b=async({destinationFolder:h,fileName:S,space:T})=>{const{children:I}=await s.webdav.listFiles(T,{fileId:h.fileId},{davProperties:[je.Name]});return I.find(A=>A.name===S)&&(S=zn(S,e.originalResource.extension,I)),s.webdav.putFileContents(T,{fileName:S,parentFolderId:h.id,content:e.content,path:ee.urlJoin(h.path,S)})},g=({locationQuery:h,resource:S,space:T})=>{const I=ee.isShareSpaceResource(T)?T.id:void 0,_=d(p(i.currentRoute).name,T,S,I);_.query={..._.query,...h};const A=i.resolve(_),$=new URL(A.href,window.location.origin);window.open($.href,"_blank")},v=({data:h})=>{h.name==="opencloud-embed:cancel"&&a(e.modal.id)};return Bt(()=>{window.addEventListener("message",E),window.addEventListener("message",v)}),Vn(()=>{window.removeEventListener("message",E),window.removeEventListener("message",v)}),{isLoading:n,onLoad:y,iframeTitle:m,iframeSrc:w.href,iframeRef:t,onLocationPick:E}}}),$k={class:"oc-height-1-1",tabindex:"0"},Dk=["title","src"];function Lk(e,t,n,r,o,i){const s=pe("app-loading-spinner");return X(),de("div",$k,[e.isLoading?(X(),Ae(s,{key:0})):Ce("",!0),ot(fe("iframe",{ref:"iframeRef",class:"oc-width-1-1 oc-height-1-1",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...a)=>e.onLoad&&e.onLoad(...a))},null,40,Dk),[[ll,!e.isLoading]])])}const qv=ze(Nk,[["render",Lk]]),Vv=({content:e})=>{const{$gettext:t}=Fe.useGettext(),n=_r(),{dispatchModal:r}=pt(),{getParentFolderLink:o}=ui(),i=({resources:a})=>{const c=o(a[0]);r({elementClass:"save-as-modal",title:t("Save as"),customComponent:qv,hideActions:!0,customComponentAttrs:()=>({content:p(e),parentFolderLink:c,originalResource:a[0]}),focusTrapInitial:!1})};return{actions:B(()=>[{name:"save-as",icon:"save-2",handler:i,label:()=>t("Save as"),isVisible:({resources:a})=>!p(n)||a.length!==1,class:"oc-files-actions-save-as-trigger"}])}},zv=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=yt(),{$gettext:r,$ngettext:o}=Fe.useGettext(),i=mn(),s=He(),a=Kt(),{dispatchModal:c}=pt(),u=ct(),{removeResources:l}=Qe(),d=y=>y.filter(E=>ee.isProjectSpaceResource(E)&&E.canBeDeleted({user:n.user,ability:i})),f=async y=>{const E=s.graphAuthenticated,b=y.map(S=>E.drives.deleteDrive(S.id).then(()=>(l([S]),u.removeSpace(S),!0))),g=await Promise.allSettled(b),v=g.filter(S=>S.status==="fulfilled");if(v.length){const S=v.length===1&&y.length===1?r('Space "%{space}" was deleted successfully',{space:y[0].name}):o("%{spaceCount} space was deleted successfully","%{spaceCount} spaces were deleted successfully",v.length,{spaceCount:v.length.toString()},!0);e({title:S})}const h=g.filter(S=>S.status==="rejected");if(h.length){h.forEach(console.error);const S=h.length===1&&y.length===1?r('Failed to delete space "%{space}"',{space:y[0].name}):o("Failed to delete %{spaceCount} space","Failed to delete %{spaceCount} spaces",h.length,{spaceCount:h.length.toString()},!0);t({title:S,errors:h.map(T=>T.reason)})}p(a).name==="admin-settings-spaces"&&Ke.publish("app.admin-settings.list.load")},m=({resources:y})=>{const E=d(y);if(!E.length)return;const b=o("Are you sure you want to delete the selected space?","Are you sure you want to delete %{count} selected spaces?",E.length,{count:E.length.toString()});c({title:o('Delete Space "%{space}"?',"Delete %{spaceCount} Spaces?",E.length,{space:E[0].name,spaceCount:E.length.toString()}),confirmText:r("Delete"),message:b,hasInput:!1,onConfirm:()=>f(E)})};return{actions:B(()=>[{name:"delete",icon:"delete-bin",label:()=>r("Delete"),handler:m,isVisible:({resources:y})=>!!d(y).length,class:"oc-files-actions-delete-trigger"}]),deleteSpaces:f}},Wv=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=yt(),{$gettext:r,$ngettext:o}=Fe.useGettext(),i=mn(),s=He(),a=Kt(),c=We(),{dispatchModal:u}=pt(),l=ct(),d=y=>y.filter(E=>ee.isProjectSpaceResource(E)&&E.canDisable({user:n.user,ability:i})),f=async y=>{const E=p(a),b=s.graphAuthenticated,g=y.map(T=>b.drives.disableDrive(T.id).then(()=>(E.name==="files-spaces-generic"&&c.push({name:"files-spaces-projects"}),E.name==="admin-settings-spaces"&&(T.disabled=!0,T.spaceQuota={total:T.spaceQuota.total}),l.updateSpaceField({id:T.id,field:"disabled",value:!0}),!0))),v=await Promise.allSettled(g),h=v.filter(T=>T.status==="fulfilled");if(h.length){const T=h.length===1&&y.length===1?r('Space "%{space}" was disabled successfully',{space:y[0].name}):o("%{spaceCount} space was disabled successfully","%{spaceCount} spaces were disabled successfully",h.length,{spaceCount:h.length.toString()},!0);e({title:T})}const S=v.filter(T=>T.status==="rejected");if(S.length){S.forEach(console.error);const T=S.length===1&&y.length===1?r('Failed to disable space "%{space}"',{space:y[0].name}):o("Failed to disable %{spaceCount} space","Failed to disable %{spaceCount} spaces",S.length,{spaceCount:S.length.toString()},!0);t({title:T,errors:S.map(I=>I.reason)})}},m=({resources:y})=>{const E=d(y);if(!E.length)return;const b=o("If you disable the selected space, it can no longer be accessed. Only Space managers will still have access. Note: No files will be deleted from the server.","If you disable the %{count} selected spaces, they can no longer be accessed. Only Space managers will still have access. Note: No files will be deleted from the server.",E.length,{count:E.length.toString()}),g=r("Disable");u({title:o('Disable Space "%{space}"?',"Disable %{spaceCount} Spaces?",E.length,{space:E[0].name,spaceCount:E.length.toString()}),confirmText:g,message:b,hasInput:!1,onConfirm:()=>f(E)})};return{actions:B(()=>[{name:"disable",icon:"stop-circle",label:()=>r("Disable"),handler:m,isVisible:({resources:y})=>!!d(y).length,class:"oc-files-actions-disable-trigger"}]),disableSpaces:f}},Hv=()=>{const e=st(),t=ct(),n=Er(),{showMessage:r,showErrorMessage:o}=tt(),i=We(),{$gettext:s}=Fe.useGettext(),a=mn(),c=He(),u=fn(),{upsertResource:l}=Qe(),d=ht(i,"files-spaces-projects"),f=async y=>{const E=t.spaces.filter(ee.isProjectSpaceResource),b=zn(y.name,"",E);try{let g=await c.graphAuthenticated.drives.createDrive({name:b,description:y.description,quota:{total:y.spaceQuota.total}});const v=await c.webdav.listFiles(y);if(v.children.length){const h=new Fr({concurrency:e.options.concurrentRequests.resourceBatchActions}),S=[];for(const T of v.children)S.push(h.add(()=>c.webdav.copyFiles(y,T,g,{path:T.name})));await Promise.all(S)}if(y.spaceReadmeData||y.spaceImageData){const h={special:[]};if(y.spaceReadmeData){const S=await c.webdav.getFileInfo(g,{path:`.space/${y.spaceReadmeData.name}`});h.special.push({specialFolder:{name:"readme"},id:S.id})}if(y.spaceImageData){const S=await c.webdav.getFileInfo(g,{path:`.space/${y.spaceImageData.name}`});h.special.push({specialFolder:{name:"image"},id:S.id})}g=await c.graphAuthenticated.drives.updateDrive(g.id,h,n.graphRoles)}t.upsertSpace(g),d&&l(g),r({title:s('Space "%{space}" was duplicated successfully',{space:y.name})})}catch(g){console.error(g),o({title:s('Failed to duplicate space "%{space}"',{space:y.name}),errors:[g]})}},m=async({resources:y})=>{for(const E of y)E.disabled||!ee.isProjectSpaceResource(E)||await f(E)};return{actions:B(()=>[{name:"duplicate",icon:"folders",label:()=>s("Duplicate"),handler:y=>u.addTask(()=>m(y)),isVisible:({resources:y})=>!(y!=null&&y.length)||y.every(E=>E.disabled)||y.every(E=>!ee.isProjectSpaceResource(E))?!1:a.can("create-all","Drive"),class:"oc-files-actions-duplicate-trigger"}]),duplicateSpace:f}},Mk=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=yt(),{$gettext:r}=Fe.useGettext(),o=mn(),i=He(),s=Kt(),{dispatchModal:a}=pt(),c=ct(),u=(f,m)=>i.graphAuthenticated.drives.updateDrive(f.id,{name:f.name,description:m}).then(()=>{c.updateSpaceField({id:f.id,field:"description",value:m}),p(s).name==="admin-settings-spaces"&&(f.description=m),e({title:r("Space subtitle was changed successfully")})}).catch(y=>{console.error(y),t({title:r("Failed to change space subtitle"),errors:[y]})}),l=({resources:f})=>{f.length===1&&a({title:r("Change subtitle for space")+" "+f[0].name,confirmText:r("Confirm"),hasInput:!0,inputLabel:r("Space subtitle"),inputValue:f[0].description,onConfirm:m=>u(f[0],m)})};return{actions:B(()=>[{name:"editDescription",icon:"h-2",iconFillType:"none",label:()=>r("Edit subtitle"),handler:l,isVisible:({resources:f})=>f.length!==1?!1:f[0].canEditDescription({user:n.user,ability:o}),class:"oc-files-actions-edit-description-trigger"}]),editDescriptionSpace:u}},Bk={name:"QuotaSelect",props:{totalQuota:{type:Number,default:0},maxQuota:{type:Number,default:0}},emits:["selectedOptionChange"],setup(){const e=le(void 0),t=le([]);return{selectedOption:e,options:t}},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 It.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=Tn(e,this.$language.current);return this.isValueValidNumber(e)?t:e.toString()}}},jk={class:"quota-select-batch-action-form"},Uk=["textContent"],qk={class:"oc-flex oc-flex-between"},Vk=["textContent"],zk={key:0,class:"oc-text-input-danger"};function Wk(e,t,n,r,o,i){const s=pe("oc-icon"),a=pe("oc-select");return X(),de("div",jk,[he(a,Gt({ref:"select","model-value":r.selectedOption,selectable:i.optionSelectable,taggable:"","push-tags":"",clearable:!1,options:r.options,"create-option":i.createOption,"option-label":"displayValue",label:e.$gettext("Quota")},e.$attrs,{"onUpdate:modelValue":i.onUpdate}),{"selected-option":Se(({displayValue:c})=>[e.$attrs["read-only"]?(X(),Ae(s,{key:0,name:"lock",class:"oc-mr-xs",size:"small"})):Ce("",!0),fe("span",{textContent:W.toDisplayString(c)},null,8,Uk)]),search:Se(({attributes:c,events:u})=>[fe("input",Gt({class:"vs__search"},c,Za(u,!0)),null,16)]),option:Se(({displayValue:c,error:u})=>[fe("div",qk,[fe("span",{textContent:W.toDisplayString(c)},null,8,Vk)]),u?(X(),de("div",zk,W.toDisplayString(u),1)):Ce("",!0)]),_:1},16,["model-value","selectable","options","create-option","label","onUpdate:modelValue"])])}const Gv=ze(Bk,[["render",Wk]]),Hk={key:0,class:"oc-mt-s"},Gk=["textContent"],Kv=Ne({__name:"QuotaModal",props:{modal:{},spaces:{},warningMessage:{default:""},warningMessageContextualHelperData:{default:()=>{}},resourceType:{default:"space"}},emits:["update:confirmDisabled"],setup(e,{expose:t,emit:n}){var h,S;const r=n,{showMessage:o,showErrorMessage:i}=tt(),{$gettext:s,$ngettext:a}=Fe.useGettext(),c=He(),u=We(),l=ct(),d=sn(),{spacesMaxQuota:f}=Ue.storeToRefs(d),{updateResourceField:m}=Qe(),w=le(((S=(h=e.spaces[0])==null?void 0:h.spaceQuota)==null?void 0:S.total)||0),y=T=>e.resourceType==="space"?a("Space quota was changed successfully","Quota of %{count} spaces was changed successfully",T,{count:T.toString()}):e.resourceType==="user"?a("User quota was changed successfully","Quota of %{count} users was changed successfully",T,{count:T.toString()}):s("Quota was changed successfully"),E=T=>e.resourceType==="space"?a("Failed to change space quota","Failed to change quota for %{count} spaces",T,{count:T.toString()}):e.resourceType==="user"?a("Failed to change user quota","Failed to change quota for %{count} users",T,{count:T.toString()}):s("Failed to change quota"),b=B(()=>!e.spaces.some(T=>T.spaceQuota.total!==p(w)));St(b,()=>{r("update:confirmDisabled",p(b))},{immediate:!0});const g=T=>{w.value=T.value};return t({onConfirm:async()=>{const T=c.graphAuthenticated,I=e.spaces.map(async D=>{const N=await T.drives.updateDrive(D.id,{name:D.name,quota:{total:p(w)}});p(u.currentRoute).name==="admin-settings-spaces"&&Ke.publish("app.admin-settings.spaces.space.quota.updated",{spaceId:D.id,quota:N.spaceQuota}),p(u.currentRoute).name==="admin-settings-users"&&Ke.publish("app.admin-settings.users.user.quota.updated",{spaceId:D.id,quota:N.spaceQuota}),l.updateSpaceField({id:D.id,field:"spaceQuota",value:N.spaceQuota}),m({id:D.id,field:"spaceQuota",value:N.spaceQuota})}),_=await Promise.allSettled(I),A=_.filter(D=>D.status==="fulfilled");A.length&&o({title:y(A.length)});const $=_.filter(D=>D.status==="rejected");$.length&&(console.error($),$.forEach(console.error),i({title:E($.length),errors:$.map(D=>D.reason)}))}}),(T,I)=>{const _=pe("oc-contextual-helper");return X(),de(qe,null,[he(Gv,{"total-quota":w.value,"max-quota":p(f),"position-fixed":!0,onSelectedOptionChange:g},null,8,["total-quota","max-quota"]),T.warningMessage?(X(),de("div",Hk,[fe("span",{class:"oc-text-input-warning",textContent:W.toDisplayString(T.warningMessage)},null,8,Gk),T.warningMessageContextualHelperData?(X(),Ae(_,Gt({key:0,class:"oc-pl-xs"},T.warningMessageContextualHelperData),null,16)):Ce("",!0)])):Ce("",!0)],64)}}}),Qv=()=>{const{dispatchModal:e}=pt(),{$gettext:t}=Fe.useGettext(),n=mn(),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()}),o=({resources:s})=>{e({title:r({resources:s}),customComponent:Kv,customComponentAttrs:()=>({spaces:s,resourceType:"space"})})};return{actions:B(()=>[{name:"editQuota",icon:"cloud",label:()=>t("Edit quota"),handler:o,isVisible:({resources:s})=>!s||!s.length||s.some(a=>!ee.isProjectSpaceResource(a)||ee.isSpaceResource(a)&&!a.spaceQuota)?!1:n.can("set-quota-all","Drive"),class:"oc-files-actions-edit-quota-trigger"}])}};function Xv(){const{getDefaultAction:e}=Qn();return{openWithDefaultApp:({space:n,resource:r})=>{if(!r||r.isFolder)return;const o={resources:[r],space:n},i=e({...o,omitSystemActions:!0});i&&i.handler(o)}}}const Kk=()=>{const e=He(),{openWithDefaultApp:t}=Xv(),{createDefaultMetaFolder:n}=Ui(),r=yt(),o=ct(),{$gettext:i}=Fe.useGettext(),{getDefaultMetaFolder:s}=ci(),a=async(l,d)=>{const f=await e.webdav.putFileContents(l,{path:".space/readme.md",parentFolderId:d.id,fileName:"readme.md"}),m=await e.graphAuthenticated.drives.updateDrive(l.id,{name:l.name,special:[{specialFolder:{name:"readme"},id:f.id}]});return o.updateSpaceField({id:l.id,field:"spaceReadmeData",value:m.spaceReadmeData}),f},c=async({resources:l})=>{let d=null,f=await s(l[0]);if(f||(f=await n(l[0]),d=await a(l[0],f)),!d){const m=ee.getRelativeSpecialFolderSpacePath(l[0],"readme");m?d=await e.webdav.getFileInfo(l[0],{path:m}):d=await a(l[0],f)}t({space:l[0],resource:d})};return{actions:B(()=>[{name:"editReadmeContent",icon:"article",label:()=>i("Edit description"),handler:c,isVisible:({resources:l})=>l.length!==1?!1:l[0].canEditReadme({user:r.user}),class:"oc-files-actions-edit-readme-content-trigger"}])}},Yv=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=yt(),{$gettext:r}=Fe.useGettext(),o=mn(),i=He(),s=Kt(),{checkSpaceNameModalInput:a}=ci(),{dispatchModal:c}=pt(),u=ct(),l=(m,w)=>i.graphAuthenticated.drives.updateDrive(m.id,{name:w}).then(()=>{p(s).name==="admin-settings-spaces"&&(m.name=w),u.updateSpaceField({id:m.id,field:"name",value:w}),e({title:r("Space name was changed successfully")})}).catch(E=>{console.error(E),t({title:r("Failed to rename space"),errors:[E]})}),d=({resources:m})=>{m.length===1&&c({title:r("Rename space")+" "+m[0].name,confirmText:r("Rename"),hasInput:!0,inputLabel:r("Space name"),inputValue:m[0].name,inputRequiredMark:!0,onConfirm:w=>l(m[0],w),onInput:a})};return{actions:B(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:d,isVisible:({resources:m})=>m.length!==1?!1:m[0].canRename({user:n.user,ability:o}),class:"oc-files-actions-rename-trigger"}]),renameSpace:l}},Jv=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=yt(),{$gettext:r,$ngettext:o}=Fe.useGettext(),i=mn(),s=He(),a=fn(),c=Kt(),{dispatchModal:u}=pt(),l=ct(),d=y=>y.filter(E=>ee.isProjectSpaceResource(E)&&E.canRestore({user:n.user,ability:i})),f=async y=>{const E=s.graphAuthenticated,b=y.map(S=>E.drives.updateDrive(S.id,{name:S.name},{headers:{Restore:"true"}}).then(T=>(p(c).name==="admin-settings-spaces"&&(S.disabled=!1,S.spaceQuota=T.spaceQuota),l.updateSpaceField({id:S.id,field:"disabled",value:!1}),!0))),g=await a.addTask(()=>Promise.allSettled(b));await l.loadGraphPermissions({ids:y.map(S=>S.id),graphClient:E});const v=g.filter(S=>S.status==="fulfilled");if(v.length){const S=v.length===1&&y.length===1?r('Space "%{space}" was enabled successfully',{space:y[0].name}):o("%{spaceCount} space was enabled successfully","%{spaceCount} spaces were enabled successfully",v.length,{spaceCount:v.length.toString()},!0);e({title:S})}const h=g.filter(S=>S.status==="rejected");if(h.length){h.forEach(console.error);const S=h.length===1&&y.length===1?r('Failed to enabled space "%{space}"',{space:y[0].name}):o("Failed to enable %{spaceCount} space","Failed to enable %{spaceCount} spaces",h.length,{spaceCount:h.length.toString()},!0);t({title:S,errors:h.map(T=>T.reason)})}},m=({resources:y})=>{const E=d(y);if(!E.length)return;const b=o("If you enable the selected space, it can be accessed again.","If you enable the %{count} selected spaces, they can be accessed again.",E.length,{count:E.length.toString()}),g=r("Enable");u({title:o('Enable Space "%{space}"?',"Enable %{spaceCount} Spaces?",E.length,{space:E[0].name,spaceCount:E.length.toString()}),confirmText:g,message:b,hasInput:!1,onConfirm:()=>f(E)})};return{actions:B(()=>[{name:"restore",icon:"play-circle",label:()=>r("Enable"),handler:m,isVisible:({resources:y})=>!!d(y).length,class:"oc-files-actions-restore-trigger"}]),restoreSpaces:f}},Qk=()=>{const{$gettext:e}=Fe.useGettext(),t=Qe(),n=({resources:o})=>{t.setSelection(o.map(({id:i})=>i)),Ke.publish(Tt.openWithPanel,"space-share")};return{actions:B(()=>[{name:"show-members",icon:"group",label:()=>e("Members"),handler:n,isVisible:({resources:o})=>o.length===1&&!o[0].disabled,class:"oc-files-actions-show-details-trigger"}])}},Xk=()=>{const e=We(),{$gettext:t}=Fe.useGettext(),n=o=>Fi("files-trash-generic",{...rr(o,{fileId:o.fileId})});return{actions:B(()=>[{name:"navigateToTrash",icon:"delete-bin",label:()=>t("Show deleted files"),handler:({resources:o})=>{e.push(n(o[0]))},isVisible:({resources:o})=>!(o.length!==1||!ee.isProjectSpaceResource(o[0])||o[0].disabled),class:"oc-files-actions-navigate-to-trash-trigger"}])}},Yk=Ne({name:"EmojiPickerModal",components:{},props:{modal:{type:Object,required:!0}},emits:["confirm"],setup(e,{emit:t}){const n=ai(),{currentTheme:r}=Ue.storeToRefs(n),o=B(()=>p(r).isDark?"dark":"light");return{onEmojiSelect:s=>{t("confirm",s)},theme:o}}});function Jk(e,t,n,r,o,i){const s=pe("oc-emoji-picker");return X(),Ae(s,{theme:e.theme,onEmojiSelect:e.onEmojiSelect},null,8,["theme","onEmojiSelect"])}const Zv=ze(Yk,[["render",Jk]]),Zk=()=>{const e=yt(),{showMessage:t,showErrorMessage:n}=tt(),{$gettext:r}=Fe.useGettext(),o=He(),i=fn(),s=ct(),{createDefaultMetaFolder:a}=Ui(),{dispatchModal:c}=pt(),{getDefaultMetaFolder:u}=ci(),l=({resources:w})=>{w.length===1&&c({elementClass:"oc-width-auto",title:r("Set icon for %{space}",{space:w[0].name}),hideConfirmButton:!0,customComponent:Zv,focusTrapInitial:!1,onConfirm:y=>f(w[0],y)})},d=async w=>{const y=document.createElement("canvas"),E=y.getContext("2d"),b=16/9,g=720,v=g/b;y.width=g,y.height=v;const h=.4*g;E.font=`${h}px sans-serif`,E.textBaseline="middle",E.textAlign="center",E.fillText(w,y.width/2,y.height/2+15);const T=await Lb(y);return Db(T)},f=async(w,y)=>{const E=o.graphAuthenticated,b=await d(y);let g=await u(w);return g||(g=await a(w)),i.addTask(async()=>{const v={"Content-Type":"application/offset+octet-stream"};try{const{fileId:h}=await o.webdav.putFileContents(w,{parentFolderId:g.id,fileName:"image.png",content:b,headers:v,overwrite:!0}),S=await E.drives.updateDrive(w.id,{name:w.name,special:[{specialFolder:{name:"image"},id:h}]});s.updateSpaceField({id:w.id,field:"spaceImageData",value:S.spaceImageData}),t({title:r("Space icon was set successfully")}),Ke.publish("app.files.spaces.uploaded-image",S)}catch(h){console.error(h),n({title:r("Failed to set space icon"),errors:[h]})}})};return{actions:B(()=>[{name:"set-space-icon",icon:"emoji-sticker",handler:l,label:()=>r("Set icon"),isVisible:({resources:w})=>w.length!==1?!1:w[0].canEditImage({user:e.user}),class:"oc-files-actions-set-space-icon-trigger"}]),setIconSpace:f}},ex=()=>{const e=yt(),{$gettext:t}=Fe.useGettext(),{dispatchModal:n}=pt(),{graphAuthenticated:r,webdav:o}=He(),i=ct(),{showMessage:s,showErrorMessage:a}=tt(),{defaultSpaceImageBlobURL:c}=Ue.storeToRefs(i),u=async({space:f})=>{try{await o.deleteFile(f,{path:".space/image.png"}),await r.drives.updateDrive(f.id,{name:f.name,special:[{specialFolder:{name:"image"},id:null}]}),i.updateSpaceField({id:f.id,field:"spaceImageData",value:null}),i.updateSpaceField({id:f.id,field:"thumbnail",value:p(c)}),s({title:t("Space image deleted successfully")})}catch(m){console.error(m),a({title:t("Failed to delete space image"),errors:[m]})}},l=({resources:f})=>{n({title:t("Delete %{ space } image",{space:f[0].name}),confirmText:t("Delete"),onConfirm:()=>u({space:f[0]}),message:t("Are you sure you want to delete the image of %{ space }?",{space:f[0].name})})};return{actions:B(()=>[{name:"delete-space-image",icon:"delete-bin",handler:l,label:()=>t("Delete image"),isVisible:({resources:f})=>f.length!==1||!f[0].spaceImageData?!1:f[0].canEditImage({user:e.user}),class:"oc-files-actions-delete-space-image-trigger"}]),deleteSpaceImage:u}},tx=()=>{const{$gettext:e}=Fe.useGettext();return{actions:B(()=>[{name:"show-details",icon:"information",label:()=>e("Details"),handler:()=>Ke.publish(Tt.open),isVisible:({resources:n})=>n.length>0,class:"oc-admin-settings-show-details-trigger"}])}},nx=()=>{const{getMatchingSpace:e}=un(),t=ct(),n=ir(),r=Qe(),o=He(),{$gettext:i}=Fe.useGettext(),{openEditor:s}=Qn(),{resources:a,currentFolder:c}=Ue.storeToRefs(r);return{openEmptyEditor:async(l,d)=>{var v;let f=p(c)?e(p(c)):null,m=p(a),w=(v=p(c))==null?void 0:v.path;(!f||!p(c).canCreate())&&(f=t.personalSpace,m=(await o.webdav.listFiles(f)).children,w="");let y=i("New file")+`.${d}`;m.some(h=>h.name===y)&&(y=zn(y,d,m));const E=await o.webdav.putFileContents(f,{path:ee.urlJoin(w,y)}),b=e(E),g=n.fileExtensions.find(({app:h,extension:S})=>h===l&&S===d);s(g,b,E)}}},e0=()=>{const{$gettext:e}=Fe.useGettext(),{showMessage:t}=tt();return{openUrl:(r,o,i)=>{const s=window.open(r,o);s?i&&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.")})}}},rx=()=>br("$appProviderService"),ix=()=>{const{isResourceAccessible:e}=un();return{breadcrumbsFromPath:({route:r,space:o,resourcePath:i,ancestorMetaData:s=le({})})=>{const a=(l="")=>l.split("/").filter(Boolean),c=a(r.path),u=a(i);return u.map((l,d)=>{const f=ee.urlJoin(...u.slice(0,d+1),{leadingSlash:!0}),m=e({space:p(o),path:f});let w;return m&&(w=p(s)[f]),{id:en.v4(),allowContextActions:!0,text:l,...m&&{to:{path:"/"+[...c].splice(0,c.length-u.length+d+1).join("/"),query:{...Mi(r.query,"page","fileId"),...w&&{fileId:w.id}}}},isStaticNav:!1}})},concatBreadcrumbs:(...r)=>{const o=r.pop();return[...r,{id:en.v4(),allowContextActions:o.allowContextActions,text:o.text,onClick:()=>Ke.publish("app.files.list.load"),isTruncationPlaceholder:o.isTruncationPlaceholder,isStaticNav:o.isStaticNav}]}}},ox=(e="")=>{const t=le(0),n=async()=>{await _n();const r=document.querySelector(e||"#files-app-bar"),o=r?r.getBoundingClientRect().height:0;t.value!==o&&(t.value=o)};return window.onresize=n,Bt(n),{y:t,refresh:n}},Kf=()=>{const e=le(!0),t=()=>{e.value=window.innerHeight>500};return Bt(()=>{t(),window.addEventListener("resize",t)}),Vn(()=>{window.removeEventListener("resize",t)}),{isSticky:e}};var Ir=(e=>(e.C="c",e.V="v",e.X="x",e.A="a",e.S="s",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))(Ir||{}),Qf=(e=>(e.Ctrl="Control",e.Shift="Shift",e))(Qf||{});const sx=()=>{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==null?void 0:n.closest("[data-custom-key-bindings-disabled='true']")}catch{r=n==null?void 0:n.parentElement.closest("[data-custom-key-bindings-disabled='true']")}return r?!0:window.getSelection().type==="Range"},Xf=e=>{const t=le([]),n=le(0),r=a=>{if(!(e!=null&&e.skipDisabledKeyBindingsCheck)&&sx())return;const{key:c,ctrlKey:u,metaKey:l,shiftKey:d}=a;let f=null;const m=[];l||u?(f="Control",m.push("altKey","shiftKey")):d&&(f="Shift",m.push("altKey","ctrlKey","metaKey")),!((y,E)=>E.some(b=>y[b]))(a,m)&&p(t).filter(y=>y.primary===c&&y.modifier===f).forEach(y=>{a.preventDefault(),y.callback(a)})},o=(a,c)=>{const u=en.v4();return t.value.push({id:u,...a,modifier:a.modifier??null,callback:c}),u},i=a=>{t.value=t.value.filter(c=>c.id!==a)},s=()=>{n.value=0};return Vr.useEventListener(document,"keydown",r),{actions:t,bindKeyAction:o,removeKeyAction:i,selectionCursor:n,resetSelectionCursor:s}},Yf=()=>{const e=Xf(),t=10,n=.1;return{setCropperInstance:o=>{e.bindKeyAction({primary:Ir.ArrowRight},()=>{var i;return(i=p(o))==null?void 0:i.move(-10,0)}),e.bindKeyAction({primary:Ir.ArrowLeft},()=>{var i;return(i=p(o))==null?void 0:i.move(t,0)}),e.bindKeyAction({primary:Ir.ArrowDown},()=>{var i;return(i=p(o))==null?void 0:i.move(0,-10)}),e.bindKeyAction({primary:Ir.ArrowUp},()=>{var i;return(i=p(o))==null?void 0:i.move(0,t)}),e.bindKeyAction({primary:Ir.Plus},()=>{var i;return(i=p(o))==null?void 0:i.zoom(n)}),e.bindKeyAction({primary:Ir.Minus},()=>{var i;return(i=p(o))==null?void 0:i.zoom(-.1)})}}};class Cr{}Ee(Cr,"perPageDefault","100"),Ee(Cr,"perPageQueryName","items-per-page"),Ee(Cr,"options",["20","50","100","250","500"]);function ax(e){const t=Mo.useRouter(),n=Mo.useRoute(),r=lx(e),o=cx(e),i=B(()=>Math.ceil(p(e.items).length/p(o))||1),s=B(()=>{if(!p(o))return p(e.items);const a=(p(r)-1)*p(o),c=a+p(o);return p(e.items).slice(a,c)});return Ke.subscribe("app.files.navigate.page",({resourceId:a,forceScroll:c,topbarElement:u})=>{const l=It.findIndex(p(e.items),d=>d.id===a);if(l>=0){const d=Math.ceil((l+1)/Number(p(o)));t.push({...p(n),query:{...p(n).query,page:d}}).then(()=>{Ke.publish("app.files.navigate.scrollTo",{resourceId:a,forceScroll:c,topbarElement:u})})}}),{items:s,total:i,page:r,perPage:o}}function lx(e){if(e.page)return B(()=>p(e.page));const t=an("page","1");return B(()=>parseInt(Rt(p(t))))}function cx(e){if(e.perPage)return B(()=>p(e.perPage));const t=Tr({name:e.perPageQueryName||Cr.perPageQueryName,defaultValue:e.perPageDefault||Cr.perPageDefault,storagePrefix:e.perPageStoragePrefix});return B(()=>parseInt(Rt(p(t))))}const t0=()=>br("$passwordPolicyService");var ya=(e=>(e.mounted="portal-target.mounted",e))(ya||{});const ux=()=>{const e=li(),t=_a.useWormhole();return{registerPortal:r=>{e.subscribe(ya.mounted,()=>{t.open(r)})}}},Jf=()=>{const e=ir();return{canBeOpenedWithSecureView:n=>e.fileExtensions.filter(({secureView:o})=>o).some(({mimeType:o})=>o===n.mimeType)}},n0=()=>{const e=yt();return{canListVersions:({space:n,resource:r})=>r.type==="folder"||ee.isSpaceResource(r)||ee.isTrashResource(r)?!1:n==null?void 0:n.canListVersions({user:e.user})}},r0=()=>{const e=He(),t=ct(),n=B(()=>t.spaces),r=a=>p(n).find(c=>a.toString().startsWith(c.id.toString())),o=a=>p(n).find(c=>{var u,l;return ee.isMountPointSpaceResource(c)&&((l=(u=c.root)==null?void 0:u.remoteItem)==null?void 0:l.id)===a}),i=a=>{const c=[je.FileId,je.FileParent,je.Name,je.ResourceType],u=ee.buildSpace({id:a,name:""});return e.webdav.getFileInfo(u,{fileId:a},{davProperties:c})};return{getResourceContext:async a=>{var w,y,E,b,g;let c,u,l=r(a);if(l)return c=await e.webdav.getPathForFileId(a),u=await e.webdav.getFileInfo(l,{path:c}),{space:l,resource:u,path:c};await t.loadMountPoints({graphClient:e.graphAuthenticated});let d=o(a);u=await i(a);const f=d?[]:[p(u).name];let m=p(u);for(;!d;)m=await i(m.parentFolderId),d=o(m.id),d||f.unshift(m.name);return l=t.getSpace((y=(w=d.root)==null?void 0:w.remoteItem)==null?void 0:y.id)||t.createShareSpace({driveAliasPrefix:(E=u.storageId)!=null&&E.startsWith(ee.OCM_PROVIDER_ID)?"ocm-share":"share",id:(g=(b=d.root)==null?void 0:b.remoteItem)==null?void 0:g.id,shareName:d.name}),c=ee.urlJoin(...f),{space:l,resource:u,path:c}}}},Jt={name:{table:"resource-table",condensedTable:"resource-table-condensed",tiles:"resource-tiles"},defaultModeName:"resource-table",queryName:"view-mode",tilesSizeDefault:2,tilesSizeMax:6,tilesSizeQueryName:"tiles-size"},i0=()=>{const e=i=>{if(!i.endsWith("rem")&&!i.endsWith("px"))return 0;if(i.endsWith("rem")){const s=parseInt(i.replace("rem","").trim()),a=parseFloat(getComputedStyle(document.documentElement).fontSize);return s*a}return parseInt(i.replace("px","").trim())},t=le(0),n=le(0);Bt(()=>{const i=getComputedStyle(document.documentElement);t.value=e(i.getPropertyValue("--oc-size-tiles-default")),n.value=e(i.getPropertyValue("--oc-size-tiles-resize-step"))});const r=i=>p(t)+(i-1)*p(n);return{calculateTileSizePixels:r,calculateTileSizeRem:i=>{const s=parseFloat(getComputedStyle(document.documentElement).fontSize);return r(i)/s}}};function fx(e){if(e)return B(()=>p(e));const t=Tr({name:Jt.queryName,defaultValue:Jt.defaultModeName});return B(()=>Rt(p(t)))}function dx(e){if(e)return B(()=>parseInt(p(e)));const t=Tr({name:Jt.tilesSizeQueryName,defaultValue:Jt.tilesSizeDefault.toString()});return B(()=>parseInt(Rt(p(t))))}const px=le(Jt.tilesSizeMax);function Zf(){return px}const ed=e=>{const t=Uf(),{updateResourceField:n}=Qe(),{httpAuthenticated:r}=He(),o=ct(),{defaultSpaceImageBlobURL:i}=Ue.storeToRefs(o),s=st(),{serverUrl:a}=Ue.storeToRefs(s),c=new Fr({concurrency:4}),u=B(()=>p(e)===Jt.name.tiles),l=B(()=>p(u)?zs.enum.fit:zs.enum.thumbnail),d=B(()=>p(u)?Kn.Tile:Kn.Thumbnail),f=pn.useTask(function*(E,{space:b,resource:g,dimensions:v,processor:h,updateStore:S=!0}){var A;const T=ee.isProjectSpaceResource(g)?ee.buildSpaceImageResource(g):g,I=T.id===((A=b.spaceImageData)==null?void 0:A.id);I&&o.addToImagesLoading(b.id);const _=yield c.add(()=>t.loadPreview({space:b,resource:T,processor:h||p(l),dimensions:v||p(d)},!0,!0,E));return _&&S&&n({id:g.id,field:"thumbnail",value:_}),I&&o.removeFromImagesLoading(b.id),_}),m=async E=>{const{resource:b,cancelRunning:g}=E;if(g&&y(),ee.isProjectSpaceResource(b)&&(!b.spaceImageData||b.disabled)){if(p(i))return b.thumbnail=p(i),p(i);try{const v=await r.get(`${p(a)}images/default-space-icon.png`,{responseType:"blob"});return o.setDefaultSpaceImageBlobURL(URL.createObjectURL(v.data)),b.thumbnail=p(i),p(i)}catch{return null}}try{return await f.perform(E)}catch(v){v!=="cancel"&&console.error(v)}},w=B(()=>f.isRunning),y=()=>{f.cancelAll(),c.clear(),o.purgeImagesLoading()};return Ya(y),{loadPreview:m,previewsLoading:w}},o0=({showSizeInformation:e=!0}={})=>{const t=Qe(),{current:n,$gettext:r,$ngettext:o}=Fe.useGettext(),i=We(),{resources:s,totalResourcesCount:a,areHiddenFilesShown:c,currentFolder:u}=Ue.storeToRefs(t),l=B(()=>{var f,m;if(!((f=p(u))!=null&&f.size)||((m=p(u))==null?void 0:m.size)==="0"){const w=p(s).map(y=>y.size?parseInt(y.size.toString()):0).reduce((y,E)=>y+E,0);return Tn(w,n)}return Tn(p(u).size,n)});return{resourceContentsText:B(()=>{let f=o("%{ filesCount } file","%{ filesCount } files",p(a).files,{filesCount:p(a).files.toString()});!p(c)&&p(a).hiddenFiles&&(f=o("%{ filesCount } file including %{ filesHiddenCount } hidden","%{ filesCount } files including %{ filesHiddenCount } hidden",p(a).files,{filesCount:p(a).files.toString(),filesHiddenCount:p(a).hiddenFiles.toString()}));let m=o("%{ foldersCount } folder","%{ foldersCount } folders",p(a).folders,{foldersCount:p(a).folders.toString()});!p(c)&&p(a).hiddenFolders&&(m=o("%{ foldersCount } folder including %{ foldersHiddenCount } hidden","%{ foldersCount } folders including %{ foldersHiddenCount } hidden",p(a).folders,{foldersCount:p(a).folders.toString(),foldersHiddenCount:p(a).hiddenFolders.toString()}));const w=o("%{ spacesCount } space","%{ spacesCount } spaces",p(a).spaces,{spacesCount:p(a).spaces.toString()}),y=p(a).files+p(a).folders+p(a).spaces,E=e&&parseFloat(p(l))>0,b=jt(i,"files-shares-via-link"),g=r(E?"%{ itemsCount } item with %{ itemSize } in total":"%{ itemsCount } item in total"),v=r(E?"%{ itemsCount } items with %{ itemSize } in total":"%{ itemsCount } items in total"),h=b?"(%{ filesStr}, %{ foldersStr}, %{ spacesStr})":"(%{ filesStr}, %{ foldersStr})",S=`${g} ${h}`,T=`${v} ${h}`;return o(S,T,y,{itemsCount:y.toString(),itemSize:p(l),filesStr:f,foldersStr:m,spacesStr:w})})}},td=()=>{const{getMatchingSpace:e}=un(),t=Qe(),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)}}),o=s=>p(r).includes(s.id),i=B(()=>{if(p(n).length!==1)return null;const s=p(n)[0];return e(s)});return{selectedResources:n,selectedResourcesIds:r,isResourceInSelection:o,selectedResourceSpace:i}};function hx(e){const t=sn(),n=ei(),r=He(),o=Fe.useGettext(),i=B(()=>t.tusMaxChunkSize>0),s=()=>{const u={};return n.publicLinkPassword?u.Authorization="Basic "+vr.from(["public",n.publicLinkPassword].join(":")).toString("base64"):n.accessToken&&!n.publicLinkPassword&&(u.Authorization="Bearer "+n.accessToken),u["X-Request-ID"]=en.v4(),u["Accept-Language"]=o.current,u["Initiator-ID"]=r.initiatorId,u},a=B(()=>{const u={onBeforeRequest:(l,d)=>new Promise(f=>{var w;const m=s();l.setHeader("Authorization",m.Authorization),l.setHeader("X-Request-ID",m["X-Request-ID"]),l.setHeader("Accept-Language",m["Accept-Language"]),l.setHeader("Initiator-ID",m["Initiator-ID"]),d!=null&&d.isRemote&&l.setHeader("x-oc-mtime",(((w=d==null?void 0:d.data)==null?void 0:w.lastModified)/1e3).toFixed(0)),f()}),chunkSize:t.tusMaxChunkSize||1/0,overridePatchMethod:t.tusHttpMethodOverride,uploadDataDuringCreation:t.tusExtension.includes("creation-with-upload")};return u.headers=l=>{var d;if(l.xhrUpload||l!=null&&l.isRemote)return{"x-oc-mtime":(((d=l==null?void 0:l.data)==null?void 0:d.lastModified)/1e3).toFixed(0),...s()}},u}),c=B(()=>({timeout:6e4,endpoint:"",headers:u=>{var l;return{"x-oc-mtime":(((l=u==null?void 0:u.data)==null?void 0:l.lastModified)/1e3).toFixed(0),...s()}}}));St([a,c],()=>{if(p(i)){e.uppyService.useTus(p(a));return}e.uppyService.useXhr(p(c))},{immediate:!0})}const s0=()=>{const e=He(),{addAvatar:t,getAvatar:n,avatarsQueue:r,pendingAvatarsRequests:o}=Ys(),i=async a=>{var c;try{const u=await e.graphAuthenticated.photos.getUserPhoto(a,{responseType:"blob"});t(a,URL.createObjectURL(u))}catch(u){((c=u.response)==null?void 0:c.status)===404&&t(a,null)}return n(a)};return{enqueueAvatar:a=>{if(n(a)!==void 0||o.has(a))return;const c=r.add(()=>i(a));o.set(a,c),c.finally(()=>o.delete(a))}}},gx=Ne({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=st(),{options:n}=Ue.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")),o=B(()=>({...{appearance:e.action.appearance||e.appearance,...e.action.isDisabled&&{disabled:e.action.isDisabled(e.actionOptions)},...e.action.id&&{id:e.action.id}},...p(r)==="router-link"&&{to:e.action.route(e.actionOptions)},...p(r)==="a"&&{href:e.action.href(e.actionOptions)},...["router-link","a"].includes(p(r))&&{target:n.value.cernFeatures?"_blank":"_self"}}));return{componentType:r,componentProps:o}},computed:{hasExternalImageIcon(){return this.action.icon&&/^https?:\/\//i.test(this.action.icon)},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}}}}),mx={key:3,class:"oc-files-context-action-label oc-flex","data-testid":"action-label"},yx=["textContent"],bx=["textContent"];function vx(e,t,n,r,o,i){var l,d,f,m;const s=pe("oc-image"),a=pe("oc-icon"),c=pe("oc-button"),u=ln("oc-tooltip");return ot((X(),de("li",null,[ot((X(),Ae(c,Gt({type:e.componentType},e.componentProps,{class:[e.action.class,"action-menu-item","oc-py-s","oc-px-m","oc-width-1-1",...e.buttonClasses],"aria-label":e.componentProps.disabled?(d=(l=e.action).disabledTooltip)==null?void 0:d.call(l,e.actionOptions):"","data-testid":"action-handler",size:e.size,"justify-content":"left"},Za(e.componentListeners)),{default:Se(()=>[e.action.img?(X(),Ae(s,{key:0,"data-testid":"action-img",src:e.action.img,alt:"",class:"oc-icon oc-icon-m"},null,8,["src"])):e.hasExternalImageIcon?(X(),Ae(s,{key:1,"data-testid":"action-img",src:e.action.icon,alt:"",class:"oc-icon oc-icon-m"},null,8,["src"])):e.action.icon?(X(),Ae(a,{key:2,"data-testid":"action-icon",name:e.action.icon,"fill-type":e.action.iconFillType||"line",size:e.size},null,8,["name","fill-type","size"])):Ce("",!0),e.action.hideLabel?Ce("",!0):(X(),de("span",mx,[fe("span",{textContent:W.toDisplayString(e.action.label(e.actionOptions))},null,8,yx)])),e.action.shortcut&&e.shortcutHint?(X(),de("span",{key:4,class:"oc-files-context-action-shortcut",textContent:W.toDisplayString(e.action.shortcut)},null,8,bx)):Ce("",!0)]),_:1},16,["type","class","aria-label","size"])),[[u,e.showTooltip||e.action.hideLabel?e.action.label(e.actionOptions):""]])])),[[u,e.componentProps.disabled?(m=(f=e.action).disabledTooltip)==null?void 0:m.call(f,e.actionOptions):""]])}const ba=ze(gx,[["render",vx]]),wx=Ne({name:"BatchActions",components:{ActionMenuItem:ba},props:{actions:{type:Array,required:!0},actionOptions:{type:Object,required:!0},limitedScreenSpace:{type:Boolean,default:!1,required:!1}}});function Sx(e,t,n,r,o,i){const s=pe("action-menu-item"),a=pe("oc-list");return X(),de("div",null,[he(a,{id:"oc-appbar-batch-actions",class:W.normalizeClass({"oc-appbar-batch-actions-squashed":e.limitedScreenSpace})},{default:Se(()=>[(X(!0),de(qe,null,wt(e.actions,(c,u)=>(X(),Ae(s,{key:`action-${u}`,action:c,"action-options":e.actionOptions,appearance:"raw",class:"batch-actions oc-mr-s","shortcut-hint":!1,"show-tooltip":e.limitedScreenSpace},null,8,["action","action-options","show-tooltip"]))),128))]),_:1},8,["class"])])}const a0=ze(wx,[["render",Sx]]),Ex={class:"context-menu oc-files-context-action oc-px-s oc-rounded oc-menu-item-hover"},Tx={class:"oc-flex oc-files-context-action-label"},Ax=["textContent"],l0=Ne({__name:"ActionMenuDropItem",props:{menuSectionDrop:{},appearance:{},actionOptions:{}},setup(e){const t=Xs(`oc-files-context-actions-${e.menuSectionDrop.name}-drop-`),n=Xs(`oc-files-context-actions-${e.menuSectionDrop.name}-toggle-`);return(r,o)=>{const i=pe("oc-icon"),s=pe("oc-button"),a=pe("oc-drop");return X(),de("li",Ex,[he(s,{id:p(n),appearance:"raw","gap-size":"medium",class:"oc-py-s oc-px-m oc-width-1-1 oc-flex-justify-between oc-width-1-1"},{default:Se(()=>[he(i,{name:r.menuSectionDrop.icon,size:"medium","fill-type":"line"},null,8,["name"]),fe("span",Tx,[fe("span",{textContent:W.toDisplayString(r.menuSectionDrop.label)},null,8,Ax)]),he(i,{name:"arrow-right-s",size:"small","fill-type":"line"})]),_:1},8,["id"]),he(a,{"drop-id":p(t),toggle:`#${p(n)}`,"is-nested":!0,mode:"hover",class:"oc-width-auto oc-files-context-action-drop","padding-size":"small",position:"auto-start","close-on-click":""},{default:Se(()=>[r.menuSectionDrop.items.length?(X(!0),de(qe,{key:0},wt(r.menuSectionDrop.items,(c,u)=>(X(),Ae(ba,{key:`section-${r.menuSectionDrop.label}-action-${u}`,action:c,appearance:r.appearance,"action-options":r.actionOptions,class:"oc-files-context-action oc-rounded oc-menu-item-hover"},null,8,["action","appearance","action-options"]))),128)):Ce("",!0)]),_:1},8,["drop-id","toggle"])])}}}),Rx=Ne({name:"ContextActionMenu",components:{ActionMenuDropItem:l0,ActionMenuItem:ba},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("oc-pb-s"),e>0&&t.push("oc-pt-s"),e<this.menuSections.length-1&&t.push("oc-files-context-actions-border")),t}}}),_x={id:"oc-files-context-menu"};function Ix(e,t,n,r,o,i){const s=pe("action-menu-item"),a=pe("action-menu-drop-item"),c=pe("oc-list");return X(),de("div",_x,[(X(!0),de(qe,null,wt(e.menuSections,(u,l)=>(X(),Ae(c,{id:`oc-files-context-actions-${u.name}`,key:`section-${u.name}-list`,class:W.normalizeClass(["oc-files-context-actions",e.getSectionClasses(l)])},{default:Se(()=>[u.items?(X(!0),de(qe,{key:0},wt(u.items,(d,f)=>(X(),Ae(s,{key:`section-${u.name}-action-${f}`,action:d,appearance:e.appearance,"action-options":e.actionOptions,class:"context-menu oc-files-context-action oc-rounded oc-menu-item-hover"},null,8,["action","appearance","action-options"]))),128)):Ce("",!0),(X(!0),de(qe,null,wt(u.dropItems,d=>(X(),de(qe,null,[d.items.length?(X(),Ae(a,{key:d.name,"menu-section-drop":d,appearance:e.appearance,"action-options":e.actionOptions},null,8,["menu-section-drop","appearance","action-options"])):Ce("",!0)],64))),256))]),_:2},1032,["id","class"]))),128))])}const nd=ze(Rx,[["render",Ix]]),Cx=Ne({name:"ContextActions",components:{ContextActionMenu:nd},props:{actionOptions:{type:Object,required:!0}},setup(e){const{editorActions:t,defaultEditorActions:n}=Qn(),{$gettext:r}=Fe.useGettext(),{actions:o}=aa(),{actions:i}=la(),{actions:s}=ca(),{actions:a}=Lf(),{actions:c}=ua(),{actions:u}=Po(),{actions:l}=fa(),{actions:d}=Fo(),{actions:f}=Bf(),{actions:m}=Mf(),{actions:w}=da(),{actions:y}=jf(),{actions:E}=Pv(),{actions:b}=pa(),{actions:g}=ha(),{actions:v}=Ov(),{actions:h}=qf(),{actions:S}=zf(),{actions:T}=Vf(),I=Bi(),_=B(()=>I.requestExtensions({id:"global.files.context-actions",extensionType:"action"}).map(te=>te.action)),A=B(()=>I.requestExtensions({id:"global.files.batch-actions",extensionType:"action"}).map(te=>te.action)),$=Mw(e,"actionOptions"),D=B(()=>[...p(o),...p(c),...p(l),...p(w),...p(s),...p(m),...p(u),...p(g),...p(S),...p(A).filter(te=>te.category==="actions"||It.isNil(te.category))].filter(te=>te.isVisible(p($)))),N=B(()=>[...p(h),...p(A).filter(te=>te.category==="sidebar")].filter(te=>te.isVisible(p($)))),x=B(()=>[...p(y),...p(n)].filter(te=>te.isVisible(p($))).sort((te,ce)=>Number(ce.hasPriority)-Number(te.hasPriority))),V=B(()=>[...p(t),...p(_).filter(te=>te.category==="context")].filter(te=>te.isVisible(p($))).sort((te,ce)=>Number(ce.hasPriority)-Number(te.hasPriority))),G=B(()=>[...p(T),...p(a),...p(_).filter(te=>te.category==="share")].filter(te=>te.isVisible(p($)))),ae=B(()=>[...p(l),...p(d),...p(u),...p(w),...p(s),...p(E),...p(b),...p(S),...p(g),...p(o),...p(c),...p(i),...p(v),...p(_).filter(te=>te.category==="actions"||It.isNil(te.category))].filter(te=>te.isVisible(p($)))),ye=B(()=>[...p(f).map(te=>(te.keepOpen=!0,te)),...p(h),...p(_).filter(te=>te.category==="sidebar")].filter(te=>te.isVisible(p($))));return{menuSections:B(()=>{const te=[];return p($).resources.length>1?(p(D).length&&te.push({name:"batch-actions",items:[...p(D)]}),te.push({name:"batch-details",items:[...p(N)]}),te):([...p(x),...p(V)].length&&te.push({name:"context",items:[...p(x)],dropItems:[{label:r("Open with..."),name:"open-with",icon:"apps",items:[...p(V)]}]}),p(G).length&&te.push({name:"share",items:p(G)}),p(ae).length&&te.push({name:"actions",items:p(ae)}),p(ye).length&&te.push({name:"sidebar",items:p(ye)}),te)})}}});function Px(e,t,n,r,o,i){const s=pe("context-action-menu");return X(),Ae(s,{"menu-sections":e.menuSections,"action-options":e.actionOptions},null,8,["menu-sections","action-options"])}const c0=ze(Cx,[["render",Px]]),Fx=Ne({props:{hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},paginationOptions:{type:Array,default:()=>Cr.options},perPageQueryName:{type:String,default:()=>Cr.perPageQueryName},perPageDefault:{type:String,default:()=>Cr.perPageDefault},perPageStoragePrefix:{type:String,required:!0},viewModeDefault:{type:String,required:!1,default:()=>Jt.defaultModeName},viewModes:{type:Array,default:()=>[]}},setup(e){const t=We(),n=Kt(),{$gettext:r}=Fe.useGettext(),o=Qe(),{setAreHiddenFilesShown:i,setAreFileExtensionsShown:s,setAreDisabledSpacesShown:a}=o,{areHiddenFilesShown:c,areFileExtensionsShown:u,areDisabledSpacesShown:l}=Ue.storeToRefs(o),d=le(!1),f=an("page"),m=B(()=>p(f)?parseInt(Rt(p(f))):1),w=Tr({name:e.perPageQueryName,defaultValue:e.perPageDefault,storagePrefix:e.perPageStoragePrefix}),y=Zs(),E=Tr({name:`${p(y)}-${Jt.queryName}`,defaultValue:e.viewModeDefault}),b=Tr({name:Jt.tilesSizeQueryName,defaultValue:Jt.tilesSizeDefault.toString()}),g=S=>t.replace({query:{...p(n).query,[e.perPageQueryName]:S,...p(m)>1&&{page:"1"}}}),v=S=>{E.value=S.name};St([w,E,b],S=>{d.value=S.some(T=>!T)},{immediate:!0,deep:!0});const h=Zf();return{FolderViewModeConstants:Jt,viewModeCurrent:E,viewSizeCurrent:b,viewSizeMax:h,itemsPerPageCurrent:w,queryParamsLoading:d,queryItemAsString:Rt,setItemsPerPage:g,setViewMode:v,areHiddenFilesShown:c,areFileExtensionsShown:u,areDisabledSpacesShown:l,setAreHiddenFilesShown:i,setAreFileExtensionsShown:s,setAreDisabledSpacesShown:a,viewOptionsButtonLabel:r("Display customization options of the files list"),isProjectsLocation:Ar(ht,"files-spaces-projects")}},computed:{hiddenFilesShownModel:{get(){return this.areHiddenFilesShown},set(e){this.setAreHiddenFilesShown(e)}},fileExtensionsShownModel:{get(){return this.areFileExtensionsShown},set(e){this.setAreFileExtensionsShown(e)}},disabledSpacesShownModel:{get(){return this.areDisabledSpacesShown},set(e){this.setAreDisabledSpacesShown(e)}}},methods:{updateHiddenFilesShownModel(e){this.hiddenFilesShownModel=e},updateFileExtensionsShownModel(e){this.fileExtensionsShownModel=e},updateDisabledSpacesShownModel(e){this.disabledSpacesShownModel=e}}}),Ox={class:"oc-flex oc-flex-middle"},kx={key:0,class:"viewmode-switch-buttons oc-button-group oc-visible@s oc-mr-s"},xx={key:0,class:"files-view-options-list-item"},Nx={key:1,class:"files-view-options-list-item"},$x={key:2,class:"files-view-options-list-item"},Dx={key:3,class:"files-view-options-list-item"},Lx={key:4,class:"files-view-options-list-item oc-flex oc-flex-between oc-flex-middle"},Mx=["textContent"],Bx=["max"];function jx(e,t,n,r,o,i){const s=pe("oc-icon"),a=pe("oc-button"),c=pe("oc-switch"),u=pe("oc-page-size"),l=pe("oc-list"),d=pe("oc-drop"),f=ln("oc-tooltip");return X(),de("div",Ox,[e.viewModes.length>1?(X(),de("div",kx,[(X(!0),de(qe,null,wt(e.viewModes,m=>ot((X(),Ae(a,{key:m.name,"no-hover":e.viewModeCurrent===m.name,class:W.normalizeClass([m.name]),appearance:e.viewModeCurrent===m.name?"filled":"outline","color-role":e.viewModeCurrent===m.name?"secondaryContainer":"secondary","aria-label":e.$gettext(m.label),onClick:w=>e.setViewMode(m)},{default:Se(()=>[he(s,{name:m.icon.name,"fill-type":m.icon.fillType,size:"small"},null,8,["name","fill-type"])]),_:2},1032,["no-hover","class","appearance","color-role","aria-label","onClick"])),[[f,e.$gettext(m.label)]])),128))])):Ce("",!0),ot((X(),Ae(a,{id:"files-view-options-btn",key:"files-view-options-btn","data-testid":"files-view-options-btn","aria-label":e.viewOptionsButtonLabel,appearance:"raw",class:"oc-my-s oc-p-xs"},{default:Se(()=>[he(s,{name:"settings-3","fill-type":"line"})]),_:1},8,["aria-label"])),[[f,e.viewOptionsButtonLabel]]),he(d,{"drop-id":"files-view-options-drop",toggle:"#files-view-options-btn",mode:"click",class:"oc-width-auto","padding-size":"medium"},{default:Se(()=>[he(l,null,{default:Se(()=>[e.hasHiddenFiles?(X(),de("li",xx,[he(c,{checked:e.hiddenFilesShownModel,"onUpdate:checked":[t[0]||(t[0]=m=>e.hiddenFilesShownModel=m),e.updateHiddenFilesShownModel],"data-testid":"files-switch-hidden-files",label:e.$gettext("Show hidden files")},null,8,["checked","label","onUpdate:checked"])])):Ce("",!0),e.hasFileExtensions?(X(),de("li",Nx,[he(c,{checked:e.fileExtensionsShownModel,"onUpdate:checked":[t[1]||(t[1]=m=>e.fileExtensionsShownModel=m),e.updateFileExtensionsShownModel],"data-testid":"files-switch-files-extensions-files",label:e.$gettext("Show file extensions")},null,8,["checked","label","onUpdate:checked"])])):Ce("",!0),e.hasPagination?(X(),de("li",$x,[e.queryParamsLoading?Ce("",!0):(X(),Ae(u,{key:0,selected:e.queryItemAsString(e.itemsPerPageCurrent),"data-testid":"files-pagination-size",label:e.$gettext("Items per page"),options:e.paginationOptions,class:"files-pagination-size",onChange:e.setItemsPerPage},null,8,["selected","label","options","onChange"]))])):Ce("",!0),e.isProjectsLocation?(X(),de("li",Dx,[he(c,{checked:e.disabledSpacesShownModel,"onUpdate:checked":[t[2]||(t[2]=m=>e.disabledSpacesShownModel=m),e.updateDisabledSpacesShownModel],"data-testid":"files-switch-projects-show-disabled",label:e.$gettext("Show disabled Spaces")},null,8,["checked","label","onUpdate:checked"])])):Ce("",!0),e.viewModeCurrent===e.FolderViewModeConstants.name.tiles?(X(),de("li",Lx,[fe("label",{for:"tiles-size-slider",textContent:W.toDisplayString(e.$gettext("Tile size"))},null,8,Mx),ot(fe("input",{id:"tiles-size-slider","onUpdate:modelValue":t[3]||(t[3]=m=>e.viewSizeCurrent=m),type:"range",min:1,max:e.viewSizeMax,class:"oc-range","data-testid":"files-tiles-size-slider"},null,8,Bx),[[WS,e.viewSizeCurrent]])])):Ce("",!0)]),_:1})]),_:1})])}const u0=ze(Fx,[["render",jx],["__scopeId","data-v-cc70f12f"]]),Ux=Ne({name:"AppBar",components:{BatchActions:a0,ContextActions:c0,ViewOptions:u0},props:{viewModeDefault:{type:String,required:!1,default:()=>Jt.name.table},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=ct(),{$gettext:r}=Fe.useGettext(),{can:o}=mn(),i=We(),{requestExtensions:s}=Bi(),{isSticky:a}=Kf(),c=Qe(),{selectedResources:u}=Ue.storeToRefs(c),l=B(()=>e.space),{actions:d}=aa(),{actions:f}=la(),{actions:m}=ca(),{actions:w}=Hv(),{actions:y}=ua(),{actions:E}=Po(),{actions:b}=fa(),{actions:g}=Fo(),{actions:v}=Mf(),{actions:h}=da(),{actions:S}=ha(),{actions:T}=zv(),{actions:I}=Wv(),{actions:_}=Qv(),{actions:A}=Jv(),$=le(0),D=Ar(Ct,"files-common-search"),N=B(()=>Object.hasOwn(vS(),"navigation")&&o("create-all","Share")),x=B(()=>{let ne=[...p(f),...p(d),...p(y),...p(b),...p(g),...p(h),...p(m),...p(v),...p(E),...p(S)];D.value||(ne=[...ne,...p(w),...p(_),...p(A),...p(T),...p(I)]);const se=s({id:"global.files.batch-actions",extensionType:"action"});return se.length&&(ne=[...ne,...se.map(Re=>Re.action)]),ne.filter(Re=>Re.isVisible({space:p(l),resources:c.selectedResources}))}),V=B(()=>n.spaces.filter(ne=>ee.isPersonalSpaceResource(ne)||ee.isProjectSpaceResource(ne))),G=hr("isMobileWidth"),ae=Ar(Fn,"files-trash-generic"),ye=B(()=>!p(G)&&e.breadcrumbs.length?!0:p(ae)&&p(V).length===1?!1:e.breadcrumbs.length>1),ue=B(()=>p(ae)&&p(V).length===1?e.breadcrumbs.length<=2:e.breadcrumbs.length<=1),te=B(()=>p(l)&&(ee.isProjectSpaceResource(p(l))||ee.isShareSpaceResource(p(l)))?3:2),ce=ne=>{t(jb,ne)},oe=fv("title"),J=B(()=>{var ne;return p(oe)?r(p(oe)):((ne=p(l))==null?void 0:ne.name)||""});return{router:i,hasSharesNavigation:N,batchActions:x,showBreadcrumb:ye,showMobileNav:ue,breadcrumbMaxWidth:$,breadcrumbTruncationOffset:te,fileDroppedBreadcrumb:ce,pageTitle:J,selectedResources:u,isSticky:a}},data:function(){return{resizeObserver:new ResizeObserver(this.onResize),limitedScreenSpace:!1}},computed:{showContextActions(){return md(this.breadcrumbs).allowContextActions},showBatchActions(){return this.hasBulkActions&&(this.selectedResources.length>=1||Fn(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(){var o,i,s,a;const e=((o=document.getElementById("web-content-main"))==null?void 0:o.getBoundingClientRect().width)||0,t=((i=document.getElementById("web-nav-sidebar"))==null?void 0:i.getBoundingClientRect().width)||0,n=((s=document.getElementById("app-sidebar"))==null?void 0:s.getBoundingClientRect().width)||0,r=(a=document.getElementById("files-app-bar-controls-right"))==null?void 0:a.clientWidth;this.breadcrumbMaxWidth=e-t-n-r,this.limitedScreenSpace=this.isSideBarOpen?window.innerWidth<=1280:window.innerWidth<=1e3}}}),qx={class:"files-topbar oc-py-s"},Vx=["textContent"],zx={key:3,id:"files-app-bar-controls-right",class:"oc-flex"},Wx={class:"files-app-bar-actions oc-mt-xs"},Hx={class:"oc-flex-1 oc-flex oc-flex-start oc-flex-middle"},Gx={key:1};function Kx(e,t,n,r,o,i){const s=pe("oc-hidden-announcer"),a=pe("context-actions"),c=pe("oc-breadcrumb"),u=pe("portal-target"),l=pe("view-options"),d=pe("batch-actions"),f=pe("oc-spinner");return X(),de("div",{id:"files-app-bar",ref:"filesAppBar",class:W.normalizeClass({"files-app-bar-squashed":e.isSideBarOpen,"files-app-bar-sticky":e.isSticky})},[fe("div",qx,[fe("h1",{class:"oc-invisible-sr",textContent:W.toDisplayString(e.pageTitle)},null,8,Vx),he(s,{announcement:e.selectedResourcesAnnouncement,level:"polite"},null,8,["announcement"]),fe("div",{class:W.normalizeClass(["oc-flex oc-flex-middle files-app-bar-controls",{"oc-flex-between":e.breadcrumbs.length||e.hasSharesNavigation,"oc-flex-right":!e.breadcrumbs.length&&!e.hasSharesNavigation}])},[e.showBreadcrumb?(X(),Ae(c,{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,onItemDroppedBreadcrumb:e.fileDroppedBreadcrumb},{contextMenu:Se(()=>[he(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","onItemDroppedBreadcrumb"])):Ce("",!0),e.showMobileNav?(X(),Ae(u,{key:1,name:"app.runtime.mobile.nav"})):Ce("",!0),e.hasSharesNavigation?Xe(e.$slots,"navigation",{key:2},void 0,!0):Ce("",!0),e.hasViewOptions?(X(),de("div",zx,[he(l,{"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"])])):Ce("",!0)],2),fe("div",Wx,[fe("div",Hx,[Xe(e.$slots,"actions",{limitedScreenSpace:e.limitedScreenSpace},void 0,!0),e.showBatchActions&&!e.batchActionsLoading?(X(),Ae(d,{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(),de("div",Gx,[he(f,{"aria-label":e.$gettext("Loading actions")},null,8,["aria-label"])])):Ce("",!0)])]),Xe(e.$slots,"content",{},void 0,!0)])],2)}const Qx=ze(Ux,[["render",Kx],["__scopeId","data-v-219be1d5"]]),Xx=Ne({name:"CreateSpace",props:{showLabel:{type:Boolean,default:!0}},emits:["spaceCreated"],setup(e,{emit:t}){const{showMessage:n,showErrorMessage:r}=tt(),{$gettext:o}=Fe.useGettext(),{createSpace:i}=Ui(),{checkSpaceNameModalInput:s}=ci(),{dispatchModal:a}=pt(),c=ct(),{upsertResource:u}=Qe(),l=async f=>{try{const m=await i(f);u(m),c.upsertSpace(m),t("spaceCreated",m),n({title:o("Space was created successfully")})}catch(m){console.error(m),r({title:o("Creating space failed…"),errors:[m]})}};return{showCreateSpaceModal:()=>{a({title:o("Create a new space"),confirmText:o("Create"),hasInput:!0,inputLabel:o("Space name"),inputValue:o("New space"),inputRequiredMark:!0,onConfirm:f=>l(f),onInput:s})}}}}),Yx=["textContent"];function Jx(e,t,n,r,o,i){const s=pe("oc-icon"),a=pe("oc-button"),c=ln("oc-tooltip");return ot((X(),Ae(a,{id:"new-space-menu-btn","aria-label":e.showLabel?void 0:e.$gettext("New space"),appearance:"filled",onClick:e.showCreateSpaceModal},{default:Se(()=>[he(s,{name:"add"}),e.showLabel?(X(),de("span",{key:0,textContent:W.toDisplayString(e.$gettext("New Space"))},null,8,Yx)):Ce("",!0)]),_:1},8,["aria-label","onClick"])),[[c,e.showLabel?void 0:e.$gettext("New space")]])}const Zx=ze(Xx,[["render",Jx]]),eN=Ne({name:"AppTopBar",components:{ContextActionMenu:nd,ResourceListItem:ko},props:{dropDownMenuSections:{type:Array,default:()=>[]},dropDownActionOptions:{type:Object,default:()=>({space:null,resources:[]})},mainActions:{type:Array,default:()=>[]},hasAutoSave:{type:Boolean,default:!0},isEditor:{type:Boolean,default:!1},resource:{type:Object,default:null}},emits:["close"],setup(e){const{$gettext:t,current:n}=Fe.useGettext(),r=Qe(),o=st(),{getMatchingSpace:i}=un(),s=B(()=>r.areFileExtensionsShown),a=B(()=>t("Show context menu")),c=B(()=>e.isEditor&&e.hasAutoSave&&o.options.editor.autosaveEnabled),u=B(()=>{const f=qt.Duration.fromObject({seconds:o.options.editor.autosaveInterval},{locale:n});return t("Autosave (every %{ duration })",{duration:f.toHuman()})}),l=B(()=>i(e.resource)),d=B(()=>!ee.isPublicSpaceResource(p(l)));return{contextMenuLabel:a,areFileExtensionsShown:s,hasAutosave:c,autoSaveTooltipText:u,isPathDisplayed:d,...ui()}}}),tN={class:"oc-app-top-bar oc-flex"},nN={class:"oc-app-top-bar-inner oc-pl-m oc-pr-xs oc-flex oc-flex-middle oc-flex-between"},rN={class:"open-file-bar oc-flex"},iN={class:"oc-flex main-actions"},oN={key:1,class:"oc-flex oc-flex-middle"};function sN(e,t,n,r,o,i){const s=pe("resource-list-item"),a=pe("oc-icon"),c=pe("oc-button"),u=pe("context-action-menu"),l=pe("oc-drop"),d=pe("portal"),f=ln("oc-tooltip");return X(),Ae(d,{to:"app.runtime.header.left"},{default:Se(()=>[fe("div",tN,[fe("span",nN,[fe("div",rN,[e.resource?(X(),Ae(s,{key:0,id:"app-top-bar-resource","is-thumbnail-displayed":!1,"is-extension-displayed":e.areFileExtensionsShown,"path-prefix":e.getPathPrefix(e.resource),resource:e.resource,"parent-folder-name":e.getParentFolderName(e.resource),"parent-folder-link-icon-additional-attributes":e.getParentFolderLinkIconAdditionalAttributes(e.resource),"is-path-displayed":e.isPathDisplayed,"is-resource-clickable":!1},null,8,["is-extension-displayed","path-prefix","resource","parent-folder-name","parent-folder-link-icon-additional-attributes","is-path-displayed"])):Ce("",!0)]),fe("div",iN,[e.dropDownMenuSections.length?(X(),de(qe,{key:0},[ot((X(),Ae(c,{id:"oc-openfile-contextmenu-trigger","aria-label":e.contextMenuLabel,appearance:"raw-inverse","color-role":"chrome",class:"oc-p-xs"},{default:Se(()=>[he(a,{name:"more-2"})]),_:1},8,["aria-label"])),[[f,e.contextMenuLabel]]),he(l,{"drop-id":"oc-openfile-contextmenu",mode:"click","padding-size":"small",toggle:"#oc-openfile-contextmenu-trigger","close-on-click":"",onClick:t[0]||(t[0]=Cn(()=>{},["stop","prevent"]))},{default:Se(()=>[he(u,{"menu-sections":e.dropDownMenuSections,"action-options":e.dropDownActionOptions},null,8,["menu-sections","action-options"])]),_:1})],64)):Ce("",!0),e.hasAutosave?(X(),de("span",oN,[ot(he(a,{"accessible-label":e.autoSaveTooltipText,name:"refresh",color:"white",class:"ox-p-xs oc-mx-xs"},null,8,["accessible-label"]),[[f,e.autoSaveTooltipText]])])):Ce("",!0),e.mainActions.length&&e.resource?(X(),Ae(u,{key:2,"menu-sections":[{name:"main-actions",items:e.mainActions.filter(m=>m.isVisible()).map(m=>({...m,class:"oc-p-xs app-topbar-action",hideLabel:!0}))}],"action-options":{resources:[e.resource]},appearance:"raw-inverse","color-role":"chrome"},null,8,["menu-sections","action-options"])):Ce("",!0),he(c,{id:"app-top-bar-close",appearance:"raw-inverse","color-role":"chrome",class:"oc-p-xs","aria-label":e.$gettext("Close"),onClick:t[1]||(t[1]=m=>e.$emit("close"))},{default:Se(()=>[he(a,{name:"close"})]),_:1},8,["aria-label"])])])])]),_:1})}const f0=ze(eN,[["render",sN]]),aN=Ne({name:"ErrorScreen",props:{message:{default:"",type:String,required:!1}}}),lN={class:"oc-text-center oc-flex oc-flex-center oc-flex-middle oc-height-1-1"},cN={key:0,class:"oc-text-xlarge"};function uN(e,t,n,r,o,i){const s=pe("oc-icon");return X(),de("div",lN,[he(s,{size:"xxlarge",name:"error-warning","fill-type":"line"}),e.message?(X(),de("p",cN,W.toDisplayString(e.message),1)):Ce("",!0)])}const fN=ze(aN,[["render",uN]]),dN=Ne({name:"LoadingScreen"}),pN={class:"oc-text-center oc-flex oc-flex-center oc-flex-middle oc-height-1-1"},hN={class:"oc-invisible"};function gN(e,t,n,r,o,i){const s=pe("oc-spinner"),a=ln("translate");return X(),de("div",pN,[he(s,{size:"xlarge"}),ot((X(),de("p",hN,t[0]||(t[0]=[Ot("Loading app")]))),[[a]])])}const mN=ze(dN,[["render",gN]]),yN=["id","data-testid","tabindex","inert"],bN={key:0,class:"sidebar-panel__header header"},vN={class:"header__title oc-my-rm"},wN={key:0,class:"sidebar-panel__navigation oc-mt-m"},d0=Ne({__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}=Fe.useGettext(),o=Qa("appSideBar"),i=B(()=>e.availablePanels.filter(A=>{var $;return A.isVisible(e.panelContext)&&(($=A.isRoot)==null?void 0:$.call(A,e.panelContext))})),s=B(()=>e.availablePanels.filter(A=>{var $;return A.isVisible(e.panelContext)&&!(($=A.isRoot)!=null&&$.call(A,e.panelContext))})),a=B(()=>p(i).length?[p(i)[0],...p(s)]:p(s)),c=B(()=>{var $;const A=($=e.activePanel)==null?void 0:$.split("#")[0];return!A||!p(s).map(D=>D.name).includes(A)?null:A}),u=B(()=>p(c)!==null),l=B(()=>p(c)===null),d=le(null),f=A=>{d.value=A},m=B(()=>p(u)?p(c):p(i)[0].name),w=B(()=>p(i).length===1?r("Back to %{panel} panel",{panel:p(i)[0].title(e.panelContext)}):r("Back to main panels")),y=le(window.innerWidth),E=B(()=>p(y)<=580),b=B(()=>{var A,$;return($=(A=p(o))==null?void 0:A.parentElement)==null?void 0:$.querySelector("div")}),g=()=>{if(!p(b))return;const A=p(E)?"hidden":"visible";p(b).style.visibility=A},v=()=>{e.isOpen&&(y.value=window.innerWidth,g())};St(()=>e.isOpen,async A=>{A&&(await _n(),g())},{immediate:!0});const h=A=>{n("selectPanel",A)},S=()=>{n("selectPanel",null)},T=()=>{n("close")},I=A=>{f(p(m)),h(A)},_=()=>{f(p(m)),S(),p(o).focus()};return Bt(()=>{window.addEventListener("resize",v)}),Vn(()=>{window.removeEventListener("resize",v),p(b)&&(p(b).style.visibility="visible")}),(A,$)=>{const D=pe("oc-spinner"),N=pe("oc-icon"),x=pe("oc-button"),V=ln("oc-tooltip");return X(),de("div",{id:"app-sidebar",ref_key:"appSideBar",ref:o,"data-testid":"app-sidebar",tabindex:"-1",class:W.normalizeClass({"has-active-sub-panel":u.value,"oc-flex oc-flex-center oc-flex-middle":A.loading,"app-sidebar-full-width":E.value})},[A.loading?(X(),Ae(D,{key:0})):(X(!0),de(qe,{key:1},wt(a.value,G=>{var ae,ye,ue,te,ce,oe;return X(),de("div",{id:`sidebar-panel-${G.name}`,key:`panel-${G.name}`,"data-testid":`sidebar-panel-${G.name}`,tabindex:m.value===G.name?-1:null,class:W.normalizeClass(["sidebar-panel",{"is-root-panel":(ae=G.isRoot)==null?void 0:ae.call(G,A.panelContext),"is-active-sub-panel":u.value&&c.value===G.name,"is-active-root-panel":l.value&&((ye=G.isRoot)==null?void 0:ye.call(G,A.panelContext))}]),inert:m.value!==G.name},[[m.value,d.value].includes(G.name)?(X(),de("div",bN,[(ue=G.isRoot)!=null&&ue.call(G,A.panelContext)?Ce("",!0):ot((X(),Ae(x,{key:0,class:"header__back oc-p-xs",appearance:"raw","aria-label":w.value,onClick:_},{default:Se(()=>[he(N,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"])),[[V,w.value]]),fe("h2",vN,W.toDisplayString(G.title(A.panelContext)),1),he(x,{appearance:"raw",class:"header__close oc-p-xs","aria-label":p(r)("Close file sidebar"),onClick:T},{default:Se(()=>[he(N,{name:"close"})]),_:1},8,["aria-label"])])):Ce("",!0),fe("div",null,[(te=G.isRoot)!=null&&te.call(G,A.panelContext)?Xe(A.$slots,"rootHeader",{key:0}):Xe(A.$slots,"subHeader",{key:1})]),fe("div",{class:W.normalizeClass(["sidebar-panel__body",[`sidebar-panel__body-${G.name}`]])},[fe("div",{class:W.normalizeClass(["sidebar-panel__body-content",{"sidebar-panel__body-content-stretch":!((ce=G.isRoot)!=null&&ce.call(G,A.panelContext))}])},[Xe(A.$slots,"body",{},()=>{var J;return[(X(!0),de(qe,null,wt((J=G.isRoot)!=null&&J.call(G,A.panelContext)?i.value:[G],(ne,se)=>{var Re;return X(),de("div",{key:`sidebar-panel-${ne.name}`},[[m.value,d.value].includes(ne.name)?(X(),Ae(Nr(ne.component),Gt({key:0,class:{"multi-root-panel-separator oc-mt oc-pt-s":se>0}},{ref_for:!0},((Re=ne.componentAttrs)==null?void 0:Re.call(ne,A.panelContext))||{}),null,16,["class"])):Ce("",!0)])}),128))]})],2),(oe=G.isRoot)!=null&&oe.call(G,A.panelContext)&&s.value.length>0?(X(),de("div",wN,[(X(!0),de(qe,null,wt(s.value,J=>(X(),Ae(x,{id:`sidebar-panel-${J.name}-select`,key:`panel-select-${J.name}`,"data-testid":`sidebar-panel-${J.name}-select`,appearance:"raw-inverse","color-role":"surface",onClick:ne=>I(J.name)},{default:Se(()=>[he(N,{name:J.icon,"fill-type":J.iconFillType},null,8,["name","fill-type"]),Ot(" "+W.toDisplayString(J.title(A.panelContext))+" ",1),he(N,{name:"arrow-right-s","fill-type":"line"})]),_:2},1032,["id","data-testid","onClick"]))),128))])):Ce("",!0)],2)],10,yN)}),128))],2)}}}),SN=Ne({name:"SpaceInfo",setup(){return{resource:hr("resource")}}}),EN={class:"space_info oc-p-s"},TN={class:"space_info__body oc-text-overflow oc-flex oc-flex-middle"},AN={class:"oc-mr-s"},RN=["textContent"],_N=["textContent"];function IN(e,t,n,r,o,i){const s=pe("oc-icon");return X(),de("div",EN,[fe("div",TN,[fe("div",AN,[he(s,{name:"layout-grid",size:e.resource.description?"large":"medium",class:"oc-display-block"},null,8,["size"])]),fe("div",null,[fe("h3",{"data-testid":"space-info-name",class:"oc-font-semibold oc-m-rm",textContent:W.toDisplayString(e.resource.name)},null,8,RN),fe("span",{"data-testid":"space-info-subtitle",textContent:W.toDisplayString(e.resource.description)},null,8,_N)])])])}const p0=ze(SN,[["render",IN]]),CN=Ne({name:"FileInfo",components:{ResourceIcon:Oo,ResourceName:Hf},props:{isSubPanelActive:{type:Boolean,default:!0}},setup(){const e=Qe(),t=hr("resource"),n=hr("space"),r=B(()=>e.areFileExtensionsShown),o=B(()=>ee.isPersonalSpaceResource(p(n))&&p(t).path==="/"?p(n).name:p(t).name);return{resource:t,resourceName:o,areFileExtensionsShown:r}}}),PN={class:"file_info oc-flex oc-flex-between oc-p-s"},FN={class:"oc-flex oc-flex-middle"},ON={class:"file_info__body oc-text-overflow"},kN={"data-testid":"files-info-name",class:"oc-font-semibold"};function xN(e,t,n,r,o,i){const s=pe("resource-icon"),a=pe("resource-name");return X(),de("div",PN,[fe("div",FN,[e.isSubPanelActive?(X(),Ae(s,{key:0,resource:e.resource,size:"large",class:"file_info__icon oc-mr-s oc-position-relative"},null,8,["resource"])):Ce("",!0),fe("div",ON,[fe("h3",kN,[he(a,{name:e.resourceName,extension:e.resource.extension,type:e.resource.type,"full-path":e.resource.webDavPath,"is-extension-displayed":e.areFileExtensionsShown,"is-path-displayed":!1,"truncate-name":!1},null,8,["name","extension","type","full-path","is-extension-displayed"])])])])])}const h0=ze(CN,[["render",xN]]),NN=Ne({name:"FileSideBar",components:{FileInfo:h0,SpaceInfo:p0,InnerSideBar:d0},props:{isOpen:{type:Boolean,required:!0},activePanel:{type:String,required:!1,default:null},space:{type:Object,required:!1,default:null}},setup(e){const t=We(),n=He(),r=Bi(),o=li(),i=ct(),s=Er(),a=st(),c=ir(),{canListShares:u}=kv(),{canListVersions:l}=n0(),d=Qe(),{currentFolder:f}=Ue.storeToRefs(d),m=le(),w=le([]),y=le([]),E=le([]),{selectedResources:b}=td(),g=le(!1),v=B(()=>p(g)||ue.isRunning),h=B(()=>{var oe;return p(b).length===0?{root:e.space,parent:null,items:(oe=p(f))!=null&&oe.id?[p(f)]:[]}:{root:e.space,parent:p(f),items:p(b)}}),S=Ar(jt,"files-shares-with-me"),T=Ar(jt,"files-shares-with-others"),I=Ar(jt,"files-shares-via-link"),_=ht(t,"files-spaces-projects"),A=Ar(Ct,"files-common-favorites"),$=Ar(Ct,"files-common-search"),D=()=>{o.publish(Tt.close)},N=oe=>{o.publish(Tt.setActivePanel,oe)},x=B(()=>{var oe;return((oe=p(h).items)==null?void 0:oe.length)===1&&!ee.isProjectSpaceResource(p(h).items[0])}),V=B(()=>{var oe;return((oe=p(h).items)==null?void 0:oe.length)===1&&ee.isProjectSpaceResource(p(h).items[0])}),G=B(()=>p(S)||p(T)||p(I)),ae=B(()=>p(G)||p($)||p(A)),ye=B(()=>r.requestExtensions({id:"global.files.sidebar",extensionType:"sidebarPanel"}).map(oe=>oe.panel)),ue=pn.useTask(function*(oe,J){w.value=yield n.webdav.listFileVersions(J.id,{signal:oe})}),te=pn.useTask(function*(oe,J){var Pe;s.setLoading(!0),s.removeOrphanedShares();const{collaboratorShares:ne,linkShares:se}=s,Re=n.graphAuthenticated.permissions;let H=(Pe=e.space)==null?void 0:Pe.id;if(ee.isShareSpaceResource(e==null?void 0:e.space)){const De=yield i.getMountPointForSpace({graphClient:n.graphAuthenticated,space:e.space,signal:oe});De&&(H=De.root.remoteItem.rootId)}const{shares:R,allowedRoles:F}=yield*ee.call(Re.listPermissions(H,J.fileId,s.graphRoles,{},{signal:oe})),K=R.filter(ee.isCollaboratorShare),z=R.filter(ee.isLinkShare),M=Object.values(s.graphRoles);if(y.value=(F==null?void 0:F.map(De=>{var Z;return{...De,icon:(Z=M.find(xe=>xe.id===De.id))==null?void 0:Z.icon}}))||[],c.isAppEnabled("open-cloud-mesh")){const{allowedRoles:De}=yield*ee.call(Re.listPermissions(H,J.fileId,s.graphRoles,{filter:`@libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition, '@Subject.UserType=="Federated"'))`,select:[cv.LibreGraphPermissionsRolesAllowedValues]},{signal:oe}));E.value=(De==null?void 0:De.map(Z=>{var xe;return{...Z,icon:(xe=M.find(Me=>Me.id===Z.id))==null?void 0:xe.icon}}))||[]}!p(ae)&&!p(_)&&(ne.forEach(De=>{K.some(Z=>Z.id===De.id)||K.push({...De,indirect:!0})}),se.forEach(De=>{z.some(Z=>Z.id===De.id)||z.push({...De,indirect:!0})})),Ct(t,"files-common-search")&&(yield d.loadAncestorMetaData({folder:p(J),space:p(e.space),client:n.webdav,signal:oe}));const ge=[...ne,...se].map(({resourceId:De})=>De),_e=Object.values(d.ancestorMetaData).filter(({id:De,path:Z})=>De===J.id||ge.includes(De)||ee.isIncomingShareResource(J)?!1:ee.isPersonalSpaceResource(e.space)?Z!=="/":!0).map(({id:De})=>De);p(ae)&&ee.isProjectSpaceResource(e.space)&&!ee.isProjectSpaceResource(J)&&_e.push(e.space.id);const Le=new Fr({concurrency:a.options.concurrentRequests.shares.list}),ke=[...new Set(_e)].map(De=>Le.add(()=>n.graphAuthenticated.permissions.listPermissions(H,De,s.graphRoles,{},{signal:oe}).then(Z=>{const xe=Z.shares.map(Me=>({...Me,indirect:!0}));K.push(...xe.filter(ee.isCollaboratorShare)),z.push(...xe.filter(ee.isLinkShare))})));yield Promise.allSettled(ke),s.setCollaboratorShares(K),s.setLinkShares(z),s.setLoading(!1)}).restartable();St(()=>[...p(h).items,e.isOpen],async()=>{var J;if(((J=p(h).items)==null?void 0:J.length)!==1)return;if(!e.isOpen){w.value=[];return}const oe=p(h).items[0];if(ue.isRunning&&ue.cancelAll(),!!l({space:e.space,resource:oe}))try{await ue.perform(oe)}catch(ne){console.error(ne)}},{immediate:!0,deep:!0});const ce=B(()=>p(h).items.map(oe=>oe.id));return St(()=>[ce,e.isOpen],async()=>{var J,ne;if(!e.isOpen||!((J=p(h).items)!=null&&J.length)){s.pruneShares(),m.value=null;return}if(((ne=p(h).items)==null?void 0:ne.length)!==1)return;const oe=p(h).items[0];if(g.value=!0,ee.isProjectSpaceResource(oe)&&await i.loadGraphPermissions({ids:[oe.id],graphClient:n.graphAuthenticated}),u({space:e.space,resource:oe}))try{te.isRunning&&te.cancelAll(),te.perform(oe)}catch(se){console.error(se)}if(!p(G)){m.value=oe,g.value=!1;return}try{const se=await n.webdav.getFileInfo(e.space,{path:oe.path}),Re={...se,...oe,tags:se.tags};m.value=Re}catch(se){m.value=oe,console.error(se)}g.value=!1},{deep:!0,immediate:!0}),Ti("resource",fr(m)),Ti("versions",fr(w)),Ti("space",B(()=>e.space)),Ti("activePanel",B(()=>e.activePanel)),Ti("availableInternalShareRoles",fr(y)),Ti("availableExternalShareRoles",fr(E)),{loadedResource:m,setActiveSideBarPanel:N,closeSideBar:D,panelContext:h,availablePanels:ye,isFileHeaderVisible:x,isSpaceHeaderVisible:V,isLoading:v,loadSharesTask:te}}});function $N(e,t,n,r,o,i){const s=pe("file-info"),a=pe("space-info"),c=pe("InnerSideBar");return e.isOpen?(X(),Ae(c,Gt({key:0,ref:"sidebar",class:"files-side-bar","is-open":e.isOpen,"active-panel":e.activePanel,"available-panels":e.availablePanels,"panel-context":e.panelContext,loading:e.isLoading},e.$attrs,{"data-custom-key-bindings-disabled":"true",onSelectPanel:e.setActiveSideBarPanel,onClose:e.closeSideBar}),{rootHeader:Se(()=>[e.isFileHeaderVisible?(X(),Ae(s,{key:0,class:"sidebar-panel__file_info","is-sub-panel-active":!1})):e.isSpaceHeaderVisible?(X(),Ae(a,{key:1,class:"sidebar-panel__space_info"})):Ce("",!0)]),subHeader:Se(()=>[e.isFileHeaderVisible?(X(),Ae(s,{key:0,class:"sidebar-panel__file_info","is-sub-panel-active":!0})):e.isSpaceHeaderVisible?(X(),Ae(a,{key:1,class:"sidebar-panel__space_info"})):Ce("",!0)]),_:1},16,["is-open","active-panel","available-panels","panel-context","loading","onSelectPanel","onClose"])):Ce("",!0)}const g0=ze(NN,[["render",$N]]),DN=Ne({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=le(),t=le(!0);return{confirmDisabled:t,onDateChanged:({date:r,error:o})=>{t.value=o||!r,e.value=r},dateTime:e}}}),LN={class:"link-modal-actions oc-flex oc-flex-right oc-flex-middle oc-mt-s"};function MN(e,t,n,r,o,i){const s=pe("oc-datepicker"),a=pe("oc-button");return X(),de(qe,null,[he(s,{label:e.$gettext("Expiration date"),type:"date","min-date":e.minDate,"current-date":e.currentDate,"is-clearable":e.isClearable,"required-mark":"",onDateChanged:e.onDateChanged},null,8,["label","min-date","current-date","is-clearable","onDateChanged"]),fe("div",LN,[he(a,{class:"oc-modal-body-actions-cancel oc-ml-s",onClick:t[0]||(t[0]=c=>e.$emit("cancel"))},{default:Se(()=>[Ot(W.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),he(a,{disabled:e.confirmDisabled,class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",onClick:t[1]||(t[1]=c=>e.$emit("confirm",e.dateTime))},{default:Se(()=>[Ot(W.toDisplayString(e.$gettext("Confirm")),1)]),_:1},8,["disabled"])])],64)}const BN=ze(DN,[["render",MN]]),jN=Ne({name:"UnsavedChangesModal",props:{modal:{type:Object,required:!0},closeCallback:{type:Function,required:!0}},emits:["cancel","confirm"],setup(e){const{removeModal:t}=pt();return{onClose:()=>{t(e.modal.id),e.closeCallback()}}}}),UN=["textContent"],qN={class:"oc-flex oc-flex-right oc-flex-middle oc-mt-m"},VN={class:"oc-modal-body-actions-grid"};function zN(e,t,n,r,o,i){const s=pe("oc-button");return X(),de(qe,null,[fe("span",{class:"oc-display-inline-block oc-mb-m",textContent:W.toDisplayString(e.$gettext("Your changes were not saved. Do you want to save them?"))},null,8,UN),t[2]||(t[2]=fe("div",{class:"oc-my-m"},null,-1)),fe("div",qN,[fe("div",VN,[he(s,{class:"oc-modal-body-actions-cancel oc-ml-s",onClick:t[0]||(t[0]=a=>e.$emit("cancel"))},{default:Se(()=>[Ot(W.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),he(s,{class:"oc-modal-body-actions-secondary oc-ml-s",onClick:e.onClose},{default:Se(()=>[Ot(W.toDisplayString(e.$gettext("Don't Save")),1)]),_:1},8,["onClick"]),he(s,{class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",onClick:t[1]||(t[1]=a=>e.$emit("confirm"))},{default:Se(()=>[Ot(W.toDisplayString(e.$gettext("Save")),1)]),_:1})])])],64)}const m0=ze(jN,[["render",zN]]);var WN=/\s/;function HN(e){for(var t=e.length;t--&&WN.test(e.charAt(t)););return t}var GN=/^\s+/;function KN(e){return e&&e.slice(0,HN(e)+1).replace(GN,"")}var y0=NaN,QN=/^[-+]0x[0-9a-f]+$/i,XN=/^0b[01]+$/i,YN=/^0o[0-7]+$/i,JN=parseInt;function ZN(e){if(typeof e=="number")return e;if(ws(e))return y0;if(er(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=er(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=KN(e);var n=XN.test(e);return n||YN.test(e)?JN(e.slice(2),n?2:8):QN.test(e)?y0:+e}const e$=Ne({name:"AppWrapper",components:{AppTopBar:f0,FileSideBar:g0,ErrorScreen:fN,LoadingScreen:mN},props:{applicationId:{type:String,required:!0},urlForResourceOptions:{type:Object,default:()=>null,required:!1},fileContentOptions:{type:Object,default:()=>null,required:!1},wrappedComponent:{type:Object,default:null},importResourceWithExtension:{type:Function,default:()=>null},disableAutoSave:{type:Boolean,default:!1}},setup(e){const{$gettext:t,current:n}=Fe.useGettext(),r=ir(),{showMessage:o,showErrorMessage:i}=tt(),s=Mo.useRouter(),a=Kt(),c=He(),u=fn(),{getResourceContext:l}=r0(),{selectedResources:d}=td(),{dispatchModal:f}=pt(),m=ct(),w=st(),y=Qe(),E=Er(),b=li(),{actions:g}=Uv({appId:e.applicationId}),{actions:v}=Lf(),{actions:h}=Fo(),{actions:S}=qf(),{actions:T}=Vf(),{actions:I}=Po(),_=B(()=>{var $e;return!!(($e=e.wrappedComponent.emits)!=null&&$e.includes("update:resource"))}),A=le(),$=le(),D=le(""),N=le(""),x=le(!p(_)),V=le(),G=le(!1),ae=le(),ye=le();let ue="",te=null;const{actions:ce}=Vv({content:ye}),oe=B(()=>{var $e;return!!(($e=e.wrappedComponent.emits)!=null&&$e.includes("update:currentContent"))}),J=$e=>!!Object.keys(e.wrappedComponent.props).includes($e),ne=B(()=>p(ye)!==p(ae)),se=$e=>{$e.preventDefault()};St(ne,$e=>{$e?window.addEventListener("beforeunload",se):window.removeEventListener("beforeunload",se)});const{applicationConfig:Re,closeApp:H,currentFileContext:R,getFileContents:F,getFileInfo:K,getUrlForResource:z,putFileContents:M,replaceInvalidFileRoute:q,revokeUrl:ge,activeFiles:_e,loadFolderForFileContext:Le,isFolderLoading:ke}=wv({applicationId:e.applicationId}),{applicationMeta:Pe}=xf({applicationId:e.applicationId,appsStore:r}),De=B(()=>{var $e;return($e=p(Pe).meta)==null?void 0:$e.fileSizeLimit}),Z=B(()=>{const{name:$e}=p(Pe);return t("%{appName} for %{fileName}",{appName:t($e),fileName:p(p(R).fileName)})}),xe=ea("driveAliasAndItem"),Me=an("fileId"),Ge=B(()=>Rt(p(Me))),et=async()=>{const $e=p(Ge),{space:Je,path:at}=await l($e),Un=Je.getDriveAliasAndItem({path:at});return ee.isPersonalSpaceResource(Je)?s.push({params:{...p(a).params,driveAliasAndItem:Un},query:{...p(a).query,fileId:$e,contextRouteName:"files-spaces-generic",contextRouteParams:{driveAliasAndItem:dt.dirname(Un)}}}):s.push({params:{...p(a).params,driveAliasAndItem:Un},query:{...p(a).query,fileId:$e,contextRouteName:at==="/"?"files-shares-with-me":"files-spaces-generic",...ee.isShareSpaceResource(Je)&&{shareId:Je.id},contextRouteParams:{driveAliasAndItem:dt.dirname(Un)},contextRouteQuery:{...ee.isShareSpaceResource(Je)&&{shareId:Je.id}}}})},Nt=pn.useTask(function*($e){try{p(xe)||(yield et()),$.value=p(p(R).space);const Je=yield K(p(R),{signal:$e});if(A.value=Je,ee.isShareSpaceResource(p($))&&(p(A).remoteItemId=p($).id,p(A).id===p(A).remoteItemId)){const at=yield*ee.call(vs({graphClient:c.graphAuthenticated,spacesStore:m,space:p($)}));at&&(A.value={...Je,...ee.buildIncomingShareResource({graphRoles:E.graphRoles,driveItem:at,serverUrl:w.serverUrl}),tags:Je.tags})}y.initResourceList({currentFolder:null,resources:[p(A)]}),d.value=[p(A)]}catch(Je){console.error(Je),V.value=Je,x.value=!1}}).restartable(),_t=pn.useTask(function*($e){try{const Je=e.importResourceWithExtension(p(A));if(Je){const at=qt.DateTime.local().toFormat("yyyyMMddHHmmss"),Un=`${p(A).name}_${at}.${Je}`;if(!(yield c.webdav.copyFiles(p($),p(A),p($),{path:Un},{signal:$e})))throw new Error(t("Importing failed"));A.value={path:Un}}if(q(R,p(A)))return;if(G.value=![On.Updateable,On.FileUpdateable].some(at=>(p(A).permissions||"").indexOf(at)>-1),p(J("currentContent"))){const at=yield*ee.call(F(R,{...e.fileContentOptions,signal:$e}));ae.value=ye.value=at.body,D.value=at.headers["OC-ETag"]}p(J("url"))&&(N.value=yield z(p($),p(A),{...e.urlForResourceOptions,signal:$e}))}catch(Je){console.error(Je),V.value=Je}finally{x.value=!1}}).restartable();St(R,async()=>{p(_)||(await Nt.perform(),p(De)&&ZN(p(A).size)>p(De)?f({title:t("File exceeds %{threshold}",{threshold:Tn(p(De),n)}),message:t("%{resource} exceeds the recommended size of %{threshold} for editing, and may cause performance issues.",{resource:p(A).name,threshold:Tn(p(De),n)}),confirmText:t("Continue"),onCancel:()=>{H()},onConfirm:()=>{_t.perform()}}):_t.perform())},{immediate:!0});const $t=$e=>{console.error($e),i({title:t("An error occurred"),desc:$e.message,errors:[$e]})},Be=()=>{o({title:t("File autosaved")})},Ve=pn.useTask(function*(){const $e=p(ye);try{const Je=yield M(R,{content:$e,previousEntityTag:p(D)});ae.value=$e,D.value=Je.etag,y.upsertResource(Je)}catch(Je){switch(Je.statusCode){case 401:case 403:$t(new ee.HttpError(t("You're not authorized to save this file"),Je.response));break;case 409:case 412:$t(new ee.HttpError(t("This file was updated outside this window. Please refresh the page (all changes will be lost)."),Je.response));break;case 507:const at=m.spaces.find(Un=>Un.id===p(A).storageId&&ee.isProjectSpaceResource(Un));if(at){$t(new ee.HttpError(t('Insufficient quota on "%{spaceName}" to save this file',{spaceName:at.name}),Je.response));break}$t(new ee.HttpError(t("Insufficient quota for saving this file"),Je.response));break;default:$t(new ee.HttpError("",Je.response))}}}).drop(),dn=async()=>{await Ve.perform()},j=B(()=>!e.disableAutoSave);let C=null;Bt(()=>{var Je;if(ue=b.subscribe("runtime.resource.deleted",Te),(Je=y.ancestorMetaData)!=null&&Je["/"]&&p($)&&y.ancestorMetaData["/"].spaceId!==p($).id&&y.setAncestorMetaData({}),!p(oe))return;const $e=w.options.editor;$e.autosaveEnabled&&!e.disableAutoSave&&(C=setInterval(async()=>{ne.value&&(await dn(),Be())},($e.autosaveInterval||120)*1e3))}),Vn(()=>{b.unsubscribe("runtime.resource.deleted",ue),u.isLoading||window.removeEventListener("beforeunload",se),p(J("url"))&&ge(N.value),p(oe)&&(clearInterval(C),C=null)});const{bindKeyAction:O}=Xf({skipDisabledKeyBindingsCheck:!0});O({modifier:Qf.Ctrl,primary:Ir.S},()=>{p(ne)&&dn()});const Q=B(()=>[{name:"save-file",disabledTooltip:()=>"",isVisible:()=>p(oe),isDisabled:()=>G.value||!ne.value,icon:"save",id:"app-save-action",label:()=>t("Save"),handler:dn}]),re=B(()=>({space:p($),resources:[p(A)]})),me=async($e,Je)=>{p(ne)&&(await dn(),Be()),Je($e)},Te=$e=>{if($e.find(at=>at.id===p(A).id)){if(te)return te();H()}},Ye=B(()=>[...p(g),...p(Q),...p(ce).map($e=>({...$e,isVisible:Je=>oe.value&&$e.isVisible(Je)}))].filter($e=>$e.isVisible(p(re)))),ut=B(()=>[...p(T),...p(v)].filter($e=>$e.isVisible(p(re)))),ft=B(()=>[...p(h).map($e=>({...$e,handler:Je=>me(Je,$e.handler)})),...p(I)].filter($e=>$e.isVisible(p(re)))),bt=B(()=>[...p(S)].filter($e=>$e.isVisible(p(re)))),it=B(()=>{const $e=[];return p(Ye).length&&$e.push({name:"context",items:p(Ye)}),p(ut).length&&$e.push({name:"share",items:p(ut)}),p(ft).length&&$e.push({name:"actions",items:p(ft)}),p(bt).length&&$e.push({name:"sidebar",items:p(bt)}),$e}),Vi=B(()=>[...p(Q)]);Mo.onBeforeRouteLeave(($e,Je,at)=>{p(ne)?f({title:t("Unsaved changes"),customComponent:m0,focusTrapInitial:".oc-modal-body-actions-confirm",hideActions:!0,customComponentAttrs:()=>({closeCallback:()=>{at()}}),async onConfirm(){await dn(),at()}}):at()});const jn=B(()=>({url:p(N),space:p(p(R).space),resource:p(A),activeFiles:p(_e),isDirty:p(ne),isReadOnly:p(G),applicationConfig:p(Re),currentFileContext:p(R),currentContent:p(ye),isFolderLoading:p(ke),"onUpdate:resource":$e=>{$.value=p(p(R).space),A.value={...$e,...ee.isShareSpaceResource(p($))&&{remoteItemId:p($).id}},d.value=[p(A)]},"onUpdate:currentContent":$e=>{ye.value=$e},"onRegister:onDeleteResourceCallback":$e=>{te=$e},"onDelete:resource":()=>{p(I)[0].isVisible({space:p($),resources:[p(A)]})&&p(I)[0].handler({space:p($),resources:[p(A)]})},onSave:dn,onClose:H,loadFolderForFileContext:Le,revokeUrl:ge,getUrlForResource:z}));return{...kb(),dropDownMenuSections:it,dropDownActionOptions:re,hasAutoSave:j,isEditor:oe,closeApp:H,fileActions:Vi,loading:x,loadingError:V,pageTitle:Z,resource:A,space:$,slotAttrs:jn}}}),t$=["id"],n$=["textContent"];function r$(e,t,n,r,o,i){const s=pe("app-top-bar"),a=pe("loading-screen"),c=pe("error-screen"),u=pe("file-side-bar");return X(),de("main",{id:e.applicationId,class:"app-wrapper oc-height-1-1",onKeydown:t[0]||(t[0]=no((...l)=>e.closeApp&&e.closeApp(...l),["esc"]))},[fe("h1",{class:"oc-invisible-sr",textContent:W.toDisplayString(e.pageTitle)},null,8,n$),!e.loading&&!e.loadingError&&e.resource?(X(),Ae(s,{key:0,"main-actions":e.fileActions,"drop-down-menu-sections":e.dropDownMenuSections,"drop-down-action-options":e.dropDownActionOptions,"has-auto-save":e.hasAutoSave,"is-editor":e.isEditor,resource:e.resource,onClose:e.closeApp},null,8,["main-actions","drop-down-menu-sections","drop-down-action-options","has-auto-save","is-editor","resource","onClose"])):Ce("",!0),e.loading?(X(),Ae(a,{key:1})):e.loadingError?(X(),Ae(c,{key:2,message:e.loadingError.message},null,8,["message"])):(X(),de("div",{key:3,class:W.normalizeClass(["oc-flex oc-width-1-1 oc-height-1-1",{"app-sidebar-open":e.isSideBarOpen}])},[Xe(e.$slots,"default",Gt({class:"app-wrapper-content oc-height-1-1"},e.slotAttrs)),he(u,{"is-open":e.isSideBarOpen,"active-panel":e.sideBarActivePanel,space:e.space},null,8,["is-open","active-panel","space"])],2))],40,t$)}const b0=ze(e$,[["render",r$]]);function i$(e,t){return Ne({render(){return al(b0,{wrappedComponent:e,...t},{default:n=>al(e,n)})}})}const o$=Ne({name:"ContextMenuQuickAction",props:{item:{type:Object,required:!0},resourceDomSelector:{type:Function,required:!1,default:e=>ee.extractDomSelector(e.id)}},emits:["quickActionClicked"],setup(){const{$gettext:e}=Fe.useGettext(),t=B(()=>e("Show context menu")),n=le(!1);return{contextMenuLabel:t,isOpen:n}}});function s$(e,t,n,r,o,i){const s=pe("oc-icon"),a=pe("oc-drop"),c=pe("oc-button"),u=ln("oc-tooltip");return ot((X(),Ae(c,{id:`context-menu-trigger-${e.resourceDomSelector(e.item)}`,"aria-label":e.contextMenuLabel,appearance:"raw",class:"quick-action-button oc-ml-xs oc-p-xs",onClick:t[2]||(t[2]=Cn(l=>e.$emit("quickActionClicked",{event:l,dropdown:e.$refs[`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`]}),["stop","prevent"]))},{default:Se(()=>[he(s,{name:"more-2"}),he(a,{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)}`,position:"bottom-end",mode:"click","padding-size":"small","close-on-click":"",onShowDrop:t[0]||(t[0]=l=>e.isOpen=!0),onHideDrop:t[1]||(t[1]=l=>e.isOpen=!1)},{default:Se(()=>[Xe(e.$slots,"contextMenu",{item:e.item,isOpen:e.isOpen})]),_:3},8,["drop-id","toggle"])]),_:3},8,["id","aria-label"])),[[u,e.contextMenuLabel]])}const rd=ze(o$,[["render",s$]]),a$=Ne({name:"ResourceGhostElement",components:{ResourceIcon:Oo},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}}}),l$={id:"ghost-element",class:"ghost-element"},c$={class:"ghost-element-layer1 oc-rounded"},u$={key:0,class:"ghost-element-layer2 oc-rounded"},f$={key:1,class:"ghost-element-layer3 oc-rounded"},d$={class:"badge"};function p$(e,t,n,r,o,i){const s=pe("resource-icon");return X(),de("div",l$,[fe("div",c$,[he(s,{class:"oc-p-xs",resource:e.previewItems[0]},null,8,["resource"]),e.showSecondLayer?(X(),de("div",u$)):Ce("",!0),e.showThirdLayer?(X(),de("div",f$)):Ce("",!0)]),fe("span",d$,W.toDisplayString(e.itemCount),1)])}const id=ze(a$,[["render",p$]]),h$=Ne({name:"ResourceSize",props:{size:{type:[String,Number],required:!0}},setup:e=>{const{current:t}=Fe.useGettext();return{formattedSize:B(()=>Tn(e.size,t))}}}),g$=["textContent"];function m$(e,t,n,r,o,i){return X(),de("span",{class:"oc-resource-size",textContent:W.toDisplayString(e.formattedSize)},null,8,g$)}const v0=ze(h$,[["render",m$]]),xo={};function y$(e){return e.getIsPending!==void 0}function b$(e){if(y$(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 v$(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 w$(e){return Object.keys(e).reduce((t,n)=>(e[n]!==!1&&e[n]!==null&&e[n]!==void 0&&(t[n]=e[n]),t),{})}function S$(e,t){const{class:n,style:r,...o}=v$(e),{class:i,style:s,...a}=w$(t);return{class:[n,i],style:[r,s],...o,...a}}const w0=Ne({inheritAttrs:!1,__name:"InlineSvg",props:{src:{},title:{default:void 0},transformSource:{type:Function,default:e=>e},keepDuringLoading:{type:Boolean,default:!0},uniqueIds:{type:[Boolean,String],default:!1},uniqueIdsBase:{default:""}},emits:["loaded","unloaded","error"],setup(e,{expose:t,emit:n}){const r=e,o=n,i=lp(),s=le(),a=le(),c=le(),u=Math.random().toString(36).substring(2);t({svgElSource:s,request:c}),St(()=>r.src,E=>{d(E)}),d(r.src);function l(E){if(E=E.cloneNode(!0),r.uniqueIds){const b=typeof r.uniqueIds=="string"?r.uniqueIds:u;E=y(E,b,r.uniqueIdsBase)}return E=r.transformSource(E),r.title&&w(E,r.title),E.innerHTML}function d(E){xo[E]||(xo[E]=f(E)),s.value&&xo[E].getIsPending()&&!r.keepDuringLoading&&(s.value=null,o("unloaded")),xo[E].then(b=>{s.value=b,_n(()=>{o("loaded",a.value)})}).catch(b=>{s.value&&(s.value=void 0,o("unloaded")),delete xo[E],o("error",b)})}function f(E){return b$(new Promise((b,g)=>{const v=new XMLHttpRequest;v.open("GET",E,!0),c.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?b(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?al("svg",{...S$(s.value,i),innerHTML:l(s.value),ref:a}):null;function w(E,b){const g=E.getElementsByTagName("title");if(g.length)g[0].textContent=b;else{const v=document.createElementNS("http://www.w3.org/2000/svg","title");v.textContent=b,E.insertBefore(v,E.firstChild)}}function y(E,b,g=""){const v=["id","href","xlink:href","xlink:role","xlink:arcrole"],h=["href","xlink:href"],S=(T,I)=>h.includes(T)&&(I?!I.includes("#"):!1);return[...E.children].forEach(T=>{var I;if((I=T.attributes)!=null&&I.length){const _=Object.values(T.attributes).map(A=>{const $=/url\((.*?)\)/.exec(A.value);return $!=null&&$[1]&&(A.value=A.value.replace($[0],`url(${g}${$[1]}_${b})`)),A});v.forEach(A=>{const $=_.find(D=>D.name===A);$&&!S(A,$.value)&&($.value=`${$.value}_${b}`)})}return T.children.length?y(T,b,g):T}),E}return(E,b)=>(X(),Ae(m))}}),S0=Ne({__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}){w0.name="inline-svg";const n=t,r=B(()=>Xs("oc-icon-title-")),o=B(()=>{const c=`${ZP()}icons/`,u=e.fillType.toLowerCase();return u==="none"?`${c}${e.name}.svg`:`${c}${e.name}-${u}.svg`}),i=c=>s(Mr(c)),s=c=>{if(c!==null)return`oc-icon-${c}`},a=c=>{if(e.accessibleLabel!==""){const u=document.createElement("title");u.setAttribute("id",r.value),u.appendChild(document.createTextNode(e.accessibleLabel)),c.insertBefore(u,c.firstChild)}return c};return(c,u)=>(X(),Ae(Nr(c.type),{class:W.normalizeClass([{"oc-button-reset":c.type==="button"},"oc-icon",i(c.size)])},{default:Se(()=>[he(p(w0),{src:o.value,"transform-source":a,"aria-hidden":c.accessibleLabel===""?"true":null,"aria-labelledby":c.accessibleLabel===""?null:r.value,focusable:c.accessibleLabel===""?"false":null,style:W.normalizeStyle(c.color!==""?{fill:c.color}:{}),onLoaded:u[0]||(u[0]=l=>n("loaded"))},null,8,["src","aria-hidden","aria-labelledby","focusable","style"])]),_:1},8,["class"]))}}),E0=Ne({__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(()=>{const a=["oc-button","oc-rounded",`oc-button-${Mr(e.size)}`,`oc-button-justify-content-${e.justifyContent}`,`oc-button-gap-${Mr(e.gapSize)}`,`oc-button-${It.kebabCase(e.colorRole)}`,`oc-button-${e.appearance}`,`oc-button-${It.kebabCase(e.colorRole)}-${e.appearance}`];return e.noHover&&a.push("no-hover"),a}),o=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:s}})),s=a=>{n("click",a)};return(a,c)=>{const u=pe("oc-spinner");return X(),Ae(Nr(a.type),Gt(o.value,{"aria-label":a.ariaLabel,class:r.value},Za(i.value)),{default:Se(()=>[a.showSpinner?(X(),Ae(u,{key:0,size:"small",class:"spinner"})):Ce("",!0),Xe(a.$slots,"default")]),_:3},16,["aria-label","class"])}}});/*!
50
+ `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}n.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)},n.prototype.j2x=function(a,l,u){let c="",d="";const f=u.join(".");for(let m in a)if(Object.prototype.hasOwnProperty.call(a,m))if(typeof a[m]>"u")this.isAttribute(m)&&(d+="");else if(a[m]===null)this.isAttribute(m)||m===this.options.cdataPropName?d+="":m[0]==="?"?d+=this.indentate(l)+"<"+m+"?"+this.tagEndChar:d+=this.indentate(l)+"<"+m+"/"+this.tagEndChar;else if(a[m]instanceof Date)d+=this.buildTextValNode(a[m],m,"",l);else if(typeof a[m]!="object"){const w=this.isAttribute(m);if(w&&!this.ignoreAttributesFn(w,f))c+=this.buildAttrPairStr(w,""+a[m]);else if(!w)if(m===this.options.textNodeName){let v=this.options.tagValueProcessor(m,""+a[m]);d+=this.replaceEntitiesValue(v)}else d+=this.buildTextValNode(a[m],m,"",l)}else if(Array.isArray(a[m])){const w=a[m].length;let v="",E="";for(let b=0;b<w;b++){const g=a[m][b];if(!(typeof g>"u"))if(g===null)m[0]==="?"?d+=this.indentate(l)+"<"+m+"?"+this.tagEndChar:d+=this.indentate(l)+"<"+m+"/"+this.tagEndChar;else if(typeof g=="object")if(this.options.oneListGroup){const y=this.j2x(g,l+1,u.concat(m));v+=y.val,this.options.attributesGroupName&&g.hasOwnProperty(this.options.attributesGroupName)&&(E+=y.attrStr)}else v+=this.processTextOrObjNode(g,m,l,u);else if(this.options.oneListGroup){let y=this.options.tagValueProcessor(m,g);y=this.replaceEntitiesValue(y),v+=y}else v+=this.buildTextValNode(g,m,"",l)}this.options.oneListGroup&&(v=this.buildObjectNode(v,m,E,l)),d+=v}else if(this.options.attributesGroupName&&m===this.options.attributesGroupName){const w=Object.keys(a[m]),v=w.length;for(let E=0;E<v;E++)c+=this.buildAttrPairStr(w[E],""+a[m][w[E]])}else d+=this.processTextOrObjNode(a[m],m,l,u);return{attrStr:c,val:d}},n.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 d=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,d.attrStr,u):this.buildObjectNode(d.val,l,d.attrStr,u)}n.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 d="</"+l+this.tagEndChar,f="";return l[0]==="?"&&(f="?",d=""),(u||u==="")&&a.indexOf("<")===-1?this.indentate(c)+"<"+l+u+f+">"+a+d:this.options.commentPropName!==!1&&l===this.options.commentPropName&&f.length===0?this.indentate(c)+`<!--${a}-->`+this.newLine:this.indentate(c)+"<"+l+u+f+this.tagEndChar+a+this.indentate(c)+d}},n.prototype.closeTag=function(a){let l="";return this.options.unpairedTags.indexOf(a)!==-1?this.options.suppressUnpairedNode||(l="/"):this.options.suppressEmptyNode?l="/":l=`></${a}`,l},n.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 d=this.options.tagValueProcessor(l,a);return d=this.replaceEntitiesValue(d),d===""?this.indentate(c)+"<"+l+u+this.closeTag(l)+this.tagEndChar:this.indentate(c)+"<"+l+u+">"+d+"</"+l+this.tagEndChar}},n.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 Ff=n,Ff}var xf,kv;function w_(){if(kv)return xf;kv=1;const e=bv(),t=y_(),r=b_();return xf={XMLParser:t,XMLValidator:e,XMLBuilder:r},xf}w_();class Fv{isEnabled(){return!0}isActive(t){return gr(t,"files-trash-generic")}getTask(t){const{resourcesStore:r,spacesStore:n,clientService:{webdav:i,graphAuthenticated:o}}=t;return or.useTask(function*(s,a,l){r.clearResourceList(),r.setAncestorMetaData({});const{resource:u,children:c}=yield i.listFiles(l,{},{depth:1,davProperties:js.Trashbin,isTrash:!0,signal:s});te.isProjectSpaceResource(l)&&(yield n.loadGraphPermissions({ids:[l.id],graphClient:o})),r.initResourceList({currentFolder:u,resources:c})})}}class xv{loaders;constructor(){this.loaders=[new xm,new Nm,new Dm,new $m,new Lm,new Fv]}getTask(){const t=bt(),r=ut(),n=er(),i=He(),o=Ge(),s=ct(),a=Ke(),l=En(),u=Kf(),c=this.loaders.find(d=>d.isEnabled()&&d.isActive(h(i)));if(!c){console.debug("No folder loader found for route");return}return or.useTask(function*(...d){const f={clientService:o,configStore:s,userStore:t,spacesStore:r,capabilityStore:n,resourcesStore:a,sharesStore:l,router:i,authService:u};try{yield c.getTask(f).perform(...d)}catch(m){console.error(m)}})}}const Nv=new xv;var $n=(e=>(e.add="loading-service.add",e.remove="loading-service.remove",e.setProgress="loading-service.set-progress",e))($n||{});const S_=200;class E_{tasks=[];get isLoading(){return this.tasks.some(t=>t.active)}get currentProgress(){if(this.tasks.some(n=>!n.state&&n.active))return null;const t=this.tasks.filter(n=>!!n.state&&n.active);if(!t.length)return null;const r=t.reduce((n,i)=>(n+=i.state.current/i.state.total,n),0);return Math.round(r/t.length*100)}addTask(t,{debounceTime:r=S_,indeterminate:n=!0}={}){const i={id:Xt.v4(),active:!1,...!n&&{state:{total:0,current:0}}};return this.tasks.length||window.addEventListener("beforeunload",this.onBeforeUnload),this.tasks.push(i),Ct.debounce(()=>{i.active=!0,ze.publish("loading-service.add")},r)(),t({setProgress:({total:a,current:l})=>{n||this.setProgress({task:i,total:a,current:l})}}).finally(()=>{this.removeTask(i.id)})}removeTask(t){this.tasks=this.tasks.filter(r=>r.id!==t),this.tasks.length||window.removeEventListener("beforeunload",this.onBeforeUnload),ze.publish("loading-service.remove")}setProgress({task:t,total:r,current:n}){t.state||(t.state={total:0,current:0}),t.state.total=r,t.state.current=n,ze.publish("loading-service.set-progress")}onBeforeUnload(t){t.preventDefault()}}var T_="__lodash_hash_undefined__";function A_(e){return this.__data__.set(e,T_),this}function R_(e){return this.__data__.has(e)}function na(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new vn;++t<r;)this.add(e[t])}na.prototype.add=na.prototype.push=A_,na.prototype.has=R_;function C_(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function I_(e,t){return e.has(t)}var __=1,O_=2;function Dv(e,t,r,n,i,o){var s=r&__,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 d=-1,f=!0,m=r&O_?new na:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var w=e[d],v=t[d];if(n)var E=s?n(v,w,d,t,e,o):n(w,v,d,e,t,o);if(E!==void 0){if(E)continue;f=!1;break}if(m){if(!C_(t,function(b,g){if(!I_(m,g)&&(w===b||i(w,b,r,n,o)))return m.push(g)})){f=!1;break}}else if(!(w===v||i(w,v,r,n,o))){f=!1;break}}return o.delete(e),o.delete(t),f}function P_(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function k_(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var F_=1,x_=2,N_="[object Boolean]",D_="[object Date]",$_="[object Error]",L_="[object Map]",M_="[object Number]",B_="[object RegExp]",j_="[object Set]",U_="[object String]",q_="[object Symbol]",V_="[object ArrayBuffer]",z_="[object DataView]",$v=Or?Or.prototype:void 0,Nf=$v?$v.valueOf:void 0;function W_(e,t,r,n,i,o,s){switch(r){case z_:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case V_:return!(e.byteLength!=t.byteLength||!o(new Ps(e),new Ps(t)));case N_:case D_:case M_:return so(+e,+t);case $_:return e.name==t.name&&e.message==t.message;case B_:case U_:return e==t+"";case L_:var a=P_;case j_:var l=n&F_;if(a||(a=k_),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;n|=x_,s.set(e,t);var c=Dv(a(e),a(t),n,i,o,s);return s.delete(e),c;case q_:if(Nf)return Nf.call(e)==Nf.call(t)}return!1}function Df(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Lv(e,t,r){var n=t(e);return Vr(e)?n:Df(n,r(e))}function H_(e,t){for(var r=-1,n=e==null?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}function Mv(){return[]}var G_=Object.prototype,K_=G_.propertyIsEnumerable,Bv=Object.getOwnPropertySymbols,jv=Bv?function(e){return e==null?[]:(e=Object(e),H_(Bv(e),function(t){return K_.call(e,t)}))}:Mv,Q_=xh(Object.keys,Object),X_=Object.prototype,Y_=X_.hasOwnProperty;function J_(e){if(!Ll(e))return Q_(e);var t=[];for(var r in Object(e))Y_.call(e,r)&&r!="constructor"&&t.push(r);return t}function Z_(e){return Fs(e)?Hh(e):J_(e)}function Uv(e){return Lv(e,Z_,jv)}var eO=1,tO=Object.prototype,rO=tO.hasOwnProperty;function nO(e,t,r,n,i,o){var s=r&eO,a=Uv(e),l=a.length,u=Uv(t),c=u.length;if(l!=c&&!s)return!1;for(var d=l;d--;){var f=a[d];if(!(s?f in t:rO.call(t,f)))return!1}var m=o.get(e),w=o.get(t);if(m&&w)return m==t&&w==e;var v=!0;o.set(e,t),o.set(t,e);for(var E=s;++d<l;){f=a[d];var b=e[f],g=t[f];if(n)var y=s?n(g,b,f,t,e,o):n(b,g,f,e,t,o);if(!(y===void 0?b===g||i(b,g,r,n,o):y)){v=!1;break}E||(E=f=="constructor")}if(v&&!E){var p=e.constructor,S=t.constructor;p!=S&&"constructor"in e&&"constructor"in t&&!(typeof p=="function"&&p instanceof p&&typeof S=="function"&&S instanceof S)&&(v=!1)}return o.delete(e),o.delete(t),v}var $f=Kn(Yr,"DataView"),Lf=Kn(Yr,"Promise"),Mf=Kn(Yr,"Set"),Bf=Kn(Yr,"WeakMap"),qv="[object Map]",iO="[object Object]",Vv="[object Promise]",zv="[object Set]",Wv="[object WeakMap]",Hv="[object DataView]",oO=Gn($f),sO=Gn(lo),aO=Gn(Lf),lO=Gn(Mf),cO=Gn(Bf),zr=Hn;($f&&zr(new $f(new ArrayBuffer(1)))!=Hv||lo&&zr(new lo)!=qv||Lf&&zr(Lf.resolve())!=Vv||Mf&&zr(new Mf)!=zv||Bf&&zr(new Bf)!=Wv)&&(zr=function(e){var t=Hn(e),r=t==iO?e.constructor:void 0,n=r?Gn(r):"";if(n)switch(n){case oO:return Hv;case sO:return qv;case aO:return Vv;case lO:return zv;case cO:return Wv}return t});var uO=1,Gv="[object Arguments]",Kv="[object Array]",ia="[object Object]",fO=Object.prototype,Qv=fO.hasOwnProperty;function dO(e,t,r,n,i,o){var s=Vr(e),a=Vr(t),l=s?Kv:zr(e),u=a?Kv:zr(t);l=l==Gv?ia:l,u=u==Gv?ia:u;var c=l==ia,d=u==ia,f=l==u;if(f&&uo(e)){if(!uo(t))return!1;s=!0,c=!1}if(f&&!c)return o||(o=new Zr),s||Ul(e)?Dv(e,t,r,n,i,o):W_(e,t,l,r,n,i,o);if(!(r&uO)){var m=c&&Qv.call(e,"__wrapped__"),w=d&&Qv.call(t,"__wrapped__");if(m||w){var v=m?e.value():e,E=w?t.value():t;return o||(o=new Zr),i(v,E,r,n,o)}}return f?(o||(o=new Zr),nO(e,t,r,n,i,o)):!1}function Xv(e,t,r,n,i){return e===t?!0:e==null||t==null||!en(e)&&!en(t)?e!==e&&t!==t:dO(e,t,r,n,Xv,i)}function Yv(e,t){return Xv(e,t)}const jf=(e="")=>e.split("/").map(encodeURIComponent).join("/"),pO=e=>{const t=[],r=(n,i="")=>Object.keys(n).forEach(o=>{Ml(n[o])?r(n[o],`${i}${o}.`):t.push(`${i}${o}`)});return r(e),t};class hO{clientService;configStore;userStore;authStore;constructor({clientService:t,userStore:r,authStore:n,configStore:i}){this.clientService=t,this.userStore=r,this.authStore=n,this.configStore=i}get user(){return this.userStore.user}async loadPreview(t,r=!1,n=!0,i){const{space:o,resource:s}=t;if(!s.canDownload()||!s.hasPreview())return;const a=te.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,r,n,i)}catch(l){if(n)return;throw l}}}async cacheFactory(t,r,n){const{resource:i,dimensions:o}=t,s=mc.filePreview.get(i.id.toString());if(s&&s.etag===i.etag&&Yv(o,s.dimensions))return s.src;try{const a=await this.privatePreviewBlob(t,!1,!0,n);return mc.filePreview.set(i.id.toString(),{src:a,etag:i.etag,dimensions:o},0).src}catch(a){if(r)return;throw a}}buildQueryString(t){return SS.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,r=!1,n=!0,i){const{resource:o,dimensions:s,processor:a}=t;if(r)return this.cacheFactory(t,n,i);const l=[this.configStore.serverUrl,"remote.php/dav",jf(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(d=>setTimeout(d,c*1e3)),this.privatePreviewBlob(t,r,n,i)}throw u}}async publicPreviewUrl(t,r){const{resource:n,dimensions:i,processor:o}=t,[s,a]=n.downloadURL.split("?"),l=[this.buildQueryString({etag:n.etag,dimensions:i,processor:o}),a].filter(Boolean).join("&"),u=[s,l].filter(Boolean).join("?");try{const{status:c}=await this.clientService.httpUnAuthenticated.head(u,{signal:r});if(c!==404)return u}catch(c){if([425,429].includes(c.status)){const d=c.response?.headers?.["retry-after"]||5;return await new Promise(f=>setTimeout(f,d*1e3)),this.publicPreviewUrl(t,r)}throw c}}}const oa=Te.z.enum(["fit","resize","fill","thumbnail"]);class mO{$gettext;constructor({$gettext:t}){this.$gettext=t}explain(t,r){return{code:"mustNotBeEmpty",message:this.$gettext("Must not be empty"),format:[],...Ct.isBoolean(r)&&{verified:r}}}assert(t,r){return r.length>0}validate(){return!0}missing(t,r){return this.explain(t,this.assert(t,r))}}class gO{$gettext;constructor({$gettext:t}){this.$gettext=t}explain(t,r){return{code:"mustContain",helperMessage:this.$gettext("Valid special characters: %{characters}",{characters:t.characters},!0),message:this.$gettext("%{param1}+ special characters"),format:[t.minLength],...Ct.isBoolean(r)&&{verified:r}}}assert(t,r){return Array.from(r).filter(i=>t.characters.includes(i)).length>=t.minLength}validate(t){if(!Ct.isObject(t))throw new Error("options should be an object");if(!Ct.isNumber(t.minLength)||Ct.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");if(!Ct.isString(t.characters))throw new Error("characters should be a character sequence");return!0}missing(t,r){return this.explain(t,this.assert(t,r))}}class sa{$gettext;constructor({$gettext:t}){this.$gettext=t}assert(t,r){throw new Error("Method not implemented.")}explain(t,r){throw new Error("Method not implemented.")}validate(t){if(!Ct.isObject(t))throw new Error("options should be an object");if(!Ct.isNumber(t.minLength)||Ct.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");return!0}missing(t,r){return this.explain(t,this.assert(t,r))}}class yO extends sa{constructor(t){super(t)}explain(t,r){return{code:"atLeastCharacters",message:this.$gettext("%{param1}+ letters"),format:[t.minLength],...Ct.isBoolean(r)&&{verified:r}}}assert(t,r){return r.length>=t.minLength}}class vO extends sa{constructor(t){super(t)}explain(t,r){return{code:"atLeastUppercaseCharacters",message:this.$gettext("%{param1}+ uppercase letters"),format:[t.minLength],...Ct.isBoolean(r)&&{verified:r}}}assert(t,r){return(r||"").match(/[A-Z\xC0-\xD6\xD8-\xDE]/g)?.length>=t.minLength}}class bO extends sa{constructor(t){super(t)}explain(t,r){return{code:"atLeastLowercaseCharacters",message:this.$gettext("%{param1}+ lowercase letters"),format:[t.minLength],...Ct.isBoolean(r)&&{verified:r}}}assert(t,r){return(r||"").match(/[a-z\xDF-\xF6\xF8-\xFF]/g)?.length>=t.minLength}}class wO extends sa{constructor(t){super(t)}explain(t,r){return{code:"atLeastDigits",message:this.$gettext("%{param1}+ numbers"),format:[t.minLength],...Ct.isBoolean(r)&&{verified:r}}}assert(t,r){return(r||"").match(/\d/g)?.length>=t.minLength}}var Uf={},Jv;function SO(){if(Jv)return Uf;Jv=1;var e=function(o){return Math.floor(Math.random()*o)},t=function(o){var s="",a="",l=o.length,u=o.lowercase,c=o.uppercase,d=o.numbers,f=o.symbols,m=o.minLengthLowercase,w=o.minLengthUppercase,v=o.minLengthNumbers,E=o.minLengthSymbols,b=o.exclude,g="abcdefghijklmnopqrstuvwxyz";g=r(g,b);var y="ABCDEFGHIJKLMNOPQRSTUVWXYZ";y=r(y,b);var p="0123456789";p=r(p,b);var S="!#$%&'()*+,-./:;<=>?@[]^_{|}~";S=r(S,b);for(var T=g.length,R=0;R<m;R++)a+=g.charAt(e(T));for(T=y.length,R=0;R<w;R++)a+=y.charAt(e(T));for(T=p.length,R=0;R<v;R++)a+=p.charAt(e(T));for(T=S.length,R=0;R<E;R++)a+=S.charAt(e(T));s+=(function(D){for(var H=D.split(""),_=H.length-1;_>0;_--){var x=Math.floor(Math.random()*(_+1)),z=H[_];H[_]=H[x],H[x]=z}return H.join("")})(a);var I="";I=u?I+g:I,I=c?I+y:I,I=d?I+p:I,I=f?I+S:I;var A=l-s.length;for(T=I.length,R=0;R<A;R++)s+=I.charAt(e(T));return s},r=function(o,s){return s?.split("").forEach((function(a){o=o.replace(a,"")})),o},n=function(o){var s=o.length,a=o.lowercase,l=o.uppercase,u=o.numbers,c=o.symbols;if(o.minLengthLowercase+o.minLengthUppercase+o.minLengthNumbers+o.minLengthSymbols>s)throw new Error("Sum of Minimum Characters in the passwords greater than the length of the Password to be generated.");if(a==0&&l==0&&u==0&&c==0)throw new Error("Alphabets, Numbers and Symbols are all set to False. No valid Characters to generate the Password.")},i=function(o){return o.length=o.length===void 0?10:o.length,o.lowercase=o.lowercase===void 0||o.lowercase,o.uppercase=o.uppercase===void 0||o.uppercase,o.numbers=o.numbers===void 0||o.numbers,o.symbols=o.symbols!==void 0&&o.symbols,o.lowercase?o.minLengthLowercase=o.minLengthLowercase===void 0?1:o.minLengthLowercase:o.minLengthLowercase=0,o.uppercase?o.minLengthUppercase=o.minLengthUppercase===void 0?1:o.minLengthUppercase:o.minLengthUppercase=0,o.numbers?o.minLengthNumbers=o.minLengthNumbers===void 0?1:o.minLengthNumbers:o.minLengthNumbers=0,o.symbols?o.minLengthSymbols=o.minLengthSymbols===void 0?1:o.minLengthSymbols:o.minLengthSymbols=0,o.exclude=o.exclude===void 0?"":o.exclude,o};return Uf.GeneratePassword=function(o){return o?(o=i(o),n(o),t(o)):(o=i({length:10,lowercase:!0,uppercase:!0,numbers:!0,symbols:!1,exclude:"",minLengthLowercase:1,minLengthUppercase:1,minLengthNumbers:1,minLengthSymbols:0}),n(o),t(o))},Uf}var EO=SO();class TO{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 r={atLeastCharacters:new yO({...this.language}),mustNotBeEmpty:new mO({...this.language}),atLeastUppercaseCharacters:new vO({...this.language}),atLeastLowercaseCharacters:new bO({...this.language}),atLeastDigits:new wO({...this.language}),mustContain:new gO({...this.language})},n={};t&&!this.hasRules()&&(n.mustNotBeEmpty={}),this.capability.min_characters&&(n.atLeastCharacters={minLength:this.capability.min_characters}),this.capability.min_uppercase_characters&&(n.atLeastUppercaseCharacters={minLength:this.capability.min_uppercase_characters}),this.capability.min_lowercase_characters&&(n.atLeastLowercaseCharacters={minLength:this.capability.min_lowercase_characters}),this.capability.min_digits&&(n.atLeastDigits={minLength:this.capability.min_digits}),this.capability.min_special_characters&&(n.mustContain={minLength:this.capability.min_special_characters,characters:' "!#\\$%&\'()*+,-./:;<=>?@[\\]^_`{|}~"'}),this.policy=new ES.PasswordPolicy(n,r)}getPolicy({enforcePassword:t=!1}={}){return this.buildPolicy({enforcePassword:t}),this.policy}generatePassword(){return EO.GeneratePassword({symbols:!0,length:this.generatePasswordRules.length,minLengthLowercase:this.generatePasswordRules.minLowercaseCharacters,minLengthUppercase:this.generatePasswordRules.minUppercaseCharacters,minLengthNumbers:this.generatePasswordRules.minDigits,minLengthSymbols:this.generatePasswordRules.minSpecialCharacters})}}const Zv=e=>({name:pt.basename(e),type:"directory",relativePath:e}),eb=(e,t)=>t.map(r=>({source:e,name:r.name,type:r.type,data:r,meta:{relativePath:r.relativePath||null}})),tb=async e=>{const t=await new Promise((n,i)=>e.file(n,i));return e.fullPath===te.urlJoin(e.name,{leadingSlash:!0})||(t.relativePath=e.fullPath),t},AO=e=>typeof e.getAsEntry=="function"?e.getAsEntry():e.webkitGetAsEntry();async function*RO(e){const t=e.createReader(),r=()=>new Promise((i,o)=>{t.readEntries(i,o)});let n;do{n=await r();for(const i of n)yield i}while(n.length>0)}async function*rb(e,t){if(e.isDirectory){let r=!1;for await(const n of RO(e))if(n.isDirectory)yield*rb(n,t);else if(n.isFile)try{r=!0,yield tb(n)}catch(i){console.error(i),t?.(i)}r||(yield Zv(e.fullPath||e.name))}else try{yield tb(e)}catch(r){console.error(r),t?.(r)}}const CO=async(e,t)=>{try{const r=[],n=await Promise.all(Array.from(e.items,i=>AO(i)));for(let i=0;i<n.length;i++)for await(const o of rb(n[i],t))r.push(o);return r}catch(r){console.error(r);const n=Array.from(e.files);return Promise.resolve(n)}},IO={target:null,uppyService:null};class _O extends Hd.BasePlugin{nodes;uppyService;constructor(t,r){super(t,{...IO,...r}),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 r=!1;const n=o=>{this.uppy.log(o,"error"),r||(this.uppy.info(o.message,"error"),r=!0)},i=await CO(t.dataTransfer,n);if(i.length>0){this.uppy.log("[DropTarget] Files were dropped");try{const o=eb("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:r}=this.opts;if(this.uppyService=r,t instanceof Element?this.nodes=[t]:typeof t=="string"&&(this.nodes=Gd.toArray(document.querySelectorAll(t))),!this.nodes||this.nodes.length===0)throw new Error(`"${t}" does not match any HTML elements`);this.nodes.forEach(n=>{n.addEventListener("dragover",this.handleDragOver,!1),n.addEventListener("dragleave",this.handleDragLeave,!1),n.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 OO{uppy;uploadInputs=[];uploadFolderMap={};constructor({language:t}){const{$gettext:r}=t;this.uppy=new Hd({autoProceed:!1,onBeforeFileAdded:(n,i)=>(n.id in i&&(n.meta.retry=!0),n.meta.relativePath=this.getRelativeFilePath(n),n.id=this.generateUploadId(n),n)}),this.uppy.setOptions({locale:{strings:{addedNumFiles:r("Added %{numFiles} file(s)"),authenticate:r("Connect"),authenticateWith:r("Connect to %{pluginName}"),authenticateWithTitle:r("Please authenticate with %{pluginName} to select files"),cancel:r("Cancel"),companionError:r("Connection with Companion failed"),loadedXFiles:r("Loaded %{numFiles} files"),loading:r("Loading..."),logOut:r("Log out"),pluginWebdavInputLabel:r("Public link without password protection"),selectX:{0:r("Select %{smart_count}"),1:r("Select %{smart_count}")},signInWithGoogle:r("Sign in with Google")}}}),this.setUpEvents()}getRelativeFilePath=t=>{const r=t.data.relativePath||t.data.webkitRelativePath;return r?te.urlJoin(r):void 0};addPlugin(t,...r){this.uppy.use(t,...r)}removePlugin(t){this.uppy.removePlugin(t)}getPlugin(t){return this.uppy.getPlugin(t)}useTus({chunkSize:t,overridePatchMethod:r,uploadDataDuringCreation:n,onBeforeRequest:i,headers:o}){const s={chunkSize:t,removeFingerprintOnSuccess:!0,overridePatchMethod:r,retryDelays:[0,500,1e3],uploadDataDuringCreation:n,limit:5,headers:o,onBeforeRequest:i,onShouldRetry:(u,c,d,f)=>u?.originalResponse?.getStatus()>=500?!1:u?.originalResponse?.getStatus()===401?!0:f(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(TS,s)}useXhr({headers:t,timeout:r,endpoint:n}){const i={endpoint:n,method:"put",headers:t,formData:!1,timeout:r,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(AS,i)}tusActive(){return!!this.uppy.getPlugin("Tus")}useDropTarget({targetSelector:t}){this.uppy.getPlugin("DropTarget")||this.uppy.use(_O,{target:t,uppyService:this})}removeDropTarget(){const t=this.uppy.getPlugin("DropTarget");t&&this.uppy.removePlugin(t)}subscribe(t,r){return ze.subscribe(t,r)}unsubscribe(t,r){ze.unsubscribe(t,r)}publish(t,r){ze.publish(t,r)}setUpEvents(){this.uppy.on("progress",t=>{this.publish("progress",t)}),this.uppy.on("upload-progress",(t,r)=>{this.publish("upload-progress",{file:t,progress:r})}),this.uppy.on("cancel-all",()=>{this.publish("uploadCancelled"),this.clearInputs()}),this.uppy.on("complete",t=>{!t||!t.successful.length&&!t.failed.length||(this.publish("uploadCompleted",t),t.successful.forEach(r=>{this.uppy.removeFile(r.id)}),this.clearInputs())}),this.uppy.on("upload-success",t=>{this.publish("uploadSuccess",t)}),this.uppy.on("upload-error",(t,r)=>{this.publish("uploadError",{file:t,error:r})})}registerUploadInput(t){t.getAttribute("listener")!=="true"&&(t.setAttribute("listener","true"),t.addEventListener("change",n=>{const i=n.target,o=Array.from(i.files);this.addFiles(o)}),this.uploadInputs.push(t))}removeUploadInput(t){this.uploadInputs=this.uploadInputs.filter(r=>r!==t)}generateUploadId(t){return Gd.generateFileID(t,this.uppy.getID())}log(t,r){this.uppy.log(t,r)}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()}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,r){this.uploadFolderMap[t]=r}removeUploadFolder(t){this.uploadFolderMap[t]&&delete this.uploadFolderMap[t]}}function PO(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var kO=Object.getOwnPropertySymbols,FO=kO?function(e){for(var t=[];e;)Df(t,jv(e)),e=$l(e);return t}:Mv;function nb(e){return Lv(e,Vl,FO)}var xO=Object.prototype,NO=xO.hasOwnProperty;function DO(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&NO.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function $O(e,t){var r=Dl(e.buffer);return new e.constructor(r,e.byteOffset,e.byteLength)}var LO=/\w*$/;function MO(e){var t=new e.constructor(e.source,LO.exec(e));return t.lastIndex=e.lastIndex,t}var ib=Or?Or.prototype:void 0,ob=ib?ib.valueOf:void 0;function BO(e){return ob?Object(ob.call(e)):{}}var jO="[object Boolean]",UO="[object Date]",qO="[object Map]",VO="[object Number]",zO="[object RegExp]",WO="[object Set]",HO="[object String]",GO="[object Symbol]",KO="[object ArrayBuffer]",QO="[object DataView]",XO="[object Float32Array]",YO="[object Float64Array]",JO="[object Int8Array]",ZO="[object Int16Array]",eP="[object Int32Array]",tP="[object Uint8Array]",rP="[object Uint8ClampedArray]",nP="[object Uint16Array]",iP="[object Uint32Array]";function oP(e,t,r){var n=e.constructor;switch(t){case KO:return Dl(e);case jO:case UO:return new n(+e);case QO:return $O(e);case XO:case YO:case JO:case ZO:case eP:case tP:case rP:case nP:case iP:return kh(e,r);case qO:return new n;case VO:case HO:return new n(e);case zO:return MO(e);case WO:return new n;case GO:return BO(e)}}var sP="[object Map]";function aP(e){return en(e)&&zr(e)==sP}var sb=Ei&&Ei.isMap,lP=sb?Bl(sb):aP,cP="[object Set]";function uP(e){return en(e)&&zr(e)==cP}var ab=Ei&&Ei.isSet,fP=ab?Bl(ab):uP,dP=1,lb="[object Arguments]",pP="[object Array]",hP="[object Boolean]",mP="[object Date]",gP="[object Error]",cb="[object Function]",yP="[object GeneratorFunction]",vP="[object Map]",bP="[object Number]",ub="[object Object]",wP="[object RegExp]",SP="[object Set]",EP="[object String]",TP="[object Symbol]",AP="[object WeakMap]",RP="[object ArrayBuffer]",CP="[object DataView]",IP="[object Float32Array]",_P="[object Float64Array]",OP="[object Int8Array]",PP="[object Int16Array]",kP="[object Int32Array]",FP="[object Uint8Array]",xP="[object Uint8ClampedArray]",NP="[object Uint16Array]",DP="[object Uint32Array]",Et={};Et[lb]=Et[pP]=Et[RP]=Et[CP]=Et[hP]=Et[mP]=Et[IP]=Et[_P]=Et[OP]=Et[PP]=Et[kP]=Et[vP]=Et[bP]=Et[ub]=Et[wP]=Et[SP]=Et[EP]=Et[TP]=Et[FP]=Et[xP]=Et[NP]=Et[DP]=!0,Et[gP]=Et[cb]=Et[AP]=!1;function aa(e,t,r,n,i,o){var s,a=t&dP;if(r&&(s=i?r(e,n,i,o):r(e)),s!==void 0)return s;if(!Jr(e))return e;var l=Vr(e);if(l)s=DO(e);else{var u=zr(e),c=u==cb||u==yP;if(uo(e))return Ph(e,a);if(u==ub||u==lb||c&&!i)s={};else{if(!Et[u])return i?e:{};s=oP(e,u,a)}}o||(o=new Zr);var d=o.get(e);if(d)return d;o.set(e,s),fP(e)?e.forEach(function(w){s.add(aa(w,t,r,w,e,o))}):lP(e)&&e.forEach(function(w,v){s.set(v,aa(w,t,r,v,e,o))});var f=nb,m=l?void 0:f(e);return PO(m||e,function(w,v){m&&(v=w,w=e[v]),Vh(s,v,aa(w,t,r,v,e,o))}),s}function $P(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n<i;)o[n]=e[n+t];return o}function LP(e,t){return t.length<2?e:fm(e,$P(t,0,-1))}function MP(e,t){return t=ec(t,e),e=LP(e,t),e==null||delete e[um(Yd(t))]}function BP(e){return Ml(e)?void 0:e}var fb=Or?Or.isConcatSpreadable:void 0;function jP(e){return Vr(e)||ks(e)||!!(fb&&e&&e[fb])}function UP(e,t,r,n,i){var o=-1,s=e.length;for(r||(r=jP),i||(i=[]);++o<s;){var a=e[o];r(a)?Df(i,a):i[i.length]=a}return i}function qP(e){var t=e==null?0:e.length;return t?UP(e):[]}function VP(e){return Yh(Xh(e,void 0,qP),e+"")}var zP=1,WP=2,HP=4,xi=VP(function(e,t){var r={};if(e==null)return r;var n=!1;t=sm(t,function(o){return o=ec(o,e),n||(n=o.length>1),o}),zh(e,nb(e),r),n&&(r=aa(r,zP|WP|HP,BP));for(var i=t.length;i--;)MP(r,t[i]);return r});const GP=(e,t)=>{const r=(o="")=>o.split("/").filter(Boolean),n=r(e.path),i=r(t);return i.map((o,s)=>({id:Xt.v4(),allowContextActions:!0,text:o,to:{path:"/"+[...n].splice(0,n.length-i.length+s+1).join("/"),query:xi(e.query,"fileId","page")},isStaticNav:!1}))},KP=(...e)=>{const t=e.pop();return[...e,{id:Xt.v4(),allowContextActions:t.allowContextActions,text:t.text,onClick:()=>ze.publish("app.files.list.load"),isTruncationPlaceholder:t.isTruncationPlaceholder,isStaticNav:t.isStaticNav}]};class Co{static Cut="cut";static Copy="copy"}const qf=e=>e.clientY===0,Io=(e,t,r)=>{if(!e)return;const n=r.$el.getBoundingClientRect(),i=qf(t)?t.target?.getBoundingClientRect().top||0:t.clientY;e.setProps({getReferenceClientRect:()=>({width:0,height:0,top:i,bottom:i,left:t.type==="contextmenu"&&!qf(t)?t.clientX:n.x,right:t.type==="contextmenu"&&!qf(t)?t.clientX:n.x})}),e.show()},la=e=>(e||"").split("_")[0],Zn=(e,t,r=Mt.DateTime.DATETIME_MED)=>e.setLocale(la(t)).toLocaleString(r),db=(e,t,r=Mt.DateTime.DATETIME_MED)=>Zn(Mt.DateTime.fromJSDate(e),t,r),QP=(e,t,r=Mt.DateTime.DATETIME_MED)=>Zn(Mt.DateTime.fromHTTP(e),t,r),pb=(e,t,r=Mt.DateTime.DATETIME_MED)=>Zn(Mt.DateTime.fromISO(e),t,r),XP=(e,t,r=Mt.DateTime.DATETIME_MED)=>Zn(Mt.DateTime.fromRFC2822(e),t,r),_o=(e,t)=>e.setLocale(la(t)).toRelative(),hb=(e,t)=>_o(Mt.DateTime.fromJSDate(e),t),YP=(e,t)=>_o(Mt.DateTime.fromHTTP(e),t),JP=(e,t)=>_o(Mt.DateTime.fromISO(e),t),ZP=(e,t)=>_o(Mt.DateTime.fromRFC2822(e),t),ek=1048576,yr=(e,t)=>{const r=typeof e=="string"?parseInt(e):e;return r<0?"--":isNaN(r)?"?":wS.filesize(r,{round:r<ek?0:1,locale:la(t),base:10,output:"string"})};function mb(e="",t=!1){const r=te.urlJoin(e,{leadingSlash:!0});if(r==="/")return[];const n=[],i=r.split("/");for(t&&n.push(r),i.pop();i.length>0;){if(!i.join("/")){i.pop();continue}n.push(i.join("/")),i.pop()}return n}var Tt=(e=>(e.open="sidebar.open",e.close="sidebar.close",e.toggle="sidebar.toggle",e.openWithPanel="sidebar.openWithPanel",e.setActivePanel="sidebar.setActivePanel",e))(Tt||{});const Vf=(e,t=void 0)=>{const r=window.localStorage.getItem(e),n=le(t);if(r)try{n.value=JSON.parse(r)}catch{n.value=r}return dt(()=>h(n),(i,o)=>{i!==o&&(i!==void 0?window.localStorage.setItem(e,typeof i=="string"?i:JSON.stringify(i)):window.localStorage.removeItem(e))},{deep:!0}),n},ei=()=>{const e=ct(),t=B(()=>e.options.embed?.enabled),r=B(()=>e.options.embed?.target==="location"),n=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(()=>h(t)&&e.options.embed?.delegateAuthentication),u=B(()=>e.options.embed?.delegateAuthenticationOrigin);return{isEnabled:t,isLocationPicker:r,chooseFileName:n,chooseFileNameSuggestion:i,isFilePicker:o,messagesTargetOrigin:a,isDelegatingAuthentication:l,fileTypes:s,postMessage:(f,m)=>{const w={};h(a)&&(w.targetOrigin=h(a)),window.parent.postMessage({name:f,data:m},w)},verifyDelegatedAuthenticationOrigin:f=>h(u)?h(u)===f:!0}},gb=e=>{const{isEnabled:t}=ei(),r=e?.bus||ze,n=Vf("oc_sideBarOpen",!1),i=le(!1),o=B({get(){return h(t)?h(i):h(n)},set(w){if(h(t)){i.value=w;return}n.value=w}}),s=async()=>{await ar();const w=document.getElementById("app-sidebar");w&&w.focus()},a=le(null),l=r.subscribe(Tt.toggle,()=>{o.value=!h(o),h(o)&&s()}),u=r.subscribe(Tt.close,()=>{o.value=!1,a.value=null}),c=r.subscribe(Tt.open,()=>{o.value=!0,a.value=null,s()}),d=r.subscribe(Tt.openWithPanel,w=>{o.value=!0,a.value=w,s()}),f=r.subscribe(Tt.setActivePanel,w=>{a.value=w});mr(()=>{r.unsubscribe(Tt.toggle,l),r.unsubscribe(Tt.close,u),r.unsubscribe(Tt.open,c),r.unsubscribe(Tt.openWithPanel,d),r.unsubscribe(Tt.setActivePanel,f)});const m=(w,v)=>{r.subscribe(Tt.setActivePanel,E=>{w===E&&setTimeout(()=>{v(E)},100)})};return{isSideBarOpen:dn(o),sideBarActivePanel:dn(a),onPanelActive:m}},vr=e=>e,yb=e=>te.ShareTypes.containsAnyValue(te.ShareTypes.authenticated,e??[]),vb=e=>te.ShareTypes.containsAnyValue(te.ShareTypes.unauthenticated,e??[]),tk=({isDirect:e})=>vr(e?"This item is directly shared with others.":"This item is shared with others through one of the parent folders."),rk=({isDirect:e})=>vr(e?"This item is directly shared via links.":"This item is shared via links through one of the parent folders."),nk=({resource:e,isDirect:t,interceptModifierClick:r})=>({id:`files-sharing-${e.getDomSelector()}`,accessibleDescription:tk({isDirect:t}),label:vr("Show invited people"),icon:"group",category:"sharing",type:t?"user-direct":"user-indirect",fillType:"line",handler:(n,i)=>{i&&r(i,n)||ze.publish(Tt.openWithPanel,"sharing#peopleShares")}}),ik=({resource:e,isDirect:t})=>({id:`file-link-${e.getDomSelector()}`,accessibleDescription:rk({isDirect:t}),label:vr("Show links"),icon:"link",category:"sharing",type:t?"link-direct":"link-indirect",fillType:"line",handler:()=>{ze.publish(Tt.openWithPanel,"sharing#linkShares")}}),ok=({resource:e})=>({id:`resource-locked-${e.getDomSelector()}`,accessibleDescription:vr("Item locked"),label:vr("This item is locked"),icon:"lock",category:"system",type:"resource-locked",fillType:"line"}),sk=({resource:e})=>({id:`resource-processing-${e.getDomSelector()}`,accessibleDescription:vr("Item in processing"),label:vr("This item is in processing"),icon:"loop-right",category:"system",type:"resource-processing",fillType:"line"}),ak=({resource:e})=>({id:`resource-space-enabled-${e.getDomSelector()}`,accessibleDescription:vr("Space is enabled"),label:vr("This space is enabled"),icon:"play-circle",category:"space",type:"resource-space-enabled",fillType:"line"}),lk=({resource:e})=>({id:`resource-space-disabled-${e.getDomSelector()}`,accessibleDescription:vr("Space is disabled"),label:vr("This space is disabled"),icon:"stop-circle",category:"space",type:"resource-space-disabled",fillType:"line"}),bb=({space:e,resource:t,ancestorMetaData:r,user:n,interceptModifierClick:i})=>{const o=[];if(t.locked&&o.push(ok({resource:t})),t.processing&&o.push(sk({resource:t})),te.isProjectSpaceResource(t)&&!t.disabled&&o.push(ak({resource:t})),te.isProjectSpaceResource(t)&&t.disabled&&o.push(lk({resource:t})),te.isProjectSpaceResource(e)||te.isPersonalSpaceResource(e)&&e.isOwner(n)){const a=Object.values(r).reduce((c,d)=>(c.push(...d.shareTypes||[]),c),[]),l=yb(t.shareTypes);(l||yb(a))&&o.push(nk({resource:t,isDirect:l,interceptModifierClick:i}));const u=vb(t.shareTypes);(u||vb(a))&&o.push(ik({resource:t,isDirect:u}))}return o},wb=e=>new Promise((t,r)=>{const n=new FileReader;n.onloadend=()=>t(n.result),n.onerror=i=>r(i),n.readAsArrayBuffer(e)}),Sb=e=>new Promise(t=>e.toBlob(t)),ca=()=>window.navigator.platform.match("Mac"),zf=e=>new TextEncoder().encode(e).length,nt=Ve.defineStore("messages",()=>{const e=le([]),t=o=>{const s={...o,id:Xt.v4()};return e.value.push(s),s},r=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
51
+ `)};return{messages:e,showMessage:t,showErrorMessage:o=>{const s={id:Xt.v4(),status:"danger",timeout:0,...o.errors&&{errorLogContent:r(o.errors)},...o};return e.value.push(s),s},removeMessage:o=>{e.value=h(e).filter(({id:s})=>o.id!==s)}}}),Oo=Ve.defineStore("clipboard",()=>{const{$gettext:e}=Fe.useGettext(),{showMessage:t}=nt(),r=le(),n=le([]);return{action:r,resources:n,copyResources:a=>{a[0]?.canDownload()&&(r.value=Co.Copy,n.value=a,t({title:e("Copied to clipboard!"),status:"success"}))},cutResources:a=>{a[0]?.canDownload()&&(r.value=Co.Cut,n.value=a,t({title:e("Cut to clipboard!"),status:"success"}))},clearClipboard:()=>{r.value=void 0,n.value=[]}}}),Eb={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},ct=Ve.defineStore("config",()=>{const e=rn(),t=le(""),r=le(""),n=le({...Eb}),i=le([]),o=le([]),s=le([]),a=le(),l=le(),u=le(),c=le([]),d=le([]),f=B(()=>te.urlJoin(h(t)||window.location.origin,{trailingSlash:!0})),m=B(()=>!!h(a)),w=B(()=>!!h(l));return{options:n,oAuth2:a,openIdConnect:l,isOAuth2:m,isOIDC:w,customTranslations:s,apps:i,externalApps:o,sentry:u,theme:r,scripts:c,styles:d,serverUrl:f,loadConfig:E=>{E.server&&(t.value=E.server?.endsWith("/")?E.server:E.server+"/"),i.value=E.apps||[],s.value=E.customTranslations||[],a.value=E.auth,l.value=E.openIdConnect,u.value=E.sentry,c.value=E.scripts||[],d.value=E.styles||[],r.value=E.theme,E.options&&(n.value=po({...Eb},E.options),h(n).ocm.openRemotely=h(n).cernFeatures,h(n).routing.idBased=!h(n).cernFeatures,h(n).routing.fullShareOwnerPaths=h(n).cernFeatures),E.external_apps&&(o.value=E.external_apps,E.external_apps.filter(Boolean).forEach(b=>{e.loadExternalAppConfig({appId:b.id,config:b.config})}))}}}),ck=Te.z.object({url:Te.z.string()}),uk=Te.z.object({apiUrl:Te.z.string().optional(),authUrl:Te.z.string().optional(),clientId:Te.z.string().optional(),clientSecret:Te.z.string().optional(),logoutUrl:Te.z.string().optional(),metaDataUrl:Te.z.string().optional(),url:Te.z.string().optional()}),fk=Te.z.object({authority:Te.z.string().optional(),client_id:Te.z.string().optional(),client_secret:Te.z.string().optional(),dynamic:Te.z.string().optional(),metadata_url:Te.z.string().optional(),post_logout_redirect_uri:Te.z.string().optional(),response_type:Te.z.string().optional(),scope:Te.z.string().optional()}).passthrough(),dk=Te.z.record(Te.z.any(),Te.z.any()),pk=Te.z.object({href:Te.z.string().optional()}),hk=Te.z.object({async:Te.z.boolean().optional(),src:Te.z.string().optional()}),mk=Te.z.object({cernFeatures:Te.z.boolean().optional(),concurrentRequests:Te.z.object({resourceBatchActions:Te.z.number().optional(),sse:Te.z.number().optional(),shares:Te.z.object({create:Te.z.number().optional(),list:Te.z.number().optional()}).optional(),avatars:Te.z.number().optional()}).optional(),contextHelpers:Te.z.boolean().optional(),contextHelpersReadMore:Te.z.boolean().optional(),defaultAppId:Te.z.string().optional(),disabledExtensions:Te.z.array(Te.z.string()).optional(),disableFeedbackLink:Te.z.boolean().optional(),accountEditLink:Te.z.object({href:Te.z.string().optional()}).optional(),editor:Te.z.object({autosaveEnabled:Te.z.boolean().optional(),autosaveInterval:Te.z.number().optional(),openAsPreview:Te.z.union([Te.z.boolean(),Te.z.array(Te.z.string())]).optional()}).optional(),embed:Te.z.object({enabled:Te.z.boolean().optional(),target:Te.z.string().optional(),messagesOrigin:Te.z.string().optional(),delegateAuthentication:Te.z.boolean().optional(),delegateAuthenticationOrigin:Te.z.string().optional(),fileTypes:Te.z.array(Te.z.string()).optional(),chooseFileName:Te.z.boolean().optional(),chooseFileNameSuggestion:Te.z.string().optional()}).optional(),feedbackLink:Te.z.object({ariaLabel:Te.z.string().optional(),description:Te.z.string().optional(),href:Te.z.string().optional()}).optional(),isRunningOnEos:Te.z.boolean().optional(),loginUrl:Te.z.string().optional(),logoutUrl:Te.z.string().optional(),ocm:Te.z.object({openRemotely:Te.z.boolean().optional()}).optional(),routing:Te.z.object({fullShareOwnerPaths:Te.z.boolean().optional(),idBased:Te.z.boolean().optional()}).optional(),runningOnEos:Te.z.boolean().optional(),tokenStorageLocal:Te.z.boolean().optional(),upload:Te.z.object({companionUrl:Te.z.string().optional()}).optional(),userListRequiresFilter:Te.z.boolean().optional(),hideLogo:Te.z.boolean().optional()}),gk=Te.z.object({id:Te.z.string(),path:Te.z.string(),config:Te.z.record(Te.z.string(),Te.z.unknown()).optional()}),yk=Te.z.object({server:Te.z.string(),theme:Te.z.string(),options:mk,apps:Te.z.array(Te.z.string()).optional(),external_apps:Te.z.array(gk).optional(),customTranslations:Te.z.array(ck).optional(),auth:uk.optional(),openIdConnect:fk.optional(),sentry:dk.optional(),scripts:Te.z.array(hk).optional(),styles:Te.z.array(pk).optional()}),Tb=Ve.defineStore("extensionPreferences",()=>{const e=ln.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(h(e),i)){e.value[i]={extensionPointId:i,selectedExtensionIds:o};return}e.value[i].selectedExtensionIds=o}}}),Ni=Ve.defineStore("extensionRegistry",()=>{const e=ct(),t=le([]),r=u=>{t.value.push(u)},n=u=>{t.value=h(t).map(c=>le(h(c).filter(({id:d})=>!u.includes(d)))).filter(c=>h(c).length)},i=u=>{if(!u.id||!u.extensionType)throw new Error("ExtensionPoint must have an id and an extensionType");return h(t).flatMap(c=>h(c).filter(d=>d.type===u.extensionType&&!e.options.disabledExtensions.includes(d.id)&&(!d.extensionPointIds||d.extensionPointIds?.includes(u.id))))},o=le([]);return{extensions:t,registerExtensions:r,unregisterExtensions:n,requestExtensions:i,extensionPoints:o,registerExtensionPoints:u=>{o.value.push(u)},unregisterExtensionPoints:u=>{o.value=h(o).map(c=>le(h(c).filter(({id:d})=>!u.includes(d)))).filter(c=>h(c).length)},getExtensionPoints:(u={})=>h(o).flatMap(c=>h(c).filter(d=>!(Object.hasOwn(u,"extensionType")&&d.extensionType!==u.extensionType)))}}),ht=Ve.defineStore("modals",()=>{const e=le([]),t=B(()=>h(e).at(-1)),r=l=>h(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 d=r(l);d[u]=c},removeModal:l=>{e.value=h(e).filter(u=>u.id!==l)},removeAllModals:()=>{e.value=[]},setModalActive:l=>{const u=h(e).findIndex(d=>d.id===l);if(u<0)return;const c=r(l);h(e).splice(u,1),e.value.push(c)}}}),bt=Ve.defineStore("user",()=>{const e=le();return{user:e,setUser:n=>{e.value=n,CS.setUser({username:n.onPremisesSamAccountName})},reset:()=>{e.value=null}}}),ua=(e,t)=>{t!==void 0&&document.querySelector(":root").style.setProperty("--oc-"+e,t)},vk="thead-clicked",bk="highlight",wk="rowMounted",Sk="contextmenuClicked",Ab="itemDropped",Ek="itemDragged",Tk=["xsmall","small","medium","large","xlarge","xxlarge","xxxlarge"];let Ak="";const Rk=()=>Ak,Ck=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"}),Ik=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"}),_k=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"});let Rb=0;const Po=(e="")=>(e=e||"",Rb+=1,e+Rb);function Ok(e,t,r,n){for(var i=-1,o=e==null?0:e.length;++i<o;)r=t(r,e[i],i,e);return r}function Pk(e){return function(t){return e?.[t]}}var kk={À:"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"},Fk=Pk(kk),xk=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Nk="\\u0300-\\u036f",Dk="\\ufe20-\\ufe2f",$k="\\u20d0-\\u20ff",Lk=Nk+Dk+$k,Mk="["+Lk+"]",Bk=RegExp(Mk,"g");function jk(e){return e=Zl(e),e&&e.replace(xk,Fk).replace(Bk,"")}var Uk=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function qk(e){return e.match(Uk)||[]}var Vk=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function zk(e){return Vk.test(e)}var Cb="\\ud800-\\udfff",Wk="\\u0300-\\u036f",Hk="\\ufe20-\\ufe2f",Gk="\\u20d0-\\u20ff",Kk=Wk+Hk+Gk,Ib="\\u2700-\\u27bf",_b="a-z\\xdf-\\xf6\\xf8-\\xff",Qk="\\xac\\xb1\\xd7\\xf7",Xk="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Yk="\\u2000-\\u206f",Jk=" \\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",Ob="A-Z\\xc0-\\xd6\\xd8-\\xde",Zk="\\ufe0e\\ufe0f",Pb=Qk+Xk+Yk+Jk,kb="['’]",Fb="["+Pb+"]",eF="["+Kk+"]",xb="\\d+",tF="["+Ib+"]",Nb="["+_b+"]",Db="[^"+Cb+Pb+xb+Ib+_b+Ob+"]",rF="\\ud83c[\\udffb-\\udfff]",nF="(?:"+eF+"|"+rF+")",iF="[^"+Cb+"]",$b="(?:\\ud83c[\\udde6-\\uddff]){2}",Lb="[\\ud800-\\udbff][\\udc00-\\udfff]",Di="["+Ob+"]",oF="\\u200d",Mb="(?:"+Nb+"|"+Db+")",sF="(?:"+Di+"|"+Db+")",Bb="(?:"+kb+"(?:d|ll|m|re|s|t|ve))?",jb="(?:"+kb+"(?:D|LL|M|RE|S|T|VE))?",Ub=nF+"?",qb="["+Zk+"]?",aF="(?:"+oF+"(?:"+[iF,$b,Lb].join("|")+")"+qb+Ub+")*",lF="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",cF="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",uF=qb+Ub+aF,fF="(?:"+[tF,$b,Lb].join("|")+")"+uF,dF=RegExp([Di+"?"+Nb+"+"+Bb+"(?="+[Fb,Di,"$"].join("|")+")",sF+"+"+jb+"(?="+[Fb,Di+Mb,"$"].join("|")+")",Di+"?"+Mb+"+"+Bb,Di+"+"+jb,cF,lF,xb,fF].join("|"),"g");function pF(e){return e.match(dF)||[]}function hF(e,t,r){return e=Zl(e),t=t,t===void 0?zk(e)?pF(e):qk(e):e.match(t)||[]}var mF="['’]",gF=RegExp(mF,"g");function yF(e){return function(t){return Ok(hF(jk(t).replace(gF,"")),e,"")}}var Vb=yF(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()});const zb=Te.z.object({name:Te.z.string().optional(),slogan:Te.z.string().optional(),logo:Te.z.string().optional(),urls:Te.z.object({accessDeniedHelp:Te.z.string().optional(),imprint:Te.z.string().optional(),privacy:Te.z.string().optional(),accessibility:Te.z.string().optional()}).optional(),shareRoles:Te.z.record(Te.z.string(),Te.z.object({iconName:Te.z.string()})).optional()}),vF=Te.z.object({roles:Te.z.record(Te.z.string(),Te.z.string()).optional(),colorPalette:Te.z.record(Te.z.string(),Te.z.string()).optional(),fontFamily:Te.z.string().optional()}),Wb=zb.extend({designTokens:vF.optional(),favicon:Te.z.string().optional(),background:Te.z.string().optional()}),bF=Wb.extend({isDark:Te.z.boolean(),label:Te.z.string()}),Hb=Te.z.object({defaults:Wb,themes:Te.z.array(bF)}),wF=Te.z.object({common:zb.optional(),clients:Te.z.object({web:Hb})}),SF="oc_currentThemeName",ti=Ve.defineStore("theme",()=>{const e=ln.useLocalStorage(SF,null),t=ln.usePreferredDark(),r=le(),n=le([]),i=c=>{const d=c.common,f=c.clients.web.defaults,m=Xd(d,f);n.value=c.clients.web.themes.map(w=>Xd(m,w)),o()},o=()=>{const c=h(n).find(f=>!f.isDark),d=h(n).find(f=>f.isDark);l(h(n).find(f=>f.label===h(e))||(h(t)?d:c)||h(n)[0],!1)},s=()=>{e.value=null,o()},a=B(()=>e.value===null),l=(c,d=!0)=>{r.value=c,d&&(e.value=h(r).label);const f=[{name:"roles",prefix:"role"},{name:"colorPalette",prefix:"color"}];ua("font-family",h(r).designTokens.fontFamily),f.forEach(m=>{for(const w in h(r).designTokens[m.name])ua(`${m.prefix}-${Vb(w)}`,h(r).designTokens[m.name][w])}),h(r).designTokens?.roles?.chrome||(ua("role-chrome",h(r).designTokens?.roles?.surfaceContainer),ua("role-on-chrome",h(r).designTokens?.roles?.onSurface))};return{availableThemes:n,currentTheme:r,initializeThemes:i,setAndApplyTheme:l,setAutoSystemTheme:s,isCurrentThemeAutoSystem:a,getRoleIcon:c=>h(r).shareRoles[c.id]?.iconName||"user"}}),En=Ve.defineStore("shares",()=>{const e=Ke(),{getRoleIcon:t}=ti(),r=le(!1),n=le([]),i=le([]),o=le({}),s=I=>{o.value=I.reduce((A,D)=>(A[D.id]={...D,icon:t(D)},A),{})},a=I=>{const A=h(n).find(({id:D})=>D===I.id);if(A){Object.assign(A,I);return}h(n).push(I)},l=I=>{n.value=I},u=I=>{h(n).push(...I)},c=I=>{n.value=h(n).filter(({id:A})=>A!==I.id)},d=()=>{n.value=[],i.value=[],r.value=void 0},f=()=>{const I=Object.values(e.ancestorMetaData).map(({id:A})=>A);if(!I.length){n.value=[],i.value=[];return}h(n).forEach(A=>{I.includes(A.resourceId)||c(A)}),h(i).forEach(A=>{I.includes(A.resourceId)||v(A)})},m=I=>{i.value=I},w=I=>{const A=h(i).find(({id:D})=>D===I.id);if(A){Object.assign(A,I);return}h(i).push(I)},v=I=>{i.value=h(i).filter(({id:A})=>A!==I.id)},E=I=>{r.value=I},b=I=>{const A=x=>{const z=new Set;return x.forEach(G=>{z.add(G.shareType)}),Array.from(z)},D=[...e.resources,e.currentFolder].find(x=>x?.id===I);if(!D||te.isProjectSpaceResource(D))return;const H=[...h(n),...h(i)];e.updateResourceField({id:D.id,field:"shareTypes",value:A(H.filter(x=>!x.indirect))});const _=e.getAncestorById(I);_&&e.updateAncestorField({path:_.path,field:"shareTypes",value:A(H.filter(x=>!x.indirect))})};return{loading:r,collaboratorShares:n,linkShares:i,graphRoles:o,setGraphRoles:s,setLoading:E,setCollaboratorShares:l,setLinkShares:m,removeOrphanedShares:f,pruneShares:d,addShare:async({clientService:I,space:A,resource:D,options:H})=>{const x=await I.graphAuthenticated.permissions.createInvite(A.id,D.id,H,h(o));return u([x]),b(D.id),x},updateShare:async({clientService:I,space:A,resource:D,collaboratorShare:H,options:_})=>{const x=I.graphAuthenticated.permissions,z={roles:_.roles,expirationDateTime:_.expirationDateTime},G=await x.updatePermission(A.id,D.id,H.id,z,h(o));return a(G),G},deleteShare:async({clientService:I,space:A,resource:D,collaboratorShare:H})=>{await I.graphAuthenticated.permissions.deletePermission(A.id,D.id,H.id),c(H),b(D.id)},addLink:async({clientService:I,space:A,resource:D,options:H})=>{const x=await I.graphAuthenticated.permissions.createLink(A.id,D.id,H),z=e.selectedResources,G=z.some(({fileId:ne})=>ne===D.fileId)||z.length===0&&e.currentFolder.fileId===D.fileId;if(w(x),b(D.id),!G){const ne=e.ancestorMetaData[D.path]??null;if(ne){const{shareTypes:ie}=ne;ie.includes(te.ShareTypes.link.value)||e.updateAncestorField({path:ne.path,field:"shareTypes",value:[...ie,te.ShareTypes.link.value]})}}return x},updateLink:async({clientService:I,space:A,resource:D,linkShare:H,options:_})=>{const x=I.graphAuthenticated.permissions;let z;if(Object.hasOwn(_,"password"))z=await x.setPermissionPassword(A.id,D.id,H.id,{password:_.password}),H.hasPassword=!!_.password;else{const G={link:{..._.type&&{type:_.type},..._.displayName&&{"@libre.graph.displayName":_.displayName}},...Object.hasOwn(_,"expirationDateTime")&&{expirationDateTime:_.expirationDateTime}};z=await x.updatePermission(A.id,D.id,H.id,G)}return w(z),z},deleteLink:async({clientService:I,space:A,resource:D,linkShare:H})=>{await I.graphAuthenticated.permissions.deletePermission(A.id,D.id,H.id),v(H),b(D.id)}}}),br={View:"view",Upload:"upload",Edit:"edit",CreateOnly:"createOnly"},Gb={LibreGraphPermissionsActionsAllowedValues:"@libre.graph.permissions.actions.allowedValues",LibreGraphPermissionsRolesAllowedValues:"@libre.graph.permissions.roles.allowedValues"},Kb=e=>e.sort((t,r)=>r.permissions.length-t.permissions.length),ko=async({graphClient:e,driveType:t,configStore:r,signal:n})=>{const i=await e.drives.listMyDrives({orderBy:"name asc",filter:`driveType eq ${t}`},{signal:n});if(!i.length)return[];if(t!=="mountpoint"||!r.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])=>te.buildSpace({id:te.extractStorageId(a),name:l,driveType:l.split("/")[0],driveAlias:l,path:"/",serverUrl:r.serverUrl}));return[...i,...s]},ut=Ve.defineStore("spaces",()=>{const e=bt(),t=ct(),r=En(),n=le([]),i=le(),o=le(!1),s=le(!1),a=le(!1),l=le(null),u=le([]),c=le([]),d=B(()=>h(n).find(de=>te.isPersonalSpaceResource(de)&&de.isOwner(e.user))),f=de=>{o.value=de},m=de=>{s.value=de},w=de=>{a.value=de},v=de=>{i.value=de},E=de=>{l.value=de},b=de=>{if(!te.isProjectSpaceResource(de))return[];const ce=r.collaboratorShares.filter(X=>X.resourceId===de.id);return Kb(ce)},g=de=>{h(n).push(...de)},y=de=>{n.value=h(n).filter(({id:ce})=>ce!==de.id)},p=de=>h(n).find(ce=>de==ce.id),S=async({graphClient:de,space:ce,signal:X})=>(await D({graphClient:de,signal:X}),h(n).find(oe=>te.isMountPointSpaceResource(oe)&&oe.root?.remoteItem?.id===ce.id)),T=({driveAliasPrefix:de,id:ce,shareName:X})=>{const oe=te.buildShareSpaceResource({driveAliasPrefix:de,id:ce,shareName:X,serverUrl:t.serverUrl});return g([oe]),oe},R=de=>{const ce=h(n).find(({id:X})=>X===de.id);if(ce){Object.assign(ce,de);return}g([de])},I=({id:de,field:ce,value:X})=>{const oe=h(n).find(ae=>de===ae.id);oe&&(oe[ce]=X)},A=async({graphClient:de})=>{a.value=!0;try{const[ce,X]=await Promise.all([ko({graphClient:de,driveType:"personal",configStore:t}),ko({graphClient:de,driveType:"project",configStore:t})]);g([...ce,...X]),o.value=!0}finally{a.value=!1}},D=async({graphClient:de,signal:ce})=>{if(!h(s))try{const X=await ko({graphClient:de,driveType:"mountpoint",configStore:t,signal:ce});g(X)}finally{s.value=!0}},H=async({graphClient:de,signal:ce})=>{const X=await ko({graphClient:de,driveType:"project",configStore:t,signal:ce});n.value=h(n).filter(oe=>!te.isProjectSpaceResource(oe)),g(X)},_=de=>{h(u).includes(de)||h(u).push(de)},x=de=>{u.value=h(u).filter(ce=>ce!==de)},z=()=>{u.value=[]},G=de=>{h(c).includes(de)||h(c).push(de)},ne=de=>{c.value=h(c).filter(ce=>ce!==de)},ie=()=>{c.value=[]},ee=le({});return{spaces:n,spacesInitialized:o,mountPointsInitialized:s,spacesLoading:a,currentSpace:i,personalSpace:d,defaultSpaceImageBlobURL:l,imagesLoading:u,readmesLoading:c,getSpace:p,createShareSpace:T,setSpacesInitialized:f,setMountPointsInitialized:m,setSpacesLoading:w,setCurrentSpace:v,setDefaultSpaceImageBlobURL:E,getSpaceMembers:b,getMountPointForSpace:S,addSpaces:g,removeSpace:y,upsertSpace:R,updateSpaceField:I,loadSpaces:A,loadMountPoints:D,reloadProjectSpaces:H,addToImagesLoading:_,removeFromImagesLoading:x,purgeImagesLoading:z,addToReadmesLoading:G,removeFromReadmesLoading:ne,purgeReadmesLoading:ie,loadGraphPermissions:async({ids:de,graphClient:ce,useCache:X=!0})=>{const oe=h(n).filter(ae=>de.includes(ae.id)&&(ae.graphPermissions===void 0||!X));if(oe.length){for(const{id:ae,disabled:Ce}of oe){if(Ce){I({id:ae,field:"graphPermissions",value:[]});continue}h(ee)[ae]||(ee.value[ae]=ce.permissions.listPermissions(ae,ae,r.graphRoles,{select:[Gb.LibreGraphPermissionsActionsAllowedValues]}).then(({allowedActions:Z})=>{I({id:ae,field:"graphPermissions",value:Z}),delete ee.value[ae]}))}await Promise.all(Object.values(h(ee)))}}}}),Ke=Ve.defineStore("resources",()=>{const e=ct(),t=ut(),r=bt(),n=le([]),i=le(),o=le({}),s=le([]),a=B(()=>{let O=h(n);return h(_)||(O=O.filter(K=>!K.name.startsWith("."))),O}),l=B(()=>{const O=h(n).filter(({type:pe})=>pe==="file").length,K=h(n).filter(({type:pe,name:Re})=>pe==="file"&&Re.startsWith(".")).length,V=h(n).filter(({type:pe})=>pe==="folder").length,$=h(n).filter(({type:pe,name:Re})=>pe==="folder"&&Re.startsWith(".")).length,U=h(n).filter(te.isProjectSpaceResource).length;return{files:O,hiddenFiles:K,folders:V,hiddenFolders:$,spaces:U}}),u=O=>{n.value=O},c=O=>{n.value=h(n).filter(K=>!O.find(({id:V})=>V===K.id))},d=()=>{n.value=[]},f=O=>{const K=h(n).find(({id:V})=>V===O.id);if(K){Object.assign(K,O);return}h(n).push(O)},m=O=>{const K=h(n).filter(V=>!O.some($=>$.path===V.path));n.value=[...K,...O]},w=({id:O,field:K,value:V})=>{const $=h(n).find(U=>O===U.id);$&&($[K]=V)},v=O=>{i.value=O},E=()=>{i.value=void 0},b=O=>{n.value=O.resources,i.value=O.currentFolder},g=()=>{n.value=[],i.value=void 0,y.value=[]},y=le([]),p=le(null),S=B(()=>h(n).filter(O=>h(y).includes(O.id))),T=O=>{const K=O.find(V=>!h(y).includes(V));K&&(p.value=K),y.value=O},R=O=>{p.value=O,h(y).includes(O)||h(y).push(O)},I=O=>{p.value=O,h(y).includes(O)&&(y.value=h(y).filter(K=>K!==O))},A=O=>{h(y).includes(O)?I(O):R(O)},D=()=>{y.value=[]},H=O=>{p.value=O},_=le(!0),x=le(!0),z=le(!1),G=le(!0),ne=le(!0),ie=O=>{_.value=O,window.localStorage.setItem("oc_hiddenFilesShown",O.toString())},ee=O=>{x.value=O,window.localStorage.setItem("oc_fileExtensionsShown",O.toString())},ue=O=>{z.value=O,window.localStorage.setItem("oc_webDavDetailsShown",O.toString())},de=O=>{G.value=O,window.localStorage.setItem("oc_disabledSpacesShown",O.toString())},ce=O=>{ne.value=O,window.localStorage.setItem("oc_emptyTrashesShown",O.toString())},X=O=>{o.value=O};return{resources:n,currentFolder:i,activeResources:a,totalResourcesCount:l,setResources:u,removeResources:c,clearResources:d,upsertResource:f,upsertResources:m,updateResourceField:w,setCurrentFolder:v,clearCurrentFolder:E,initResourceList:b,clearResourceList:g,selectedIds:y,latestSelectedId:p,selectedResources:S,setSelection:T,addSelection:R,removeSelection:I,toggleSelection:A,resetSelection:D,setLastSelectedId:H,areHiddenFilesShown:_,areFileExtensionsShown:x,areWebDavDetailsShown:z,areDisabledSpacesShown:G,areEmptyTrashesShown:ne,setAreHiddenFilesShown:ie,setAreFileExtensionsShown:ee,setAreWebDavDetailsShown:ue,setAreDisabledSpacesShown:de,setAreEmptyTrashesShown:ce,ancestorMetaData:o,setAncestorMetaData:X,updateAncestorField:({path:O,field:K,value:V})=>{const $=h(o)[O]??null;$&&($[K]=V)},loadAncestorMetaData:({folder:O,space:K,client:V,signal:$})=>{const U={[O.path]:{id:O.fileId,shareTypes:O.shareTypes,parentFolderId:O.parentFolderId,spaceId:K.id,path:O.path}},pe=[],Re=[Me.FileId,Me.ShareTypes,Me.FileParent],De=mb(O.path),ke=t.spaces,Oe=()=>ke.filter(Se=>te.isMountPointSpaceResource(Se)&&te.extractStorageId(Se.root.remoteItem.rootId)===K.id);let Be=!0;if(e.options.routing.fullShareOwnerPaths){const Se=ke.some(Ye=>te.isProjectSpaceResource(Ye)&&Ye.id===K.id);Be=K.isOwner(r.user)||Se}for(const Se of De){const Ye=h(o)[Se]??null;if(Ye?.spaceId===K.id){U[Se]=Ye;continue}if(!Be&&!Oe().find(Qe=>Se.startsWith(Qe.root.remoteItem.path)))break;pe.push(V.listFiles(K,{path:Se},{depth:0,davProperties:Re,signal:$}).then(({resource:Qe})=>{U[Se]={id:Qe.fileId,shareTypes:Qe.shareTypes,parentFolderId:Qe.parentFolderId,spaceId:K.id,path:Se}}))}return Promise.all(pe).then(()=>{if(!Object.keys(U).includes("/")){const Se=h(o)["/"];if(Se?.spaceId===K.id)U["/"]=Se;else{const{parentFolderId:Ye}=Object.values(U)[0],Qe=t.spaces.find(({id:he})=>Ye.startsWith(he));Qe&&(U["/"]={id:Qe.id,shareTypes:Qe.shareTypes,parentFolderId:Qe.id,spaceId:Qe.id,path:"/"})}}X(U)})},getAncestorById:O=>Object.values(h(o)).find(K=>O===K.id),deleteQueue:s,addResourcesIntoDeleteQueue:O=>{s.value=s.value.concat(O.filter(K=>!h(s).includes(K)))},removeResourcesFromDeleteQueue:O=>{s.value=s.value.filter(K=>!O.includes(K))}}}),Fo=Ve.defineStore("webWorkers",()=>{const e=le([]);return{createWorker:(o,{needsTokenRenewal:s=!1}={})=>{const a=Xt.v4(),l=ln.useWebWorker(o,{type:"module",name:a}),u={id:a,needsTokenRenewal:s,...l};return h(e).push(u),u},terminateWorker:o=>{const s=h(e).find(a=>o===a.id);s&&(s.terminate(),e.value=h(e).filter(a=>o!==a.id))},terminateAllWorkers:()=>{h(e).forEach(({terminate:o})=>{o()}),e.value=[]},updateAccessTokens:o=>{h(e).filter(({needsTokenRenewal:s})=>s).forEach(({post:s})=>{s(JSON.stringify({topic:"tokenUpdate",data:{accessToken:`Bearer ${o}`}}))})}}}),fa=Ve.defineStore("avatars",()=>{const e=ct(),t=le({}),r=vp(new On({concurrency:e.options.concurrentRequests.avatars}));return{avatarMap:t,getAvatar:l=>h(t)[l],addAvatar:(l,u)=>{t.value[l]=u},removeAvatar:l=>{t.value[l]=null},reset:()=>{t.value={}},avatarsQueue:r,pendingAvatarsRequests:new Map}}),da=(e={})=>{const t=e.router||He(),r=e.configStore||ct();return{replaceInvalidFileRoute:({space:i,resource:o,path:s,fileId:a})=>{if(!r.options.routing?.idBased||s===o.path&&a===o.fileId)return!1;const l=tn(i,o,{configStore:r});return t.replace(l),!0}}},pa=()=>{const e=zt();return B(()=>h(e).name)},Qb=(e,t)=>{const r=zt();return B(()=>h(r).meta[e]||t)},ha=(e,t)=>{const r=He();return B({get(){return Rt(h(r.currentRoute).params[e])||t},async set(n){h(r.currentRoute).params[e]!==n&&await r.replace({params:{...h(r.currentRoute).params,[e]:n}})}})};let Xb=Promise.resolve();const tr=(e,t)=>{const r=He();return B({get(){return h(r.currentRoute).query[e]||t},set(n){if(h(r.currentRoute).query[e]===n)return;Xb=Xb.then(async()=>{try{await r.replace({path:h(r.currentRoute).path,query:{...h(r.currentRoute).query,[e]:n}})}catch{}})}})},Tn=e=>{const t=tr(e.name),r=Vf(EF(e));return dt(()=>h(t)?{value:h(t),source:"route"}:h(r)?{value:h(r),source:"storage"}:{value:e.defaultValue,source:"default"},n=>{["route","default"].includes(n.source)&&(r.value=n.value===e.defaultValue?void 0:Rt(n.value)),["storage","default"].includes(n.source)&&(t.value=n.value)},{immediate:!0}),t},EF=e=>["oc-options",e.storagePrefix,e.name].filter(Boolean).join("_"),Wr=(e,...t)=>{const r=le(!1),n=He(),i=zt();return dt(i,()=>{r.value=e(n,...t)},{immediate:!0}),r},ma="contextRouteName",Wf="contextRouteParams",Hf="contextRouteQuery",ga=e=>{const{params:t,query:r}=e,n={},i=["fileId","shareId","q_share-visibility","page"].concat(e.meta?.contextQueryItems||[]);for(const o of i)n[o]=r[o];return{[ma]:e.name,[Wf]:t,[Hf]:n}},Yb=e=>({routeName:Rt(e[ma]),routeParams:e[Wf],routeQuery:e[Hf]}),Rt=e=>Array.isArray(e)?e[0].toString():e?.toString();function Jb({router:e,currentFileContext:t}){const r=a=>{const{fileName:l,routeName:u,routeParams:c,routeQuery:d}=h(a);return h(u)?e.push({name:h(u),params:h(c),query:{...h(d),scrollTo:h(l)}}):e.push({path:"/"})},{replaceInvalidFileRoute:n}=da({router:e}),i=(a,l)=>{const u=h(a);return n({space:h(u.space),resource:l,path:h(u.item),fileId:h(u.itemId)})},o=le(!1);return{replaceInvalidFileRoute:i,closeApp:()=>(o.value=!0,r(t)),closed:o}}const Ge=()=>bn("$clientService");function Gf({clientService:e}){e=e||Ge();const t=er(),r=bt();return{getUrlForResource:(l,u,c)=>e.webdav.getFileUrl(l,u,{isUrlSigningEnabled:t.supportUrlSigning,username:r.user?.onPremisesSamAccountName,...c}),revokeUrl:l=>e.webdav.revokeUrl(l),getFileContents:(l,u)=>e.webdav.getFileContents(h(h(l).space),{path:h(h(l).item)},{...u}),getFileInfo:(l,u={})=>e.webdav.getFileInfo(h(h(l).space),{path:h(h(l).item),fileId:h(h(l).itemId)},u),putFileContents:(l,u)=>e.webdav.putFileContents(h(h(l).space),{path:h(h(l).item),...u})}}const Kf=()=>bn("$authService");class ri{static allFiles="all-files";static currentFolder="current-folder"}const Qf=()=>{const e=ct(),t=Ge(),r=ut(),n=Ke(),i=er(),o=B(()=>i.searchContent?.enabled),s=B(()=>n.areHiddenFilesShown),a=B(()=>r.spaces.filter(te.isProjectSpaceResource)),l=f=>h(a).find(m=>m.id===f),u=or.useTask(function*(f,m,w=null){if(e.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:t.graphAuthenticated,signal:f})),!m)return{totalResults:null,values:[]};const{resources:v,totalResults:E}=yield*te.call(t.webdav.search(m,{searchLimit:w,davProperties:js.Default,signal:f}));return{totalResults:E,values:v.map(b=>{const g=l(b.parentFolderId),y=g||b;return e.options.routing.fullShareOwnerPaths&&y.remoteItemPath&&(y.path=te.urlJoin(y.remoteItemPath,y.path)),{id:y.id,data:y}}).filter(({data:b})=>!b.name.startsWith(".")||h(s))}}).restartable();return{search:async(f,m=null)=>await u.perform(f,m),buildSearchTerm:({term:f,isTitleOnlySearch:m,tags:w,lastModified:v,mediaType:E,scope:b,useScope:g})=>{const y=[],p=f,S=h(o)&&!m;if(p){let T=`name:"*${p}*"`;S&&(T=`(name:"*${p}*" OR content:"${p}")`),y.push(T)}if(g&&b&&y.push(`scope:${b}`),w){const T=w.split("+").map(R=>`"${R}"`);y.push(`tag:(${T.join(" OR ")})`)}if(v&&y.push(`mtime:${v}`),E){const T=E.split("+").map(R=>`"${R}"`);y.push(`mediatype:(${T.join(" OR ")})`)}return y.sort((T,R)=>Number(T.startsWith("scope:"))-Number(R.startsWith("scope:"))).join(" AND ")}}};function Zb({currentRoute:e,clientService:t}){const r=le(!1),{webdav:n}=t,{replaceInvalidFileRoute:i}=da(),{getFileInfo:o}=Gf({clientService:t}),s=Kf(),a=ut(),{buildSearchTerm:l,search:u}=Qf(),c=tr("contextRouteQuery"),d=Ke(),{activeResources:f}=Ve.storeToRefs(d);return{isFolderLoading:r,loadFolderForFileContext:async w=>{r.value=!0;try{if(w=h(w),h(c)?.term){const T=l({term:h(c)?.term}),{values:R}=await u(T,200),I=R.filter(({data:A})=>te.isSearchResource(A)).map(A=>A.data);d.initResourceList({currentFolder:null,resources:I}),r.value=!1;return}if(["files-shares-with-me","files-shares-with-others","files-shares-via-link","files-common-favorites"].includes(h(w.routeName))){await Nv.getTask().perform(),r.value=!1;return}d.clearResourceList();const E=h(w.space),b=await o(w,{davProperties:[Me.FileId]});if(i({space:E,resource:b,path:h(w.item),fileId:h(w.itemId)}),a.spaces.some(T=>te.isMountPointSpaceResource(T)&&T.root.remoteItem?.id===b.id)){const T=await o(w);d.initResourceList({currentFolder:T,resources:[T]}),r.value=!1;return}const y=pt.dirname(b.path),{resource:p,children:S}=await n.listFiles(E,{path:y});p.type==="file"?d.initResourceList({currentFolder:p,resources:[p]}):d.initResourceList({currentFolder:p,resources:S})}catch(v){if(v.statusCode===401)return s.handleAuthError(h(e));d.setCurrentFolder(null),console.error(v)}r.value=!1},activeFiles:f}}function Xf({appsStore:e,applicationId:t}){return{applicationMeta:B(()=>{const n=e.apps[t];if(!n)throw new Error(`useAppConfig: could not find config for applicationId: ${t}`);return n||{}})}}const Ln=()=>ze;function e0({titleSegments:e,eventBus:t}){const r=ti(),{currentTheme:n}=Ve.storeToRefs(r);t=t||Ln(),dt(e,i=>{const o=h(i),s=" - ",a={shortDocumentTitle:o.join(s),fullDocumentTitle:[...o,h(n).name].join(s)};t.publish("runtime.documentTitle.changed",a)},{immediate:!0,deep:!0})}function TF({appsStore:e,applicationId:t,applicationName:r,currentFileContext:n,currentRoute:i}){const o=Xf({applicationId:t,appsStore:e}),{$gettext:s}=Fe.useGettext(),a=B(()=>{const l=pt.basename(h(h(n)?.fileName))||s(h(i)?.meta?.title||""),u=h(h(o).applicationMeta);return[l,h(r)||u.name||u.id].filter(Boolean)});e0({titleSegments:a})}function t0(e={}){const t=e.clientService??Ge(),r=e.authStore??Xn();return{makeRequest:(i,o,s={})=>{const a=!r.accessToken||r.publicLinkContextReady?t.httpUnAuthenticated:t.httpAuthenticated,l=new gc({accessToken:r.accessToken,publicLinkToken:r.publicLinkToken,publicLinkPassword:r.publicLinkPassword});return s.method=i,s.url=o,s.headers={...l.getHeaders(),...s?.headers||{}},a.request(s)}}}const r0=()=>{const e=ut();return{areSpacesLoading:B(()=>!e.spacesInitialized||e.spacesLoading)}},n0=(e={})=>{const t=ut(),{areSpacesLoading:r}=r0(),n=tr("shareId"),i=tr("fileId"),o=B(()=>Rt(h(i))),s=ct(),a=Ge(),l=B(()=>t.spaces),u=le(null),c=le(null),d=le(!1),f=m=>{const w=m.split("/");return h(l).find(v=>{if(!m.startsWith(v.driveAlias))return!1;const E=v.driveAlias.split("/");return w.length<E.length||w.slice(0,E.length).join("/")!==v.driveAlias?!1:v})};return gl(()=>{const m=h(e.driveAliasAndItem);!m?.startsWith("personal/")&&!m?.startsWith("project/")&&t.setCurrentSpace(null)}),dt([e.driveAliasAndItem,r],async([m,w],[v,E])=>{if(m===v&&w===E)return;if(!m||m.startsWith("virtual/")){u.value=null,c.value=null;return}if(h(u)&&m.startsWith(h(u).driveAlias)){c.value=te.urlJoin(m.slice(h(u).driveAlias.length),{leadingSlash:!0});return}let g=null,y=null;if(m.startsWith("public/")||m.startsWith("ocm/")){const[p,...S]=m.split("/").slice(1);g=h(l).find(T=>T.id===p),y=S.join("/")}else if(m.startsWith("share/")||m.startsWith("ocm-share/")){const[p,...S]=m.split("/").slice(1),T=m.startsWith("ocm-share/")?"ocm-share":"share";let R=Rt(h(n));R?.includes(":")&&(R=[te.SHARE_JAIL_ID,R].join("!")),g=t.getSpace(R)||t.createShareSpace({driveAliasPrefix:T,id:R,shareName:h(p)}),y=S.join("/")}else h(o)?g=h(l).find(p=>h(o).startsWith(`${p.fileId}`)):g=f(m),g||(!t.mountPointsInitialized&&s.options.routing.fullShareOwnerPaths&&(d.value=!0,await t.loadMountPoints({graphClient:a.graphAuthenticated})),g=f(m)),g&&(y=m.slice(g.driveAlias.length));u.value=g,c.value=te.urlJoin(y,{leadingSlash:!0}),d.value=!1},{immediate:!0,deep:!0}),dt(u,m=>{t.setCurrentSpace(m)},{immediate:!0}),{space:u,item:c,itemId:o,loading:d}};function i0(e){const t=He(),r=rn(),n=zt(),i=e.clientService??Ge(),o=e.applicationId,s=Xn(),{publicLinkContextReady:a}=Ve.storeToRefs(s),l=ha("driveAliasAndItem"),{space:u,item:c,itemId:d,loading:f}=n0({driveAliasAndItem:l}),m=B(()=>{if(h(f))return null;let w;return h(u)?w=te.urlJoin(h(u).webDavPath,h(c)):w=te.urlJoin(Rt(h(n).params.filePath)),{path:w,driveAliasAndItem:h(l),space:h(u),item:h(c),itemId:h(d),fileName:pt.basename(w),routeName:Rt(h(n).query[ma]),...Yb(h(n).query)}});return TF({appsStore:r,applicationId:o,applicationName:e.applicationName,currentFileContext:m,currentRoute:n}),{isPublicLinkContext:a,currentFileContext:m,...nm({appsStore:r,...e}),...Jb({router:t,currentFileContext:m}),...Gf({clientService:i}),...Zb({clientService:i,currentRoute:n}),...t0({clientService:i,currentRoute:h(n)})}}const AF=e=>({meta:{...e.meta,authContext:"anonymous"},path:e.path,redirect:t=>{const r=e.redirect(t);return console.warn(`route "${e.path}" is deprecated, use "${String(r.path)||String(r.name)}" instead.`),r}}),RF=()=>[{path:"/list",redirect:e=>Pr("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:"personal/home"}})},{path:"/list/all/:item(.*)",redirect:e=>Pr("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:te.urlJoin("personal/home",Rt(e.params.item),{leadingSlash:!1})}})},{path:"/list/favorites",redirect:e=>Ti("files-common-favorites",e)},{path:"/list/shared-with-me",redirect:e=>kr("files-shares-with-me",e)},{path:"/list/shared-with-others",redirect:e=>kr("files-shares-with-others",e)},{path:"/list/shared-via-link",redirect:e=>kr("files-shares-via-link",e)},{path:"/trash-bin",redirect:e=>Ri("files-trash-generic",e)},{path:"/public/list/:item(.*)",redirect:e=>Ai("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(AF),CF=(e,...t)=>{const[r,...n]=t.map(i=>{const o={"files-personal":Pr("files-spaces-generic").name,"files-favorites":Ti("files-common-favorites").name,"files-shared-with-others":kr("files-shares-with-others").name,"files-shared-with-me":kr("files-shares-with-me").name,"files-trashbin ":Ri("files-trash-generic").name,"files-public-list":Ai("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 zl(e,r,...n)},IF={name:"root",path:"/",redirect:e=>Pr("files-spaces-generic",e)},_F=e=>[IF,...GA(e),...XA(e),...YA(e),...KA(e),...JA(e),...RF()],ya=()=>{const e=Ge();return{getDefaultMetaFolder:async r=>{const{children:n}=await e.webdav.listFiles(r);return n.find(({name:i})=>i===".space")}}},rr=e=>{const t=bt(),r=ut(),n=ct(),i=B(()=>r.spaces),o=ha("driveAliasAndItem"),s=d=>h(e?.space)||h(i).find(f=>f.id===d),a=d=>{let f=d.storageId;(h(o)?.startsWith("public/")||h(o)?.startsWith("ocm/"))&&(f=h(o).split("/")[1]);const m=s(f);if(m&&!te.isMountPointSpaceResource(m))return m;const w=te.isShareResource(d)&&d.shareTypes.includes(te.ShareTypes.remote.value)||d?.id?.toString().startsWith(te.OCM_PROVIDER_ID)?"ocm-share":"share";let v;return d.remoteItemPath?v=pt.basename(d.remoteItemPath):h(o)?.startsWith("share/")||h(o)?.startsWith("ocm-share/")?v=h(o).split("/")[1]:v=d.name,r.getSpace(d.remoteItemId)||r.createShareSpace({driveAliasPrefix:w,id:d.remoteItemId,shareName:v})},l=d=>h(i).filter(f=>te.isMountPointSpaceResource(f)&&te.extractStorageId(f.root.remoteItem.rootId)===d.id);return{getInternalSpace:s,getMatchingSpace:a,isPersonalSpaceRoot:d=>d?.storageId&&d?.storageId===r.personalSpace?.storageId&&d?.path==="/"&&!te.isIncomingShareResource(d),isResourceAccessible:({space:d,path:f})=>{if(!n.options.routing.fullShareOwnerPaths)return!0;const m=h(i).some(v=>te.isProjectSpaceResource(v)&&v.id===d.id);return d.isOwner(t.user)||m||l(d).some(v=>f.startsWith(v.root.remoteItem.path))}}},$i=()=>{const e=Ge(),t=Ke();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 te.extractStorageId(o.parentFolderId)===t.currentFolder?.id&&t.upsertResource(o),o}}},ir=()=>bn("$loadingService"),va=()=>{const e=Xn(),t=Ge(),r=Fe.useGettext();return{headers:B(()=>{const i=new gc({accessToken:e.accessToken,publicLinkToken:e.publicLinkToken,publicLinkPassword:e.publicLinkPassword});return{"Accept-Language":r.current,"Initiator-ID":t.initiatorId,"X-Request-ID":Xt.v4(),...i.getHeaders()}})}};function OF(e){return new Worker("/assets/worker-Cgdggo8k.js",{name:e?.name})}const o0=({concurrentRequests:e=4}={})=>{const t=ct(),r=ir(),{headers:n}=va(),{createWorker:i,terminateWorker:o}=Fo(),s=({topic:l,space:u,resources:c},d)=>{const f=i(OF,{needsTokenRenewal:!0});let m;h(f.worker).onmessage=w=>{o(f.id),m?.(!0);const{successful:v,failed:E}=JSON.parse(w.data),b=E.map(({resource:g,...y})=>({resource:g,error:te.createHttpError(y)}));d({successful:v,failed:b})},r.addTask(()=>new Promise(w=>{m=w})),f.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:{...h(n),"X-Request-ID":void 0}}});return{startWorker:s}};function PF(e){return new Worker("/assets/worker-bk9PAyWf.js",{name:e?.name})}const s0=()=>{const e=ct(),t=ir(),{headers:r}=va(),{createWorker:n,terminateWorker:i}=Fo(),o=(a,l)=>{const u=n(PF,{needsTokenRenewal:!0});let c;h(u.worker).onmessage=d=>{i(u.id),c?.(!0);const{successful:f,failed:m}=JSON.parse(d.data),w=m.map(({resourceName:v,...E})=>({resourceName:v,error:te.createHttpError(E)}));l({successful:f,failed:w})},t.addTask(()=>new Promise(d=>{c=d})),u.post(s(a))},s=a=>JSON.stringify({topic:"startProcess",data:{transferData:a,baseUrl:e.serverUrl,headers:{...h(r),"X-Request-ID":void 0}}});return{startWorker:o}};function kF(e){return new Worker("/assets/worker-HJ1GIjJK.js",{name:e?.name})}const a0=()=>{const e=ct(),t=ir(),{headers:r}=va(),{createWorker:n,terminateWorker:i}=Fo(),o=({space:a,resources:l,missingFolderPaths:u},c)=>{const d=n(kF,{needsTokenRenewal:!0});let f;h(d.worker).onmessage=m=>{i(d.id),f?.(!0);const{successful:w,failed:v}=JSON.parse(m.data),E=v.map(({resource:b,...g})=>({resource:b,error:te.createHttpError(g)}));c({successful:w,failed:E})},t.addTask(()=>new Promise(m=>{f=m})),d.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:{...h(r),"X-Request-ID":void 0}}});return{startWorker:o}};function FF(e){return new Worker("/assets/worker-BBQqm_-D.js",{name:e?.name})}const xF=({authService:e})=>{const{createWorker:t}=Fo(),r=le();return{startWorker:()=>{r.value=t(FF),h(h(r).worker).onmessage=()=>{e.signinSilent().catch(async s=>{if(s instanceof RS.ErrorTimeout){console.warn("token renewal timed out, retrying in 5 seconds..."),h(r).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(!h(r)){console.error("token timer worker is not running");return}h(r).post(JSON.stringify({topic:"set",expiry:s,expiryThreshold:a}))},resetTokenTimer:()=>{if(!h(r)){console.error("token timer worker is not running");return}h(r).post(JSON.stringify({topic:"reset"}))}}},l0=()=>{const e=ct(),t=nt(),r=He(),n=Fe.useGettext(),{getMatchingSpace:i}=rr(),{$gettext:o,$ngettext:s}=n,a=Ge(),{dispatchModal:l}=ht(),u=ut(),c=Ln(),{startWorker:d}=o0({concurrentRequests:e.options.concurrentRequests.resourceBatchActions}),f=Ke(),{currentFolder:m}=Ve.storeToRefs(f),w=le([]),v=tr("page","1"),E=B(()=>parseInt(Rt(h(v)))),b=tr("items-per-page","1"),g=B(()=>parseInt(Rt(h(b)))),y=B(()=>hh(h(w))),p=B(()=>{const A=h(y),D=A[0].type==="folder";let H=null;return A.length===1?(D?H=o("Permanently delete folder »%{name}«",{name:A[0].name},!0):H=o("Permanently delete file »%{name}«",{name:A[0].name},!0),H):s("Permanently delete selected resource?","Permanently delete %{amount} selected resources?",A.length,{amount:A.length.toString()},!1)}),S=B(()=>{const A=h(y),D=A[0].type==="folder";return A.length===1?o(D?"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."):o("Are you sure you want to delete all selected resources? All their content will be permanently removed. This action cannot be undone.")}),T=A=>{const D=h(r.currentRoute);d({topic:"trashBinDelete",space:A,resources:h(y)},({successful:H,failed:_})=>{if(H.length){const x=H.length===1&&h(y).length===1?o('"%{item}" was deleted successfully',{item:H[0].name}):s("%{itemCount} item was deleted successfully","%{itemCount} items were deleted successfully",H.length,{itemCount:H.length.toString()},!0);t.showMessage({title:x})}_.forEach(({resource:x})=>{const z=o('Failed to delete "%{item}"',{item:x.name});t.showErrorMessage({title:z,errors:[new Error]})}),D.name===h(r.currentRoute).name&&D.query?.fileId===h(r.currentRoute).query?.fileId&&(f.removeResources(H),f.resetSelection())})};return{displayDialog:(A,D)=>{w.value=[...D],l({title:h(p),message:h(S),confirmText:o("Delete"),onConfirm:()=>T(A)})},filesList_delete:A=>{w.value=[...A],f.addResourcesIntoDeleteQueue(h(w).map(({id:_})=>_)),h(w).forEach(({id:_})=>f.removeSelection(_));const D=h(A).reduce((_,x)=>{if(x.storageId in _)return _[x.storageId].resources.push(x),_;const z=i(x);return z.id in _||(_[z.id]={space:z,resources:[]}),_[z.id].resources.push(x),_},{}),H=h(m)?.id;return Object.values(D).map(({space:_,resources:x})=>{d({topic:"fileListDelete",space:_,resources:x},async({successful:z,failed:G})=>{if(z.length){const ne=z.length===1&&A.length===1?o('"%{item}" was moved to trash bin',{item:z[0].name}):s("%{itemCount} item was moved to trash bin","%{itemCount} items were moved to trash bin",z.length,{itemCount:z.length.toString()},!0);t.showMessage({title:ne}),c.publish("runtime.resource.deleted",z)}if(f.removeResourcesFromDeleteQueue(G.map(({resource:ne})=>ne.id)),f.removeResourcesFromDeleteQueue(z.map(({id:ne})=>ne)),G.forEach(({error:ne,resource:ie})=>{let ee=o('Failed to delete "%{resource}"',{resource:ie.name});ne.statusCode===423&&(ee=o('Failed to delete "%{resource}" - the file is locked',{resource:ie.name})),t.showErrorMessage({title:ee,errors:[ne]})}),H===h(m)?.id){f.removeResources(z);const ne=f.activeResources.length,ie=Math.ceil(h(ne)/h(g));h(E)>1&&h(E)>ie&&(v.value=ie.toString())}if(gt(r,"files-spaces-generic")&&!["public","share"].includes(_?.driveType)){const ie=await a.graphAuthenticated.drives.getDrive(h(A)[0].storageId);u.updateSpaceField({id:ie.id,field:"spaceQuota",value:ie.spaceQuota})}if(h(w).length&&oo(h(w)[0],h(m)))return r.push(tn(_,{path:pt.dirname(h(w)[0].path),fileId:h(w)[0].parentFolderId}))})})}}},c0=()=>{const e=zt();return B(()=>h(e)?.query?.contextRouteName)},NF=e=>e==="files",An=()=>{const e=zt();return B(()=>NF(Xl(h(e))))},u0="rowMounted",Yf="fileDropped",DF="contextmenuClicked";class ni{static Thumbnail=[36,36];static Tile=[1e3,1e3];static Preview=[1200,1200];static Avatar=64}class $F{static Thumbnail="thumbnail";static Preview="preview";static Avatar="avatar"}const Jf=10,LF=63,Zf=256,ii=()=>{const{$gettext:e}=Fe.useGettext(),t=Ke();return{isSpaceNameValid:i=>i.trim()===""?{isValid:!1,error:e("The Space name cannot be empty")}:zf(i)>Zf?{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(zf(o)>Zf)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}}}},ba=()=>B(()=>!!document.getElementById("files-global-search-options"));function MF(e){return e==null}const BF="edit",jF="create",Hr=()=>{const e=rn(),t=He(),{$gettext:r}=Fe.useGettext(),n=ba(),{isEnabled:i}=ei(),{requestExtensions:o}=Ni(),s=An(),{openUrl:a}=M0(),l=ct(),{options:u}=Ve.storeToRefs(l),{actions:c}=wa(),{actions:d}=Sa(),{actions:f}=Ea(),{actions:m}=xo(),{actions:w}=Ta(),{actions:v}=Aa(),{actions:E}=No(),{actions:b}=od(),{actions:g}=Ra(),{actions:y}=sd(),{actions:p}=Ca(),{actions:S}=Ia(),{actions:T}=ud(),R=B(()=>[...h(y),...h(v),...h(E),...h(m),...h(g),...h(f),...h(p),...h(T),...h(S),...h(c),...h(d),...h(w),...h(b)]),I=B(()=>o({id:"global.files.default-actions",extensionType:"action"}).map(ue=>ue.action)),A=B(()=>o({id:"global.files.context-actions",extensionType:"action"}).map(ee=>ee.action)),D=B(()=>[{name:"open",icon:"eye",label:()=>r("Open"),handler:({space:ee,resources:ue})=>{const de=ne({space:ee,resources:ue,omitSystemActions:!0});de&&de.handler({space:ee,resources:ue})},isVisible:ee=>{const ue=ne({...ee,omitSystemActions:!0});return ue?ue.isVisible(ee):!1},class:"oc-files-actions-default-editor-trigger"}]),H=B(()=>h(i)?[]:e.fileExtensions.map(ee=>{const ue=e.apps[ee.app];return{name:`editor-${ee.app}`,label:()=>ee.label?typeof ee.label=="function"?ee.label():ee.label:ue.name,icon:ee.icon||ue.icon,...ue.iconFillType&&{iconFillType:ue.iconFillType},img:ue.img,route:({space:de,resources:ce})=>_({appFileExtension:ee,space:de,resource:ce[0]}),handler:de=>z(ee,de.space,de.resources[0]),isVisible:({resources:de})=>!h(s)||de.length!==1||!de[0].canDownload()&&!ee.secureView||!h(n)&&gr(t,"files-trash-generic")?!1:de[0].extension&&ee.extension?de[0].extension.toLowerCase()===ee.extension.toLowerCase():de[0].mimeType&&ee.mimeType?de[0].mimeType.toLowerCase()===ee.mimeType.toLowerCase()||de[0].mimeType.split("/")[0].toLowerCase()===ee.mimeType.toLowerCase():!1,hasPriority:ee.hasPriority,class:`oc-files-actions-${Vb(ue.name).toLowerCase()}-trigger`}}).sort((ee,ue)=>ue.hasPriority!==ee.hasPriority&&ue.hasPriority?1:0)),_=({appFileExtension:ee,space:ue,resource:de})=>{const ce=te.isShareSpaceResource(ue)?ue.id:void 0,X=ee.routeName||ee.app,oe=x(X,ue,de,ce);return t.resolve(oe)},x=(ee,ue,de,ce,X)=>({name:ee,params:{driveAliasAndItem:ue?.getDriveAliasAndItem(de)},query:{...ce&&{shareId:ce},...de.fileId&&h(u).routing.idBased&&{fileId:de.fileId},...X&&{templateId:X},...ga(h(t.currentRoute))}}),z=(ee,ue,de)=>{const ce=te.isShareSpaceResource(ue)?ue.id:void 0,X=ee.routeName||ee.app,oe=x(X,ue,de,ce);if(h(u).cernFeatures){const ae=t.resolve(oe).href,Ce=`${ee.routeName}-${de.path}`;a(ae,Ce,!0);return}t.push(oe)},G=ee=>{ne(ee).handler({...ee})},ne=ee=>{const ue=ie(ee);if(ue.length)return ue[0]},ie=ee=>{const ue=X=>X.isVisible(ee),de=[...h(I),...h(H)].filter(ue).sort((X,oe)=>Number(oe.hasPriority)-Number(X.hasPriority)),ce=ee.omitSystemActions?[]:h(R).filter(ue);return[...de,...ce,...h(A).filter(X=>X.isVisible(ee)&&(X.category==="actions"||MF(X.category)))]};return{editorActions:H,defaultEditorActions:D,systemActions:R,getDefaultAction:ne,getAllAvailableActions:ie,getEditorRouteOpts:x,openEditor:z,triggerDefaultAction:G}},wa=()=>{const{showMessage:e,showErrorMessage:t}=nt(),r=He(),{$gettext:n,$ngettext:i}=Fe.useGettext(),o=Ge(),s=ir(),a=ct(),l=Ke(),{updateResourceField:u}=l,c=async({resources:f})=>{const m=[],w=[],v=new On({concurrency:a.options.concurrentRequests.resourceBatchActions});if(f.forEach(E=>{w.push(v.add(async()=>{try{const{graphAuthenticated:b}=o;await b.driveItems.createDriveItem(E.driveId,{name:E.name,remoteItem:{id:E.fileId}}),u({id:E.id,field:"syncEnabled",value:!0})}catch(b){console.error(b),m.push(b)}}))}),await Promise.all(w),m.length===0){l.resetSelection(),gt(r,"files-spaces-generic")&&e({title:i("Sync for the selected share was enabled successfully","Sync for the selected shares was enabled successfully",f.length)});return}t({title:i("Failed to enable sync for the the selected share","Failed to enable sync for the selected shares",f.length),errors:m})};return{actions:B(()=>[{name:"enable-sync",icon:"check",handler:f=>s.addTask(()=>c(f)),label:()=>n("Enable sync"),isVisible:({space:f,resources:m})=>!Lt(r,"files-shares-with-me")&&!gt(r,"files-spaces-generic")||m.length===0||gt(r,"files-spaces-generic")&&(h(f)?.driveType!=="share"||m.length>1||m[0].path!=="/")?!1:m.some(w=>!w.syncEnabled),class:"oc-files-actions-enable-sync-trigger"}])}},Sa=()=>{const{showMessage:e,showErrorMessage:t}=nt(),r=He(),{$gettext:n}=Fe.useGettext(),i=Ge(),o=ir(),s=ct(),{updateResourceField:a,resetSelection:l}=Ke(),u=async({resources:d})=>{const f=[],m=[],w=new On({concurrency:s.options.concurrentRequests.resourceBatchActions}),v=!d[0].hidden;if(d.forEach(E=>{m.push(w.add(async()=>{try{await i.graphAuthenticated.driveItems.updateDriveItem(E.driveId,E.id,{"@UI.Hidden":v}),a({id:E.id,field:"hidden",value:v})}catch(b){console.error(b),f.push(b)}}))}),await Promise.all(m),f.length===0){l(),e({title:n(v?"The share was hidden successfully":"The share was unhidden successfully")});return}t({title:n(v?"Failed to hide the share":"Failed to unhide the share"),errors:f})};return{actions:B(()=>[{name:"toggle-hide-share",icon:"eye-off",handler:d=>o.addTask(()=>u(d)),label:({resources:d})=>d[0].hidden?n("Unhide"):n("Hide"),isVisible:({resources:d})=>d.length===0?!1:Lt(r,"files-shares-with-me"),class:"oc-files-actions-hide-share-trigger"}])}},Ea=()=>{const e=ct(),t=He(),{copyResources:r}=Oo(),n=Fe.useGettext(),{$gettext:i}=n,o=Ke(),{currentFolder:s}=Ve.storeToRefs(o),a=B(()=>ca()?i("⌘ + C"):i("Ctrl + C")),l=({resources:c})=>{It(t,"files-common-search")&&(c=c.filter(d=>!te.isProjectSpaceResource(d))),r(c)};return{actions:B(()=>[{name:"copy",icon:"file-copy-2",handler:l,shortcut:h(a),label:()=>i("Copy"),isVisible:({resources:c})=>{if(!gt(t,"files-spaces-generic")&&!Rr(t,"files-public-link")&&!It(t,"files-common-favorites")&&!It(t,"files-common-search")||gt(t,"files-spaces-projects")||c.length===0)return!1;if(Rr(t,"files-public-link"))return h(s)?.canCreate();if(It(t,"files-common-search")&&c.every(d=>te.isProjectSpaceResource(d)))return!1;if(h(e.options.runningOnEos)){const d=c[0].path?.split("/").filter(Boolean)||[];if(gt(t,"files-spaces-generic")&&d.length<5)return!1}return!!h(c)[0].canDownload()},class:"oc-files-actions-copy-trigger"}])}},ed=()=>({copyToClipboard:t=>{if(navigator?.clipboard?.write)return navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"})})]);{const{copy:r}=ln.useClipboard({legacy:!0});return r(t)}}});var Rn=(e=>(e.C="c",e.V="v",e.X="x",e.A="a",e.S="s",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))(Rn||{}),td=(e=>(e.Ctrl="Control",e.Shift="Shift",e))(td||{});const UF=()=>{const e=document.activeElement.tagName,t=document.activeElement.getAttribute("type");if(["textarea","input","select"].includes(e.toLowerCase())&&t!=="checkbox")return!0;const r=document.activeElement;if(!r)return!1;let n;try{n=r?.closest("[data-custom-key-bindings-disabled='true']")}catch{n=r?.parentElement.closest("[data-custom-key-bindings-disabled='true']")}return n?!0:window.getSelection().type==="Range"},rd=e=>{const t=le([]),r=le(0),n=a=>{if(!e?.skipDisabledKeyBindingsCheck&&UF())return;const{key:l,ctrlKey:u,metaKey:c,shiftKey:d}=a;let f=null;const m=[];c||u?(f="Control",m.push("altKey","shiftKey")):d&&(f="Shift",m.push("altKey","ctrlKey","metaKey")),!((v,E)=>E.some(b=>v[b]))(a,m)&&h(t).filter(v=>v.primary===l&&v.modifier===f).forEach(v=>{v.preventDefault&&a.preventDefault(),v.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=()=>{r.value=0};return ln.useEventListener(document,"keydown",n),{actions:t,bindKeyAction:i,removeKeyAction:o,selectionCursor:r,resetSelectionCursor:s}};function oi(){return{interceptModifierClick:(t,r)=>{if(!t||!r)return!1;const n=t.shiftKey,i=t.ctrlKey||t.metaKey;return!n&&!i?!1:(t.stopPropagation?.(),t.stopImmediatePropagation?.(),n&&ze.publish("app.files.list.clicked.shift",{resource:r,skipTargetSelection:!1}),i&&ze.publish("app.files.list.clicked.meta",r),!0)}}}const nd=()=>{const e=rd(),t=10,r=.1;return{setCropperInstance:i=>{e.bindKeyAction({primary:Rn.ArrowRight},()=>h(i)?.move(-t,0)),e.bindKeyAction({primary:Rn.ArrowLeft},()=>h(i)?.move(t,0)),e.bindKeyAction({primary:Rn.ArrowDown},()=>h(i)?.move(0,-t)),e.bindKeyAction({primary:Rn.ArrowUp},()=>h(i)?.move(0,t)),e.bindKeyAction({primary:Rn.Plus},()=>h(i)?.zoom(r)),e.bindKeyAction({primary:Rn.Minus},()=>h(i)?.zoom(-r))}}},id=()=>{const{showMessage:e,showErrorMessage:t}=nt(),{$gettext:r}=Fe.useGettext(),{copyToClipboard:n}=ed(),{interceptModifierClick:i}=oi(),o=async a=>{try{await n(a),e({title:r("The link has been copied to your clipboard.")})}catch(l){t({title:r("Copy link failed"),errors:[l]})}};return{actions:B(()=>[{name:"copy-permanent-link",icon:"link",label:()=>r("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||te.isPublicSpaceResource(a)||te.isTrashResource(l[0])),class:"oc-files-actions-copy-permanent-link-trigger"}])}},Ta=()=>{const{showMessage:e,showErrorMessage:t}=nt(),r=He(),{$gettext:n,$ngettext:i}=Fe.useGettext(),o=Ge(),s=ir(),a=ct(),{updateResourceField:l}=Ke(),u=async({resources:d})=>{const f=[],m=[],w=new On({concurrency:a.options.concurrentRequests.resourceBatchActions});if(d.forEach(v=>{m.push(w.add(async()=>{try{const{graphAuthenticated:E}=o;await E.driveItems.deleteDriveItem(v.driveId,v.id),l({id:v.id,field:"syncEnabled",value:!1})}catch(E){console.error(E),f.push(E)}}))}),await Promise.all(m),f.length===0){gt(r,"files-spaces-generic")&&(e({title:i("Sync for the selected share was disabled successfully","Sync for the selected shares was disabled successfully",d.length)}),r.push(kr("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",d.length),errors:f})};return{actions:B(()=>[{name:"disable-sync",icon:"spam-3",handler:d=>s.addTask(()=>u(d)),label:()=>n("Disable sync"),isVisible:({space:d,resources:f})=>!Lt(r,"files-shares-with-me")&&!gt(r,"files-spaces-generic")||f.length===0||gt(r,"files-spaces-generic")&&(d?.driveType!=="share"||f.length>1||f[0].path!=="/")?!1:f.some(m=>m.syncEnabled),class:"oc-files-actions-disable-sync-trigger"}])}},xo=()=>{const e=bt(),t=er(),r=He(),n=c0(),{displayDialog:i,filesList_delete:o}=l0(),{$gettext:s}=Fe.useGettext(),a=({space:u,resources:c,deletePermanent:d})=>{if(It(r,"files-common-search")&&(c=c.filter(f=>f.canBeDeleted()&&!f.isShareRoot()&&!te.isProjectSpaceResource(f))),d){i(u,c);return}o(c)};return{actions:B(()=>[{name:"delete",icon:"delete-bin-5",label:()=>s("Delete"),handler:({space:u,resources:c})=>a({space:u,resources:c,deletePermanent:!1}),isVisible:({space:u,resources:c})=>!gt(r,"files-spaces-generic")&&!Rr(r,"files-public-link")&&!It(r,"files-common-search")&&!h(n)||c.length===0||gt(r,"files-spaces-generic")&&u?.driveType==="share"&&c[0].path==="/"||c.length===1&&c[0].locked?!1:It(r,"files-common-search")?c.some(d=>d.canBeDeleted()&&!d.isShareRoot()&&!te.isProjectSpaceResource(d)):!c.some(d=>!d.canBeDeleted()||te.isProjectSpaceResource(d)),class:"oc-files-actions-delete-trigger"},{name:"delete-permanent",icon:"delete-bin-5",label:()=>s("Delete"),handler:({space:u,resources:c})=>a({space:u,resources:c,deletePermanent:!0}),isVisible:({space:u,resources:c})=>!gr(r,"files-trash-generic")||!t.filesPermanentDeletion||te.isProjectSpaceResource(u)&&!u.canDeleteFromTrashBin({user:e.user})?!1:c.length>0,class:"oc-files-actions-delete-permanent-trigger"}])}};function qF(e){return e&&e.length?e[0]:void 0}const f0=()=>bn("$archiverService"),Aa=()=>{const{showErrorMessage:e}=nt(),t=He(),r=ir(),n=f0(),{$ngettext:i,$gettext:o,current:s}=Fe.useGettext(),a=Xn(),l=An(),u=({space:f,resources:m})=>{m.length>1&&(m=m.filter(v=>v.canDownload()&&!te.isProjectSpaceResource(v)));const w=h(n.fileIdsSupported)?{fileIds:m.map(v=>v.fileId)}:{dir:Cs.dirname(qF(m).path)||"/",files:m.map(v=>v.name)};return n.triggerDownload({...w,...f&&te.isPublicSpaceResource(f)&&{publicToken:f.id,publicLinkPassword:a.publicLinkPassword}}).catch(v=>{console.error(v),e({title:i("Failed to download the selected folder.","Failed to download the selected files.",m.length),errors:[v]})})},c=f=>{const m=h(n.capability);return m?f.reduce((v,E)=>v+parseInt(`${E.size}`),0)>parseInt(m.max_size):void 0};return{actions:B(()=>[{name:"download-archive",icon:"inbox-archive",handler:async f=>{await r.addTask(()=>u(f))},label:()=>o("Download"),disabledTooltip:({resources:f})=>c(f)?o("The selection exceeds the allowed archive size (max. %{maxSize})",{maxSize:yr(h(n.capability).max_size,s)}):"",isDisabled:({resources:f})=>c(f),isVisible:({resources:f})=>h(l)&&!gt(t,"files-spaces-generic")&&!Rr(t,"files-public-link")&&!It(t,"files-common-favorites")&&!It(t,"files-common-search")&&!Lt(t,"files-shares-with-me")&&!Lt(t,"files-shares-with-others")&&!Lt(t,"files-shares-via-link")&&!It(t,"files-common-search")||!h(n.available)||f.length===0||f.length===1&&!f[0].isFolder||f.length>1&&f.every(w=>te.isProjectSpaceResource(w))||te.isProjectSpaceResource(f[0])&&f[0].disabled||!h(n.fileIdsSupported)&&It(t,"files-common-favorites")?!1:!f.some(w=>!w.canDownload()),class:"oc-files-actions-download-archive-trigger"}])}},d0=e=>{const{showErrorMessage:t}=nt(),r=e?.clientService||Ge(),{$gettext:n}=Fe.useGettext(),i=er(),o=bt();return{downloadFile:async(a,l,u=null)=>{try{const c=await r.webdav.getFileUrl(a,l,{version:u,doHeadRequest:!0,isUrlSigningEnabled:i.supportUrlSigning,username:o.user?.onPremisesSamAccountName});hc(c,l.name)}catch(c){console.error(c),t({title:n("Download failed"),desc:n("File could not be located"),errors:[c]})}}}},No=()=>{const e=He(),{$gettext:t}=Fe.useGettext(),r=An(),n=ba(),{downloadFile:i}=d0(),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})=>h(r)&&!h(n)&&!gt(e,"files-spaces-generic")&&!Rr(e,"files-public-link")&&!It(e,"files-common-favorites")&&!It(e,"files-common-search")&&!Lt(e,"files-shares-with-me")&&!Lt(e,"files-shares-with-others")&&!Lt(e,"files-shares-via-link")||a.length!==1||a[0].isFolder?!1:a[0].canDownload(),class:"oc-files-actions-download-file-trigger"}])}},VF=()=>{const{showMessage:e,showErrorMessage:t}=nt(),r=bt(),n=er(),{$gettext:i}=Fe.useGettext(),o=Ge(),{dispatchModal:s}=ht(),a=Ke(),l=ut(),u=ir(),c=async({space:m})=>{try{await o.webdav.clearTrashBin(m),e({title:i("All deleted files were removed")}),a.clearResources(),a.resetSelection(),l.updateSpaceField({id:m.id,field:"hasTrashedItems",value:!1})}catch(w){console.error(w),t({title:i("Failed to empty trash bin"),errors:[w]})}},d=({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:"delete-bin-2",label:()=>i("Empty trash bin"),handler:d,isVisible:({resources:m})=>m.length!==1||!n.filesPermanentDeletion||!te.isSpaceResource(m[0])?!1:m[0].canDeleteFromTrashBin({user:r.user}),isDisabled:({resources:m})=>!m[0].hasTrashedItems,class:"oc-files-actions-empty-trash-bin-trigger"}]),emptyTrashBin:c}},od=()=>{const{showErrorMessage:e}=nt(),t=er(),r=He(),{$gettext:n}=Fe.useGettext(),i=Ge(),o=An(),s=ur(),a=Ke(),l=Ln(),u=async({space:d,resources:f})=>{try{const m=!f[0].starred;await i.webdav.setFavorite(d,f[0],m),a.updateResourceField({id:f[0].id,field:"starred",value:m}),m||l.publish("app.files.list.removeFromFavorites",f[0].id)}catch(m){const w=n('Failed to change favorite state of "%{file}"',{file:f[0].name},!0);e({title:w,errors:[m]})}};return{actions:B(()=>[{name:"favorite",icon:"star",handler:u,label:({resources:d})=>d[0].starred?n("Remove from favorites"):n("Add to favorites"),isVisible:({resources:d})=>h(o)&&!gt(r,"files-spaces-generic")&&!It(r,"files-common-favorites")||d.length!==1?!1:t.filesFavorites&&s.can("create","Favorite"),class:"oc-files-actions-favorite-trigger"}])}};function zF(e,t){const r=e.isReceivedShare()||e.isMounted(),n=t===""&&r;return e.canBeDeleted()&&!n}const Ra=()=>{const e=He(),{cutResources:t}=Oo(),r=Fe.useGettext(),{$gettext:n}=r,i=Ke(),{currentFolder:o}=Ve.storeToRefs(i),s=B(()=>ca()?n("⌘ + X"):n("Ctrl + X")),a=({resources:u})=>{t(u)};return{actions:B(()=>[{name:"cut",icon:"scissors",handler:a,shortcut:h(s),label:()=>n("Cut"),isVisible:({resources:u})=>!gt(e,"files-spaces-generic")&&!Rr(e,"files-public-link")&&!It(e,"files-common-favorites")||u.length===0||!h(o)||u.length===1&&u[0].locked?!1:!u.some(d=>zF(d,h(o).path)===!1),class:"oc-files-actions-move-trigger"}])}},sd=()=>{const e=He(),{$gettext:t}=Fe.useGettext(),{getMatchingSpace:r}=rr(),n=Ke(),{currentFolder:i}=Ve.storeToRefs(n),o=l=>l||r(l),s=B(()=>Rr(e,"files-public-link")?Ai("files-public-link"):Pr("files-spaces-generic"));return{actions:B(()=>[{name:"navigate",icon:"folder-open",label:()=>t("Open"),isVisible:({resources:l})=>!(gr(e,"files-trash-generic")||l.length!==1||h(i)!==null&&oo(l[0],h(i))||!l[0].isFolder||l[0].type==="space"),route:({space:l,resources:u})=>po({},h(s),tn(o(l),{path:u[0].path,fileId:u[0].fileId})),class:"oc-files-actions-navigate-trigger"}])}},p0=()=>{const e=He(),t=Ge(),{getMatchingSpace:r}=rr(),{$gettext:n,$ngettext:i}=Fe.useGettext(),o=Oo(),{startWorker:s}=s0(),a=Ke(),{currentFolder:l}=Ve.storeToRefs(a),u=B(()=>ca()?n("⌘ + V"):n("Ctrl + V")),c=B(()=>o.action===Co.Cut?gn.MOVE:gn.COPY),d=async({targetSpace:w,sourceSpace:v,resources:E})=>{const b=new bh(v,E,w,h(l),l,t,n,i),g=await b.getTransferData(h(c));if(!g.length)return;const y=h(l)?.id;s(g,async({successful:p,failed:S})=>{if(b.showResultMessage(S,p,h(c)),!p.length||h(l)&&y!==h(l).id)return;const T=[],R=[];for(const I of p)T.push((async()=>{const A=await t.webdav.getFileInfo(w,I);R.push(A)})());await Promise.allSettled(T),te.isShareSpaceResource(w)&&R.forEach(I=>{I.remoteItemId=w.id}),a.upsertResources(R)})},f=async({space:w})=>{const v=o.resources.reduce((b,g)=>{if(g.storageId in b)return b[g.storageId].resources.push(g),b;const y=r(g);return y.id in b||(b[y.id]={space:y,resources:[]}),b[y.id].resources.push(g),b},{}),E=Object.values(v).map(({space:b,resources:g})=>d({targetSpace:w,sourceSpace:b,resources:g}));await Promise.all(E),o.clearClipboard()};return{actions:B(()=>[{name:"paste",icon:"clipboard",handler:f,label:()=>n("Paste"),shortcut:h(u),isVisible:({resources:w})=>o.resources.length===0||!gt(e,"files-spaces-generic")&&!Rr(e,"files-public-link")&&!It(e,"files-common-favorites")||w.length===0?!1:Rr(e,"files-public-link")&&h(l)?h(l)?.canCreate():!0,class:"oc-files-actions-copy-trigger"}])}},Ca=()=>{const{showErrorMessage:e}=nt(),t=er(),r=He(),{$gettext:n}=Fe.useGettext(),i=Ge(),o=ct(),{dispatchModal:s}=ht(),a=bt(),l=ur(),u=Ke(),{setCurrentFolder:c,upsertResource:d}=u,{isFileNameValid:f}=ii(),m=async(E,b,g)=>{let y=u.currentFolder;try{const p=pt.join(pt.dirname(b.path),g);await i.webdav.moveFiles(E,b,E,{path:p});const S=oo(b,y);if(te.isShareSpaceResource(E)&&b.isReceivedShare()){if(E.rename(g),S)return y={...y},y.name=g,c(y),r.push(tn(E,{path:"",fileId:b.fileId}));const R={...b};R.name=g,d(R);return}if(S)return y={...y},Pl(E,y,p),c(y),r.push(tn(E,{path:p,fileId:b.fileId}));const T={...b};Pl(E,T,p),d(T)}catch(p){console.error(p);let S=n('Failed to rename "%{file}" to »%{newName}«',{file:b.name,newName:g},!0);p.statusCode===423&&(S=n("Failed to rename »%{file}« to »%{newName}« - the file is locked",{file:b.name,newName:g},!0)),e({title:S,errors:[p]})}},w=async({space:E,resources:b})=>{const g=u.currentFolder;let y;if(oo(b[0],g)){const _=pt.dirname(g.path);y=(await i.webdav.listFiles(E,{path:_})).children}const p=u.areFileExtensionsShown,S=async _=>{p||(_=`${_}.${b[0].extension}`),await m(E,b[0],_)},T=(_,x)=>{p||(_=`${_}.${b[0].extension}`);const{isValid:z,error:G}=f(b[0],_,y);x(z?null:G)},R=te.extractNameWithoutExtension(b[0]),I=!b[0].isFolder&&!p?R:b[0].name,A=b[0].isFolder?n("Rename folder »%{name}«",{name:I}):n("Rename file »%{name}«",{name:I}),D=!b[0].isFolder&&!p?R:b[0].name,H=b[0].isFolder||!p?null:[0,R.length];s({title:A,confirmText:n("Rename"),hasInput:!0,inputValue:D,inputSelectionRange:H,inputLabel:b[0].isFolder?n("Folder name"):n("File name"),inputRequiredMark:!0,onConfirm:S,onInput:T})};return{actions:B(()=>[{name:"rename",icon:"pencil",label:()=>n("Rename"),handler:w,isVisible:({resources:E})=>gr(r,"files-trash-generic")||Lt(r,"files-shares-with-me")&&!t.sharingCanRename||E.length!==1||(o.options.routing.fullShareOwnerPaths?E.some(y=>y.remoteItemPath&&y.path):E.some(y=>y.remoteItemId&&y.path==="/"))||E.length===1&&E[0].locked?!1:!E.some(y=>!y.canRename({user:a.user,ability:l})||y.processing),class:"oc-files-actions-rename-trigger"}]),renameResource:m}},Ia=()=>{const{showMessage:e,showErrorMessage:t}=nt(),r=bt(),n=He(),{$gettext:i,$ngettext:o}=Fe.useGettext(),s=Ge(),a=ut(),l=Ke(),{startWorker:u}=a0(),c=async(v,E)=>{const b={},g=[],y=[],p=[];for(const S of E){const T=pt.dirname(S.path);let R=[];if(T in b)R=b[T];else{try{R=(await s.webdav.listFiles(v,{path:T})).children}catch{p.push(T)}b[T]=R}R.some(A=>A.name===S.name)||y.filter(A=>A.id!==S.id).some(A=>A.path===S.path)?g.push(S):y.push(S)}return{existingResourcesByPath:b,conflicts:g,resolvedResources:y,missingFolderPaths:p.filter(S=>!b[S]?.length)}},d=async v=>{let E=0;const b=[],g=v.length;let y=!1,p;for(const S of v){const T=S.type==="folder";if(y){b.push({resource:S,strategy:p});continue}const R=g-E,A=await new _l(i,o).resolveFileExists({name:S.name,isFolder:T},R,!1);E++,A.doForAllConflicts&&(y=!0,p=A.strategy),b.push({resource:S,strategy:A.strategy})}return b},f=(v,E,b)=>{const g=h(n.currentRoute);u({space:v,resources:E,missingFolderPaths:b},async({successful:y,failed:p})=>{if(y.length){let S;y.length===1?S=i("%{resource} was restored successfully",{resource:y[0].name}):S=i("%{resourceCount} files restored successfully",{resourceCount:y.length.toString()}),e({title:S}),g.name===h(n.currentRoute).name&&g.query?.fileId===h(n.currentRoute).query?.fileId&&(l.removeResources(y),l.resetSelection());const R=await s.graphAuthenticated.drives.getDrive(v.id);a.updateSpaceField({id:R.id,field:"spaceQuota",value:R.spaceQuota})}if(p.length){let S;const T={};p.length===1?(T.resource=p[0].resource.name,S=i('Failed to restore "%{resource}"',T,!0)):(T.resourceCount=p.length.toString(),S=i("Failed to restore %{resourceCount} files",T,!0)),t({title:S,errors:p.map(({error:R})=>R)})}})},m=async({space:v,resources:E})=>{const b=E.sort((A,D)=>A.path.length-D.path.length),{existingResourcesByPath:g,conflicts:y,resolvedResources:p,missingFolderPaths:S}=await c(v,b),T=await d(y),R=T.filter(A=>A.strategy===qr.REPLACE).map(A=>A.resource);p.push(...R);const I=T.filter(A=>A.strategy===qr.KEEP_BOTH).map(A=>A.resource);for(let A of I){A={...A};const D=pt.dirname(A.path),H=g[D]||[],_=te.extractExtensionFromFile(A),x=Ur(A.name,_,[...H,...T.map(z=>z.resource),...p]);A.name=x,A.path=te.urlJoin(D,x),p.push(A)}return f(v,p,S)};return{actions:B(()=>[{name:"restore",icon:"arrow-go-back",label:()=>i("Restore"),handler:m,isVisible:({space:v,resources:E})=>!gr(n,"files-trash-generic")||!E.every(b=>te.isTrashResource(b)&&b.canBeRestored())||te.isProjectSpaceResource(v)&&!v.canRestoreFromTrashbin({user:r.user})?!1:E.length>0,class:"oc-files-actions-restore-trigger"}]),restoreResources:f,collectConflicts:c}},ad=()=>bn("$previewService"),WF={class:W.normalizeClass(["[&_.cropper-crop-box]:!outline-1","[&_.cropper-crop-box]:!outline-role-outline","[&_.cropper-line]:!bg-role-outline","[&_.cropper-point]:!bg-role-outline"])},HF={key:0,class:"max-h-[400px]"},GF=["src"],KF={class:"text-sm text-role-on-surface-variant flex items-center mt-1"},QF=["textContent"],h0=xe({__name:"SpaceImageModal",props:{modal:{},space:{},file:{}},setup(e,{expose:t}){const{showMessage:r,showErrorMessage:n}=nt(),{$gettext:i}=Fe.useGettext(),o=Ge(),s=ut(),{createDefaultMetaFolder:a}=$i(),{getDefaultMetaFolder:l}=ya(),{setCropperInstance:u}=nd(),c=le(null),d=Wn("imageRef"),f=le(null);t({onConfirm:async()=>{const E=h(c)?.getCroppedCanvas({imageSmoothingQuality:"high"}),b=await w(E);await v(b)}});const w=async E=>(await new Promise(g=>E.toBlob(g,"image/png"))).arrayBuffer(),v=async E=>{const b=o.graphAuthenticated;s.addToImagesLoading(e.space.id);let g=await l(e.space);g||(g=await a(e.space));const y={"Content-Type":"application/offset+octet-stream"};try{const{fileId:p,processing:S}=await o.webdav.putFileContents(e.space,{parentFolderId:g.id,fileName:"image.png",content:E,headers:y,overwrite:!0}),T=await b.drives.updateDrive(e.space.id,{name:e.space.name,special:[{specialFolder:{name:"image"},id:p}]});S||s.removeFromImagesLoading(e.space.id),s.updateSpaceField({id:e.space.id,field:"spaceImageData",value:T.spaceImageData}),r({title:i("Space image was set successfully")}),ze.publish("app.files.spaces.uploaded-image",T)}catch(p){if(console.error(p),s.removeFromImagesLoading(e.space.id),p instanceof te.HttpError&&p.statusCode===507){n({title:i("Failed to set space image"),desc:i("Not enough quota to set the space image"),errors:[p]});return}n({title:i("Failed to set space image"),errors:[p]})}};return $t(async()=>{try{f.value=URL.createObjectURL(e.file),h(c)&&h(c)?.destroy(),await ar(),c.value=new Wa(h(d),{aspectRatio:16/9,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1}),u(c)}catch(E){n({title:i("Failed to load space image"),errors:[E]})}}),(E,b)=>{const g=be("oc-icon");return Q(),ye("div",WF,[f.value?(Q(),ye("div",HF,[fe("img",{ref_key:"imageRef",ref:d,src:f.value},null,8,GF),fe("div",KF,[ge(g,{class:"mr-1",name:"information",size:"small","fill-type":"line"}),fe("span",{textContent:W.toDisplayString(h(i)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:h(i)("+-"),panKeys:h(i)("↑↓←→")}))},null,8,QF)])])):_e("",!0)])}}}),m0=()=>{const e=bt(),t=He(),{$gettext:r}=Fe.useGettext(),n=Ge(),i=ir();ad();const{dispatchModal:o}=ht(),s=async({space:l,resources:u})=>{const{getFileContents:c}=n.webdav,d=await c(l,u[0],{responseType:"blob"}),f=new File([d.body],u[0].name);o({title:r("Crop your Space image"),confirmText:r("Confirm"),customComponent:h0,customComponentAttrs:()=>({file:f,space:l})})};return{actions:B(()=>[{name:"set-space-image",icon:"image-edit",handler:l=>i.addTask(()=>s(l)),label:()=>r("Set as space image"),isVisible:({space:l,resources:u})=>u.length!==1||!u[0].mimeType||!gt(t,"files-spaces-generic")||!l?!1:l.canEditImage({user:e.user}),class:"oc-files-actions-set-space-image-trigger"}])}},XF=()=>{const e=He(),{$gettext:t}=Fe.useGettext(),r=An(),n=()=>{const o=gr(e,"files-trash-generic")?null:"actions";ze.publish(Tt.openWithPanel,o)};return{actions:B(()=>[{name:"show-actions",icon:"slideshow-3",label:()=>t("All Actions"),handler:n,isVisible:({resources:o})=>h(r)?o.length===1:!1,class:"oc-files-actions-show-actions-trigger"}])}},ld=()=>{const e=He(),t=Ke(),{$gettext:r}=Fe.useGettext();return{actions:B(()=>[{name:"show-details",icon:"information",class:"oc-files-actions-show-details-trigger",label:()=>r("Details"),isVisible:({resources:i})=>gr(e,"files-trash-generic")?!1:i.length>0,handler({resources:i}){t.setSelection(i.map(({id:o})=>o)),ze.publish(Tt.open)}}])}},g0=()=>{const e=er(),{isPersonalSpaceRoot:t}=rr();return{canListShares:({space:n,resource:i})=>!e.sharingApiEnabled||te.isPublicSpaceResource(n)||t(i)||te.isTrashResource(i)?!1:te.isIncomingShareResource(i)?i.sharePermissions.includes(te.GraphSharePermission.readPermissions):te.isShareSpaceResource(n)?n.graphPermissions?.includes(te.GraphSharePermission.readPermissions):!0}},y0=()=>{const e=er(),t=ur(),r=bt();return{canShare:({space:i,resource:o})=>!e.sharingApiEnabled||te.isShareSpaceResource(i)||te.isProjectSpaceResource(i)&&!i.canShare({user:r.user})?!1:o.canShare({ability:t,user:r.user})}},cd=()=>{const e=He(),{$gettext:t}=Fe.useGettext(),{canShare:r}=y0();Ke();const{interceptModifierClick:n}=oi(),i=({resources:s,event:a})=>{const l=s[0];a&&n(a,l)||ze.publish(Tt.openWithPanel,"sharing#peopleShares")};return{actions:B(()=>[{name:"show-shares",icon:"user-add",label:()=>t("Share"),handler:i,isVisible:({space:s,resources:a})=>gr(e,"files-trash-generic")||a.length!==1?!1:r({space:s,resource:a[0]}),class:"oc-files-actions-show-shares-trigger"}])}},ud=()=>{const{showMessage:e,showErrorMessage:t}=nt(),{can:r}=ur(),{$gettext:n,$ngettext:i}=Fe.useGettext(),{createSpace:o}=$i(),s=Ge(),a=He(),l=B(()=>r("create-all","Drive")),{dispatchModal:u}=ht(),c=ct(),d=ut(),f=Ke(),{isSpaceNameValid:m}=ii(),w=async({spaceName:b,resources:g,space:y})=>{const{webdav:p}=s,S=new On({concurrency:c.options.concurrentRequests.resourceBatchActions}),T=[];try{const R=await o(b);d.upsertSpace(R),g.length===1&&g[0].isFolder&&(g=(await p.listFiles(y,{path:g[0].path})).children);for(const I of g)T.push(S.add(()=>p.copyFiles(y,I,R,{path:I.name})));await Promise.all(T),f.resetSelection(),e({title:n("Space was created successfully")})}catch(R){console.error(R),t({title:n("Creating space failed…"),errors:[R]})}},v=({resources:b,space:g})=>{u({title:i("Create Space from »%{resourceName}«","Create Space from selection",b.length,{resourceName:b[0].name}),message:i("Create Space with the content of »%{resourceName}«.","Create Space with the selected files.",b.length,{resourceName:b[0].name}),contextualHelperLabel:n("The marked elements will be copied."),contextualHelperData:{title:n("Restrictions"),text:n("Shares, versions and tags will not be copied.")},confirmText:n("Create"),hasInput:!0,inputLabel:n("Space name"),inputRequiredMark:!0,onInput:(y,p)=>{const{isValid:S,error:T}=m(y);p(S?null:T)},onConfirm:y=>w({spaceName:y,space:g,resources:b})})};return{actions:B(()=>[{name:"create-space-from-resource",icon:"function",handler:v,label:()=>n("Create Space from selection"),isVisible:({resources:b,space:g})=>!(!b.length||!h(l)||!gt(a,"files-spaces-generic")||!te.isPersonalSpaceResource(g)),class:"oc-files-actions-create-space-from-resource-trigger"}])}},v0=()=>{const e=tr("scrollTo"),t=tr("details"),r=Ke(),n=B(()=>Rt(h(e))),i=B(()=>Rt(h(t))),o=(a,l={forceScroll:!1,topbarElement:null})=>{const u=document.querySelectorAll(`[data-item-id='${a}']`)[0];if(!u){ze.publish("app.files.navigate.page",{resourceId:a,forceScroll:l.forceScroll,topbarElement:l.topbarElement});return}const d=document.getElementById(l.topbarElement)?.offsetHeight||0+u.offsetHeight*2;(u.getBoundingClientRect().bottom>window.innerHeight||u.getBoundingClientRect().top<d||l.forceScroll)&&u.scrollIntoView({behavior:"smooth",block:"center"})};return ze.subscribe("app.files.navigate.scrollTo",a=>o(a.resourceId,{forceScroll:a.forceScroll,topbarElement:a.topbarElement})),{scrollToResource:o,scrollToResourceFromRoute:(a,l)=>{if(!h(n)||!a.length)return;const u=h(a).find(c=>te.isIncomingShareResource(c)?c.remoteItemId===h(n):c.id===h(n));u&&u.processing!==!0&&(r.setSelection([u.id]),o(u.id,{forceScroll:!0,topbarElement:l}),h(i)&&ze.publish(Tt.openWithPanel,h(i)))}}},YF=({space:e}={})=>{const{showMessage:t,showErrorMessage:r}=nt(),{dispatchModal:n}=ht(),{$gettext:i}=Fe.useGettext(),{scrollToResource:o}=v0(),s=Ke(),{resources:a,currentFolder:l}=Ve.storeToRefs(s),u=Ge(),{isFileNameValid:c}=ii(),d=async w=>{w=w.trimEnd();try{const v=pt.join(h(l).path,w),E=await u.webdav.createFolder(h(e),{path:v});te.isShareSpaceResource(h(e))&&(E.remoteItemId=h(e).id),s.upsertResource(E),t({title:i("»%{folderName}« was created successfully",{folderName:w})}),await ar(),o(E.id,{forceScroll:!0,topbarElement:"files-app-bar"})}catch(v){console.error(v),r({title:i("Failed to create folder"),errors:[v]})}},f=()=>{let w=i("New folder");h(a).some(v=>v.name===w)&&(w=Ur(w,"",h(a))),n({title:i("Create a new folder"),confirmText:i("Create"),hasInput:!0,inputValue:w,inputLabel:i("Folder name"),inputRequiredMark:!0,onConfirm:d,onInput:(v,E)=>{const b={path:pt.join(h(l).path,v),name:v,isFolder:!0},{isValid:g,error:y}=c(b,v,h(a));return E(g?null:y)}})};return{actions:B(()=>[{name:"create-folder",icon:"folder",handler:f,label:()=>i("New Folder"),isVisible:()=>h(l)?.canCreate(),class:"oc-files-actions-create-new-folder"}]),addNewFolder:d}},JF=({space:e}={})=>{const{showMessage:t,showErrorMessage:r}=nt(),n=bt(),{$gettext:i}=Fe.useGettext(),{dispatchModal:o}=ht(),s=rn(),{isEnabled:a}=ei(),{openEditor:l}=Hr(),u=Ge(),c=Ke(),{resources:d,currentFolder:f,areFileExtensionsShown:m}=Ve.storeToRefs(c),{isFileNameValid:w}=ii(),v=B(()=>s.fileExtensions.filter(({newFileMenu:y})=>!!y)),E=(y,p)=>(c.upsertResource(y),l(p,h(e),y)),b=(y,p,S)=>{let T=i("New file")+`.${p}`;h(d).some(I=>I.name===T)&&(T=Ur(T,p,h(d))),m.value||(T=te.extractNameWithoutExtension({name:T,extension:p}));const R=m.value?[0,T.length-(p.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 I=>{m.value||(I=`${I}.${p}`);try{let A;if(S.createFileHandler)A=await S.createFileHandler({fileName:I,space:h(e),currentFolder:h(f)});else{const D=pt.join(h(f).path,I);A=await u.webdav.putFileContents(h(e),{path:D})}return c.upsertResource(A),t({title:i("»%{fileName}« was created successfully",{fileName:A.name})}),h(a)?void 0:E(A,S)}catch(A){console.error(A),r({title:i("Failed to create file"),errors:[A]})}},onInput:(I,A)=>{const D=m.value?I:`${I}.${p}`,H={path:pt.join(h(f).path,D),name:D,extension:p},{isValid:_,error:x}=w(H,D);A(_?null:x)}})};return{actions:B(()=>{const y=[],p={};for(const S of h(v)||[])S.hasPriority?p[S.extension]=S:p[S.extension]=p[S.extension]||S;for(const[,S]of Object.entries(p))y.push({name:"create-new-file",icon:"add",handler:T=>b(T,S.extension,S),label:()=>i(S.newFileMenu.menuTitle()),isVisible:()=>h(f)?.canUpload({user:n.user}),class:"oc-files-actions-create-new-file",ext:S.extension,isExternal:S.app?.startsWith("external-")});return y}),openFile:E}};class ZF{state;observeEnter;observeExit;onEnterCallCount;onExitCallCount;onEnter;onExit;threshold;unobserver;constructor(t,r,n){this.unobserver=t,this.threshold=r,this.onEnter=n.onEnter,this.onExit=n.onExit,this.observeEnter=!!n.onEnter,this.observeExit=!!n.onExit,this.onEnterCallCount=0,this.onExitCallCount=0}request(t,r){const n={element:r,unobserve:()=>this.unobserve(t,r)};t===0&&this.observeEnter&&this.onEnter?(this.onEnterCallCount++,this.onEnter({callCount:this.onEnterCallCount,...n})):this.state===0&&t===1&&this.observeExit&&this.onExit&&(this.onExitCallCount++,this.onExit({callCount:this.onExitCallCount,...n})),this.state=t}unobserve(t,r){t===0?this.observeEnter=!1:t===1&&(this.observeExit=!1),!this.observeEnter&&!this.observeExit&&this.unobserver(r)}}class b0{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,r={},n){!r.onEnter&&!r.onExit||(this.targets.set(t,new ZF(this.unobserve.bind(this),n||this.options.threshold||0,{onEnter:r.onEnter,onExit:r.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(r=>{const n=this.targets.get(r.target);n&&n.request(r.isIntersecting&&r.intersectionRatio>n.threshold?0:1,r.target)})}}const ex={name:"resource-type-folder",color:"var(--oc-color-icon-folder)"},tx={name:"resource-type-folder",color:"var(--oc-role-secondary)"},rx={name:"layout-grid",color:"var(--oc-role-secondary)"},nx={name:"layout-grid",color:"var(--oc-role-secondary)"},ix={name:"resource-type-file",color:"var(--oc-role-on-surface)"},ox=Sh(),sx=xe({name:"ResourceIcon",props:{resource:{type:Object,required:!0},size:{type:String,default:"large",validator:e=>Tk.some(t=>t===e)}},setup(e){const t=mn(wh),r=B(()=>e.resource.type==="folder"||e.resource.isFolder),n=B(()=>e.resource.type==="space"),i=B(()=>te.isProjectSpaceResource(e.resource)&&e.resource.disabled===!0),o=B(()=>te.isPersonalSpaceResource(e.resource)),s=B(()=>e.resource.extension?.toLowerCase()),a=B(()=>e.resource.mimeType?.toLowerCase());return{icon:B(()=>{if(h(o))return tx;if(h(i))return nx;if(h(n))return rx;if(h(r))return ex;const u=ox[h(s)]||t?.mimeType[h(a)]||t?.extension[h(s)];return{...ix,...u}}),isSpace:n,isFolder:r,isDisabledSpace:i}}});function ax(e,t,r,n,i,o){const s=be("oc-icon");return Q(),Ae(s,{key:`resource-icon-${e.icon.name}`,name:e.icon.name,color:e.icon.color,size:e.size,class:W.normalizeClass(["oc-resource-icon","inline-flex","items-center",{"opacity-80 grayscale":e.isDisabledSpace,"[&_svg]:h-[70%]":!e.isSpace&&!e.isFolder}])},null,8,["name","color","size","class"])}const Do=qe(sx,[["render",ax]]),lx={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=ct(),{options:r}=Ve.storeToRefs(t);return{linkTarget:B(()=>h(r).cernFeatures&&e.link&&!e.resource.isFolder?"_blank":"_self")}},computed:{isNavigatable(){return this.resource?(this.resource.isFolder||this.link)&&!this.resource.disabled:!1},componentType(){return this.isNavigatable?"router-link":"oc-button"},componentProps(){return this.isNavigatable?{to:this.link}:{appearance:"raw",gapSize:"none",justifyContent:"left"}}},methods:{emitClick(e){!e||typeof e.stopPropagation!="function"||this.isNavigatable||this.$emit("click",e)}}},cx={key:1};function ux(e,t,r,n,i,o){return r.isResourceClickable?(Q(),Ae(jr(o.componentType),jt({key:0},o.componentProps,{target:e.linkTarget,draggable:!1,class:"oc-resource-link max-w-full","no-hover":"",onDragstart:t[0]||(t[0]=Vt(()=>{},["prevent","stop"])),onClick:o.emitClick}),{default:we(()=>[je(e.$slots,"default",{},void 0,!0)]),_:3},16,["target","onClick"])):(Q(),ye("span",cx,[je(e.$slots,"default",{},void 0,!0)]))}const fd=qe(lx,[["render",ux],["__scopeId","data-v-3b603353"]]),fx=xe({name:"ResourceName",props:{name:{type:String,required:!0},pathPrefix:{type:String,required:!1,default:""},extension:{type:String,required:!1,default:""},type:{type:String,required:!0},fullPath:{type:String,required:!0},isPathDisplayed:{type:Boolean,required:!1,default:!1},isExtensionDisplayed:{type:Boolean,required:!1,default:!0},truncateName:{type:Boolean,required:!1,default:!0}},computed:{tooltip(){return this.pathTooltip},fullName(){return(this.displayPath||"")+this.name},displayName(){return this.extension?this.name.slice(0,-this.extension.length-1):this.name},displayExtension(){return this.extension?"."+this.extension:""},displayPath(){if(!this.isPathDisplayed)return null;const e=this.fullPath.replace(/^\//,"").split("/");return e.length<2?null:e.length===2?e[0]+"/":`…/${e[e.length-2]}/`},pathTooltip(){return!this.isPathDisplayed||this.displayPath===this.fullPath?null:this.pathPrefix?Cs.join(this.pathPrefix,this.fullPath):this.fullPath},htmlTitle(){if(!this.tooltip)return this.isExtensionDisplayed?`${this.displayName}${this.displayExtension}`:this.displayName}}}),dx=["data-test-resource-path","data-test-resource-name","data-test-resource-type","title"],px={key:0,class:"truncate leading-4"},hx=["textContent"],mx=["textContent"],gx=["textContent"];function yx(e,t,r,n,i,o){const s=lr("oc-tooltip");return lt((Q(),ye("span",{class:W.normalizeClass(["oc-resource-name flex min-w-0",[{"inline-block":!e.truncateName}]]),"data-test-resource-path":e.fullPath,"data-test-resource-name":e.fullName,"data-test-resource-type":e.type,title:e.htmlTitle},[e.truncateName?(Q(),ye("span",px,[fe("span",{class:"oc-resource-basename whitespace-pre text-role-on-surface",textContent:W.toDisplayString(e.displayName)},null,8,hx)])):(Q(),ye("span",{key:1,class:"oc-resource-basename break-normal text-role-on-surface leading-4",textContent:W.toDisplayString(e.displayName)},null,8,mx)),e.extension&&e.isExtensionDisplayed?(Q(),ye("span",{key:2,class:"oc-resource-extension whitespace-pre text-role-on-surface leading-4",textContent:W.toDisplayString(e.displayExtension)},null,8,gx)):_e("",!0)],10,dx)),[[s,e.tooltip]])}const dd=qe(fx,[["render",yx]]),vx=xe({name:"ResourceListItem",components:{ResourceIcon:Do,ResourceLink:fd,ResourceName:dd},props:{resource:{type:Object,required:!0},pathPrefix:{type:String,required:!1,default:""},link:{type:Object,required:!1,default:null},isPathDisplayed:{type:Boolean,required:!1,default:!1},parentFolderLink:{type:Object,required:!1,default:null},parentFolderName:{type:String,required:!1,default:""},parentFolderLinkIconAdditionalAttributes:{type:Object,required:!1,default:()=>({})},isExtensionDisplayed:{type:Boolean,required:!1,default:!0},isThumbnailDisplayed:{type:Boolean,required:!1,default:!0},isIconDisplayed:{type:Boolean,required:!1,default:!0},isResourceClickable:{type:Boolean,required:!1,default:!0}},emits:["click"],computed:{parentFolderComponentType(){return this.parentFolderLink?"router-link":"span"},parentFolderLinkIconAttrs(){return{"fill-type":"line",name:"folder-2",size:"small",...this.parentFolderLinkIconAdditionalAttributes}},hasThumbnail(){return this.isThumbnailDisplayed&&Object.prototype.hasOwnProperty.call(this.resource,"thumbnail")},thumbnail(){return this.resource.thumbnail},tooltipLabelIcon(){return this.resource.locked?this.$gettext("This item is locked"):null}},methods:{emitClick(e){!e||typeof e.stopPropagation!="function"||this.$emit("click",e)}}}),bx={class:"oc-resource-indicators flex"},wx=["textContent"];function Sx(e,t,r,n,i,o){const s=be("oc-image"),a=be("resource-icon"),l=be("resource-link"),u=be("resource-name"),c=be("oc-icon"),d=lr("oc-tooltip");return Q(),ye("div",{class:W.normalizeClass(["oc-resource inline-flex justify-start items-center max-w-full overflow-visible",{"pointer-events-none":!e.isResourceClickable}])},[e.isIconDisplayed?(Q(),Ae(l,{key:0,resource:e.resource,link:e.link,"is-resource-clickable":e.isResourceClickable,class:W.normalizeClass(["oc-resource-icon-link relative",{"hover:underline":e.isResourceClickable}]),onClick:e.emitClick},{default:we(()=>[e.hasThumbnail?lt((Q(),Ae(s,{key:e.thumbnail,src:e.thumbnail,"data-test-thumbnail-resource-name":e.resource.name,class:"oc-resource-thumbnail rounded-xs size-8 object-cover",width:"40",height:"40","aria-label":e.tooltipLabelIcon},null,8,["src","data-test-thumbnail-resource-name","aria-label"])),[[d,e.tooltipLabelIcon]]):lt((Q(),Ae(a,{key:1,"aria-label":e.tooltipLabelIcon,resource:e.resource},null,8,["aria-label","resource"])),[[d,e.tooltipLabelIcon]])]),_:1},8,["resource","link","is-resource-clickable","class","onClick"])):_e("",!0),fe("div",{class:W.normalizeClass(["oc-resource-details block truncate",{"pl-2":e.isIconDisplayed}])},[ge(l,{resource:e.resource,"is-resource-clickable":e.isResourceClickable,link:e.link,class:W.normalizeClass(["hover:outline-offset-0 focus:outline-offset-0",{"hover:underline":e.isResourceClickable}]),onClick:e.emitClick},{default:we(()=>[(Q(),Ae(u,{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","onClick"]),fe("div",bx,[e.isPathDisplayed?(Q(),Ae(jr(e.parentFolderComponentType),{key:0,to:e.parentFolderLink,class:W.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:we(()=>[ge(c,jt(e.parentFolderLinkIconAttrs,{class:"mr-1"}),null,16),fe("span",{class:"text truncate text-sm hover:underline",textContent:W.toDisplayString(e.parentFolderName)},null,8,wx)]),_:1},8,["to","class"])):_e("",!0)])],2)],2)}const $o=qe(vx,[["render",Sx]]),w0=xe({__name:"ResourcePreview",props:{searchResult:{default:()=>({data:{}})},isClickable:{type:Boolean,default:!0},term:{default:""}},setup(e){const t=new b0,{triggerDefaultAction:r}=Hr(),{getMatchingSpace:n}=rr(),{getDefaultAction:i}=Hr(),{loadPreview:o}=yd(),s=Wn("resourceListItem"),{getPathPrefix:a,getParentFolderName:l,getParentFolderLink:u,getParentFolderLinkIconAdditionalAttributes:c,getFolderLink:d}=si(),f=Ke(),m=le(),w=B(()=>f.areFileExtensionsShown),v=B(()=>({...e.searchResult.data,...h(m)&&{thumbnail:h(m)}})),E=B(()=>n(h(v))),b=B(()=>{const I=h(v);return te.isSpaceResource(I)&&I.disabled===!0}),g=()=>{r({space:h(E),resources:[h(v)]})},y=B(()=>e.isClickable?{parentFolderLink:u(h(v)),onClick:g}:{isResourceClickable:!1}),p=B(()=>{if(h(v).isFolder)return d(h(v));const I=i({resources:[h(v)],space:h(E)});if(!I?.route)return null;const A=I.route({space:h(E),resources:[h(v)]});return A.query={...A.query,contextRouteQuery:{...A.query?.contextRouteQuery||{},term:e.term}},A}),S=a(h(v)),T=l(h(v)),R=c(h(v));return $t(()=>{h(b)&&h(s).parentElement.classList.add("disabled");const I=async()=>{const D=await o({space:h(E),resource:h(v),dimensions:ni.Thumbnail,cancelRunning:!0,updateStore:!1});D&&(m.value=D)},A=Ct.debounce(({unobserve:D})=>{D(),I()},250);t.observe(h(s).$el,{onEnter:A,onExit:A.cancel})}),mr(()=>{t.disconnect()}),(I,A)=>(Q(),Ae($o,jt({ref_key:"resourceListItem",ref:s,resource:v.value,"path-prefix":h(S),"is-path-displayed":!0,link:p.value,"is-extension-displayed":w.value,"parent-folder-link-icon-additional-attributes":h(R),"parent-folder-name":h(T),"is-thumbnail-displayed":!!m.value},y.value),null,16,["resource","path-prefix","link","is-extension-displayed","parent-folder-link-icon-additional-attributes","parent-folder-name","is-thumbnail-displayed"]))}}),Ex=7,Tx=200,Ax=xe({name:"CreateShortcutModal",components:{ResourcePreview:w0},props:{modal:{type:Object,required:!0},space:{type:Object,required:!0}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:r}){const n=Ge(),{$gettext:i}=Fe.useGettext(),{showMessage:o,showErrorMessage:s}=nt(),a=He(),{search:l}=Qf(),{getPathPrefix:u,getParentFolderName:c,getParentFolderLink:d,getParentFolderLinkIconAdditionalAttributes:f,getFolderLink:m}=si(),w=Ke(),{resources:v,currentFolder:E}=Ve.storeToRefs(w),b=le(null),g=le(""),y=le(""),p=le(null),S=le(null),T=le(!1);let R=null;const I=K=>{const V=K.trim();return G(V)?V:`https://${V}`},A=B(()=>I(h(g))),D=B(()=>!!h(v).find(K=>K.name===`${h(y)}.url`)),H=B(()=>h(D)||!h(y)||!h(g));dt(H,()=>{t("update:confirmDisabled",h(H))},{immediate:!0});const _=B(()=>h(D)?i("»%{name}« already exists",{name:`${h(y)}.url`}):/[/]/.test(h(y))?i('Shortcut name cannot contain "/"'):""),x=or.useTask(function*(K,V){p.value=null,V=`name:"*${V}*" NOT name:"*.url"`;try{p.value=yield l(V,Ex)}catch{}}),z=Ct.debounce(()=>{x.perform(h(g))},Tx),G=K=>["http://","https://"].some($=>$.startsWith(K)||K.startsWith($)),ne=()=>{p.value=null,g.value=h(A);try{let K=new URL(h(A)).host;h(v).some(V=>V.name===`${K}.url`)&&(K=Ur(`${K}.url`,"url",h(v)).slice(0,-4)),y.value=K}catch{}},ie=K=>{p.value=null;const V=new URL(window.location.href);let $=K.data.name;g.value=`${V.origin}/f/${K.id}`,h(v).some(U=>U.name===`${$}.url`)&&($=Ur(`${$}.url`,"url",h(v)).slice(0,-4)),y.value=$},ee=K=>h(S)===K,ue=(K=!1)=>{const V=Array.from(document.querySelectorAll("li.selectable-item"));let $=h(S)!==null?h(S):K?V.length:-1;const U=K?-1:1;do if($+=U,$<0||$>V.length-1)return null;while(V[$].classList.contains("disabled"));return $},de=()=>{S.value=ue(!0)},ce=()=>{S.value=ue(!1)},X=K=>{h(T)&&(K.stopPropagation(),h(b).hide())},oe=K=>{h(T)&&(K.stopPropagation(),h(S)!==null&&(h(S)===0?ne():ie(h(p)?.values?.[h(S)-1]),h(b).hide()))},ae=()=>{T.value=!1,S.value=null},Ce=()=>{T.value=!0,S.value=0},Z=()=>{g.value.trim().length&&h(b).show()},N=async()=>{if(await ar(),y.value=g.value.trim(),!g.value.trim().length){h(b).hide();return}h(b).show(),Rr(a,"files-public-link")||z()},O=async()=>{try{const V=`[InternetShortcut]
52
+ URL=${Kd.sanitize(I(h(g)),{USE_PROFILES:{html:!0}})}`,$=te.urlJoin(h(E).path,`${h(y)}.url`),U=await n.webdav.putFileContents(e.space,{path:$,content:V});w.upsertResource(U),o({title:i("Shortcut was created successfully")})}catch(K){console.error(K),s({title:i("Failed to create shortcut"),errors:[K]})}};return $t(async()=>{await ar(),R=new Qd(h(b)?.$refs?.drop)}),dt(p,async()=>{await ar(),!(!h(T)||!R)&&(R.unmark(),R.mark(h(g),{element:"span",className:"mark-highlight",exclude:[".selectable-item-url *",".create-shortcut-modal-search-separator *"]}))},{deep:!0}),dt(S,()=>{if(!h(T)||typeof h(b)?.$el?.scrollTo!="function")return;const K=h(b).$el.querySelectorAll(".selectable-item");h(b).$el.scrollTo(0,h(S)===null?0:K[h(S)].getBoundingClientRect().y-K[h(S)].getBoundingClientRect().height)}),r({onConfirm:O}),{inputUrl:g,inputFilename:y,dropRef:b,dropItemUrl:A,searchResult:p,confirmButtonDisabled:H,inputFileNameErrorMessage:_,searchTask:x,dropItemUrlClicked:ne,dropItemResourceClicked:ie,getPathPrefix:u,getFolderLink:m,getParentFolderLink:d,getParentFolderName:c,getParentFolderLinkIconAdditionalAttributes:f,onKeyEnterDrop:oe,onKeyDownDrop:ce,onKeyUpDrop:de,onKeyEscDrop:X,onHideDrop:ae,onShowDrop:Ce,onInputUrlInput:N,onClickUrlInput:Z,isDropItemActive:ee,onConfirm:O}}}),Rx={class:"flex items-center mb-1"},Cx={for:"create-shortcut-modal-url-input"},Ix=["textContent"],_x={key:0,class:"p-1 flex justify-center"},Ox={class:"create-shortcut-modal-search-separator text-role-on-surface-variant text-sm pl-1"},Px=["textContent"],kx={key:0,class:"flex w-full mt-4"},Fx={class:"flex items-center mb-1"},xx={for:"create-shortcut-modal-filename-input"};function Nx(e,t,r,n,i,o){const s=be("oc-contextual-helper"),a=be("oc-text-input"),l=be("oc-icon"),u=be("oc-button"),c=be("oc-spinner"),d=be("resource-preview"),f=be("oc-list"),m=be("oc-drop");return Q(),ye(Ue,null,[ge(a,{id:"create-shortcut-modal-url-input",modelValue:e.inputUrl,"onUpdate:modelValue":[t[0]||(t[0]=w=>e.inputUrl=w),e.onInputUrlInput],placeholder:"example.org",label:e.$gettext("Webpage or file"),onKeydown:[io(e.onKeyUpDrop,["up"]),io(e.onKeyDownDrop,["down"]),io(e.onKeyEscDrop,["esc"]),io(e.onKeyEnterDrop,["enter"])],onClick:e.onClickUrlInput},{label:we(()=>[fe("div",Rx,[fe("label",Cx,[Pt(W.toDisplayString(e.$gettext("Webpage or file"))+" ",1),t[2]||(t[2]=fe("span",{class:"text-role-error","aria-hidden":"true"},"*",-1))]),ge(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"]),ge(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:we(()=>[ge(f,null,{default:we(()=>[fe("li",{class:W.normalizeClass(["selectable-item selectable-item-url",{active:e.isDropItemActive(0)}])},[ge(u,{class:"w-full",appearance:"raw","justify-content":"left",onClick:e.dropItemUrlClicked},{default:we(()=>[ge(l,{name:"external-link"}),fe("span",{textContent:W.toDisplayString(e.dropItemUrl)},null,8,Ix)]),_:1},8,["onClick"])],2),e.searchTask.isRunning?(Q(),ye("li",_x,[ge(c)])):_e("",!0),e.searchResult?.values?.length?(Q(),ye(Ue,{key:1},[fe("li",Ox,[fe("span",{textContent:W.toDisplayString(e.$gettext("Link to a file"))},null,8,Px)]),(Q(!0),ye(Ue,null,mt(e.searchResult.values,(w,v)=>(Q(),ye("li",{key:v,class:W.normalizeClass(["selectable-item",{active:e.isDropItemActive(v+1)}])},[ge(u,{class:"w-full",appearance:"raw","justify-content":"left",onClick:E=>e.dropItemResourceClicked(w)},{default:we(()=>[ge(d,{"search-result":w,"is-clickable":!1},null,8,["search-result"])]),_:2},1032,["onClick"])],2))),128))],64)):_e("",!0)]),_:1})]),_:1},8,["onHideDrop","onShowDrop"]),e.inputFilename?(Q(),ye("div",kx,[ge(a,{id:"create-shortcut-modal-filename-input",modelValue:e.inputFilename,"onUpdate:modelValue":t[1]||(t[1]=w=>e.inputFilename=w),label:e.$gettext("Shortcut name"),class:"w-full","error-message":e.inputFileNameErrorMessage,"fix-message-line":!0},{label:we(()=>[fe("div",Fx,[fe("label",xx,[Pt(W.toDisplayString(e.$gettext("Shortcut name"))+" ",1),t[3]||(t[3]=fe("span",{class:"text-role-error","aria-hidden":"true"},"*",-1))]),ge(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"])])):_e("",!0)],64)}const S0=qe(Ax,[["render",Nx]]),Dx=({space:e})=>{const{dispatchModal:t}=ht(),{$gettext:r}=Fe.useGettext(),n=Ke(),{currentFolder:i}=Ve.storeToRefs(n);return{actions:B(()=>[{name:"create-shortcut",icon:"external-link",handler:()=>{t({title:r("Create a Shortcut"),confirmText:r("Create"),customComponent:S0,customComponentAttrs:()=>({space:h(e)})})},label:()=>r("New Shortcut"),isVisible:()=>h(i)?.canCreate(),class:"oc-files-actions-create-new-shortcut"}])}},$x=()=>{const{showErrorMessage:e}=nt(),t=He(),{$gettext:r}=Fe.useGettext(),n=An(),i=ba(),o=Ge(),s=u=>{const c=/URL=(.+)/,d=u.match(c);if(d&&d[1])return d[1];throw new Error("unable to extract url")},a=async({resources:u,space:c})=>{try{const d=new URL(window.location.href),f=(await o.webdav.getFileContents(c,u[0])).body;let m=s(f);if(m=m.match(/^http[s]?:\/\//)?m:`https://${m}`,m=Kd.sanitize(m,{USE_PROFILES:{html:!0}}),m.startsWith(d.origin)){window.location.href=m;return}window.open(m)}catch(d){console.error(d),e({title:r("Failed to open shortcut"),errors:[d]})}};return{actions:B(()=>[{name:"open-shortcut",icon:"external-link",category:"context",handler:a,label:()=>r("Open shortcut"),isVisible:({resources:u})=>h(n)&&!h(i)&&!gt(t,"files-spaces-generic")&&!Rr(t,"files-public-link")&&!It(t,"files-common-favorites")&&!It(t,"files-common-search")&&!Lt(t,"files-shares-with-me")&&!Lt(t,"files-shares-with-others")&&!Lt(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}},_a=()=>{const{$gettext:e}=Fe.useGettext(),t=er(),r=ur(),n=B(()=>r.can("create-all","PublicLink")),i=B(()=>br.View),o=u=>u===br.View?t.sharingPublicPasswordEnforcedFor.read_only:u===br.Upload?t.sharingPublicPasswordEnforcedFor.upload_only:u===br.CreateOnly?t.sharingPublicPasswordEnforcedFor.read_write:u===br.Edit?t.sharingPublicPasswordEnforcedFor.read_write_delete:!1,s=({isFolder:u})=>h(n)?u?[br.View,br.Edit,br.CreateOnly]:[br.View,br.Edit]:[],a=[{id:br.View,displayName:e("Can view"),description:e("View, download"),icon:"eye"},{id:br.Upload,displayName:e("Can upload"),description:e("View, upload, download"),icon:"upload"},{id:br.Edit,displayName:e("Can edit"),description:e("View, upload, edit, download, delete"),icon:"pencil"},{id:br.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)}},Lx=xe({name:"LinkRoleDropdown",props:{modelValue:{type:Object,required:!0},availableLinkTypeOptions:{type:Array,required:!0},dropOffset:{type:String,default:void 0}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:r}=Fe.useGettext(),{getLinkRoleByType:n}=_a(),i=l=>e.modelValue===l,o=l=>{t("update:modelValue",l)},s=B(()=>r(n(e.modelValue)?.displayName)),a=Xt.v4();return{isSelectedType:i,updateSelectedType:o,currentLinkRoleLabel:s,dropUuid:a,getLinkRoleByType:n}}}),Mx=["textContent"],Bx=["textContent"],jx={class:"flex items-center"},Ux={class:"text-left"},qx=["textContent"],Vx={class:"text-sm leading-4"},zx={class:"flex"};function Wx(e,t,r,n,i,o){const s=be("oc-icon"),a=be("oc-button"),l=be("oc-list"),u=be("oc-drop"),c=lr("oc-tooltip");return Q(),ye(Ue,null,[e.availableLinkTypeOptions.length>1?(Q(),Ae(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:we(()=>[fe("span",{class:"link-current-role",textContent:W.toDisplayString(e.currentLinkRoleLabel||e.$gettext("Select a role"))},null,8,Mx),ge(s,{name:"arrow-down-s"})]),_:1},8,["id"])):lt((Q(),ye("span",{key:1,class:"link-current-role mr-4",textContent:W.toDisplayString(e.currentLinkRoleLabel)},null,8,Bx)),[[c,e.getLinkRoleByType(e.modelValue)?.description]]),e.availableLinkTypeOptions.length>1?(Q(),Ae(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",offset:e.dropOffset,"close-on-click":""},{default:we(()=>[ge(l,{class:"role-dropdown-list"},{default:we(()=>[(Q(!0),ye(Ue,null,mt(e.availableLinkTypeOptions,(d,f)=>(Q(),ye("li",{key:`role-dropdown-${f}`},[ge(a,{id:`files-role-${e.getLinkRoleByType(d).id}`,class:W.normalizeClass([{selected:e.isSelectedType(d)},"p-2"]),appearance:e.isSelectedType(d)?"filled":"raw-inverse","color-role":e.isSelectedType(d)?"secondaryContainer":"surface","justify-content":"space-between",onClick:m=>e.updateSelectedType(d)},{default:we(()=>[fe("span",jx,[ge(s,{name:e.getLinkRoleByType(d).icon,class:"pl-2 pr-4"},null,8,["name"]),fe("span",Ux,[fe("span",{class:"role-dropdown-list-option-label font-semibold block w-full leading-4",textContent:W.toDisplayString(e.$gettext(e.getLinkRoleByType(d).displayName))},null,8,qx),fe("span",Vx,W.toDisplayString(e.$gettext(e.getLinkRoleByType(d).description)),1)])]),fe("span",zx,[e.isSelectedType(d)?(Q(),Ae(s,{key:0,name:"check"})):_e("",!0)])]),_:2},1032,["id","class","appearance","color-role","onClick"])]))),128))]),_:1})]),_:1},8,["title","drop-id","toggle","offset"])):_e("",!0)],64)}const E0=qe(Lx,[["render",Wx]]),Hx=xe({name:"CreateLinkModal",components:{LinkRoleDropdown:E0},props:{modal:{type:Object,required:!0},resources:{type:Array,required:!0},space:{type:Object,default:void 0},callbackFn:{type:Function,default:void 0}},emits:["cancel","confirm"],setup(e,{expose:t}){const r=Ge(),n=Fe.useGettext(),{$gettext:i}=n,o=B0(),{isEnabled:s,postMessage:a}=ei(),{defaultLinkType:l,getAvailableLinkTypes:u,getLinkRoleByType:c,isPasswordEnforcedForLinkType:d}=_a(),{addLink:f}=En(),m=le(!1),w=le(!1),v=B(()=>e.resources.every(({isFolder:ce})=>ce)),E=B(()=>h(s)?i("Share link(s)"):i("Copy link")),b=le(Xt.v4()),g=le({}),y=le(),p=ol({value:"",error:void 0}),S=le(h(l)),T=B(()=>i(c(h(S)).description)),R=B(()=>i(c(h(S)).displayName)),I=B(()=>c(h(S)).icon),A=B(()=>u({isFolder:h(v)})),D=B(()=>d(h(S))),H=o.getPolicy({enforcePassword:h(D)}),_=()=>{m.value=!0},x=({date:ce,error:X})=>{y.value=ce,w.value=X},z=()=>Promise.allSettled(e.resources.map(ce=>f({clientService:r,space:e.space,resource:ce,options:{type:h(S),"@libre.graph.quickLink":!1,password:h(p).value,expirationDateTime:h(y)?.toISO(),displayName:i("Unnamed link")}}))),G=B(()=>!!H.check(h(p).value)),ne=B(()=>!(h(G)&&!h(w))),ie=async(ce={})=>{const X=await z(),oe=X.filter(({status:Z})=>Z==="fulfilled");oe.length&&h(s)&&a("opencloud-embed:share",oe.map(({value:Z})=>Z.webUrl));const ae=[],Ce=X.filter(({status:Z})=>Z==="rejected");if(Ce.length&&Ce.map(({reason:Z})=>Z).forEach(Z=>{if(console.error(Z),Z.response?.status===400){const N=Z.response.data.error;N.message=Ct.upperFirst(N.message),ae.push(N)}}),ae.length)return p.error=i(ae[0].message),Promise.reject();e.callbackFn&&e.callbackFn({result:X,password:p.value,options:ce})};t({onConfirm:ie});const ee=ce=>h(S)===ce,ue=ce=>{p.value=ce,p.error=void 0},de=ce=>{S.value=ce};return $t(()=>{const ce=h(g)[h(S)];ce&&ce.$el.focus(),h(D)&&(p.value=o.generatePassword())}),{roleRefs:g,password:p,passwordEnforced:D,passwordPolicy:H,generatePasswordMethod:()=>o.generatePassword(),passwordInputKey:b,selectedExpiry:y,availableLinkTypes:A,selectedType:S,selectedTypeIcon:I,selectedTypeDisplayName:R,selectedTypeDescription:T,isSelectedLinkType:ee,updateSelectedLinkType:de,updatePassword:ue,getLinkRoleByType:c,confirmButtonText:E,isAdvancedMode:m,setAdvancedMode:_,onExpiryDateChanged:x,confirmButtonDisabled:ne,DateTime:Mt.DateTime,onConfirm:ie}}}),Gx={class:"flex justify-between pb-2"},Kx={key:0,class:"flex items-center"},Qx={key:1,class:"flex items-center"},Xx={class:"flex flex-col"},Yx=["textContent"],Jx=["textContent"],Zx=["textContent"],eN={class:"mb-4 ml-[30px]"},tN={key:1,class:"text-sm text-role-on-surface-variant"},rN=["textContent"],nN=["textContent"],iN={class:"flex justify-end items-center mt-2"};function oN(e,t,r,n,i,o){const s=be("oc-icon"),a=be("link-role-dropdown"),l=be("oc-button"),u=be("oc-text-input"),c=be("oc-datepicker"),d=be("oc-list"),f=be("oc-drop");return Q(),ye(Ue,null,[fe("div",Gx,[e.isAdvancedMode?(Q(),ye("div",Kx,[ge(s,{class:"mr-2",name:e.selectedTypeIcon,"fill-type":"line"},null,8,["name"]),ge(a,{"model-value":e.selectedType,"available-link-type-options":e.availableLinkTypes,"onUpdate:modelValue":e.updateSelectedLinkType},null,8,["model-value","available-link-type-options","onUpdate:modelValue"])])):(Q(),ye("div",Qx,[ge(s,{class:"mr-2",name:e.selectedTypeIcon,"fill-type":"line"},null,8,["name"]),fe("div",Xx,[fe("span",{class:"font-semibold",textContent:W.toDisplayString(e.selectedTypeDisplayName)},null,8,Yx),fe("span",{class:"text-sm",textContent:W.toDisplayString(e.selectedTypeDescription)},null,8,Jx)])])),e.isAdvancedMode?_e("",!0):(Q(),Ae(l,{key:2,class:"link-modal-advanced-mode-button","gap-size":"xsmall",appearance:"raw","no-hover":"",onClick:t[0]||(t[0]=m=>e.setAdvancedMode())},{default:we(()=>[ge(s,{name:"settings-3",size:"small","fill-type":"fill"}),fe("span",{textContent:W.toDisplayString(e.$gettext("Options"))},null,8,Zx)]),_:1}))]),fe("div",eN,[e.isAdvancedMode?(Q(),Ae(u,{key:e.passwordInputKey,"model-value":e.password.value,type:"password","password-policy":e.passwordPolicy,"generate-password-method":e.generatePasswordMethod,"error-message":e.password.error,label:e.$gettext("Password"),"required-mark":e.passwordEnforced,class:"link-modal-password-input","onUpdate:modelValue":e.updatePassword},null,8,["model-value","password-policy","generate-password-method","error-message","label","required-mark","onUpdate:modelValue"])):e.password.value?(Q(),ye("div",tN,[fe("span",{textContent:W.toDisplayString(e.$gettext("Password:"))},null,8,rN),fe("span",{textContent:W.toDisplayString(e.password.value)},null,8,nN)])):_e("",!0),e.isAdvancedMode?(Q(),Ae(c,{key:2,class:"mt-2","min-date":e.DateTime.now(),label:e.$gettext("Expiry date"),onDateChanged:e.onExpiryDateChanged},null,8,["min-date","label","onDateChanged"])):_e("",!0)]),fe("div",iN,[ge(l,{class:"link-modal-cancel oc-modal-body-actions-cancel ml-2",onClick:t[1]||(t[1]=m=>e.$emit("cancel"))},{default:we(()=>[Pt(W.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),fe("div",{class:W.normalizeClass(["ml-2",{"oc-button-group":e.password.value}])},[ge(l,{class:"link-modal-confirm oc-modal-body-actions-confirm",appearance:"filled",disabled:e.confirmButtonDisabled,onClick:t[2]||(t[2]=m=>e.$emit("confirm"))},{default:we(()=>[Pt(W.toDisplayString(e.confirmButtonText),1)]),_:1},8,["disabled"]),e.password.value?(Q(),Ae(l,{key:0,class:"link-modal-confirm oc-modal-body-actions-confirm-secondary-trigger p-1",appearance:"filled",disabled:e.confirmButtonDisabled},{default:we(()=>[ge(s,{size:"small",name:"arrow-down-s"})]),_:1},8,["disabled"])):_e("",!0),e.password.value?(Q(),Ae(f,{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:e.$gettext("More options"),"close-on-click":""},{default:we(()=>[ge(d,null,{default:we(()=>[fe("li",null,[ge(l,{class:"oc-modal-body-actions-confirm-password",appearance:"raw","justify-content":"left",onClick:t[3]||(t[3]=m=>e.$emit("confirm",{copyPassword:!0}))},{default:we(()=>[Pt(W.toDisplayString(e.$gettext("Copy link and password")),1)]),_:1})])]),_:1})]),_:1},8,["title"])):_e("",!0)],2)])],64)}const T0=qe(Hx,[["render",oN]]),sN=({enforceModal:e=!1}={})=>{const t=Ge(),r=bt(),{showMessage:n,showErrorMessage:i}=nt(),{$gettext:o,$ngettext:s}=Fe.useGettext(),a=er(),l=ur(),u=ir(),{defaultLinkType:c}=_a(),{addLink:d}=En(),{dispatchModal:f}=ht(),{copyToClipboard:m}=ed(),w=async({result:g,password:y,options:p={}})=>{const S=g.filter(R=>R.status==="fulfilled");if(S.length){let R=o("Link has been created successfully");if(g.length===1)try{const I=p.copyPassword?o("%{link} Password:%{password}",{link:S[0].value.webUrl,password:y},!0):S[0].value.webUrl;await m(I),R=o("The link has been copied to your clipboard.")}catch(I){console.warn("Unable to copy link to clipboard",I)}n({title:s(R,"Links have been created successfully.",S.length)})}const T=g.filter(({status:R})=>R==="rejected");T.length&&i({errors:T.map(({reason:R})=>R),title:s("Failed to create link","Failed to create links",T.length)})},v=async({space:g,resources:y})=>{const p=a.sharingPublicPasswordEnforcedFor.read_only===!0;if(e||p){f({title:s("Copy link for »%{resourceName}«","Copy links for the selected items",y.length,{resourceName:y[0].name}),customComponent:T0,customComponentAttrs:()=>({space:g,resources:y,callbackFn:w}),hideActions:!0});return}const S=y.map(R=>d({clientService:t,space:g,resource:R,options:{"@libre.graph.quickLink":!1,displayName:o("Unnamed link"),type:h(c)}})),T=await u.addTask(()=>Promise.allSettled(S));w({result:T})},E=({resources:g})=>{if(!g.length)return!1;for(const y of g)if(!y.canShare({user:r.user,ability:l})||te.isProjectSpaceResource(y)&&y.disabled)return!1;return!0};return{actions:B(()=>[{name:"create-links",icon:"link",handler:v,label:()=>o("Create links"),isVisible:E,class:"oc-files-actions-create-links"}])}},aN=xe({name:"AppLoadingSpinner"}),lN={class:"flex items-center justify-center size-full"};function cN(e,t,r,n,i,o){const s=be("oc-spinner");return Q(),ye("div",lN,[ge(s,{id:"app-loading-spinner",size:"large","aria-hidden":!0,"aria-label":""})])}const pd=qe(aN,[["render",cN]]),uN=xe({name:"FilePickerModal",components:{AppLoadingSpinner:pd},props:{modal:{type:Object,required:!0},app:{type:Object,required:!0},parentFolderLink:{type:Object,required:!0}},setup(e){const t=le(),r=le(!0),n=He(),{removeModal:i}=ht(),{getMatchingSpace:o}=rr(),s=ti(),{getEditorRouteOpts:a}=Hr(),l=n.resolve(e.parentFolderLink),u=e.app.extensions.map(v=>v.extension?v.extension:v.mimeType),c=s.currentTheme.name,d=new URL(l.href,window.location.origin);d.searchParams.append("hide-logo","true"),d.searchParams.append("embed","true"),d.searchParams.append("embed-target","file"),d.searchParams.append("embed-delegate-authentication","false"),d.searchParams.append("embed-file-types",u.join(","));const f=()=>{r.value=!1,h(t).contentWindow.focus()},m=({data:v})=>{if(v.name!=="opencloud-embed:file-pick")return;const{resource:E,locationQuery:b}=v.data,g=o(E),y=te.isShareSpaceResource(g)?g.id:void 0,p=a(h(n.currentRoute).name,g,E,y);p.query={...p.query,...b};const S=n.resolve(p),T=new URL(S.href,window.location.origin);i(e.modal.id),window.open(T.href,"_blank")},w=({data:v})=>{v.name==="opencloud-embed:cancel"&&i(e.modal.id)};return $t(()=>{window.addEventListener("message",m),window.addEventListener("message",w)}),mr(()=>{window.removeEventListener("message",m),window.removeEventListener("message",w)}),{isLoading:r,onLoad:f,iframeTitle:c,iframeSrc:d.href,iframeRef:t,onFilePick:m}}}),fN={class:"h-full",tabindex:"0"},dN=["title","src"];function pN(e,t,r,n,i,o){const s=be("app-loading-spinner");return Q(),ye("div",fN,[e.isLoading?(Q(),Ae(s,{key:0})):_e("",!0),lt(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,dN),[[fh,!e.isLoading]])])}const A0=qe(uN,[["render",pN]]),Oa=(e={},t)=>{const r=e.targetRouteCallback,{getMatchingSpace:n}=rr(e);return{createFileAction:s=>{const a=h(e.space)||n(s);t.emit("fileClick",{space:a,resources:[s]})},createFolderLink:s=>{if(h(r))return h(r)(s);const{path:a,fileId:l,resource:u}=s,c=h(e.space)||n(u);return c?Pr("files-spaces-generic",tn(c,{path:a,fileId:l})):{}}}},si=(e={})=>{const t=er(),{$gettext:r}=Fe.useGettext(),{getInternalSpace:n,getMatchingSpace:i,isResourceAccessible:o}=rr(),{createFolderLink:s}=Oa(e);return{getPathPrefix:f=>{const m=h(e.space)||i(f);return te.isProjectSpaceResource(m)?Cs.join(r("Spaces"),m.name):te.isShareSpaceResource(m)?Cs.join(r("Shares"),m.name):m.name},getFolderLink:f=>s({path:f.path,fileId:f.fileId,resource:f}),getParentFolderLink:f=>{const m=h(e.space)||i(f),w=o({space:m,path:pt.dirname(f.path)});return f.remoteItemId&&f.path==="/"||!w?kr("files-shares-with-me"):te.isProjectSpaceResource(f)?Pr("files-spaces-projects"):s({path:pt.dirname(f.path),...f.parentFolderId&&{fileId:f.parentFolderId},resource:f})},getParentFolderName:f=>{const m=h(e.space)||i(f),w=o({space:m,path:pt.dirname(f.path)});if(te.isShareRoot(f)||f.id===m.id&&te.isShareSpaceResource(m)||!w)return r("Shared with me");const E=te.extractParentFolderName(f);if(E)return E;if(te.isShareSpaceResource(m))return m.name;if(t.spacesProjects){if(te.isProjectSpaceResource(f))return r("Spaces");if(m?.driveType==="project")return m.name}return r("Personal")},getParentFolderLinkIconAdditionalAttributes:f=>te.isProjectSpaceResource(f)||te.isProjectSpaceResource(n(f.storageId)||{})&&f.path.split("/").length===2?{name:"layout-grid","fill-type":"fill"}:{}}},R0=({appId:e})=>{const{$gettext:t}=Fe.useGettext(),r=An(),{dispatchModal:n}=ht(),i=rn(),{apps:o}=Ve.storeToRefs(i),{getParentFolderLink:s}=si(),a=({resources:u})=>{const c=h(o)[e],d=s(u[0]);n({elementClass:"open-with-app-modal",title:t("Open file in %{app}",{app:c.name}),customComponent:A0,hideActions:!0,customComponentAttrs:()=>({app:c,parentFolderLink:d}),focusTrapInitial:!1})};return{actions:B(()=>[{name:"open-with-app",icon:"folder-open",handler:a,label:()=>t("Open"),isVisible:()=>!h(r),class:"oc-files-actions-open-with-app-trigger"}])}},hN=xe({name:"SaveAsModal",components:{AppLoadingSpinner:pd},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(),r=le(!0),n=ti(),{$gettext:i}=Fe.useGettext(),o=He(),s=Ge(),{removeModal:a}=ht(),{showMessage:l,showErrorMessage:u}=nt(),{getMatchingSpace:c}=rr(),{getEditorRouteOpts:d}=Hr(),f=o.resolve(e.parentFolderLink),m=n.currentTheme.name,w=new URL(f.href,window.location.origin);w.searchParams.append("hide-logo","true"),w.searchParams.append("embed","true"),w.searchParams.append("embed-target","location"),w.searchParams.append("embed-choose-file-name","true"),w.searchParams.append("embed-delegate-authentication","false"),w.searchParams.append("embed-choose-file-name-suggestion",e.originalResource.name);const v=()=>{r.value=!1,h(t).contentWindow.focus()},E=async({data:p})=>{if(p.name!=="opencloud-embed:select")return;const{resources:S,fileName:T,locationQuery:R}=p.data,I=S[0],A=c(I);try{const D=await b({destinationFolder:I,fileName:T,space:A});l({title:i("»%{fileName}« was saved successfully",{fileName:D.name})}),g({resource:D,space:A,locationQuery:R})}catch(D){console.error(D),u({title:i("Unable to save »%{fileName}«",{fileName:T}),errors:[D]}),console.error(D)}a(e.modal.id)},b=async({destinationFolder:p,fileName:S,space:T})=>{const{children:R}=await s.webdav.listFiles(T,{fileId:p.fileId},{davProperties:[Me.Name]});return R.find(A=>A.name===S)&&(S=Ur(S,e.originalResource.extension,R)),s.webdav.putFileContents(T,{fileName:S,parentFolderId:p.id,content:e.content,path:te.urlJoin(p.path,S)})},g=({locationQuery:p,resource:S,space:T})=>{const R=te.isShareSpaceResource(T)?T.id:void 0,I=d(h(o.currentRoute).name,T,S,R);I.query={...I.query,...p};const A=o.resolve(I),D=new URL(A.href,window.location.origin);window.open(D.href,"_blank")},y=({data:p})=>{p.name==="opencloud-embed:cancel"&&a(e.modal.id)};return $t(()=>{window.addEventListener("message",E),window.addEventListener("message",y)}),mr(()=>{window.removeEventListener("message",E),window.removeEventListener("message",y)}),{isLoading:r,onLoad:v,iframeTitle:m,iframeSrc:w.href,iframeRef:t,onLocationPick:E}}}),mN={class:"h-full",tabindex:"0"},gN=["title","src"];function yN(e,t,r,n,i,o){const s=be("app-loading-spinner");return Q(),ye("div",mN,[e.isLoading?(Q(),Ae(s,{key:0})):_e("",!0),lt(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,gN),[[fh,!e.isLoading]])])}const C0=qe(hN,[["render",yN]]),I0=({content:e})=>{const{$gettext:t}=Fe.useGettext(),r=An(),{dispatchModal:n}=ht(),{getParentFolderLink:i}=si(),o=({resources:a})=>{const l=i(a[0]);n({elementClass:"save-as-modal",title:t("Save as"),customComponent:C0,hideActions:!0,customComponentAttrs:()=>({content:h(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})=>!h(r)||a.length!==1,class:"oc-files-actions-save-as-trigger"}])}},_0=()=>{const{showMessage:e,showErrorMessage:t}=nt(),r=bt(),{$gettext:n,$ngettext:i}=Fe.useGettext(),o=ur(),s=Ge(),a=zt(),{dispatchModal:l}=ht(),u=ut(),{removeResources:c}=Ke(),d=v=>v.filter(E=>te.isProjectSpaceResource(E)&&E.canBeDeleted({user:r.user,ability:o})),f=async v=>{const E=s.graphAuthenticated,b=v.map(S=>E.drives.deleteDrive(S.id).then(()=>(c([S]),u.removeSpace(S),!0))),g=await Promise.allSettled(b),y=g.filter(S=>S.status==="fulfilled");if(y.length){const S=y.length===1&&v.length===1?n("Space »%{space}« was deleted successfully",{space:v[0].name}):i("%{spaceCount} space was deleted successfully","%{spaceCount} spaces were deleted successfully",y.length,{spaceCount:y.length.toString()},!0);e({title:S})}const p=g.filter(S=>S.status==="rejected");if(p.length){p.forEach(console.error);const S=p.length===1&&v.length===1?n("Failed to delete space »%{space}«",{space:v[0].name}):i("Failed to delete %{spaceCount} space","Failed to delete %{spaceCount} spaces",p.length,{spaceCount:p.length.toString()},!0);t({title:S,errors:p.map(T=>T.reason)})}h(a).name==="admin-settings-spaces"&&ze.publish("app.admin-settings.list.load")},m=({resources:v})=>{const E=d(v);if(!E.length)return;const b=i("Are you sure you want to delete the selected space?","Are you sure you want to delete %{count} selected spaces?",E.length,{count:E.length.toString()});l({title:i("Delete Space »%{space}«?","Delete %{spaceCount} Spaces?",E.length,{space:E[0].name,spaceCount:E.length.toString()}),confirmText:n("Delete"),message:b,hasInput:!1,onConfirm:()=>f(E)})};return{actions:B(()=>[{name:"delete",icon:"delete-bin",label:()=>n("Delete"),handler:m,isVisible:({resources:v})=>!!d(v).length,class:"oc-files-actions-delete-trigger"}]),deleteSpaces:f}},O0=()=>{const{showMessage:e,showErrorMessage:t}=nt(),r=bt(),{$gettext:n,$ngettext:i}=Fe.useGettext(),o=ur(),s=Ge(),a=zt(),l=He(),{dispatchModal:u}=ht(),c=ut(),d=v=>v.filter(E=>te.isProjectSpaceResource(E)&&E.canDisable({user:r.user,ability:o})),f=async v=>{const E=h(a),b=s.graphAuthenticated,g=v.map(T=>b.drives.disableDrive(T.id).then(()=>(E.name==="files-spaces-generic"&&l.push({name:"files-spaces-projects"}),E.name==="admin-settings-spaces"&&(T.disabled=!0,T.spaceQuota={total:T.spaceQuota.total}),c.updateSpaceField({id:T.id,field:"disabled",value:!0}),!0))),y=await Promise.allSettled(g),p=y.filter(T=>T.status==="fulfilled");if(p.length){const T=p.length===1&&v.length===1?n("Space »%{space}« was disabled successfully",{space:v[0].name}):i("%{spaceCount} space was disabled successfully","%{spaceCount} spaces were disabled successfully",p.length,{spaceCount:p.length.toString()},!0);e({title:T})}const S=y.filter(T=>T.status==="rejected");if(S.length){S.forEach(console.error);const T=S.length===1&&v.length===1?n("Failed to disable space »%{space}«",{space:v[0].name}):i("Failed to disable %{spaceCount} space","Failed to disable %{spaceCount} spaces",S.length,{spaceCount:S.length.toString()},!0);t({title:T,errors:S.map(R=>R.reason)})}},m=({resources:v})=>{const E=d(v);if(!E.length)return;const b=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.",E.length,{count:E.length.toString()}),g=n("Disable");u({title:i("Disable Space »%{space}«?","Disable %{spaceCount} Spaces?",E.length,{space:E[0].name,spaceCount:E.length.toString()}),confirmText:g,message:b,hasInput:!1,onConfirm:()=>f(E)})};return{actions:B(()=>[{name:"disable",icon:"stop-circle",label:()=>n("Disable"),handler:m,isVisible:({resources:v})=>!!d(v).length,class:"oc-files-actions-disable-trigger"}]),disableSpaces:f}},P0=()=>{const e=ct(),t=ut(),r=En(),{showMessage:n,showErrorMessage:i}=nt(),o=He(),{$gettext:s}=Fe.useGettext(),a=ur(),l=Ge(),u=ir(),{upsertResource:c}=Ke(),d=gt(o,"files-spaces-projects"),f=async v=>{const E=t.spaces.filter(te.isProjectSpaceResource),b=Ur(v.name,"",E);try{let g=await l.graphAuthenticated.drives.createDrive({name:b,description:v.description,quota:{total:v.spaceQuota.total}});const y=await l.webdav.listFiles(v);if(y.children.length){const p=new On({concurrency:e.options.concurrentRequests.resourceBatchActions}),S=[];for(const T of y.children)S.push(p.add(()=>l.webdav.copyFiles(v,T,g,{path:T.name})));await Promise.all(S)}if(v.spaceReadmeData||v.spaceImageData){const p={special:[]};if(v.spaceReadmeData){const S=await l.webdav.getFileInfo(g,{path:`.space/${v.spaceReadmeData.name}`});p.special.push({specialFolder:{name:"readme"},id:S.id})}if(v.spaceImageData){const S=await l.webdav.getFileInfo(g,{path:`.space/${v.spaceImageData.name}`});p.special.push({specialFolder:{name:"image"},id:S.id})}g=await l.graphAuthenticated.drives.updateDrive(g.id,p,r.graphRoles)}t.upsertSpace(g),d&&c(g),n({title:s("Space »%{space}« was duplicated successfully",{space:v.name})})}catch(g){console.error(g),i({title:s("Failed to duplicate space »%{space}«",{space:v.name}),errors:[g]})}},m=async({resources:v})=>{for(const E of v)E.disabled||!te.isProjectSpaceResource(E)||await f(E)};return{actions:B(()=>[{name:"duplicate",icon:"folders",label:()=>s("Duplicate"),handler:v=>u.addTask(()=>m(v)),isVisible:({resources:v})=>!v?.length||v.every(E=>E.disabled)||v.every(E=>!te.isProjectSpaceResource(E))?!1:a.can("create-all","Drive"),class:"oc-files-actions-duplicate-trigger"}]),duplicateSpace:f}},vN=()=>{const{showMessage:e,showErrorMessage:t}=nt(),r=bt(),{$gettext:n}=Fe.useGettext(),i=ur(),o=Ge(),s=zt(),{dispatchModal:a}=ht(),l=ut(),u=(f,m)=>o.graphAuthenticated.drives.updateDrive(f.id,{name:f.name,description:m}).then(()=>{l.updateSpaceField({id:f.id,field:"description",value:m}),h(s).name==="admin-settings-spaces"&&(f.description=m),e({title:n("Space subtitle was changed successfully")})}).catch(v=>{console.error(v),t({title:n("Failed to change space subtitle"),errors:[v]})}),c=({resources:f})=>{f.length===1&&a({title:n("Change subtitle for space")+" "+f[0].name,confirmText:n("Confirm"),hasInput:!0,inputLabel:n("Space subtitle"),inputValue:f[0].description,onConfirm:m=>u(f[0],m)})};return{actions:B(()=>[{name:"editDescription",icon:"h-2",iconFillType:"none",label:()=>n("Edit subtitle"),handler:c,isVisible:({resources:f})=>f.length!==1?!1:f[0].canEditDescription({user:r.user,ability:i}),class:"oc-files-actions-edit-description-trigger"}]),editDescriptionSpace:u}},bN={name:"QuotaSelect",props:{totalQuota:{type:Number,default:0},maxQuota:{type:Number,default:0}},emits:["selectedOptionChange"],setup(){const e=le(void 0),t=le([]);return{selectedOption:e,options:t}},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 Ct.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(r=>this.totalQuota===0&&r.value===0?(r.selectable=!1,!0):r.value!==0&&r.value<=this.maxQuota)),e.find(r=>r.value===this.totalQuota)||e.push({displayValue:this.getFormattedFileSize(this.totalQuota),value:this.totalQuota,selectable:this.totalQuota<=this.quotaLimit}),e=[...e.filter(r=>r.value).sort((r,n)=>r.value-n.value),...e.filter(r=>!r.value)],this.options=e},getFormattedFileSize(e){const t=yr(e,this.$language.current);return this.isValueValidNumber(e)?t:e.toString()}}},wN={class:"quota-select-batch-action-form"},SN=["textContent"],EN={class:"flex justify-between"},TN=["textContent"],AN={key:0,class:"oc-text-input-danger"};function RN(e,t,r,n,i,o){const s=be("oc-icon"),a=be("oc-select");return Q(),ye("div",wN,[ge(a,jt({ref:"select","model-value":n.selectedOption,selectable:o.optionSelectable,taggable:"","push-tags":"",clearable:!1,options:n.options,"create-option":o.createOption,"option-label":"displayValue",label:e.$gettext("Quota")},e.$attrs,{"onUpdate:modelValue":o.onUpdate}),{"selected-option":we(({displayValue:l})=>[e.$attrs["read-only"]?(Q(),Ae(s,{key:0,name:"lock",class:"mr-1",size:"small"})):_e("",!0),fe("span",{textContent:W.toDisplayString(l)},null,8,SN)]),search:we(({attributes:l,events:u})=>[fe("input",jt({class:"vs__search"},l,vl(u,!0)),null,16)]),option:we(({displayValue:l,error:u})=>[fe("div",EN,[fe("span",{textContent:W.toDisplayString(l)},null,8,TN)]),u?(Q(),ye("div",AN,W.toDisplayString(u),1)):_e("",!0)]),_:1},16,["model-value","selectable","options","create-option","label","onUpdate:modelValue"])])}const k0=qe(bN,[["render",RN]]),CN={key:0,class:"mt-2"},IN=["textContent"],F0=xe({__name:"QuotaModal",props:{modal:{},spaces:{},warningMessage:{default:""},warningMessageContextualHelperData:{default:()=>{}},resourceType:{default:"space"}},emits:["update:confirmDisabled"],setup(e,{expose:t,emit:r}){const n=r,{showMessage:i,showErrorMessage:o}=nt(),{$gettext:s,$ngettext:a}=Fe.useGettext(),l=Ge(),u=He(),c=ut(),d=er(),{spacesMaxQuota:f}=Ve.storeToRefs(d),{updateResourceField:m}=Ke(),w=le(e.spaces[0]?.spaceQuota?.total||0),v=p=>e.resourceType==="space"?a("Space quota was changed successfully","Quota of %{count} spaces was changed successfully",p,{count:p.toString()}):e.resourceType==="user"?a("User quota was changed successfully","Quota of %{count} users was changed successfully",p,{count:p.toString()}):s("Quota was changed successfully"),E=p=>e.resourceType==="space"?a("Failed to change space quota","Failed to change quota for %{count} spaces",p,{count:p.toString()}):e.resourceType==="user"?a("Failed to change user quota","Failed to change quota for %{count} users",p,{count:p.toString()}):s("Failed to change quota"),b=B(()=>!e.spaces.some(p=>p.spaceQuota.total!==h(w)));dt(b,()=>{n("update:confirmDisabled",h(b))},{immediate:!0});const g=p=>{w.value=p.value};return t({onConfirm:async()=>{const p=l.graphAuthenticated,S=e.spaces.map(async A=>{const D=await p.drives.updateDrive(A.id,{name:A.name,quota:{total:h(w)}});h(u.currentRoute).name==="admin-settings-spaces"&&ze.publish("app.admin-settings.spaces.space.quota.updated",{spaceId:A.id,quota:D.spaceQuota}),h(u.currentRoute).name==="admin-settings-users"&&ze.publish("app.admin-settings.users.user.quota.updated",{spaceId:A.id,quota:D.spaceQuota}),c.updateSpaceField({id:A.id,field:"spaceQuota",value:D.spaceQuota}),m({id:A.id,field:"spaceQuota",value:D.spaceQuota})}),T=await Promise.allSettled(S),R=T.filter(A=>A.status==="fulfilled");R.length&&i({title:v(R.length)});const I=T.filter(A=>A.status==="rejected");I.length&&(console.error(I),I.forEach(console.error),o({title:E(I.length),errors:I.map(A=>A.reason)}))}}),(p,S)=>{const T=be("oc-contextual-helper");return Q(),ye(Ue,null,[ge(k0,{"total-quota":w.value,"max-quota":h(f),"position-fixed":!0,onSelectedOptionChange:g},null,8,["total-quota","max-quota"]),p.warningMessage?(Q(),ye("div",CN,[fe("span",{class:"oc-text-input-warning",textContent:W.toDisplayString(p.warningMessage)},null,8,IN),p.warningMessageContextualHelperData?(Q(),Ae(T,jt({key:0,class:"pl-1"},p.warningMessageContextualHelperData),null,16)):_e("",!0)])):_e("",!0)],64)}}}),x0=()=>{const{dispatchModal:e}=ht(),{$gettext:t}=Fe.useGettext(),r=ur(),n=({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:n({resources:s}),customComponent:F0,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=>!te.isProjectSpaceResource(a)||te.isSpaceResource(a)&&!a.spaceQuota)?!1:r.can("set-quota-all","Drive"),class:"oc-files-actions-edit-quota-trigger"}])}};function N0(){const{getDefaultAction:e}=Hr();return{openWithDefaultApp:({space:r,resource:n})=>{if(!n||n.isFolder)return;const i={resources:[n],space:r},o=e({...i,omitSystemActions:!0});o&&o.handler(i)}}}const _N=()=>{const e=Ge(),{openWithDefaultApp:t}=N0(),{createDefaultMetaFolder:r}=$i(),n=bt(),i=ut(),{$gettext:o}=Fe.useGettext(),{getDefaultMetaFolder:s}=ya(),a=async(c,d)=>{const f=await e.webdav.putFileContents(c,{path:".space/readme.md",parentFolderId:d.id,fileName:"readme.md"}),m=await e.graphAuthenticated.drives.updateDrive(c.id,{name:c.name,special:[{specialFolder:{name:"readme"},id:f.id}]});return i.updateSpaceField({id:c.id,field:"spaceReadmeData",value:m.spaceReadmeData}),f},l=async({resources:c})=>{let d=null,f=await s(c[0]);if(f||(f=await r(c[0]),d=await a(c[0],f)),!d){const m=te.getRelativeSpecialFolderSpacePath(c[0],"readme");m?d=await e.webdav.getFileInfo(c[0],{path:m}):d=await a(c[0],f)}t({space:c[0],resource:d})};return{actions:B(()=>[{name:"editReadmeContent",icon:"article",label:()=>o("Edit description"),handler:l,isVisible:({resources:c})=>c.length!==1?!1:c[0].canEditReadme({user:n.user}),class:"oc-files-actions-edit-readme-content-trigger"}])}},D0=()=>{const{showMessage:e,showErrorMessage:t}=nt(),r=bt(),{$gettext:n}=Fe.useGettext(),i=ur(),o=Ge(),s=zt(),{isSpaceNameValid:a}=ii(),{dispatchModal:l}=ht(),u=ut(),c=(m,w)=>o.graphAuthenticated.drives.updateDrive(m.id,{name:w}).then(()=>{h(s).name==="admin-settings-spaces"&&(m.name=w),u.updateSpaceField({id:m.id,field:"name",value:w}),e({title:n("Space name was changed successfully")})}).catch(E=>{console.error(E),t({title:n("Failed to rename space"),errors:[E]})}),d=({resources:m})=>{m.length===1&&l({title:n("Rename space »%{name}«",{name:m[0].name}),confirmText:n("Rename"),hasInput:!0,inputLabel:n("Space name"),inputValue:m[0].name,inputRequiredMark:!0,onConfirm:w=>c(m[0],w),onInput:(w,v)=>{const{isValid:E,error:b}=a(w);v(E?null:b)}})};return{actions:B(()=>[{name:"rename",icon:"pencil",label:()=>n("Rename"),handler:d,isVisible:({resources:m})=>m.length!==1?!1:m[0].canRename({user:r.user,ability:i}),class:"oc-files-actions-rename-trigger"}]),renameSpace:c}},$0=()=>{const{showMessage:e,showErrorMessage:t}=nt(),r=bt(),{$gettext:n,$ngettext:i}=Fe.useGettext(),o=ur(),s=Ge(),a=ir(),l=zt(),{dispatchModal:u}=ht(),c=ut(),d=v=>v.filter(E=>te.isProjectSpaceResource(E)&&E.canRestore({user:r.user,ability:o})),f=async v=>{const E=s.graphAuthenticated,b=v.map(S=>E.drives.updateDrive(S.id,{name:S.name},{headers:{Restore:"true"}}).then(T=>(h(l).name==="admin-settings-spaces"&&(S.disabled=!1,S.spaceQuota=T.spaceQuota),c.updateSpaceField({id:S.id,field:"disabled",value:!1}),!0))),g=await a.addTask(()=>Promise.allSettled(b));await c.loadGraphPermissions({ids:v.map(S=>S.id),graphClient:E});const y=g.filter(S=>S.status==="fulfilled");if(y.length){const S=y.length===1&&v.length===1?n("Space »%{space}« was enabled successfully",{space:v[0].name}):i("%{spaceCount} space was enabled successfully","%{spaceCount} spaces were enabled successfully",y.length,{spaceCount:y.length.toString()},!0);e({title:S})}const p=g.filter(S=>S.status==="rejected");if(p.length){p.forEach(console.error);const S=p.length===1&&v.length===1?n("Failed to enabled space »%{space}«",{space:v[0].name}):i("Failed to enable %{spaceCount} space","Failed to enable %{spaceCount} spaces",p.length,{spaceCount:p.length.toString()},!0);t({title:S,errors:p.map(T=>T.reason)})}},m=({resources:v})=>{const E=d(v);if(!E.length)return;const b=i("If you enable the selected space, it can be accessed again.","If you enable the %{count} selected spaces, they can be accessed again.",E.length,{count:E.length.toString()}),g=n("Enable");u({title:i("Enable Space »%{space}«?","Enable %{spaceCount} Spaces?",E.length,{space:E[0].name,spaceCount:E.length.toString()}),confirmText:g,message:b,hasInput:!1,onConfirm:()=>f(E)})};return{actions:B(()=>[{name:"restore",icon:"play-circle",label:()=>n("Enable"),handler:m,isVisible:({resources:v})=>!!d(v).length,class:"oc-files-actions-restore-trigger"}]),restoreSpaces:f}},ON=()=>{const{$gettext:e}=Fe.useGettext(),t=Ke(),r=({resources:i})=>{t.setSelection(i.map(({id:o})=>o)),ze.publish(Tt.openWithPanel,"space-share")};return{actions:B(()=>[{name:"show-members",icon:"group",label:()=>e("Members"),handler:r,isVisible:({resources:i})=>i.length===1&&!i[0].disabled,class:"oc-files-actions-show-details-trigger"}])}},PN=()=>{const e=He(),{$gettext:t}=Fe.useGettext(),r=i=>Ri("files-trash-generic",{...tn(i,{fileId:i.fileId})});return{actions:B(()=>[{name:"navigateToTrash",icon:"delete-bin-5",label:()=>t("Open trash bin"),handler:({resources:i})=>{e.push(r(i[0]))},isVisible:({resources:i})=>!(i.length!==1||!te.isProjectSpaceResource(i[0])&&!te.isPersonalSpaceResource(i[0])||i[0].disabled),class:"oc-files-actions-navigate-to-trash-trigger"}])}},kN=xe({name:"EmojiPickerModal",components:{},props:{modal:{type:Object,required:!0}},emits:["confirm"],setup(e,{emit:t}){const r=ti(),{currentTheme:n}=Ve.storeToRefs(r),i=B(()=>h(n).isDark?"dark":"light");return{onEmojiSelect:s=>{t("confirm",s)},theme:i}}});function FN(e,t,r,n,i,o){const s=be("oc-emoji-picker");return Q(),Ae(s,{theme:e.theme,onEmojiSelect:e.onEmojiSelect},null,8,["theme","onEmojiSelect"])}const L0=qe(kN,[["render",FN]]),xN=()=>{const e=bt(),{showMessage:t,showErrorMessage:r}=nt(),{$gettext:n}=Fe.useGettext(),i=Ge(),o=ir(),s=ut(),{createDefaultMetaFolder:a}=$i(),{dispatchModal:l}=ht(),{getDefaultMetaFolder:u}=ya(),c=({resources:w})=>{w.length===1&&l({elementClass:"w-auto",title:n("Set icon for »%{space}«",{space:w[0].name}),hideConfirmButton:!0,customComponent:L0,focusTrapInitial:!1,onConfirm:v=>f(w[0],v)})},d=async w=>{const v=document.createElement("canvas"),E=v.getContext("2d"),b=16/9,g=720,y=g/b;v.width=g,v.height=y;const p=.4*g;E.font=`${p}px sans-serif`,E.textBaseline="middle",E.textAlign="center",E.fillText(w,v.width/2,v.height/2+15);const T=await Sb(v);return wb(T)},f=async(w,v)=>{const E=i.graphAuthenticated,b=await d(v);let g=await u(w);return g||(g=await a(w)),o.addTask(async()=>{const y={"Content-Type":"application/offset+octet-stream"};try{const{fileId:p}=await i.webdav.putFileContents(w,{parentFolderId:g.id,fileName:"image.png",content:b,headers:y,overwrite:!0}),S=await E.drives.updateDrive(w.id,{name:w.name,special:[{specialFolder:{name:"image"},id:p}]});s.updateSpaceField({id:w.id,field:"spaceImageData",value:S.spaceImageData}),t({title:n("Space icon was set successfully")}),ze.publish("app.files.spaces.uploaded-image",S)}catch(p){if(console.error(p),p instanceof te.HttpError&&p.statusCode===507){r({title:n("Failed to set space icon"),desc:n("Not enough quota to set the space icon"),errors:[p]});return}r({title:n("Failed to set space icon"),errors:[p]})}})};return{actions:B(()=>[{name:"set-space-icon",icon:"emoji-sticker",handler:c,label:()=>n("Set icon"),isVisible:({resources:w})=>w.length!==1?!1:w[0].canEditImage({user:e.user}),class:"oc-files-actions-set-space-icon-trigger"}]),setIconSpace:f}},NN=()=>{const e=bt(),{$gettext:t}=Fe.useGettext(),{dispatchModal:r}=ht(),{graphAuthenticated:n,webdav:i}=Ge(),o=ut(),{showMessage:s,showErrorMessage:a}=nt(),{defaultSpaceImageBlobURL:l}=Ve.storeToRefs(o),u=async({space:f})=>{try{await i.deleteFile(f,{path:".space/image.png"}),await n.drives.updateDrive(f.id,{name:f.name,special:[{specialFolder:{name:"image"},id:null}]}),o.updateSpaceField({id:f.id,field:"spaceImageData",value:null}),o.updateSpaceField({id:f.id,field:"thumbnail",value:h(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:f})=>{r({title:t("Delete »%{space}« image",{space:f[0].name}),confirmText:t("Delete"),onConfirm:()=>u({space:f[0]}),message:t("Are you sure you want to delete the image of »%{space}«?",{space:f[0].name})})};return{actions:B(()=>[{name:"delete-space-image",icon:"delete-bin",handler:c,label:()=>t("Delete image"),isVisible:({resources:f})=>f.length!==1||!f[0].spaceImageData?!1:f[0].canEditImage({user:e.user}),class:"oc-files-actions-delete-space-image-trigger"}]),deleteSpaceImage:u}},DN=()=>{const{$gettext:e}=Fe.useGettext();return{actions:B(()=>[{name:"show-details",icon:"information",label:()=>e("Details"),handler:()=>ze.publish(Tt.open),isVisible:({resources:r})=>r.length>0,class:"oc-admin-settings-show-details-trigger"}])}},$N=()=>{const{getMatchingSpace:e}=rr(),t=ut(),r=rn(),n=Ke(),i=Ge(),{$gettext:o}=Fe.useGettext(),{openEditor:s}=Hr(),{resources:a,currentFolder:l}=Ve.storeToRefs(n);return{openEmptyEditor:async(c,d)=>{let f=h(l)?e(h(l)):null,m=h(a),w=h(l)?.path;(!f||!h(l).canCreate())&&(f=t.personalSpace,m=(await i.webdav.listFiles(f)).children,w="");let v=o("New file")+`.${d}`;m.some(y=>y.name===v)&&(v=Ur(v,d,m));const E=await i.webdav.putFileContents(f,{path:te.urlJoin(w,v)}),b=e(E),g=r.fileExtensions.find(({app:y,extension:p})=>y===c&&p===d);s(g,b,E)}}},M0=()=>{const{$gettext:e}=Fe.useGettext(),{showMessage:t}=nt();return{openUrl:(n,i,o)=>{const s=window.open(n,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.")})}}},LN=()=>bn("$appProviderService"),MN=()=>{const{isResourceAccessible:e}=rr();return{breadcrumbsFromPath:({route:n,space:i,resourcePath:o,ancestorMetaData:s=le({})})=>{const a=(c="")=>c.split("/").filter(Boolean),l=a(n.path),u=a(o);return u.map((c,d)=>{const f=te.urlJoin(...u.slice(0,d+1),{leadingSlash:!0}),m=e({space:h(i),path:f});let w;return m&&(w=h(s)[f]),{id:Xt.v4(),allowContextActions:!0,text:c,...m&&{to:{path:"/"+[...l].splice(0,l.length-u.length+d+1).join("/"),query:{...xi(n.query,"page","fileId"),...w&&{fileId:w.id}}}},isStaticNav:!1}})},concatBreadcrumbs:(...n)=>{const i=n.pop();return[...n,{id:Xt.v4(),allowContextActions:i.allowContextActions,text:i.text,onClick:()=>ze.publish("app.files.list.load"),isTruncationPlaceholder:i.isTruncationPlaceholder,isStaticNav:i.isStaticNav}]}}},BN=(e="")=>{const t=le(0),r=async()=>{await ar();const n=document.querySelector(e||"#files-app-bar"),i=n?n.getBoundingClientRect().height:0;t.value!==i&&(t.value=i)};return window.onresize=r,$t(r),{y:t,refresh:r}},hd=()=>{const e=le(!0),t=()=>{e.value=window.innerHeight>500};return $t(()=>{t(),window.addEventListener("resize",t)}),mr(()=>{window.removeEventListener("resize",t)}),{isSticky:e}};class Li{static perPageDefault="100";static perPageQueryName="items-per-page";static options=["20","50","100","250","500"]}function jN(e){const t=Yo.useRouter(),r=Yo.useRoute(),n=UN(e),i=qN(e),o=B(()=>Math.ceil(h(e.items).length/h(i))||1),s=B(()=>{if(!h(i))return h(e.items);const a=(h(n)-1)*h(i),l=a+h(i);return h(e.items).slice(a,l)});return ze.subscribe("app.files.navigate.page",({resourceId:a,forceScroll:l,topbarElement:u})=>{const c=Ct.findIndex(h(e.items),d=>d.id===a);if(c>=0){const d=Math.ceil((c+1)/Number(h(i)));t.push({...h(r),query:{...h(r).query,page:d}}).then(()=>{ze.publish("app.files.navigate.scrollTo",{resourceId:a,forceScroll:l,topbarElement:u})})}}),{items:s,total:o,page:n,perPage:i}}function UN(e){if(e.page)return B(()=>h(e.page));const t=tr("page","1");return B(()=>parseInt(Rt(h(t))))}function qN(e){if(e.perPage)return B(()=>h(e.perPage));const t=Tn({name:e.perPageQueryName||Li.perPageQueryName,defaultValue:e.perPageDefault||Li.perPageDefault,storagePrefix:e.perPageStoragePrefix});return B(()=>parseInt(Rt(h(t))))}const B0=()=>bn("$passwordPolicyService");var Pa=(e=>(e.mounted="portal-target.mounted",e))(Pa||{});const VN=()=>{const e=Ln(),t=Ha.useWormhole();return{registerPortal:n=>{e.subscribe(Pa.mounted,()=>{t.open(n)})}}},md=()=>{const e=rn();return{canBeOpenedWithSecureView:r=>e.fileExtensions.filter(({secureView:i})=>i).some(({mimeType:i})=>i===r.mimeType)}},j0=()=>{const e=bt();return{canListVersions:({space:r,resource:n})=>n.type==="folder"||te.isSpaceResource(n)||te.isTrashResource(n)?!1:r?.canListVersions({user:e.user})}},U0=()=>{const e=Ge(),t=ut(),r=B(()=>t.spaces),n=a=>h(r).find(l=>a.toString().startsWith(l.id.toString())),i=a=>h(r).find(l=>te.isMountPointSpaceResource(l)&&l.root?.remoteItem?.id===a),o=a=>{const l=[Me.FileId,Me.FileParent,Me.Name,Me.ResourceType],u=te.buildSpace({id:a,name:""});return e.webdav.getFileInfo(u,{fileId:a},{davProperties:l})};return{getResourceContext:async a=>{let l,u,c=n(a);if(c)return l=await e.webdav.getPathForFileId(a),u=await e.webdav.getFileInfo(c,{path:l}),{space:c,resource:u,path:l};await t.loadMountPoints({graphClient:e.graphAuthenticated});let d=i(a);u=await o(a);const f=d?[]:[h(u).name];let m=h(u);for(;!d;)m=await o(m.parentFolderId),d=i(m.id),d||f.unshift(m.name);return c=t.getSpace(d.root?.remoteItem?.id)||t.createShareSpace({driveAliasPrefix:u.storageId?.startsWith(te.OCM_PROVIDER_ID)?"ocm-share":"share",id:d.root?.remoteItem?.id,shareName:d.name}),l=te.urlJoin(...f),{space:c,resource:u,path:l}}}},Kt={name:{table:"resource-table",condensedTable:"resource-table-condensed",tiles:"resource-tiles"},defaultModeName:"resource-tiles",queryName:"view-mode",tilesSizeDefault:2,tilesSizeMax:6,tilesSizeQueryName:"tiles-size"},zN=140,WN=84,q0=()=>{const e=le(zN),t=le(WN),r=i=>h(e)+(i-1)*h(t);return{calculateTileSizePixels:r,calculateTileSizeRem:i=>{const o=parseFloat(getComputedStyle(document.documentElement).fontSize);return r(i)/o}}};function HN(e){if(e)return B(()=>h(e));const t=Tn({name:Kt.queryName,defaultValue:Kt.defaultModeName});return B(()=>Rt(h(t)))}function GN(e){if(e)return B(()=>parseInt(h(e)));const t=Tn({name:Kt.tilesSizeQueryName,defaultValue:Kt.tilesSizeDefault.toString()});return B(()=>parseInt(Rt(h(t))))}const KN=le(Kt.tilesSizeMax);function gd(){return KN}const yd=e=>{const t=ad(),{updateResourceField:r}=Ke(),{httpAuthenticated:n}=Ge(),i=ut(),{defaultSpaceImageBlobURL:o}=Ve.storeToRefs(i),s=ct(),{serverUrl:a}=Ve.storeToRefs(s),l=new On({concurrency:4}),u=B(()=>h(e)===Kt.name.tiles),c=B(()=>h(u)?oa.enum.fit:oa.enum.thumbnail),d=B(()=>h(u)?ni.Tile:ni.Thumbnail),f=or.useTask(function*(E,{space:b,resource:g,dimensions:y,processor:p,updateStore:S=!0}){const T=te.isProjectSpaceResource(g)?te.buildSpaceImageResource(g):g,R=T.id===b.spaceImageData?.id;R&&i.addToImagesLoading(b.id);const I=yield l.add(()=>t.loadPreview({space:b,resource:T,processor:p||h(c),dimensions:y||h(d)},!0,!0,E));return I&&S&&r({id:g.id,field:"thumbnail",value:I}),R&&i.removeFromImagesLoading(b.id),I}),m=async E=>{const{resource:b,cancelRunning:g}=E;if(g&&v(),te.isProjectSpaceResource(b)&&(!b.spaceImageData||b.disabled)){h(o)&&i.updateSpaceField({id:b.id,field:"thumbnail",value:h(o)});try{const y=await n.get(`${h(a)}images/default-space-icon.png`,{responseType:"blob"});return i.setDefaultSpaceImageBlobURL(URL.createObjectURL(y.data)),i.updateSpaceField({id:b.id,field:"thumbnail",value:h(o)}),h(o)}catch{return null}}try{return await f.perform(E)}catch(y){y!=="cancel"&&console.error(y)}},w=B(()=>f.isRunning),v=()=>{f.cancelAll(),l.clear(),i.purgeImagesLoading()};return gl(v),{loadPreview:m,previewsLoading:w}},V0=({showSizeInformation:e=!0}={})=>{const t=Ke(),{current:r,$gettext:n,$ngettext:i}=Fe.useGettext(),o=He(),{resources:s,totalResourcesCount:a,areHiddenFilesShown:l,currentFolder:u}=Ve.storeToRefs(t),c=B(()=>{if(!h(u)?.size||h(u)?.size==="0"){const f=h(s).map(m=>m.size?parseInt(m.size.toString()):0).reduce((m,w)=>m+w,0);return yr(f,r)}return yr(h(u).size,r)});return{resourceContentsText:B(()=>{let f=i("%{ filesCount } file","%{ filesCount } files",h(a).files,{filesCount:h(a).files.toString()});!h(l)&&h(a).hiddenFiles&&(f=i("%{ filesCount } file including %{ filesHiddenCount } hidden","%{ filesCount } files including %{ filesHiddenCount } hidden",h(a).files,{filesCount:h(a).files.toString(),filesHiddenCount:h(a).hiddenFiles.toString()}));let m=i("%{ foldersCount } folder","%{ foldersCount } folders",h(a).folders,{foldersCount:h(a).folders.toString()});!h(l)&&h(a).hiddenFolders&&(m=i("%{ foldersCount } folder including %{ foldersHiddenCount } hidden","%{ foldersCount } folders including %{ foldersHiddenCount } hidden",h(a).folders,{foldersCount:h(a).folders.toString(),foldersHiddenCount:h(a).hiddenFolders.toString()}));const w=i("%{ spacesCount } space","%{ spacesCount } spaces",h(a).spaces,{spacesCount:h(a).spaces.toString()}),v=h(a).files+h(a).folders+h(a).spaces,E=e&&parseFloat(h(c))>0,b=Lt(o,"files-shares-via-link"),g=n(E?"%{ itemsCount } item with %{ itemSize } in total":"%{ itemsCount } item in total"),y=n(E?"%{ itemsCount } items with %{ itemSize } in total":"%{ itemsCount } items in total"),p=b?"(%{ filesStr}, %{ foldersStr}, %{ spacesStr})":"(%{ filesStr}, %{ foldersStr})",S=`${g} ${p}`,T=`${y} ${p}`;return i(S,T,v,{itemsCount:v.toString(),itemSize:h(c),filesStr:f,foldersStr:m,spacesStr:w})})}},vd=()=>{const{getMatchingSpace:e}=rr(),t=Ke(),r=B({get(){return t.selectedResources},set(s){t.setSelection(s.map(({id:a})=>a))}}),n=B({get(){return t.selectedIds},set(s){t.setSelection(s)}}),i=s=>h(n).includes(s.id),o=B(()=>{if(h(r).length!==1)return null;const s=h(r)[0];return e(s)});return{selectedResources:r,selectedResourcesIds:n,isResourceInSelection:i,selectedResourceSpace:o}};function z0(){const{interceptModifierClick:e}=oi(),t=Ln();return{toggleTile:n=>{const i=n[0],o=n[1];if(!(o&&e(o,i))){if(o&&o.metaKey)return t.publish("app.files.list.clicked.meta",i);if(!o.shiftKey&&!o.metaKey&&!o.ctrlKey&&t.publish("app.files.shiftAnchor.reset"),o&&o.shiftKey)return t.publish("app.files.list.clicked.shift",{resource:i,skipTargetSelection:!1});t.publish("app.files.list.clicked.default",i)}}}}function QN(e){const t=er(),r=Xn(),n=Ge(),i=Fe.useGettext(),o=B(()=>t.tusMaxChunkSize>0),s=()=>{const u={};return r.publicLinkPassword?u.Authorization="Basic "+Dn.from(["public",r.publicLinkPassword].join(":")).toString("base64"):r.accessToken&&!r.publicLinkPassword&&(u.Authorization="Bearer "+r.accessToken),u["X-Request-ID"]=Xt.v4(),u["Accept-Language"]=i.current,u["Initiator-ID"]=n.initiatorId,u},a=B(()=>{const u={onBeforeRequest:(c,d)=>new Promise(f=>{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"]),d?.isRemote&&c.setHeader("x-oc-mtime",(d?.data?.lastModified/1e3).toFixed(0)),f()}),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()})}));dt([a,l],()=>{if(h(o)){e.uppyService.useTus(h(a));return}e.uppyService.useXhr(h(l))},{immediate:!0})}const W0=()=>{const e=Ge(),{addAvatar:t,getAvatar:r,avatarsQueue:n,pendingAvatarsRequests:i}=fa(),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 r(a)};return{enqueueAvatar:a=>{if(r(a)!==void 0||i.has(a))return;const l=n.add(()=>o(a));i.set(a,l),l.finally(()=>i.delete(a))}}},XN=xe({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=ct(),{options:r}=Ve.storeToRefs(t),n=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}},...h(n)==="router-link"&&{to:e.action.route(e.actionOptions)},...h(n)==="a"&&{href:e.action.href(e.actionOptions)},...["router-link","a"].includes(h(n))&&{target:r.value.cernFeatures?"_blank":"_self"}}));return{componentType:n,componentProps:i}},computed:{hasExternalImageIcon(){return this.action.icon&&/^https?:\/\//i.test(this.action.icon)},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}}}}),YN={key:3,class:"oc-files-context-action-label flex flex-col","data-testid":"action-label"},JN=["textContent"],ZN=["textContent"];function eD(e,t,r,n,i,o){const s=be("oc-image"),a=be("oc-icon"),l=be("oc-button"),u=lr("oc-tooltip");return lt((Q(),ye("li",null,[lt((Q(),Ae(l,jt({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):"","data-testid":"action-handler",size:e.size,"justify-content":"left"},vl(e.componentListeners)),{default:we(()=>[e.action.img?(Q(),Ae(s,{key:0,"data-testid":"action-img",src:e.action.img,alt:"",class:"oc-icon oc-icon-m"},null,8,["src"])):e.hasExternalImageIcon?(Q(),Ae(s,{key:1,"data-testid":"action-img",src:e.action.icon,alt:"",class:"oc-icon oc-icon-m"},null,8,["src"])):e.action.icon?(Q(),Ae(a,{key:2,"data-testid":"action-icon",name:e.action.icon,"fill-type":e.action.iconFillType||"line",size:e.size},null,8,["name","fill-type","size"])):_e("",!0),e.action.hideLabel?_e("",!0):(Q(),ye("span",YN,[fe("span",{textContent:W.toDisplayString(e.action.label(e.actionOptions))},null,8,JN)])),e.action.shortcut&&e.shortcutHint?(Q(),ye("span",{key:4,class:"text-sm flex-row-reverse",textContent:W.toDisplayString(e.action.shortcut)},null,8,ZN)):_e("",!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 ka=qe(XN,[["render",eD]]),tD=xe({name:"BatchActions",components:{ActionMenuItem:ka},props:{actions:{type:Array,required:!0},actionOptions:{type:Object,required:!0},limitedScreenSpace:{type:Boolean,default:!1,required:!1}}});function rD(e,t,r,n,i,o){const s=be("action-menu-item"),a=be("oc-list");return Q(),ye("div",null,[ge(a,{id:"oc-appbar-batch-actions",class:W.normalizeClass(["block xl:flex xl:items-center",{"oc-appbar-batch-actions-squashed [&_.oc-files-context-action-label]:hidden":e.limitedScreenSpace}])},{default:we(()=>[(Q(!0),ye(Ue,null,mt(e.actions,(l,u)=>(Q(),Ae(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 H0=qe(tD,[["render",rD]]),Lo={};function nD(e){return e.getIsPending!==void 0}function iD(e){if(nD(e))return e;let t=!0,r=e.then(n=>(t=!1,n),n=>{throw t=!1,n});return r.getIsPending=function(){return t},r}function oD(e){let t={};const r=e.attributes;if(!r)return t;for(let n=r.length-1;n>=0;n--)t[r[n].name]=r[n].value;return t}function sD(e){return Object.keys(e).reduce((t,r)=>(e[r]!==!1&&e[r]!==null&&e[r]!==void 0&&(t[r]=e[r]),t),{})}function aD(e,t){const{class:r,style:n,...i}=oD(e),{class:o,style:s,...a}=sD(t);return{class:[r,o],style:[n,s],...i,...a}}const G0=xe({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:r}){const n=e,i=r,o=Vp(),s=le(),a=le(),l=le(),u=Math.random().toString(36).substring(2);t({svgElSource:s,request:l}),dt(()=>n.src,E=>{d(E)}),d(n.src);function c(E){if(E=E.cloneNode(!0),n.uniqueIds){const b=typeof n.uniqueIds=="string"?n.uniqueIds:u;E=v(E,b,n.uniqueIdsBase)}return E=n.transformSource(E),n.title&&w(E,n.title),E.innerHTML}function d(E){Lo[E]||(Lo[E]=f(E)),s.value&&Lo[E].getIsPending()&&!n.keepDuringLoading&&(s.value=null,i("unloaded")),Lo[E].then(b=>{s.value=b,ar(()=>{i("loaded",a.value)})}).catch(b=>{s.value&&(s.value=void 0,i("unloaded")),delete Lo[E],i("error",b)})}function f(E){return iD(new Promise((b,g)=>{const y=new XMLHttpRequest;y.open("GET",E,!0),l.value=y,y.onload=()=>{if(y.status>=200&&y.status<400)try{let p=new DOMParser().parseFromString(y.responseText,"text/xml").getElementsByTagName("svg")[0];p?b(p):g(new Error('Loaded file is not valid SVG"'))}catch(p){g(p)}else g(new Error("Error loading SVG"))},y.onerror=g,y.send()}))}const m=()=>s.value?Al("svg",{...aD(s.value,o),innerHTML:c(s.value),ref:a}):null;function w(E,b){const g=E.getElementsByTagName("title");if(g.length)g[0].textContent=b;else{const y=document.createElementNS("http://www.w3.org/2000/svg","title");y.textContent=b,E.insertBefore(y,E.firstChild)}}function v(E,b,g=""){const y=["id","href","xlink:href","xlink:role","xlink:arcrole"],p=["href","xlink:href"],S=(T,R)=>p.includes(T)&&(R?!R.includes("#"):!1);return[...E.children].forEach(T=>{var R;if((R=T.attributes)!=null&&R.length){const I=Object.values(T.attributes).map(A=>{const D=/url\((.*?)\)/.exec(A.value);return D!=null&&D[1]&&(A.value=A.value.replace(D[0],`url(${g}${D[1]}_${b})`)),A});y.forEach(A=>{const D=I.find(H=>H.name===A);D&&!S(A,D.value)&&(D.value=`${D.value}_${b}`)})}return T.children.length?v(T,b,g):T}),E}return(E,b)=>(Q(),Ae(m))}}),K0=xe({__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}){G0.name="inline-svg";const r=t,n=B(()=>Po("oc-icon-title-")),i=B(()=>{const a=`${Rk()}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",n.value),l.appendChild(document.createTextNode(e.accessibleLabel)),a.insertBefore(l,a.firstChild)}return a};return(a,l)=>(Q(),Ae(jr(a.type),{class:W.normalizeClass(["oc-icon","box-content","inline-block","align-baseline","[&_svg]:block",o.value,{"bg-transparent min-h-0":a.type==="button"}])},{default:we(()=>[ge(h(G0),{src:i.value,"transform-source":s,"aria-hidden":a.accessibleLabel===""?"true":null,"aria-labelledby":a.accessibleLabel===""?null:n.value,focusable:a.accessibleLabel===""?"false":null,style:W.normalizeStyle(a.color!==""?{fill:a.color}:{}),class:W.normalizeClass(o.value),onLoaded:l[0]||(l[0]=u=>r("loaded"))},null,8,["src","aria-hidden","aria-labelledby","focusable","style","class"])]),_:1},8,["class"]))}});/*!
53
53
  * tabbable 6.2.0
54
54
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
55
- */var T0=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],va=T0.join(","),A0=typeof Element>"u",fi=A0?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,wa=!A0&&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==null?void 0:e.ownerDocument},Sa=function e(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=o===""||o==="true",s=i||n&&t&&e(t.parentNode);return s},E$=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},R0=function(t,n,r){if(Sa(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(va));return n&&fi.call(t,va)&&o.unshift(t),o=o.filter(r),o},_0=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!Sa(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),c=a.length?a:s.children,u=e(c,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:s,candidates:u})}else{var l=fi.call(s,va);l&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var d=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),f=!Sa(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(d&&f){var m=e(d===!0?s.children:d.children,!0,r);r.flatten?o.push.apply(o,m):o.push({scopeParent:s,candidates:m})}else i.unshift.apply(i,s.children)}}return o},I0=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},di=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||E$(t))&&!I0(t)?0:t.tabIndex},T$=function(t,n){var r=di(t);return r<0&&n&&!I0(t)?0:r},A$=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},C0=function(t){return t.tagName==="INPUT"},R$=function(t){return C0(t)&&t.type==="hidden"},_$=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},I$=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},C$=function(t){if(!t.name)return!0;var n=t.form||wa(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(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 i=I$(o,t.form);return!i||i===t},P$=function(t){return C0(t)&&t.type==="radio"},F$=function(t){return P$(t)&&!C$(t)},O$=function(t){var n,r=t&&wa(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,a,c;for(i=!!((s=o)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!i&&o;){var u,l,d;r=wa(o),o=(u=r)===null||u===void 0?void 0:u.host,i=!!((l=o)!==null&&l!==void 0&&(d=l.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return i},P0=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},k$=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=fi.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(fi.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var c=t.parentElement,u=wa(t);if(c&&!c.shadowRoot&&o(c)===!0)return P0(t);t.assignedSlot?t=t.assignedSlot:!c&&u!==t.ownerDocument?t=u.host:t=c}t=a}if(O$(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return P0(t);return!1},x$=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return fi.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Ea=function(t,n){return!(n.disabled||Sa(n)||R$(n)||k$(n,t)||_$(n)||x$(n))},od=function(t,n){return!(F$(n)||di(n)<0||!Ea(t,n))},N$=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},$$=function e(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,a=s?o.scopeParent:o,c=T$(a,s),u=s?e(o.candidates):a;c===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:i,tabIndex:c,item:o,isScope:s,content:u})}),r.sort(A$).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},D$=function(t,n){n=n||{};var r;return n.getShadowRoot?r=_0([t],n.includeContainer,{filter:od.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:N$}):r=R0(t,n.includeContainer,od.bind(null,n)),$$(r)},L$=function(t,n){n=n||{};var r;return n.getShadowRoot?r=_0([t],n.includeContainer,{filter:Ea.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=R0(t,n.includeContainer,Ea.bind(null,n)),r},qi=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return fi.call(t,va)===!1?!1:od(n,t)},M$=T0.concat("iframe").join(","),sd=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return fi.call(t,M$)===!1?!1:Ea(n,t)};/*!
55
+ */var Q0=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Fa=Q0.join(","),X0=typeof Element>"u",ai=X0?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,xa=!X0&&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},Na=function e(t,r){var n;r===void 0&&(r=!0);var i=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"inert"),o=i===""||i==="true",s=o||r&&t&&e(t.parentNode);return s},lD=function(t){var r,n=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"contenteditable");return n===""||n==="true"},Y0=function(t,r,n){if(Na(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Fa));return r&&ai.call(t,Fa)&&i.unshift(t),i=i.filter(n),i},J0=function e(t,r,n){for(var i=[],o=Array.from(t);o.length;){var s=o.shift();if(!Na(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=e(l,!0,n);n.flatten?i.push.apply(i,u):i.push({scopeParent:s,candidates:u})}else{var c=ai.call(s,Fa);c&&n.filter(s)&&(r||!t.includes(s))&&i.push(s);var d=s.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(s),f=!Na(d,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(s));if(d&&f){var m=e(d===!0?s.children:d.children,!0,n);n.flatten?i.push.apply(i,m):i.push({scopeParent:s,candidates:m})}else o.unshift.apply(o,s.children)}}return i},Z0=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},li=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||lD(t))&&!Z0(t)?0:t.tabIndex},cD=function(t,r){var n=li(t);return n<0&&r&&!Z0(t)?0:n},uD=function(t,r){return t.tabIndex===r.tabIndex?t.documentOrder-r.documentOrder:t.tabIndex-r.tabIndex},ew=function(t){return t.tagName==="INPUT"},fD=function(t){return ew(t)&&t.type==="hidden"},dD=function(t){var r=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(n){return n.tagName==="SUMMARY"});return r},pD=function(t,r){for(var n=0;n<t.length;n++)if(t[n].checked&&t[n].form===r)return t[n]},hD=function(t){if(!t.name)return!0;var r=t.form||xa(t),n=function(a){return r.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=n(window.CSS.escape(t.name));else try{i=n(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=pD(i,t.form);return!o||o===t},mD=function(t){return ew(t)&&t.type==="radio"},gD=function(t){return mD(t)&&!hD(t)},yD=function(t){var r,n=t&&xa(t),i=(r=n)===null||r===void 0?void 0:r.host,o=!1;if(n&&n!==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,d;n=xa(i),i=(u=n)===null||u===void 0?void 0:u.host,o=!!((c=i)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return o},tw=function(t){var r=t.getBoundingClientRect(),n=r.width,i=r.height;return n===0&&i===0},vD=function(t,r){var n=r.displayCheck,i=r.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var o=ai.call(t,"details>summary:first-of-type"),s=o?t.parentElement:t;if(ai.call(s,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="legacy-full"){if(typeof i=="function"){for(var a=t;t;){var l=t.parentElement,u=xa(t);if(l&&!l.shadowRoot&&i(l)===!0)return tw(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(yD(t))return!t.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return tw(t);return!1},bD=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var r=t.parentElement;r;){if(r.tagName==="FIELDSET"&&r.disabled){for(var n=0;n<r.children.length;n++){var i=r.children.item(n);if(i.tagName==="LEGEND")return ai.call(r,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}r=r.parentElement}return!1},Da=function(t,r){return!(r.disabled||Na(r)||fD(r)||vD(r,t)||dD(r)||bD(r))},bd=function(t,r){return!(gD(r)||li(r)<0||!Da(t,r))},wD=function(t){var r=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(r)||r>=0)},SD=function e(t){var r=[],n=[];return t.forEach(function(i,o){var s=!!i.scopeParent,a=s?i.scopeParent:i,l=cD(a,s),u=s?e(i.candidates):a;l===0?s?r.push.apply(r,u):r.push(a):n.push({documentOrder:o,tabIndex:l,item:i,isScope:s,content:u})}),n.sort(uD).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(r)},ED=function(t,r){r=r||{};var n;return r.getShadowRoot?n=J0([t],r.includeContainer,{filter:bd.bind(null,r),flatten:!1,getShadowRoot:r.getShadowRoot,shadowRootFilter:wD}):n=Y0(t,r.includeContainer,bd.bind(null,r)),SD(n)},TD=function(t,r){r=r||{};var n;return r.getShadowRoot?n=J0([t],r.includeContainer,{filter:Da.bind(null,r),flatten:!0,getShadowRoot:r.getShadowRoot}):n=Y0(t,r.includeContainer,Da.bind(null,r)),n},Mi=function(t,r){if(r=r||{},!t)throw new Error("No node provided");return ai.call(t,Fa)===!1?!1:bd(r,t)},AD=Q0.concat("iframe").join(","),wd=function(t,r){if(r=r||{},!t)throw new Error("No node provided");return ai.call(t,AD)===!1?!1:Da(r,t)};/*!
56
56
  * focus-trap 7.6.5
57
57
  * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
58
- */function ad(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 B$(e){if(Array.isArray(e))return ad(e)}function j$(e,t,n){return(t=W$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function q$(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
59
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function F0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function O0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?F0(Object(n),!0).forEach(function(r){j$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function V$(e){return B$(e)||U$(e)||H$(e)||q$()}function z$(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 W$(e){var t=z$(e,"string");return typeof t=="symbol"?t:t+""}function H$(e,t){if(e){if(typeof e=="string")return ad(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)?ad(e,t):void 0}}var k0={activateTrap:function(t,n){if(t.length>0){var r=t[t.length-1];r!==n&&r._setPausedState(!0)}var o=t.indexOf(n);o===-1||t.splice(o,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),t.length>0&&!t[t.length-1]._isManuallyPaused()&&t[t.length-1]._setPausedState(!1)}},G$=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},K$=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},No=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},Q$=function(t){return No(t)&&!t.shiftKey},X$=function(t){return No(t)&&t.shiftKey},x0=function(t){return setTimeout(t,0)},$o=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return typeof t=="function"?t.apply(void 0,r):t},Ta=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},Y$=[],J$=function(t,n){var r=(n==null?void 0:n.document)||document,o=(n==null?void 0:n.trapStack)||Y$,i=O0({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:Q$,isKeyBackward:X$},n),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a,c=function(x,V,G){return x&&x[V]!==void 0?x[V]:i[G||V]},u=function(x,V){var G=typeof(V==null?void 0:V.composedPath)=="function"?V.composedPath():void 0;return s.containerGroups.findIndex(function(ae){var ye=ae.container,ue=ae.tabbableNodes;return ye.contains(x)||(G==null?void 0:G.includes(ye))||ue.find(function(te){return te===x})})},l=function(x){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},G=V.hasFallback,ae=G===void 0?!1:G,ye=V.params,ue=ye===void 0?[]:ye,te=i[x];if(typeof te=="function"&&(te=te.apply(void 0,V$(ue))),te===!0&&(te=void 0),!te){if(te===void 0||te===!1)return te;throw new Error("`".concat(x,"` was specified but was not a node, or did not return a node"))}var ce=te;if(typeof te=="string"){try{ce=r.querySelector(te)}catch(oe){throw new Error("`".concat(x,'` appears to be an invalid selector; error="').concat(oe.message,'"'))}if(!ce&&!ae)throw new Error("`".concat(x,"` as selector refers to no known node"))}return ce},d=function(){var x=l("initialFocus",{hasFallback:!0});if(x===!1)return!1;if(x===void 0||x&&!sd(x,i.tabbableOptions))if(u(r.activeElement)>=0)x=r.activeElement;else{var V=s.tabbableGroups[0],G=V&&V.firstTabbableNode;x=G||l("fallbackFocus")}else x===null&&(x=l("fallbackFocus"));if(!x)throw new Error("Your focus-trap needs to have at least one focusable element");return x},f=function(){if(s.containerGroups=s.containers.map(function(x){var V=D$(x,i.tabbableOptions),G=L$(x,i.tabbableOptions),ae=V.length>0?V[0]:void 0,ye=V.length>0?V[V.length-1]:void 0,ue=G.find(function(oe){return qi(oe)}),te=G.slice().reverse().find(function(oe){return qi(oe)}),ce=!!V.find(function(oe){return di(oe)>0});return{container:x,tabbableNodes:V,focusableNodes:G,posTabIndexesFound:ce,firstTabbableNode:ae,lastTabbableNode:ye,firstDomTabbableNode:ue,lastDomTabbableNode:te,nextTabbableNode:function(J){var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,se=V.indexOf(J);return se<0?ne?G.slice(G.indexOf(J)+1).find(function(Re){return qi(Re)}):G.slice(0,G.indexOf(J)).reverse().find(function(Re){return qi(Re)}):V[se+(ne?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(x){return x.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!l("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(x){return x.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(x){var V=x.activeElement;if(V)return V.shadowRoot&&V.shadowRoot.activeElement!==null?m(V.shadowRoot):V},w=function(x){if(x!==!1&&x!==m(document)){if(!x||!x.focus){w(d());return}x.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=x,G$(x)&&x.select()}},y=function(x){var V=l("setReturnFocus",{params:[x]});return V||(V===!1?!1:x)},E=function(x){var V=x.target,G=x.event,ae=x.isBackward,ye=ae===void 0?!1:ae;V=V||Ta(G),f();var ue=null;if(s.tabbableGroups.length>0){var te=u(V,G),ce=te>=0?s.containerGroups[te]:void 0;if(te<0)ye?ue=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:ue=s.tabbableGroups[0].firstTabbableNode;else if(ye){var oe=s.tabbableGroups.findIndex(function(R){var F=R.firstTabbableNode;return V===F});if(oe<0&&(ce.container===V||sd(V,i.tabbableOptions)&&!qi(V,i.tabbableOptions)&&!ce.nextTabbableNode(V,!1))&&(oe=te),oe>=0){var J=oe===0?s.tabbableGroups.length-1:oe-1,ne=s.tabbableGroups[J];ue=di(V)>=0?ne.lastTabbableNode:ne.lastDomTabbableNode}else No(G)||(ue=ce.nextTabbableNode(V,!1))}else{var se=s.tabbableGroups.findIndex(function(R){var F=R.lastTabbableNode;return V===F});if(se<0&&(ce.container===V||sd(V,i.tabbableOptions)&&!qi(V,i.tabbableOptions)&&!ce.nextTabbableNode(V))&&(se=te),se>=0){var Re=se===s.tabbableGroups.length-1?0:se+1,H=s.tabbableGroups[Re];ue=di(V)>=0?H.firstTabbableNode:H.firstDomTabbableNode}else No(G)||(ue=ce.nextTabbableNode(V))}}else ue=l("fallbackFocus");return ue},b=function(x){var V=Ta(x);if(!(u(V,x)>=0)){if($o(i.clickOutsideDeactivates,x)){a.deactivate({returnFocus:i.returnFocusOnDeactivate});return}$o(i.allowOutsideClick,x)||x.preventDefault()}},g=function(x){var V=Ta(x),G=u(V,x)>=0;if(G||V instanceof Document)G&&(s.mostRecentlyFocusedNode=V);else{x.stopImmediatePropagation();var ae,ye=!0;if(s.mostRecentlyFocusedNode)if(di(s.mostRecentlyFocusedNode)>0){var ue=u(s.mostRecentlyFocusedNode),te=s.containerGroups[ue].tabbableNodes;if(te.length>0){var ce=te.findIndex(function(oe){return oe===s.mostRecentlyFocusedNode});ce>=0&&(i.isKeyForward(s.recentNavEvent)?ce+1<te.length&&(ae=te[ce+1],ye=!1):ce-1>=0&&(ae=te[ce-1],ye=!1))}}else s.containerGroups.some(function(oe){return oe.tabbableNodes.some(function(J){return di(J)>0})})||(ye=!1);else ye=!1;ye&&(ae=E({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),w(ae||s.mostRecentlyFocusedNode||d())}s.recentNavEvent=void 0},v=function(x){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=x;var G=E({event:x,isBackward:V});G&&(No(x)&&x.preventDefault(),w(G))},h=function(x){(i.isKeyForward(x)||i.isKeyBackward(x))&&v(x,i.isKeyBackward(x))},S=function(x){K$(x)&&$o(i.escapeDeactivates,x)!==!1&&(x.preventDefault(),a.deactivate())},T=function(x){var V=Ta(x);u(V,x)>=0||$o(i.clickOutsideDeactivates,x)||$o(i.allowOutsideClick,x)||(x.preventDefault(),x.stopImmediatePropagation())},I=function(){if(s.active)return k0.activateTrap(o,a),s.delayInitialFocusTimer=i.delayInitialFocus?x0(function(){w(d())}):w(d()),r.addEventListener("focusin",g,!0),r.addEventListener("mousedown",b,{capture:!0,passive:!1}),r.addEventListener("touchstart",b,{capture:!0,passive:!1}),r.addEventListener("click",T,{capture:!0,passive:!1}),r.addEventListener("keydown",h,{capture:!0,passive:!1}),r.addEventListener("keydown",S),a},_=function(){if(s.active)return r.removeEventListener("focusin",g,!0),r.removeEventListener("mousedown",b,!0),r.removeEventListener("touchstart",b,!0),r.removeEventListener("click",T,!0),r.removeEventListener("keydown",h,!0),r.removeEventListener("keydown",S),a},A=function(x){var V=x.some(function(G){var ae=Array.from(G.removedNodes);return ae.some(function(ye){return ye===s.mostRecentlyFocusedNode})});V&&w(d())},$=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(A):void 0,D=function(){$&&($.disconnect(),s.active&&!s.paused&&s.containers.map(function(x){$.observe(x,{subtree:!0,childList:!0})}))};return a={get active(){return s.active},get paused(){return s.paused},activate:function(x){if(s.active)return this;var V=c(x,"onActivate"),G=c(x,"onPostActivate"),ae=c(x,"checkCanFocusTrap");ae||f(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=m(r),V==null||V();var ye=function(){ae&&f(),I(),D(),G==null||G()};return ae?(ae(s.containers.concat()).then(ye,ye),this):(ye(),this)},deactivate:function(x){if(!s.active)return this;var V=O0({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},x);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,_(),s.active=!1,s.paused=!1,D(),k0.deactivateTrap(o,a);var G=c(V,"onDeactivate"),ae=c(V,"onPostDeactivate"),ye=c(V,"checkCanReturnFocus"),ue=c(V,"returnFocus","returnFocusOnDeactivate");G==null||G();var te=function(){x0(function(){ue&&w(y(s.nodeFocusedBeforeActivation)),ae==null||ae()})};return ue&&ye?(ye(y(s.nodeFocusedBeforeActivation)).then(te,te),this):(te(),this)},pause:function(x){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,x)):this},unpause:function(x){return s.active?(s.manuallyPaused=!1,o[o.length-1]!==this?this:this._setPausedState(!1,x)):this},updateContainerElements:function(x){var V=[].concat(x).filter(Boolean);return s.containers=V.map(function(G){return typeof G=="string"?r.querySelector(G):G}),s.active&&f(),D(),this}},Object.defineProperties(a,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function(x,V){if(s.paused===x)return this;if(s.paused=x,x){var G=c(V,"onPause"),ae=c(V,"onPostPause");G==null||G(),_(),D(),ae==null||ae()}else{var ye=c(V,"onUnpause"),ue=c(V,"onPostUnpause");ye==null||ye(),f(),I(),D(),ue==null||ue()}return this}}}),a.updateContainerElements(t),a};/*!
60
- * focus-trap-vue v4.0.2
61
- * (c) 2023 Eduardo San Martin Morote
58
+ */function Sd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function RD(e){if(Array.isArray(e))return Sd(e)}function CD(e,t,r){return(t=kD(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ID(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _D(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
59
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function nw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rw(Object(r),!0).forEach(function(n){CD(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function OD(e){return RD(e)||ID(e)||FD(e)||_D()}function PD(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kD(e){var t=PD(e,"string");return typeof t=="symbol"?t:t+""}function FD(e,t){if(e){if(typeof e=="string")return Sd(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Sd(e,t):void 0}}var iw={activateTrap:function(t,r){if(t.length>0){var n=t[t.length-1];n!==r&&n._setPausedState(!0)}var i=t.indexOf(r);i===-1||t.splice(i,1),t.push(r)},deactivateTrap:function(t,r){var n=t.indexOf(r);n!==-1&&t.splice(n,1),t.length>0&&!t[t.length-1]._isManuallyPaused()&&t[t.length-1]._setPausedState(!1)}},xD=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},ND=function(t){return t?.key==="Escape"||t?.key==="Esc"||t?.keyCode===27},Mo=function(t){return t?.key==="Tab"||t?.keyCode===9},DD=function(t){return Mo(t)&&!t.shiftKey},$D=function(t){return Mo(t)&&t.shiftKey},ow=function(t){return setTimeout(t,0)},Bo=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return typeof t=="function"?t.apply(void 0,n):t},$a=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},LD=[],MD=function(t,r){var n=r?.document||document,i=r?.trapStack||LD,o=nw({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:DD,isKeyBackward:$D},r),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a,l=function(x,z,G){return x&&x[z]!==void 0?x[z]:o[G||z]},u=function(x,z){var G=typeof z?.composedPath=="function"?z.composedPath():void 0;return s.containerGroups.findIndex(function(ne){var ie=ne.container,ee=ne.tabbableNodes;return ie.contains(x)||G?.includes(ie)||ee.find(function(ue){return ue===x})})},c=function(x){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},G=z.hasFallback,ne=G===void 0?!1:G,ie=z.params,ee=ie===void 0?[]:ie,ue=o[x];if(typeof ue=="function"&&(ue=ue.apply(void 0,OD(ee))),ue===!0&&(ue=void 0),!ue){if(ue===void 0||ue===!1)return ue;throw new Error("`".concat(x,"` was specified but was not a node, or did not return a node"))}var de=ue;if(typeof ue=="string"){try{de=n.querySelector(ue)}catch(ce){throw new Error("`".concat(x,'` appears to be an invalid selector; error="').concat(ce.message,'"'))}if(!de&&!ne)throw new Error("`".concat(x,"` as selector refers to no known node"))}return de},d=function(){var x=c("initialFocus",{hasFallback:!0});if(x===!1)return!1;if(x===void 0||x&&!wd(x,o.tabbableOptions))if(u(n.activeElement)>=0)x=n.activeElement;else{var z=s.tabbableGroups[0],G=z&&z.firstTabbableNode;x=G||c("fallbackFocus")}else x===null&&(x=c("fallbackFocus"));if(!x)throw new Error("Your focus-trap needs to have at least one focusable element");return x},f=function(){if(s.containerGroups=s.containers.map(function(x){var z=ED(x,o.tabbableOptions),G=TD(x,o.tabbableOptions),ne=z.length>0?z[0]:void 0,ie=z.length>0?z[z.length-1]:void 0,ee=G.find(function(ce){return Mi(ce)}),ue=G.slice().reverse().find(function(ce){return Mi(ce)}),de=!!z.find(function(ce){return li(ce)>0});return{container:x,tabbableNodes:z,focusableNodes:G,posTabIndexesFound:de,firstTabbableNode:ne,lastTabbableNode:ie,firstDomTabbableNode:ee,lastDomTabbableNode:ue,nextTabbableNode:function(X){var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ae=z.indexOf(X);return ae<0?oe?G.slice(G.indexOf(X)+1).find(function(Ce){return Mi(Ce)}):G.slice(0,G.indexOf(X)).reverse().find(function(Ce){return Mi(Ce)}):z[ae+(oe?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(x){return x.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(x){return x.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(x){var z=x.activeElement;if(z)return z.shadowRoot&&z.shadowRoot.activeElement!==null?m(z.shadowRoot):z},w=function(x){if(x!==!1&&x!==m(document)){if(!x||!x.focus){w(d());return}x.focus({preventScroll:!!o.preventScroll}),s.mostRecentlyFocusedNode=x,xD(x)&&x.select()}},v=function(x){var z=c("setReturnFocus",{params:[x]});return z||(z===!1?!1:x)},E=function(x){var z=x.target,G=x.event,ne=x.isBackward,ie=ne===void 0?!1:ne;z=z||$a(G),f();var ee=null;if(s.tabbableGroups.length>0){var ue=u(z,G),de=ue>=0?s.containerGroups[ue]:void 0;if(ue<0)ie?ee=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:ee=s.tabbableGroups[0].firstTabbableNode;else if(ie){var ce=s.tabbableGroups.findIndex(function(N){var O=N.firstTabbableNode;return z===O});if(ce<0&&(de.container===z||wd(z,o.tabbableOptions)&&!Mi(z,o.tabbableOptions)&&!de.nextTabbableNode(z,!1))&&(ce=ue),ce>=0){var X=ce===0?s.tabbableGroups.length-1:ce-1,oe=s.tabbableGroups[X];ee=li(z)>=0?oe.lastTabbableNode:oe.lastDomTabbableNode}else Mo(G)||(ee=de.nextTabbableNode(z,!1))}else{var ae=s.tabbableGroups.findIndex(function(N){var O=N.lastTabbableNode;return z===O});if(ae<0&&(de.container===z||wd(z,o.tabbableOptions)&&!Mi(z,o.tabbableOptions)&&!de.nextTabbableNode(z))&&(ae=ue),ae>=0){var Ce=ae===s.tabbableGroups.length-1?0:ae+1,Z=s.tabbableGroups[Ce];ee=li(z)>=0?Z.firstTabbableNode:Z.firstDomTabbableNode}else Mo(G)||(ee=de.nextTabbableNode(z))}}else ee=c("fallbackFocus");return ee},b=function(x){var z=$a(x);if(!(u(z,x)>=0)){if(Bo(o.clickOutsideDeactivates,x)){a.deactivate({returnFocus:o.returnFocusOnDeactivate});return}Bo(o.allowOutsideClick,x)||x.preventDefault()}},g=function(x){var z=$a(x),G=u(z,x)>=0;if(G||z instanceof Document)G&&(s.mostRecentlyFocusedNode=z);else{x.stopImmediatePropagation();var ne,ie=!0;if(s.mostRecentlyFocusedNode)if(li(s.mostRecentlyFocusedNode)>0){var ee=u(s.mostRecentlyFocusedNode),ue=s.containerGroups[ee].tabbableNodes;if(ue.length>0){var de=ue.findIndex(function(ce){return ce===s.mostRecentlyFocusedNode});de>=0&&(o.isKeyForward(s.recentNavEvent)?de+1<ue.length&&(ne=ue[de+1],ie=!1):de-1>=0&&(ne=ue[de-1],ie=!1))}}else s.containerGroups.some(function(ce){return ce.tabbableNodes.some(function(X){return li(X)>0})})||(ie=!1);else ie=!1;ie&&(ne=E({target:s.mostRecentlyFocusedNode,isBackward:o.isKeyBackward(s.recentNavEvent)})),w(ne||s.mostRecentlyFocusedNode||d())}s.recentNavEvent=void 0},y=function(x){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=x;var G=E({event:x,isBackward:z});G&&(Mo(x)&&x.preventDefault(),w(G))},p=function(x){(o.isKeyForward(x)||o.isKeyBackward(x))&&y(x,o.isKeyBackward(x))},S=function(x){ND(x)&&Bo(o.escapeDeactivates,x)!==!1&&(x.preventDefault(),a.deactivate())},T=function(x){var z=$a(x);u(z,x)>=0||Bo(o.clickOutsideDeactivates,x)||Bo(o.allowOutsideClick,x)||(x.preventDefault(),x.stopImmediatePropagation())},R=function(){if(s.active)return iw.activateTrap(i,a),s.delayInitialFocusTimer=o.delayInitialFocus?ow(function(){w(d())}):w(d()),n.addEventListener("focusin",g,!0),n.addEventListener("mousedown",b,{capture:!0,passive:!1}),n.addEventListener("touchstart",b,{capture:!0,passive:!1}),n.addEventListener("click",T,{capture:!0,passive:!1}),n.addEventListener("keydown",p,{capture:!0,passive:!1}),n.addEventListener("keydown",S),a},I=function(){if(s.active)return n.removeEventListener("focusin",g,!0),n.removeEventListener("mousedown",b,!0),n.removeEventListener("touchstart",b,!0),n.removeEventListener("click",T,!0),n.removeEventListener("keydown",p,!0),n.removeEventListener("keydown",S),a},A=function(x){var z=x.some(function(G){var ne=Array.from(G.removedNodes);return ne.some(function(ie){return ie===s.mostRecentlyFocusedNode})});z&&w(d())},D=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(A):void 0,H=function(){D&&(D.disconnect(),s.active&&!s.paused&&s.containers.map(function(x){D.observe(x,{subtree:!0,childList:!0})}))};return a={get active(){return s.active},get paused(){return s.paused},activate:function(x){if(s.active)return this;var z=l(x,"onActivate"),G=l(x,"onPostActivate"),ne=l(x,"checkCanFocusTrap");ne||f(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=m(n),z?.();var ie=function(){ne&&f(),R(),H(),G?.()};return ne?(ne(s.containers.concat()).then(ie,ie),this):(ie(),this)},deactivate:function(x){if(!s.active)return this;var z=nw({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},x);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,I(),s.active=!1,s.paused=!1,H(),iw.deactivateTrap(i,a);var G=l(z,"onDeactivate"),ne=l(z,"onPostDeactivate"),ie=l(z,"checkCanReturnFocus"),ee=l(z,"returnFocus","returnFocusOnDeactivate");G?.();var ue=function(){ow(function(){ee&&w(v(s.nodeFocusedBeforeActivation)),ne?.()})};return ee&&ie?(ie(v(s.nodeFocusedBeforeActivation)).then(ue,ue),this):(ue(),this)},pause:function(x){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,x)):this},unpause:function(x){return s.active?(s.manuallyPaused=!1,i[i.length-1]!==this?this:this._setPausedState(!1,x)):this},updateContainerElements:function(x){var z=[].concat(x).filter(Boolean);return s.containers=z.map(function(G){return typeof G=="string"?n.querySelector(G):G}),s.active&&f(),H(),this}},Object.defineProperties(a,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function(x,z){if(s.paused===x)return this;if(s.paused=x,x){var G=l(z,"onPause"),ne=l(z,"onPostPause");G?.(),I(),H(),ne?.()}else{var ie=l(z,"onUnpause"),ee=l(z,"onPostUnpause");ie?.(),f(),R(),H(),ee?.()}return this}}}),a.updateContainerElements(t),a};/*!
60
+ * focus-trap-vue v4.0.3
61
+ * (c) 2025 Eduardo San Martin Morote
62
62
  * @license MIT
63
- */function hM(e){return e}const Z$={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};Object.assign({active:{type:Boolean,default:!0}},Z$);var eD=Object.defineProperty,N0=Object.getOwnPropertySymbols,tD=Object.prototype.hasOwnProperty,nD=Object.prototype.propertyIsEnumerable,$0=(e,t,n)=>t in e?eD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rD=(e,t)=>{for(var n in t||(t={}))tD.call(t,n)&&$0(e,n,t[n]);if(N0)for(var n of N0(t))nD.call(t,n)&&$0(e,n,t[n]);return e};const D0=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},iD={},oD={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},sD=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),aD=[sD];function lD(e,t){return X(),de("svg",oD,aD)}const cD=D0(iD,[["render",lD]]),uD={},fD={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"},dD=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),pD=[dD];function hD(e,t){return X(),de("svg",fD,pD)}rD({},{Deselect:cD,OpenIndicator:D0(uD,[["render",hD]])});const gD=["aria-label"],mD=Ne({__name:"OcSpinner",props:{ariaLabel:{default:""},size:{default:"medium"}},setup(e){const t=B(()=>["oc-spinner",`oc-spinner-${Mr(e.size||"medium")}`]);return(n,r)=>(X(),de("span",{class:W.normalizeClass(t.value),"aria-label":n.ariaLabel,tabindex:"-1",role:"img"},null,10,gD))}}),yD={class:"oc-status-indicators oc-flex"},bD=["id","textContent"],vD=Ne({__name:"OcStatusIndicators",props:{resource:{},indicators:{},disableHandler:{type:Boolean,default:!1}},setup(e){const{$gettext:t}=Fe.useGettext(),n=le({}),r=i=>Object.hasOwn(i,"handler"),o=i=>i.accessibleDescription?(p(n)[i.id]||(p(n)[i.id]=Xs("oc-indicator-description-")),p(n)[i.id]):null;return(i,s)=>{const a=ln("oc-tooltip");return X(),de("div",yD,[(X(!0),de(qe,null,wt(i.indicators,(c,u)=>(X(),de(qe,null,[r(c)&&!i.disableHandler?ot((X(),Ae(E0,{id:c.id,key:`${c.id}-handler`,class:W.normalizeClass(["oc-status-indicators-indicator",{"oc-ml-xs":u>0}]),"aria-label":p(t)(c.label),"aria-describedby":o(c),appearance:"raw","data-testid":c.id,"data-test-indicator-type":c.type,"no-hover":"",onClick:l=>c.handler(i.resource)},{default:Se(()=>[he(S0,{name:c.icon,size:"small","fill-type":c.fillType},null,8,["name","fill-type"])]),_:2},1032,["id","class","aria-label","aria-describedby","data-testid","data-test-indicator-type","onClick"])),[[a,p(t)(c.label)]]):ot((X(),Ae(S0,{id:c.id,key:c.id,tabindex:"-1",size:"small",class:W.normalizeClass(["oc-status-indicators-indicator",{"oc-ml-xs":u>0}]),name:c.icon,"fill-type":c.fillType,"accessible-label":p(t)(c.label),"aria-describedby":o(c),"data-testid":c.id,"data-test-indicator-type":c.type},null,8,["id","class","name","fill-type","accessible-label","aria-describedby","data-testid","data-test-indicator-type"])),[[a,p(t)(c.label)]]),o(c)?(X(),de("p",{id:o(c),key:o(c),class:"oc-invisible-sr",textContent:W.toDisplayString(p(t)(c.accessibleDescription))},null,8,bD)):Ce("",!0)],64))),256))])}}}),wD={class:"oc-thead"},SD=Ne({name:"OcTableHead",__name:"OcTableHead",setup(e){return(t,n)=>(X(),de("thead",wD,[Xe(t.$slots,"default")]))}}),ED=Ne({name:"OcTableBody",__name:"OcTableBody",setup(e){return(t,n)=>(X(),de("tbody",null,[Xe(t.$slots,"default")]))}}),L0=({target:e,mode:t="show",rootMargin:n="100px",onVisibleCallback:r})=>{if(!(window&&"IntersectionObserver"in window))return{isVisible:le(!0)};const i=le(!1),s=new IntersectionObserver(a=>{const c=a.at(-1).isIntersecting;i.value=c,p(i)&&r&&r(),t!=="showHide"&&i.value&&s.unobserve(e.value)},{rootMargin:n});return St(e,()=>{s.observe(e.value)}),Vn(()=>s.disconnect()),{isVisible:i}},M0=Ne({__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,r=B(()=>{const o=["oc-table-cell",`oc-table-cell-align-${e.alignH}`,`oc-table-cell-align-${e.alignV}`,`oc-table-cell-width-${e.width}`];return e.wrap&&o.push(`oc-text-${e.wrap}`),o});return(o,i)=>(X(),Ae(Nr(o.type),{class:W.normalizeClass(r.value),onClick:i[0]||(i[0]=s=>n("click",s))},{default:Se(()=>[Xe(o.$slots,"default")]),_:3},8,["class"]))}}),B0=Ne({__name:"OcTableTd",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},setup(e){return(t,n)=>(X(),Ae(M0,{type:"td","align-h":t.alignH,"align-v":t.alignV,width:t.width,wrap:t.wrap,class:"oc-td"},{default:Se(()=>[Xe(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),j0=Ne({__name:"OcTableTr",props:{lazy:{}},emits:["contextmenu","click","dragstart","drop","dragenter","dragleave","dragover","mouseleave","itemVisible"],setup(e,{emit:t}){const n=t,r=Bd((a,c)=>{let u;return{get(){return a(),u},set(l){u=l,c()}}}),o=B(()=>e.lazy?e.lazy.colspan:1),{isVisible:i}=e.lazy?L0({...e.lazy,target:r,onVisibleCallback:()=>n("itemVisible")}):{isVisible:le(!0)},s=B(()=>!p(i));return e.lazy||n("itemVisible"),(a,c)=>(X(),de("tr",{ref_key:"observerTarget",ref:r,onClick:c[0]||(c[0]=u=>a.$emit("click",u)),onContextmenu:c[1]||(c[1]=u=>a.$emit("contextmenu",u)),onDragstart:c[2]||(c[2]=u=>a.$emit("dragstart",u)),onDrop:c[3]||(c[3]=u=>a.$emit("drop",u)),onDragenter:c[4]||(c[4]=u=>a.$emit("dragenter",u)),onDragleave:c[5]||(c[5]=u=>a.$emit("dragleave",u)),onDragover:c[6]||(c[6]=u=>a.$emit("dragover",u)),onMouseleave:c[7]||(c[7]=u=>a.$emit("mouseleave",u))},[s.value?(X(),Ae(B0,{key:0,colspan:o.value},{default:Se(()=>c[8]||(c[8]=[fe("span",{class:"shimmer"},null,-1)])),_:1,__:[8]},8,["colspan"])):Xe(a.$slots,"default",{key:1})],544))}}),TD=Ne({__name:"OcTableTh",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e){return(t,n)=>(X(),Ae(M0,{type:"th","align-h":t.alignH,"align-v":t.alignV,width:t.width,wrap:t.wrap,class:"oc-th",onClick:n[0]||(n[0]=r=>t.$emit("click",r))},{default:Se(()=>[Xe(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),AD={key:0,class:"oc-table-thead-content"},RD=["textContent"],_D={key:1},ID={key:0,class:"oc-table-thead-content"},CD=["textContent"],PD={key:1,class:"oc-table-footer"},FD={class:"oc-table-footer-row"},OD=["colspan"],U0="asc",ld="desc",kD=Ne({__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:HP,EVENT_TROW_CLICKED:GP,EVENT_TROW_MOUNTED:KP,EVENT_TROW_CONTEXTMENU:QP},{$gettext:o}=Fe.useGettext(),i=D=>e.itemDomSelector?e.itemDomSelector(D):D[e.idKey],s=B(()=>{const D=["oc-table"];return e.hover&&D.push("oc-table-hover"),e.sticky&&D.push("oc-table-sticky"),D}),a=B(()=>e.fields.length),c=D=>{D.preventDefault()},u=(D,N)=>{n(XP,D,N)},l=(D,N)=>{n(jb,D,N)},d=(D,N,x)=>{n("dropRowStyling",D,N,x)},f=D=>D.type==="slot",m=D=>["callback","function"].indexOf(D.type)>=0,w=D=>Object.prototype.hasOwnProperty.call(D,"title")?D.title:D.name,y=()=>({class:s.value}),E=(D,N)=>{const x=v(D);return x.class=`oc-table-header-cell oc-table-header-cell-${D.name}`,Object.prototype.hasOwnProperty.call(D,"thClass")&&(x.class+=` ${D.thClass}`),e.sticky&&(x.style=`top: ${e.headerPosition}px;`),N===0&&(x.class+=` oc-pl-${Mr(e.paddingX)} `),N===e.fields.length-1&&(x.class+=` oc-pr-${Mr(e.paddingX)}`),_(x,D),x},b=(D,N)=>({...e.lazy&&{lazy:{colspan:a.value}},class:["oc-tbody-tr",`oc-tbody-tr-${i(D)||N}`,h(D)?"oc-table-highlighted":void 0,S(D)?"oc-table-disabled":void 0].filter(Boolean)}),g=(D,N,x)=>{const V=v(D);return V.class=`oc-table-data-cell oc-table-data-cell-${D.name}`,Object.prototype.hasOwnProperty.call(D,"tdClass")&&(V.class+=` ${D.tdClass}`),Object.prototype.hasOwnProperty.call(D,"wrap")&&(V.wrap=D.wrap),N===0&&(V.class+=` oc-pl-${Mr(e.paddingX)} `),N===e.fields.length-1&&(V.class+=` oc-pr-${Mr(e.paddingX)}`),Object.prototype.hasOwnProperty.call(D,"accessibleLabelCallback")&&(V["aria-label"]=D.accessibleLabelCallback(x)),V},v=D=>({...(D==null?void 0:D.alignH)&&{alignH:D.alignH},...(D==null?void 0:D.alignV)&&{alignV:D.alignV},...(D==null?void 0:D.width)&&{width:D.width},class:void 0,wrap:void 0,style:void 0}),h=D=>e.highlighted?Array.isArray(e.highlighted)?e.highlighted.indexOf(D[e.idKey])>-1:e.highlighted===D[e.idKey]:!1,S=D=>e.disabled.length?e.disabled.indexOf(D[e.idKey])>-1:!1,T=(D,N,x)=>{const V=[x[e.idKey],N+1].filter(Boolean);return f(D)?[...V,D.name].join("-"):m(D)?[...V,D.callback(x[D.name])].join("-"):[...V,x[D.name]].join("-")},I=D=>o("Sort by %{ name }",{name:D}),_=(D,N)=>{if(!A(N))return;let x="none";e.sortBy===N.name&&(x=e.sortDir===U0?"ascending":"descending"),D["aria-sort"]=x},A=({sortable:D})=>!!D,$=D=>{if(!A(D))return;let N=e.sortDir;e.sortBy===D.name&&e.sortDir!==void 0&&(N=e.sortDir===ld?U0:ld),(e.sortBy!==D.name||e.sortDir===void 0)&&(N=D.sortDir||ld),n("sort",{sortBy:D.name,sortDir:N})};return(D,N)=>{const x=pe("oc-icon");return X(),de("table",Gt(y(),{class:"has-item-context-menu"}),[D.hasHeader?(X(),Ae(SD,{key:0},{default:Se(()=>[he(j0,{class:"oc-table-header-row"},{default:Se(()=>[(X(!0),de(qe,null,wt(D.fields,(V,G)=>(X(),Ae(TD,Gt({key:`oc-thead-${V.name}`},{ref_for:!0},E(V,G)),{default:Se(()=>[V.sortable?(X(),Ae(E0,{key:0,"aria-label":I(V.name),appearance:"raw",class:"oc-button-sort oc-width-1-1","gap-size":"small","no-hover":"",onClick:ae=>$(V)},{default:Se(()=>[V.headerType==="slot"?(X(),de("span",AD,[Xe(D.$slots,V.name+"Header")])):(X(),de("span",{key:1,class:"oc-table-thead-content header-text",textContent:W.toDisplayString(w(V))},null,8,RD)),he(x,{name:D.sortDir==="asc"?"arrow-down":"arrow-up","fill-type":"line",class:W.normalizeClass([{"oc-invisible-sr":D.sortBy!==V.name},"oc-p-xs oc-rounded"]),size:"small"},null,8,["name","class"])]),_:2},1032,["aria-label","onClick"])):(X(),de("div",_D,[V.headerType==="slot"?(X(),de("span",ID,[Xe(D.$slots,V.name+"Header")])):(X(),de("span",{key:1,class:"oc-table-thead-content header-text",textContent:W.toDisplayString(w(V))},null,8,CD))]))]),_:2},1040))),128))]),_:3})]),_:3})):Ce("",!0),he(ED,{class:"has-item-context-menu"},{default:Se(()=>[(X(!0),de(qe,null,wt(D.data,(V,G)=>(X(),Ae(j0,Gt({key:`oc-tbody-tr-${i(V)||G}`,ref_for:!0,ref:`row-${G}`},{ref_for:!0},b(V,G),{"data-item-id":V[D.idKey],draggable:D.dragDrop,onClick:ae=>D.$emit(r.EVENT_TROW_CLICKED,[V,ae]),onContextmenu:ae=>D.$emit(r.EVENT_TROW_CONTEXTMENU,D.$refs[`row-${G}`][0],ae,V),onVnodeMounted:ae=>D.$emit(r.EVENT_TROW_MOUNTED,V,D.$refs[`row-${G}`][0]),onDragstart:ae=>u(V,ae),onDrop:ae=>l(i(V),ae),onDragenter:Cn(ae=>d(i(V),!1,ae),["prevent"]),onDragleave:Cn(ae=>d(i(V),!0,ae),["prevent"]),onMouseleave:ae=>d(i(V),!0,ae),onDragover:N[0]||(N[0]=ae=>c(ae)),onItemVisible:ae=>D.$emit("itemVisible",V)}),{default:Se(()=>[(X(!0),de(qe,null,wt(D.fields,(ae,ye)=>(X(),Ae(B0,Gt({key:"oc-tbody-td-"+T(ae,ye,V)},{ref_for:!0},g(ae,ye,V)),{default:Se(()=>[f(ae)?Xe(D.$slots,ae.name,{key:0,item:V}):m(ae)?(X(),de(qe,{key:1},[Ot(W.toDisplayString(ae.callback(V[ae.name])),1)],64)):(X(),de(qe,{key:2},[Ot(W.toDisplayString(V[ae.name]),1)],64))]),_:2},1040))),128))]),_:2},1040,["data-item-id","draggable","onClick","onContextmenu","onVnodeMounted","onDragstart","onDrop","onDragenter","onDragleave","onMouseleave","onItemVisible"]))),128))]),_:3}),D.$slots.footer?(X(),de("tfoot",PD,[fe("tr",FD,[fe("td",{colspan:a.value,class:"oc-table-footer-cell"},[Xe(D.$slots,"footer")],8,OD)])])):Ce("",!0)],16)}}}),q0=Ne({__name:"ResourceStatusIndicators",props:{space:{},resource:{},filter:{type:Function}},setup(e){const t=lp(),n=yt(),r=Qe(),o=B(()=>{const i=$b({space:e.space,resource:e.resource,ancestorMetaData:r.ancestorMetaData,user:n.user});return e.filter?i.filter(e.filter):i});return(i,s)=>o.value.length>0?(X(),Ae(p(vD),Gt({key:0},p(t),{indicators:o.value}),null,16,["indicators"])):Ce("",!0)}}),cd=Ne({__name:"UserAvatar",props:{userId:{},userName:{}},setup(e){const t=Ys(),{avatarMap:n}=Ue.storeToRefs(t),{enqueueAvatar:r}=s0(),o=B(()=>p(n)[e.userId]);return Bt(()=>{r(e.userId)}),(i,s)=>{const a=pe("oc-avatar");return X(),Ae(a,{"user-name":i.userName,src:o.value,width:36},null,8,["user-name","src"])}}}),xD={class:"avatar-upload"},ND={class:"oc-flex oc-flex-column oc-flex-middle"},$D={class:"oc-button-group"},DD={key:0},LD=["src"],MD={class:"oc-text-small oc-text-muted oc-flex oc-flex-middle oc-mt-xs"},BD=["textContent"],jD=Ne({__name:"AvatarUpload",setup(e){const t=yt(),n=Ys(),{avatarMap:r}=Ue.storeToRefs(n),{user:o}=Ue.storeToRefs(t),{$gettext:i}=Fe.useGettext(),{showErrorMessage:s,showMessage:a}=tt(),{graphAuthenticated:c}=He(),{setCropperInstance:u}=Yf(),l=le(null),d=le(null),f=le(null),m=le(!1),w=le(!1),y=le(!1),E=le(null),b=$f*1024*1024,g=B(()=>!!p(r)[p(o).id]),v=D=>{var V;const x=(V=D.target.files)==null?void 0:V[0];if(x){if(x.size>b){s({title:i("File size exceeds the limit of %{size}MB",{size:$f.toString()})});return}l.value=URL.createObjectURL(x),w.value=!0}};St(l,async D=>{D&&(await _n(),f.value&&f.value.destroy(),d.value&&(f.value=new Ra(d.value,{aspectRatio:1,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1,ready(){m.value=!0}}),u(f)))});const h=()=>f.value.getCroppedCanvas({width:256,height:256,imageSmoothingQuality:"high"}),S=async D=>await new Promise(N=>{D.toBlob(x=>N(x),"image/png")}),T=()=>{var D;(D=E.value)==null||D.click()},I=()=>{w.value=!1,$()},_=async()=>{const D=h(),N=await S(D),x=URL.createObjectURL(N),V=new File([N],"avatar.png",{type:"image/png",lastModified:Date.now()});try{await c.photos.updateOwnUserPhotoPatch(V),n.addAvatar(p(o).id,x),a({title:i("Profile picture was set successfully")})}catch(G){s({title:i("Failed to set profile picture"),errors:[G]})}w.value=!1,$()},A=async()=>{try{await c.photos.deleteOwnUserPhoto(),n.removeAvatar(p(o).id),a({title:i("Profile picture was removed successfully")})}catch(D){s({title:i("Failed to remove profile picture"),errors:[D]})}y.value=!1},$=()=>{var D;(D=f.value)==null||D.destroy(),f.value=null,E.value&&(E.value.value=""),l.value=null};return(D,N)=>{const x=pe("oc-button"),V=pe("oc-icon"),G=pe("oc-modal");return X(),de("div",xD,[fe("input",{ref_key:"fileInputRef",ref:E,class:"oc-invisible avatar-file-input",type:"file",accept:"image/jpeg, image/png",onChange:v},null,544),fe("div",ND,[he(cd,{class:"oc-mb-m",width:128,"user-id":p(o).id,"user-name":p(o).displayName},null,8,["user-id","user-name"]),fe("div",null,[fe("div",$D,[he(x,{class:"avatar-upload-button",size:"small",onClick:T},{default:Se(()=>[Ot(W.toDisplayString(p(i)("Upload")),1)]),_:1}),g.value?(X(),Ae(x,{key:0,class:"avatar-upload-remove-button",size:"small",onClick:N[0]||(N[0]=ae=>y.value=!0)},{default:Se(()=>[Ot(W.toDisplayString(p(i)("Remove")),1)]),_:1})):Ce("",!0)])])]),w.value?(X(),Ae(G,{key:0,title:p(i)("Crop your new profile picture"),"button-cancel-text":p(i)("Cancel"),"button-confirm-text":p(i)("Set"),"button-confirm-disabled":!m.value,"focus-trap-initial":!1,onCancel:I,onConfirm:_},{content:Se(()=>[l.value?(X(),de("div",DD,[fe("img",{ref_key:"imageRef",ref:d,class:"avatar-upload-modal-image",src:l.value},null,8,LD),fe("div",MD,[he(V,{class:"oc-mr-xs",name:"information",size:"small","fill-type":"line"}),fe("span",{textContent:W.toDisplayString(p(i)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:p(i)("+-"),panKeys:p(i)("↑↓←→")}))},null,8,BD)])])):Ce("",!0)]),_:1},8,["title","button-cancel-text","button-confirm-text","button-confirm-disabled"])):Ce("",!0),y.value?(X(),Ae(G,{key:1,message:p(i)("Are you sure you want to remove your profile picture?"),title:p(i)("Remove profile picture"),"button-cancel-text":p(i)("Cancel"),"button-confirm-text":p(i)("Remove"),onCancel:N[1]||(N[1]=ae=>y.value=!1),onConfirm:A},null,8,["message","title","button-cancel-text","button-confirm-text"])):Ce("",!0)])}}}),UD=850,qD=Ne({components:{UserAvatar:cd,ContextMenuQuickAction:rd,ResourceGhostElement:id,ResourceListItem:ko,ResourceSize:v0,ResourceStatusIndicators:q0,OcSpinner:mD,OcTable:kD},props:{resources:{type:Array,required:!0},resourceDomSelector:{type:Function,required:!1,default:e=>ee.extractDomSelector(e.id)},arePathsDisplayed:{type:Boolean,required:!1,default:!1},areThumbnailsDisplayed:{type:Boolean,required:!1,default:!0},selectedIds:{type:Array,default:()=>[]},hasActions:{type:Boolean,required:!1,default:!0},targetRouteCallback:{type:Function,required:!1,default:void 0},areResourcesClickable:{type:Boolean,required:!1,default:!0},headerPosition:{type:Number,required:!1,default:0},isSelectable:{type:Boolean,required:!1,default:!0},isSideBarOpen:{type:Boolean,required:!1,default:!1},paddingX:{type:String,required:!1,default:"small",validator:e=>/(xsmall|small|medium|large|xlarge)/.test(e)},dragDrop:{type:Boolean,required:!1,default:!1},viewMode:{type:String,default:()=>Jt.defaultModeName,validator:e=>[Jt.name.condensedTable,Jt.name.table].includes(e)},hover:{type:Boolean,required:!1,default:!0},sortBy:{type:String,required:!1,default:void 0},fieldsDisplayed:{type:Array,required:!1,default:null},sortDir:{type:String,required:!1,default:void 0,validator:e=>e===void 0||[zt.Asc.toString(),zt.Desc.toString()].includes(e)},space:{type:Object,required:!1,default:null},resourceType:{type:String,default:"file"},lazy:{type:Boolean,default:!0},groupingSettings:{type:Object,required:!1,default:null}},emits:["fileClick","sort","rowMounted",Nf,"update:selectedIds","update:modelValue"],setup(e,t){const n=We(),r=sn(),{getMatchingSpace:o}=un(),{canBeOpenedWithSecureView:i}=Jf(),s=ui({space:le(e.space),targetRouteCallback:B(()=>e.targetRouteCallback)}),{isSticky:a}=Kf(),{$gettext:c}=Fe.useGettext(),{isLocationPicker:u,isFilePicker:l,postMessage:d,isEnabled:f,fileTypes:m}=si(),{getDefaultAction:w}=Qn(),y=st(),{options:E}=Ue.storeToRefs(y),b=Ro(),{resources:g,action:v}=Ue.storeToRefs(b),h=ei(),{userContextReady:S}=Ue.storeToRefs(h),T=Qe(),{areFileExtensionsShown:I,latestSelectedId:_,deleteQueue:A}=Ue.storeToRefs(T),$=le(),D=le(),N=le(),{width:x}=Vr.useWindowSize(),V=B(()=>r.filesTags&&x.value>=UD),{actions:G}=pa(),{actions:ae}=Yv(),ye=B(()=>p(G)[0].handler),ue=B(()=>p(ae)[0].handler),te=R=>c("Search for tag %{tag}",{tag:R}),ce=R=>{var F;return p(f)&&((F=p(m))!=null&&F.length)?!p(m).includes(R.extension)&&!p(m).includes(R.mimeType)&&!R.isFolder:R.processing===!0||H(R.id)},oe=B(()=>{var R,F;return((F=(R=e.resources)==null?void 0:R.filter(K=>ce(K)===!0))==null?void 0:F.map(K=>K.id))||[]}),J=R=>!e.areResourcesClickable||ee.isProjectSpaceResource(R)&&R.disabled||!R.isFolder&&(!R.canDownload()&&!i(R)||p(f)&&!p(l))?!1:!p(oe).includes(R.id),ne=R=>{Ke.publish("app.files.list.clicked"),t.emit("update:selectedIds",R)},se=R=>{T.toggleSelection(R),ne(T.selectedIds)},Re=R=>{if(R.isFolder)return s.getFolderLink(R);let F=e.space;F||(F=o(R));const K=w({resources:[R],space:F});if(K!=null&&K.route)return K.route({space:F,resources:[R]})},H=R=>p(A).includes(R);return{router:n,configOptions:E,dragItem:$,ghostElement:D,contextMenuButton:N,getTagToolTip:te,renameActions:G,renameActionsSpace:ae,renameHandler:ye,renameHandlerSpace:ue,FolderViewModeConstants:Jt,hasTags:V,disabledResources:oe,isResourceDisabled:ce,userContextReady:S,getMatchingSpace:o,clipboardResources:g,clipboardAction:v,...ma({space:le(e.space),targetRouteCallback:B(()=>e.targetRouteCallback)},t),...s,postMessage:d,isFilePicker:l,isLocationPicker:u,isEmbedModeEnabled:f,emitSelect:ne,toggleSelection:se,areFileExtensionsShown:I,latestSelectedId:_,isResourceClickable:J,getResourceLink:Re,isSticky:a,isResourceInDeleteQueue:H,ShareTypes:ee.ShareTypes}},data(){return{constants:{ImageDimension:Kn,EVENT_TROW_MOUNTED:Sv}}},computed:{fields(){if(this.resources.length===0)return[];const e=this.resources[0],t=[];this.isSelectable&&t.push({name:"select",title:"",type:"slot",headerType:"slot",width:"shrink"});const n=kh(e);return t.push(...[{name:"name",title:this.$gettext("Name"),type:"slot",width:"expand",wrap:"truncate"},{name:"manager",prop:"members",title:this.$gettext("Manager"),type:"slot"},{name:"members",title:this.$gettext("Members"),prop:"members",type:"slot"},{name:"totalQuota",prop:"spaceQuota.total",title:this.$gettext("Total quota"),type:"slot",sortable:!0},{name:"usedQuota",prop:"spaceQuota.used",title:this.$gettext("Used quota"),type:"slot",sortable:!0},{name:"remainingQuota",prop:"spaceQuota.remaining",title:this.$gettext("Remaining quota"),type:"slot",sortable:!0},{name:"indicators",title:this.$gettext("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"size",title:this.$gettext("Size"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"syncEnabled",title:this.$gettext("Info"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"status",prop:"disabled",title:this.$gettext("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"tags",title:this.$gettext("Tags"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedBy",title:this.$gettext("Shared by"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedWith",title:this.$gettext("Shared with"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"mdate",title:this.$gettext("Modified"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:r=>this.formatDateRelative(r.mdate)+" ("+this.formatDate(r.mdate)+")"},{name:"sdate",title:this.$gettext("Shared on"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:r=>this.formatDateRelative(r.sdate)+" ("+this.formatDate(r.sdate)+")"},{name:"ddate",title:this.$gettext("Deleted"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:r=>this.formatDateRelative(r.ddate)+" ("+this.formatDate(r.ddate)+")"}].filter(r=>{if(r.name==="tags"&&!this.hasTags)return!1;if(r.name==="indicators")return!0;let o;return r.prop?o=Bl(e,r.prop)!==void 0:o=Object.prototype.hasOwnProperty.call(e,r.name),this.fieldsDisplayed?o&&this.fieldsDisplayed.includes(r.name):o}).map(r=>{const o=n.find(i=>i.name===r.name);return o&&Object.assign(r,{sortable:o.sortable,sortDir:o.sortDir}),r})),this.hasActions&&t.push({name:"actions",title:this.$gettext("Actions"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"}),t},areAllResourcesSelected(){const e=this.disabledResources.length===this.resources.length,t=this.selectedResources.length===this.resources.length-this.disabledResources.length;return!e&&t},selectAllCheckboxLabel(){return this.areAllResourcesSelected?this.$gettext("Clear selection"):this.$gettext("Select all")},selectedResources(){return this.resources.filter(e=>this.selectedIds.includes(e.id))},contextMenuLabel(){return this.$gettext("Show context menu")},dragSelection(){const e=[...this.selectedResources];return e.splice(e.findIndex(t=>t.id===this.dragItem.id),1),e}},methods:{isResourceSelected(e){return this.selectedIds.includes(e.id)},isResourceCut(e){return this.clipboardAction!==ii.Cut?!1:this.clipboardResources.some(t=>t.id===e.id)},getTagLink(e){var n;const t=(n=p(this.router.currentRoute).query)==null?void 0:n.term;return Ci("files-common-search",{query:{provider:"files.sdk",q_tags:e,...t&&{term:t}}})},getTagComponentAttrs(e){return this.userContextReady?{to:this.getTagLink(e)}:{}},isLatestSelectedItem(e){return e.id===this.latestSelectedId},hasRenameAction(e){return ee.isProjectSpaceResource(e)?this.renameActionsSpace.filter(t=>t.isVisible({resources:[e]})).length:this.renameActions.filter(t=>t.isVisible({space:this.space,resources:[e]})).length},openRenameDialog(e){if(ee.isProjectSpaceResource(e))return this.renameHandlerSpace({resources:[e]});this.renameHandler({space:this.getMatchingSpace(e),resources:[e]})},openTagsSidebar(){Ke.publish(Tt.open)},openSharingSidebar(e){let t;e.type==="space"?t="space-share":t="sharing",Ke.publish(Tt.openWithPanel,t)},async fileDragged(e,t){this.dragDrop&&(await this.setDragItem(e,t),this.addSelectedResource(e))},fileDropped(e,t){if(!this.dragDrop||(t.dataTransfer.types||[]).some(s=>s==="Files"))return;this.dragItem=null;const i=t.target.closest("tr").dataset.itemId;this.dropRowStyling(e,!0,t),this.$emit(Nf,i)},async setDragItem(e,t){this.dragItem=e,await this.$nextTick(),this.ghostElement.$el.ariaHidden="true",this.ghostElement.$el.style.left="-99999px",this.ghostElement.$el.style.top="-99999px",t.dataTransfer.setDragImage(this.ghostElement.$el,0,0),t.dataTransfer.dropEffect="move",t.dataTransfer.effectAllowed="move"},dropRowStyling(e,t,n){var s,a;if((((s=n.dataTransfer)==null?void 0:s.types)||[]).some(c=>c==="Files")||(a=n.currentTarget)!=null&&a.contains(n.relatedTarget))return;const o=document.getElementsByClassName(`oc-tbody-tr-${e}`)[0].classList,i="highlightedDropTarget";t?o.remove(i):o.add(i)},sort(e){this.$emit("sort",e)},addSelectedResource(e){this.isResourceSelected(e)||this.toggleSelection(e.id)},showContextMenuOnBtnClick(e,t){if(this.isResourceDisabled(t))return!1;const{dropdown:n,event:r}=e;(n==null?void 0:n.tippy)!==void 0&&(this.isResourceSelected(t)||this.emitSelect([t.id]),To(n.tippy,r,this.contextMenuButton))},showContextMenu(e,t,n){if(t.preventDefault(),this.isResourceDisabled(n))return!1;const r=e.$el.getElementsByClassName("resource-table-btn-action-dropdown")[0];r!==void 0&&(this.isResourceSelected(n)||this.emitSelect([n.id]),To(r._tippy,t,this.contextMenuButton))},rowMounted(e,t){this.$emit("rowMounted",e,t,this.constants.ImageDimension.Thumbnail)},fileClicked(e){var s,a;const t=e[0];if(this.isResourceDisabled(t))return;if(this.isEmbedModeEnabled&&this.isFilePicker&&!t.isFolder)return this.postMessage("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(t)),locationQuery:JSON.parse(JSON.stringify(na(p(this.router.currentRoute))))});const n=e[1],r=e[2]??!1;!n.shiftKey&&!n.metaKey&&!n.ctrlKey&&Ke.publish("app.files.shiftAnchor.reset");const o=(n==null?void 0:n.target).getAttribute("type")==="checkbox";if(((a=(s=n==null?void 0:n.target)==null?void 0:s.closest("div"))==null?void 0:a.id)!=="oc-files-context-menu"){if(n&&n.metaKey)return Ke.publish("app.files.list.clicked.meta",t);if(n&&n.shiftKey)return Ke.publish("app.files.list.clicked.shift",{resource:t,skipTargetSelection:r});if(!o&&!this.isResourceSelected(t))return this.emitSelect([t.id])}},formatDate(e){return Cb(new Date(e),this.$language.current)},formatDateRelative(e){return Fb(new Date(e),this.$language.current)},toggleSelectionAll(){if(this.areAllResourcesSelected)return this.emitSelect([]);this.emitSelect(this.resources.filter(e=>!this.disabledResources.includes(e.id)).map(e=>e.id))},emitFileClick(e){const t=this.getMatchingSpace(e);this.$emit("fileClick",{space:t,resources:[e]})},getResourceCheckboxLabel(e){return e.type==="folder"?this.$gettext("Select folder"):this.$gettext("Select file")},getSharedWithAvatarDescription(e){if(!ee.isShareResource(e))return;const t=e.type==="folder"?this.$gettext("folder"):this.$gettext("file"),n=e.sharedWith.filter(({shareType:r})=>ee.ShareTypes.authenticated.includes(ee.ShareTypes.getByValue(r))).length;return n?this.$ngettext("This %{ resourceType } is shared via %{ shareCount } invite","This %{ resourceType } is shared via %{ shareCount } invites",n,{resourceType:t,shareCount:n.toString()}):""},getSharedByAvatarDescription(e){if(!ee.isShareResource(e))return"";const t=e.type==="folder"?this.$gettext("folder"):this.$gettext("file");return this.$gettext("This %{ resourceType } is shared by %{ user }",{resourceType:t,user:e.sharedBy.map(({displayName:n})=>n).join(", ")})},getSharedByAvatarItems(e){return ee.isShareResource(e)?e.sharedBy.map(t=>({displayName:t.displayName,name:t.displayName,avatarType:ee.ShareTypes.user.key,username:t.id,userId:t.id})):[]},getSharedWithAvatarItems(e){return ee.isShareResource(e)?e.sharedWith.filter(({shareType:t})=>ee.ShareTypes.authenticated.includes(ee.ShareTypes.getByValue(t))).map(t=>({displayName:t.displayName,name:t.displayName,avatarType:ee.ShareTypes.getByValue(t.shareType).key,username:t.id,userId:t.id})):[]}}}),VD={class:"resource-table-select-all"},zD={class:"oc-text-truncate"},WD=["textContent"],HD=["textContent"],GD=["textContent"],KD={key:0,class:"resource-table-actions"};function QD(e,t,n,r,o,i){const s=pe("oc-checkbox"),a=pe("oc-spinner"),c=pe("resource-list-item"),u=pe("oc-icon"),l=pe("oc-button"),d=pe("resource-size"),f=pe("oc-tag"),m=pe("resource-status-indicators"),w=pe("user-avatar"),y=pe("oc-avatars"),E=pe("context-menu-quick-action"),b=pe("oc-table"),g=pe("resource-ghost-element"),v=ln("oc-tooltip");return X(),de(qe,null,[he(b,Gt(e.$attrs,{id:"files-space-table",class:[{condensed:e.viewMode===e.FolderViewModeConstants.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:e.fields,highlighted:e.selectedIds,disabled:e.disabledResources,sticky:e.isSticky,"header-position":e.headerPosition,"drag-drop":e.dragDrop,hover:e.hover,"item-dom-selector":e.resourceDomSelector,selection:e.selectedResources,"sort-by":e.sortBy,"sort-dir":e.sortDir,lazy:e.lazy,"grouping-settings":e.groupingSettings,"padding-x":"medium",onHighlight:e.fileClicked,onRowMounted:e.rowMounted,onContextmenuClicked:e.showContextMenu,onItemDropped:e.fileDropped,onItemDragged:e.fileDragged,onDropRowStyling:e.dropRowStyling,onSort:e.sort,"onUpdate:modelValue":t[0]||(t[0]=h=>e.$emit("update:modelValue",h))}),sp({name:Se(({item:h})=>[fe("div",{class:W.normalizeClass(["resource-table-resource-wrapper",[{"resource-table-resource-wrapper-limit-max-width":e.hasRenameAction(h)}]])},[Xe(e.$slots,"image",{resource:h}),(X(),Ae(c,{key:`${h.path}-${e.resourceDomSelector(h)}-${h.thumbnail}`,resource:h,"path-prefix":e.getPathPrefix(h),"is-path-displayed":e.arePathsDisplayed,"parent-folder-name":e.getParentFolderName(h),"is-icon-displayed":!e.$slots.image,"is-extension-displayed":e.areFileExtensionsShown,"is-resource-clickable":e.isResourceClickable(h),link:e.getResourceLink(h),"parent-folder-link":e.getParentFolderLink(h),"parent-folder-link-icon-additional-attributes":e.getParentFolderLinkIconAdditionalAttributes(h),class:W.normalizeClass({"resource-table-resource-cut":e.isResourceCut(h)}),onClick:S=>e.emitFileClick(h)},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"])),e.hasRenameAction(h)?(X(),Ae(l,{key:0,class:"resource-table-edit-name raw-hover-surface oc-p-xs",appearance:"raw",onClick:S=>e.openRenameDialog(h)},{default:Se(()=>[he(u,{name:"edit-2","fill-type":"line",size:"small"})]),_:2},1032,["onClick"])):Ce("",!0)],2),Xe(e.$slots,"additionalResourceContent",{resource:h})]),syncEnabled:Se(({item:h})=>[Xe(e.$slots,"syncEnabled",{resource:h})]),size:Se(({item:h})=>[he(d,{size:h.size||Number.NaN},null,8,["size"])]),tags:Se(({item:h})=>[(X(!0),de(qe,null,wt(h.tags.slice(0,2),S=>(X(),Ae(Nr(e.userContextReady?"router-link":"span"),Gt({key:S},{ref_for:!0},e.getTagComponentAttrs(S),{class:"resource-table-tag-wrapper"}),{default:Se(()=>[ot((X(),Ae(f,{class:"resource-table-tag oc-ml-xs",rounded:!0,size:"small"},{default:Se(()=>[he(u,{name:"price-tag-3",size:"small"}),fe("span",zD,W.toDisplayString(S),1)]),_:2},1024)),[[v,e.getTagToolTip(S)]])]),_:2},1040))),128)),h.tags.length>2?(X(),Ae(f,{key:0,size:"small",class:"resource-table-tag-more",onClick:e.openTagsSidebar},{default:Se(()=>[Ot(" + "+W.toDisplayString(h.tags.length-2),1)]),_:2},1032,["onClick"])):Ce("",!0)]),manager:Se(({item:h})=>[Xe(e.$slots,"manager",{resource:h})]),members:Se(({item:h})=>[Xe(e.$slots,"members",{resource:h})]),totalQuota:Se(({item:h})=>[Xe(e.$slots,"totalQuota",{resource:h})]),usedQuota:Se(({item:h})=>[Xe(e.$slots,"usedQuota",{resource:h})]),remainingQuota:Se(({item:h})=>[Xe(e.$slots,"remainingQuota",{resource:h})]),mdate:Se(({item:h})=>[ot(fe("span",{tabindex:"0",textContent:W.toDisplayString(e.formatDateRelative(h.mdate))},null,8,WD),[[v,e.formatDate(h.mdate)]])]),indicators:Se(({item:h})=>[he(m,{space:e.space,resource:h,"disable-handler":e.isResourceDisabled(h)},null,8,["space","resource","disable-handler"])]),sdate:Se(({item:h})=>[ot(fe("span",{tabindex:"0",textContent:W.toDisplayString(e.formatDateRelative(h.sdate))},null,8,HD),[[v,e.formatDate(h.sdate)]])]),ddate:Se(({item:h})=>[ot(fe("p",{tabindex:"0",class:"oc-m-rm",textContent:W.toDisplayString(e.formatDateRelative(h.ddate))},null,8,GD),[[v,e.formatDate(h.ddate)]])]),sharedBy:Se(({item:h})=>[he(l,{appearance:"raw-inverse",class:"resource-table-shared-by","no-hover":"",onClick:S=>e.openSharingSidebar(h)},{default:Se(()=>[he(y,{class:"resource-table-people","is-tooltip-displayed":!0,items:e.getSharedByAvatarItems(h),"accessible-description":e.getSharedByAvatarDescription(h),"hover-effect":""},{userAvatars:Se(({avatars:S,width:T})=>[(X(!0),de(qe,null,wt(S,I=>(X(),Ae(w,{key:I.userId,"user-id":I.userId,"user-name":I.displayName,width:T},null,8,["user-id","user-name","width"]))),128))]),_:2},1032,["items","accessible-description"])]),_:2},1032,["onClick"])]),sharedWith:Se(({item:h})=>[he(l,{appearance:"raw-inverse",class:"resource-table-shared-with","no-hover":"",onClick:S=>e.openSharingSidebar(h)},{default:Se(()=>[he(y,{class:"resource-table-people",items:e.getSharedWithAvatarItems(h),stacked:!0,"max-displayed":3,"is-tooltip-displayed":!0,"accessible-description":e.getSharedWithAvatarDescription(h),"hover-effect":""},{userAvatars:Se(({avatars:S,width:T})=>[(X(!0),de(qe,null,wt(S,I=>(X(),Ae(w,{key:I.userId,"user-id":I.userId,"user-name":I.displayName,width:T},null,8,["user-id","user-name","width"]))),128))]),_:2},1032,["items","accessible-description"])]),_:2},1032,["onClick"])]),actions:Se(({item:h})=>[e.isResourceDisabled(h)?Ce("",!0):(X(),de("div",KD,[Xe(e.$slots,"quickActions",{resource:h}),he(E,{ref:"contextMenuButton",item:h,"resource-dom-selector":e.resourceDomSelector,class:"resource-table-btn-action-dropdown",onQuickActionClicked:S=>e.showContextMenuOnBtnClick(S,h)},{contextMenu:Se(({isOpen:S})=>[Xe(e.$slots,"contextMenu",{resource:h,isOpen:S})]),_:2},1032,["item","resource-dom-selector","onQuickActionClicked"])]))]),_:2},[!e.isLocationPicker&&!e.isFilePicker?{name:"selectHeader",fn:Se(()=>[fe("div",VD,[ot(he(s,{id:"resource-table-select-all",size:"large",label:e.selectAllCheckboxLabel,disabled:e.resources.length===e.disabledResources.length,"label-hidden":!0,"model-value":e.areAllResourcesSelected,onClick:Cn(e.toggleSelectionAll,["stop"])},null,8,["label","disabled","model-value","onClick"]),[[v,{content:e.selectAllCheckboxLabel,placement:"bottom"}]])])]),key:"0"}:void 0,!e.isLocationPicker&&!e.isFilePicker?{name:"select",fn:Se(({item:h})=>[e.isResourceInDeleteQueue(h.id)?(X(),Ae(a,{key:0,class:"resource-table-activity-indicator",size:"medium","aria-label":e.$gettext("File is being processed")},null,8,["aria-label"])):(X(),Ae(s,{key:1,id:`resource-table-select-${e.resourceDomSelector(h)}`,label:e.getResourceCheckboxLabel(h),"label-hidden":!0,size:"large",disabled:e.isResourceDisabled(h),"model-value":e.isResourceSelected(h),outline:e.isLatestSelectedItem(h),onClick:Cn(S=>e.toggleSelection(h.id),["stop"])},null,8,["id","label","disabled","model-value","outline","onClick"]))]),key:"1"}:void 0,e.$slots.footer?{name:"footer",fn:Se(()=>[Xe(e.$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","grouping-settings","onHighlight","onRowMounted","onContextmenuClicked","onItemDropped","onItemDragged","onDropRowStyling","onSort"]),e.dragItem?(X(),Ae(ep,{key:0,to:"body"},[he(g,{ref:"ghostElement","preview-items":[e.dragItem,...e.dragSelection]},null,8,["preview-items"])])):Ce("",!0)],64)}const XD=ze(qD,[["render",QD]]),YD=["data-item-id"],JD={key:0,class:"oc-tile-card-lazy-shimmer"},ZD={class:"oc-tile-card-selection"},eL={key:0,class:"oc-tile-card-loading-spinner oc-m-s"},tL=["textContent"],nL=["aria-label"],rL={class:"oc-card-body oc-p-s"},iL={class:"oc-flex oc-flex-between oc-flex-middle"},oL={class:"oc-flex oc-flex-middle oc-text-truncate resource-name-wrapper"},sL={class:"oc-flex oc-flex-middle"},aL={key:0,class:"oc-text-left oc-my-rm oc-text-truncate"},lL=["textContent"],V0=Ne({__name:"ResourceTile",props:{resource:{},resourceRoute:{},isResourceSelected:{type:Boolean,default:!1},isResourceClickable:{type:Boolean,default:!0},isResourceDisabled:{type:Boolean,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},resourceIconSize:{default:"xlarge"},lazy:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1}},emits:["click","contextmenu","itemVisible"],setup(e,{emit:t}){const n=t,{$gettext:r}=Fe.useGettext(),o=Bd((d,f)=>{let m;return{get(){return d(),m},set(w){m=w,f()}}}),i=B(()=>e.resource.locked||e.resource.processing),s=B(()=>e.resource.locked?{name:"lock",fillType:"fill"}:e.resource.processing?{name:"loop-right",fillType:"line"}:{}),a=B(()=>e.resource.locked?r("This item is locked"):null),c=B(()=>ee.isSpaceResource(e.resource)?e.resource.description:""),{isVisible:u}=e.lazy?L0({target:o,onVisibleCallback:()=>n("itemVisible")}):{isVisible:le(!0)},l=B(()=>!p(u));return e.lazy||n("itemVisible"),(d,f)=>{const m=pe("oc-spinner"),w=pe("oc-tag"),y=pe("oc-image"),E=pe("oc-icon"),b=ln("oc-tooltip");return X(),de("div",{ref_key:"observerTarget",ref:o,class:W.normalizeClass(["oc-tile-card oc-card oc-card-default",{"oc-tile-card-selected":d.isResourceSelected,"oc-tile-card-disabled":d.isResourceDisabled&&!p(ee.isProjectSpaceResource)(d.resource),"state-trashed":d.isResourceDisabled&&p(ee.isProjectSpaceResource)(d.resource)}]),"data-item-id":d.resource.id,onContextmenu:f[2]||(f[2]=g=>d.$emit("contextmenu",g))},[l.value?(X(),de("div",JD)):(X(),de(qe,{key:1},[he(Wf,{class:"oc-card-media-top oc-flex oc-flex-center oc-flex-middle oc-m-rm",resource:d.resource,link:d.resourceRoute,"is-resource-clickable":d.isResourceClickable,tabindex:"-1",onClick:f[0]||(f[0]=g=>d.$emit("click"))},{default:Se(()=>[fe("div",ZD,[d.isLoading?(X(),de("div",eL,[he(m,{"aria-label":p(r)("File is being processed")},null,8,["aria-label"])])):Xe(d.$slots,"selection",{key:1,item:d.resource})]),d.isResourceDisabled&&p(ee.isProjectSpaceResource)(d.resource)?(X(),Ae(w,{key:0,class:"resource-disabled-indicator oc-position-absolute",type:"span"},{default:Se(()=>[fe("span",{textContent:W.toDisplayString(p(r)("Disabled"))},null,8,tL)]),_:1})):Ce("",!0),ot((X(),de("div",{class:"oc-tile-card-preview oc-flex oc-flex-middle oc-flex-center","aria-label":a.value},[Xe(d.$slots,"imageField",{item:d.resource},()=>[d.resource.thumbnail?(X(),Ae(y,{key:0,class:"tile-preview",src:d.resource.thumbnail},null,8,["src"])):(X(),Ae(Oo,{key:1,resource:d.resource,size:d.resourceIconSize,class:"tile-default-image oc-pt-xs"},sp({_:2},[i.value?{name:"status",fn:Se(()=>[he(E,Gt(s.value,{size:"xsmall"}),null,16)]),key:"0"}:void 0]),1032,["resource","size"]))])],8,nL)),[[b,a.value]])]),_:3},8,["resource","link","is-resource-clickable"]),fe("div",rL,[fe("div",iL,[fe("div",oL,[he(ko,{resource:d.resource,"is-icon-displayed":!1,"is-extension-displayed":d.isExtensionDisplayed,"is-resource-clickable":d.isResourceClickable,link:d.resourceRoute,onClick:f[1]||(f[1]=g=>d.$emit("click"))},null,8,["resource","is-extension-displayed","is-resource-clickable","link"])]),fe("div",sL,[Xe(d.$slots,"indicators",{item:d.resource,class:"resource-indicators"}),Xe(d.$slots,"actions",{item:d.resource}),Xe(d.$slots,"contextMenu",{item:d.resource})])]),c.value?(X(),de("p",aL,[fe("small",{textContent:W.toDisplayString(c.value)},null,8,lL)])):Ce("",!0)])],64))],42,YD)}}}),cL={id:"tiles-view",class:"oc-px-m oc-pt-l"},uL={class:"oc-flex oc-flex-middle oc-mb-s oc-pb-s oc-tiles-controls"},fL={key:0,class:"oc-tiles-sort"},dL={key:0,class:"oc-flex"},pL={class:"oc-tiles-footer"},hL=Ne({__name:"ResourceTiles",props:{resources:{default:()=>[]},selectedIds:{default:()=>[]},targetRouteCallback:{type:Function},space:{},sortFields:{default:()=>[]},sortBy:{},sortDir:{},viewSize:{default:()=>Jt.tilesSizeDefault},dragDrop:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0}},emits:["fileDropped","rowMounted","sort","itemVisible","update:selectedIds"],setup(e,{emit:t}){const n=t,{$gettext:r}=Fe.useGettext(),o=We(),i=Qe(),{getDefaultAction:s}=Qn(),{getMatchingSpace:a}=un(),{canBeOpenedWithSecureView:c}=Jf(),{isEnabled:u,fileTypes:l,isLocationPicker:d,isFilePicker:f,postMessage:m}=si(),w=Zf(),y=B(()=>Math.min(p(w),e.viewSize)),E=B(()=>i.areFileExtensionsShown),b=B(()=>p(Pe)?r("Clear selection"):r("Select all")),g=le(),v=le(),h=le({tiles:{},dropBtns:{}}),S=ma({space:le(e.space),targetRouteCallback:B(()=>e.targetRouteCallback)},{emit:n}),T=Z=>{if(ee.isSpaceResource(Z))return Z.disabled?null:Nn("files-spaces-generic",rr(Z,{path:"",fileId:Z.fileId}));if(Z.isFolder)return S.createFolderLink({path:Z.path,fileId:Z.fileId,resource:Z});let xe=e.space;xe||(xe=a(Z));const Me=s({resources:[Z],space:xe});return Me!=null&&Me.route?Me.route({space:xe,resources:[Z]}):null},I=Z=>{if(p(u)&&p(f))return m("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(Z)),locationQuery:JSON.parse(JSON.stringify(na(p(o.currentRoute))))});Z.type!=="space"&&Z.type!=="folder"&&S.createFileAction(Z)},_=(Z,xe,Me)=>{const{dropdown:Ge,event:et}=Z;(Ge==null?void 0:Ge.tippy)!==void 0&&(i.setSelection([xe.id]),To(Ge.tippy,et,p(h).dropBtns[Me]))},A=Z=>e.selectedIds.includes(Z.id),$=B(()=>e.resources.filter(Z=>e.selectedIds.includes(Z.id))),D=Z=>N(Z)||x(Z)?!1:Z.isFolder?!0:!(!Z.canDownload()&&!c(Z)||p(u)&&!p(f)),N=Z=>{var xe;return p(u)&&((xe=p(l))!=null&&xe.length)?!p(l).includes(Z.extension)&&!p(l).includes(Z.mimeType)&&!Z.isFolder:De(Z.id)?!0:Z.processing===!0},x=Z=>N(Z)?!0:ee.isSpaceResource(Z)&&Z.disabled,V=B(()=>{var Z,xe;return((xe=(Z=e.resources)==null?void 0:Z.filter(Me=>N(Me)===!0))==null?void 0:xe.map(Me=>Me.id))||[]}),G=Z=>{n("update:selectedIds",Z)},ae=()=>{if(p(Pe))return n("update:selectedIds",[]);n("update:selectedIds",e.resources.filter(Z=>!p(V).includes(Z.id)).map(Z=>Z.id))},ye=(Z,xe,Me)=>{var et;Z.preventDefault();const Ge=(et=p(h).tiles[xe.id])==null?void 0:et.$el.getElementsByClassName("resource-tiles-btn-action-dropdown")[0];Ge!==void 0&&(A(xe)||G([xe.id]),To(Ge._tippy,Z,Me))},ue=Z=>{const xe=Z[0],Me=Z[1];if(Me&&Me.metaKey)return Ke.publish("app.files.list.clicked.meta",xe);if(!Me.shiftKey&&!Me.metaKey&&!Me.ctrlKey&&Ke.publish("app.files.shiftAnchor.reset"),Me&&Me.shiftKey)return Ke.publish("app.files.list.clicked.shift",{resource:xe,skipTargetSelection:!1});te(xe)},te=Z=>{const xe=A(Z)?e.selectedIds.filter(Me=>Me!==Z.id):[...e.selectedIds,Z.id];n("update:selectedIds",xe)},ce=Z=>{switch(Z.type){case"folder":return r("Select folder");case"space":return r("Select space");default:return r("Select file")}},oe=B(()=>e.sortFields.find(Z=>Z.name===e.sortBy&&Z.sortDir===e.sortDir)||e.sortFields[0]),J=Z=>{n("sort",{sortBy:Z.name,sortDir:Z.sortDir})},ne=B(()=>{const Z={1:"xlarge",2:"xlarge",3:"xxlarge",4:"xxlarge",5:"xxxlarge",6:"xxxlarge"},xe=p(y);return Z[xe]??"xxlarge"});mS(()=>{h.value={tiles:{},dropBtns:{}}});const se=(Z,xe,Me)=>{var Nt,_t;if((((Nt=Me.dataTransfer)==null?void 0:Nt.types)||[]).some($t=>$t==="Files")||(_t=Me.currentTarget)!=null&&_t.contains(Me.relatedTarget)||e.selectedIds.includes(Z.id)||Z.type!=="folder")return;const et=p(h).tiles[Z.id];if(xe){et.$el.classList.remove("oc-tiles-item-drop-highlight");return}et.$el.classList.add("oc-tiles-item-drop-highlight")},Re=B(()=>e.selectedIds.filter(Z=>Z!==p(g).id)),H=async(Z,xe)=>{g.value=Z,await _n(),p(v).$el.ariaHidden="true",p(v).$el.style.left="-99999px",p(v).$el.style.top="-99999px",xe.dataTransfer.setDragImage(p(v).$el,0,0),xe.dataTransfer.dropEffect="move",xe.dataTransfer.effectAllowed="move"},R=async(Z,xe)=>{A(Z)||te(Z),await H(Z,xe)},F=(Z,xe)=>{(xe.dataTransfer.types||[]).some(Ge=>Ge==="Files")||(g.value=null,se(Z,!0,xe),n("fileDropped",Z.id))},K=le(0),z=()=>{const Z=document.getElementById("tiles-view"),xe=getComputedStyle(Z),Me=parseInt(xe.getPropertyValue("padding-left"),10)|0,Ge=parseInt(xe.getPropertyValue("padding-right"),10)|0;K.value=Z.clientWidth-Me-Ge},M=B(()=>parseFloat(getComputedStyle(document.documentElement).fontSize)),{calculateTileSizePixels:q}=i0(),ge=B(()=>{const Z=[...Array(Jt.tilesSizeMax).keys()].map(xe=>xe+1);return[...new Set(Z.map(xe=>{const Me=q(xe);return Me?Math.round(p(K)/(Me+p(M))):0}))]}),_e=B(()=>{const Z=p(ge);return Z.length<p(y)?Z[Z.length-1]:Z[p(y)-1]}),Le=B(()=>{const Z=p(_e)?e.resources.length%p(_e):0;return Z?p(_e)-Z:0}),ke=B(()=>p(K)/p(_e)-p(M)),Pe=B(()=>{const Z=p(V).length===e.resources.length,xe=p($).length===e.resources.length-p(V).length;return!Z&&xe}),De=Z=>i.deleteQueue.includes(Z);return St(ke,Z=>{document.documentElement.style.setProperty("--oc-size-tiles-actual",`${Z}px`)},{immediate:!0}),St(ge,Z=>{w.value=Math.max(Z.length,1)}),Bt(()=>{window.addEventListener("resize",z),z()}),Vn(()=>{window.removeEventListener("resize",z)}),(Z,xe)=>{const Me=pe("oc-checkbox"),Ge=pe("oc-icon"),et=pe("oc-button"),Nt=pe("oc-filter-chip"),_t=pe("oc-list"),$t=ln("oc-tooltip");return X(),de("div",cL,[fe("div",uL,[ot(he(Me,{id:"tiles-view-select-all",class:"oc-ml-s",size:"large",label:b.value,"label-hidden":!0,disabled:Z.resources.length===V.value.length,"model-value":Pe.value,onClick:Cn(ae,["stop"])},null,8,["label","disabled","model-value"]),[[$t,b.value]]),Z.sortFields.length?(X(),de("div",fL,[he(Nt,{class:"oc-tiles-sort-filter-chip","filter-label":oe.value.label,"selected-item-names":[],"close-on-click":"",raw:""},{default:Se(()=>[(X(!0),de(qe,null,wt(Z.sortFields,(Be,Ve)=>(X(),Ae(et,{key:Ve,appearance:"raw",size:"medium","justify-content":"space-between",class:W.normalizeClass(["oc-tiles-sort-filter-chip-item oc-flex oc-flex-middle oc-width-1-1 oc-p-s",{"oc-tiles-sort-filter-chip-item-active":oe.value===Be,"oc-mt-xs":Ve>0}]),onClick:dn=>J(Be)},{default:Se(()=>[fe("span",null,W.toDisplayString(Be.label),1),Be===oe.value?(X(),de("div",dL,[he(Ge,{name:"check"})])):Ce("",!0)]),_:2},1032,["class","onClick"]))),128))]),_:1},8,["filter-label"])])):Ce("",!0)]),he(_t,{class:"oc-tiles"},{default:Se(()=>[(X(!0),de(qe,null,wt(Z.resources,Be=>(X(),de("li",{key:Be.id,class:"oc-tiles-item has-item-context-menu"},[he(V0,{ref_for:!0,ref:Ve=>h.value.tiles[Be.id]=Ve,resource:Be,"resource-route":T(Be),"is-resource-selected":A(Be),"is-resource-clickable":D(Be),"is-resource-disabled":N(Be)||x(Be),"is-extension-displayed":E.value,"resource-icon-size":ne.value,draggable:Z.dragDrop,lazy:Z.lazy,"is-loading":De(Be.id),onVnodeMounted:Ve=>Z.$emit("rowMounted",Be,h.value.tiles[Be.id],p(Kn).Tile),onContextmenu:Ve=>ye(Ve,Be,h.value.tiles[Be.id]),onClick:Ve=>I(Be),onDragstart:Ve=>R(Be,Ve),onDragenter:Cn(Ve=>se(Be,!1,Ve),["prevent"]),onDragleave:Cn(Ve=>se(Be,!0,Ve),["prevent"]),onDrop:Ve=>F(Be,Ve),onDragover:xe[0]||(xe[0]=Ve=>Ve.preventDefault()),onItemVisible:Ve=>Z.$emit("itemVisible",Be)},{selection:Se(()=>[!p(d)&&!p(f)?(X(),Ae(Me,{key:0,label:ce(Be),"label-hidden":!0,size:"large",class:"oc-flex-inline oc-p-s",disabled:N(Be),"model-value":A(Be),onClick:Cn(Ve=>ue([Be,Ve]),["stop","prevent"])},null,8,["label","disabled","model-value","onClick"])):Ce("",!0)]),imageField:Se(()=>[Xe(Z.$slots,"image",{resource:Be})]),indicators:Se(()=>[he(q0,{space:Z.space,resource:Be,filter:Ve=>Ve.category==="system","disable-handler":N(Be)},null,8,["space","resource","filter","disable-handler"])]),actions:Se(()=>[Xe(Z.$slots,"actions",{resource:Be})]),contextMenu:Se(()=>[p(ee.isSpaceResource)(Be)||!N(Be)?(X(),Ae(p(rd),{key:0,ref_for:!0,ref:Ve=>h.value.dropBtns[Be.id]=Ve,item:Be,class:"resource-tiles-btn-action-dropdown",onQuickActionClicked:Ve=>_(Ve,Be,Be.id)},{contextMenu:Se(({isOpen:Ve})=>[Xe(Z.$slots,"contextMenu",{resource:Be,isOpen:Ve})]),_:2},1032,["item","onQuickActionClicked"])):Ce("",!0)]),_:2},1032,["resource","resource-route","is-resource-selected","is-resource-clickable","is-resource-disabled","is-extension-displayed","resource-icon-size","draggable","lazy","is-loading","onVnodeMounted","onContextmenu","onClick","onDragstart","onDragenter","onDragleave","onDrop","onItemVisible"])]))),128)),(X(!0),de(qe,null,wt(Le.value,Be=>(X(),de("li",{key:`ghost-tile-${Be}`,class:"ghost-tile","aria-hidden":!0}))),128))]),_:3}),g.value?(X(),Ae(ep,{key:0,to:"body"},[he(id,{ref_key:"ghostElementRef",ref:v,"preview-items":[g.value,...Re.value]},null,8,["preview-items"])])):Ce("",!0),fe("div",pL,[Xe(Z.$slots,"footer")])])}}}),gL=Ne({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=We(),{current:o}=Fe.useGettext(),i=Kt(),s=le(),a=le(e.items),c=le(),u=le(),l=le(!1),d=le(),f=`q_${e.filterName}`,m=an(f),w=N=>N[e.idAttribute],y=()=>r.push({query:{...Mi(p(i).query,[f]),...p(s)&&{[f]:w(p(s))}}}),E=N=>p(s)&&w(p(s))===w(N),b=()=>{c.value=void 0,u.value=void 0},g=async N=>{b(),E(N)?s.value=void 0:(s.value=N,p(d).hideDrop()),await y(),t("selectionChange",p(s))},v=()=>{s.value=void 0,l.value=!1,b(),t("selectionChange",p(s)),y()},h=()=>{a.value=e.items},S=()=>{l.value=!1},T=()=>{const N=Rt(p(m));if(!N)return;const x=e.items.find(V=>w(V)===N);if(x){s.value=x;return}if(p(I)){const V=N.replace("range:",""),G=Number(V.split(" - ")[0]),ae=Number(V.split(" - ")[1]);c.value=qt.DateTime.fromMillis(G),u.value=qt.DateTime.fromMillis(ae),s.value=p(A)}},I=B(()=>{var N;return(N=Rt(p(m)))==null?void 0:N.startsWith("range:")}),_=B(()=>!p(c)||!p(u)?!1:p(c)<=p(u)),A=B(()=>{if(!p(c)||!p(u))return null;const N=oi(p(c),o,qt.DateTime.DATE_SHORT),x=oi(p(u),o,qt.DateTime.DATE_SHORT),V=p(c).toMillis(),G=p(u).toMillis();return{[e.idAttribute]:`range:${V} - ${G}`,[e.displayNameAttribute]:`${N} - ${x}`}}),$=async()=>{s.value=p(A),await y(),p(d).hideDrop(),t("selectionChange",p(s))},D=({date:N,error:x},V)=>{if(x){console.error("date could not be set");return}const G=V==="from"?c:u;if(!N){G.value=void 0;return}const ae=V==="from"?N.startOf("day"):N.endOf("day");G.value=ae};return n({setSelectedItemsBasedOnQuery:T}),Bt(()=>{T()}),{clearFilter:v,displayedItems:a,isItemSelected:E,selectedItem:s,onShowDrop:h,onHideDrop:S,filterChip:d,toggleItemSelection:g,setSelectedItemsBasedOnQuery:T,fromDate:c,toDate:u,dateRangeValid:_,applyDateRangeFilter:$,dateRangeApplied:I,setDateRangeDate:D,dateRangeClicked:l,queryParam:f}}}),mL={class:"oc-flex oc-flex-middle oc-text-truncate"},yL={class:"oc-text-truncate oc-ml-s"},bL={class:"oc-flex"},vL={class:"oc-my-xs"},wL={class:"oc-flex oc-flex-middle oc-text-truncate"},SL={class:"oc-text-truncate oc-ml-s"},EL=["textContent"],TL={class:"oc-flex"},AL={class:"oc-flex oc-flex-middle oc-flex-between oc-mb-m"},RL=["textContent"],_L={class:"oc-mt-s"},IL={class:"date-filter-apply-btn"};function CL(e,t,n,r,o,i){const s=pe("oc-icon"),a=pe("oc-button"),c=pe("oc-list"),u=pe("oc-datepicker"),l=pe("oc-filter-chip");return X(),de("div",{class:W.normalizeClass(["date-filter oc-flex",`date-filter-${e.filterName}`])},[he(l,{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:Se(()=>[he(c,{class:W.normalizeClass(["date-filter-list",{"date-filter-list-hidden":e.dateRangeClicked}])},{default:Se(()=>[(X(!0),de(qe,null,wt(e.displayedItems,(d,f)=>(X(),de("li",{key:f,class:"oc-my-xs"},[he(a,{class:W.normalizeClass(["date-filter-list-item oc-flex oc-flex-between oc-flex-middle oc-width-1-1 oc-p-xs",{"date-filter-list-item-active":e.isItemSelected(d)}]),"justify-content":"space-between",appearance:"raw","data-testid":d[e.displayNameAttribute],onClick:m=>e.toggleItemSelection(d)},{default:Se(()=>[fe("div",mL,[fe("div",yL,[Xe(e.$slots,"item",{item:d})])]),fe("div",bL,[e.isItemSelected(d)?(X(),Ae(s,{key:0,name:"check"})):Ce("",!0)])]),_:2},1032,["class","data-testid","onClick"])]))),128)),fe("li",vL,[he(a,{class:W.normalizeClass(["date-filter-list-item oc-flex oc-flex-between oc-flex-middle oc-width-1-1 oc-p-xs",{"date-filter-list-item-active":e.dateRangeApplied}]),"justify-content":"space-between",appearance:"raw","data-testid":"custom-date-range",onClick:t[0]||(t[0]=d=>e.dateRangeClicked=!0)},{default:Se(()=>[fe("div",wL,[fe("div",SL,[fe("span",{textContent:W.toDisplayString(e.$gettext("Custom date range"))},null,8,EL)])]),fe("div",TL,[e.dateRangeApplied?(X(),Ae(s,{key:0,name:"check"})):Ce("",!0)])]),_:1},8,["class"])])]),_:3},8,["class"]),fe("div",{class:W.normalizeClass(["date-filter-range-panel oc-py-s",{"date-filter-range-panel-active":e.dateRangeClicked}])},[fe("div",AL,[he(a,{appearance:"raw",class:"date-filter-range-panel-back","aria-label":e.$gettext("Go back to filter options"),onClick:t[1]||(t[1]=d=>e.dateRangeClicked=!1)},{default:Se(()=>[he(s,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"]),fe("span",{textContent:W.toDisplayString(e.$gettext("Custom date range"))},null,8,RL),he(a,{appearance:"raw",class:"date-filter-range-panel-close","aria-label":e.$gettext("Close filter"),onClick:t[2]||(t[2]=d=>e.filterChip.hideDrop())},{default:Se(()=>[he(s,{name:"close"})]),_:1},8,["aria-label"])]),fe("div",_L,[he(u,{label:e.$gettext("From"),"is-clearable":!0,"current-date":e.fromDate,onDateChanged:t[3]||(t[3]=d=>e.setDateRangeDate(d,"from"))},null,8,["label","current-date"]),he(u,{label:e.$gettext("To"),"is-clearable":!0,"current-date":e.toDate,"min-date":e.fromDate?e.fromDate:void 0,onDateChanged:t[4]||(t[4]=d=>e.setDateRangeDate(d,"to"))},null,8,["label","current-date","min-date"])]),fe("div",IL,[he(a,{size:"small",disabled:!e.dateRangeValid,onClick:e.applyDateRangeFilter},{default:Se(()=>[Ot(W.toDisplayString(e.$gettext("Apply")),1)]),_:1},8,["disabled","onClick"])])],2)]),_:3},8,["filter-label","selected-item-names","onClearFilter","onShowDrop","onHideDrop"])],2)}const PL=ze(gL,[["render",CL]]),FL=Ne({name:"ItemFilterInline",props:{filterName:{type:String,required:!0},filterOptions:{type:Array,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=We(),r=Kt(),o=le(e.filterOptions[0].name),i=`q_${e.filterName}`,s=an(i),a=u=>n.push({query:{...Mi(p(r).query,[i]),[i]:u}}),c=async u=>{o.value=u.name,await a(u.name),t("toggleFilter",u)};return Bt(()=>{const u=Rt(p(s));u&&e.filterOptions.some(({name:l})=>l===u)&&(o.value=u,t("toggleFilter",e.filterOptions.find(({name:l})=>l===u)))}),{queryParam:i,activeOption:o,toggleFilter:c}}}),OL=["textContent"];function kL(e,t,n,r,o,i){const s=pe("oc-button");return X(),de("div",null,[fe("div",{class:W.normalizeClass(["item-inline-filter oc-flex-inline",`item-inline-filter-${e.filterName}`])},[(X(!0),de(qe,null,wt(e.filterOptions,(a,c)=>(X(),Ae(s,{id:a.name,key:c,class:W.normalizeClass(["item-inline-filter-option",{"item-inline-filter-option-selected":e.activeOption===a.name}]),appearance:"raw-inverse","color-role":"surface",onClick:u=>e.toggleFilter(a)},{default:Se(()=>[fe("span",{class:"oc-text-truncate item-inline-filter-option-label",textContent:W.toDisplayString(a.label)},null,8,OL)]),_:2},1032,["id","class","onClick"]))),128))],2)])}const xL=ze(FL,[["render",kL]]),NL={class:"space-quota"},$L=["textContent"],z0=Ne({__name:"SpaceQuota",props:{spaceQuota:{}},setup(e){const{$gettext:t,current:n}=Fe.useGettext(),r=B(()=>e.spaceQuota.total?t("%{used} of %{total} used (%{percentage}% used)",{used:p(i),total:p(o),percentage:p(s).toString()}):t("%{used} used (no restriction)",{used:p(i)})),o=B(()=>Tn(e.spaceQuota.total,n)),i=B(()=>Tn(e.spaceQuota.used,n)),s=B(()=>parseFloat((e.spaceQuota.used/e.spaceQuota.total*100).toFixed(2))),a=B(()=>{switch(e.spaceQuota.state){case"normal":return"var(--oc-role-secondary)";default:return"var(--oc-role-error)"}});return(c,u)=>{const l=pe("oc-progress");return X(),de("div",NL,[fe("p",{class:"oc-mb-s oc-mt-rm",textContent:W.toDisplayString(r.value)},null,8,$L),he(l,{value:s.value,max:100,size:"small",color:a.value,"background-color":"var(--oc-role-surface)"},null,8,["value","color"])])}}}),DL=Ne({name:"WebDavDetails",props:{space:{type:Object,required:!0}},setup(e){const t=hr("resource"),n="check",r="file-copy",o=le(r),i=le(r),s=B(()=>Af(p(t).webDavPath)),a=B(()=>{var l;return(l=e.space)==null?void 0:l.getWebDavUrl({path:p(t).path})});return{copyWebDAVPathIcon:o,copyWebDAVPathToClipboard:()=>{navigator.clipboard.writeText(p(s)),o.value=n,setTimeout(()=>o.value=r,1500)},copyWebDAVUrlIcon:i,copyWebDAVUrlToClipboard:()=>{navigator.clipboard.writeText(p(a)),i.value=n,setTimeout(()=>i.value=r,1500)},webDavPath:s,webDavUrl:a}}}),LL={class:"oc-flex"},ML=["textContent"],BL={class:"oc-flex"},jL=["textContent"];function UL(e,t,n,r,o,i){const s=pe("oc-icon"),a=pe("oc-button"),c=ln("oc-tooltip");return X(),de(qe,null,[fe("dt",null,W.toDisplayString(e.$gettext("WebDAV path")),1),fe("dd",LL,[ot(fe("div",{class:"oc-text-truncate",textContent:W.toDisplayString(e.webDavPath)},null,8,ML),[[c,e.webDavPath]]),ot((X(),Ae(a,{class:"oc-ml-s",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV path to clipboard"),"no-hover":"",onClick:e.copyWebDAVPathToClipboard},{default:Se(()=>[he(s,{name:e.copyWebDAVPathIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[c,e.$gettext("Copy WebDAV path")]])]),fe("dt",null,W.toDisplayString(e.$gettext("WebDAV URL")),1),fe("dd",BL,[ot(fe("div",{class:"oc-text-truncate",textContent:W.toDisplayString(e.webDavUrl)},null,8,jL),[[c,e.webDavUrl]]),ot((X(),Ae(a,{class:"oc-ml-s",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV URL to clipboard"),"no-hover":"",onClick:e.copyWebDAVUrlToClipboard},{default:Se(()=>[he(s,{name:e.copyWebDAVUrlIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[c,e.$gettext("Copy WebDAV URL")]])])],64)}const W0=ze(DL,[["render",UL]]),qL={id:"oc-space-details-sidebar"},VL={class:"oc-space-details-sidebar-image oc-text-center"},zL={key:1,class:"oc-position-relative"},WL=["src"],HL={key:0,class:"oc-flex oc-flex-middle oc-space-details-sidebar-members oc-mb-s oc-text-small"},GL=["textContent"],KL=["textContent"],QL=["aria-label"],XL=ze(Ne({__name:"SpaceDetails",props:{showShareIndicators:{type:Boolean,default:!0}},setup(e){const t=yt(),n=Qe(),{resourceContentsText:r}=o0({showSizeInformation:!1}),o=We(),{$gettext:i,$ngettext:s,current:a}=Fe.useGettext(),{loadPreview:c}=ed(),u=ct(),{imagesLoading:l}=Ue.storeToRefs(u),d=Er(),f=hr("resource"),m=le(""),{user:w}=Ue.storeToRefs(t),y=B(()=>u.getSpaceMembers(p(f))),E=B(()=>d.linkShares.length),b=B(()=>n.areWebDavDetailsShown),g=B(()=>!ht(o,"files-spaces-projects")),v=B(()=>`${Tn(p(f).size,a)}, ${p(r)}`);St(()=>p(f).spaceImageData,async()=>{m.value=await c({space:p(f),resource:p(f).spaceImageData?ee.buildSpaceImageResource(p(f)):p(f),dimensions:Kn.Tile,processor:zs.enum.fit,cancelRunning:!0,updateStore:!1})},{immediate:!0});const h=B(()=>p(y).filter(ee.isManager).map(({sharedWith:ue})=>{var te;return ue.id===((te=p(w))==null?void 0:te.id)?i("%{displayName} (me)",{displayName:ue.displayName}):ue.displayName}).join(", ")),S=B(()=>Pb(p(f).mdate,a)),T=B(()=>p(D)||p(N)),I=B(()=>{if(p(D)&&!p(N))return p(V);if(!p(D)&&p(N))return p(G);switch(p(x)){case 1:return s("This space has one member and %{linkShareCount} link.","This space has one member and %{linkShareCount} links.",p(E),{linkShareCount:p(E).toString()});default:return p(E)===1?i("This space has %{memberShareCount} members and one link.",{memberShareCount:p(x).toString()}):i("This space has %{memberShareCount} members and %{linkShareCount} links.",{memberShareCount:p(x).toString(),linkShareCount:p(E).toString()})}}),_=B(()=>i("Open share panel")),A=B(()=>i("Open link list in share panel")),$=B(()=>i("Open member list in share panel")),D=B(()=>p(x)>0),N=B(()=>p(E)>0),x=B(()=>p(y).length),V=B(()=>s("This space has %{memberShareCount} member.","This space has %{memberShareCount} members.",p(x),{memberShareCount:p(x).toString()})),G=B(()=>s("%{linkShareCount} link giving access.","%{linkShareCount} links giving access.",p(E),{linkShareCount:p(E).toString()})),ae=()=>{Ke.publish(Tt.setActivePanel,"space-share")};return(ye,ue)=>{const te=pe("oc-spinner"),ce=pe("oc-icon"),oe=pe("oc-button"),J=pe("portal-target");return X(),de("div",qL,[fe("div",VL,[p(l).includes(p(f).id)?(X(),Ae(te,{key:0,"aria-label":p(i)("Space image is loading")},null,8,["aria-label"])):m.value?(X(),de("div",zL,[fe("img",{src:m.value,alt:""},null,8,WL)])):(X(),Ae(ce,{key:2,name:"layout-grid",size:"xxlarge",class:"space-default-image oc-px-m oc-py-m"}))]),ye.showShareIndicators&&T.value&&!p(f).disabled?(X(),de("div",HL,[D.value?(X(),Ae(oe,{key:0,appearance:"raw","aria-label":$.value,"no-hover":"",onClick:ae},{default:Se(()=>[he(ce,{name:"group",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):Ce("",!0),N.value?(X(),Ae(oe,{key:1,appearance:"raw","aria-label":A.value,"no-hover":"",onClick:ae},{default:Se(()=>[he(ce,{name:"link",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):Ce("",!0),fe("p",{textContent:W.toDisplayString(I.value)},null,8,GL),he(oe,{appearance:"raw","aria-label":_.value,size:"small","no-hover":"",onClick:ae},{default:Se(()=>[fe("span",{class:"oc-text-small",textContent:W.toDisplayString(p(i)("Show"))},null,8,KL)]),_:1},8,["aria-label"])])):Ce("",!0),fe("dl",{class:"details-list oc-m-rm","aria-label":p(i)("Overview of the information about the selected space")},[fe("dt",null,W.toDisplayString(p(i)("Last activity")),1),fe("dd",null,W.toDisplayString(S.value),1),p(f).description?(X(),de(qe,{key:0},[fe("dt",null,W.toDisplayString(p(i)("Subtitle")),1),fe("dd",null,W.toDisplayString(p(f).description),1)],64)):Ce("",!0),fe("dt",null,W.toDisplayString(p(i)("Manager")),1),fe("dd",null,W.toDisplayString(h.value),1),p(f).disabled?Ce("",!0):(X(),de(qe,{key:1},[fe("dt",null,W.toDisplayString(p(i)("Quota")),1),fe("dd",null,[he(z0,{"space-quota":p(f).spaceQuota},null,8,["space-quota"])])],64)),g.value?(X(),de(qe,{key:2},[fe("dt",null,W.toDisplayString(p(i)("Size")),1),fe("dd",null,W.toDisplayString(v.value),1)],64)):Ce("",!0),b.value?(X(),Ae(W0,{key:3,space:p(f)},null,8,["space"])):Ce("",!0),he(J,{name:"app.files.sidebar.space.details.table","slot-props":{space:p(f),resource:p(f)},multiple:!0},null,8,["slot-props"])],8,QL)])}}}),[["__scopeId","data-v-73f2b09b"]]),YL={id:"oc-spaces-details-multiple-sidebar"},JL={class:"spaces-preview oc-mb-l"},ZL={class:"spaces-preview-body"},e2=["textContent"],t2=ze(Ne({__name:"SpaceDetailsMultiple",props:{selectedSpaces:{}},setup(e){const t=Fe.useGettext(),{$gettext:n,$ngettext:r}=t,o=B(()=>{let f=0;return e.selectedSpaces.forEach(m=>{f+=m.spaceQuota.total}),Tn(f,t.current)}),i=B(()=>{let f=0;return e.selectedSpaces.forEach(m=>{m.disabled||(f+=m.spaceQuota.remaining)}),Tn(f,t.current)}),s=B(()=>{let f=0;return e.selectedSpaces.forEach(m=>{m.disabled||(f+=m.spaceQuota.used)}),Tn(f,t.current)}),a=B(()=>e.selectedSpaces.filter(f=>!f.disabled).length),c=B(()=>e.selectedSpaces.filter(f=>f.disabled).length),u=B(()=>n("Overview of the information about the selected spaces")),l=B(()=>r("%{ itemCount } space selected","%{ itemCount } spaces selected",e.selectedSpaces.length,{itemCount:e.selectedSpaces.length.toString()})),d=B(()=>[{term:n("Total quota:"),definition:p(o).toString()},{term:n("Remaining quota:"),definition:p(i).toString()},{term:n("Used quota:"),definition:p(s).toString()},{term:n("Enabled:"),definition:p(a).toString()},{term:n("Disabled:"),definition:p(c).toString()}]);return(f,m)=>{const w=pe("oc-icon"),y=pe("oc-definition-list");return X(),de("div",YL,[fe("div",JL,[fe("div",ZL,[he(w,{class:"preview-icon",size:"xxlarge",name:"layout-grid"}),fe("p",{class:"preview-text",textContent:W.toDisplayString(l.value)},null,8,e2)])]),he(y,{"aria-label":u.value,items:d.value},null,8,["aria-label","items"])])}}}),[["__scopeId","data-v-11ad741e"]]),n2=Ne({name:"SpaceNoSelection"}),r2={class:"oc-mt-xl"},i2={class:"oc-flex space-info oc-text-center"};function o2(e,t,n,r,o,i){const s=pe("oc-icon"),a=ln("translate");return X(),de("div",r2,[fe("div",i2,[he(s,{name:"layout-grid",size:"xxlarge"}),ot((X(),de("p",null,t[0]||(t[0]=[Ot("Select a space to view details")]))),[[a]])])])}const s2=ze(n2,[["render",o2]]),a2=Ne({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 Bt(()=>{t=Ke.subscribe("sidebar.entity.saved",()=>{e.value=!0})}),Vn(()=>{Ke.unsubscribe("sidebar.entity.saved",t)}),{saved:e}},computed:{unsavedChanges(){return!gb(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}}}),l2={class:"compare-save-dialog oc-width-1-1 oc-flex oc-flex-between oc-flex-middle"},c2={key:0,class:"state-indicator oc-flex oc-flex-middle"},u2=["textContent"],f2={key:1,class:"state-indicator"},d2=["textContent"],p2=["textContent"];function h2(e,t,n,r,o,i){const s=pe("oc-icon"),a=pe("oc-button");return X(),de("div",l2,[e.saved?(X(),de("span",c2,[he(s,{name:"checkbox-circle"}),fe("span",{class:"oc-ml-s",textContent:W.toDisplayString(e.$gettext("Changes saved"))},null,8,u2)])):(X(),de("span",f2,W.toDisplayString(e.unsavedChangesText),1)),fe("div",null,[he(a,{disabled:!e.unsavedChanges,class:"compare-save-dialog-revert-btn",onClick:t[0]||(t[0]=c=>e.$emit("revert"))},{default:Se(()=>[fe("span",{textContent:W.toDisplayString(e.$gettext("Revert"))},null,8,d2)]),_:1},8,["disabled"]),he(a,{appearance:"filled",class:"compare-save-dialog-confirm-btn",disabled:!e.unsavedChanges||e.confirmButtonDisabled,onClick:t[1]||(t[1]=c=>e.$emit("confirm"))},{default:Se(()=>[fe("span",{textContent:W.toDisplayString(e.$gettext("Save"))},null,8,p2)]),_:1},8,["disabled"])])])}const g2=ze(a2,[["render",h2],["__scopeId","data-v-471483fe"]]),m2=pS(async()=>(await Promise.resolve().then(()=>cM)).default),y2=Ne({name:"CustomComponentTarget",props:{extensionPoint:{type:Object,required:!0}},setup(e){const t=Bi(),n=Bb(),r=B(()=>t.requestExtensions(e.extensionPoint)),o=n.extractDefaultExtensionIds(e.extensionPoint,p(r));return{extensions:B(()=>{if(e.extensionPoint.multiple||p(r).length<=1)return p(r);const s=n.getExtensionPreference(e.extensionPoint.id,o);return s.selectedExtensionIds.length?[p(r).find(a=>s.selectedExtensionIds.includes(a.id))||p(r)[0]]:[p(r)[0]]})}}});function b2(e,t,n,r,o,i){return X(!0),de(qe,null,wt(e.extensions,s=>(X(),Ae(Nr(s.content),{key:`custom-component-${s.id}`}))),128)}const v2=ze(y2,[["render",b2]]),w2=Ne({name:"ItemFilter",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0},optionFilterLabel:{type:String,required:!1,default:""},showOptionFilter:{type:Boolean,required:!1,default:!1},items:{type:Array,required:!0},allowMultiple:{type:Boolean,required:!1,default:!1},idAttribute:{type:String,required:!1,default:"id"},displayNameAttribute:{type:String,required:!1,default:"name"},filterableAttributes:{type:Array,required:!1,default:()=>[]},closeOnClick:{type:Boolean,default:!1}},emits:["selectionChange"],setup:function(e,{emit:t,expose:n}){const r=We(),o=Kt(),i=le(),s=le([]),a=le(e.items),c=le(null),u=le(null),l=`q_${e.filterName}`,d=an(l),f=T=>T[e.idAttribute],m=()=>r.push({query:{...Mi(p(o).query,[l]),...!!p(s).length&&{[l]:p(s).reduce((T,I)=>(T+=`${f(I)}+`,T),"").slice(0,-1)}}}),w=T=>!!p(s).find(I=>f(I)===f(T)),y=async T=>{w(T)?s.value=p(s).filter(I=>f(I)!==f(T)):(e.allowMultiple||(s.value=[]),s.value.push(T)),await m(),t("selectionChange",p(s))},E=le(),b=(T,I)=>{if(!(I||"").trim())return T;const A=new dd(T,{...pl,keys:e.filterableAttributes}).search(I).map($=>$.item);return T.filter($=>A.includes($))},g=()=>{s.value=[],t("selectionChange",p(s)),m()},v=T=>{a.value=T},h=async()=>{var T;v(e.items),await _n(),(T=p(i))==null||T.focus()};St(E,()=>{v(b(e.items,p(E))),p(u)&&(c.value=new hd(p(u)),p(c).unmark(),p(c).mark(p(E),{element:"span",className:"mark-highlight"}))});const S=()=>{const T=Rt(p(d));if(T){const I=T.split("+");s.value=e.items.filter(_=>I.includes(f(_)))}};return n({setSelectedItemsBasedOnQuery:S}),Bt(()=>{S()}),{clearFilter:g,displayedItems:a,filterInputRef:i,filterTerm:E,isItemSelected:w,itemFilterListRef:u,queryParam:l,selectedItems:s,setDisplayedItems:v,showDrop:h,toggleItemSelection:y,setSelectedItemsBasedOnQuery:S}}}),S2={ref:"itemFilterListRef"},E2={class:"oc-flex oc-flex-middle oc-text-truncate"},T2={class:"oc-text-truncate oc-ml-s"},A2={class:"oc-flex"};function R2(e,t,n,r,o,i){const s=pe("oc-text-input"),a=pe("oc-checkbox"),c=pe("oc-icon"),u=pe("oc-button"),l=pe("oc-list"),d=pe("oc-filter-chip");return X(),de("div",{class:W.normalizeClass(["item-filter oc-flex",`item-filter-${e.filterName}`])},[he(d,{"filter-label":e.filterLabel,"selected-item-names":e.selectedItems.map(f=>f[e.displayNameAttribute]),"close-on-click":e.closeOnClick,onClearFilter:e.clearFilter,onShowDrop:e.showDrop},{default:Se(()=>[e.showOptionFilter&&e.filterableAttributes.length?(X(),Ae(s,{key:0,ref:"filterInputRef",modelValue:e.filterTerm,"onUpdate:modelValue":t[0]||(t[0]=f=>e.filterTerm=f),class:"item-filter-input oc-mb-m oc-mt-s",autocomplete:"off",label:e.optionFilterLabel===""?e.$gettext("Filter list"):e.optionFilterLabel},null,8,["modelValue","label"])):Ce("",!0),fe("div",S2,[he(l,{class:"item-filter-list"},{default:Se(()=>[(X(!0),de(qe,null,wt(e.displayedItems,(f,m)=>(X(),de("li",{key:m,class:"oc-my-xs"},[he(u,{class:W.normalizeClass(["item-filter-list-item oc-flex oc-flex-middle oc-width-1-1 oc-p-s",{"item-filter-list-item-active":!e.allowMultiple&&e.isItemSelected(f),"oc-flex-left":e.allowMultiple,"oc-flex-between":!e.allowMultiple}]),"justify-content":"space-between",appearance:"raw","data-test-value":f[e.displayNameAttribute],onClick:w=>e.toggleItemSelection(f)},{default:Se(()=>[fe("div",E2,[e.allowMultiple?(X(),Ae(a,{key:0,size:"large",class:"item-filter-checkbox oc-mr-s",label:e.$gettext("Toggle selection"),"model-value":e.isItemSelected(f),"label-hidden":!0,"onUpdate:modelValue":w=>e.toggleItemSelection(f),onClick:t[1]||(t[1]=Cn(()=>{},["stop"]))},null,8,["label","model-value","onUpdate:modelValue"])):Ce("",!0),fe("div",null,[Xe(e.$slots,"image",{item:f})]),fe("div",T2,[Xe(e.$slots,"item",{item:f})])]),fe("div",A2,[!e.allowMultiple&&e.isItemSelected(f)?(X(),Ae(c,{key:0,name:"check"})):Ce("",!0)])]),_:2},1032,["class","data-test-value","onClick"])]))),128))]),_:3})],512)]),_:3},8,["filter-label","selected-item-names","close-on-click","onClearFilter","onShowDrop"])],2)}const _2=ze(w2,[["render",R2]]),I2=Ne({name:"ItemFilterToggle",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=We(),r=Kt(),o=le(!1),i=`q_${e.filterName}`,s=an(i),a=()=>n.push({query:{...Mi(p(r).query,[i]),...p(o)&&{[i]:"true"}}}),c=async()=>{o.value=!p(o),await a(),t("toggleFilter",p(o))};return Bt(()=>{Rt(p(s))==="true"&&(o.value=!0)}),{queryParam:i,filterActive:o,toggleFilter:c}}});function C2(e,t,n,r,o,i){const s=pe("oc-filter-chip");return X(),de("div",{class:W.normalizeClass(["item-filter oc-flex",`item-filter-${e.filterName}`])},[he(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 P2=ze(I2,[["render",C2]]),F2=Ne({name:"LoadingIndicator",setup(){const e=fn();let t,n,r;const o=le(e.isLoading),i=le(e.currentProgress),s=()=>{i.value=e.currentProgress,o.value=e.isLoading},a=()=>{i.value=e.currentProgress};return Bt(()=>{t=Ke.subscribe(Lr.add,s),n=Ke.subscribe(Lr.remove,s),r=Ke.subscribe(Lr.setProgress,a)}),Vn(()=>{Ke.unsubscribe(Lr.add,t),Ke.unsubscribe(Lr.remove,n),Ke.unsubscribe(Lr.setProgress,r)}),{isLoading:o,currentProgress:i}}}),O2={key:0,id:"oc-loading-indicator",class:"oc-width-1-1"};function k2(e,t,n,r,o,i){const s=pe("oc-progress");return e.isLoading?(X(),de("div",O2,[he(s,{max:100,indeterminate:e.currentProgress===null,value:e.currentProgress,size:"small"},null,8,["indeterminate","value"])])):Ce("",!0)}const x2=ze(F2,[["render",k2]]),N2={class:"no-content-message oc-flex oc-flex-column oc-flex-center oc-flex-middle oc-text-center"},$2={class:"oc-text-muted oc-text-xlarge"},D2={class:"oc-text-muted"},L2=Ne({__name:"NoContentMessage",props:{icon:{},iconFillType:{default:"fill"}},setup(e){return(t,n)=>{const r=pe("oc-icon");return X(),de("div",N2,[he(r,{name:t.icon,type:"div",size:"xxlarge","fill-type":t.iconFillType,class:"oc-mb-m"},null,8,["name","fill-type"]),fe("div",$2,[Xe(t.$slots,"message")]),fe("div",D2,[Xe(t.$slots,"callToAction")])])}}}),M2=Ne({props:{pages:{type:Number,required:!0},currentPage:{type:Number,required:!0}},watch:{currentPage:{handler:function(){var e;(e=document.getElementsByClassName("files-view-wrapper")[0])==null||e.scrollTo(0,0)}}}});function B2(e,t,n,r,o,i){const s=pe("oc-pagination");return e.pages>1?(X(),Ae(s,{key:0,pages:e.pages,"current-page":e.currentPage,"max-displayed":3,"current-route":e.$route,class:"files-pagination oc-flex oc-flex-center oc-my-s"},null,8,["pages","current-page","current-route"])):Ce("",!0)}const j2=ze(M2,[["render",B2]]),U2=Ne({name:"SearchBarFilter",props:{currentFolderAvailable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=Fe.useGettext(),r=an("useScope"),o=le(),i=le(),s=B(()=>{var u;return n((u=o.value)==null?void 0:u.title)}),a=B(()=>[{id:Rr.currentFolder,title:n("Current folder"),enabled:e.currentFolderAvailable},{id:Rr.allFiles,title:n("All files"),enabled:!0}]);return St(()=>e.currentFolderAvailable,()=>{if(p(r)){if(p(r).toString()==="true"){o.value=p(a).find(({id:l})=>l===Rr.currentFolder);return}o.value=p(a).find(({id:l})=>l===Rr.allFiles);return}if(!e.currentFolderAvailable){o.value=p(a).find(({id:u})=>u===Rr.allFiles);return}if(p(i)){o.value=p(a).find(({id:u})=>u===p(i).id);return}o.value=p(a).find(({id:u})=>u===Rr.allFiles)},{immediate:!0}),{currentSelection:o,currentSelectionTitle:s,onOptionSelected:u=>{i.value=u,o.value=u,t("update:modelValue",{value:u})},locationOptions:a}}}),q2={key:0},V2={key:0,class:"oc-flex"};function z2(e,t,n,r,o,i){const s=pe("oc-icon"),a=pe("oc-button"),c=pe("oc-filter-chip");return X(),de("div",{class:"oc-location-search oc-position-small oc-position-center-right oc-mt-rm",onClick:t[0]||(t[0]=Cn(()=>{},["stop"]))},[e.currentSelection?(X(),de("div",q2,[he(c,{"is-toggle":!1,"is-toggle-active":!1,"filter-label":e.currentSelectionTitle,"selected-item-names":[],class:"oc-search-bar-filter",raw:"","close-on-click":""},{default:Se(()=>[(X(!0),de(qe,null,wt(e.locationOptions,(u,l)=>(X(),Ae(a,{key:l,appearance:"raw",size:"medium","justify-content":"space-between",class:W.normalizeClass(["search-bar-filter-item oc-flex oc-flex-middle oc-width-1-1 oc-py-xs oc-px-s",{"oc-secondary-container":u.id===e.currentSelection.id}]),disabled:!u.enabled,"data-test-id":u.id,onClick:d=>e.onOptionSelected(u)},{default:Se(()=>[fe("span",null,W.toDisplayString(u.title),1),u.id===e.currentSelection.id?(X(),de("div",V2,[he(s,{name:"check"})])):Ce("",!0)]),_:2},1032,["class","disabled","data-test-id","onClick"]))),128))]),_:1},8,["filter-label"])])):Ce("",!0)])}const W2=ze(U2,[["render",z2]]),H2=Ne({name:"PortalTarget",components:{PortalTargetVue:_a.PortalTarget},props:{..._a.PortalTarget.props},setup(e){const t=B(()=>e);return Bt(()=>{Ke.publish(ya.mounted,e)}),{properties:t}}});function G2(e,t,n,r,o,i){const s=pe("portal-target-vue");return X(),Ae(s,W.normalizeProps(rl(e.properties)),null,16)}const K2=ze(H2,[["render",G2]]),Q2=({sortBy:e,sortDir:t})=>({groupingSettings:B(()=>({groupingBy:localStorage.getItem("grouping-shared-with-me")||"Shared on",showGroupingOptions:!0,groupingFunctions:{"Name alphabetically":function(r){return localStorage.setItem("grouping-shared-with-me","Name alphabetically"),isNaN(Number(r.name.charAt(0)))?r.name.charAt(0)==="."?r.name.charAt(1).toLowerCase():r.name.charAt(0).toLowerCase():"#"},"Shared on":function(r){localStorage.setItem("grouping-shared-with-me","Shared on");const o=Date.now()-6048e5,i=Date.now()-2592e6;return Date.parse(r.sdate)<i?"Older":Date.parse(r.sdate)>=o?"Recently":"Last month"},"Share owner":function(r){var o;return localStorage.setItem("grouping-shared-with-me","Share owner"),(o=r==null?void 0:r.owner)==null?void 0:o.displayName},None:function(){localStorage.setItem("grouping-shared-with-me","None")}},sortGroups:{"Name alphabetically":function(r){const o=r.sort(function(i,s){return i.name<s.name?-1:i.name>s.name?1:0});return p(e)==="name"&&p(t)==="desc"&&o.reverse(),o},"Shared on":function(r){const o=[],i=["Recently","Last month","Older"];for(const s of i){const a=r.find(c=>c.name.toLowerCase()===s.toLowerCase());a&&o.push(a)}return p(e)==="sdate"&&p(t)==="asc"&&o.reverse(),o},"Share owner":function(r){const o=r.sort(function(i,s){return i.name<s.name?-1:i.name>s.name?1:0});return p(e)==="owner"&&p(t)==="desc"&&o.reverse(),o}}}))}),X2={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é"}},Y2={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"}},J2={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"}},Z2={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"}},eM={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"}},tM={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:"Автопрокрутка"}},nM={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:"同期スクロール"}},rM={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"}},iM={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"},oM={"fr-FR":X2,"de-DE":Y2,"it-IT":J2,"es-ES":Z2,"pl-PL":eM,ru:tM,"jp-JP":nM,"id-ID":rM},sM=Ne({name:"TextEditor",components:{MdEditor:Bo.MdEditor,MdPreview:Bo.MdPreview},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=Fe.useGettext(),{currentTheme:r}=ai(),o=B(()=>{const{showPreviewOnlyMd:c=!0}=e.applicationConfig;return{showPreviewOnlyMd:c}}),i=B(()=>{var c;return e.markdownMode||["md","markdown"].includes((c=e.resource)==null?void 0:c.extension)||!p(o).showPreviewOnlyMd}),s=B(()=>p(r).isDark?"dark":"light");return Bo.config({editorConfig:{languageUserDefined:oM},editorExtensions:{screenfull:{instance:ow},cropper:{instance:Ra}},markdownItPlugins(c){return[...c,{type:"xss",plugin:Bo.XSSPlugin,options:{}}]}}),{isMarkdown:i,theme:s,language:n,languages:iM,onUploadImg:async c=>{const l=(await Promise.all([...c].map(f=>new Promise((m,w)=>{const y=new FileReader;y.onload=()=>m(y.result),y.onerror=w,y.readAsDataURL(f)})))).map(f=>`![image](${f})`),d=`${p(e.currentContent)}
64
- ${l.join(`
63
+ */function N8(e){return e}const BD={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},jD=xe({name:"FocusTrap",props:Object.assign({active:{type:Boolean,default:!0}},BD),emits:["update:active","activate","postActivate","deactivate","postDeactivate"],render(){return this.renderImpl()},setup(e,{slots:t,emit:r}){let n;const i=le(null),o=B(()=>{const a=i.value;return a&&(a instanceof HTMLElement?a:a.$el)});function s(){return n||(n=MD(o.value,{escapeDeactivates:e.escapeDeactivates,allowOutsideClick:e.allowOutsideClick,returnFocusOnDeactivate:e.returnFocusOnDeactivate,clickOutsideDeactivates:e.clickOutsideDeactivates,onActivate:()=>{r("update:active",!0),r("activate")},onDeactivate:()=>{r("update:active",!1),r("deactivate")},onPostActivate:()=>r("postActivate"),onPostDeactivate:()=>r("postDeactivate"),initialFocus:e.initialFocus,fallbackFocus:e.fallbackFocus,tabbableOptions:e.tabbableOptions,delayInitialFocus:e.delayInitialFocus,preventScroll:e.preventScroll}))}return $t(()=>{dt(()=>e.active,a=>{a&&o.value?s().activate():n&&(n.deactivate(),(!o.value||o.value.nodeType===Node.COMMENT_NODE)&&(n=null))},{immediate:!0,flush:"post"})}),gl(()=>{n&&n.deactivate(),n=null}),{activate(){s().activate()},deactivate(){n&&n.deactivate()},renderImpl(){if(!t.default)return null;const a=t.default().filter(u=>u.type!==bi);return!a||!a.length||a.length>1?(console.error("[focus-trap-vue]: FocusTrap requires exactly one child."),a):wi(a[0],{ref:i})}}}}),La=xe({__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 r=t,n=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=>{r("click",s)};return(s,a)=>{const l=be("oc-spinner");return Q(),Ae(jr(s.type),jt(n.value,{"aria-label":s.ariaLabel,class:[[`oc-button-${h(Ct.kebabCase)(s.colorRole)}`,`oc-button-${s.appearance}`,`oc-button-${h(Ct.kebabCase)(s.colorRole)}-${s.appearance}`,{...h(Ck)(s.gapSize),...h(Ik)(s.justifyContent),"text-sm min-h-3":s.size==="small","text-base min-h-4":s.size==="medium","text-lg min-h-7":s.size==="large","no-hover":s.noHover}],"oc-button cursor-pointer disabled:opacity-60 disabled:cursor-default"]},vl(i.value)),{default:we(()=>[s.showSpinner?(Q(),Ae(l,{key:0,size:"small",class:"spinner"})):_e("",!0),je(s.$slots,"default")]),_:3},16,["aria-label","class"])}}}),UD=["src"],Ed=xe({__name:"OcCard",props:{tag:{default:"div"},title:{},titleTag:{default:"h2"},logoUrl:{default:""},headerClass:{default:""},bodyClass:{default:""},footerClass:{default:""}},setup(e){const t=qp(),r=B(()=>Object.hasOwn(t,"header")||!!h(e.title)||!!h(e.logoUrl)),n=B(()=>Object.hasOwn(t,"footer"));return(i,o)=>(Q(),Ae(jr(i.tag),{class:"oc-card"},{default:we(()=>[r.value?(Q(),ye("div",{key:0,class:W.normalizeClass(["oc-card-header",i.headerClass])},[je(i.$slots,"header",{},()=>[i.logoUrl?(Q(),ye("img",{key:0,src:i.logoUrl,alt:"","aria-hidden":!0,class:"max-w-48 max-h-48 absolute -translate-y-16"},null,8,UD)):_e("",!0),i.title?(Q(),Ae(jr(i.titleTag),{key:1,class:"mt-0"},{default:we(()=>[Pt(W.toDisplayString(i.title),1)]),_:1})):_e("",!0)])],2)):_e("",!0),fe("div",{class:W.normalizeClass(["oc-card-body",i.bodyClass])},[je(i.$slots,"default")],2),n.value?(Q(),ye("div",{key:1,class:W.normalizeClass(["oc-card-footer",i.footerClass])},[je(i.$slots,"footer")],2)):_e("",!0)]),_:3}))}}),qD=["id"],VD=["textContent"],zD=xe({__name:"OcBottomDrawer",props:{drawerId:{},toggle:{},closeOnClick:{type:Boolean,default:!1},title:{default:""},usePortal:{type:Boolean,default:!1},portalTarget:{default:"app.runtime.bottom.drawer"},isNestedElement:{type:Boolean,default:!1},nestedParentRef:{default:null}},emits:["show","hide"],setup(e,{expose:t,emit:r}){const n=r,{$gettext:i}=Fe.useGettext(),o=le(!1),s=Wn("bottomDrawerRef"),a=Wn("bottomDrawerCardBodyRef"),l=async()=>{e.isNestedElement&&h(e.nestedParentRef).getElement().classList.add("hidden"),o.value=!0,n("show"),await ar(),h(a).addEventListener("click",d),document.getElementById(e.drawerId)?.classList.add("active")},u=()=>{c({hideParent:!1}),h(e.nestedParentRef).getElement().classList.remove("hidden")},c=async({hideParent:w=!0}={})=>{e.isNestedElement&&w&&h(e.nestedParentRef).hide(),h(a)?.removeEventListener("click",d),document.getElementById(e.drawerId)?.classList.remove("active"),await new Promise(E=>setTimeout(E,150)),o.value=!1,n("hide")},d=w=>{const v=w.target.closest("a[href], button");if(v){if(v.hasAttribute("aria-expanded")){v.setAttribute("aria-expanded","true");return}e.closeOnClick&&(e.isNestedElement&&h(e.nestedParentRef).hide(),c())}},f=w=>{w.target===w.currentTarget&&c()};return ln.onKeyStroke("Escape",w=>{w.preventDefault(),c()}),$t(()=>{h(e.toggle)&&document.querySelector(e.toggle).addEventListener("click",l)}),mr(()=>{document.querySelector(e.toggle).removeEventListener("click",l)}),t({show:l,hide:c,getElement:()=>h(s)}),(w,v)=>{const E=be("oc-icon");return o.value?(Q(),Ae(jr(w.usePortal?"portal":"div"),{key:0,to:w.usePortal?w.portalTarget:void 0},{default:we(()=>[o.value?(Q(),ye("div",{key:0,ref_key:"bottomDrawerRef",ref:s,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:f},[ge(h(jD),null,{default:we(()=>[fe("div",{id:w.drawerId,tabindex:"0",class:"oc-bottom-drawer fixed inset-x-0 bg-role-surface-container-high rounded-t-sm w-full max-h-[66vh] overflow-y-auto bottom-[-100%] transition-all duration-200 [&.active]:bottom-0"},[ge(Ed,{class:"bg-transparent","header-class":"flex flex-row justify-between items-center"},{header:we(()=>[w.isNestedElement?(Q(),Ae(La,{key:0,appearance:"raw",class:"raw-hover-surface oc-bottom-drawer-back-button","aria-label":h(i)("Open the parent context menu"),onClick:u},{default:we(()=>[ge(E,{name:"arrow-left","fill-type":"line"})]),_:1},8,["aria-label"])):_e("",!0),fe("span",{class:"font-semibold",textContent:W.toDisplayString(w.title)},null,8,VD),ge(La,{appearance:"raw",class:"raw-hover-surface oc-bottom-drawer-close-button","aria-label":h(i)("Close the context menu"),onClick:v[0]||(v[0]=b=>c())},{default:we(()=>[ge(E,{name:"close","fill-type":"line"})]),_:1},8,["aria-label"])]),default:we(()=>[fe("div",{ref_key:"bottomDrawerCardBodyRef",ref:a},[je(w.$slots,"default")],512)]),_:3})],8,qD)]),_:3})],512)):_e("",!0)]),_:3},8,["to"])):_e("",!0)}}});var wr="top",$r="bottom",Lr="right",Sr="left",Td="auto",jo=[wr,$r,Lr,Sr],Bi="start",Uo="end",WD="clippingParents",sw="viewport",qo="popper",HD="reference",aw=jo.reduce(function(e,t){return e.concat([t+"-"+Bi,t+"-"+Uo])},[]),lw=[].concat(jo,[Td]).reduce(function(e,t){return e.concat([t,t+"-"+Bi,t+"-"+Uo])},[]),GD="beforeRead",KD="read",QD="afterRead",XD="beforeMain",YD="main",JD="afterMain",ZD="beforeWrite",e$="write",t$="afterWrite",r$=[GD,KD,QD,XD,YD,JD,ZD,e$,t$];function on(e){return e?(e.nodeName||"").toLowerCase():null}function Cr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function ci(e){var t=Cr(e).Element;return e instanceof t||e instanceof Element}function Mr(e){var t=Cr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Ad(e){if(typeof ShadowRoot>"u")return!1;var t=Cr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function n$(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},i=t.attributes[r]||{},o=t.elements[r];!Mr(o)||!on(o)||(Object.assign(o.style,n),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function i$(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var i=t.elements[n],o=t.attributes[n]||{},s=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),a=s.reduce(function(l,u){return l[u]="",l},{});!Mr(i)||!on(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const cw={name:"applyStyles",enabled:!0,phase:"write",fn:n$,effect:i$,requires:["computeStyles"]};function sn(e){return e.split("-")[0]}var ui=Math.max,Ma=Math.min,ji=Math.round;function Rd(){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 uw(){return!/^((?!chrome|android).)*safari/i.test(Rd())}function Ui(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),i=1,o=1;t&&Mr(e)&&(i=e.offsetWidth>0&&ji(n.width)/e.offsetWidth||1,o=e.offsetHeight>0&&ji(n.height)/e.offsetHeight||1);var s=ci(e)?Cr(e):window,a=s.visualViewport,l=!uw()&&r,u=(n.left+(l&&a?a.offsetLeft:0))/i,c=(n.top+(l&&a?a.offsetTop:0))/o,d=n.width/i,f=n.height/o;return{width:d,height:f,top:c,right:u+d,bottom:c+f,left:u,x:u,y:c}}function Cd(e){var t=Ui(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function fw(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&Ad(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Cn(e){return Cr(e).getComputedStyle(e)}function o$(e){return["table","td","th"].indexOf(on(e))>=0}function Mn(e){return((ci(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ba(e){return on(e)==="html"?e:e.assignedSlot||e.parentNode||(Ad(e)?e.host:null)||Mn(e)}function dw(e){return!Mr(e)||Cn(e).position==="fixed"?null:e.offsetParent}function s$(e){var t=/firefox/i.test(Rd()),r=/Trident/i.test(Rd());if(r&&Mr(e)){var n=Cn(e);if(n.position==="fixed")return null}var i=Ba(e);for(Ad(i)&&(i=i.host);Mr(i)&&["html","body"].indexOf(on(i))<0;){var o=Cn(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 Vo(e){for(var t=Cr(e),r=dw(e);r&&o$(r)&&Cn(r).position==="static";)r=dw(r);return r&&(on(r)==="html"||on(r)==="body"&&Cn(r).position==="static")?t:r||s$(e)||t}function Id(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function zo(e,t,r){return ui(e,Ma(t,r))}function a$(e,t,r){var n=zo(e,t,r);return n>r?r:n}function pw(){return{top:0,right:0,bottom:0,left:0}}function hw(e){return Object.assign({},pw(),e)}function mw(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var l$=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,hw(typeof t!="number"?t:mw(t,jo))};function c$(e){var t,r=e.state,n=e.name,i=e.options,o=r.elements.arrow,s=r.modifiersData.popperOffsets,a=sn(r.placement),l=Id(a),u=[Sr,Lr].indexOf(a)>=0,c=u?"height":"width";if(!(!o||!s)){var d=l$(i.padding,r),f=Cd(o),m=l==="y"?wr:Sr,w=l==="y"?$r:Lr,v=r.rects.reference[c]+r.rects.reference[l]-s[l]-r.rects.popper[c],E=s[l]-r.rects.reference[l],b=Vo(o),g=b?l==="y"?b.clientHeight||0:b.clientWidth||0:0,y=v/2-E/2,p=d[m],S=g-f[c]-d[w],T=g/2-f[c]/2+y,R=zo(p,T,S),I=l;r.modifiersData[n]=(t={},t[I]=R,t.centerOffset=R-T,t)}}function u$(e){var t=e.state,r=e.options,n=r.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||fw(t.elements.popper,i)&&(t.elements.arrow=i))}const f$={name:"arrow",enabled:!0,phase:"main",fn:c$,effect:u$,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qi(e){return e.split("-")[1]}var d$={top:"auto",right:"auto",bottom:"auto",left:"auto"};function p$(e,t){var r=e.x,n=e.y,i=t.devicePixelRatio||1;return{x:ji(r*i)/i||0,y:ji(n*i)/i||0}}function gw(e){var t,r=e.popper,n=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,f=s.x,m=f===void 0?0:f,w=s.y,v=w===void 0?0:w,E=typeof c=="function"?c({x:m,y:v}):{x:m,y:v};m=E.x,v=E.y;var b=s.hasOwnProperty("x"),g=s.hasOwnProperty("y"),y=Sr,p=wr,S=window;if(u){var T=Vo(r),R="clientHeight",I="clientWidth";if(T===Cr(r)&&(T=Mn(r),Cn(T).position!=="static"&&a==="absolute"&&(R="scrollHeight",I="scrollWidth")),T=T,i===wr||(i===Sr||i===Lr)&&o===Uo){p=$r;var A=d&&T===S&&S.visualViewport?S.visualViewport.height:T[R];v-=A-n.height,v*=l?1:-1}if(i===Sr||(i===wr||i===$r)&&o===Uo){y=Lr;var D=d&&T===S&&S.visualViewport?S.visualViewport.width:T[I];m-=D-n.width,m*=l?1:-1}}var H=Object.assign({position:a},u&&d$),_=c===!0?p$({x:m,y:v},Cr(r)):{x:m,y:v};if(m=_.x,v=_.y,l){var x;return Object.assign({},H,(x={},x[p]=g?"0":"",x[y]=b?"0":"",x.transform=(S.devicePixelRatio||1)<=1?"translate("+m+"px, "+v+"px)":"translate3d("+m+"px, "+v+"px, 0)",x))}return Object.assign({},H,(t={},t[p]=g?v+"px":"",t[y]=b?m+"px":"",t.transform="",t))}function h$(e){var t=e.state,r=e.options,n=r.gpuAcceleration,i=n===void 0?!0:n,o=r.adaptive,s=o===void 0?!0:o,a=r.roundOffsets,l=a===void 0?!0:a,u={placement:sn(t.placement),variation:qi(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,gw(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,gw(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 m$={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:h$,data:{}};var ja={passive:!0};function g$(e){var t=e.state,r=e.instance,n=e.options,i=n.scroll,o=i===void 0?!0:i,s=n.resize,a=s===void 0?!0:s,l=Cr(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",r.update,ja)}),a&&l.addEventListener("resize",r.update,ja),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",r.update,ja)}),a&&l.removeEventListener("resize",r.update,ja)}}const y$={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:g$,data:{}};var v$={left:"right",right:"left",bottom:"top",top:"bottom"};function Ua(e){return e.replace(/left|right|bottom|top/g,function(t){return v$[t]})}var b$={start:"end",end:"start"};function yw(e){return e.replace(/start|end/g,function(t){return b$[t]})}function _d(e){var t=Cr(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function Od(e){return Ui(Mn(e)).left+_d(e).scrollLeft}function w$(e,t){var r=Cr(e),n=Mn(e),i=r.visualViewport,o=n.clientWidth,s=n.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var u=uw();(u||!u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+Od(e),y:l}}function S$(e){var t,r=Mn(e),n=_d(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=ui(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=ui(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-n.scrollLeft+Od(e),l=-n.scrollTop;return Cn(i||r).direction==="rtl"&&(a+=ui(r.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function Pd(e){var t=Cn(e),r=t.overflow,n=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function vw(e){return["html","body","#document"].indexOf(on(e))>=0?e.ownerDocument.body:Mr(e)&&Pd(e)?e:vw(Ba(e))}function Wo(e,t){var r;t===void 0&&(t=[]);var n=vw(e),i=n===((r=e.ownerDocument)==null?void 0:r.body),o=Cr(n),s=i?[o].concat(o.visualViewport||[],Pd(n)?n:[]):n,a=t.concat(s);return i?a:a.concat(Wo(Ba(s)))}function kd(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function E$(e,t){var r=Ui(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function bw(e,t,r){return t===sw?kd(w$(e,r)):ci(t)?E$(t,r):kd(S$(Mn(e)))}function T$(e){var t=Wo(Ba(e)),r=["absolute","fixed"].indexOf(Cn(e).position)>=0,n=r&&Mr(e)?Vo(e):e;return ci(n)?t.filter(function(i){return ci(i)&&fw(i,n)&&on(i)!=="body"}):[]}function A$(e,t,r,n){var i=t==="clippingParents"?T$(e):[].concat(t),o=[].concat(i,[r]),s=o[0],a=o.reduce(function(l,u){var c=bw(e,u,n);return l.top=ui(c.top,l.top),l.right=Ma(c.right,l.right),l.bottom=Ma(c.bottom,l.bottom),l.left=ui(c.left,l.left),l},bw(e,s,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ww(e){var t=e.reference,r=e.element,n=e.placement,i=n?sn(n):null,o=n?qi(n):null,s=t.x+t.width/2-r.width/2,a=t.y+t.height/2-r.height/2,l;switch(i){case wr:l={x:s,y:t.y-r.height};break;case $r:l={x:s,y:t.y+t.height};break;case Lr:l={x:t.x+t.width,y:a};break;case Sr:l={x:t.x-r.width,y:a};break;default:l={x:t.x,y:t.y}}var u=i?Id(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case Bi:l[u]=l[u]-(t[c]/2-r[c]/2);break;case Uo:l[u]=l[u]+(t[c]/2-r[c]/2);break}}return l}function Vi(e,t){t===void 0&&(t={});var r=t,n=r.placement,i=n===void 0?e.placement:n,o=r.strategy,s=o===void 0?e.strategy:o,a=r.boundary,l=a===void 0?WD:a,u=r.rootBoundary,c=u===void 0?sw:u,d=r.elementContext,f=d===void 0?qo:d,m=r.altBoundary,w=m===void 0?!1:m,v=r.padding,E=v===void 0?0:v,b=hw(typeof E!="number"?E:mw(E,jo)),g=f===qo?HD:qo,y=e.rects.popper,p=e.elements[w?g:f],S=A$(ci(p)?p:p.contextElement||Mn(e.elements.popper),l,c,s),T=Ui(e.elements.reference),R=ww({reference:T,element:y,placement:i}),I=kd(Object.assign({},y,R)),A=f===qo?I:T,D={top:S.top-A.top+b.top,bottom:A.bottom-S.bottom+b.bottom,left:S.left-A.left+b.left,right:A.right-S.right+b.right},H=e.modifiersData.offset;if(f===qo&&H){var _=H[i];Object.keys(D).forEach(function(x){var z=[Lr,$r].indexOf(x)>=0?1:-1,G=[wr,$r].indexOf(x)>=0?"y":"x";D[x]+=_[G]*z})}return D}function R$(e,t){t===void 0&&(t={});var r=t,n=r.placement,i=r.boundary,o=r.rootBoundary,s=r.padding,a=r.flipVariations,l=r.allowedAutoPlacements,u=l===void 0?lw:l,c=qi(n),d=c?a?aw:aw.filter(function(w){return qi(w)===c}):jo,f=d.filter(function(w){return u.indexOf(w)>=0});f.length===0&&(f=d);var m=f.reduce(function(w,v){return w[v]=Vi(e,{placement:v,boundary:i,rootBoundary:o,padding:s})[sn(v)],w},{});return Object.keys(m).sort(function(w,v){return m[w]-m[v]})}function C$(e){if(sn(e)===Td)return[];var t=Ua(e);return[yw(e),t,yw(t)]}function I$(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var i=r.mainAxis,o=i===void 0?!0:i,s=r.altAxis,a=s===void 0?!0:s,l=r.fallbackPlacements,u=r.padding,c=r.boundary,d=r.rootBoundary,f=r.altBoundary,m=r.flipVariations,w=m===void 0?!0:m,v=r.allowedAutoPlacements,E=t.options.placement,b=sn(E),g=b===E,y=l||(g||!w?[Ua(E)]:C$(E)),p=[E].concat(y).reduce(function(ae,Ce){return ae.concat(sn(Ce)===Td?R$(t,{placement:Ce,boundary:c,rootBoundary:d,padding:u,flipVariations:w,allowedAutoPlacements:v}):Ce)},[]),S=t.rects.reference,T=t.rects.popper,R=new Map,I=!0,A=p[0],D=0;D<p.length;D++){var H=p[D],_=sn(H),x=qi(H)===Bi,z=[wr,$r].indexOf(_)>=0,G=z?"width":"height",ne=Vi(t,{placement:H,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),ie=z?x?Lr:Sr:x?$r:wr;S[G]>T[G]&&(ie=Ua(ie));var ee=Ua(ie),ue=[];if(o&&ue.push(ne[_]<=0),a&&ue.push(ne[ie]<=0,ne[ee]<=0),ue.every(function(ae){return ae})){A=H,I=!1;break}R.set(H,ue)}if(I)for(var de=w?3:1,ce=function(Ce){var Z=p.find(function(N){var O=R.get(N);if(O)return O.slice(0,Ce).every(function(K){return K})});if(Z)return A=Z,"break"},X=de;X>0;X--){var oe=ce(X);if(oe==="break")break}t.placement!==A&&(t.modifiersData[n]._skip=!0,t.placement=A,t.reset=!0)}}const _$={name:"flip",enabled:!0,phase:"main",fn:I$,requiresIfExists:["offset"],data:{_skip:!1}};function Sw(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function Ew(e){return[wr,Lr,$r,Sr].some(function(t){return e[t]>=0})}function O$(e){var t=e.state,r=e.name,n=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=Vi(t,{elementContext:"reference"}),a=Vi(t,{altBoundary:!0}),l=Sw(s,n),u=Sw(a,i,o),c=Ew(l),d=Ew(u);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const P$={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:O$};function k$(e,t,r){var n=sn(e),i=[Sr,wr].indexOf(n)>=0?-1:1,o=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[Sr,Lr].indexOf(n)>=0?{x:a,y:s}:{x:s,y:a}}function F$(e){var t=e.state,r=e.options,n=e.name,i=r.offset,o=i===void 0?[0,0]:i,s=lw.reduce(function(c,d){return c[d]=k$(d,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[n]=s}const x$={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:F$};function N$(e){var t=e.state,r=e.name;t.modifiersData[r]=ww({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const D$={name:"popperOffsets",enabled:!0,phase:"read",fn:N$,data:{}};function $$(e){return e==="x"?"y":"x"}function L$(e){var t=e.state,r=e.options,n=e.name,i=r.mainAxis,o=i===void 0?!0:i,s=r.altAxis,a=s===void 0?!1:s,l=r.boundary,u=r.rootBoundary,c=r.altBoundary,d=r.padding,f=r.tether,m=f===void 0?!0:f,w=r.tetherOffset,v=w===void 0?0:w,E=Vi(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),b=sn(t.placement),g=qi(t.placement),y=!g,p=Id(b),S=$$(p),T=t.modifiersData.popperOffsets,R=t.rects.reference,I=t.rects.popper,A=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,D=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),H=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,_={x:0,y:0};if(T){if(o){var x,z=p==="y"?wr:Sr,G=p==="y"?$r:Lr,ne=p==="y"?"height":"width",ie=T[p],ee=ie+E[z],ue=ie-E[G],de=m?-I[ne]/2:0,ce=g===Bi?R[ne]:I[ne],X=g===Bi?-I[ne]:-R[ne],oe=t.elements.arrow,ae=m&&oe?Cd(oe):{width:0,height:0},Ce=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:pw(),Z=Ce[z],N=Ce[G],O=zo(0,R[ne],ae[ne]),K=y?R[ne]/2-de-O-Z-D.mainAxis:ce-O-Z-D.mainAxis,V=y?-R[ne]/2+de+O+N+D.mainAxis:X+O+N+D.mainAxis,$=t.elements.arrow&&Vo(t.elements.arrow),U=$?p==="y"?$.clientTop||0:$.clientLeft||0:0,pe=(x=H?.[p])!=null?x:0,Re=ie+K-pe-U,De=ie+V-pe,ke=zo(m?Ma(ee,Re):ee,ie,m?ui(ue,De):ue);T[p]=ke,_[p]=ke-ie}if(a){var Oe,Be=p==="x"?wr:Sr,Se=p==="x"?$r:Lr,Ye=T[S],Qe=S==="y"?"height":"width",he=Ye+E[Be],Pe=Ye-E[Se],We=[wr,Sr].indexOf(b)!==-1,Xe=(Oe=H?.[S])!=null?Oe:0,at=We?he:Ye-R[Qe]-I[Qe]-Xe+D.altAxis,_t=We?Ye+R[Qe]+I[Qe]-Xe-D.altAxis:Pe,wt=m&&We?a$(at,Ye,_t):zo(m?at:he,Ye,m?_t:Pe);T[S]=wt,_[S]=wt-Ye}t.modifiersData[n]=_}}const M$={name:"preventOverflow",enabled:!0,phase:"main",fn:L$,requiresIfExists:["offset"]};function B$(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function j$(e){return e===Cr(e)||!Mr(e)?_d(e):B$(e)}function U$(e){var t=e.getBoundingClientRect(),r=ji(t.width)/e.offsetWidth||1,n=ji(t.height)/e.offsetHeight||1;return r!==1||n!==1}function q$(e,t,r){r===void 0&&(r=!1);var n=Mr(t),i=Mr(t)&&U$(t),o=Mn(t),s=Ui(e,i,r),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!r)&&((on(t)!=="body"||Pd(o))&&(a=j$(t)),Mr(t)?(l=Ui(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=Od(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function V$(e){var t=new Map,r=new Set,n=[];e.forEach(function(o){t.set(o.name,o)});function i(o){r.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!r.has(a)){var l=t.get(a);l&&i(l)}}),n.push(o)}return e.forEach(function(o){r.has(o.name)||i(o)}),n}function z$(e){var t=V$(e);return r$.reduce(function(r,n){return r.concat(t.filter(function(i){return i.phase===n}))},[])}function W$(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function H$(e){var t=e.reduce(function(r,n){var i=r[n.name];return r[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var Tw={placement:"bottom",modifiers:[],strategy:"absolute"};function Aw(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function G$(e){e===void 0&&(e={});var t=e,r=t.defaultModifiers,n=r===void 0?[]:r,i=t.defaultOptions,o=i===void 0?Tw:i;return function(a,l,u){u===void 0&&(u=o);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Tw,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},d=[],f=!1,m={state:c,setOptions:function(b){var g=typeof b=="function"?b(c.options):b;v(),c.options=Object.assign({},o,c.options,g),c.scrollParents={reference:ci(a)?Wo(a):a.contextElement?Wo(a.contextElement):[],popper:Wo(l)};var y=z$(H$([].concat(n,c.options.modifiers)));return c.orderedModifiers=y.filter(function(p){return p.enabled}),w(),m.update()},forceUpdate:function(){if(!f){var b=c.elements,g=b.reference,y=b.popper;if(Aw(g,y)){c.rects={reference:q$(g,Vo(y),c.options.strategy==="fixed"),popper:Cd(y)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(D){return c.modifiersData[D.name]=Object.assign({},D.data)});for(var p=0;p<c.orderedModifiers.length;p++){if(c.reset===!0){c.reset=!1,p=-1;continue}var S=c.orderedModifiers[p],T=S.fn,R=S.options,I=R===void 0?{}:R,A=S.name;typeof T=="function"&&(c=T({state:c,options:I,name:A,instance:m})||c)}}}},update:W$(function(){return new Promise(function(E){m.forceUpdate(),E(c)})}),destroy:function(){v(),f=!0}};if(!Aw(a,l))return m;m.setOptions(u).then(function(E){!f&&u.onFirstUpdate&&u.onFirstUpdate(E)});function w(){c.orderedModifiers.forEach(function(E){var b=E.name,g=E.options,y=g===void 0?{}:g,p=E.effect;if(typeof p=="function"){var S=p({state:c,name:b,instance:m,options:y}),T=function(){};d.push(S||T)}})}function v(){d.forEach(function(E){return E()}),d=[]}return m}}var K$=[y$,D$,m$,cw,x$,_$,M$,f$,P$],Q$=G$({defaultModifiers:K$}),X$="tippy-box",Rw="tippy-content",Y$="tippy-backdrop",Cw="tippy-arrow",Iw="tippy-svg-arrow",fi={passive:!0,capture:!0},_w=function(){return document.body};function J$(e,t){return{}.hasOwnProperty.call(e,t)}function Fd(e,t,r){if(Array.isArray(e)){var n=e[t];return n??(Array.isArray(r)?r[t]:r)}return e}function xd(e,t){var r={}.toString.call(e);return r.indexOf("[object")===0&&r.indexOf(t+"]")>-1}function Ow(e,t){return typeof e=="function"?e.apply(void 0,t):e}function Pw(e,t){if(t===0)return e;var r;return function(n){clearTimeout(r),r=setTimeout(function(){e(n)},t)}}function Z$(e,t){var r=Object.assign({},e);return t.forEach(function(n){delete r[n]}),r}function eL(e){return e.split(/\s+/).filter(Boolean)}function zi(e){return[].concat(e)}function kw(e,t){e.indexOf(t)===-1&&e.push(t)}function tL(e){return e.filter(function(t,r){return e.indexOf(t)===r})}function rL(e){return e.split("-")[0]}function qa(e){return[].slice.call(e)}function Fw(e){return Object.keys(e).reduce(function(t,r){return e[r]!==void 0&&(t[r]=e[r]),t},{})}function Ho(){return document.createElement("div")}function Go(e){return["Element","Fragment"].some(function(t){return xd(e,t)})}function nL(e){return xd(e,"NodeList")}function iL(e){return xd(e,"MouseEvent")}function xw(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function oL(e){return Go(e)?[e]:nL(e)?qa(e):Array.isArray(e)?e:qa(document.querySelectorAll(e))}function Nd(e,t){e.forEach(function(r){r&&(r.style.transitionDuration=t+"ms")})}function Nw(e,t){e.forEach(function(r){r&&r.setAttribute("data-state",t)})}function sL(e){var t,r=zi(e),n=r[0];return n!=null&&(t=n.ownerDocument)!=null&&t.body?n.ownerDocument:document}function aL(e,t){var r=t.clientX,n=t.clientY;return e.every(function(i){var o=i.popperRect,s=i.popperState,a=i.props,l=a.interactiveBorder,u=rL(s.placement),c=s.modifiersData.offset;if(!c)return!0;var d=u==="bottom"?c.top.y:0,f=u==="top"?c.bottom.y:0,m=u==="right"?c.left.x:0,w=u==="left"?c.right.x:0,v=o.top-n+d>l,E=n-o.bottom-f>l,b=o.left-r+m>l,g=r-o.right-w>l;return v||E||b||g})}function Dd(e,t,r){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[n](i,r)})}function Dw(e,t){for(var r=t;r;){var n;if(e.contains(r))return!0;r=r.getRootNode==null||(n=r.getRootNode())==null?void 0:n.host}return!1}var an={isTouch:!1},$w=0;function lL(){an.isTouch||(an.isTouch=!0,window.performance&&document.addEventListener("mousemove",Lw))}function Lw(){var e=performance.now();e-$w<20&&(an.isTouch=!1,document.removeEventListener("mousemove",Lw)),$w=e}function cL(){var e=document.activeElement;if(xw(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function uL(){document.addEventListener("touchstart",lL,fi),window.addEventListener("blur",cL)}var fL=typeof window<"u"&&typeof document<"u",dL=fL?!!window.msCrypto:!1;function Wi(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 Mw(e){var t=/[ \t]{2,}/g,r=/^[ \t]*/gm;return e.replace(t," ").replace(r,"").trim()}function pL(e){return Mw(`
64
+ %ctippy.js
65
+
66
+ %c`+Mw(e)+`
67
+
68
+ %c👷‍ This is a development-only message. It will be removed in production.
69
+ `)}function Bw(e){return[pL(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var Ko;ve.env.NODE_ENV!=="production"&&hL();function hL(){Ko=new Set}function In(e,t){if(e&&!Ko.has(t)){var r;Ko.add(t),(r=console).warn.apply(r,Bw(t))}}function $d(e,t){if(e&&!Ko.has(t)){var r;Ko.add(t),(r=console).error.apply(r,Bw(t))}}function mL(e){var t=!e,r=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;$d(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),$d(r,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var jw={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},gL={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ir=Object.assign({appendTo:_w,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},jw,gL),yL=Object.keys(Ir),vL=function(t){ve.env.NODE_ENV!=="production"&&Vw(t,[]);var r=Object.keys(t);r.forEach(function(n){Ir[n]=t[n]})};function Uw(e){var t=e.plugins||[],r=t.reduce(function(n,i){var o=i.name,s=i.defaultValue;if(o){var a;n[o]=e[o]!==void 0?e[o]:(a=Ir[o])!=null?a:s}return n},{});return Object.assign({},e,r)}function bL(e,t){var r=t?Object.keys(Uw(Object.assign({},Ir,{plugins:t}))):yL,n=r.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 n}function qw(e,t){var r=Object.assign({},t,{content:Ow(t.content,[e])},t.ignoreAttributes?{}:bL(e,t.plugins));return r.aria=Object.assign({},Ir.aria,r.aria),r.aria={expanded:r.aria.expanded==="auto"?t.interactive:r.aria.expanded,content:r.aria.content==="auto"?t.interactive?null:"describedby":r.aria.content},r}function Vw(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var r=Object.keys(e);r.forEach(function(n){var i=Z$(Ir,Object.keys(jw)),o=!J$(i,n);o&&(o=t.filter(function(s){return s.name===n}).length===0),In(o,["`"+n+"`","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.",`
70
+
71
+ `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
72
+ `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var wL=function(){return"innerHTML"};function Ld(e,t){e[wL()]=t}function zw(e){var t=Ho();return e===!0?t.className=Cw:(t.className=Iw,Go(e)?t.appendChild(e):Ld(t,e)),t}function Ww(e,t){Go(t.content)?(Ld(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?Ld(e,t.content):e.textContent=t.content)}function Md(e){var t=e.firstElementChild,r=qa(t.children);return{box:t,content:r.find(function(n){return n.classList.contains(Rw)}),arrow:r.find(function(n){return n.classList.contains(Cw)||n.classList.contains(Iw)}),backdrop:r.find(function(n){return n.classList.contains(Y$)})}}function Hw(e){var t=Ho(),r=Ho();r.className=X$,r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var n=Ho();n.className=Rw,n.setAttribute("data-state","hidden"),Ww(n,e.props),t.appendChild(r),r.appendChild(n),i(e.props,e.props);function i(o,s){var a=Md(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)&&Ww(u,e.props),s.arrow?c?o.arrow!==s.arrow&&(l.removeChild(c),l.appendChild(zw(s.arrow))):l.appendChild(zw(s.arrow)):c&&l.removeChild(c)}return{popper:t,onUpdate:i}}Hw.$$tippy=!0;var SL=1,Va=[],za=[];function EL(e,t){var r=qw(e,Object.assign({},Ir,Uw(Fw(t)))),n,i,o,s=!1,a=!1,l=!1,u=!1,c,d,f,m=[],w=Pw(Re,r.interactiveDebounce),v,E=SL++,b=null,g=tL(r.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},p={id:E,reference:e,popper:Ho(),popperInstance:b,props:r,state:y,plugins:g,clearDelayTimeouts:at,setProps:_t,setContent:wt,show:Qt,hide:L,hideWithInteractivity:C,enable:We,disable:Xe,unmount:k,destroy:Y};if(!r.render)return ve.env.NODE_ENV!=="production"&&$d(!0,"render() function has not been supplied."),p;var S=r.render(p),T=S.popper,R=S.onUpdate;T.setAttribute("data-tippy-root",""),T.id="tippy-"+p.id,p.popper=T,e._tippy=p,T._tippy=p;var I=g.map(function(q){return q.fn(p)}),A=e.hasAttribute("aria-expanded");return $(),de(),ie(),ee("onCreate",[p]),r.showOnCreate&&he(),T.addEventListener("mouseenter",function(){p.props.interactive&&p.state.isVisible&&p.clearDelayTimeouts()}),T.addEventListener("mouseleave",function(){p.props.interactive&&p.props.trigger.indexOf("mouseenter")>=0&&z().addEventListener("mousemove",w)}),p;function D(){var q=p.props.touch;return Array.isArray(q)?q:[q,0]}function H(){return D()[0]==="hold"}function _(){var q;return!!((q=p.props.render)!=null&&q.$$tippy)}function x(){return v||e}function z(){var q=x().parentNode;return q?sL(q):document}function G(){return Md(T)}function ne(q){return p.state.isMounted&&!p.state.isVisible||an.isTouch||c&&c.type==="focus"?0:Fd(p.props.delay,q?0:1,Ir.delay)}function ie(q){q===void 0&&(q=!1),T.style.pointerEvents=p.props.interactive&&!q?"":"none",T.style.zIndex=""+p.props.zIndex}function ee(q,re,me){if(me===void 0&&(me=!0),I.forEach(function(Le){Le[q]&&Le[q].apply(Le,re)}),me){var Ne;(Ne=p.props)[q].apply(Ne,re)}}function ue(){var q=p.props.aria;if(q.content){var re="aria-"+q.content,me=T.id,Ne=zi(p.props.triggerTarget||e);Ne.forEach(function(Le){var Je=Le.getAttribute(re);if(p.state.isVisible)Le.setAttribute(re,Je?Je+" "+me:me);else{var et=Je&&Je.replace(me,"").trim();et?Le.setAttribute(re,et):Le.removeAttribute(re)}})}}function de(){if(!(A||!p.props.aria.expanded)){var q=zi(p.props.triggerTarget||e);q.forEach(function(re){p.props.interactive?re.setAttribute("aria-expanded",p.state.isVisible&&re===x()?"true":"false"):re.removeAttribute("aria-expanded")})}}function ce(){z().removeEventListener("mousemove",w),Va=Va.filter(function(q){return q!==w})}function X(q){if(!(an.isTouch&&(l||q.type==="mousedown"))){var re=q.composedPath&&q.composedPath()[0]||q.target;if(!(p.props.interactive&&Dw(T,re))){if(zi(p.props.triggerTarget||e).some(function(me){return Dw(me,re)})){if(an.isTouch||p.state.isVisible&&p.props.trigger.indexOf("click")>=0)return}else ee("onClickOutside",[p,q]);p.props.hideOnClick===!0&&(p.clearDelayTimeouts(),p.hide(),a=!0,setTimeout(function(){a=!1}),p.state.isMounted||Z())}}}function oe(){l=!0}function ae(){l=!1}function Ce(){var q=z();q.addEventListener("mousedown",X,!0),q.addEventListener("touchend",X,fi),q.addEventListener("touchstart",ae,fi),q.addEventListener("touchmove",oe,fi)}function Z(){var q=z();q.removeEventListener("mousedown",X,!0),q.removeEventListener("touchend",X,fi),q.removeEventListener("touchstart",ae,fi),q.removeEventListener("touchmove",oe,fi)}function N(q,re){K(q,function(){!p.state.isVisible&&T.parentNode&&T.parentNode.contains(T)&&re()})}function O(q,re){K(q,re)}function K(q,re){var me=G().box;function Ne(Le){Le.target===me&&(Dd(me,"remove",Ne),re())}if(q===0)return re();Dd(me,"remove",d),Dd(me,"add",Ne),d=Ne}function V(q,re,me){me===void 0&&(me=!1);var Ne=zi(p.props.triggerTarget||e);Ne.forEach(function(Le){Le.addEventListener(q,re,me),m.push({node:Le,eventType:q,handler:re,options:me})})}function $(){H()&&(V("touchstart",pe,{passive:!0}),V("touchend",De,{passive:!0})),eL(p.props.trigger).forEach(function(q){if(q!=="manual")switch(V(q,pe),q){case"mouseenter":V("mouseleave",De);break;case"focus":V(dL?"focusout":"blur",ke);break;case"focusin":V("focusout",ke);break}})}function U(){m.forEach(function(q){var re=q.node,me=q.eventType,Ne=q.handler,Le=q.options;re.removeEventListener(me,Ne,Le)}),m=[]}function pe(q){var re,me=!1;if(!(!p.state.isEnabled||Oe(q)||a)){var Ne=((re=c)==null?void 0:re.type)==="focus";c=q,v=q.currentTarget,de(),!p.state.isVisible&&iL(q)&&Va.forEach(function(Le){return Le(q)}),q.type==="click"&&(p.props.trigger.indexOf("mouseenter")<0||s)&&p.props.hideOnClick!==!1&&p.state.isVisible?me=!0:he(q),q.type==="click"&&(s=!me),me&&!Ne&&Pe(q)}}function Re(q){var re=q.target,me=x().contains(re)||T.contains(re);if(!(q.type==="mousemove"&&me)){var Ne=Qe().concat(T).map(function(Le){var Je,et=Le._tippy,tt=(Je=et.popperInstance)==null?void 0:Je.state;return tt?{popperRect:Le.getBoundingClientRect(),popperState:tt,props:r}:null}).filter(Boolean);aL(Ne,q)&&(ce(),Pe(q))}}function De(q){var re=Oe(q)||p.props.trigger.indexOf("click")>=0&&s;if(!re){if(p.props.interactive){p.hideWithInteractivity(q);return}Pe(q)}}function ke(q){p.props.trigger.indexOf("focusin")<0&&q.target!==x()||p.props.interactive&&q.relatedTarget&&T.contains(q.relatedTarget)||Pe(q)}function Oe(q){return an.isTouch?H()!==q.type.indexOf("touch")>=0:!1}function Be(){Se();var q=p.props,re=q.popperOptions,me=q.placement,Ne=q.offset,Le=q.getReferenceClientRect,Je=q.moveTransition,et=_()?Md(T).arrow:null,tt=Le?{getBoundingClientRect:Le,contextElement:Le.contextElement||x()}:e,_n={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Ze){var it=Ze.state;if(_()){var Er=G(),j=Er.box;["placement","reference-hidden","escaped"].forEach(function(P){P==="placement"?j.setAttribute("data-placement",it.placement):it.attributes.popper["data-popper-"+P]?j.setAttribute("data-"+P,""):j.removeAttribute("data-"+P)}),it.attributes.popper={}}}},qt=[{name:"offset",options:{offset:Ne}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Je}},_n];_()&&et&&qt.push({name:"arrow",options:{element:et,padding:3}}),qt.push.apply(qt,re?.modifiers||[]),p.popperInstance=Q$(tt,T,Object.assign({},re,{placement:me,onFirstUpdate:f,modifiers:qt}))}function Se(){p.popperInstance&&(p.popperInstance.destroy(),p.popperInstance=null)}function Ye(){var q=p.props.appendTo,re,me=x();p.props.interactive&&q===_w||q==="parent"?re=me.parentNode:re=Ow(q,[me]),re.contains(T)||re.appendChild(T),p.state.isMounted=!0,Be(),ve.env.NODE_ENV!=="production"&&In(p.props.interactive&&q===Ir.appendTo&&me.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.",`
73
+
74
+ `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
75
+
76
+ `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
77
+
78
+ `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Qe(){return qa(T.querySelectorAll("[data-tippy-root]"))}function he(q){p.clearDelayTimeouts(),q&&ee("onTrigger",[p,q]),Ce();var re=ne(!0),me=D(),Ne=me[0],Le=me[1];an.isTouch&&Ne==="hold"&&Le&&(re=Le),re?n=setTimeout(function(){p.show()},re):p.show()}function Pe(q){if(p.clearDelayTimeouts(),ee("onUntrigger",[p,q]),!p.state.isVisible){Z();return}if(!(p.props.trigger.indexOf("mouseenter")>=0&&p.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(q.type)>=0&&s)){var re=ne(!1);re?i=setTimeout(function(){p.state.isVisible&&p.hide()},re):o=requestAnimationFrame(function(){p.hide()})}}function We(){p.state.isEnabled=!0}function Xe(){p.hide(),p.state.isEnabled=!1}function at(){clearTimeout(n),clearTimeout(i),cancelAnimationFrame(o)}function _t(q){if(ve.env.NODE_ENV!=="production"&&In(p.state.isDestroyed,Wi("setProps")),!p.state.isDestroyed){ee("onBeforeUpdate",[p,q]),U();var re=p.props,me=qw(e,Object.assign({},re,Fw(q),{ignoreAttributes:!0}));p.props=me,$(),re.interactiveDebounce!==me.interactiveDebounce&&(ce(),w=Pw(Re,me.interactiveDebounce)),re.triggerTarget&&!me.triggerTarget?zi(re.triggerTarget).forEach(function(Ne){Ne.removeAttribute("aria-expanded")}):me.triggerTarget&&e.removeAttribute("aria-expanded"),de(),ie(),R&&R(re,me),p.popperInstance&&(Be(),Qe().forEach(function(Ne){requestAnimationFrame(Ne._tippy.popperInstance.forceUpdate)})),ee("onAfterUpdate",[p,q])}}function wt(q){p.setProps({content:q})}function Qt(){ve.env.NODE_ENV!=="production"&&In(p.state.isDestroyed,Wi("show"));var q=p.state.isVisible,re=p.state.isDestroyed,me=!p.state.isEnabled,Ne=an.isTouch&&!p.props.touch,Le=Fd(p.props.duration,0,Ir.duration);if(!(q||re||me||Ne)&&!x().hasAttribute("disabled")&&(ee("onShow",[p],!1),p.props.onShow(p)!==!1)){if(p.state.isVisible=!0,_()&&(T.style.visibility="visible"),ie(),Ce(),p.state.isMounted||(T.style.transition="none"),_()){var Je=G(),et=Je.box,tt=Je.content;Nd([et,tt],0)}f=function(){var qt;if(!(!p.state.isVisible||u)){if(u=!0,T.offsetHeight,T.style.transition=p.props.moveTransition,_()&&p.props.animation){var $e=G(),Ze=$e.box,it=$e.content;Nd([Ze,it],Le),Nw([Ze,it],"visible")}ue(),de(),kw(za,p),(qt=p.popperInstance)==null||qt.forceUpdate(),ee("onMount",[p]),p.props.animation&&_()&&O(Le,function(){p.state.isShown=!0,ee("onShown",[p])})}},Ye()}}function L(){ve.env.NODE_ENV!=="production"&&In(p.state.isDestroyed,Wi("hide"));var q=!p.state.isVisible,re=p.state.isDestroyed,me=!p.state.isEnabled,Ne=Fd(p.props.duration,1,Ir.duration);if(!(q||re||me)&&(ee("onHide",[p],!1),p.props.onHide(p)!==!1)){if(p.state.isVisible=!1,p.state.isShown=!1,u=!1,s=!1,_()&&(T.style.visibility="hidden"),ce(),Z(),ie(!0),_()){var Le=G(),Je=Le.box,et=Le.content;p.props.animation&&(Nd([Je,et],Ne),Nw([Je,et],"hidden"))}ue(),de(),p.props.animation?_()&&N(Ne,p.unmount):p.unmount()}}function C(q){ve.env.NODE_ENV!=="production"&&In(p.state.isDestroyed,Wi("hideWithInteractivity")),z().addEventListener("mousemove",w),kw(Va,w),w(q)}function k(){ve.env.NODE_ENV!=="production"&&In(p.state.isDestroyed,Wi("unmount")),p.state.isVisible&&p.hide(),p.state.isMounted&&(Se(),Qe().forEach(function(q){q._tippy.unmount()}),T.parentNode&&T.parentNode.removeChild(T),za=za.filter(function(q){return q!==p}),p.state.isMounted=!1,ee("onHidden",[p]))}function Y(){ve.env.NODE_ENV!=="production"&&In(p.state.isDestroyed,Wi("destroy")),!p.state.isDestroyed&&(p.clearDelayTimeouts(),p.unmount(),U(),delete e._tippy,p.state.isDestroyed=!0,ee("onDestroy",[p]))}}function Qo(e,t){t===void 0&&(t={});var r=Ir.plugins.concat(t.plugins||[]);ve.env.NODE_ENV!=="production"&&(mL(e),Vw(t,r)),uL();var n=Object.assign({},t,{plugins:r}),i=oL(e);if(ve.env.NODE_ENV!=="production"){var o=Go(n.content),s=i.length>1;In(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.",`
79
+
80
+ `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
81
+
82
+ `,`1) content: element.innerHTML
83
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var a=i.reduce(function(l,u){var c=u&&EL(u,n);return c&&l.push(c),l},[]);return Go(e)?a[0]:a}Qo.defaultProps=Ir,Qo.setDefaultProps=vL,Qo.currentInput=an;var TL=function(t){var r=t===void 0?{}:t,n=r.exclude,i=r.duration;za.forEach(function(o){var s=!1;if(n&&(s=xw(n)?o.reference===n:o.popper===n.popper),!s){var a=o.props.duration;o.setProps({duration:i}),o.hide(),o.state.isDestroyed||o.setProps({duration:a})}})};Object.assign({},cw,{effect:function(t){var r=t.state,n={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(r.elements.popper.style,n.popper),r.styles=n,r.elements.arrow&&Object.assign(r.elements.arrow.style,n.arrow)}}),Qo.setDefaultProps({render:Hw});const AL={name:"hideOnEsc",defaultValue:!0,fn({hide:e}){const t=r=>{r.code==="Escape"&&e()};return{onShow:()=>{document.addEventListener("keydown",t)},onHide:()=>{document.removeEventListener("keydown",t)}}}},Bd=e=>{if(e)try{e.destroy()}catch{}},Gw=({target:e,mode:t="show",rootMargin:r="100px",onVisibleCallback:n})=>{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,h(o)&&n&&n(),t!=="showHide"&&o.value&&s.unobserve(e.value)},{rootMargin:r});return dt(e,()=>{s.observe(e.value)}),mr(()=>s.disconnect()),{isVisible:o}},Kw=()=>{const{width:e}=ln.useWindowSize();return{isMobile:B(()=>e.value<640)}},RL=["id"],CL=xe({__name:"OcDrop",props:{title:{default:""},closeOnClick:{type:Boolean,default:!1},dropId:{default:()=>Po("oc-drop-")},isNestedElement:{type:Boolean,default:!1},nestedParentRef:{default:null},mode:{default:"click"},offset:{},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:r}){const n=r,{isMobile:i}=Kw(),o=B(()=>h(i)&&!e.enforceDropOnMobile),s=Wn("bottomDrawerRef"),a=le(null),l=le(null),u=E=>{if(h(o)){h(s).show();return}h(l)?.show(E)},c=E=>{if(h(o)){h(s).hide();return}h(l)?.hide(E)};t({show:u,hide:c,getElement:()=>h(o)?h(s).getElement():h(a),tippy:l});const f=E=>{const b=E.target.closest(".oc-button")?.hasAttribute("aria-expanded");e.closeOnClick&&!b&&c()},m=E=>{const b=a.value?.closest(".tippy-box");E.relatedTarget&&!b?.contains(E.relatedTarget)&&c()};mr(()=>{a.value?.removeEventListener("focusout",m)});const w=B(()=>({hover:"mouseenter focus"})[e.mode]||e.mode);dt(()=>e.position,()=>{h(l)?.setProps({placement:e.position})}),dt(()=>e.mode,()=>{h(l)?.setProps({trigger:w.value})}),mr(()=>{Bd(h(l))});const v=()=>{Bd(h(l));const E=e.target?document.querySelector(e.target):e.toggle?document.querySelector(e.toggle):a.value?.previousElementSibling,b=a.value;if(!E||!b)return;const g={trigger:w.value,placement:e.position,arrow:!1,hideOnClick:!e.isNestedElement,interactive:!0,plugins:[AL],theme:"none",maxWidth:416,offset:e.offset??0,...!e.isNestedElement&&{onShow:y=>{n("showDrop"),TL({exclude:y})},onHide:()=>{n("hideDrop")}},popperOptions:{...e.popperOptions,modifiers:[...e.popperOptions?.modifiers?e.popperOptions.modifiers:[],{name:"fixVerticalPosition",enabled:!0,phase:"beforeWrite",requiresIfExists:["offset","preventOverflow","flip"],fn({state:y}){const p=Vi(y),S=y.modifiersData.fullHeight||y.elements.popper.offsetHeight,T=p.top*-1-10,R=T+S+p.bottom*-1,I=R-T,A=R-I;S>I&&S>A&&(y.styles.popper.top=`-${T}px`,y.modifiersData.fullHeight=S),S>R&&(y.styles.popper.maxHeight=`${R-10}px`,y.styles.popper.overflowY="auto",y.styles.popper.overflowX="hidden")}}]},content:b};e.target&&(g.triggerTarget=e.toggle?document.querySelector(e.toggle):a.value?.previousElementSibling),l.value=Qo(E,g),a.value?.addEventListener("focusout",m)};return dt(o,async()=>{if(await ar(),h(o)){h(l)&&Bd(h(l));return}v()},{immediate:!0}),(E,b)=>o.value?(Q(),Ae(zD,{key:0,ref_key:"bottomDrawerRef",ref:s,"drawer-id":E.dropId,toggle:E.toggle,"close-on-click":E.closeOnClick,title:E.title,"is-nested-element":E.isNestedElement,"nested-parent-ref":E.nestedParentRef,"use-portal":"",onShow:b[0]||(b[0]=g=>n("showDrop")),onHide:b[1]||(b[1]=g=>n("hideDrop"))},{default:we(()=>[je(E.$slots,"default")]),_:3},8,["drawer-id","toggle","close-on-click","title","is-nested-element","nested-parent-ref"])):(Q(),ye("div",{key:1,id:E.dropId,ref_key:"drop",ref:a,class:"oc-drop shadow-md/20 rounded-sm",onClick:f},[E.$slots.default?(Q(),Ae(Ed,{key:0,"body-class":[h(_k)(E.paddingSize)]},{default:we(()=>[je(E.$slots,"default")]),_:3},8,["body-class"])):je(E.$slots,"special",{key:1})],8,RL))}});var IL=Object.defineProperty,Qw=Object.getOwnPropertySymbols,_L=Object.prototype.hasOwnProperty,OL=Object.prototype.propertyIsEnumerable,Xw=(e,t,r)=>t in e?IL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,PL=(e,t)=>{for(var r in t||(t={}))_L.call(t,r)&&Xw(e,r,t[r]);if(Qw)for(var r of Qw(t))OL.call(t,r)&&Xw(e,r,t[r]);return e};const Yw=(e,t)=>{const r=e.__vccOpts||e;for(const[n,i]of t)r[n]=i;return r},kL={},FL={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},xL=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),NL=[xL];function DL(e,t){return Q(),ye("svg",FL,NL)}const $L=Yw(kL,[["render",DL]]),LL={},ML={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"},BL=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),jL=[BL];function UL(e,t){return Q(),ye("svg",ML,jL)}PL({},{Deselect:$L,OpenIndicator:Yw(LL,[["render",UL]])});const qL=["aria-label"],VL=xe({__name:"OcSpinner",props:{ariaLabel:{default:""},size:{default:"medium"}},setup(e){return(t,r)=>(Q(),ye("span",{class:W.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":t.size==="xsmall","size-4":t.size==="small","size-5":t.size==="medium","size-8":t.size==="large","size-10":t.size==="xlarge","size-12":t.size==="xxlarge","size-16":t.size==="xxxlarge"}]),"aria-label":t.ariaLabel,tabindex:"-1",role:"img"},null,10,qL))}}),zL={class:"oc-status-indicators flex"},WL=["id","textContent"],HL=xe({__name:"OcStatusIndicators",props:{resource:{},indicators:{},disableHandler:{type:Boolean,default:!1}},setup(e){const{$gettext:t}=Fe.useGettext(),r=le({}),n=o=>Object.hasOwn(o,"handler"),i=o=>o.accessibleDescription?(h(r)[o.id]||(h(r)[o.id]=Po("oc-indicator-description-")),h(r)[o.id]):null;return(o,s)=>{const a=lr("oc-tooltip");return Q(),ye("div",zL,[(Q(!0),ye(Ue,null,mt(o.indicators,(l,u)=>(Q(),ye(Ue,null,[n(l)&&!o.disableHandler?lt((Q(),Ae(La,{id:l.id,key:`${l.id}-handler`,class:W.normalizeClass(["oc-status-indicators-indicator",{"ml-1":u>0}]),"aria-label":h(t)(l.label),"aria-describedby":i(l),appearance:"raw","data-testid":l.id,"data-test-indicator-type":l.type,"data-test-indicator-resource-name":o.resource.name,"data-test-indicator-resource-path":o.resource.path,"no-hover":"",onClick:c=>l.handler?.(o.resource,c)},{default:we(()=>[ge(K0,{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,h(t)(l.label)]]):lt((Q(),Ae(K0,{id:l.id,key:l.id,tabindex:"-1",size:"small",class:W.normalizeClass(["oc-status-indicators-indicator",{"ml-1":u>0}]),name:l.icon,"fill-type":l.fillType,"accessible-label":h(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,h(t)(l.label)]]),i(l)?(Q(),ye("p",{id:i(l),key:i(l),class:"sr-only",textContent:W.toDisplayString(h(t)(l.accessibleDescription))},null,8,WL)):_e("",!0)],64))),256))])}}}),GL={class:"oc-thead border-b"},KL=xe({name:"OcTableHead",__name:"OcTableHead",setup(e){return(t,r)=>(Q(),ye("thead",GL,[je(t.$slots,"default")]))}}),QL=xe({name:"OcTableBody",__name:"OcTableBody",setup(e){return(t,r)=>(Q(),ye("tbody",null,[je(t.$slots,"default")]))}}),Jw=qe(xe({__name:"OcTableCell",props:{alignH:{default:"left"},alignV:{default:"middle"},type:{default:"td"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e,{emit:t}){const r=t;return(n,i)=>(Q(),Ae(jr(n.type),{class:W.normalizeClass(["oc-table-cell",{"break-all":n.wrap==="break","whitespace-nowrap":n.wrap==="nowrap","overflow-visible max-w-0":n.wrap==="truncate","text-left":n.alignH==="left","text-right":n.alignH==="right","text-center":n.alignH==="center","align-top":n.alignV==="top","align-middle":n.alignV==="middle","align-bottom":n.alignV==="bottom","w-px":n.width==="shrink","min-w-38":n.width==="expand"}]),onClick:i[0]||(i[0]=o=>r("click",o))},{default:we(()=>[je(n.$slots,"default",{},void 0,!0)]),_:3},8,["class"]))}}),[["__scopeId","data-v-dc7aa8e1"]]),Zw=xe({__name:"OcTableTd",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},setup(e){return(t,r)=>(Q(),Ae(Jw,{type:"td","align-h":t.alignH,"align-v":t.alignV,width:t.width,wrap:t.wrap,class:"oc-td"},{default:we(()=>[je(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),eS=qe(xe({__name:"OcTableTr",props:{lazy:{}},emits:["contextmenu","click","dragstart","drop","dragenter","dragleave","dragover","mouseleave","itemVisible"],setup(e,{emit:t}){const r=t,n=iE((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?Gw({...e.lazy,target:n,onVisibleCallback:()=>r("itemVisible")}):{isVisible:le(!0)},s=B(()=>!h(o));return e.lazy||r("itemVisible"),(a,l)=>(Q(),ye("tr",{ref_key:"observerTarget",ref:n,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?(Q(),Ae(Zw,{key:0,colspan:i.value},{default:we(()=>[...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"])):je(a.$slots,"default",{key:1},void 0,!0)],544))}}),[["__scopeId","data-v-7acab1b8"]]),XL=qe(xe({__name:"OcTableTh",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e){return(t,r)=>(Q(),Ae(Jw,{type:"th","align-h":t.alignH,"align-v":t.alignV,width:t.width,wrap:t.wrap,class:"oc-th aria-[sort]:cursor-pointer",onClick:r[0]||(r[0]=n=>t.$emit("click",n))},{default:we(()=>[je(t.$slots,"default",{},void 0,!0)]),_:3},8,["align-h","align-v","width","wrap"]))}}),[["__scopeId","data-v-d746eb11"]]),YL={key:0,class:"oc-table-thead-content inline-table align-middle"},JL=["textContent"],ZL={key:1},e2={key:0,class:"oc-table-thead-content inline-table align-middle"},t2=["textContent"],r2={key:1,class:"oc-table-footer border-t"},n2={class:"oc-table-footer-row h-10.5"},i2=["colspan"],tS="asc",jd="desc",o2=qe(xe({__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 r=t,n={EVENT_THEAD_CLICKED:vk,EVENT_TROW_CLICKED:bk,EVENT_TROW_MOUNTED:wk,EVENT_TROW_CONTEXTMENU:Sk},{$gettext:i}=Fe.useGettext(),o=_=>e.itemDomSelector?e.itemDomSelector(_):_[e.idKey],s=B(()=>{const _=["oc-table"];return e.hover&&_.push("oc-table-hover"),e.sticky&&_.push("oc-table-sticky"),_}),a=B(()=>e.fields.length),l=_=>{_.preventDefault()},u=(_,x)=>{r(Ek,_,x)},c=(_,x)=>{r(Ab,_,x)},d=(_,x,z)=>{r("dropRowStyling",_,x,z)},f=_=>_.type==="slot",m=_=>["callback","function"].indexOf(_.type)>=0,w=_=>Object.prototype.hasOwnProperty.call(_,"title")?_.title:_.name,v=()=>({class:s.value}),E=_=>{switch(e.paddingX){case"remove":return _==="right"?"pr-0":"pl-0";case"xsmall":return _==="right"?"pr-1":"pl-1";case"small":return _==="right"?"pr-2":"pl-2";case"medium":return _==="right"?"pr-4":"pl-4";case"large":return _==="right"?"pr-6":"pl-6";case"xlarge":return _==="right"?"pr-12":"pl-12";case"xxlarge":return _==="right"?"pr-24":"pl-24"}},b=(_,x)=>{const z=p(_);return z.class=`oc-table-header-cell oc-table-header-cell-${_.name}`,Object.prototype.hasOwnProperty.call(_,"thClass")&&(z.class+=` ${_.thClass}`),e.sticky&&(z.style=`top: ${e.headerPosition}px;`,z.class+=" z-10"),x===0&&(z.class+=` ${E("left")} `),x===e.fields.length-1&&(z.class+=` ${E("right")}`),A(z,_),z},g=(_,x)=>({...e.lazy&&{lazy:{colspan:a.value}},class:["oc-tbody-tr",`oc-tbody-tr-${o(_)||x}`,S(_)?"oc-table-highlighted":void 0,...T(_)?["oc-table-disabled","opacity-70","pointer-events-none","grayscale-60"]:[]].filter(Boolean)}),y=(_,x,z)=>{const G=p(_);return G.class=`oc-table-data-cell oc-table-data-cell-${_.name}`,Object.prototype.hasOwnProperty.call(_,"tdClass")&&(G.class+=` ${_.tdClass}`),Object.prototype.hasOwnProperty.call(_,"wrap")&&(G.wrap=_.wrap),x===0&&(G.class+=` ${E("left")} `),x===e.fields.length-1&&(G.class+=` ${E("right")}`),Object.prototype.hasOwnProperty.call(_,"accessibleLabelCallback")&&(G["aria-label"]=_.accessibleLabelCallback(z)),G},p=_=>({..._?.alignH&&{alignH:_.alignH},..._?.alignV&&{alignV:_.alignV},..._?.width&&{width:_.width},class:void 0,wrap:void 0,style:void 0}),S=_=>e.highlighted?Array.isArray(e.highlighted)?e.highlighted.indexOf(_[e.idKey])>-1:e.highlighted===_[e.idKey]:!1,T=_=>e.disabled.length?e.disabled.indexOf(_[e.idKey])>-1:!1,R=(_,x,z)=>{const G=[z[e.idKey],x+1].filter(Boolean);return f(_)?[...G,_.name].join("-"):m(_)?[...G,_.callback(z[_.name])].join("-"):[...G,z[_.name]].join("-")},I=_=>i("Sort by %{ name }",{name:_}),A=(_,x)=>{if(!D(x))return;let z="none";e.sortBy===x.name&&(z=e.sortDir===tS?"ascending":"descending"),_["aria-sort"]=z},D=({sortable:_})=>!!_,H=_=>{if(!D(_))return;let x=e.sortDir;e.sortBy===_.name&&e.sortDir!==void 0&&(x=e.sortDir===jd?tS:jd),(e.sortBy!==_.name||e.sortDir===void 0)&&(x=_.sortDir||jd),r("sort",{sortBy:_.name,sortDir:x})};return(_,x)=>{const z=be("oc-icon");return Q(),ye("table",jt(v(),{class:"has-item-context-menu"}),[_.hasHeader?(Q(),Ae(KL,{key:0},{default:we(()=>[ge(eS,{class:"oc-table-header-row h-10.5"},{default:we(()=>[(Q(!0),ye(Ue,null,mt(_.fields,(G,ne)=>(Q(),Ae(XL,jt({key:`oc-thead-${G.name}`},{ref_for:!0},b(G,ne)),{default:we(()=>[G.sortable?(Q(),Ae(La,{key:0,"aria-label":I(G.name),appearance:"raw","justify-content":"left",class:"oc-button-sort w-full hover:underline","gap-size":"small","no-hover":"",onClick:ie=>H(G)},{default:we(()=>[G.headerType==="slot"?(Q(),ye("span",YL,[je(_.$slots,G.name+"Header",{},void 0,!0)])):(Q(),ye("span",{key:1,class:"oc-table-thead-content inline-table align-middle header-text",textContent:W.toDisplayString(w(G))},null,8,JL)),ge(z,{name:_.sortDir==="asc"?"arrow-down":"arrow-up","fill-type":"line",class:W.normalizeClass([{"sr-only":_.sortBy!==G.name},"p-1 rounded-sm"]),size:"small"},null,8,["name","class"])]),_:2},1032,["aria-label","onClick"])):(Q(),ye("div",ZL,[G.headerType==="slot"?(Q(),ye("span",e2,[je(_.$slots,G.name+"Header",{},void 0,!0)])):(Q(),ye("span",{key:1,class:"oc-table-thead-content inline-table align-middle header-text",textContent:W.toDisplayString(w(G))},null,8,t2))]))]),_:2},1040))),128))]),_:3})]),_:3})):_e("",!0),ge(QL,{class:"has-item-context-menu"},{default:we(()=>[(Q(!0),ye(Ue,null,mt(_.data,(G,ne)=>(Q(),Ae(eS,jt({key:`oc-tbody-tr-${o(G)||ne}`,ref_for:!0,ref:`row-${ne}`},{ref_for:!0},g(G,ne),{"data-item-id":G[_.idKey],draggable:_.dragDrop,class:"border-t h-10.5",onClick:ie=>_.$emit(n.EVENT_TROW_CLICKED,[G,ie]),onContextmenu:ie=>_.$emit(n.EVENT_TROW_CONTEXTMENU,_.$refs[`row-${ne}`][0],ie,G),onVnodeMounted:ie=>_.$emit(n.EVENT_TROW_MOUNTED,G,_.$refs[`row-${ne}`][0]),onDragstart:ie=>u(G,ie),onDrop:ie=>c(o(G),ie),onDragenter:Vt(ie=>d(o(G),!1,ie),["prevent"]),onDragleave:Vt(ie=>d(o(G),!0,ie),["prevent"]),onMouseleave:ie=>d(o(G),!0,ie),onDragover:x[0]||(x[0]=ie=>l(ie)),onItemVisible:ie=>_.$emit("itemVisible",G)}),{default:we(()=>[(Q(!0),ye(Ue,null,mt(_.fields,(ie,ee)=>(Q(),Ae(Zw,jt({key:"oc-tbody-td-"+R(ie,ee,G)},{ref_for:!0},y(ie,ee,G)),{default:we(()=>[f(ie)?je(_.$slots,ie.name,{key:0,item:G},void 0,!0):m(ie)?(Q(),ye(Ue,{key:1},[Pt(W.toDisplayString(ie.callback(G[ie.name])),1)],64)):(Q(),ye(Ue,{key:2},[Pt(W.toDisplayString(G[ie.name]),1)],64))]),_:2},1040))),128))]),_:2},1040,["data-item-id","draggable","onClick","onContextmenu","onVnodeMounted","onDragstart","onDrop","onDragenter","onDragleave","onMouseleave","onItemVisible"]))),128))]),_:3}),_.$slots.footer?(Q(),ye("tfoot",r2,[fe("tr",n2,[fe("td",{colspan:a.value,class:"oc-table-footer-cell p-1 text-sm text-role-on-surface-variant"},[je(_.$slots,"footer",{},void 0,!0)],8,i2)])])):_e("",!0)],16)}}}),[["__scopeId","data-v-e7845e19"]]),s2={class:"context-menu px-2"},a2={class:"inline-flex gap-2"},l2={class:"flex oc-files-context-action-label"},c2=["textContent"],rS=xe({__name:"ActionMenuDropItem",props:{menuSectionDrop:{},appearance:{},actionOptions:{},parentDropRef:{default:null}},setup(e){const t=Po(`oc-files-context-actions-${e.menuSectionDrop.name}-drop-`),r=Po(`oc-files-context-actions-${e.menuSectionDrop.name}-toggle-`);return(n,i)=>{const o=be("oc-icon"),s=be("oc-button"),a=be("oc-list");return Q(),ye("li",s2,[ge(s,{id:h(r),appearance:"raw","justify-content":"space-between","gap-size":"medium",class:"w-full flex justify-between","aria-expanded":"false"},{default:we(()=>[fe("span",a2,[ge(o,{name:n.menuSectionDrop.icon,size:"medium","fill-type":"line"},null,8,["name"]),fe("span",l2,[fe("span",{textContent:W.toDisplayString(n.menuSectionDrop.label)},null,8,c2)])]),ge(o,{name:"arrow-right-s",size:"small","fill-type":"line"})]),_:1},8,["id"]),ge(h(CL),{title:n.menuSectionDrop.label,"drop-id":h(t),toggle:`#${h(r)}`,"is-nested-element":!0,"nested-parent-ref":n.parentDropRef,mode:"hover",class:"w-auto oc-files-context-action-drop","padding-size":"small",position:"auto-start","close-on-click":""},{default:we(()=>[n.menuSectionDrop.items.length?(Q(),Ae(a,{key:0},{default:we(()=>[(Q(!0),ye(Ue,null,mt(n.menuSectionDrop.items,(l,u)=>(Q(),Ae(ka,{key:`section-${n.menuSectionDrop.label}-action-${u}`,action:l,appearance:n.appearance,"action-options":n.actionOptions},null,8,["action","appearance","action-options"]))),128))]),_:1})):_e("",!0)]),_:1},8,["title","drop-id","toggle","nested-parent-ref"])])}}}),u2=xe({name:"ContextActionMenu",components:{ActionMenuDropItem:rS,ActionMenuItem:ka},props:{menuSections:{type:Array,required:!0},appearance:{type:String,default:"raw"},actionOptions:{type:Object,required:!0},dropRef:{type:Object,required:!1,default:null}},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}}}),f2={id:"oc-files-context-menu"};function d2(e,t,r,n,i,o){const s=be("action-menu-item"),a=be("action-menu-drop-item"),l=be("oc-list");return Q(),ye("div",f2,[(Q(!0),ye(Ue,null,mt(e.menuSections,(u,c)=>(Q(),Ae(l,{id:`oc-files-context-actions-${u.name}`,key:`section-${u.name}-list`,class:W.normalizeClass(["[&_li]:px-0",e.getSectionClasses(c)])},{default:we(()=>[u.items?(Q(!0),ye(Ue,{key:0},mt(u.items,(d,f)=>(Q(),Ae(s,{key:`section-${u.name}-action-${f}`,action:d,appearance:e.appearance,"action-options":e.actionOptions,class:"context-menu"},null,8,["action","appearance","action-options"]))),128)):_e("",!0),(Q(!0),ye(Ue,null,mt(u.dropItems,d=>(Q(),ye(Ue,null,[d.items.length?(Q(),Ae(a,{key:d.name,"menu-section-drop":d,appearance:e.appearance,"action-options":e.actionOptions,"parent-drop-ref":e.dropRef},null,8,["menu-section-drop","appearance","action-options","parent-drop-ref"])):_e("",!0)],64))),256))]),_:2},1032,["id","class"]))),128))])}const Ud=qe(u2,[["render",d2]]),p2=xe({name:"ContextActions",components:{ContextActionMenu:Ud},props:{actionOptions:{type:Object,required:!0},dropRef:{type:Object,required:!1,default:null}},setup(e){const{editorActions:t,defaultEditorActions:r}=Hr(),{$gettext:n}=Fe.useGettext(),{actions:i}=wa(),{actions:o}=Sa(),{actions:s}=Ea(),{actions:a}=id(),{actions:l}=Ta(),{actions:u}=xo(),{actions:c}=Aa(),{actions:d}=No(),{actions:f}=od(),{actions:m}=Ra(),{actions:w}=sd(),{actions:v}=p0(),{actions:E}=Ca(),{actions:b}=Ia(),{actions:g}=m0(),{actions:y}=ld(),{actions:p}=ud(),{actions:S}=cd(),T=Ni(),R=B(()=>T.requestExtensions({id:"global.files.context-actions",extensionType:"action"}).map(ee=>ee.action)),I=B(()=>T.requestExtensions({id:"global.files.batch-actions",extensionType:"action"}).map(ee=>ee.action)),A=aE(e,"actionOptions"),D=B(()=>[...h(i),...h(l),...h(c),...h(m),...h(s),...h(u),...h(b),...h(p),...h(I).filter(ee=>ee.category==="actions"||Ct.isNil(ee.category))].filter(ee=>ee.isVisible(h(A)))),H=B(()=>[...h(y),...h(I).filter(ee=>ee.category==="sidebar")].filter(ee=>ee.isVisible(h(A)))),_=B(()=>[...h(w),...h(r)].filter(ee=>ee.isVisible(h(A))).sort((ee,ue)=>Number(ue.hasPriority)-Number(ee.hasPriority))),x=B(()=>[...h(t),...h(R).filter(ee=>ee.category==="context")].filter(ee=>ee.isVisible(h(A))).sort((ee,ue)=>Number(ue.hasPriority)-Number(ee.hasPriority))),z=B(()=>[...h(S),...h(a),...h(R).filter(ee=>ee.category==="share")].filter(ee=>ee.isVisible(h(A)))),G=B(()=>[...h(c),...h(d),...h(u),...h(m),...h(s),...h(v),...h(E),...h(p),...h(b),...h(i),...h(l),...h(o),...h(g),...h(R).filter(ee=>ee.category==="actions"||Ct.isNil(ee.category))].filter(ee=>ee.isVisible(h(A)))),ne=B(()=>[...h(f).map(ee=>(ee.keepOpen=!0,ee)),...h(y),...h(R).filter(ee=>ee.category==="sidebar")].filter(ee=>ee.isVisible(h(A))));return{menuSections:B(()=>{const ee=[];return h(A).resources.length>1?(h(D).length&&ee.push({name:"batch-actions",items:[...h(D)]}),ee.push({name:"batch-details",items:[...h(H)]}),ee):([...h(_),...h(x)].length&&ee.push({name:"context",items:[...h(_)],dropItems:[{label:n("Open with..."),name:"open-with",icon:"apps",items:[...h(x)]}]}),h(z).length&&ee.push({name:"share",items:h(z)}),h(G).length&&ee.push({name:"actions",items:h(G)}),h(ne).length&&ee.push({name:"sidebar",items:h(ne)}),ee)})}}});function h2(e,t,r,n,i,o){const s=be("context-action-menu");return Q(),Ae(s,{"menu-sections":e.menuSections,"action-options":e.actionOptions,"drop-ref":e.dropRef},null,8,["menu-sections","action-options","drop-ref"])}const nS=qe(p2,[["render",h2]]),m2=xe({props:{hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},paginationOptions:{type:Array,default:()=>Li.options},perPageQueryName:{type:String,default:()=>Li.perPageQueryName},perPageDefault:{type:String,default:()=>Li.perPageDefault},perPageStoragePrefix:{type:String,required:!0},viewModeDefault:{type:String,required:!1,default:()=>Kt.defaultModeName},viewModes:{type:Array,default:()=>[]}},setup(e){const t=He(),r=zt(),{$gettext:n}=Fe.useGettext(),i=Ke(),{setAreHiddenFilesShown:o,setAreFileExtensionsShown:s,setAreDisabledSpacesShown:a,setAreEmptyTrashesShown:l}=i,{areHiddenFilesShown:u,areFileExtensionsShown:c,areDisabledSpacesShown:d,areEmptyTrashesShown:f}=Ve.storeToRefs(i),m=le(!1),w=tr("page"),v=B(()=>h(w)?parseInt(Rt(h(w))):1),E=Tn({name:e.perPageQueryName,defaultValue:e.perPageDefault,storagePrefix:e.perPageStoragePrefix}),b=pa(),g=Tn({name:`${h(b)}-${Kt.queryName}`,defaultValue:e.viewModeDefault}),y=Tn({name:Kt.tilesSizeQueryName,defaultValue:Kt.tilesSizeDefault.toString()}),p=R=>t.replace({query:{...h(r).query,[e.perPageQueryName]:R,...h(v)>1&&{page:"1"}}}),S=R=>{g.value=R.name};dt([E,g,y],R=>{m.value=R.some(I=>!I)},{immediate:!0,deep:!0});const T=gd();return{FolderViewModeConstants:Kt,viewModeCurrent:g,viewSizeCurrent:y,viewSizeMax:T,itemsPerPageCurrent:E,queryParamsLoading:m,queryItemAsString:Rt,setItemsPerPage:p,setViewMode:S,areHiddenFilesShown:u,areFileExtensionsShown:c,areDisabledSpacesShown:d,areEmptyTrashesShown:f,setAreHiddenFilesShown:o,setAreFileExtensionsShown:s,setAreDisabledSpacesShown:a,setAreEmptyTrashesShown:l,viewOptionsButtonLabel:n("Display customization options of the files list"),isProjectsLocation:Wr(gt,"files-spaces-projects"),isTrashOverViewLocation:Wr(gr,"files-trash-overview")}},computed:{hiddenFilesShownModel:{get(){return this.areHiddenFilesShown},set(e){this.setAreHiddenFilesShown(e)}},fileExtensionsShownModel:{get(){return this.areFileExtensionsShown},set(e){this.setAreFileExtensionsShown(e)}},disabledSpacesShownModel:{get(){return this.areDisabledSpacesShown},set(e){this.setAreDisabledSpacesShown(e)}},emptyTrashesShownModel:{get(){return this.areEmptyTrashesShown},set(e){this.setAreEmptyTrashesShown(e)}}},methods:{updateHiddenFilesShownModel(e){this.hiddenFilesShownModel=e},updateFileExtensionsShownModel(e){this.fileExtensionsShownModel=e},updateDisabledSpacesShownModel(e){this.disabledSpacesShownModel=e},updateEmptyTrashesShownModel(e){this.emptyTrashesShownModel=e}}}),g2={class:"flex items-center"},y2={class:"flex justify-between w-full"},v2={class:"flex items-center"},b2=["textContent"],w2={key:1,class:"viewmode-switch-buttons oc-button-group hidden sm:inline-flex mr-2"},S2={key:0,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},E2={key:1,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},T2={key:2,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},A2={key:3,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},R2={key:4,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},C2={key:5,class:"mt-2 mb-4 last:mb-0 flex justify-between items-center [&>*]:flex [&>*]:justify-between"},I2=["textContent"],_2=["max"];function O2(e,t,r,n,i,o){const s=be("oc-icon"),a=be("oc-button"),l=be("oc-list"),u=be("oc-drop"),c=be("oc-switch"),d=be("oc-page-size"),f=lr("oc-tooltip");return Q(),ye("div",g2,[e.viewModes.length?(Q(),ye(Ue,{key:0},[lt((Q(),Ae(a,{id:"mobile-viewmode-switch-toggle","aria-label":e.$gettext("Switch view mode"),appearance:"raw",class:"my-2 mx-1 p-1 align-middle sm:hidden"},{default:we(()=>[ge(s,{name:"list-view","fill-type":"none"})]),_:1},8,["aria-label"])),[[f,e.$gettext("Switch view mode")]]),ge(u,{title:e.$gettext("View mode"),"drop-id":"mobile-viewmode-switch-drop",toggle:"#mobile-viewmode-switch-toggle",class:"w-auto","padding-size":"medium","close-on-click":""},{default:we(()=>[ge(l,null,{default:we(()=>[(Q(!0),ye(Ue,null,mt(e.viewModes,m=>(Q(),ye("li",{key:m.name},[ge(a,{appearance:e.viewModeCurrent===m.name?"filled":"raw","color-role":e.viewModeCurrent===m.name?"secondaryContainer":"secondary","justify-content":"left",onClick:w=>e.setViewMode(m)},{default:we(()=>[fe("div",y2,[fe("span",v2,[ge(s,{name:m.icon.name,"fill-type":m.icon.fillType,size:"medium",class:"mr-1"},null,8,["name","fill-type"]),fe("span",{textContent:W.toDisplayString(m.label)},null,8,b2)]),e.viewModeCurrent===m.name?(Q(),Ae(s,{key:0,name:"check",size:"medium"})):_e("",!0)])]),_:2},1032,["appearance","color-role","onClick"])]))),128))]),_:1})]),_:1},8,["title"])],64)):_e("",!0),e.viewModes.length>1?(Q(),ye("div",w2,[(Q(!0),ye(Ue,null,mt(e.viewModes,m=>lt((Q(),Ae(a,{key:m.name,"no-hover":e.viewModeCurrent===m.name,class:W.normalizeClass([m.name]),appearance:e.viewModeCurrent===m.name?"filled":"outline","color-role":e.viewModeCurrent===m.name?"secondaryContainer":"secondary","aria-label":e.$gettext("Switch to %{viewMode}",{viewMode:m.label}),onClick:w=>e.setViewMode(m)},{default:we(()=>[ge(s,{name:m.icon.name,"fill-type":m.icon.fillType,size:"small"},null,8,["name","fill-type"])]),_:2},1032,["no-hover","class","appearance","color-role","aria-label","onClick"])),[[f,e.$gettext("Switch to %{viewMode}",{viewMode:m.label})]])),128))])):_e("",!0),lt((Q(),Ae(a,{id:"files-view-options-btn",key:"files-view-options-btn","data-testid":"files-view-options-btn","aria-label":e.viewOptionsButtonLabel,appearance:"raw",class:"my-2 mx-1 p-1 align-middle"},{default:we(()=>[ge(s,{name:"settings-3","fill-type":"line"})]),_:1},8,["aria-label"])),[[f,e.viewOptionsButtonLabel]]),ge(u,{title:e.$gettext("View options"),"drop-id":"files-view-options-drop",toggle:"#files-view-options-btn",mode:"click",class:"w-auto","padding-size":"medium"},{default:we(()=>[ge(l,null,{default:we(()=>[e.hasHiddenFiles?(Q(),ye("li",S2,[ge(c,{checked:e.hiddenFilesShownModel,"onUpdate:checked":[t[0]||(t[0]=m=>e.hiddenFilesShownModel=m),e.updateHiddenFilesShownModel],"data-testid":"files-switch-hidden-files",label:e.$gettext("Show hidden files")},null,8,["checked","label","onUpdate:checked"])])):_e("",!0),e.hasFileExtensions?(Q(),ye("li",E2,[ge(c,{checked:e.fileExtensionsShownModel,"onUpdate:checked":[t[1]||(t[1]=m=>e.fileExtensionsShownModel=m),e.updateFileExtensionsShownModel],"data-testid":"files-switch-files-extensions-files",label:e.$gettext("Show file extensions")},null,8,["checked","label","onUpdate:checked"])])):_e("",!0),e.hasPagination?(Q(),ye("li",T2,[e.queryParamsLoading?_e("",!0):(Q(),Ae(d,{key:0,selected:e.queryItemAsString(e.itemsPerPageCurrent),"data-testid":"files-pagination-size",label:e.$gettext("Items per page"),options:e.paginationOptions,class:"files-pagination-size",onChange:e.setItemsPerPage},null,8,["selected","label","options","onChange"]))])):_e("",!0),e.isProjectsLocation?(Q(),ye("li",A2,[ge(c,{checked:e.disabledSpacesShownModel,"onUpdate:checked":[t[2]||(t[2]=m=>e.disabledSpacesShownModel=m),e.updateDisabledSpacesShownModel],"data-testid":"files-switch-projects-show-disabled",label:e.$gettext("Show disabled Spaces")},null,8,["checked","label","onUpdate:checked"])])):_e("",!0),e.isTrashOverViewLocation?(Q(),ye("li",R2,[ge(c,{checked:e.emptyTrashesShownModel,"onUpdate:checked":[t[3]||(t[3]=m=>e.emptyTrashesShownModel=m),e.updateEmptyTrashesShownModel],"data-testid":"files-switch-projects-show-disabled",label:e.$gettext("Show empty trash bins")},null,8,["checked","label","onUpdate:checked"])])):_e("",!0),e.viewModeCurrent===e.FolderViewModeConstants.name.tiles?(Q(),ye("li",C2,[fe("label",{for:"tiles-size-slider",textContent:W.toDisplayString(e.$gettext("Tile size"))},null,8,I2),lt(fe("input",{id:"tiles-size-slider","onUpdate:modelValue":t[4]||(t[4]=m=>e.viewSizeCurrent=m),type:"range",min:1,max:e.viewSizeMax,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,_2),[[p1,e.viewSizeCurrent]])])):_e("",!0)]),_:1})]),_:1},8,["title"])])}const iS=qe(m2,[["render",O2],["__scopeId","data-v-a09cca67"]]),P2=xe({name:"AppBar",components:{BatchActions:H0,ContextActions:nS,ViewOptions:iS},props:{viewModeDefault:{type:String,required:!1,default:()=>Kt.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 r=ut(),{$gettext:n}=Fe.useGettext(),{can:i}=ur(),o=He(),{requestExtensions:s}=Ni(),{isSticky:a}=hd(),l=Ke(),{selectedResources:u}=Ve.storeToRefs(l),c=B(()=>e.space),{actions:d}=wa(),{actions:f}=Sa(),{actions:m}=Ea(),{actions:w}=P0(),{actions:v}=Ta(),{actions:E}=xo(),{actions:b}=Aa(),{actions:g}=No(),{actions:y}=Ra(),{actions:p}=Ia(),{actions:S}=_0(),{actions:T}=O0(),{actions:R}=x0(),{actions:I}=$0(),A=le(0),D=Wr(It,"files-common-search"),H=B(()=>Object.hasOwn(qp(),"navigation")&&i("create-all","Share")),_=B(()=>{let X=[...h(f),...h(d),...h(v),...h(b),...h(g),...h(y),...h(m),...h(E),...h(p)];D.value||(X=[...X,...h(w),...h(R),...h(I),...h(S),...h(T)]);const oe=s({id:"global.files.batch-actions",extensionType:"action"});return oe.length&&(X=[...X,...oe.map(ae=>ae.action)]),X.filter(ae=>ae.isVisible({space:h(c),resources:l.selectedResources}))}),x=B(()=>r.spaces.filter(X=>te.isPersonalSpaceResource(X)||te.isProjectSpaceResource(X))),z=mn("isMobileWidth"),G=Wr(gr,"files-trash-generic"),ne=B(()=>!h(z)&&e.breadcrumbs.length?!0:h(G)&&h(x).length===1?!1:e.breadcrumbs.length>1),ie=B(()=>h(G)&&h(x).length===1?e.breadcrumbs.length<=2:e.breadcrumbs.length<=1),ee=B(()=>h(c)&&(te.isProjectSpaceResource(h(c))||te.isShareSpaceResource(h(c)))?3:2),ue=X=>{t(Ab,X)},de=Qb("title"),ce=B(()=>h(de)?n(h(de)):h(c)?.name||"");return{router:o,hasSharesNavigation:H,batchActions:_,showBreadcrumb:ne,showMobileNav:ie,breadcrumbMaxWidth:A,breadcrumbTruncationOffset:ee,fileDroppedBreadcrumb:ue,pageTitle:ce,selectedResources:u,isSticky:a}},data:function(){return{resizeObserver:new ResizeObserver(this.onResize),limitedScreenSpace:!1}},computed:{showContextActions(){return Yd(this.breadcrumbs).allowContextActions},showBatchActions(){return this.hasBulkActions&&(this.selectedResources.length>=1||gr(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,r=document.getElementById("app-sidebar")?.getBoundingClientRect().width||0,n=document.getElementById("files-app-bar-controls-right")?.clientWidth;this.breadcrumbMaxWidth=e-t-r-n,this.limitedScreenSpace=this.isSideBarOpen?window.innerWidth<=1280:window.innerWidth<=1e3}}}),k2={class:"files-topbar py-2"},F2=["textContent"],x2={key:3,id:"files-app-bar-controls-right",class:"flex"},N2={class:"files-app-bar-actions flex items-center justify-end mt-1 min-h-10 gap-2"},D2={class:"flex-1 flex justify-start items-center"},$2={key:1};function L2(e,t,r,n,i,o){const s=be("oc-hidden-announcer"),a=be("context-actions"),l=be("oc-breadcrumb"),u=be("portal-target"),c=be("view-options"),d=be("batch-actions"),f=be("oc-spinner");return Q(),ye("div",{id:"files-app-bar",ref:"filesAppBar",class:W.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",k2,[fe("h1",{class:"sr-only",textContent:W.toDisplayString(e.pageTitle)},null,8,F2),ge(s,{announcement:e.selectedResourcesAnnouncement,level:"polite"},null,8,["announcement"]),fe("div",{class:W.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?(Q(),Ae(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,onItemDroppedBreadcrumb:e.fileDroppedBreadcrumb},{contextMenu:we(()=>[ge(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","onItemDroppedBreadcrumb"])):_e("",!0),e.showMobileNav?(Q(),Ae(u,{key:1,name:"app.runtime.mobile.nav"})):_e("",!0),e.hasSharesNavigation?je(e.$slots,"navigation",{key:2}):_e("",!0),e.hasViewOptions?(Q(),ye("div",x2,[ge(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"])])):_e("",!0)],2),fe("div",N2,[fe("div",D2,[je(e.$slots,"actions",{limitedScreenSpace:e.limitedScreenSpace}),e.showBatchActions&&!e.batchActionsLoading?(Q(),Ae(d,{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?(Q(),ye("div",$2,[ge(f,{"aria-label":e.$gettext("Loading actions")},null,8,["aria-label"])])):_e("",!0)])]),je(e.$slots,"content")])],2)}const M2=qe(P2,[["render",L2]]),B2=xe({name:"CreateSpace",props:{showLabel:{type:Boolean,default:!0}},emits:["spaceCreated"],setup(e,{emit:t}){const{showMessage:r,showErrorMessage:n}=nt(),{$gettext:i}=Fe.useGettext(),{createSpace:o}=$i(),{isSpaceNameValid:s}=ii(),{dispatchModal:a}=ht(),l=ut(),{upsertResource:u}=Ke(),c=async f=>{try{const m=await o(f);u(m),l.upsertSpace(m),t("spaceCreated",m),r({title:i("Space was created successfully")})}catch(m){console.error(m),n({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:f=>c(f),onInput:(f,m)=>{const{isValid:w,error:v}=s(f);m(w?null:v)}})}}}}),j2=["textContent"];function U2(e,t,r,n,i,o){const s=be("oc-icon"),a=be("oc-button"),l=lr("oc-tooltip");return lt((Q(),Ae(a,{id:"new-space-menu-btn","aria-label":e.showLabel?void 0:e.$gettext("New space"),appearance:"filled",onClick:e.showCreateSpaceModal},{default:we(()=>[ge(s,{name:"add"}),e.showLabel?(Q(),ye("span",{key:0,textContent:W.toDisplayString(e.$gettext("New Space"))},null,8,j2)):_e("",!0)]),_:1},8,["aria-label","onClick"])),[[l,e.showLabel?void 0:e.$gettext("New space")]])}const q2=qe(B2,[["render",U2]]),V2=xe({name:"AppTopBar",components:{ContextActionMenu:Ud,ResourceListItem:$o},props:{dropDownMenuSections:{type:Array,default:()=>[]},dropDownActionOptions:{type:Object,default:()=>({space:null,resources:[]})},mainActions:{type:Array,default:()=>[]},hasAutoSave:{type:Boolean,default:!0},isEditor:{type:Boolean,default:!1},resource:{type:Object,default:null}},emits:["close"],setup(e){const{$gettext:t,current:r}=Fe.useGettext(),n=Ke(),i=ct(),{getMatchingSpace:o}=rr(),s=B(()=>n.areFileExtensionsShown),a=B(()=>t("Show context menu")),l=B(()=>e.isEditor&&e.hasAutoSave&&i.options.editor.autosaveEnabled),u=B(()=>{const f=Mt.Duration.fromObject({seconds:i.options.editor.autosaveInterval},{locale:r});return t("Autosave (every %{ duration })",{duration:f.toHuman()})}),c=B(()=>o(e.resource)),d=B(()=>!te.isPublicSpaceResource(h(c)));return{contextMenuLabel:a,areFileExtensionsShown:s,hasAutosave:l,autoSaveTooltipText:u,isPathDisplayed:d,...si()}}}),z2={class:"oc-app-top-bar self-center flex col-[1/4] row-2 sm:col-2 sm:row-1"},W2={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"},H2={class:"open-file-bar flex"},G2={class:"flex"},K2={key:1,class:"flex items-center"};function Q2(e,t,r,n,i,o){const s=be("resource-list-item"),a=be("oc-icon"),l=be("oc-button"),u=be("context-action-menu"),c=be("oc-drop"),d=be("portal"),f=lr("oc-tooltip");return Q(),Ae(d,{to:"app.runtime.header.left"},{default:we(()=>[fe("div",z2,[fe("div",W2,[fe("div",H2,[e.resource?(Q(),Ae(s,{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","is-thumbnail-displayed":!1,"is-extension-displayed":e.areFileExtensionsShown,"path-prefix":e.getPathPrefix(e.resource),resource:e.resource,"parent-folder-name":e.getParentFolderName(e.resource),"parent-folder-link-icon-additional-attributes":e.getParentFolderLinkIconAdditionalAttributes(e.resource),"is-path-displayed":e.isPathDisplayed,"is-resource-clickable":!1},null,8,["is-extension-displayed","path-prefix","resource","parent-folder-name","parent-folder-link-icon-additional-attributes","is-path-displayed"])):_e("",!0)]),fe("div",G2,[e.dropDownMenuSections.length?(Q(),ye(Ue,{key:0},[lt((Q(),Ae(l,{id:"oc-openfile-contextmenu-trigger","aria-label":e.contextMenuLabel,appearance:"raw-inverse","color-role":"chrome",class:"p-1"},{default:we(()=>[ge(a,{name:"more-2"})]),_:1},8,["aria-label"])),[[f,e.contextMenuLabel]]),ge(c,{"drop-id":"oc-openfile-contextmenu",mode:"click","padding-size":"small",toggle:"#oc-openfile-contextmenu-trigger","close-on-click":"",title:e.resource.name,onClick:t[0]||(t[0]=Vt(()=>{},["stop","prevent"]))},{default:we(()=>[ge(u,{"menu-sections":e.dropDownMenuSections,"action-options":e.dropDownActionOptions},null,8,["menu-sections","action-options"])]),_:1},8,["title"])],64)):_e("",!0),e.hasAutosave?(Q(),ye("span",K2,[lt(ge(a,{"accessible-label":e.autoSaveTooltipText,name:"refresh",color:"white",class:"ox-p-xs mx-1"},null,8,["accessible-label"]),[[f,e.autoSaveTooltipText]])])):_e("",!0),e.mainActions.length&&e.resource?(Q(),Ae(u,{key:2,"menu-sections":[{name:"main-actions",items:e.mainActions.filter(m=>m.isVisible()).map(m=>({...m,class:"p-1 app-topbar-action",hideLabel:!0}))}],"action-options":{resources:[e.resource]},appearance:"raw-inverse","color-role":"chrome"},null,8,["menu-sections","action-options"])):_e("",!0),ge(l,{id:"app-top-bar-close",appearance:"raw-inverse","color-role":"chrome",class:"p-1","aria-label":e.$gettext("Close"),onClick:t[1]||(t[1]=m=>e.$emit("close"))},{default:we(()=>[ge(a,{name:"close"})]),_:1},8,["aria-label"])])])])]),_:1})}const oS=qe(V2,[["render",Q2]]),X2=xe({name:"ErrorScreen",props:{message:{default:"",type:String,required:!1}}}),Y2={class:"text-center flex justify-center items-center h-full"},J2={key:0,class:"text-xl"};function Z2(e,t,r,n,i,o){const s=be("oc-icon");return Q(),ye("div",Y2,[ge(s,{size:"xxlarge",name:"error-warning","fill-type":"line"}),e.message?(Q(),ye("p",J2,W.toDisplayString(e.message),1)):_e("",!0)])}const eM=qe(X2,[["render",Z2]]),tM=xe({name:"LoadingScreen"}),rM={class:"text-center flex justify-center items-center h-full"},nM=["textContent"];function iM(e,t,r,n,i,o){const s=be("oc-spinner");return Q(),ye("div",rM,[ge(s,{size:"xlarge"}),fe("p",{class:"sr-only",textContent:W.toDisplayString(e.$gettext("Loading app"))},null,8,nM)])}const oM=qe(tM,[["render",iM]]),sM=["id","data-testid","tabindex","inert"],aM={key:0,class:"sidebar-panel__header header grid grid-cols-[auto_1fr_auto] items-center pt-2 px-2"},lM={class:"col-start-2 text-center my-0 text-lg"},cM={key:0,class:"mt-4"},sS=qe(xe({__name:"SideBar",props:{isOpen:{type:Boolean},loading:{type:Boolean},availablePanels:{},panelContext:{},activePanel:{default:""}},emits:["selectPanel","close"],setup(e,{emit:t}){const r=t,{$gettext:n}=Fe.useGettext(),i=Wn("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(()=>h(o).length?[h(o)[0],...h(s)]:h(s)),l=B(()=>{const A=e.activePanel?.split("#")[0];return!A||!h(s).map(D=>D.name).includes(A)?null:A}),u=B(()=>h(l)!==null),c=B(()=>h(l)===null),d=le(null),f=A=>{d.value=A},m=B(()=>h(u)?h(l):h(o)[0].name),w=B(()=>h(o).length===1?n("Back to %{panel} panel",{panel:h(o)[0].title(e.panelContext)}):n("Back to main panels")),v=le(window.innerWidth),E=B(()=>h(v)<=580),b=B(()=>h(i)?.parentElement?.querySelector("div")),g=()=>{if(!h(b))return;const A=h(E)?"hidden":"visible";h(b).style.visibility=A},y=()=>{e.isOpen&&(v.value=window.innerWidth,g())};dt(()=>e.isOpen,async A=>{A&&(await ar(),g())},{immediate:!0});const p=A=>{r("selectPanel",A)},S=()=>{r("selectPanel",null)},T=()=>{r("close")},R=A=>{f(h(m)),p(A)},I=()=>{f(h(m)),S(),h(i).focus()};return $t(()=>{window.addEventListener("resize",y)}),mr(()=>{window.removeEventListener("resize",y),h(b)&&(h(b).style.visibility="visible")}),(A,D)=>{const H=be("oc-spinner"),_=be("oc-icon"),x=be("oc-button"),z=lr("oc-tooltip");return Q(),ye("div",{id:"app-sidebar",ref_key:"appSideBar",ref:i,"data-testid":"app-sidebar",tabindex:"-1",class:W.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":A.loading,"w-full min-w-full":E.value}])},[A.loading?(Q(),Ae(H,{key:0})):(Q(!0),ye(Ue,{key:1},mt(a.value,G=>(Q(),ye("div",{id:`sidebar-panel-${G.name}`,key:`panel-${G.name}`,"data-testid":`sidebar-panel-${G.name}`,tabindex:m.value===G.name?-1:null,class:W.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]":G.isRoot?.(A.panelContext),"is-active-sub-panel":u.value&&l.value===G.name,"is-active-root-panel transition-[right] duration-[0.4s,0s]":c.value&&G.isRoot?.(A.panelContext)}]),inert:m.value!==G.name},[[m.value,d.value].includes(G.name)?(Q(),ye("div",aM,[G.isRoot?.(A.panelContext)?_e("",!0):lt((Q(),Ae(x,{key:0,class:"header__back col-start-1 p-1",appearance:"raw","aria-label":w.value,onClick:I},{default:we(()=>[ge(_,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"])),[[z,w.value]]),fe("h2",lM,W.toDisplayString(G.title(A.panelContext)),1),ge(x,{appearance:"raw",class:"header__close col-start-3 p-1","aria-label":h(n)("Close file sidebar"),onClick:T},{default:we(()=>[ge(_,{name:"close"})]),_:1},8,["aria-label"])])):_e("",!0),fe("div",null,[G.isRoot?.(A.panelContext)?je(A.$slots,"rootHeader",{key:0},void 0,!0):je(A.$slots,"subHeader",{key:1},void 0,!0)]),fe("div",{class:W.normalizeClass(["sidebar-panel__body flex flex-col p-2 overflow-y-auto overflow-x-hidden",[`sidebar-panel__body-${G.name}`]])},[fe("div",{class:W.normalizeClass(["sidebar-panel__body-content",{"flex-1 ":!G.isRoot?.(A.panelContext)}])},[je(A.$slots,"body",{},()=>[(Q(!0),ye(Ue,null,mt(G.isRoot?.(A.panelContext)?o.value:[G],(ne,ie)=>(Q(),ye("div",{key:`sidebar-panel-${ne.name}`},[(c.value?ne.isRoot?.(A.panelContext):[m.value,d.value].includes(ne.name))?(Q(),Ae(jr(ne.component),jt({key:0,class:[{"multi-root-panel-separator mt-4 pt-2 border-t":ie>0},"rounded-sm"]},{ref_for:!0},ne.componentAttrs?.(A.panelContext)||{}),null,16,["class"])):_e("",!0)]))),128))],!0)],2),G.isRoot?.(A.panelContext)&&s.value.length>0?(Q(),ye("div",cM,[(Q(!0),ye(Ue,null,mt(s.value,ne=>(Q(),Ae(x,{id:`sidebar-panel-${ne.name}-select`,key:`panel-select-${ne.name}`,"data-testid":`sidebar-panel-${ne.name}-select`,appearance:"raw-inverse","color-role":"surface",class:"!grid !grid-cols-[auto_1fr_auto] text-left px-2 w-full h-12",onClick:ie=>R(ne.name)},{default:we(()=>[ge(_,{name:ne.icon,"fill-type":ne.iconFillType},null,8,["name","fill-type"]),Pt(" "+W.toDisplayString(ne.title(A.panelContext))+" ",1),ge(_,{name:"arrow-right-s","fill-type":"line"})]),_:2},1032,["id","data-testid","onClick"]))),128))])):_e("",!0)],2)],10,sM))),128))],2)}}}),[["__scopeId","data-v-b2b7e1e8"]]),uM=xe({name:"SpaceInfo",setup(){return{resource:mn("resource")}}}),fM={class:"grid items-center p-2"},dM={class:"flex items-center text-sm"},pM={class:"mr-2"},hM=["textContent"],mM=["textContent"];function gM(e,t,r,n,i,o){const s=be("oc-icon");return Q(),ye("div",fM,[fe("div",dM,[fe("div",pM,[ge(s,{name:"layout-grid",size:e.resource.description?"large":"medium",class:"block"},null,8,["size"])]),fe("div",null,[fe("h3",{"data-testid":"space-info-name",class:"font-semibold m-0 text-base",textContent:W.toDisplayString(e.resource.name)},null,8,hM),fe("span",{"data-testid":"space-info-subtitle",textContent:W.toDisplayString(e.resource.description)},null,8,mM)])])])}const aS=qe(uM,[["render",gM]]),yM={class:"flex justify-between p-2"},vM={class:"flex items-center"},bM={"data-testid":"files-info-name",class:"font-semibold m-0 text-base break-all"},lS=xe({__name:"FileInfo",props:{isSubPanelActive:{type:Boolean,default:!0}},setup(e){const t=Ke(),{isPersonalSpaceRoot:r}=rr(),n=mn("resource"),i=mn("space"),o=B(()=>t.areFileExtensionsShown),s=B(()=>r(h(n))?h(i).name:h(n).name);return(a,l)=>(Q(),ye("div",yM,[fe("div",vM,[a.isSubPanelActive?(Q(),Ae(Do,{key:0,resource:h(n),size:"large",class:"mr-2 relative"},null,8,["resource"])):_e("",!0),fe("div",null,[fe("h3",bM,[ge(dd,{name:s.value,extension:h(n).extension,type:h(n).type,"full-path":h(n).webDavPath,"is-extension-displayed":o.value,"is-path-displayed":!1,"truncate-name":!1},null,8,["name","extension","type","full-path","is-extension-displayed"])])])])]))}}),wM=xe({name:"FileSideBar",components:{FileInfo:lS,SpaceInfo:aS,InnerSideBar:sS},props:{isOpen:{type:Boolean,required:!0},activePanel:{type:String,required:!1,default:null},space:{type:Object,required:!1,default:null}},setup(e){const t=He(),r=Ge(),n=Ni(),i=Ln(),o=ut(),s=En(),a=ct(),l=rn(),{canListShares:u}=g0(),{canListVersions:c}=j0(),d=Ke(),{currentFolder:f}=Ve.storeToRefs(d),m=le(),w=le([]),v=le([]),E=le([]),{selectedResources:b}=vd(),g=le(!1),y=B(()=>h(g)||ee.isRunning),p=B(()=>h(b).length===0?{root:e.space,parent:null,items:h(f)?.id?[h(f)]:[]}:{root:e.space,parent:h(f),items:h(b)}),S=Wr(Lt,"files-shares-with-me"),T=Wr(Lt,"files-shares-with-others"),R=Wr(Lt,"files-shares-via-link"),I=gt(t,"files-spaces-projects"),A=Wr(It,"files-common-favorites"),D=Wr(It,"files-common-search"),H=()=>{i.publish(Tt.close)},_=ce=>{i.publish(Tt.setActivePanel,ce)},x=B(()=>h(p).items?.length===1&&!te.isProjectSpaceResource(h(p).items[0])),z=B(()=>h(p).items?.length===1&&te.isProjectSpaceResource(h(p).items[0])),G=B(()=>h(S)||h(T)||h(R)),ne=B(()=>h(G)||h(D)||h(A)),ie=B(()=>n.requestExtensions({id:"global.files.sidebar",extensionType:"sidebarPanel"}).map(ce=>ce.panel)),ee=or.useTask(function*(ce,X){w.value=yield r.webdav.listFileVersions(X.id,{signal:ce})}),ue=or.useTask(function*(ce,X){s.setLoading(!0),s.removeOrphanedShares();const{collaboratorShares:oe,linkShares:ae}=s,Ce=r.graphAuthenticated.permissions;let Z=e.space?.id;if(te.isShareSpaceResource(e?.space)){const Oe=yield o.getMountPointForSpace({graphClient:r.graphAuthenticated,space:e.space,signal:ce});Oe&&(Z=Oe.root.remoteItem.rootId)}const{shares:N,allowedRoles:O}=yield*te.call(Ce.listPermissions(Z,X.fileId,s.graphRoles,{},{signal:ce})),K=N.filter(te.isCollaboratorShare),V=N.filter(te.isLinkShare),$=Object.values(s.graphRoles);if(v.value=O?.map(Oe=>({...Oe,icon:$.find(Be=>Be.id===Oe.id)?.icon}))||[],l.isAppEnabled("open-cloud-mesh")){const{allowedRoles:Oe}=yield*te.call(Ce.listPermissions(Z,X.fileId,s.graphRoles,{filter:`@libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition, '@Subject.UserType=="Federated"'))`,select:[Gb.LibreGraphPermissionsRolesAllowedValues]},{signal:ce}));E.value=Oe?.map(Be=>({...Be,icon:$.find(Se=>Se.id===Be.id)?.icon}))||[]}!h(ne)&&!h(I)&&(oe.forEach(Oe=>{K.some(Be=>Be.id===Oe.id)||K.push({...Oe,indirect:!0})}),ae.forEach(Oe=>{V.some(Be=>Be.id===Oe.id)||V.push({...Oe,indirect:!0})})),It(t,"files-common-search")&&(yield d.loadAncestorMetaData({folder:h(X),space:h(e.space),client:r.webdav,signal:ce}));const pe=[...oe,...ae].map(({resourceId:Oe})=>Oe),Re=Object.values(d.ancestorMetaData).filter(({id:Oe,path:Be})=>Oe===X.id||pe.includes(Oe)||te.isIncomingShareResource(X)?!1:te.isPersonalSpaceResource(e.space)?Be!=="/":!0).map(({id:Oe})=>Oe);h(ne)&&te.isProjectSpaceResource(e.space)&&!te.isProjectSpaceResource(X)&&Re.push(e.space.id);const De=new On({concurrency:a.options.concurrentRequests.shares.list}),ke=[...new Set(Re)].map(Oe=>De.add(()=>r.graphAuthenticated.permissions.listPermissions(Z,Oe,s.graphRoles,{},{signal:ce}).then(Be=>{const Se=Be.shares.map(Ye=>({...Ye,indirect:!0}));K.push(...Se.filter(te.isCollaboratorShare)),V.push(...Se.filter(te.isLinkShare))})));yield Promise.allSettled(ke),s.setCollaboratorShares(K),s.setLinkShares(V),s.setLoading(!1)}).restartable();dt(()=>[...h(p).items,e.isOpen],async()=>{if(h(p).items?.length!==1)return;if(!e.isOpen){w.value=[];return}const ce=h(p).items[0];if(ee.isRunning&&ee.cancelAll(),!!c({space:e.space,resource:ce}))try{await ee.perform(ce)}catch(X){console.error(X)}},{immediate:!0,deep:!0});const de=B(()=>h(p).items.map(ce=>ce.id));return dt(()=>[de,e.isOpen],async()=>{if(!e.isOpen||!h(p).items?.length){s.pruneShares(),m.value=null;return}if(h(p).items?.length!==1)return;const ce=h(p).items[0];if(g.value=!0,te.isProjectSpaceResource(ce)&&await o.loadGraphPermissions({ids:[ce.id],graphClient:r.graphAuthenticated}),u({space:e.space,resource:ce}))try{ue.isRunning&&ue.cancelAll(),ue.perform(ce)}catch(X){console.error(X)}if(!h(G)){m.value=ce,g.value=!1;return}try{const X=await r.webdav.getFileInfo(e.space,{path:ce.path}),oe={...X,...ce,tags:X.tags};m.value=oe}catch(X){m.value=ce,console.error(X)}g.value=!1},{deep:!0,immediate:!0}),vi("resource",dn(m)),vi("versions",dn(w)),vi("space",B(()=>e.space)),vi("activePanel",B(()=>e.activePanel)),vi("availableInternalShareRoles",dn(v)),vi("availableExternalShareRoles",dn(E)),{loadedResource:m,setActiveSideBarPanel:_,closeSideBar:H,panelContext:p,availablePanels:ie,isFileHeaderVisible:x,isSpaceHeaderVisible:z,isLoading:y,loadSharesTask:ue}}});function SM(e,t,r,n,i,o){const s=be("file-info"),a=be("space-info"),l=be("InnerSideBar");return e.isOpen?(Q(),Ae(l,jt({key:0,ref:"sidebar",class:"files-side-bar z-30","is-open":e.isOpen,"active-panel":e.activePanel,"available-panels":e.availablePanels,"panel-context":e.panelContext,loading:e.isLoading},e.$attrs,{"data-custom-key-bindings-disabled":"true",onSelectPanel:e.setActiveSideBarPanel,onClose:e.closeSideBar}),{rootHeader:we(()=>[e.isFileHeaderVisible?(Q(),Ae(s,{key:0,class:"px-2 pt-2","is-sub-panel-active":!1})):e.isSpaceHeaderVisible?(Q(),Ae(a,{key:1})):_e("",!0)]),subHeader:we(()=>[e.isFileHeaderVisible?(Q(),Ae(s,{key:0,class:"px-2 pt-2","is-sub-panel-active":!0})):e.isSpaceHeaderVisible?(Q(),Ae(a,{key:1})):_e("",!0)]),_:1},16,["is-open","active-panel","available-panels","panel-context","loading","onSelectPanel","onClose"])):_e("",!0)}const cS=qe(wM,[["render",SM]]),EM=xe({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=le(),t=le(!0);return{confirmDisabled:t,onDateChanged:({date:n,error:i})=>{t.value=i||!n,e.value=n},dateTime:e}}}),TM={class:"flex justify-end items-center mt-2"};function AM(e,t,r,n,i,o){const s=be("oc-datepicker"),a=be("oc-button");return Q(),ye(Ue,null,[ge(s,{label:e.$gettext("Expiration date"),type:"date","min-date":e.minDate,"current-date":e.currentDate,"is-clearable":e.isClearable,"required-mark":"",onDateChanged:e.onDateChanged},null,8,["label","min-date","current-date","is-clearable","onDateChanged"]),fe("div",TM,[ge(a,{class:"oc-modal-body-actions-cancel ml-2",onClick:t[0]||(t[0]=l=>e.$emit("cancel"))},{default:we(()=>[Pt(W.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),ge(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:we(()=>[Pt(W.toDisplayString(e.$gettext("Confirm")),1)]),_:1},8,["disabled"])])],64)}const RM=qe(EM,[["render",AM]]),CM=xe({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()}}}}),IM=["textContent"],_M={class:"flex justify-end items-center mt-4"},OM={class:"oc-modal-body-actions-grid"};function PM(e,t,r,n,i,o){const s=be("oc-button");return Q(),ye(Ue,null,[fe("span",{class:"inline-block mb-4",textContent:W.toDisplayString(e.$gettext("Your changes were not saved. Do you want to save them?"))},null,8,IM),t[2]||(t[2]=fe("div",{class:"my-4"},null,-1)),fe("div",_M,[fe("div",OM,[ge(s,{class:"oc-modal-body-actions-cancel ml-2",onClick:t[0]||(t[0]=a=>e.$emit("cancel"))},{default:we(()=>[Pt(W.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),ge(s,{class:"oc-modal-body-actions-secondary ml-2",onClick:e.onClose},{default:we(()=>[Pt(W.toDisplayString(e.$gettext("Don't Save")),1)]),_:1},8,["onClick"]),ge(s,{class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:t[1]||(t[1]=a=>e.$emit("confirm"))},{default:we(()=>[Pt(W.toDisplayString(e.$gettext("Save")),1)]),_:1})])])],64)}const uS=qe(CM,[["render",PM]]);var kM=/\s/;function FM(e){for(var t=e.length;t--&&kM.test(e.charAt(t)););return t}var xM=/^\s+/;function NM(e){return e&&e.slice(0,FM(e)+1).replace(xM,"")}var fS=NaN,DM=/^[-+]0x[0-9a-f]+$/i,$M=/^0b[01]+$/i,LM=/^0o[0-7]+$/i,MM=parseInt;function BM(e){if(typeof e=="number")return e;if(Ds(e))return fS;if(Jr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Jr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=NM(e);var r=$M.test(e);return r||LM.test(e)?MM(e.slice(2),r?2:8):DM.test(e)?fS:+e}const jM=xe({name:"AppWrapper",components:{AppTopBar:oS,FileSideBar:cS,ErrorScreen:eM,LoadingScreen:oM},props:{applicationId:{type:String,required:!0},urlForResourceOptions:{type:Object,default:()=>null,required:!1},fileContentOptions:{type:Object,default:()=>null,required:!1},wrappedComponent:{type:Object,default:null},importResourceWithExtension:{type:Function,default:()=>null},disableAutoSave:{type:Boolean,default:!1}},setup(e){const{$gettext:t,current:r}=Fe.useGettext(),n=rn(),{showMessage:i,showErrorMessage:o}=nt(),s=Yo.useRouter(),a=zt(),l=Ge(),u=ir(),{getResourceContext:c}=U0(),{selectedResources:d}=vd(),{dispatchModal:f}=ht(),m=ut(),w=ct(),v=Ke(),E=En(),b=Ln(),{actions:g}=R0({appId:e.applicationId}),{actions:y}=id(),{actions:p}=No(),{actions:S}=ld(),{actions:T}=cd(),{actions:R}=xo(),I=B(()=>!!e.wrappedComponent.emits?.includes("update:resource")),A=le(),D=le(),H=le(""),_=le(""),x=le(!h(I)),z=le(),G=le(!1),ne=le(),ie=le();let ee="",ue=null;const{actions:de}=I0({content:ie}),ce=B(()=>!!e.wrappedComponent.emits?.includes("update:currentContent")),X=$e=>!!Object.keys(e.wrappedComponent.props).includes($e),oe=B(()=>h(ie)!==h(ne)),ae=$e=>{$e.preventDefault()};dt(oe,$e=>{$e?window.addEventListener("beforeunload",ae):window.removeEventListener("beforeunload",ae)});const{applicationConfig:Ce,closeApp:Z,currentFileContext:N,getFileContents:O,getFileInfo:K,getUrlForResource:V,putFileContents:$,replaceInvalidFileRoute:U,revokeUrl:pe,activeFiles:Re,loadFolderForFileContext:De,isFolderLoading:ke}=i0({applicationId:e.applicationId}),{applicationMeta:Oe}=Xf({applicationId:e.applicationId,appsStore:n}),Be=B(()=>h(Oe).meta?.fileSizeLimit),Se=B(()=>{const{name:$e}=h(Oe);return t("%{appName} for %{fileName}",{appName:t($e),fileName:h(h(N).fileName)})}),Ye=ha("driveAliasAndItem"),Qe=tr("fileId"),he=B(()=>Rt(h(Qe))),Pe=async()=>{const $e=h(he),{space:Ze,path:it}=await c($e),Er=Ze.getDriveAliasAndItem({path:it});return te.isPersonalSpaceResource(Ze)?s.push({params:{...h(a).params,driveAliasAndItem:Er},query:{...h(a).query,fileId:$e,contextRouteName:"files-spaces-generic",contextRouteParams:{driveAliasAndItem:pt.dirname(Er)}}}):s.push({params:{...h(a).params,driveAliasAndItem:Er},query:{...h(a).query,fileId:$e,contextRouteName:it==="/"?"files-shares-with-me":"files-spaces-generic",...te.isShareSpaceResource(Ze)&&{shareId:Ze.id},contextRouteParams:{driveAliasAndItem:pt.dirname(Er)},contextRouteQuery:{...te.isShareSpaceResource(Ze)&&{shareId:Ze.id}}}})},We=or.useTask(function*($e){try{h(Ye)||(yield Pe()),D.value=h(h(N).space);const Ze=yield K(h(N),{signal:$e});if(A.value=Ze,te.isShareSpaceResource(h(D))&&(h(A).remoteItemId=h(D).id,h(A).id===h(A).remoteItemId)){const it=yield*te.call(Ns({graphClient:l.graphAuthenticated,spacesStore:m,space:h(D)}));it&&(A.value={...Ze,...te.buildIncomingShareResource({graphRoles:E.graphRoles,driveItem:it,serverUrl:w.serverUrl}),tags:Ze.tags})}v.initResourceList({currentFolder:null,resources:[h(A)]}),d.value=[h(A)]}catch(Ze){console.error(Ze),z.value=Ze,x.value=!1}}).restartable(),Xe=or.useTask(function*($e){try{const Ze=e.importResourceWithExtension(h(A));if(Ze){const it=Mt.DateTime.local().toFormat("yyyyMMddHHmmss"),Er=`${h(A).name}_${it}.${Ze}`;if(!(yield l.webdav.copyFiles(h(D),h(A),h(D),{path:Er},{signal:$e})))throw new Error(t("Importing failed"));A.value={path:Er}}if(U(N,h(A)))return;if(G.value=![Mm.Updateable,Mm.FileUpdateable].some(it=>(h(A).permissions||"").indexOf(it)>-1),h(X("currentContent"))){const it=yield*te.call(O(N,{...e.fileContentOptions,signal:$e}));ne.value=ie.value=it.body,H.value=it.headers["OC-ETag"]}h(X("url"))&&(_.value=yield V(h(D),h(A),{...e.urlForResourceOptions,signal:$e}))}catch(Ze){console.error(Ze),z.value=Ze}finally{x.value=!1}}).restartable();dt(N,async()=>{h(I)?D.value=h(h(N).space):(await We.perform(),h(Be)&&BM(h(A).size)>h(Be)?f({title:t("File exceeds %{threshold}",{threshold:yr(h(Be),r)}),message:t("%{resource} exceeds the recommended size of %{threshold} for editing, and may cause performance issues.",{resource:h(A).name,threshold:yr(h(Be),r)}),confirmText:t("Continue"),onCancel:()=>{Z()},onConfirm:()=>{Xe.perform()}}):Xe.perform())},{immediate:!0});const at=$e=>{console.error($e),o({title:t("An error occurred"),desc:$e.message,errors:[$e]})},_t=()=>{i({title:t("File autosaved")})},wt=or.useTask(function*(){const $e=h(ie);try{const Ze=yield $(N,{content:$e,previousEntityTag:h(H)});ne.value=$e,H.value=Ze.etag,v.upsertResource(Ze)}catch(Ze){switch(Ze.statusCode){case 401:case 403:at(new te.HttpError(t("You're not authorized to save this file"),Ze.response));break;case 409:case 412:at(new te.HttpError(t("This file was updated outside this window. Please refresh the page (all changes will be lost)."),Ze.response));break;case 507:const it=m.spaces.find(Er=>Er.id===h(A).storageId&&te.isProjectSpaceResource(Er));if(it){at(new te.HttpError(t('Insufficient quota on "%{spaceName}" to save this file',{spaceName:it.name}),Ze.response));break}at(new te.HttpError(t("Insufficient quota for saving this file"),Ze.response));break;default:at(new te.HttpError("",Ze.response))}}}).drop(),Qt=async()=>{await wt.perform()},L=B(()=>!e.disableAutoSave);let C=null;$t(()=>{if(ee=b.subscribe("runtime.resource.deleted",me),v.ancestorMetaData?.["/"]&&h(D)&&v.ancestorMetaData["/"].spaceId!==h(D).id&&v.setAncestorMetaData({}),!h(ce))return;const $e=w.options.editor;$e.autosaveEnabled&&!e.disableAutoSave&&(C=setInterval(async()=>{oe.value&&(await Qt(),_t())},($e.autosaveInterval||120)*1e3))}),mr(()=>{b.unsubscribe("runtime.resource.deleted",ee),u.isLoading||window.removeEventListener("beforeunload",ae),h(X("url"))&&pe(_.value),h(ce)&&(clearInterval(C),C=null)});const{bindKeyAction:k}=rd({skipDisabledKeyBindingsCheck:!0});k({modifier:td.Ctrl,primary:Rn.S},()=>{h(oe)&&Qt()});const Y=B(()=>[{name:"save-file",disabledTooltip:()=>"",isVisible:()=>h(ce),isDisabled:()=>G.value||!oe.value,icon:"save",id:"app-save-action",label:()=>t("Save"),handler:Qt}]),q=B(()=>({space:h(D),resources:[h(A)]})),re=async($e,Ze)=>{h(oe)&&(await Qt(),_t()),Ze($e)},me=$e=>{if($e.find(it=>it.id===h(A).id)){if(ue)return ue();Z()}},Ne=B(()=>[...h(g),...h(Y),...h(de).map($e=>({...$e,isVisible:Ze=>ce.value&&$e.isVisible(Ze)}))].filter($e=>$e.isVisible(h(q)))),Le=B(()=>[...h(T),...h(y)].filter($e=>$e.isVisible(h(q)))),Je=B(()=>[...h(p).map($e=>({...$e,handler:Ze=>re(Ze,$e.handler)})),...h(R)].filter($e=>$e.isVisible(h(q)))),et=B(()=>[...h(S)].filter($e=>$e.isVisible(h(q)))),tt=B(()=>{const $e=[];return h(Ne).length&&$e.push({name:"context",items:h(Ne)}),h(Le).length&&$e.push({name:"share",items:h(Le)}),h(Je).length&&$e.push({name:"actions",items:h(Je)}),h(et).length&&$e.push({name:"sidebar",items:h(et)}),$e}),_n=B(()=>[...h(Y)]);Yo.onBeforeRouteLeave(($e,Ze,it)=>{h(oe)?f({title:t("Unsaved changes"),customComponent:uS,focusTrapInitial:".oc-modal-body-actions-confirm",hideActions:!0,customComponentAttrs:()=>({closeCallback:()=>{it()}}),async onConfirm(){await Qt(),it()}}):it()});const qt=B(()=>({url:h(_),space:h(h(N).space),resource:h(A),activeFiles:h(Re),isDirty:h(oe),isReadOnly:h(G),applicationConfig:h(Ce),currentFileContext:h(N),currentContent:h(ie),isFolderLoading:h(ke),"onUpdate:resource":$e=>{D.value=h(h(N).space),A.value={...$e,...te.isShareSpaceResource(h(D))&&{remoteItemId:h(D).id}},d.value=[h(A)]},"onUpdate:currentContent":$e=>{ie.value=$e},"onRegister:onDeleteResourceCallback":$e=>{ue=$e},"onDelete:resource":()=>{h(R)[0].isVisible({space:h(D),resources:[h(A)]})&&h(R)[0].handler({space:h(D),resources:[h(A)]})},onSave:Qt,onClose:Z,loadFolderForFileContext:De,revokeUrl:pe,getUrlForResource:V}));return{...gb(),dropDownMenuSections:tt,dropDownActionOptions:q,hasAutoSave:L,isEditor:ce,closeApp:Z,fileActions:_n,loading:x,loadingError:z,pageTitle:Se,resource:A,space:D,slotAttrs:qt}}}),UM=["id"],qM=["textContent"],VM={key:3,class:"flex size-full"};function zM(e,t,r,n,i,o){const s=be("app-top-bar"),a=be("loading-screen"),l=be("error-screen"),u=be("file-side-bar");return Q(),ye("main",{id:e.applicationId,class:"app-wrapper h-full",onKeydown:t[0]||(t[0]=io((...c)=>e.closeApp&&e.closeApp(...c),["esc"]))},[fe("h1",{class:"sr-only",textContent:W.toDisplayString(e.pageTitle)},null,8,qM),!e.loading&&!e.loadingError&&e.resource?(Q(),Ae(s,{key:0,"main-actions":e.fileActions,"drop-down-menu-sections":e.dropDownMenuSections,"drop-down-action-options":e.dropDownActionOptions,"has-auto-save":e.hasAutoSave,"is-editor":e.isEditor,resource:e.resource,onClose:e.closeApp},null,8,["main-actions","drop-down-menu-sections","drop-down-action-options","has-auto-save","is-editor","resource","onClose"])):_e("",!0),e.loading?(Q(),Ae(a,{key:1})):e.loadingError?(Q(),Ae(l,{key:2,message:e.loadingError.message},null,8,["message"])):(Q(),ye("div",VM,[je(e.$slots,"default",jt({class:["app-wrapper-content size-full",{"w-[calc(100%-440px)] hidden xs:block":e.isSideBarOpen}]},e.slotAttrs)),ge(u,{"is-open":e.isSideBarOpen,"active-panel":e.sideBarActivePanel,space:e.space},null,8,["is-open","active-panel","space"])]))],40,UM)}const dS=qe(jM,[["render",zM]]);function WM(e,t){return xe({render(){return Al(dS,{wrappedComponent:e,...t},{default:r=>Al(e,r)})}})}const HM=xe({name:"ContextMenuQuickAction",props:{item:{type:Object,required:!0},resourceDomSelector:{type:Function,required:!1,default:e=>te.extractDomSelector(e.id)},title:{type:String,required:!1,default:""}},emits:["quickActionClicked"],setup(){const{$gettext:e}=Fe.useGettext(),t=B(()=>e("Show context menu")),r=le(!1);return{contextMenuLabel:t,isOpen:r}}});function GM(e,t,r,n,i,o){const s=be("oc-icon"),a=be("oc-drop"),l=be("oc-button"),u=lr("oc-tooltip");return lt((Q(),Ae(l,{id:`context-menu-trigger-${e.resourceDomSelector(e.item)}`,"data-test-context-menu-resource-name":e.item.name,"aria-label":e.contextMenuLabel,appearance:"raw",class:"quick-action-button ml-1 p-1",onClick:t[2]||(t[2]=Vt(c=>e.$emit("quickActionClicked",{event:c,dropdown:e.$refs[`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`]}),["stop","prevent"]))},{default:we(()=>[ge(s,{name:"more-2"}),ge(a,{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":"",onShowDrop:t[0]||(t[0]=c=>e.isOpen=!0),onHideDrop:t[1]||(t[1]=c=>e.isOpen=!1)},{default:we(()=>[je(e.$slots,"contextMenu",{dropRef:e.$refs[`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`],item:e.item,isOpen:e.isOpen})]),_:3},8,["drop-id","toggle","title"])]),_:3},8,["id","data-test-context-menu-resource-name","aria-label"])),[[u,e.contextMenuLabel]])}const qd=qe(HM,[["render",GM]]),KM=xe({name:"ResourceGhostElement",components:{ResourceIcon:Do},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}}}),QM={id:"ghost-element",class:"z-[var(--z-index-modal)] absolute pt-1 pl-4 bg-transparent"},XM={class:"relative rounded-sm bg-role-surface-container-high"},YM={key:0,class:"-z-10 absolute top-[3px] left-[3px] right-[-3px] bottom-[-3px] rounded-sm bg-role-surface-container-high brightness-82"},JM={key:1,class:"-z-20 absolute top-[6px] left-[6px] right-[-6px] bottom-[-6px] rounded-sm bg-role-surface-container-high brightness-72"},ZM={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 eB(e,t,r,n,i,o){const s=be("resource-icon");return Q(),ye("div",QM,[fe("div",XM,[ge(s,{class:"p-1",resource:e.previewItems[0]},null,8,["resource"]),e.showSecondLayer?(Q(),ye("div",YM)):_e("",!0),e.showThirdLayer?(Q(),ye("div",JM)):_e("",!0)]),fe("span",ZM,W.toDisplayString(e.itemCount),1)])}const Vd=qe(KM,[["render",eB]]),tB=xe({name:"ResourceSize",props:{size:{type:[String,Number],required:!0}},setup:e=>{const{current:t}=Fe.useGettext();return{formattedSize:B(()=>yr(e.size,t))}}}),rB=["textContent"];function nB(e,t,r,n,i,o){return Q(),ye("span",{textContent:W.toDisplayString(e.formattedSize)},null,8,rB)}const pS=qe(tB,[["render",nB]]),hS=xe({__name:"ResourceStatusIndicators",props:{resource:{},space:{default:()=>{}},filter:{type:Function,default:void 0}},setup(e){const t=Vp(),r=bt(),n=Ke(),{interceptModifierClick:i}=oi(),o=B(()=>{const s=bb({space:e.space,resource:e.resource,ancestorMetaData:n.ancestorMetaData,user:r.user,interceptModifierClick:i});return e.filter?s.filter(e.filter):s});return(s,a)=>o.value.length>0?(Q(),Ae(h(HL),jt({key:0},h(t),{indicators:o.value,resource:s.resource}),null,16,["indicators","resource"])):_e("",!0)}}),zd=xe({__name:"UserAvatar",props:{userId:{},userName:{}},setup(e){const t=fa(),{avatarMap:r}=Ve.storeToRefs(t),{enqueueAvatar:n}=W0(),i=B(()=>h(r)[e.userId]);return $t(()=>{n(e.userId)}),(o,s)=>{const a=be("oc-avatar");return Q(),Ae(a,{"user-name":o.userName,src:i.value,width:36},null,8,["user-name","src"])}}}),iB={class:W.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"])},oB={class:"flex flex-col items-center"},sB={class:"oc-button-group"},aB={key:0},lB=["src"],cB={class:"text-sm text-role-on-surface-variant flex items-center mt-1"},uB=["textContent"],fB=xe({__name:"AvatarUpload",setup(e){const t=bt(),r=fa(),{avatarMap:n}=Ve.storeToRefs(r),{user:i}=Ve.storeToRefs(t),{$gettext:o}=Fe.useGettext(),{showErrorMessage:s,showMessage:a}=nt(),{graphAuthenticated:l}=Ge(),{setCropperInstance:u}=nd(),c=le(null),d=le(null),f=le(null),m=le(!1),w=le(!1),v=le(!1),E=le(null),b=Jf*1024*1024,g=B(()=>!!h(n)[h(i).id]),y=H=>{const x=H.target.files?.[0];if(x){if(x.size>b){s({title:o("File size exceeds the limit of %{size}MB",{size:Jf.toString()})});return}c.value=URL.createObjectURL(x),w.value=!0}};dt(c,async H=>{H&&(await ar(),f.value&&f.value.destroy(),d.value&&(f.value=new Wa(d.value,{aspectRatio:1,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1,ready(){m.value=!0}}),u(f)))});const p=()=>f.value.getCroppedCanvas({width:256,height:256,imageSmoothingQuality:"high"}),S=async H=>await new Promise(_=>{H.toBlob(x=>_(x),"image/png")}),T=()=>{E.value?.click()},R=()=>{w.value=!1,D()},I=async()=>{const H=p(),_=await S(H),x=URL.createObjectURL(_),z=new File([_],"avatar.png",{type:"image/png",lastModified:Date.now()});try{await l.photos.updateOwnUserPhotoPatch(z),r.addAvatar(h(i).id,x),a({title:o("Profile picture was set successfully")})}catch(G){s({title:o("Failed to set profile picture"),errors:[G]})}w.value=!1,D()},A=async()=>{try{await l.photos.deleteOwnUserPhoto(),r.removeAvatar(h(i).id),a({title:o("Profile picture was removed successfully")})}catch(H){s({title:o("Failed to remove profile picture"),errors:[H]})}v.value=!1},D=()=>{f.value?.destroy(),f.value=null,E.value&&(E.value.value=""),c.value=null};return(H,_)=>{const x=be("oc-button"),z=be("oc-icon"),G=be("oc-modal");return Q(),ye("div",iB,[fe("input",{ref_key:"fileInputRef",ref:E,class:"invisible avatar-file-input",type:"file",accept:"image/jpeg, image/png",onChange:y},null,544),fe("div",oB,[ge(zd,{class:"mb-4",width:128,"user-id":h(i).id,"user-name":h(i).displayName},null,8,["user-id","user-name"]),fe("div",null,[fe("div",sB,[ge(x,{size:"small",onClick:T},{default:we(()=>[Pt(W.toDisplayString(h(o)("Upload")),1)]),_:1}),g.value?(Q(),Ae(x,{key:0,class:"avatar-upload-remove-button",size:"small",onClick:_[0]||(_[0]=ne=>v.value=!0)},{default:we(()=>[Pt(W.toDisplayString(h(o)("Remove")),1)]),_:1})):_e("",!0)])])]),w.value?(Q(),Ae(G,{key:0,title:h(o)("Crop your new profile picture"),"button-cancel-text":h(o)("Cancel"),"button-confirm-text":h(o)("Set"),"button-confirm-disabled":!m.value,"focus-trap-initial":!1,onCancel:R,onConfirm:I},{content:we(()=>[c.value?(Q(),ye("div",aB,[fe("img",{ref_key:"imageRef",ref:d,class:"max-h-[400px]",src:c.value},null,8,lB),fe("div",cB,[ge(z,{class:"mr-1",name:"information",size:"small","fill-type":"line"}),fe("span",{textContent:W.toDisplayString(h(o)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:h(o)("+-"),panKeys:h(o)("↑↓←→")}))},null,8,uB)])])):_e("",!0)]),_:1},8,["title","button-cancel-text","button-confirm-text","button-confirm-disabled"])):_e("",!0),v.value?(Q(),Ae(G,{key:1,message:h(o)("Are you sure you want to remove your profile picture?"),title:h(o)("Remove profile picture"),"button-cancel-text":h(o)("Cancel"),"button-confirm-text":h(o)("Remove"),onCancel:_[1]||(_[1]=ne=>v.value=!1),onConfirm:A},null,8,["message","title","button-cancel-text","button-confirm-text"])):_e("",!0)])}}}),dB=850,pB=xe({components:{UserAvatar:zd,ContextMenuQuickAction:qd,ResourceGhostElement:Vd,ResourceListItem:$o,ResourceSize:pS,ResourceStatusIndicators:hS,OcSpinner:VL,OcTable:o2},props:{resources:{type:Array,required:!0},resourceDomSelector:{type:Function,required:!1,default:e=>te.extractDomSelector(e.id)},arePathsDisplayed:{type:Boolean,required:!1,default:!1},areThumbnailsDisplayed:{type:Boolean,required:!1,default:!0},selectedIds:{type:Array,default:()=>[]},hasActions:{type:Boolean,required:!1,default:!0},showRenameQuickAction:{type:Boolean,required:!1,default:!0},targetRouteCallback:{type:Function,required:!1,default:void 0},areResourcesClickable:{type:Boolean,required:!1,default:!0},headerPosition:{type:Number,required:!1,default:0},isSelectable:{type:Boolean,required:!1,default:!0},isSideBarOpen:{type:Boolean,required:!1,default:!1},paddingX:{type:String,required:!1,default:"small",validator:e=>/(xsmall|small|medium|large|xlarge)/.test(e)},dragDrop:{type:Boolean,required:!1,default:!1},viewMode:{type:String,default:()=>Kt.defaultModeName,validator:e=>[Kt.name.condensedTable,Kt.name.table].includes(e)},hover:{type:Boolean,required:!1,default:!0},sortBy:{type:String,required:!1,default:void 0},fieldsDisplayed:{type:Array,required:!1,default:null},sortDir:{type:String,required:!1,default:void 0,validator:e=>e===void 0||[Ut.Asc.toString(),Ut.Desc.toString()].includes(e)},space:{type:Object,required:!1,default:null},resourceType:{type:String,default:"file"},lazy:{type:Boolean,default:!0},groupingSettings:{type:Object,required:!1,default:null}},emits:["fileClick","sort","rowMounted",Yf,"update:selectedIds","update:modelValue"],setup(e,t){const r=He(),n=er(),{getMatchingSpace:i}=rr(),{canBeOpenedWithSecureView:o}=md(),{interceptModifierClick:s}=oi(),a=si({space:le(e.space),targetRouteCallback:B(()=>e.targetRouteCallback)}),{isSticky:l}=hd(),{$gettext:u}=Fe.useGettext(),{isMobile:c}=Kw(),{isLocationPicker:d,isFilePicker:f,postMessage:m,isEnabled:w,fileTypes:v}=ei(),{getDefaultAction:E}=Hr(),b=ct(),{options:g}=Ve.storeToRefs(b),y=Oo(),{resources:p,action:S}=Ve.storeToRefs(y),T=Xn(),{userContextReady:R}=Ve.storeToRefs(T),I=Ke(),{areFileExtensionsShown:A,latestSelectedId:D,deleteQueue:H}=Ve.storeToRefs(I),_=le(),x=le(),z=le(),{width:G}=ln.useWindowSize(),ne=B(()=>n.filesTags&&G.value>=dB),ie=Wr(gr,"files-trash-overview"),{actions:ee}=Ca(),{actions:ue}=D0(),de=B(()=>h(ee)[0].handler),ce=B(()=>h(ue)[0].handler),X=$=>u("Search for tag %{tag}",{tag:$}),oe=$=>h(w)&&h(v)?.length?!h(v).includes($.extension)&&!h(v).includes($.mimeType)&&!$.isFolder:$.processing===!0||K($.id),ae=B(()=>e.resources?.filter($=>oe($)===!0)?.map($=>$.id)||[]),Ce=$=>!e.areResourcesClickable||te.isProjectSpaceResource($)&&$.disabled||!$.isFolder&&(!$.canDownload()&&!o($)||h(w)&&!h(f))?!1:!h(ae).includes($.id),Z=$=>{ze.publish("app.files.list.clicked"),t.emit("update:selectedIds",$)},N=$=>{I.toggleSelection($),Z(I.selectedIds)},O=$=>{if($.isFolder)return a.getFolderLink($);let U=e.space;U||(U=i($));const pe=E({resources:[$],space:U});if(pe?.route)return pe.route({space:U,resources:[$]})},K=$=>h(H).includes($),V=$=>h(ie)&&te.isProjectSpaceResource($)&&$.disabled?!1:!oe($);return{router:r,configOptions:g,dragItem:_,ghostElement:x,contextMenuButton:z,getTagToolTip:X,renameActions:ee,renameActionsSpace:ue,renameHandler:de,renameHandlerSpace:ce,FolderViewModeConstants:Kt,hasTags:ne,disabledResources:ae,isResourceDisabled:oe,userContextReady:R,getMatchingSpace:i,clipboardResources:p,clipboardAction:S,...Oa({space:le(e.space),targetRouteCallback:B(()=>e.targetRouteCallback)},t),...a,postMessage:m,isFilePicker:f,isLocationPicker:d,isEmbedModeEnabled:w,emitSelect:Z,toggleSelection:N,eventBus:ze,interceptModifierClick:s,areFileExtensionsShown:A,latestSelectedId:D,isResourceClickable:Ce,getResourceLink:O,isSticky:l,isResourceInDeleteQueue:K,ShareTypes:te.ShareTypes,showContextDrop:V,isMobile:c}},data(){return{constants:{ImageDimension:ni,EVENT_TROW_MOUNTED:u0}}},computed:{fields(){if(this.resources.length===0)return[];const e=this.resources[0],t=[];this.isSelectable&&t.push({name:"select",title:"",type:"slot",headerType:"slot",width:"shrink"});const r=hm(e);return t.push(...[{name:"name",title:this.$gettext("Name"),type:"slot",width:"expand",wrap:"truncate"},{name:"manager",prop:"members",title:this.$gettext("Manager"),type:"slot"},{name:"members",title:this.$gettext("Members"),prop:"members",type:"slot"},{name:"totalQuota",prop:"spaceQuota.total",title:this.$gettext("Total quota"),type:"slot",sortable:!0},{name:"usedQuota",prop:"spaceQuota.used",title:this.$gettext("Used quota"),type:"slot",sortable:!0},{name:"remainingQuota",prop:"spaceQuota.remaining",title:this.$gettext("Remaining quota"),type:"slot",sortable:!0},{name:"indicators",title:this.$gettext("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"size",title:this.$gettext("Size"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"syncEnabled",title:this.$gettext("Info"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"tags",title:this.$gettext("Tags"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedBy",title:this.$gettext("Shared by"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedWith",title:this.$gettext("Shared with"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"mdate",title:this.$gettext("Modified"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:n=>this.formatDateRelative(n.mdate)+" ("+this.formatDate(n.mdate)+")"},{name:"sdate",title:this.$gettext("Shared on"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:n=>this.formatDateRelative(n.sdate)+" ("+this.formatDate(n.sdate)+")"},{name:"ddate",title:this.$gettext("Deleted"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:n=>this.formatDateRelative(n.ddate)+" ("+this.formatDate(n.ddate)+")"}].filter(n=>{if(n.name==="tags"&&!this.hasTags)return!1;if(n.name==="indicators")return!0;let i;return n.prop?i=tc(e,n.prop)!==void 0:i=Object.prototype.hasOwnProperty.call(e,n.name),this.fieldsDisplayed?i&&this.fieldsDisplayed.includes(n.name):i}).map(n=>{const i=r.find(o=>o.name===n.name);return i&&Object.assign(n,{sortable:i.sortable,sortDir:i.sortDir}),n})),this.hasActions&&t.push({name:"actions",title:this.$gettext("Actions"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"}),t},areAllResourcesSelected(){const e=this.disabledResources.length===this.resources.length,t=this.selectedResources.length===this.resources.length-this.disabledResources.length;return!e&&t},selectAllCheckboxLabel(){return this.areAllResourcesSelected?this.$gettext("Clear selection"):this.$gettext("Select all")},selectedResources(){return this.resources.filter(e=>this.selectedIds.includes(e.id))},contextMenuLabel(){return this.$gettext("Show context menu")},dragSelection(){const e=[...this.selectedResources];return e.splice(e.findIndex(t=>t.id===this.dragItem.id),1),e}},methods:{isResourceSelected(e){return this.selectedIds.includes(e.id)},isResourceCut(e){return this.clipboardAction!==Co.Cut?!1:this.clipboardResources.some(t=>t.id===e.id)},getTagLink(e){const t=h(this.router.currentRoute).query?.term;return Ti("files-common-search",{query:{provider:"files.sdk",q_tags:e,...t&&{term:t}}})},getTagComponentAttrs(e){return this.userContextReady?{to:this.getTagLink(e)}:{}},isLatestSelectedItem(e){return e.id===this.latestSelectedId},hasRenameAction(e){return this.showRenameQuickAction?te.isProjectSpaceResource(e)?this.renameActionsSpace.filter(t=>t.isVisible({resources:[e]})).length:this.renameActions.filter(t=>t.isVisible({space:this.space,resources:[e]})).length:!1},openRenameDialog(e){if(te.isProjectSpaceResource(e))return this.renameHandlerSpace({resources:[e]});this.renameHandler({space:this.getMatchingSpace(e),resources:[e]})},openTagsSidebar(){ze.publish(Tt.open)},handleFileClick(e,t){this.interceptModifierClick(e,t)||this.$emit("fileClick",{space:this.getMatchingSpace(t),resources:[t]})},openSharingSidebar(e,t){if(t instanceof MouseEvent&&this.interceptModifierClick(t,e))return;let r;e.type==="space"?r="space-share":r="sharing",ze.publish(Tt.openWithPanel,r)},async fileDragged(e,t){this.dragDrop&&(await this.setDragItem(e,t),this.addSelectedResource(e))},fileDropped(e,t){if(!this.dragDrop||(t.dataTransfer.types||[]).some(s=>s==="Files"))return;this.dragItem=null;const o=t.target.closest("tr").dataset.itemId;this.dropRowStyling(e,!0,t),this.$emit(Yf,o)},async setDragItem(e,t){this.dragItem=e,await this.$nextTick(),this.ghostElement.$el.ariaHidden="true",this.ghostElement.$el.style.left="-99999px",this.ghostElement.$el.style.top="-99999px",t.dataTransfer.setDragImage(this.ghostElement.$el,0,0),t.dataTransfer.dropEffect="move",t.dataTransfer.effectAllowed="move"},dropRowStyling(e,t,r){if((r.dataTransfer?.types||[]).some(s=>s==="Files")||r.currentTarget?.contains(r.relatedTarget))return;const i=document.getElementsByClassName(`oc-tbody-tr-${e}`)[0].classList,o="highlightedDropTarget";t?i.remove(o):i.add(o)},sort(e){this.$emit("sort",e)},addSelectedResource(e){this.isResourceSelected(e)||this.toggleSelection(e.id)},showContextMenuOnBtnClick(e,t){const{dropdown:r,event:n}=e;if(!(n instanceof MouseEvent&&this.interceptModifierClick(n,t))){if(this.isResourceDisabled(t))return!1;r?.tippy!==void 0&&(this.isResourceSelected(t)||this.emitSelect([t.id]),Io(r.tippy,n,this.contextMenuButton))}},showContextMenu(e,t,r){if(t instanceof MouseEvent&&this.interceptModifierClick(t,r))return;if(t.preventDefault(),this.isResourceDisabled(r))return!1;const n=e.$el.getElementsByClassName("resource-table-btn-action-dropdown")[0];if(n!==void 0){if(this.isResourceSelected(r)||this.emitSelect([r.id]),this.isMobile){document.getElementById(`context-menu-trigger-${r.getDomSelector()}`)?.click();return}Io(n._tippy,t,this.contextMenuButton)}},rowMounted(e,t){this.$emit("rowMounted",e,t,this.constants.ImageDimension.Thumbnail)},fileClicked(e){const t=e[0];if(this.isResourceDisabled(t))return;if(this.isEmbedModeEnabled&&this.isFilePicker&&!t.isFolder)return this.postMessage("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(t)),locationQuery:JSON.parse(JSON.stringify(ga(h(this.router.currentRoute))))});const r=e[1],n=e[2]??!1;!r.shiftKey&&!r.metaKey&&!r.ctrlKey&&ze.publish("app.files.shiftAnchor.reset");const i=(r?.target).getAttribute("type")==="checkbox";if(r?.target?.closest("div")?.id!=="oc-files-context-menu"){if(r&&r.metaKey)return ze.publish("app.files.list.clicked.meta",t);if(r&&r.shiftKey)return ze.publish("app.files.list.clicked.shift",{resource:t,skipTargetSelection:n});if(!i&&!this.isResourceSelected(t))return this.emitSelect([t.id])}},formatDate(e){return db(new Date(e),this.$language.current)},formatDateRelative(e){return hb(new Date(e),this.$language.current)},toggleSelectionAll(){if(this.areAllResourcesSelected)return this.emitSelect([]);this.emitSelect(this.resources.filter(e=>!this.disabledResources.includes(e.id)).map(e=>e.id))},emitFileClick(e,t){if(this.interceptModifierClick(t,e))return;const r=this.getMatchingSpace(e);this.$emit("fileClick",{space:r,resources:[e]})},getResourceCheckboxLabel(e){return e.type==="folder"?this.$gettext("Select folder"):this.$gettext("Select file")},getSharedWithAvatarDescription(e){if(!te.isShareResource(e))return;const t=e.type==="folder"?this.$gettext("folder"):this.$gettext("file"),r=e.sharedWith.filter(({shareType:n})=>te.ShareTypes.authenticated.includes(te.ShareTypes.getByValue(n))).length;return r?this.$ngettext("This %{ resourceType } is shared via %{ shareCount } invite","This %{ resourceType } is shared via %{ shareCount } invites",r,{resourceType:t,shareCount:r.toString()}):""},getSharedByAvatarDescription(e){if(!te.isShareResource(e))return"";const t=e.type==="folder"?this.$gettext("folder"):this.$gettext("file");return this.$gettext("This %{ resourceType } is shared by %{ user }",{resourceType:t,user:e.sharedBy.map(({displayName:r})=>r).join(", ")})},getSharedByAvatarItems(e){return te.isShareResource(e)?e.sharedBy.map(t=>({displayName:t.displayName,name:t.displayName,avatarType:te.ShareTypes.user.key,username:t.id,userId:t.id})):[]},getSharedWithAvatarItems(e){return te.isShareResource(e)?e.sharedWith.filter(({shareType:t})=>te.ShareTypes.authenticated.includes(te.ShareTypes.getByValue(t))).map(t=>({displayName:t.displayName,name:t.displayName,avatarType:te.ShareTypes.getByValue(t.shareType).key,username:t.id,userId:t.id})):[]}}}),hB={class:"resource-table-select-all flex justify-center items-center"},mB={class:"truncate"},gB=["textContent"],yB=["textContent"],vB=["textContent"],bB={key:0,class:"flex items-center justify-end flex-row flex-nowrap"};function wB(e,t,r,n,i,o){const s=be("oc-checkbox"),a=be("oc-spinner"),l=be("resource-list-item"),u=be("oc-icon"),c=be("oc-button"),d=be("resource-size"),f=be("oc-tag"),m=be("resource-status-indicators"),w=be("user-avatar"),v=be("oc-avatars"),E=be("context-menu-quick-action"),b=be("oc-table"),g=be("resource-ghost-element"),y=lr("oc-tooltip");return Q(),ye(Ue,null,[ge(b,jt(e.$attrs,{id:"files-space-table",class:[{condensed:e.viewMode===e.FolderViewModeConstants.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:e.fields,highlighted:e.selectedIds,disabled:e.disabledResources,sticky:e.isSticky,"header-position":e.headerPosition,"drag-drop":e.dragDrop,hover:e.hover,"item-dom-selector":e.resourceDomSelector,selection:e.selectedResources,"sort-by":e.sortBy,"sort-dir":e.sortDir,lazy:e.lazy,"grouping-settings":e.groupingSettings,"padding-x":"medium",onHighlight:e.fileClicked,onRowMounted:e.rowMounted,onContextmenuClicked:e.showContextMenu,onItemDropped:e.fileDropped,onItemDragged:e.fileDragged,onDropRowStyling:e.dropRowStyling,onSort:e.sort,"onUpdate:modelValue":t[1]||(t[1]=p=>e.$emit("update:modelValue",p))}),jp({name:we(({item:p})=>[fe("div",{class:W.normalizeClass(["resource-table-resource-wrapper flex items-center",[{"resource-table-resource-wrapper-limit-max-width":e.hasRenameAction(p)}]])},[je(e.$slots,"image",{resource:p}),(Q(),Ae(l,{key:`${p.path}-${e.resourceDomSelector(p)}-${p.thumbnail}`,resource:p,"path-prefix":e.getPathPrefix(p),"is-path-displayed":e.arePathsDisplayed,"parent-folder-name":e.getParentFolderName(p),"is-icon-displayed":!e.$slots.image,"is-extension-displayed":e.areFileExtensionsShown,"is-resource-clickable":e.isResourceClickable(p),link:e.getResourceLink(p),"parent-folder-link":e.getParentFolderLink(p),"parent-folder-link-icon-additional-attributes":e.getParentFolderLinkIconAdditionalAttributes(p),class:W.normalizeClass({"opacity-70":e.isResourceCut(p)}),onClick:S=>e.emitFileClick(p)},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"])),e.hasRenameAction(p)?(Q(),Ae(c,{key:0,class:"resource-table-edit-name inline-flex raw-hover-surface p-1 ml-1",appearance:"raw",onClick:Vt(S=>{e.interceptModifierClick(S,p)||e.openRenameDialog(p)},["stop"])},{default:we(()=>[ge(u,{name:"edit-2","fill-type":"line",size:"small",color:"var(--oc-role-on-surface)"})]),_:1},8,["onClick"])):_e("",!0)],2),je(e.$slots,"additionalResourceContent",{resource:p})]),syncEnabled:we(({item:p})=>[je(e.$slots,"syncEnabled",{resource:p})]),size:we(({item:p})=>[ge(d,{size:p.size||Number.NaN},null,8,["size"])]),tags:we(({item:p})=>[(Q(!0),ye(Ue,null,mt(p.tags.slice(0,2),S=>(Q(),Ae(jr(e.userContextReady?"router-link":"span"),jt({key:S},{ref_for:!0},e.getTagComponentAttrs(S),{class:"resource-table-tag-wrapper"}),{default:we(()=>[lt((Q(),Ae(f,{class:"resource-table-tag ml-1 max-w-20",rounded:!0,size:"small"},{default:we(()=>[ge(u,{name:"price-tag-3",size:"small"}),fe("span",mB,W.toDisplayString(S),1)]),_:2},1024)),[[y,e.getTagToolTip(S)]])]),_:2},1040))),128)),p.tags.length>2?(Q(),Ae(f,{key:0,size:"small",class:"resource-table-tag-more align-text-bottom cursor-pointer",onClick:t[0]||(t[0]=S=>e.openTagsSidebar())},{default:we(()=>[Pt(" + "+W.toDisplayString(p.tags.length-2),1)]),_:2},1024)):_e("",!0)]),manager:we(({item:p})=>[je(e.$slots,"manager",{resource:p})]),members:we(({item:p})=>[je(e.$slots,"members",{resource:p})]),totalQuota:we(({item:p})=>[je(e.$slots,"totalQuota",{resource:p})]),usedQuota:we(({item:p})=>[je(e.$slots,"usedQuota",{resource:p})]),remainingQuota:we(({item:p})=>[je(e.$slots,"remainingQuota",{resource:p})]),mdate:we(({item:p})=>[lt(fe("span",{tabindex:"0",textContent:W.toDisplayString(e.formatDateRelative(p.mdate))},null,8,gB),[[y,e.formatDate(p.mdate)]])]),indicators:we(({item:p})=>[ge(m,{space:e.space,resource:p,"disable-handler":e.isResourceDisabled(p)},null,8,["space","resource","disable-handler"])]),sdate:we(({item:p})=>[lt(fe("span",{tabindex:"0",textContent:W.toDisplayString(e.formatDateRelative(p.sdate))},null,8,yB),[[y,e.formatDate(p.sdate)]])]),ddate:we(({item:p})=>[lt(fe("p",{tabindex:"0",class:"m-0",textContent:W.toDisplayString(e.formatDateRelative(p.ddate))},null,8,vB),[[y,e.formatDate(p.ddate)]])]),sharedBy:we(({item:p})=>[ge(c,{appearance:"raw-inverse","no-hover":"",onClick:Vt(S=>{e.interceptModifierClick(S,p)||e.openSharingSidebar(p,S)},["stop"])},{default:we(()=>[ge(v,{class:"flex items-center justify-end flex-row flex-nowrap","is-tooltip-displayed":!0,items:e.getSharedByAvatarItems(p),"accessible-description":e.getSharedByAvatarDescription(p),"hover-effect":""},{userAvatars:we(({avatars:S,width:T})=>[(Q(!0),ye(Ue,null,mt(S,R=>(Q(),Ae(w,{key:R.userId,"user-id":R.userId,"user-name":R.displayName,width:T},null,8,["user-id","user-name","width"]))),128))]),_:1},8,["items","accessible-description"])]),_:2},1032,["onClick"])]),sharedWith:we(({item:p})=>[ge(c,{appearance:"raw-inverse",class:"resource-table-shared-with","no-hover":"",onClick:Vt(S=>{e.interceptModifierClick(S,p)||e.openSharingSidebar(p,S)},["stop"])},{default:we(()=>[ge(v,{class:"flex items-center justify-end flex-row flex-nowrap",items:e.getSharedWithAvatarItems(p),stacked:!0,"max-displayed":3,"is-tooltip-displayed":!0,"accessible-description":e.getSharedWithAvatarDescription(p),"hover-effect":""},{userAvatars:we(({avatars:S,width:T})=>[(Q(!0),ye(Ue,null,mt(S,R=>(Q(),Ae(w,{key:R.userId,"user-id":R.userId,"user-name":R.displayName,width:T},null,8,["user-id","user-name","width"]))),128))]),_:1},8,["items","accessible-description"])]),_:2},1032,["onClick"])]),actions:we(({item:p})=>[e.showContextDrop(p)?(Q(),ye("div",bB,[je(e.$slots,"quickActions",{resource:p}),ge(E,{ref:"contextMenuButton",title:p.name,item:p,"resource-dom-selector":e.resourceDomSelector,class:"resource-table-btn-action-dropdown",onQuickActionClicked:S=>e.showContextMenuOnBtnClick(S,p)},{contextMenu:we(({isOpen:S,dropRef:T})=>[je(e.$slots,"contextMenu",{dropRef:T,resource:p,isOpen:S})]),_:2},1032,["title","item","resource-dom-selector","onQuickActionClicked"])])):_e("",!0)]),_:2},[!e.isLocationPicker&&!e.isFilePicker?{name:"selectHeader",fn:we(()=>[fe("div",hB,[lt(ge(s,{id:"resource-table-select-all",size:"large",label:e.selectAllCheckboxLabel,disabled:e.resources.length===e.disabledResources.length,"label-hidden":!0,"model-value":e.areAllResourcesSelected,onClick:Vt(e.toggleSelectionAll,["stop"])},null,8,["label","disabled","model-value","onClick"]),[[y,{content:e.selectAllCheckboxLabel,placement:"bottom"}]])])]),key:"0"}:void 0,!e.isLocationPicker&&!e.isFilePicker?{name:"select",fn:we(({item:p})=>[e.isResourceInDeleteQueue(p.id)?(Q(),Ae(a,{key:0,class:"inline-flex ml-1",size:"medium","aria-label":e.$gettext("File is being processed")},null,8,["aria-label"])):(Q(),Ae(s,{key:1,id:`resource-table-select-${e.resourceDomSelector(p)}`,label:e.getResourceCheckboxLabel(p),"label-hidden":!0,size:"large",disabled:e.isResourceDisabled(p),"model-value":e.isResourceSelected(p),outline:e.isLatestSelectedItem(p),"data-test-selection-resource-name":p.name,"data-test-selection-resource-path":p.path,onClick:Vt(S=>{e.interceptModifierClick(S,p)||e.toggleSelection(p.id)},["stop"])},null,8,["id","label","disabled","model-value","outline","data-test-selection-resource-name","data-test-selection-resource-path","onClick"]))]),key:"1"}:void 0,e.$slots.footer?{name:"footer",fn:we(()=>[je(e.$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","grouping-settings","onHighlight","onRowMounted","onContextmenuClicked","onItemDropped","onItemDragged","onDropRowStyling","onSort"]),e.dragItem?(Q(),Ae(Np,{key:0,to:"body"},[ge(g,{ref:"ghostElement","preview-items":[e.dragItem,...e.dragSelection]},null,8,["preview-items"])])):_e("",!0)],64)}const SB=qe(pB,[["render",wB]]),EB={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"},TB={class:"z-10 absolute top-0 left-0 [&_input]:not-[.oc-checkbox-checked]:bg-role-surface-container"},AB={key:0,class:"oc-tile-card-loading-spinner z-990 m-2"},RB=["textContent"],CB=["aria-label"],IB={class:"flex justify-between items-center"},_B={class:"flex items-center truncate resource-name-wrapper text-role-on-surface overflow-hidden"},OB={class:"flex items-center"},PB={key:0,class:"text-left my-0 truncate"},kB=["textContent"],mS=xe({__name:"ResourceTile",props:{resource:{},resourceRoute:{},isResourceSelected:{type:Boolean,default:!1},isResourceClickable:{type:Boolean,default:!0},isResourceDisabled:{type:Boolean,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},resourceIconSize:{default:"xlarge"},lazy:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1}},emits:["click","contextmenu","itemVisible"],setup(e,{emit:t}){const r=t,{toggleTile:n}=z0(),{$gettext:i}=Fe.useGettext(),o=Wn("observerTarget"),s=B(()=>h(o)?.$el),a=B(()=>e.resource.locked||e.resource.processing),l=B(()=>e.resource.locked?{name:"lock",fillType:"fill"}:e.resource.processing?{name:"loop-right",fillType:"line"}:{}),u=B(()=>e.resource.locked?i("This item is locked"):null),c=B(()=>te.isSpaceResource(e.resource)?e.resource.description:""),{isVisible:d}=e.lazy?Gw({target:s,onVisibleCallback:()=>r("itemVisible")}):{isVisible:le(!0)},f=B(()=>!h(d));return e.lazy||r("itemVisible"),(m,w)=>{const v=be("oc-spinner"),E=be("oc-tag"),b=be("oc-image"),g=be("oc-icon"),y=lr("oc-tooltip");return Q(),Ae(h(Ed),{ref_key:"observerTarget",ref:o,"body-class":"p-0",class:W.normalizeClass(["oc-tile-card flex flex-col h-full shadow-none",{"oc-tile-card-selected bg-role-secondary-container outline-2 outline-role-outline":m.isResourceSelected,"bg-role-surface-container hover:bg-role-surface-container-highest outline outline-role-surface-container-highest":!m.isResourceSelected,"oc-tile-card-disabled opacity-70 grayscale-60 pointer-events-none":m.isResourceDisabled&&!h(te.isProjectSpaceResource)(m.resource),"state-trashed [&_.tile-preview]:opacity-80 [&_.tile-default-image_svg]:opacity-80 [&_.tile-preview]:grayscale [&_.tile-default-image_svg]:grayscale":m.isResourceDisabled&&h(te.isProjectSpaceResource)(m.resource)}]),"data-item-id":m.resource.id,onContextmenu:w[4]||(w[4]=p=>m.$emit("contextmenu",p))},{default:we(()=>[f.value?(Q(),ye("div",EB)):(Q(),ye(Ue,{key:1},[ge(fd,{class:"oc-card-media-top flex justify-center items-center m-0 w-full relative aspect-[16/9]",resource:m.resource,link:m.resourceRoute,"is-resource-clickable":m.isResourceClickable,tabindex:"-1",onClick:w[1]||(w[1]=p=>m.$emit("click",p))},{default:we(()=>[fe("div",TB,[m.isLoading?(Q(),ye("div",AB,[ge(v,{"aria-label":h(i)("File is being processed")},null,8,["aria-label"])])):je(m.$slots,"selection",{key:1,item:m.resource})]),m.isResourceDisabled&&h(te.isProjectSpaceResource)(m.resource)?(Q(),Ae(E,{key:0,class:"z-10 absolute text-role-on-surface",type:"span"},{default:we(()=>[fe("span",{textContent:W.toDisplayString(h(i)("Disabled"))},null,8,RB)]),_:1})):_e("",!0),lt((Q(),ye("div",{class:W.normalizeClass(["oc-tile-card-preview flex items-center justify-center text-center size-full absolute",{"p-2":m.isResourceSelected,"hover:p-2":!m.isResourceSelected}]),"aria-label":u.value},[je(m.$slots,"imageField",{item:m.resource},()=>[m.resource.thumbnail?(Q(),Ae(b,{key:0,class:W.normalizeClass(["tile-preview rounded-t-sm size-full object-cover aspect-[16/9] pointer-events-none",{"rounded-sm":m.isResourceSelected,"hover:rounded-sm":!m.isResourceSelected}]),src:m.resource.thumbnail,"data-test-thumbnail-resource-name":m.resource.name,onClick:w[0]||(w[0]=p=>h(n)([m.resource,p]))},null,8,["class","src","data-test-thumbnail-resource-name"])):(Q(),Ae(Do,{key:1,resource:m.resource,size:m.resourceIconSize,class:"tile-default-image pt-1 relative"},jp({_:2},[a.value?{name:"status",fn:we(()=>[ge(g,jt(l.value,{size:"xsmall"}),null,16)]),key:"0"}:void 0]),1032,["resource","size"]))])],10,CB)),[[y,u.value]])]),_:3},8,["resource","link","is-resource-clickable"]),fe("div",{class:"p-2",onClick:w[3]||(w[3]=Vt(p=>h(n)([m.resource,p]),["stop"]))},[fe("div",IB,[fe("div",_B,[ge($o,{resource:m.resource,"is-icon-displayed":!1,"is-extension-displayed":m.isExtensionDisplayed,"is-resource-clickable":m.isResourceClickable,link:m.resourceRoute,onClick:w[2]||(w[2]=Vt(p=>m.$emit("click",p),["stop"]))},null,8,["resource","is-extension-displayed","is-resource-clickable","link"])]),fe("div",OB,[je(m.$slots,"indicators",{item:m.resource,class:"resource-indicators"}),je(m.$slots,"actions",{item:m.resource}),je(m.$slots,"contextMenu",{item:m.resource})])]),c.value?(Q(),ye("p",PB,[fe("span",{class:"text-sm",textContent:W.toDisplayString(c.value)},null,8,kB)])):_e("",!0)])],64))]),_:3},8,["data-item-id","class"])}}}),FB={id:"tiles-view",class:"px-4 pt-2"},xB={class:"flex items-center mb-2 pb-2 oc-tiles-controls"},NB={key:0,class:"oc-tiles-sort"},DB={key:0,class:"flex"},$B={class:"p-1 text-sm"},LB=qe(xe({__name:"ResourceTiles",props:{resources:{default:()=>[]},selectedIds:{default:()=>[]},targetRouteCallback:{type:Function},space:{},sortFields:{default:()=>[]},sortBy:{},sortDir:{},viewSize:{default:()=>Kt.tilesSizeDefault},dragDrop:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0}},emits:["fileDropped","rowMounted","sort","itemVisible","update:selectedIds"],setup(e,{emit:t}){const r=t,{$gettext:n}=Fe.useGettext(),i=He(),o=Ke(),{getDefaultAction:s}=Hr(),{getMatchingSpace:a}=rr(),{interceptModifierClick:l}=oi(),{canBeOpenedWithSecureView:u}=md(),{isEnabled:c,fileTypes:d,isLocationPicker:f,isFilePicker:m,postMessage:w}=ei(),v=gd(),E=B(()=>Math.min(h(v),e.viewSize)),b=window.__E2E__===!0?!1:e.lazy,g=B(()=>o.areFileExtensionsShown),y=B(()=>h(Ye)?n("Clear selection"):n("Select all")),p=le(),S=le(),T=le({tiles:{},dropBtns:{}}),R=Oa({space:le(e.space),targetRouteCallback:B(()=>e.targetRouteCallback)},{emit:r}),I=he=>{if(te.isSpaceResource(he))return he.disabled?null:Pr("files-spaces-generic",tn(he,{path:"",fileId:he.fileId}));if(he.isFolder)return R.createFolderLink({path:he.path,fileId:he.fileId,resource:he});let Pe=e.space;Pe||(Pe=a(he));const We=s({resources:[he],space:Pe});return We?.route?We.route({space:Pe,resources:[he]}):null},A=(he,Pe)=>{if(!(Pe&&l(Pe,he))){if(h(c)&&h(m))return w("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(he)),locationQuery:JSON.parse(JSON.stringify(ga(h(i.currentRoute))))});Pe&&!Pe.shiftKey&&!Pe.ctrlKey&&!Pe.metaKey&&X(he),he.type!=="space"&&he.type!=="folder"&&R.createFileAction(he)}},D=(he,Pe,We)=>{const{dropdown:Xe,event:at}=he;at&&l(at,Pe)||Xe?.tippy!==void 0&&(o.setSelection([Pe.id]),Io(Xe.tippy,at,h(T).dropBtns[We]))},H=he=>e.selectedIds.includes(he.id),_=B(()=>e.resources.filter(he=>e.selectedIds.includes(he.id))),x=he=>z(he)||G(he)?!1:he.isFolder?!0:!(!he.canDownload()&&!u(he)||h(c)&&!h(m)),z=he=>h(c)&&h(d)?.length?!h(d).includes(he.extension)&&!h(d).includes(he.mimeType)&&!he.isFolder:Qe(he.id)?!0:he.processing===!0,G=he=>z(he)?!0:te.isSpaceResource(he)&&he.disabled,ne=B(()=>e.resources?.filter(he=>z(he)===!0)?.map(he=>he.id)||[]),ie=he=>{r("update:selectedIds",he)},ee=()=>{if(h(Ye))return r("update:selectedIds",[]);r("update:selectedIds",e.resources.filter(he=>!h(ne).includes(he.id)).map(he=>he.id))},ue=(he,Pe,We)=>{if(he instanceof MouseEvent&&l(he,Pe))return;he.preventDefault();const Xe=h(T).tiles[Pe.id]?.$el.getElementsByClassName("resource-tiles-btn-action-dropdown")[0];Xe!==void 0&&(H(Pe)||ie([Pe.id]),Io(Xe._tippy,he,We))},de=(he,Pe)=>{if(l(he,Pe)){X(Pe);return}A(Pe,he)},ce=(he,Pe)=>{const We=he[0],Xe=he[1];if(Xe&&Xe.metaKey)return ze.publish("app.files.list.clicked.meta",We);if(!Xe.shiftKey&&!Xe.metaKey&&!Xe.ctrlKey&&ze.publish("app.files.shiftAnchor.reset"),Xe&&Xe.shiftKey)return ze.publish("app.files.list.clicked.shift",{resource:We,skipTargetSelection:!1});X(We)},X=he=>{const Pe=H(he)?e.selectedIds.filter(We=>We!==he.id):[...e.selectedIds,he.id];r("update:selectedIds",Pe)},oe=he=>{switch(he.type){case"folder":return n("Select folder");case"space":return n("Select space");default:return n("Select file")}},ae=B(()=>e.sortFields.find(he=>he.name===e.sortBy&&he.sortDir===e.sortDir)||e.sortFields[0]),Ce=he=>{r("sort",{sortBy:he.name,sortDir:he.sortDir})},Z=B(()=>{const he={1:"xlarge",2:"xlarge",3:"xxlarge",4:"xxlarge",5:"xxxlarge",6:"xxxlarge"},Pe=h(E);return he[Pe]??"xxlarge"});BE(()=>{T.value={tiles:{},dropBtns:{}}});const N=(he,Pe,We)=>{if((We.dataTransfer?.types||[]).some(_t=>_t==="Files")||We.currentTarget?.contains(We.relatedTarget)||e.selectedIds.includes(he.id)||he.type!=="folder")return;const at=h(T).tiles[he.id];if(Pe){at.$el.classList.remove("bg-role-secondary-container");return}at.$el.classList.add("bg-role-secondary-container")},O=B(()=>e.selectedIds.filter(he=>he!==h(p).id)),K=async(he,Pe)=>{p.value=he,await ar(),h(S).$el.ariaHidden="true",h(S).$el.style.left="-99999px",h(S).$el.style.top="-99999px",Pe.dataTransfer.setDragImage(h(S).$el,0,0),Pe.dataTransfer.dropEffect="move",Pe.dataTransfer.effectAllowed="move"},V=async(he,Pe)=>{H(he)||X(he),await K(he,Pe)},$=(he,Pe)=>{(Pe.dataTransfer.types||[]).some(Xe=>Xe==="Files")||(p.value=null,N(he,!0,Pe),r("fileDropped",he.id))},U=le(0),pe=()=>{const he=document.getElementById("tiles-view"),Pe=getComputedStyle(he),We=parseInt(Pe.getPropertyValue("padding-left"),10)|0,Xe=parseInt(Pe.getPropertyValue("padding-right"),10)|0;U.value=he.clientWidth-We-Xe},Re=B(()=>parseFloat(getComputedStyle(document.documentElement).fontSize)),{calculateTileSizePixels:De}=q0(),ke=B(()=>{const he=[...Array(Kt.tilesSizeMax).keys()].map(Pe=>Pe+1);return[...new Set(he.map(Pe=>{const We=De(Pe);return We?Math.round(h(U)/(We+h(Re))):0}))]}),Oe=B(()=>{const he=h(ke);return he.length<h(E)?he[he.length-1]:he[h(E)-1]}),Be=B(()=>{const he=h(Oe)?e.resources.length%h(Oe):0;return he?h(Oe)-he:0}),Se=B(()=>h(U)/h(Oe)-h(Re)),Ye=B(()=>{const he=h(ne).length===e.resources.length,Pe=h(_).length===e.resources.length-h(ne).length;return!he&&Pe}),Qe=he=>o.deleteQueue.includes(he);return dt(Se,he=>{document.documentElement.style.setProperty("--oc-size-tiles-actual",`${he}px`)},{immediate:!0}),dt(ke,he=>{v.value=Math.max(he.length,1)}),$t(()=>{window.addEventListener("resize",pe),pe()}),ze.subscribe("app.files.list.clicked.default",he=>{x(he)&&ie([he.id])}),mr(()=>{window.removeEventListener("resize",pe)}),(he,Pe)=>{const We=be("oc-checkbox"),Xe=be("oc-icon"),at=be("oc-button"),_t=be("oc-list"),wt=be("oc-filter-chip"),Qt=lr("oc-tooltip");return Q(),ye("div",FB,[fe("div",xB,[lt(ge(We,{id:"tiles-view-select-all",class:"ml-2",size:"large",label:y.value,"label-hidden":!0,disabled:he.resources.length===ne.value.length,"model-value":Ye.value,onClick:Vt(ee,["stop"])},null,8,["label","disabled","model-value"]),[[Qt,y.value]]),he.sortFields.length?(Q(),ye("div",NB,[ge(wt,{class:"[&_.oc-filter-chip-label]:text-sm","filter-label":h(n)("Sort by"),"selected-item-names":[ae.value.label],"has-active-state":!1,"close-on-click":"",raw:""},{default:we(()=>[ge(_t,null,{default:we(()=>[(Q(!0),ye(Ue,null,mt(he.sortFields,(L,C)=>(Q(),ye("li",{key:C},[ge(at,{appearance:ae.value===L?"filled":"raw-inverse","color-role":ae.value===L?"secondaryContainer":"surface","no-hover":ae.value===L,"justify-content":"space-between",class:"oc-tiles-sort-filter-chip-item",onClick:k=>Ce(L)},{default:we(()=>[fe("span",null,W.toDisplayString(L.label),1),L===ae.value?(Q(),ye("div",DB,[ge(Xe,{name:"check"})])):_e("",!0)]),_:2},1032,["appearance","color-role","no-hover","onClick"])]))),128))]),_:1})]),_:1},8,["filter-label","selected-item-names"])])):_e("",!0)]),ge(_t,{class:"oc-tiles grid justify-start gap-3"},{default:we(()=>[(Q(!0),ye(Ue,null,mt(he.resources,L=>(Q(),ye("li",{key:L.id,class:"oc-tiles-item has-item-context-menu"},[ge(mS,{ref_for:!0,ref:C=>T.value.tiles[L.id]=C,resource:L,"resource-route":I(L),"is-resource-selected":H(L),"is-resource-clickable":x(L),"is-resource-disabled":z(L)||G(L),"is-extension-displayed":g.value,"resource-icon-size":Z.value,draggable:he.dragDrop,lazy:h(b),"is-loading":Qe(L.id),onVnodeMounted:C=>he.$emit("rowMounted",L,T.value.tiles[L.id],h(ni).Tile),onContextmenu:C=>ue(C,L,T.value.tiles[L.id]),onClick:Vt(C=>de(C,L),["stop"]),onDragstart:C=>V(L,C),onDragenter:Vt(C=>N(L,!1,C),["prevent"]),onDragleave:Vt(C=>N(L,!0,C),["prevent"]),onDrop:C=>$(L,C),onDragover:Pe[0]||(Pe[0]=C=>C.preventDefault()),onItemVisible:C=>he.$emit("itemVisible",L)},{selection:we(()=>[!h(f)&&!h(m)?(Q(),Ae(We,{key:0,label:oe(L),"label-hidden":!0,size:"large",class:"inline-flex p-2.5",disabled:z(L),"model-value":H(L),"data-test-selection-resource-name":L.name,"data-test-selection-resource-path":L.path,onClick:Vt(C=>ce([L,C]),["stop","prevent"])},null,8,["label","disabled","model-value","data-test-selection-resource-name","data-test-selection-resource-path","onClick"])):_e("",!0)]),imageField:we(()=>[je(he.$slots,"image",{resource:L},void 0,!0)]),indicators:we(()=>[ge(hS,{space:he.space,resource:L,filter:C=>["system","sharing"].includes(C.category),"disable-handler":z(L)},null,8,["space","resource","filter","disable-handler"])]),actions:we(()=>[je(he.$slots,"actions",{resource:L},void 0,!0)]),contextMenu:we(()=>[h(te.isSpaceResource)(L)||!z(L)?(Q(),Ae(h(qd),{key:0,ref_for:!0,ref:C=>T.value.dropBtns[L.id]=C,item:L,title:L.name,class:"resource-tiles-btn-action-dropdown",onQuickActionClicked:C=>D(C,L,L.id)},{contextMenu:we(({isOpen:C,dropRef:k})=>[je(he.$slots,"contextMenu",{resource:L,isOpen:C,dropRef:k},void 0,!0)]),_:2},1032,["item","title","onQuickActionClicked"])):_e("",!0)]),_:2},1032,["resource","resource-route","is-resource-selected","is-resource-clickable","is-resource-disabled","is-extension-displayed","resource-icon-size","draggable","lazy","is-loading","onVnodeMounted","onContextmenu","onClick","onDragstart","onDragenter","onDragleave","onDrop","onItemVisible"])]))),128)),(Q(!0),ye(Ue,null,mt(Be.value,L=>(Q(),ye("li",{key:`ghost-tile-${L}`,class:"list-item","aria-hidden":!0}))),128))]),_:3}),p.value?(Q(),Ae(Np,{key:0,to:"body"},[ge(Vd,{ref_key:"ghostElementRef",ref:S,"preview-items":[p.value,...O.value]},null,8,["preview-items"])])):_e("",!0),fe("div",$B,[je(he.$slots,"footer",{},void 0,!0)])])}}}),[["__scopeId","data-v-0d2a5892"]]),MB=xe({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:r}){const n=He(),{current:i}=Fe.useGettext(),o=zt(),s=le(),a=le(e.items),l=le(),u=le(),c=le(!1),d=le(),f=`q_${e.filterName}`,m=tr(f),w=_=>_[e.idAttribute],v=()=>n.push({query:{...xi(h(o).query,[f]),...h(s)&&{[f]:w(h(s))}}}),E=_=>h(s)&&w(h(s))===w(_),b=()=>{l.value=void 0,u.value=void 0},g=async _=>{b(),E(_)?s.value=void 0:(s.value=_,h(d).hideDrop()),await v(),t("selectionChange",h(s))},y=()=>{s.value=void 0,c.value=!1,b(),t("selectionChange",h(s)),v()},p=()=>{a.value=e.items},S=()=>{c.value=!1},T=()=>{const _=Rt(h(m));if(!_)return;const x=e.items.find(z=>w(z)===_);if(x){s.value=x;return}if(h(R)){const z=_.replace("range:",""),G=Number(z.split(" - ")[0]),ne=Number(z.split(" - ")[1]);l.value=Mt.DateTime.fromMillis(G),u.value=Mt.DateTime.fromMillis(ne),s.value=h(A)}},R=B(()=>Rt(h(m))?.startsWith("range:")),I=B(()=>!h(l)||!h(u)?!1:h(l)<=h(u)),A=B(()=>{if(!h(l)||!h(u))return null;const _=Zn(h(l),i,Mt.DateTime.DATE_SHORT),x=Zn(h(u),i,Mt.DateTime.DATE_SHORT),z=h(l).toMillis(),G=h(u).toMillis();return{[e.idAttribute]:`range:${z} - ${G}`,[e.displayNameAttribute]:`${_} - ${x}`}}),D=async()=>{s.value=h(A),await v(),h(d).hideDrop(),t("selectionChange",h(s))},H=({date:_,error:x},z)=>{if(x){console.error("date could not be set");return}const G=z==="from"?l:u;if(!_){G.value=void 0;return}const ne=z==="from"?_.startOf("day"):_.endOf("day");G.value=ne};return r({setSelectedItemsBasedOnQuery:T}),$t(()=>{T()}),{clearFilter:y,displayedItems:a,isItemSelected:E,selectedItem:s,onShowDrop:p,onHideDrop:S,filterChip:d,toggleItemSelection:g,setSelectedItemsBasedOnQuery:T,fromDate:l,toDate:u,dateRangeValid:I,applyDateRangeFilter:D,dateRangeApplied:R,setDateRangeDate:H,dateRangeClicked:c,queryParam:f}}}),BB={class:"flex items-center truncate"},jB={class:"truncate ml-2"},UB={class:"flex"},qB={class:"my-1"},VB={class:"flex items-center truncate"},zB={class:"truncate ml-2"},WB=["textContent"],HB={class:"flex"},GB={class:"flex items-center justify-between mb-4"},KB=["textContent"],QB={class:"mt-2"},XB={class:"date-filter-apply-btn text-end"};function YB(e,t,r,n,i,o){const s=be("oc-icon"),a=be("oc-button"),l=be("oc-list"),u=be("oc-datepicker"),c=be("oc-filter-chip");return Q(),ye("div",{class:W.normalizeClass(["date-filter flex overflow-hidden [&_label]:text-sm",`date-filter-${e.filterName}`])},[ge(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:we(()=>[ge(l,{class:W.normalizeClass({"invisible min-h-[225px] transition-[visibility] duration-[0.4s,0s]":e.dateRangeClicked})},{default:we(()=>[(Q(!0),ye(Ue,null,mt(e.displayedItems,(d,f)=>(Q(),ye("li",{key:f,class:"my-1 first:mt-0 last:mb-0"},[ge(a,{class:W.normalizeClass(["date-filter-list-item flex justify-between items-center w-full p-1",{"date-filter-list-item-active":e.isItemSelected(d)}]),"justify-content":"space-between",appearance:"raw","data-testid":d[e.displayNameAttribute],onClick:m=>e.toggleItemSelection(d)},{default:we(()=>[fe("div",BB,[fe("div",jB,[je(e.$slots,"item",{item:d},void 0,!0)])]),fe("div",UB,[e.isItemSelected(d)?(Q(),Ae(s,{key:0,name:"check"})):_e("",!0)])]),_:2},1032,["class","data-testid","onClick"])]))),128)),fe("li",qB,[ge(a,{class:W.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]=d=>e.dateRangeClicked=!0)},{default:we(()=>[fe("div",VB,[fe("div",zB,[fe("span",{textContent:W.toDisplayString(e.$gettext("Custom date range"))},null,8,WB)])]),fe("div",HB,[e.dateRangeApplied?(Q(),Ae(s,{key:0,name:"check"})):_e("",!0)])]),_:1},8,["class"])])]),_:3},8,["class"]),fe("div",{class:W.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",GB,[ge(a,{appearance:"raw",class:"date-filter-range-panel-back","aria-label":e.$gettext("Go back to filter options"),onClick:t[1]||(t[1]=d=>e.dateRangeClicked=!1)},{default:we(()=>[ge(s,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"]),fe("span",{textContent:W.toDisplayString(e.$gettext("Custom date range"))},null,8,KB),ge(a,{appearance:"raw",class:"date-filter-range-panel-close","aria-label":e.$gettext("Close filter"),onClick:t[2]||(t[2]=d=>e.filterChip.hideDrop())},{default:we(()=>[ge(s,{name:"close"})]),_:1},8,["aria-label"])]),fe("div",QB,[ge(u,{label:e.$gettext("From"),"is-clearable":!0,"current-date":e.fromDate,onDateChanged:t[3]||(t[3]=d=>e.setDateRangeDate(d,"from"))},null,8,["label","current-date"]),ge(u,{label:e.$gettext("To"),"is-clearable":!0,"current-date":e.toDate,"min-date":e.fromDate?e.fromDate:void 0,onDateChanged:t[4]||(t[4]=d=>e.setDateRangeDate(d,"to"))},null,8,["label","current-date","min-date"])]),fe("div",XB,[ge(a,{size:"small",disabled:!e.dateRangeValid,onClick:e.applyDateRangeFilter},{default:we(()=>[Pt(W.toDisplayString(e.$gettext("Apply")),1)]),_:1},8,["disabled","onClick"])])],2)]),_:3},8,["filter-label","selected-item-names","onClearFilter","onShowDrop","onHideDrop"])],2)}const JB=qe(MB,[["render",YB],["__scopeId","data-v-091479ef"]]),ZB=xe({name:"ItemFilterInline",props:{filterName:{type:String,required:!0},filterOptions:{type:Array,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const r=He(),n=zt(),i=le(e.filterOptions[0].name),o=`q_${e.filterName}`,s=tr(o),a=u=>r.push({query:{...xi(h(n).query,[o]),[o]:u}}),l=async u=>{i.value=u.name,await a(u.name),t("toggleFilter",u)};return $t(()=>{const u=Rt(h(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}}}),ej=["textContent"];function tj(e,t,r,n,i,o){const s=be("oc-button");return Q(),ye("div",null,[fe("div",{class:W.normalizeClass(["item-inline-filter inline-flex outline outline-role-secondary outline-offset-[-1px] rounded-full",`item-inline-filter-${e.filterName}`])},[(Q(!0),ye(Ue,null,mt(e.filterOptions,(a,l)=>(Q(),Ae(s,{id:a.name,key:l,class:W.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:we(()=>[fe("span",{class:"truncate item-inline-filter-option-label",textContent:W.toDisplayString(a.label)},null,8,ej)]),_:2},1032,["id","class","appearance","color-role","no-hover","onClick"]))),128))],2)])}const rj=qe(ZB,[["render",tj]]),nj={class:"space-quota"},ij=["textContent"],gS=xe({__name:"SpaceQuota",props:{spaceQuota:{}},setup(e){const{$gettext:t,current:r}=Fe.useGettext(),n=B(()=>e.spaceQuota.total?t("%{used} of %{total} used (%{percentage}% used)",{used:h(o),total:h(i),percentage:h(s).toString()}):t("%{used} used (no restriction)",{used:h(o)})),i=B(()=>yr(e.spaceQuota.total,r)),o=B(()=>yr(e.spaceQuota.used,r)),s=B(()=>parseFloat((e.spaceQuota.used/e.spaceQuota.total*100).toFixed(2))),a=B(()=>{switch(e.spaceQuota.state){case"normal":return"var(--oc-role-secondary)";default:return"var(--oc-role-error)"}});return(l,u)=>{const c=be("oc-progress");return Q(),ye("div",nj,[fe("p",{class:"mb-2 mt-0",textContent:W.toDisplayString(n.value)},null,8,ij),ge(c,{value:s.value,max:100,size:"small",color:a.value,"background-color":"var(--oc-role-surface)"},null,8,["value","color"])])}}}),oj=xe({name:"WebDavDetails",props:{space:{type:Object,required:!0}},setup(e){const t=mn("resource"),r="check",n="file-copy",i=le(n),o=le(n),s=B(()=>jf(h(t).webDavPath)),a=B(()=>e.space?.getWebDavUrl({path:h(t).path}));return{copyWebDAVPathIcon:i,copyWebDAVPathToClipboard:()=>{navigator.clipboard.writeText(h(s)),i.value=r,setTimeout(()=>i.value=n,1500)},copyWebDAVUrlIcon:o,copyWebDAVUrlToClipboard:()=>{navigator.clipboard.writeText(h(a)),o.value=r,setTimeout(()=>o.value=n,1500)},webDavPath:s,webDavUrl:a}}}),sj={class:"flex"},aj=["textContent"],lj={class:"flex"},cj=["textContent"];function uj(e,t,r,n,i,o){const s=be("oc-icon"),a=be("oc-button"),l=lr("oc-tooltip");return Q(),ye(Ue,null,[fe("dt",null,W.toDisplayString(e.$gettext("WebDAV path")),1),fe("dd",sj,[lt(fe("div",{class:"truncate",textContent:W.toDisplayString(e.webDavPath)},null,8,aj),[[l,e.webDavPath]]),lt((Q(),Ae(a,{class:"ml-2",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV path to clipboard"),"no-hover":"",onClick:e.copyWebDAVPathToClipboard},{default:we(()=>[ge(s,{name:e.copyWebDAVPathIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[l,e.$gettext("Copy WebDAV path")]])]),fe("dt",null,W.toDisplayString(e.$gettext("WebDAV URL")),1),fe("dd",lj,[lt(fe("div",{class:"truncate",textContent:W.toDisplayString(e.webDavUrl)},null,8,cj),[[l,e.webDavUrl]]),lt((Q(),Ae(a,{class:"ml-2",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV URL to clipboard"),"no-hover":"",onClick:e.copyWebDAVUrlToClipboard},{default:we(()=>[ge(s,{name:e.copyWebDAVUrlIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[l,e.$gettext("Copy WebDAV URL")]])])],64)}const yS=qe(oj,[["render",uj]]),fj={id:"oc-space-details-sidebar",class:"p-4 bg-role-surface-container rounded-sm"},dj={class:"text-center"},pj={key:1,class:"relative mb-2"},hj=["src"],mj={key:0,class:"flex items-center oc-space-details-sidebar-members mb-2 text-sm gap-2"},gj=["textContent"],yj=["textContent"],vj=["aria-label"],bj=xe({__name:"SpaceDetails",props:{showShareIndicators:{type:Boolean,default:!0}},setup(e){const t=bt(),r=Ke(),{resourceContentsText:n}=V0({showSizeInformation:!1}),i=He(),{$gettext:o,$ngettext:s,current:a}=Fe.useGettext(),{loadPreview:l}=yd(),u=ut(),{imagesLoading:c}=Ve.storeToRefs(u),d=En(),f=mn("resource"),m=le(""),{user:w}=Ve.storeToRefs(t),v=B(()=>u.getSpaceMembers(h(f))),E=B(()=>d.linkShares.length),b=B(()=>r.areWebDavDetailsShown),g=B(()=>!gt(i,"files-spaces-projects")),y=B(()=>`${yr(h(f).size,a)}, ${h(n)}`);dt(()=>h(f).spaceImageData,async()=>{m.value=await l({space:h(f),resource:h(f).spaceImageData?te.buildSpaceImageResource(h(f)):h(f),dimensions:ni.Tile,processor:oa.enum.fit,cancelRunning:!0,updateStore:!1})},{immediate:!0});const p=B(()=>h(v).filter(te.isManager).map(({sharedWith:ee})=>ee.id===h(w)?.id?o("%{displayName} (me)",{displayName:ee.displayName}):ee.displayName).join(", ")),S=B(()=>pb(h(f).mdate,a)),T=B(()=>h(H)||h(_)),R=B(()=>{if(h(H)&&!h(_))return h(z);if(!h(H)&&h(_))return h(G);switch(h(x)){case 1:return s("This space has one member and %{linkShareCount} link.","This space has one member and %{linkShareCount} links.",h(E),{linkShareCount:h(E).toString()});default:return h(E)===1?o("This space has %{memberShareCount} members and one link.",{memberShareCount:h(x).toString()}):o("This space has %{memberShareCount} members and %{linkShareCount} links.",{memberShareCount:h(x).toString(),linkShareCount:h(E).toString()})}}),I=B(()=>o("Open share panel")),A=B(()=>o("Open link list in share panel")),D=B(()=>o("Open member list in share panel")),H=B(()=>h(x)>0),_=B(()=>h(E)>0),x=B(()=>h(v).length),z=B(()=>s("This space has %{memberShareCount} member.","This space has %{memberShareCount} members.",h(x),{memberShareCount:h(x).toString()})),G=B(()=>s("%{linkShareCount} link giving access.","%{linkShareCount} links giving access.",h(E),{linkShareCount:h(E).toString()})),ne=()=>{ze.publish(Tt.setActivePanel,"space-share")};return(ie,ee)=>{const ue=be("oc-spinner"),de=be("oc-icon"),ce=be("oc-button"),X=be("portal-target");return Q(),ye("div",fj,[fe("div",dj,[h(c).includes(h(f).id)?(Q(),Ae(ue,{key:0,"aria-label":h(o)("Space image is loading")},null,8,["aria-label"])):m.value?(Q(),ye("div",pj,[fe("img",{src:m.value,alt:"",class:"size-full object-cover aspect-[16/9]"},null,8,hj)])):(Q(),Ae(de,{key:2,name:"layout-grid",size:"xxlarge",class:"space-default-image px-4 py-4"}))]),ie.showShareIndicators&&T.value&&!h(f).disabled?(Q(),ye("div",mj,[H.value?(Q(),Ae(ce,{key:0,appearance:"raw","aria-label":D.value,"no-hover":"",onClick:ne},{default:we(()=>[ge(de,{name:"group",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):_e("",!0),_.value?(Q(),Ae(ce,{key:1,appearance:"raw","aria-label":A.value,"no-hover":"",onClick:ne},{default:we(()=>[ge(de,{name:"link",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):_e("",!0),fe("p",{textContent:W.toDisplayString(R.value)},null,8,gj),ge(ce,{appearance:"raw","aria-label":I.value,size:"small","no-hover":"",onClick:ne},{default:we(()=>[fe("span",{class:"text-sm",textContent:W.toDisplayString(h(o)("Show"))},null,8,yj)]),_:1},8,["aria-label"])])):_e("",!0),fe("dl",{class:"details-list grid grid-cols-[auto_minmax(0,1fr)] m-0","aria-label":h(o)("Overview of the information about the selected space")},[fe("dt",null,W.toDisplayString(h(o)("Last activity")),1),fe("dd",null,W.toDisplayString(S.value),1),h(f).description?(Q(),ye(Ue,{key:0},[fe("dt",null,W.toDisplayString(h(o)("Subtitle")),1),fe("dd",null,W.toDisplayString(h(f).description),1)],64)):_e("",!0),fe("dt",null,W.toDisplayString(h(o)("Manager")),1),fe("dd",null,W.toDisplayString(p.value),1),h(f).disabled?_e("",!0):(Q(),ye(Ue,{key:1},[fe("dt",null,W.toDisplayString(h(o)("Quota")),1),fe("dd",null,[ge(gS,{"space-quota":h(f).spaceQuota},null,8,["space-quota"])])],64)),g.value?(Q(),ye(Ue,{key:2},[fe("dt",null,W.toDisplayString(h(o)("Size")),1),fe("dd",null,W.toDisplayString(y.value),1)],64)):_e("",!0),b.value?(Q(),Ae(yS,{key:3,space:h(f)},null,8,["space"])):_e("",!0),ge(X,{name:"app.files.sidebar.space.details.table","slot-props":{space:h(f),resource:h(f)},multiple:!0},null,8,["slot-props"])],8,vj)])}}}),wj={id:"oc-spaces-details-multiple-sidebar",class:"p-4 bg-role-surface-container rounded-sm"},Sj={class:"text-center mb-6 rounded-sm"},Ej=["textContent"],Tj=xe({__name:"SpaceDetailsMultiple",props:{selectedSpaces:{}},setup(e){const t=Fe.useGettext(),{$gettext:r,$ngettext:n}=t,i=B(()=>{let f=0;return e.selectedSpaces.forEach(m=>{f+=m.spaceQuota.total}),yr(f,t.current)}),o=B(()=>{let f=0;return e.selectedSpaces.forEach(m=>{m.disabled||(f+=m.spaceQuota.remaining)}),yr(f,t.current)}),s=B(()=>{let f=0;return e.selectedSpaces.forEach(m=>{m.disabled||(f+=m.spaceQuota.used)}),yr(f,t.current)}),a=B(()=>e.selectedSpaces.filter(f=>!f.disabled).length),l=B(()=>e.selectedSpaces.filter(f=>f.disabled).length),u=B(()=>r("Overview of the information about the selected spaces")),c=B(()=>n("%{ itemCount } space selected","%{ itemCount } spaces selected",e.selectedSpaces.length,{itemCount:e.selectedSpaces.length.toString()})),d=B(()=>[{term:r("Total quota:"),definition:h(i).toString()},{term:r("Remaining quota:"),definition:h(o).toString()},{term:r("Used quota:"),definition:h(s).toString()},{term:r("Enabled:"),definition:h(a).toString()},{term:r("Disabled:"),definition:h(l).toString()}]);return(f,m)=>{const w=be("oc-icon"),v=be("oc-definition-list");return Q(),ye("div",wj,[fe("div",Sj,[fe("div",null,[ge(w,{size:"xxlarge",name:"layout-grid"}),fe("p",{textContent:W.toDisplayString(c.value)},null,8,Ej)])]),ge(v,{"aria-label":u.value,items:d.value,class:"m-0"},null,8,["aria-label","items"])])}}}),Aj=xe({name:"SpaceNoSelection"}),Rj={class:"mt-12"},Cj={class:"flex flex-col items-center space-info text-center"};function Ij(e,t,r,n,i,o){const s=be("oc-icon"),a=lr("translate");return Q(),ye("div",Rj,[fe("div",Cj,[ge(s,{name:"layout-grid",size:"xxlarge"}),lt((Q(),ye("p",null,[...t[0]||(t[0]=[Pt("Select a space to view details",-1)])])),[[a]])])])}const _j=qe(Aj,[["render",Ij]]),Oj=xe({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 $t(()=>{t=ze.subscribe("sidebar.entity.saved",()=>{e.value=!0})}),mr(()=>{ze.unsubscribe("sidebar.entity.saved",t)}),{saved:e}},computed:{unsavedChanges(){return!Yv(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}}}),Pj={class:"w-full flex flex-row flex-wrap justify-between items-center"},kj={key:0,class:"flex items-center"},Fj=["textContent"],xj={key:1},Nj=["textContent"],Dj=["textContent"];function $j(e,t,r,n,i,o){const s=be("oc-icon"),a=be("oc-button");return Q(),ye("div",Pj,[e.saved?(Q(),ye("span",kj,[ge(s,{name:"checkbox-circle"}),fe("span",{class:"ml-2",textContent:W.toDisplayString(e.$gettext("Changes saved"))},null,8,Fj)])):(Q(),ye("span",xj,W.toDisplayString(e.unsavedChangesText),1)),fe("div",null,[ge(a,{disabled:!e.unsavedChanges,class:"compare-save-dialog-revert-btn",onClick:t[0]||(t[0]=l=>e.$emit("revert"))},{default:we(()=>[fe("span",{textContent:W.toDisplayString(e.$gettext("Revert"))},null,8,Nj)]),_:1},8,["disabled"]),ge(a,{appearance:"filled",class:"compare-save-dialog-confirm-btn",disabled:!e.unsavedChanges||e.confirmButtonDisabled,onClick:t[1]||(t[1]=l=>e.$emit("confirm"))},{default:we(()=>[fe("span",{textContent:W.toDisplayString(e.$gettext("Save"))},null,8,Dj)]),_:1},8,["disabled"])])])}const Lj=qe(Oj,[["render",$j]]),Mj=$E(async()=>(await Promise.resolve().then(()=>k8)).default),Bj=xe({name:"CustomComponentTarget",props:{extensionPoint:{type:Object,required:!0}},setup(e){const t=Ni(),r=Tb(),n=B(()=>t.requestExtensions(e.extensionPoint)),i=r.extractDefaultExtensionIds(e.extensionPoint,h(n));return{extensions:B(()=>{if(e.extensionPoint.multiple||h(n).length<=1)return h(n);const s=r.getExtensionPreference(e.extensionPoint.id,i);return s.selectedExtensionIds.length?[h(n).find(a=>s.selectedExtensionIds.includes(a.id))||h(n)[0]]:[h(n)[0]]})}}});function jj(e,t,r,n,i,o){return Q(!0),ye(Ue,null,mt(e.extensions,s=>(Q(),Ae(jr(s.content),{key:`custom-component-${s.id}`}))),128)}const Uj=qe(Bj,[["render",jj]]),qj=xe({name:"ItemFilter",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0},optionFilterLabel:{type:String,required:!1,default:""},showOptionFilter:{type:Boolean,required:!1,default:!1},items:{type:Array,required:!0},allowMultiple:{type:Boolean,required:!1,default:!1},idAttribute:{type:String,required:!1,default:"id"},displayNameAttribute:{type:String,required:!1,default:"name"},filterableAttributes:{type:Array,required:!1,default:()=>[]},closeOnClick:{type:Boolean,default:!1}},emits:["selectionChange"],setup:function(e,{emit:t,expose:r}){const n=He(),i=zt(),o=le(),s=le([]),a=le(e.items),l=le(null),u=le(null),c=`q_${e.filterName}`,d=tr(c),f=T=>T[e.idAttribute],m=()=>n.push({query:{...xi(h(i).query,[c]),...!!h(s).length&&{[c]:h(s).reduce((T,R)=>(T+=`${f(R)}+`,T),"").slice(0,-1)}}}),w=T=>!!h(s).find(R=>f(R)===f(T)),v=async T=>{w(T)?s.value=h(s).filter(R=>f(R)!==f(T)):(e.allowMultiple||(s.value=[]),s.value.push(T)),await m(),t("selectionChange",h(s))},E=le(),b=(T,R)=>{if(!(R||"").trim())return T;const A=new Wd(T,{...Ol,keys:e.filterableAttributes}).search(R).map(D=>D.item);return T.filter(D=>A.includes(D))},g=()=>{s.value=[],t("selectionChange",h(s)),m()},y=T=>{a.value=T},p=async()=>{y(e.items),await ar(),h(o)?.focus()};dt(E,()=>{y(b(e.items,h(E))),h(u)&&(l.value=new Qd(h(u)),h(l).unmark(),h(l).mark(h(E),{element:"span",className:"mark-highlight"}))});const S=()=>{const T=Rt(h(d));if(T){const R=T.split("+");s.value=e.items.filter(I=>R.includes(f(I)))}};return r({setSelectedItemsBasedOnQuery:S}),$t(()=>{S()}),{clearFilter:g,displayedItems:a,filterInputRef:o,filterTerm:E,isItemSelected:w,itemFilterListRef:u,queryParam:c,selectedItems:s,setDisplayedItems:y,showDrop:p,toggleItemSelection:v,setSelectedItemsBasedOnQuery:S}}}),Vj={ref:"itemFilterListRef"},zj={class:"flex items-center truncate"},Wj={class:"truncate"},Hj={class:"flex"};function Gj(e,t,r,n,i,o){const s=be("oc-text-input"),a=be("oc-checkbox"),l=be("oc-icon"),u=be("oc-button"),c=be("oc-list"),d=be("oc-filter-chip");return Q(),ye("div",{class:W.normalizeClass(["item-filter flex",`item-filter-${e.filterName}`])},[ge(d,{"filter-label":e.filterLabel,"selected-item-names":e.selectedItems.map(f=>f[e.displayNameAttribute]),"close-on-click":e.closeOnClick,onClearFilter:e.clearFilter,onShowDrop:e.showDrop},{default:we(()=>[e.showOptionFilter&&e.filterableAttributes.length?(Q(),Ae(s,{key:0,ref:"filterInputRef",modelValue:e.filterTerm,"onUpdate:modelValue":t[0]||(t[0]=f=>e.filterTerm=f),class:"item-filter-input mb-4 mt-2",autocomplete:"off",label:e.optionFilterLabel===""?e.$gettext("Filter list"):e.optionFilterLabel},null,8,["modelValue","label"])):_e("",!0),fe("div",Vj,[ge(c,{class:"item-filter-list"},{default:we(()=>[(Q(!0),ye(Ue,null,mt(e.displayedItems,(f,m)=>(Q(),ye("li",{key:m,class:"my-1"},[ge(u,{class:W.normalizeClass(["item-filter-list-item flex items-center w-full",{"item-filter-list-item-active":!e.allowMultiple&&e.isItemSelected(f),"justify-start":e.allowMultiple,"justify-between":!e.allowMultiple}]),"justify-content":"space-between",appearance:"raw","data-test-value":f[e.displayNameAttribute],onClick:w=>e.toggleItemSelection(f)},{default:we(()=>[fe("div",zj,[e.allowMultiple?(Q(),Ae(a,{key:0,size:"large",class:"mr-2",label:e.$gettext("Toggle selection"),"model-value":e.isItemSelected(f),"label-hidden":!0,"onUpdate:modelValue":w=>e.toggleItemSelection(f),onClick:t[1]||(t[1]=Vt(()=>{},["stop"]))},null,8,["label","model-value","onUpdate:modelValue"])):_e("",!0),fe("div",null,[je(e.$slots,"image",{item:f})]),fe("div",Wj,[je(e.$slots,"item",{item:f})])]),fe("div",Hj,[!e.allowMultiple&&e.isItemSelected(f)?(Q(),Ae(l,{key:0,name:"check"})):_e("",!0)])]),_:2},1032,["class","data-test-value","onClick"])]))),128))]),_:3})],512)]),_:3},8,["filter-label","selected-item-names","close-on-click","onClearFilter","onShowDrop"])],2)}const Kj=qe(qj,[["render",Gj]]),Qj=xe({name:"ItemFilterToggle",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const r=He(),n=zt(),i=le(!1),o=`q_${e.filterName}`,s=tr(o),a=()=>r.push({query:{...xi(h(n).query,[o]),...h(i)&&{[o]:"true"}}}),l=async()=>{i.value=!h(i),await a(),t("toggleFilter",h(i))};return $t(()=>{Rt(h(s))==="true"&&(i.value=!0)}),{queryParam:o,filterActive:i,toggleFilter:l}}});function Xj(e,t,r,n,i,o){const s=be("oc-filter-chip");return Q(),ye("div",{class:W.normalizeClass(["item-filter flex",`item-filter-${e.filterName}`])},[ge(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 Yj=qe(Qj,[["render",Xj]]),Jj=xe({name:"LoadingIndicator",setup(){const e=ir();let t,r,n;const i=le(e.isLoading),o=le(e.currentProgress),s=()=>{o.value=e.currentProgress,i.value=e.isLoading},a=()=>{o.value=e.currentProgress};return $t(()=>{t=ze.subscribe($n.add,s),r=ze.subscribe($n.remove,s),n=ze.subscribe($n.setProgress,a)}),mr(()=>{ze.unsubscribe($n.add,t),ze.unsubscribe($n.remove,r),ze.unsubscribe($n.setProgress,n)}),{isLoading:i,currentProgress:o}}}),Zj={key:0,id:"oc-loading-indicator",class:"w-full"};function e8(e,t,r,n,i,o){const s=be("oc-progress");return e.isLoading?(Q(),ye("div",Zj,[ge(s,{max:100,indeterminate:e.currentProgress===null,value:e.currentProgress,size:"xsmall"},null,8,["indeterminate","value"])])):_e("",!0)}const t8=qe(Jj,[["render",e8]]),r8={class:"no-content-message flex flex-col justify-center items-center text-center"},n8={class:"text-role-on-surface-variant text-xl"},i8={class:"text-role-on-surface-variant"},o8=qe(xe({__name:"NoContentMessage",props:{icon:{},iconFillType:{default:"fill"}},setup(e){return(t,r)=>{const n=be("oc-icon");return Q(),ye("div",r8,[ge(n,{name:t.icon,type:"div",size:"xxlarge","fill-type":t.iconFillType,class:"mb-4"},null,8,["name","fill-type"]),fe("div",n8,[je(t.$slots,"message",{},void 0,!0)]),fe("div",i8,[je(t.$slots,"callToAction",{},void 0,!0)])])}}}),[["__scopeId","data-v-734c490b"]]),s8=xe({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 a8(e,t,r,n,i,o){const s=be("oc-pagination");return e.pages>1?(Q(),Ae(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"])):_e("",!0)}const l8=qe(s8,[["render",a8]]),c8=xe({name:"SearchBarFilter",props:{currentFolderAvailable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:r}=Fe.useGettext(),n=tr("useScope"),i=le(),o=le(),s=B(()=>r(i.value?.title)),a=B(()=>[{id:ri.currentFolder,title:r("Current folder"),enabled:e.currentFolderAvailable},{id:ri.allFiles,title:r("All files"),enabled:!0}]);return dt(()=>e.currentFolderAvailable,()=>{if(h(n)){if(h(n).toString()==="true"){i.value=h(a).find(({id:c})=>c===ri.currentFolder);return}i.value=h(a).find(({id:c})=>c===ri.allFiles);return}if(!e.currentFolderAvailable){i.value=h(a).find(({id:u})=>u===ri.allFiles);return}if(h(o)){i.value=h(a).find(({id:u})=>u===h(o).id);return}i.value=h(a).find(({id:u})=>u===ri.allFiles)},{immediate:!0}),{currentSelection:i,currentSelectionTitle:s,onOptionSelected:u=>{o.value=u,i.value=u,t("update:modelValue",{value:u})},locationOptions:a}}}),u8={key:0},f8={key:0,class:"flex"};function d8(e,t,r,n,i,o){const s=be("oc-icon"),a=be("oc-button"),l=be("oc-list"),u=be("oc-filter-chip");return Q(),ye("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]=Vt(()=>{},["stop"]))},[e.currentSelection?(Q(),ye("div",u8,[ge(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:we(()=>[ge(l,null,{default:we(()=>[(Q(!0),ye(Ue,null,mt(e.locationOptions,(c,d)=>(Q(),ye("li",{key:d},[ge(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:f=>e.onOptionSelected(c)},{default:we(()=>[fe("span",null,W.toDisplayString(c.title),1),c.id===e.currentSelection.id?(Q(),ye("div",f8,[ge(s,{name:"check"})])):_e("",!0)]),_:2},1032,["appearance","color-role","no-hover","disabled","data-test-id","onClick"])]))),128))]),_:1})]),_:1},8,["filter-label","selected-item-names"])])):_e("",!0)])}const p8=qe(c8,[["render",d8]]),h8=xe({name:"PortalTarget",components:{PortalTargetVue:Ha.PortalTarget},props:{...Ha.PortalTarget.props},setup(e){const t=B(()=>e);return $t(()=>{ze.publish(Pa.mounted,e)}),{properties:t}}});function m8(e,t,r,n,i,o){const s=be("portal-target-vue");return Q(),Ae(s,W.normalizeProps(rh(e.properties)),null,16)}const g8=qe(h8,[["render",m8]]),y8=({sortBy:e,sortDir:t})=>({groupingSettings:B(()=>({groupingBy:localStorage.getItem("grouping-shared-with-me")||"Shared on",showGroupingOptions:!0,groupingFunctions:{"Name alphabetically":function(n){return localStorage.setItem("grouping-shared-with-me","Name alphabetically"),isNaN(Number(n.name.charAt(0)))?n.name.charAt(0)==="."?n.name.charAt(1).toLowerCase():n.name.charAt(0).toLowerCase():"#"},"Shared on":function(n){localStorage.setItem("grouping-shared-with-me","Shared on");const i=Date.now()-6048e5,o=Date.now()-2592e6;return Date.parse(n.sdate)<o?"Older":Date.parse(n.sdate)>=i?"Recently":"Last month"},"Share owner":function(n){return localStorage.setItem("grouping-shared-with-me","Share owner"),n?.owner?.displayName},None:function(){localStorage.setItem("grouping-shared-with-me","None")}},sortGroups:{"Name alphabetically":function(n){const i=n.sort(function(o,s){return o.name<s.name?-1:o.name>s.name?1:0});return h(e)==="name"&&h(t)==="desc"&&i.reverse(),i},"Shared on":function(n){const i=[],o=["Recently","Last month","Older"];for(const s of o){const a=n.find(l=>l.name.toLowerCase()===s.toLowerCase());a&&i.push(a)}return h(e)==="sdate"&&h(t)==="asc"&&i.reverse(),i},"Share owner":function(n){const i=n.sort(function(o,s){return o.name<s.name?-1:o.name>s.name?1:0});return h(e)==="owner"&&h(t)==="desc"&&i.reverse(),i}}}))}),v8={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é"}},b8={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"}},w8={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"}},S8={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"}},E8={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"}},T8={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:"Автопрокрутка"}},A8={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:"同期スクロール"}},R8={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"}},C8={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"},I8={"fr-FR":v8,"de-DE":b8,"it-IT":w8,"es-ES":S8,"pl-PL":E8,ru:T8,"jp-JP":A8,"id-ID":R8},_8=xe({name:"TextEditor",components:{MdEditor:Jo.MdEditor,MdPreview:Jo.MdPreview},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 r=Fe.useGettext(),{currentTheme:n}=ti(),i=B(()=>{const{showPreviewOnlyMd:l=!0}=e.applicationConfig;return{showPreviewOnlyMd:l}}),o=B(()=>e.markdownMode||["md","markdown"].includes(e.resource?.extension)||!h(i).showPreviewOnlyMd),s=B(()=>h(n).isDark?"dark":"light");return Jo.config({editorConfig:{languageUserDefined:I8},editorExtensions:{screenfull:{instance:IS},cropper:{instance:Wa}},markdownItPlugins(l){return[...l,{type:"xss",plugin:Jo.XSSPlugin,options:{}}]}}),{isMarkdown:o,theme:s,language:r,languages:C8,onUploadImg:async l=>{const c=(await Promise.all([...l].map(f=>new Promise((m,w)=>{const v=new FileReader;v.onload=()=>m(v.result),v.onerror=w,v.readAsDataURL(f)})))).map(f=>`![image](${f})`),d=`${h(e.currentContent)}
84
+ ${c.join(`
65
85
 
66
86
  `)}
67
- `;t("update:currentContent",d)}}}}),aM={id:"text-editor-container",class:"oc-height-1-1"};function lM(e,t,n,r,o,i){const s=pe("md-preview"),a=pe("md-editor");return X(),de("div",aM,[e.isReadOnly?(X(),Ae(s,{key:0,id:"text-editor-preview-component","model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-upload-img":"","no-highlight":"",language:e.languages[e.language.current]||"en-US",theme:e.theme,"auto-focus":"","read-only":"",toolbars:[]},null,8,["model-value","language","theme"])):(X(),Ae(a,{key:1,id:"text-editor-component","model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-highlight":"","on-upload-img":e.onUploadImg,language:e.languages[e.language.current]||"en-US",theme:e.theme,preview:e.isMarkdown,toolbars:e.isMarkdown?void 0:["revoke","next"],"toolbars-exclude":["save","katex","github","catalog","mermaid","prettier","fullscreen","htmlPreview","pageFullscreen"],"read-only":e.isReadOnly,"auto-focus":"",onOnChange:t[0]||(t[0]=c=>e.$emit("update:currentContent",c))},null,8,["model-value","on-upload-img","language","theme","preview","toolbars","read-only"]))])}const cM=Object.freeze(Object.defineProperty({__proto__:null,default:ze(sM,[["render",lM]])},Symbol.toStringTag,{value:"Module"}));L.AVATAR_UPLOAD_MAX_FILE_SIZE_MB=$f,L.ActionMenuDropItem=l0,L.ActionMenuItem=ba,L.ApiError=wA,L.AppBar=Qx,L.AppLoadingSpinner=Gf,L.AppProviderService=nA,L.AppTopBar=f0,L.AppWrapper=b0,L.AppWrapperRoute=i$,L.ArchiverService=SA,L.Auth=Xh,L.AvatarUpload=jD,L.BatchActions=a0,L.Cache=$l,L.ClientService=FA,L.ClipboardActions=ii,L.CompareSaveDialog=g2,L.ConflictDialog=dl,L.ContextActionMenu=nd,L.ContextActions=c0,L.ContextMenuQuickAction=rd,L.CreateLinkModal=Bv,L.CreateShortcutModal=Lv,L.CreateSpace=Zx,L.CustomComponentTarget=v2,L.DateFilter=PL,L.DatePickerModal=BN,L.EDITOR_MODE_CREATE=uO,L.EDITOR_MODE_EDIT=cO,L.EVENT_FILE_DROPPED=Nf,L.EVENT_TROW_CONTEXTMENU=tO,L.EVENT_TROW_MOUNTED=Sv,L.EmojiPickerModal=Zv,L.EventBus=Yh,L.FileInfo=h0,L.FilePickerModal=jv,L.FileSideBar=g0,L.FolderLoaderFavorites=Zh,L.FolderLoaderSharedViaLink=eg,L.FolderLoaderSharedWithMe=tg,L.FolderLoaderSharedWithOthers=ng,L.FolderLoaderSpace=Jh,L.FolderLoaderTrashbin=Xy,L.FolderService=Yy,L.FolderViewModeConstants=Jt,L.HttpClient=ec,L.ImageDimension=Kn,L.ImageType=ra,L.ItemFilter=_2,L.ItemFilterInline=xL,L.ItemFilterToggle=P2,L.Key=Ir,L.LinkRoleDropdown=Mv,L.LoadingEventTopics=Lr,L.LoadingIndicator=x2,L.LoadingService=eI,L.MimeTypesToAppsSchema=Nh,L.Modifier=Qf,L.NoContentMessage=L2,L.Pagination=j2,L.PaginationConstants=Cr,L.PasswordPolicyService=tC,L.PortalTarget=K2,L.PortalTargetEventTopics=ya,L.PreviewService=HI,L.ProcessorType=zs,L.QuotaModal=Kv,L.QuotaSelect=Gv,L.RESOURCE_MAX_CHARACTER_LENGTH=Co,L.RawConfigSchema=WP,L.ResolveStrategy=Wn,L.ResourceConflictModal=$p,L.ResourceGhostElement=id,L.ResourceIcon=Oo,L.ResourceLink=Wf,L.ResourceListItem=ko,L.ResourceName=Hf,L.ResourcePreview=Dv,L.ResourceSize=v0,L.ResourceTable=XD,L.ResourceTile=V0,L.ResourceTiles=hL,L.ResourceTransfer=Lp,L.RuntimeError=ki,L.SaveAsModal=qv,L.SearchBarFilter=W2,L.SearchLocationFilterConstants=Rr,L.SideBar=d0,L.SideBarEventTopics=Tt,L.SortConstants=ti,L.SortDir=zt,L.SpaceDetails=XL,L.SpaceDetailsMultiple=t2,L.SpaceImageModal=Fv,L.SpaceInfo=p0,L.SpaceMoveInfoModal=Np,L.SpaceNoSelection=s2,L.SpaceQuota=z0,L.TextEditor=m2,L.ThemeConfig=HF,L.TransferType=gr,L.UnsavedChangesModal=m0,L.UppyService=rC,L.UserAvatar=cd,L.ViewOptions=u0,L.VisibilityObserver=$v,L.WebDavDetails=W0,L.WebThemeConfig=lv,L.activeApp=Nl,L.authContextValues=OT,L.blobToArrayBuffer=Db,L.breadcrumbsFromPath=SP,L.buildRoutes=eO,L.buildUrl=xT,L.cacheService=Zl,L.canvasToBlob=Lb,L.cloneStateObject=kp,L.concatBreadcrumbs=EP,L.contextQueryToFileContextProps=pv,L.contextRouteNameKey=ta,L.contextRouteParamsKey=Cf,L.contextRouteQueryKey=Pf,L.createDefaultFileIconMapping=Bp,L.createFileRouteOptions=rr,L.createLocationCommon=Ci,L.createLocationPublic=Pi,L.createLocationShares=$n,L.createLocationSpaces=Nn,L.createLocationTrash=Fi,L.defaultFuseOptions=pl,L.defineWebApplication=sw,L.determineResourceTableSortFields=kh,L.determineResourceTilesSortFields=JT,L.dirname=dt.dirname,L.displayPositionedDropdown=To,L.encodePath=Af,L.eventBus=Ke,L.filterResources=aE,L.focusCheckbox=DT,L.folderService=Jy,L.formatDateFromDateTime=oi,L.formatDateFromHTTP=TP,L.formatDateFromISO=Pb,L.formatDateFromJSDate=Cb,L.formatDateFromRFC=AP,L.formatFileSize=Tn,L.formatRelativeDateFromDateTime=Ao,L.formatRelativeDateFromHTTP=RP,L.formatRelativeDateFromISO=_P,L.formatRelativeDateFromJSDate=Fb,L.formatRelativeDateFromRFC=IP,L.getIndicators=$b,L.getLocaleFromLanguage=Gs,L.getParentPaths=Ob,L.getSharedAncestorRoute=$T,L.getSharedDriveItem=vs,L.getSpacesByType=_o,L.isLocationActive=JF,L.isLocationCommonActive=Ct,L.isLocationPublicActive=Pn,L.isLocationSharesActive=jt,L.isLocationSpacesActive=ht,L.isLocationTrashActive=Fn,L.isMacOs=Ks,L.isResourceBeeingMovedToSameLocation=Dp,L.isSameResource=ro,L.locationPublicLink=kl,L.locationPublicUpload=xl,L.locationSharesViaLink=Ol,L.locationSharesWithMe=bs,L.locationSharesWithOthers=Fl,L.locationSpacesGeneric=Pl,L.objectKeys=WI,L.queryItemAsString=Rt,L.renameResource=hl,L.resolveFileNameDuplicate=zn,L.resourceIconMappingInjectionKey=Mp,L.routeToContextQuery=na,L.setCurrentUserShareSpacePermissions=Th,L.sortFields=xh,L.sortHelper=Fh,L.sortSpaceMembers=uv,L.translateSortFields=ZT,L.triggerDownloadWithFilename=Jl,L.useAbility=mn,L.useActionsShowDetails=tx,L.useActiveApp=kT,L.useActiveLocation=Ar,L.useAppConfig=Sh,L.useAppDefaults=wv,L.useAppFileHandling=Ff,L.useAppFolderHandling=gv,L.useAppMeta=xf,L.useAppNavigation=hv,L.useAppProviderService=rx,L.useAppsStore=ir,L.useArchiverService=Iv,L.useAuthService=Of,L.useAuthStore=ei,L.useAvatarsStore=Ys,L.useBreadcrumbsFromPath=ix,L.useCanBeOpenedWithSecureView=Jf,L.useCanListShares=kv,L.useCanListVersions=n0,L.useCanShare=xv,L.useCapabilityStore=sn,L.useClientService=He,L.useClipboard=Df,L.useClipboardStore=Ro,L.useConfigStore=st,L.useCreateSpace=Ui,L.useCropperKeyboardActions=Yf,L.useDeleteWorker=Ev,L.useDocumentTitle=mv,L.useDownloadFile=Cv,L.useDriveResolver=vv,L.useEmbedMode=si,L.useEventBus=li,L.useExtensionPreferencesStore=Bb,L.useExtensionRegistry=Bi,L.useFileActions=Qn,L.useFileActionsCopy=ca,L.useFileActionsCopyPermanentLink=Lf,L.useFileActionsCreateLink=_k,L.useFileActionsCreateNewFile=wO,L.useFileActionsCreateNewFolder=vO,L.useFileActionsCreateNewShortcut=tk,L.useFileActionsCreateSpaceFromResource=zf,L.useFileActionsDelete=Po,L.useFileActionsDeleteResources=Rv,L.useFileActionsDisableSync=ua,L.useFileActionsDownloadArchive=fa,L.useFileActionsDownloadFile=Fo,L.useFileActionsEmptyTrashBin=Mf,L.useFileActionsEnableSync=aa,L.useFileActionsFavorite=Bf,L.useFileActionsMove=da,L.useFileActionsNavigate=jf,L.useFileActionsOpenShortcut=nk,L.useFileActionsOpenWithApp=Uv,L.useFileActionsPaste=Pv,L.useFileActionsRename=pa,L.useFileActionsRestore=ha,L.useFileActionsSaveAs=Vv,L.useFileActionsSetImage=Ov,L.useFileActionsShowActions=bO,L.useFileActionsShowDetails=qf,L.useFileActionsShowShares=Vf,L.useFileActionsToggleHideShare=la,L.useFileListHeaderPosition=ox,L.useFileRouteReplace=Js,L.useFolderLink=ui,L.useGetMatchingSpace=un,L.useGetResourceContext=r0,L.useGroupingSettings=Q2,L.useIsAppActive=_v,L.useIsFilesAppActive=_r,L.useIsResourceNameValid=oa,L.useIsSearchActive=sa,L.useIsTopBarSticky=Kf,L.useKeyboardActions=Xf,L.useLinkTypes=ga,L.useLoadAvatars=s0,L.useLoadPreview=ed,L.useLoadingService=fn,L.useLocalStorage=If,L.useMessages=tt,L.useModals=pt,L.useOpenEmptyEditor=nx,L.useOpenWithDefaultApp=Xv,L.usePagination=ax,L.usePasswordPolicyService=t0,L.usePasteWorker=Tv,L.usePortalTarget=ux,L.usePreviewService=Uf,L.useRequest=yv,L.useRequestHeaders=ia,L.useResourceContents=o0,L.useResourceRouteResolver=ma,L.useResourcesStore=Qe,L.useRestoreWorker=Av,L.useRoute=Kt,L.useRouteMeta=fv,L.useRouteName=Zs,L.useRouteParam=ea,L.useRouteQuery=an,L.useRouteQueryPersisted=Tr,L.useRouter=We,L.useScrollTo=Nv,L.useSearch=kf,L.useSelectedResources=td,L.useService=br,L.useSharesStore=Er,L.useSideBar=kb,L.useSort=GT,L.useSpaceActionsDelete=zv,L.useSpaceActionsDeleteImage=ex,L.useSpaceActionsDisable=Wv,L.useSpaceActionsDuplicate=Hv,L.useSpaceActionsEditDescription=Mk,L.useSpaceActionsEditQuota=Qv,L.useSpaceActionsEditReadmeContent=Kk,L.useSpaceActionsNavigateToTrash=Xk,L.useSpaceActionsRename=Yv,L.useSpaceActionsRestore=Jv,L.useSpaceActionsSetIcon=Zk,L.useSpaceActionsShowMembers=Qk,L.useSpaceHelpers=ci,L.useSpacesLoading=bv,L.useSpacesStore=ct,L.useThemeStore=ai,L.useTileSize=i0,L.useTokenTimerWorker=sO,L.useUpload=hx,L.useUserStore=yt,L.useViewMode=fx,L.useViewSize=dx,L.useViewSizeMax=Zf,L.useWebWorkersStore=Io,L.useWindowOpen=e0,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
87
+ `;t("update:currentContent",d)}}}}),O8={id:"text-editor-container",class:"h-full [&_.md-editor-preview]:!font-(family-name:--oc-font-family)"};function P8(e,t,r,n,i,o){const s=be("md-preview"),a=be("md-editor");return Q(),ye("div",O8,[e.isReadOnly?(Q(),Ae(s,{key:0,id:"text-editor-preview-component","model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-upload-img":"","no-highlight":"",language:e.languages[e.language.current]||"en-US",theme:e.theme,"auto-focus":"","read-only":"",toolbars:[]},null,8,["model-value","language","theme"])):(Q(),Ae(a,{key:1,id:"text-editor-component",class:"[&_.cm-content]:!font-(family-name:--oc-font-family)","model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-highlight":"","on-upload-img":e.onUploadImg,language:e.languages[e.language.current]||"en-US",theme:e.theme,preview:e.isMarkdown,toolbars:e.isMarkdown?void 0:["revoke","next"],"toolbars-exclude":["save","katex","github","catalog","mermaid","prettier","fullscreen","htmlPreview","pageFullscreen"],"read-only":e.isReadOnly,"auto-focus":"",onOnChange:t[0]||(t[0]=l=>e.$emit("update:currentContent",l))},null,8,["model-value","on-upload-img","language","theme","preview","toolbars","read-only"]))])}const k8=Object.freeze(Object.defineProperty({__proto__:null,default:qe(_8,[["render",P8]])},Symbol.toStringTag,{value:"Module"}));M.AVATAR_UPLOAD_MAX_FILE_SIZE_MB=Jf,M.ActionMenuDropItem=rS,M.ActionMenuItem=ka,M.ApiError=qR,M.AppBar=M2,M.AppLoadingSpinner=pd,M.AppProviderService=AR,M.AppTopBar=oS,M.AppWrapper=dS,M.AppWrapperRoute=WM,M.ArchiverService=VR,M.Auth=gc,M.AvatarUpload=fB,M.BatchActions=H0,M.Cache=Yl,M.ClientService=JR,M.ClipboardActions=Co,M.CompareSaveDialog=Lj,M.ConflictDialog=_l,M.ContextActionMenu=Ud,M.ContextActions=nS,M.ContextMenuQuickAction=qd,M.CreateLinkModal=T0,M.CreateShortcutModal=S0,M.CreateSpace=q2,M.CustomComponentTarget=Uj,M.DateFilter=JB,M.DatePickerModal=RM,M.EDITOR_MODE_CREATE=jF,M.EDITOR_MODE_EDIT=BF,M.EVENT_FILE_DROPPED=Yf,M.EVENT_TROW_CONTEXTMENU=DF,M.EVENT_TROW_MOUNTED=u0,M.EmojiPickerModal=L0,M.EventBus=Fm,M.FileInfo=lS,M.FilePickerModal=A0,M.FileSideBar=cS,M.FolderLoaderFavorites=Nm,M.FolderLoaderSharedViaLink=Dm,M.FolderLoaderSharedWithMe=$m,M.FolderLoaderSharedWithOthers=Lm,M.FolderLoaderSpace=xm,M.FolderLoaderTrashbin=Fv,M.FolderService=xv,M.FolderViewModeConstants=Kt,M.HttpClient=yc,M.ImageDimension=ni,M.ImageType=$F,M.ItemFilter=Kj,M.ItemFilterInline=rj,M.ItemFilterToggle=Yj,M.Key=Rn,M.LinkRoleDropdown=E0,M.LoadingEventTopics=$n,M.LoadingIndicator=t8,M.LoadingService=E_,M.MimeTypesToAppsSchema=gm,M.Modifier=td,M.NoContentMessage=o8,M.Pagination=l8,M.PaginationConstants=Li,M.PasswordPolicyService=TO,M.PortalTarget=g8,M.PortalTargetEventTopics=Pa,M.PreviewService=hO,M.ProcessorType=oa,M.QuotaModal=F0,M.QuotaSelect=k0,M.RESOURCE_MAX_CHARACTER_LENGTH=LF,M.RESOURCE_NAME_MAX_BYTES=Zf,M.RawConfigSchema=yk,M.ResolveStrategy=qr,M.ResourceConflictModal=yh,M.ResourceGhostElement=Vd,M.ResourceIcon=Do,M.ResourceLink=fd,M.ResourceListItem=$o,M.ResourceName=dd,M.ResourcePreview=w0,M.ResourceSize=pS,M.ResourceTable=SB,M.ResourceTile=mS,M.ResourceTiles=LB,M.ResourceTransfer=bh,M.RuntimeError=Ii,M.SaveAsModal=C0,M.SearchBarFilter=p8,M.SearchLocationFilterConstants=ri,M.SideBar=sS,M.SideBarEventTopics=Tt,M.SortConstants=go,M.SortDir=Ut,M.SpaceDetails=bj,M.SpaceDetailsMultiple=Tj,M.SpaceImageModal=h0,M.SpaceInfo=aS,M.SpaceMoveInfoModal=gh,M.SpaceNoSelection=_j,M.SpaceQuota=gS,M.TextEditor=Mj,M.ThemeConfig=wF,M.TransferType=gn,M.UnsavedChangesModal=uS,M.UppyService=OO,M.UserAvatar=zd,M.ViewOptions=iS,M.VisibilityObserver=b0,M.WebDavDetails=yS,M.WebThemeConfig=Hb,M.activeApp=Xl,M.authContextValues=ZA,M.blobToArrayBuffer=wb,M.breadcrumbsFromPath=GP,M.buildRoutes=_F,M.buildUrl=tR,M.cacheService=mc,M.canvasToBlob=Sb,M.cloneStateObject=hh,M.concatBreadcrumbs=KP,M.contextQueryToFileContextProps=Yb,M.contextRouteNameKey=ma,M.contextRouteParamsKey=Wf,M.contextRouteQueryKey=Hf,M.convertToMinimalUppyFile=eb,M.createDefaultFileIconMapping=Sh,M.createFileRouteOptions=tn,M.createFolderDummyFile=Zv,M.createLocationCommon=Ti,M.createLocationPublic=Ai,M.createLocationShares=kr,M.createLocationSpaces=Pr,M.createLocationTrash=Ri,M.defaultFuseOptions=Ol,M.defineWebApplication=_S,M.determineResourceTableSortFields=hm,M.determineResourceTilesSortFields=wR,M.dirname=pt.dirname,M.displayPositionedDropdown=Io,M.encodePath=jf,M.eventBus=ze,M.filterResources=O1,M.focusCheckbox=iR,M.folderService=Nv,M.formatDateFromDateTime=Zn,M.formatDateFromHTTP=QP,M.formatDateFromISO=pb,M.formatDateFromJSDate=db,M.formatDateFromRFC=XP,M.formatFileSize=yr,M.formatRelativeDateFromDateTime=_o,M.formatRelativeDateFromHTTP=YP,M.formatRelativeDateFromISO=JP,M.formatRelativeDateFromJSDate=hb,M.formatRelativeDateFromRFC=ZP,M.getIndicators=bb,M.getLocaleFromLanguage=la,M.getParentPaths=mb,M.getSharedAncestorRoute=nR,M.getSharedDriveItem=Ns,M.getSpacesByType=ko,M.getTextByteSize=zf,M.isLocationActive=CF,M.isLocationCommonActive=It,M.isLocationPublicActive=Rr,M.isLocationSharesActive=Lt,M.isLocationSpacesActive=gt,M.isLocationTrashActive=gr,M.isMacOs=ca,M.isResourceBeeingMovedToSameLocation=vh,M.isSameResource=oo,M.locationPublicLink=Kl,M.locationPublicUpload=Ql,M.locationSharesViaLink=Gl,M.locationSharesWithMe=xs,M.locationSharesWithOthers=Hl,M.locationSpacesGeneric=Wl,M.objectKeys=pO,M.queryItemAsString=Rt,M.renameResource=Pl,M.resolveFileNameDuplicate=Ur,M.resourceIconMappingInjectionKey=wh,M.routeToContextQuery=ga,M.setCurrentUserShareSpacePermissions=om,M.sortFields=mm,M.sortHelper=dm,M.sortSpaceMembers=Kb,M.translateSortFields=SR,M.triggerDownloadWithFilename=hc,M.useAbility=ur,M.useActionsShowDetails=DN,M.useActiveApp=eR,M.useActiveLocation=Wr,M.useAppConfig=nm,M.useAppDefaults=i0,M.useAppFileHandling=Gf,M.useAppFolderHandling=Zb,M.useAppMeta=Xf,M.useAppNavigation=Jb,M.useAppProviderService=LN,M.useAppsStore=rn,M.useArchiverService=f0,M.useAuthService=Kf,M.useAuthStore=Xn,M.useAvatarsStore=fa,M.useBreadcrumbsFromPath=MN,M.useCanBeOpenedWithSecureView=md,M.useCanListShares=g0,M.useCanListVersions=j0,M.useCanShare=y0,M.useCapabilityStore=er,M.useClientService=Ge,M.useClipboard=ed,M.useClipboardStore=Oo,M.useConfigStore=ct,M.useCreateSpace=$i,M.useCropperKeyboardActions=nd,M.useDeleteWorker=o0,M.useDocumentTitle=e0,M.useDownloadFile=d0,M.useDriveResolver=n0,M.useEmbedMode=ei,M.useEventBus=Ln,M.useExtensionPreferencesStore=Tb,M.useExtensionRegistry=Ni,M.useFileActions=Hr,M.useFileActionsCopy=Ea,M.useFileActionsCopyPermanentLink=id,M.useFileActionsCreateLink=sN,M.useFileActionsCreateNewFile=JF,M.useFileActionsCreateNewFolder=YF,M.useFileActionsCreateNewShortcut=Dx,M.useFileActionsCreateSpaceFromResource=ud,M.useFileActionsDelete=xo,M.useFileActionsDeleteResources=l0,M.useFileActionsDisableSync=Ta,M.useFileActionsDownloadArchive=Aa,M.useFileActionsDownloadFile=No,M.useFileActionsEmptyTrashBin=VF,M.useFileActionsEnableSync=wa,M.useFileActionsFavorite=od,M.useFileActionsMove=Ra,M.useFileActionsNavigate=sd,M.useFileActionsOpenShortcut=$x,M.useFileActionsOpenWithApp=R0,M.useFileActionsPaste=p0,M.useFileActionsRename=Ca,M.useFileActionsRestore=Ia,M.useFileActionsSaveAs=I0,M.useFileActionsSetImage=m0,M.useFileActionsShowActions=XF,M.useFileActionsShowDetails=ld,M.useFileActionsShowShares=cd,M.useFileActionsToggleHideShare=Sa,M.useFileListHeaderPosition=BN,M.useFileRouteReplace=da,M.useFolderLink=si,M.useGetMatchingSpace=rr,M.useGetResourceContext=U0,M.useGroupingSettings=y8,M.useInterceptModifierClick=oi,M.useIsAppActive=c0,M.useIsFilesAppActive=An,M.useIsResourceNameValid=ii,M.useIsSearchActive=ba,M.useIsTopBarSticky=hd,M.useKeyboardActions=rd,M.useLinkTypes=_a,M.useLoadAvatars=W0,M.useLoadPreview=yd,M.useLoadingService=ir,M.useLocalStorage=Vf,M.useMessages=nt,M.useModals=ht,M.useOpenEmptyEditor=$N,M.useOpenWithDefaultApp=N0,M.usePagination=jN,M.usePasswordPolicyService=B0,M.usePasteWorker=s0,M.usePortalTarget=VN,M.usePreviewService=ad,M.useRequest=t0,M.useRequestHeaders=va,M.useResourceContents=V0,M.useResourceRouteResolver=Oa,M.useResourcesStore=Ke,M.useRestoreWorker=a0,M.useRoute=zt,M.useRouteMeta=Qb,M.useRouteName=pa,M.useRouteParam=ha,M.useRouteQuery=tr,M.useRouteQueryPersisted=Tn,M.useRouter=He,M.useScrollTo=v0,M.useSearch=Qf,M.useSelectedResources=vd,M.useService=bn,M.useSharesStore=En,M.useSideBar=gb,M.useSort=mR,M.useSpaceActionsDelete=_0,M.useSpaceActionsDeleteImage=NN,M.useSpaceActionsDisable=O0,M.useSpaceActionsDuplicate=P0,M.useSpaceActionsEditDescription=vN,M.useSpaceActionsEditQuota=x0,M.useSpaceActionsEditReadmeContent=_N,M.useSpaceActionsNavigateToTrash=PN,M.useSpaceActionsRename=D0,M.useSpaceActionsRestore=$0,M.useSpaceActionsSetIcon=xN,M.useSpaceActionsShowMembers=ON,M.useSpaceHelpers=ya,M.useSpacesLoading=r0,M.useSpacesStore=ut,M.useThemeStore=ti,M.useTileSize=q0,M.useToggleTile=z0,M.useTokenTimerWorker=xF,M.useUpload=QN,M.useUserStore=bt,M.useViewMode=HN,M.useViewSize=GN,M.useViewSizeMax=gd,M.useWebWorkersStore=Fo,M.useWindowOpen=M0,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})}));