@opencloud-eu/web-pkg 2.1.0-alpha.1 → 2.1.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,67 @@
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("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"),require("cropperjs")):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","dompurify","mark.js","vue-router","portal-vue","@vue/shared","deepmerge","md-editor-v3","zod","@sentry/vue","screenfull","cropperjs"],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.DOMPurify,L.Mark,L.vueRouter,L.portalVue,L.shared,L.merge$1,L.mdEditorV3,L.zod,L.vue$1,L.screenfull,L.Cropper))})(this,function(L,ee,qt,Ne,Yf,Et,ko,Yt,A0,un,Dt,R0,_0,I0,C0,P0,F0,O0,He,x0,Lr,Mr,Jf,Zf,No,ga,H,ed,$o,me,k0,N0,$0){"use strict";var R2=Object.defineProperty;var S0=L=>{throw TypeError(L)};var _2=(L,ee,qt)=>ee in L?R2(L,ee,{enumerable:!0,configurable:!0,writable:!0,value:qt}):L[ee]=qt;var Ee=(L,ee,qt)=>_2(L,typeof ee!="symbol"?ee+"":ee,qt),Qf=(L,ee,qt)=>ee.has(L)||S0("Cannot "+qt);var xe=(L,ee,qt)=>(Qf(L,ee,"read from private field"),qt?qt.call(L):ee.get(L)),Tn=(L,ee,qt)=>ee.has(L)?S0("Cannot add the same private member more than once"):ee instanceof WeakSet?ee.add(L):ee.set(L,qt),$t=(L,ee,qt,Ne)=>(Qf(L,ee,"write to private field"),Ne?Ne.call(L,qt):ee.set(L,qt),qt),Dr=(L,ee,qt)=>(Qf(L,ee,"access private method"),qt);var Kt,tn,Ar,Rt,Ut,xr,ui,kr,nr,fi,xo,di,E0,Nr,ha,Xf,T0;const D0=e=>e;function td(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function L0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var nd={exports:{}},xt=nd.exports={},Wn,Hn;function ma(){throw new Error("setTimeout has not been defined")}function ya(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Wn=setTimeout:Wn=ma}catch{Wn=ma}try{typeof clearTimeout=="function"?Hn=clearTimeout:Hn=ya}catch{Hn=ya}})();function rd(e){if(Wn===setTimeout)return setTimeout(e,0);if((Wn===ma||!Wn)&&setTimeout)return Wn=setTimeout,setTimeout(e,0);try{return Wn(e,0)}catch{try{return Wn.call(null,e,0)}catch{return Wn.call(this,e,0)}}}function M0(e){if(Hn===clearTimeout)return clearTimeout(e);if((Hn===ya||!Hn)&&clearTimeout)return Hn=clearTimeout,clearTimeout(e);try{return Hn(e)}catch{try{return Hn.call(null,e)}catch{return Hn.call(this,e)}}}var ir=[],pi=!1,Br,Do=-1;function B0(){!pi||!Br||(pi=!1,Br.length?ir=Br.concat(ir):Do=-1,ir.length&&id())}function id(){if(!pi){var e=rd(B0);pi=!0;for(var t=ir.length;t;){for(Br=ir,ir=[];++Do<t;)Br&&Br[Do].run();Do=-1,t=ir.length}Br=null,pi=!1,M0(e)}}xt.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];ir.push(new od(e,t)),ir.length===1&&!pi&&rd(id)};function od(e,t){this.fun=e,this.array=t}od.prototype.run=function(){this.fun.apply(null,this.array)},xt.title="browser",xt.browser=!0,xt.env={},xt.argv=[],xt.version="",xt.versions={};function or(){}xt.on=or,xt.addListener=or,xt.once=or,xt.off=or,xt.removeListener=or,xt.removeAllListeners=or,xt.emit=or,xt.prependListener=or,xt.prependOnceListener=or,xt.listeners=function(e){return[]},xt.binding=function(e){throw new Error("process.binding is not supported")},xt.cwd=function(){return"/"},xt.chdir=function(e){throw new Error("process.chdir is not supported")},xt.umask=function(){return 0};var j0=nd.exports;const ye=L0(j0);function sr(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let it;const ba=new WeakSet;class U0{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,ba.has(this)&&(ba.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ad(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,dd(this),ld(this);const t=it,n=Bn;it=this,Bn=!0;try{return this.fn()}finally{ye.env.NODE_ENV!=="production"&&it!==this&&sr("Active effect was not restored correctly - this is likely a Vue internal bug."),cd(this),it=t,Bn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ea(t);this.deps=this.depsTail=void 0,dd(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ba.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Sa(this)&&this.run()}get dirty(){return Sa(this)}}let sd=0,Mi,Bi;function ad(e,t=!1){if(e.flags|=8,t){e.next=Bi,Bi=e;return}e.next=Mi,Mi=e}function va(){sd++}function wa(){if(--sd>0)return;if(Bi){let t=Bi;for(Bi=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Mi;){let t=Mi;for(Mi=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 ld(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function cd(e){let t,n=e.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),Ea(r),q0(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function Sa(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(ud(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function ud(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===qi))return;e.globalVersion=qi;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!Sa(e)){e.flags&=-3;return}const n=it,r=Bn;it=e,Bn=!0;try{ld(e);const o=e.fn(e._value);(t.version===0||H.hasChanged(o,e._value))&&(e._value=o,t.version++)}catch(o){throw t.version++,o}finally{it=n,Bn=r,cd(e),e.flags&=-3}}function Ea(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),ye.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)Ea(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function q0(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Bn=!0;const fd=[];function ji(){fd.push(Bn),Bn=!1}function Ui(){const e=fd.pop();Bn=e===void 0?!0:e}function dd(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=it;it=void 0;try{t()}finally{it=n}}}let qi=0;class V0{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 Lo{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,ye.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){if(!it||!Bn||it===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==it)n=this.activeLink=new V0(it,this),it.deps?(n.prevDep=it.depsTail,it.depsTail.nextDep=n,it.depsTail=n):it.deps=it.depsTail=n,pd(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=it.depsTail,n.nextDep=void 0,it.depsTail.nextDep=n,it.depsTail=n,it.deps===n&&(it.deps=r)}return ye.env.NODE_ENV!=="production"&&it.onTrack&&it.onTrack(H.extend({effect:it},t)),n}trigger(t){this.version++,qi++,this.notify(t)}notify(t){va();try{if(ye.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(H.extend({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{wa()}}}function pd(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)pd(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),ye.env.NODE_ENV!=="production"&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}const Mo=new WeakMap,jr=Symbol(ye.env.NODE_ENV!=="production"?"Object iterate":""),Ta=Symbol(ye.env.NODE_ENV!=="production"?"Map keys iterate":""),Vi=Symbol(ye.env.NODE_ENV!=="production"?"Array iterate":"");function nn(e,t,n){if(Bn&&it){let r=Mo.get(e);r||Mo.set(e,r=new Map);let o=r.get(n);o||(r.set(n,o=new Lo),o.map=r,o.key=n),ye.env.NODE_ENV!=="production"?o.track({target:e,type:t,key:n}):o.track()}}function Rr(e,t,n,r,o,i){const s=Mo.get(e);if(!s){qi++;return}const a=c=>{c&&(ye.env.NODE_ENV!=="production"?c.trigger({target:e,type:t,key:n,newValue:r,oldValue:o,oldTarget:i}):c.trigger())};if(va(),t==="clear")s.forEach(a);else{const c=H.isArray(e),u=c&&H.isIntegerKey(n);if(c&&n==="length"){const l=Number(r);s.forEach((f,d)=>{(d==="length"||d===Vi||!H.isSymbol(d)&&d>=l)&&a(f)})}else switch((n!==void 0||s.has(void 0))&&a(s.get(n)),u&&a(s.get(Vi)),t){case"add":c?u&&a(s.get("length")):(a(s.get(jr)),H.isMap(e)&&a(s.get(Ta)));break;case"delete":c||(a(s.get(jr)),H.isMap(e)&&a(s.get(Ta)));break;case"set":H.isMap(e)&&a(s.get(jr));break}}wa()}function z0(e,t){const n=Mo.get(e);return n&&n.get(t)}function hi(e){const t=nt(e);return t===e?t:(nn(t,"iterate",Vi),fn(e)?t:t.map(sn))}function Bo(e){return nn(e=nt(e),"iterate",Vi),e}const W0={__proto__:null,[Symbol.iterator](){return Aa(this,Symbol.iterator,sn)},concat(...e){return hi(this).concat(...e.map(t=>H.isArray(t)?hi(t):t))},entries(){return Aa(this,"entries",e=>(e[1]=sn(e[1]),e))},every(e,t){return ar(this,"every",e,t,void 0,arguments)},filter(e,t){return ar(this,"filter",e,t,n=>n.map(sn),arguments)},find(e,t){return ar(this,"find",e,t,sn,arguments)},findIndex(e,t){return ar(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ar(this,"findLast",e,t,sn,arguments)},findLastIndex(e,t){return ar(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ar(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ra(this,"includes",e)},indexOf(...e){return Ra(this,"indexOf",e)},join(e){return hi(this).join(e)},lastIndexOf(...e){return Ra(this,"lastIndexOf",e)},map(e,t){return ar(this,"map",e,t,void 0,arguments)},pop(){return zi(this,"pop")},push(...e){return zi(this,"push",e)},reduce(e,...t){return hd(this,"reduce",e,t)},reduceRight(e,...t){return hd(this,"reduceRight",e,t)},shift(){return zi(this,"shift")},some(e,t){return ar(this,"some",e,t,void 0,arguments)},splice(...e){return zi(this,"splice",e)},toReversed(){return hi(this).toReversed()},toSorted(e){return hi(this).toSorted(e)},toSpliced(...e){return hi(this).toSpliced(...e)},unshift(...e){return zi(this,"unshift",e)},values(){return Aa(this,"values",sn)}};function Aa(e,t,n){const r=Bo(e),o=r[t]();return r!==e&&!fn(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.value&&(i.value=n(i.value)),i}),o}const H0=Array.prototype;function ar(e,t,n,r,o,i){const s=Bo(e),a=s!==e&&!fn(e),c=s[t];if(c!==H0[t]){const f=c.apply(e,i);return a?sn(f):f}let u=n;s!==e&&(a?u=function(f,d){return n.call(this,sn(f),d,e)}:n.length>2&&(u=function(f,d){return n.call(this,f,d,e)}));const l=c.call(s,u,r);return a&&o?o(l):l}function hd(e,t,n,r){const o=Bo(e);let i=n;return o!==e&&(fn(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,sn(a),c,e)}),o[t](i,...r)}function Ra(e,t,n){const r=nt(e);nn(r,"iterate",Vi);const o=r[t](...n);return(o===-1||o===!1)&&Vo(n[0])?(n[0]=nt(n[0]),r[t](...n)):o}function zi(e,t,n=[]){ji(),va();const r=nt(e)[t].apply(e,n);return wa(),Ui(),r}const G0=H.makeMap("__proto__,__v_isRef,__isVue"),gd=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(H.isSymbol));function K0(e){H.isSymbol(e)||(e=String(e));const t=nt(this);return nn(t,"has",e),t.hasOwnProperty(e)}class md{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?Sd:wd:i?iw:vd).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const s=H.isArray(t);if(!o){let c;if(s&&(c=W0[n]))return c;if(n==="hasOwnProperty")return K0}const a=Reflect.get(t,n,Lt(t)?t:r);return(H.isSymbol(n)?gd.has(n):G0(n))||(o||nn(t,"get",n),i)?a:Lt(a)?s&&H.isIntegerKey(n)?a:a.value:H.isObject(a)?o?lr(a):Ca(a):a}}class Q0 extends md{constructor(t=!1){super(!1,t)}set(t,n,r,o){let i=t[n];if(!this._isShallow){const c=cr(i);if(!fn(r)&&!cr(r)&&(i=nt(i),r=nt(r)),!H.isArray(t)&&Lt(i)&&!Lt(r))return c?!1:(i.value=r,!0)}const s=H.isArray(t)&&H.isIntegerKey(n)?Number(n)<t.length:H.hasOwn(t,n),a=Reflect.set(t,n,r,Lt(t)?t:o);return t===nt(o)&&(s?H.hasChanged(r,i)&&Rr(t,"set",n,r,i):Rr(t,"add",n,r)),a}deleteProperty(t,n){const r=H.hasOwn(t,n),o=t[n],i=Reflect.deleteProperty(t,n);return i&&r&&Rr(t,"delete",n,void 0,o),i}has(t,n){const r=Reflect.has(t,n);return(!H.isSymbol(n)||!gd.has(n))&&nn(t,"has",n),r}ownKeys(t){return nn(t,"iterate",H.isArray(t)?"length":jr),Reflect.ownKeys(t)}}class yd extends md{constructor(t=!1){super(!0,t)}set(t,n){return ye.env.NODE_ENV!=="production"&&sr(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return ye.env.NODE_ENV!=="production"&&sr(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const X0=new Q0,Y0=new yd,J0=new yd(!0),_a=e=>e,jo=e=>Reflect.getPrototypeOf(e);function Z0(e,t,n){return function(...r){const o=this.__v_raw,i=nt(o),s=H.isMap(i),a=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,u=o[e](...r),l=n?_a:t?Fa:sn;return!t&&nn(i,"iterate",c?Ta:jr),{next(){const{value:f,done:d}=u.next();return d?{value:f,done:d}:{value:a?[l(f[0]),l(f[1])]:l(f),done:d}},[Symbol.iterator](){return this}}}}function Uo(e){return function(...t){if(ye.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";sr(`${H.capitalize(e)} operation ${n}failed: target is readonly.`,nt(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function ew(e,t){const n={get(o){const i=this.__v_raw,s=nt(i),a=nt(o);e||(H.hasChanged(o,a)&&nn(s,"get",o),nn(s,"get",a));const{has:c}=jo(s),u=t?_a:e?Fa:sn;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&&nn(nt(o),"iterate",jr),Reflect.get(o,"size",o)},has(o){const i=this.__v_raw,s=nt(i),a=nt(o);return e||(H.hasChanged(o,a)&&nn(s,"has",o),nn(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=nt(a),u=t?_a:e?Fa:sn;return!e&&nn(c,"iterate",jr),a.forEach((l,f)=>o.call(i,u(l),u(f),s))}};return H.extend(n,e?{add:Uo("add"),set:Uo("set"),delete:Uo("delete"),clear:Uo("clear")}:{add(o){!t&&!fn(o)&&!cr(o)&&(o=nt(o));const i=nt(this);return jo(i).has.call(i,o)||(i.add(o),Rr(i,"add",o,o)),this},set(o,i){!t&&!fn(i)&&!cr(i)&&(i=nt(i));const s=nt(this),{has:a,get:c}=jo(s);let u=a.call(s,o);u?ye.env.NODE_ENV!=="production"&&bd(s,a,o):(o=nt(o),u=a.call(s,o));const l=c.call(s,o);return s.set(o,i),u?H.hasChanged(i,l)&&Rr(s,"set",o,i,l):Rr(s,"add",o,i),this},delete(o){const i=nt(this),{has:s,get:a}=jo(i);let c=s.call(i,o);c?ye.env.NODE_ENV!=="production"&&bd(i,s,o):(o=nt(o),c=s.call(i,o));const u=a?a.call(i,o):void 0,l=i.delete(o);return c&&Rr(i,"delete",o,void 0,u),l},clear(){const o=nt(this),i=o.size!==0,s=ye.env.NODE_ENV!=="production"?H.isMap(o)?new Map(o):new Set(o):void 0,a=o.clear();return i&&Rr(o,"clear",void 0,void 0,s),a}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Z0(o,e,t)}),n}function Ia(e,t){const n=ew(e,t);return(r,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?r:Reflect.get(H.hasOwn(n,o)&&o in r?n:r,o,i)}const tw={get:Ia(!1,!1)},nw={get:Ia(!0,!1)},rw={get:Ia(!0,!0)};function bd(e,t,n){const r=nt(n);if(r!==n&&t.call(e,r)){const o=H.toRawType(e);sr(`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 vd=new WeakMap,iw=new WeakMap,wd=new WeakMap,Sd=new WeakMap;function ow(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function sw(e){return e.__v_skip||!Object.isExtensible(e)?0:ow(H.toRawType(e))}function Ca(e){return cr(e)?e:Pa(e,!1,X0,tw,vd)}function lr(e){return Pa(e,!0,Y0,nw,wd)}function qo(e){return Pa(e,!0,J0,rw,Sd)}function Pa(e,t,n,r,o){if(!H.isObject(e))return ye.env.NODE_ENV!=="production"&&sr(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=o.get(e);if(i)return i;const s=sw(e);if(s===0)return e;const a=new Proxy(e,s===2?r:n);return o.set(e,a),a}function Ur(e){return cr(e)?Ur(e.__v_raw):!!(e&&e.__v_isReactive)}function cr(e){return!!(e&&e.__v_isReadonly)}function fn(e){return!!(e&&e.__v_isShallow)}function Vo(e){return e?!!e.__v_raw:!1}function nt(e){const t=e&&e.__v_raw;return t?nt(t):e}function aw(e){return!H.hasOwn(e,"__v_skip")&&Object.isExtensible(e)&&H.def(e,"__v_skip",!0),e}const sn=e=>H.isObject(e)?Ca(e):e,Fa=e=>H.isObject(e)?lr(e):e;function Lt(e){return e?e.__v_isRef===!0:!1}function oe(e){return Ed(e,!1)}function lw(e){return Ed(e,!0)}function Ed(e,t){return Lt(e)?e:new cw(e,t)}class cw{constructor(t,n){this.dep=new Lo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:nt(t),this._value=n?t:sn(t),this.__v_isShallow=n}get value(){return ye.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||fn(t)||cr(t);t=r?t:nt(t),H.hasChanged(t,n)&&(this._rawValue=t,this._value=r?t:sn(t),ye.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:n}):this.dep.trigger())}}function p(e){return Lt(e)?e.value:e}const uw={get:(e,t,n)=>t==="__v_raw"?e:p(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return Lt(o)&&!Lt(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function fw(e){return Ur(e)?e:new Proxy(e,uw)}class dw{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Lo,{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 Td(e){return new dw(e)}class pw{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 z0(nt(this._object),this._key)}}class hw{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 gw(e,t,n){return Lt(e)?e:H.isFunction(e)?new hw(e):H.isObject(e)&&arguments.length>1?mw(e,t,n):oe(e)}function mw(e,t,n){const r=e[t];return Lt(r)?r:new pw(e,t,n)}class yw{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Lo(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=qi-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&it!==this)return ad(this,!0),!0;ye.env.NODE_ENV}get value(){const t=ye.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return ud(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter?this.setter(t):ye.env.NODE_ENV!=="production"&&sr("Write operation failed: computed value is readonly")}}function bw(e,t,n=!1){let r,o;H.isFunction(e)?r=e:(r=e.get,o=e.set);const i=new yw(r,o,n);return ye.env.NODE_ENV,i}const zo={},Wo=new WeakMap;let qr;function vw(e,t=!1,n=qr){if(n){let r=Wo.get(n);r||Wo.set(n,r=[]),r.push(e)}else ye.env.NODE_ENV!=="production"&&!t&&sr("onWatcherCleanup() was called when there was no active watcher to associate with.")}function ww(e,t,n=H.EMPTY_OBJ){const{immediate:r,deep:o,once:i,scheduler:s,augmentJob:a,call:c}=n,u=y=>{(n.onWarn||sr)("Invalid watch source: ",y,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},l=y=>o?y:fn(y)||o===!1||o===0?ur(y,1):ur(y);let f,d,m,w,v=!1,T=!1;if(Lt(e)?(d=()=>e.value,v=fn(e)):Ur(e)?(d=()=>l(e),v=!0):H.isArray(e)?(T=!0,v=e.some(y=>Ur(y)||fn(y)),d=()=>e.map(y=>{if(Lt(y))return y.value;if(Ur(y))return l(y);if(H.isFunction(y))return c?c(y,2):y();ye.env.NODE_ENV!=="production"&&u(y)})):H.isFunction(e)?t?d=c?()=>c(e,2):e:d=()=>{if(m){ji();try{m()}finally{Ui()}}const y=qr;qr=f;try{return c?c(e,3,[w]):e(w)}finally{qr=y}}:(d=H.NOOP,ye.env.NODE_ENV!=="production"&&u(e)),t&&o){const y=d,S=o===!0?1/0:o;d=()=>ur(y(),S)}const b=()=>{f.stop()};if(i&&t){const y=t;t=(...S)=>{y(...S),b()}}let g=T?new Array(e.length).fill(zo):zo;const h=y=>{if(!(!(f.flags&1)||!f.dirty&&!y))if(t){const S=f.run();if(o||v||(T?S.some((E,R)=>H.hasChanged(E,g[R])):H.hasChanged(S,g))){m&&m();const E=qr;qr=f;try{const R=[S,g===zo?void 0:T&&g[0]===zo?[]:g,w];c?c(t,3,R):t(...R),g=S}finally{qr=E}}}else f.run()};return a&&a(h),f=new U0(d),f.scheduler=s?()=>s(h,!1):h,w=y=>vw(y,!1,f),m=f.onStop=()=>{const y=Wo.get(f);if(y){if(c)c(y,4);else for(const S of y)S();Wo.delete(f)}},ye.env.NODE_ENV!=="production"&&(f.onTrack=n.onTrack,f.onTrigger=n.onTrigger),t?r?h(!0):g=f.run():s?s(h.bind(null,!0),!0):f.run(),b.pause=f.pause.bind(f),b.resume=f.resume.bind(f),b.stop=b,b}function ur(e,t=1/0,n){if(t<=0||!H.isObject(e)||e.__v_skip||(n=n||new Set,n.has(e)))return e;if(n.add(e),t--,Lt(e))ur(e.value,t,n);else if(H.isArray(e))for(let r=0;r<e.length;r++)ur(e[r],t,n);else if(H.isSet(e)||H.isMap(e))e.forEach(r=>{ur(r,t,n)});else if(H.isPlainObject(e)){for(const r in e)ur(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&ur(e[r],t,n)}return e}const Vr=[];function Sw(e){Vr.push(e)}function Ew(){Vr.pop()}let Oa=!1;function et(e,...t){if(Oa)return;Oa=!0,ji();const n=Vr.length?Vr[Vr.length-1].component:null,r=n&&n.appContext.config.warnHandler,o=Tw();if(r)Ho(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 <${cp(n,i.type)}>`).join(`
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("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"),require("cropperjs")):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","dompurify","mark.js","vue-router","portal-vue","@vue/shared","deepmerge","md-editor-v3","zod","@sentry/vue","screenfull","cropperjs"],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.DOMPurify,L.Mark,L.vueRouter,L.portalVue,L.shared,L.merge$1,L.mdEditorV3,L.zod,L.vue$1,L.screenfull,L.Cropper))})(this,function(L,ee,qt,Ne,Yf,Et,ko,Yt,R0,un,Dt,_0,I0,C0,F0,P0,O0,x0,He,k0,Lr,Mr,Jf,Zf,No,ga,W,ed,$o,ye,N0,$0,D0){"use strict";var _2=Object.defineProperty;var E0=L=>{throw TypeError(L)};var I2=(L,ee,qt)=>ee in L?_2(L,ee,{enumerable:!0,configurable:!0,writable:!0,value:qt}):L[ee]=qt;var Ee=(L,ee,qt)=>I2(L,typeof ee!="symbol"?ee+"":ee,qt),Qf=(L,ee,qt)=>ee.has(L)||E0("Cannot "+qt);var xe=(L,ee,qt)=>(Qf(L,ee,"read from private field"),qt?qt.call(L):ee.get(L)),Tn=(L,ee,qt)=>ee.has(L)?E0("Cannot add the same private member more than once"):ee instanceof WeakSet?ee.add(L):ee.set(L,qt),$t=(L,ee,qt,Ne)=>(Qf(L,ee,"write to private field"),Ne?Ne.call(L,qt):ee.set(L,qt),qt),Dr=(L,ee,qt)=>(Qf(L,ee,"access private method"),qt);var Kt,tn,Ar,Rt,Ut,xr,ui,kr,nr,fi,xo,di,T0,Nr,ha,Xf,A0;const L0=e=>e;function td(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function M0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var nd={exports:{}},xt=nd.exports={},Wn,Hn;function ma(){throw new Error("setTimeout has not been defined")}function ya(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Wn=setTimeout:Wn=ma}catch{Wn=ma}try{typeof clearTimeout=="function"?Hn=clearTimeout:Hn=ya}catch{Hn=ya}})();function rd(e){if(Wn===setTimeout)return setTimeout(e,0);if((Wn===ma||!Wn)&&setTimeout)return Wn=setTimeout,setTimeout(e,0);try{return Wn(e,0)}catch{try{return Wn.call(null,e,0)}catch{return Wn.call(this,e,0)}}}function B0(e){if(Hn===clearTimeout)return clearTimeout(e);if((Hn===ya||!Hn)&&clearTimeout)return Hn=clearTimeout,clearTimeout(e);try{return Hn(e)}catch{try{return Hn.call(null,e)}catch{return Hn.call(this,e)}}}var ir=[],pi=!1,Br,Do=-1;function j0(){!pi||!Br||(pi=!1,Br.length?ir=Br.concat(ir):Do=-1,ir.length&&id())}function id(){if(!pi){var e=rd(j0);pi=!0;for(var t=ir.length;t;){for(Br=ir,ir=[];++Do<t;)Br&&Br[Do].run();Do=-1,t=ir.length}Br=null,pi=!1,B0(e)}}xt.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];ir.push(new od(e,t)),ir.length===1&&!pi&&rd(id)};function od(e,t){this.fun=e,this.array=t}od.prototype.run=function(){this.fun.apply(null,this.array)},xt.title="browser",xt.browser=!0,xt.env={},xt.argv=[],xt.version="",xt.versions={};function or(){}xt.on=or,xt.addListener=or,xt.once=or,xt.off=or,xt.removeListener=or,xt.removeAllListeners=or,xt.emit=or,xt.prependListener=or,xt.prependOnceListener=or,xt.listeners=function(e){return[]},xt.binding=function(e){throw new Error("process.binding is not supported")},xt.cwd=function(){return"/"},xt.chdir=function(e){throw new Error("process.chdir is not supported")},xt.umask=function(){return 0};var U0=nd.exports;const be=M0(U0);function sr(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let it;const ba=new WeakSet;class q0{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,ba.has(this)&&(ba.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ad(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,dd(this),ld(this);const t=it,n=Bn;it=this,Bn=!0;try{return this.fn()}finally{be.env.NODE_ENV!=="production"&&it!==this&&sr("Active effect was not restored correctly - this is likely a Vue internal bug."),cd(this),it=t,Bn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ea(t);this.deps=this.depsTail=void 0,dd(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ba.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Sa(this)&&this.run()}get dirty(){return Sa(this)}}let sd=0,Mi,Bi;function ad(e,t=!1){if(e.flags|=8,t){e.next=Bi,Bi=e;return}e.next=Mi,Mi=e}function va(){sd++}function wa(){if(--sd>0)return;if(Bi){let t=Bi;for(Bi=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Mi;){let t=Mi;for(Mi=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 ld(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function cd(e){let t,n=e.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),Ea(r),V0(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function Sa(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(ud(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function ud(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===qi))return;e.globalVersion=qi;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!Sa(e)){e.flags&=-3;return}const n=it,r=Bn;it=e,Bn=!0;try{ld(e);const o=e.fn(e._value);(t.version===0||W.hasChanged(o,e._value))&&(e._value=o,t.version++)}catch(o){throw t.version++,o}finally{it=n,Bn=r,cd(e),e.flags&=-3}}function Ea(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),be.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)Ea(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function V0(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Bn=!0;const fd=[];function ji(){fd.push(Bn),Bn=!1}function Ui(){const e=fd.pop();Bn=e===void 0?!0:e}function dd(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=it;it=void 0;try{t()}finally{it=n}}}let qi=0;class z0{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 Lo{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,be.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){if(!it||!Bn||it===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==it)n=this.activeLink=new z0(it,this),it.deps?(n.prevDep=it.depsTail,it.depsTail.nextDep=n,it.depsTail=n):it.deps=it.depsTail=n,pd(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=it.depsTail,n.nextDep=void 0,it.depsTail.nextDep=n,it.depsTail=n,it.deps===n&&(it.deps=r)}return be.env.NODE_ENV!=="production"&&it.onTrack&&it.onTrack(W.extend({effect:it},t)),n}trigger(t){this.version++,qi++,this.notify(t)}notify(t){va();try{if(be.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(W.extend({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{wa()}}}function pd(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)pd(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),be.env.NODE_ENV!=="production"&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}const Mo=new WeakMap,jr=Symbol(be.env.NODE_ENV!=="production"?"Object iterate":""),Ta=Symbol(be.env.NODE_ENV!=="production"?"Map keys iterate":""),Vi=Symbol(be.env.NODE_ENV!=="production"?"Array iterate":"");function nn(e,t,n){if(Bn&&it){let r=Mo.get(e);r||Mo.set(e,r=new Map);let o=r.get(n);o||(r.set(n,o=new Lo),o.map=r,o.key=n),be.env.NODE_ENV!=="production"?o.track({target:e,type:t,key:n}):o.track()}}function Rr(e,t,n,r,o,i){const s=Mo.get(e);if(!s){qi++;return}const a=c=>{c&&(be.env.NODE_ENV!=="production"?c.trigger({target:e,type:t,key:n,newValue:r,oldValue:o,oldTarget:i}):c.trigger())};if(va(),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((f,d)=>{(d==="length"||d===Vi||!W.isSymbol(d)&&d>=l)&&a(f)})}else switch((n!==void 0||s.has(void 0))&&a(s.get(n)),u&&a(s.get(Vi)),t){case"add":c?u&&a(s.get("length")):(a(s.get(jr)),W.isMap(e)&&a(s.get(Ta)));break;case"delete":c||(a(s.get(jr)),W.isMap(e)&&a(s.get(Ta)));break;case"set":W.isMap(e)&&a(s.get(jr));break}}wa()}function W0(e,t){const n=Mo.get(e);return n&&n.get(t)}function hi(e){const t=nt(e);return t===e?t:(nn(t,"iterate",Vi),fn(e)?t:t.map(sn))}function Bo(e){return nn(e=nt(e),"iterate",Vi),e}const H0={__proto__:null,[Symbol.iterator](){return Aa(this,Symbol.iterator,sn)},concat(...e){return hi(this).concat(...e.map(t=>W.isArray(t)?hi(t):t))},entries(){return Aa(this,"entries",e=>(e[1]=sn(e[1]),e))},every(e,t){return ar(this,"every",e,t,void 0,arguments)},filter(e,t){return ar(this,"filter",e,t,n=>n.map(sn),arguments)},find(e,t){return ar(this,"find",e,t,sn,arguments)},findIndex(e,t){return ar(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ar(this,"findLast",e,t,sn,arguments)},findLastIndex(e,t){return ar(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ar(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ra(this,"includes",e)},indexOf(...e){return Ra(this,"indexOf",e)},join(e){return hi(this).join(e)},lastIndexOf(...e){return Ra(this,"lastIndexOf",e)},map(e,t){return ar(this,"map",e,t,void 0,arguments)},pop(){return zi(this,"pop")},push(...e){return zi(this,"push",e)},reduce(e,...t){return hd(this,"reduce",e,t)},reduceRight(e,...t){return hd(this,"reduceRight",e,t)},shift(){return zi(this,"shift")},some(e,t){return ar(this,"some",e,t,void 0,arguments)},splice(...e){return zi(this,"splice",e)},toReversed(){return hi(this).toReversed()},toSorted(e){return hi(this).toSorted(e)},toSpliced(...e){return hi(this).toSpliced(...e)},unshift(...e){return zi(this,"unshift",e)},values(){return Aa(this,"values",sn)}};function Aa(e,t,n){const r=Bo(e),o=r[t]();return r!==e&&!fn(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.value&&(i.value=n(i.value)),i}),o}const G0=Array.prototype;function ar(e,t,n,r,o,i){const s=Bo(e),a=s!==e&&!fn(e),c=s[t];if(c!==G0[t]){const f=c.apply(e,i);return a?sn(f):f}let u=n;s!==e&&(a?u=function(f,d){return n.call(this,sn(f),d,e)}:n.length>2&&(u=function(f,d){return n.call(this,f,d,e)}));const l=c.call(s,u,r);return a&&o?o(l):l}function hd(e,t,n,r){const o=Bo(e);let i=n;return o!==e&&(fn(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,sn(a),c,e)}),o[t](i,...r)}function Ra(e,t,n){const r=nt(e);nn(r,"iterate",Vi);const o=r[t](...n);return(o===-1||o===!1)&&Vo(n[0])?(n[0]=nt(n[0]),r[t](...n)):o}function zi(e,t,n=[]){ji(),va();const r=nt(e)[t].apply(e,n);return wa(),Ui(),r}const K0=W.makeMap("__proto__,__v_isRef,__isVue"),gd=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(W.isSymbol));function Q0(e){W.isSymbol(e)||(e=String(e));const t=nt(this);return nn(t,"has",e),t.hasOwnProperty(e)}class md{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?Sd:wd:i?ow:vd).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const s=W.isArray(t);if(!o){let c;if(s&&(c=H0[n]))return c;if(n==="hasOwnProperty")return Q0}const a=Reflect.get(t,n,Lt(t)?t:r);return(W.isSymbol(n)?gd.has(n):K0(n))||(o||nn(t,"get",n),i)?a:Lt(a)?s&&W.isIntegerKey(n)?a:a.value:W.isObject(a)?o?lr(a):Ca(a):a}}class X0 extends md{constructor(t=!1){super(!1,t)}set(t,n,r,o){let i=t[n];if(!this._isShallow){const c=cr(i);if(!fn(r)&&!cr(r)&&(i=nt(i),r=nt(r)),!W.isArray(t)&&Lt(i)&&!Lt(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,Lt(t)?t:o);return t===nt(o)&&(s?W.hasChanged(r,i)&&Rr(t,"set",n,r,i):Rr(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&&Rr(t,"delete",n,void 0,o),i}has(t,n){const r=Reflect.has(t,n);return(!W.isSymbol(n)||!gd.has(n))&&nn(t,"has",n),r}ownKeys(t){return nn(t,"iterate",W.isArray(t)?"length":jr),Reflect.ownKeys(t)}}class yd extends md{constructor(t=!1){super(!0,t)}set(t,n){return be.env.NODE_ENV!=="production"&&sr(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return be.env.NODE_ENV!=="production"&&sr(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const Y0=new X0,J0=new yd,Z0=new yd(!0),_a=e=>e,jo=e=>Reflect.getPrototypeOf(e);function ew(e,t,n){return function(...r){const o=this.__v_raw,i=nt(o),s=W.isMap(i),a=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,u=o[e](...r),l=n?_a:t?Pa:sn;return!t&&nn(i,"iterate",c?Ta:jr),{next(){const{value:f,done:d}=u.next();return d?{value:f,done:d}:{value:a?[l(f[0]),l(f[1])]:l(f),done:d}},[Symbol.iterator](){return this}}}}function Uo(e){return function(...t){if(be.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";sr(`${W.capitalize(e)} operation ${n}failed: target is readonly.`,nt(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function tw(e,t){const n={get(o){const i=this.__v_raw,s=nt(i),a=nt(o);e||(W.hasChanged(o,a)&&nn(s,"get",o),nn(s,"get",a));const{has:c}=jo(s),u=t?_a:e?Pa:sn;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&&nn(nt(o),"iterate",jr),Reflect.get(o,"size",o)},has(o){const i=this.__v_raw,s=nt(i),a=nt(o);return e||(W.hasChanged(o,a)&&nn(s,"has",o),nn(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=nt(a),u=t?_a:e?Pa:sn;return!e&&nn(c,"iterate",jr),a.forEach((l,f)=>o.call(i,u(l),u(f),s))}};return W.extend(n,e?{add:Uo("add"),set:Uo("set"),delete:Uo("delete"),clear:Uo("clear")}:{add(o){!t&&!fn(o)&&!cr(o)&&(o=nt(o));const i=nt(this);return jo(i).has.call(i,o)||(i.add(o),Rr(i,"add",o,o)),this},set(o,i){!t&&!fn(i)&&!cr(i)&&(i=nt(i));const s=nt(this),{has:a,get:c}=jo(s);let u=a.call(s,o);u?be.env.NODE_ENV!=="production"&&bd(s,a,o):(o=nt(o),u=a.call(s,o));const l=c.call(s,o);return s.set(o,i),u?W.hasChanged(i,l)&&Rr(s,"set",o,i,l):Rr(s,"add",o,i),this},delete(o){const i=nt(this),{has:s,get:a}=jo(i);let c=s.call(i,o);c?be.env.NODE_ENV!=="production"&&bd(i,s,o):(o=nt(o),c=s.call(i,o));const u=a?a.call(i,o):void 0,l=i.delete(o);return c&&Rr(i,"delete",o,void 0,u),l},clear(){const o=nt(this),i=o.size!==0,s=be.env.NODE_ENV!=="production"?W.isMap(o)?new Map(o):new Set(o):void 0,a=o.clear();return i&&Rr(o,"clear",void 0,void 0,s),a}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=ew(o,e,t)}),n}function Ia(e,t){const n=tw(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 nw={get:Ia(!1,!1)},rw={get:Ia(!0,!1)},iw={get:Ia(!0,!0)};function bd(e,t,n){const r=nt(n);if(r!==n&&t.call(e,r)){const o=W.toRawType(e);sr(`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 vd=new WeakMap,ow=new WeakMap,wd=new WeakMap,Sd=new WeakMap;function sw(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function aw(e){return e.__v_skip||!Object.isExtensible(e)?0:sw(W.toRawType(e))}function Ca(e){return cr(e)?e:Fa(e,!1,Y0,nw,vd)}function lr(e){return Fa(e,!0,J0,rw,wd)}function qo(e){return Fa(e,!0,Z0,iw,Sd)}function Fa(e,t,n,r,o){if(!W.isObject(e))return be.env.NODE_ENV!=="production"&&sr(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=o.get(e);if(i)return i;const s=aw(e);if(s===0)return e;const a=new Proxy(e,s===2?r:n);return o.set(e,a),a}function Ur(e){return cr(e)?Ur(e.__v_raw):!!(e&&e.__v_isReactive)}function cr(e){return!!(e&&e.__v_isReadonly)}function fn(e){return!!(e&&e.__v_isShallow)}function Vo(e){return e?!!e.__v_raw:!1}function nt(e){const t=e&&e.__v_raw;return t?nt(t):e}function lw(e){return!W.hasOwn(e,"__v_skip")&&Object.isExtensible(e)&&W.def(e,"__v_skip",!0),e}const sn=e=>W.isObject(e)?Ca(e):e,Pa=e=>W.isObject(e)?lr(e):e;function Lt(e){return e?e.__v_isRef===!0:!1}function ae(e){return Ed(e,!1)}function cw(e){return Ed(e,!0)}function Ed(e,t){return Lt(e)?e:new uw(e,t)}class uw{constructor(t,n){this.dep=new Lo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:nt(t),this._value=n?t:sn(t),this.__v_isShallow=n}get value(){return be.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||fn(t)||cr(t);t=r?t:nt(t),W.hasChanged(t,n)&&(this._rawValue=t,this._value=r?t:sn(t),be.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:n}):this.dep.trigger())}}function p(e){return Lt(e)?e.value:e}const fw={get:(e,t,n)=>t==="__v_raw"?e:p(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return Lt(o)&&!Lt(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function dw(e){return Ur(e)?e:new Proxy(e,fw)}class pw{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Lo,{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 Td(e){return new pw(e)}class hw{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 W0(nt(this._object),this._key)}}class gw{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 Lt(e)?e:W.isFunction(e)?new gw(e):W.isObject(e)&&arguments.length>1?yw(e,t,n):ae(e)}function yw(e,t,n){const r=e[t];return Lt(r)?r:new hw(e,t,n)}class bw{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Lo(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=qi-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&it!==this)return ad(this,!0),!0;be.env.NODE_ENV}get value(){const t=be.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return ud(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter?this.setter(t):be.env.NODE_ENV!=="production"&&sr("Write operation failed: computed value is readonly")}}function vw(e,t,n=!1){let r,o;W.isFunction(e)?r=e:(r=e.get,o=e.set);const i=new bw(r,o,n);return be.env.NODE_ENV,i}const zo={},Wo=new WeakMap;let qr;function ww(e,t=!1,n=qr){if(n){let r=Wo.get(n);r||Wo.set(n,r=[]),r.push(e)}else be.env.NODE_ENV!=="production"&&!t&&sr("onWatcherCleanup() was called when there was no active watcher to associate with.")}function Sw(e,t,n=W.EMPTY_OBJ){const{immediate:r,deep:o,once:i,scheduler:s,augmentJob:a,call:c}=n,u=y=>{(n.onWarn||sr)("Invalid watch source: ",y,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},l=y=>o?y:fn(y)||o===!1||o===0?ur(y,1):ur(y);let f,d,m,w,b=!1,T=!1;if(Lt(e)?(d=()=>e.value,b=fn(e)):Ur(e)?(d=()=>l(e),b=!0):W.isArray(e)?(T=!0,b=e.some(y=>Ur(y)||fn(y)),d=()=>e.map(y=>{if(Lt(y))return y.value;if(Ur(y))return l(y);if(W.isFunction(y))return c?c(y,2):y();be.env.NODE_ENV!=="production"&&u(y)})):W.isFunction(e)?t?d=c?()=>c(e,2):e:d=()=>{if(m){ji();try{m()}finally{Ui()}}const y=qr;qr=f;try{return c?c(e,3,[w]):e(w)}finally{qr=y}}:(d=W.NOOP,be.env.NODE_ENV!=="production"&&u(e)),t&&o){const y=d,S=o===!0?1/0:o;d=()=>ur(y(),S)}const v=()=>{f.stop()};if(i&&t){const y=t;t=(...S)=>{y(...S),v()}}let g=T?new Array(e.length).fill(zo):zo;const h=y=>{if(!(!(f.flags&1)||!f.dirty&&!y))if(t){const S=f.run();if(o||b||(T?S.some((E,R)=>W.hasChanged(E,g[R])):W.hasChanged(S,g))){m&&m();const E=qr;qr=f;try{const R=[S,g===zo?void 0:T&&g[0]===zo?[]:g,w];c?c(t,3,R):t(...R),g=S}finally{qr=E}}}else f.run()};return a&&a(h),f=new q0(d),f.scheduler=s?()=>s(h,!1):h,w=y=>ww(y,!1,f),m=f.onStop=()=>{const y=Wo.get(f);if(y){if(c)c(y,4);else for(const S of y)S();Wo.delete(f)}},be.env.NODE_ENV!=="production"&&(f.onTrack=n.onTrack,f.onTrigger=n.onTrigger),t?r?h(!0):g=f.run():s?s(h.bind(null,!0),!0):f.run(),v.pause=f.pause.bind(f),v.resume=f.resume.bind(f),v.stop=v,v}function ur(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--,Lt(e))ur(e.value,t,n);else if(W.isArray(e))for(let r=0;r<e.length;r++)ur(e[r],t,n);else if(W.isSet(e)||W.isMap(e))e.forEach(r=>{ur(r,t,n)});else if(W.isPlainObject(e)){for(const r in e)ur(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&ur(e[r],t,n)}return e}const Vr=[];function Ew(e){Vr.push(e)}function Tw(){Vr.pop()}let Oa=!1;function et(e,...t){if(Oa)return;Oa=!0,ji();const n=Vr.length?Vr[Vr.length-1].component:null,r=n&&n.appContext.config.warnHandler,o=Aw();if(r)Ho(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 <${cp(n,i.type)}>`).join(`
2
2
  `),o]);else{const i=[`[Vue warn]: ${e}`,...t];o.length&&i.push(`
3
- `,...Aw(o)),console.warn(...i)}Ui(),Oa=!1}function Tw(){let e=Vr[Vr.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 Aw(e){const t=[];return e.forEach((n,r)=>{t.push(...r===0?[]:[`
4
- `],...Rw(n))}),t}function Rw({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",r=e.component?e.component.parent==null:!1,o=` at <${cp(e.component,e.type,r)}`,i=">"+n;return e.props?[o,..._w(e.props),i]:[o+i]}function _w(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(r=>{t.push(...Ad(r,e[r]))}),n.length>3&&t.push(" ..."),t}function Ad(e,t,n){return H.isString(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:Lt(t)?(t=Ad(e,nt(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):H.isFunction(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=nt(t),n?t:[`${e}=`,t])}const xa={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Ho(e,t,n,r){try{return r?e(...r):e()}catch(o){Go(o,t,n)}}function ka(e,t,n,r){if(H.isFunction(e)){const o=Ho(e,t,n,r);return o&&H.isPromise(o)&&o.catch(i=>{Go(i,t,n)}),o}if(H.isArray(e)){const o=[];for(let i=0;i<e.length;i++)o.push(ka(e[i],t,n,r));return o}else ye.env.NODE_ENV!=="production"&&et(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function Go(e,t,n,r=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||H.EMPTY_OBJ;if(t){let a=t.parent;const c=t.proxy,u=ye.env.NODE_ENV!=="production"?xa[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const l=a.ec;if(l){for(let f=0;f<l.length;f++)if(l[f](e,c,u)===!1)return}a=a.parent}if(i){ji(),Ho(i,null,10,[e,c,u]),Ui();return}}Iw(e,n,o,r,s)}function Iw(e,t,n,r=!0,o=!1){if(ye.env.NODE_ENV!=="production"){const i=xa[t];if(n&&Sw(n),et(`Unhandled error${i?` during execution of ${i}`:""}`),n&&Ew(),r)throw e;console.error(e)}else{if(o)throw e;console.error(e)}}const Pn=[];let fr=-1;const gi=[];let _r=null,mi=0;const Rd=Promise.resolve();let Ko=null;const Cw=100;function Gn(e){const t=Ko||Rd;return e?t.then(this?e.bind(this):e):t}function Pw(e){let t=fr+1,n=Pn.length;for(;t<n;){const r=t+n>>>1,o=Pn[r],i=Wi(o);i<e||i===e&&o.flags&2?t=r+1:n=r}return t}function Na(e){if(!(e.flags&1)){const t=Wi(e),n=Pn[Pn.length-1];!n||!(e.flags&2)&&t>=Wi(n)?Pn.push(e):Pn.splice(Pw(t),0,e),e.flags|=1,_d()}}function _d(){Ko||(Ko=Rd.then(Cd))}function Id(e){H.isArray(e)?gi.push(...e):_r&&e.id===-1?_r.splice(mi+1,0,e):e.flags&1||(gi.push(e),e.flags|=1),_d()}function Fw(e){if(gi.length){const t=[...new Set(gi)].sort((n,r)=>Wi(n)-Wi(r));if(gi.length=0,_r){_r.push(...t);return}for(_r=t,ye.env.NODE_ENV!=="production"&&(e=e||new Map),mi=0;mi<_r.length;mi++){const n=_r[mi];ye.env.NODE_ENV!=="production"&&Pd(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}_r=null,mi=0}}const Wi=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Cd(e){ye.env.NODE_ENV!=="production"&&(e=e||new Map);const t=ye.env.NODE_ENV!=="production"?n=>Pd(e,n):H.NOOP;try{for(fr=0;fr<Pn.length;fr++){const n=Pn[fr];if(n&&!(n.flags&8)){if(ye.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),Ho(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;fr<Pn.length;fr++){const n=Pn[fr];n&&(n.flags&=-2)}fr=-1,Pn.length=0,Fw(e),Ko=null,(Pn.length||gi.length)&&Cd(e)}}function Pd(e,t){const n=e.get(t)||0;if(n>Cw){const r=t.i,o=r&&Xa(r.type);return Go(`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 Hi=!1;const $a=new Map;ye.env.NODE_ENV!=="production"&&(H.getGlobalThis().__VUE_HMR_RUNTIME__={createRecord:Da(Ow),rerender:Da(xw),reload:Da(kw)});const Qo=new Map;function Ow(e,t){return Qo.has(e)?!1:(Qo.set(e,{initialDef:Xo(t),instances:new Set}),!0)}function Xo(e){return up(e)?e.__vccOpts:e}function xw(e,t){const n=Qo.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(r=>{t&&(r.render=t,Xo(r.type).render=t),r.renderCache=[],Hi=!0,r.update(),Hi=!1}))}function kw(e,t){const n=Qo.get(e);if(!n)return;t=Xo(t),Fd(n.initialDef,t);const r=[...n.instances];for(let o=0;o<r.length;o++){const i=r[o],s=Xo(i.type);let a=$a.get(s);a||(s!==n.initialDef&&Fd(s,t),$a.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?Na(()=>{Hi=!0,i.parent.update(),Hi=!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)}Id(()=>{$a.clear()})}function Fd(e,t){H.extend(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function Da(e){return(t,n)=>{try{return e(t,n)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let Ir,Gi=[],La=!1;function Nw(e,...t){Ir?Ir.emit(e,...t):La||Gi.push({event:e,args:t})}function Od(e,t){var n,r;Ir=e,Ir?(Ir.enabled=!0,Gi.forEach(({event:o,args:i})=>Ir.emit(o,...i)),Gi=[]):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=>{Od(i,t)}),setTimeout(()=>{Ir||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,La=!0,Gi=[])},3e3)):(La=!0,Gi=[])}const $w=Dw("component:updated");/*! #__NO_SIDE_EFFECTS__ */function Dw(e){return t=>{Nw(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let Jt=null,xd=null;function kd(e){const t=Jt;return Jt=e,xd=e&&e.type.__scopeId||null,t}function Te(e,t=Jt,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&tp(-1);const i=kd(t);let s;try{s=e(...o)}finally{kd(i),r._d&&tp(1)}return ye.env.NODE_ENV!=="production"&&$w(t),s};return r._n=!0,r._c=!0,r._d=!0,r}function ot(e,t){if(Jt===null)return ye.env.NODE_ENV!=="production"&&et("withDirectives can only be used inside render functions."),e;const n=lp(Jt),r=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,s,a,c=H.EMPTY_OBJ]=t[o];i&&(H.isFunction(i)&&(i={mounted:i,updated:i}),i.deep&&ur(s),r.push({dir:i,instance:n,value:s,oldValue:void 0,arg:a,modifiers:c}))}return e}const Lw=Symbol("_vte"),Mw=e=>e.__isTeleport,zr=e=>e&&(e.disabled||e.disabled===""),Nd=e=>e&&(e.defer||e.defer===""),$d=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Dd=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ma=(e,t)=>{const n=e&&e.to;if(H.isString(n))if(t){const r=t(n);return ye.env.NODE_ENV!=="production"&&!r&&!zr(e)&&et(`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 ye.env.NODE_ENV!=="production"&&et("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"),null;else return ye.env.NODE_ENV!=="production"&&!n&&!zr(e)&&et(`Invalid Teleport target: ${n}`),n},Ld={name:"Teleport",__isTeleport:!0,process(e,t,n,r,o,i,s,a,c,u){const{mc:l,pc:f,pbc:d,o:{insert:m,querySelector:w,createText:v,createComment:T}}=u,b=zr(t.props);let{shapeFlag:g,children:h,dynamicChildren:y}=t;if(ye.env.NODE_ENV!=="production"&&Hi&&(c=!1,y=null),e==null){const S=t.el=ye.env.NODE_ENV!=="production"?T("teleport start"):v(""),E=t.anchor=ye.env.NODE_ENV!=="production"?T("teleport end"):v("");m(S,n,r),m(E,n,r);const R=(A,$)=>{g&16&&(o&&o.isCE&&(o.ce._teleportTarget=A),l(h,A,$,o,i,s,a,c))},I=()=>{const A=t.target=Ma(t.props,w),$=Bd(A,t,v,m);A?(s!=="svg"&&$d(A)?s="svg":s!=="mathml"&&Dd(A)&&(s="mathml"),b||(R(A,$),Jo(t,!1))):ye.env.NODE_ENV!=="production"&&!b&&et("Invalid Teleport target on mount:",A,`(${typeof A})`)};b&&(R(n,E),Jo(t,!0)),Nd(t.props)?Wa(()=>{I(),t.el.__isMounted=!0},i):I()}else{if(Nd(t.props)&&!e.el.__isMounted){Wa(()=>{Ld.process(e,t,n,r,o,i,s,a,c,u),delete e.el.__isMounted},i);return}t.el=e.el,t.targetStart=e.targetStart;const S=t.anchor=e.anchor,E=t.target=e.target,R=t.targetAnchor=e.targetAnchor,I=zr(e.props),A=I?n:E,$=I?S:R;if(s==="svg"||$d(E)?s="svg":(s==="mathml"||Dd(E))&&(s="mathml"),y?(d(e.dynamicChildren,y,A,o,i,s,a),Jd(e,t,!0)):c||f(e,t,A,$,o,i,s,a,!1),b)I?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Yo(t,n,S,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const D=t.target=Ma(t.props,w);D?Yo(t,D,null,u,0):ye.env.NODE_ENV!=="production"&&et("Invalid Teleport target on update:",E,`(${typeof E})`)}else I&&Yo(t,E,R,u,1);Jo(t,b)}},remove(e,t,n,{um:r,o:{remove:o}},i){const{shapeFlag:s,children:a,anchor:c,targetStart:u,targetAnchor:l,target:f,props:d}=e;if(f&&(o(u),o(l)),i&&o(c),s&16){const m=i||!zr(d);for(let w=0;w<a.length;w++){const v=a[w];r(v,t,n,m,!!v.dynamicChildren)}}},move:Yo,hydrate:Bw};function Yo(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,f=i===2;if(f&&r(s,t,n),(!f||zr(l))&&c&16)for(let d=0;d<u.length;d++)o(u[d],t,n,2);f&&r(a,t,n)}function Bw(e,t,n,r,o,i,{o:{nextSibling:s,parentNode:a,querySelector:c,insert:u,createText:l}},f){const d=t.target=Ma(t.props,c);if(d){const m=zr(t.props),w=d._lpa||d.firstChild;if(t.shapeFlag&16)if(m)t.anchor=f(s(e),t,a(e),n,r,o,i),t.targetStart=w,t.targetAnchor=w&&s(w);else{t.anchor=s(e);let v=w;for(;v;){if(v&&v.nodeType===8){if(v.data==="teleport start anchor")t.targetStart=v;else if(v.data==="teleport anchor"){t.targetAnchor=v,d._lpa=t.targetAnchor&&s(t.targetAnchor);break}}v=s(v)}t.targetAnchor||Bd(d,t,l,u),f(w&&s(w),t,d,n,r,o,i)}Jo(t,m)}return t.anchor&&s(t.anchor)}const Md=Ld;function Jo(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 Bd(e,t,n,r){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Lw]=i,e&&(r(o,e),r(i,e)),i}function jd(e,t){e.shapeFlag&6&&e.component?(e.transition=t,jd(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 Me(e,t){return H.isFunction(e)?H.extend({name:e.name},t,{setup:e}):e}function jw(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const Uw=new WeakSet;function Ud(e){const t=Ka(),n=lw(null);if(t){const o=t.refs===H.EMPTY_OBJ?t.refs={}:t.refs;let i;ye.env.NODE_ENV!=="production"&&(i=Object.getOwnPropertyDescriptor(o,e))&&!i.configurable?et(`useTemplateRef('${e}') already exists.`):Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:s=>n.value=s})}else ye.env.NODE_ENV!=="production"&&et("useTemplateRef() is called when there is no active component instance to be associated with.");const r=ye.env.NODE_ENV!=="production"?lr(n):n;return ye.env.NODE_ENV!=="production"&&Uw.add(r),r}const qd=e=>e.nodeType===8;H.getGlobalThis().requestIdleCallback,H.getGlobalThis().cancelIdleCallback;function qw(e,t){if(qd(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(qd(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const Vw=e=>!!e.type.__asyncLoader;/*! #__NO_SIDE_EFFECTS__ */function zw(e){H.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,f=0;const d=()=>(f++,u=null,m()),m=()=>{let w;return u||(w=u=t().catch(v=>{if(v=v instanceof Error?v:new Error(String(v)),c)return new Promise((T,b)=>{c(v,()=>T(d()),()=>b(v),f+1)});throw v}).then(v=>{if(w!==u&&u)return u;if(ye.env.NODE_ENV!=="production"&&!v&&et("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),ye.env.NODE_ENV!=="production"&&v&&!H.isObject(v)&&!H.isFunction(v))throw new Error(`Invalid async component load result: ${v}`);return l=v,v}))};return Me({name:"AsyncComponentWrapper",__asyncLoader:m,__asyncHydrate(w,v,T){const b=i?()=>{const g=i(T,h=>qw(w,h));g&&(v.bum||(v.bum=[])).push(g)}:T;l?b():m().then(()=>!v.isUnmounted&&b())},get __asyncResolved(){return l},setup(){const w=Sn;if(jw(w),l)return()=>Ba(l,w);const v=h=>{u=null,Go(h,w,13,!r)};if(a&&w.suspense||wi)return m().then(h=>()=>Ba(h,w)).catch(h=>(v(h),()=>r?be(r,{error:h}):null));const T=oe(!1),b=oe(),g=oe(!!o);return o&&setTimeout(()=>{g.value=!1},o),s!=null&&setTimeout(()=>{if(!T.value&&!b.value){const h=new Error(`Async component timed out after ${s}ms.`);v(h),b.value=h}},s),m().then(()=>{T.value=!0,w.parent&&Ww(w.parent.vnode)&&w.parent.update()}).catch(h=>{v(h),b.value=h}),()=>{if(T.value&&l)return Ba(l,w);if(b.value&&r)return be(r,{error:b.value});if(n&&!g.value)return be(n)}}})}function Ba(e,t){const{ref:n,props:r,children:o,ce:i}=t.vnode,s=be(e,r,o);return s.ref=n,s.ce=i,delete t.vnode.ce,s}const Ww=e=>e.type.__isKeepAlive;function Hw(e,t,n=Sn,r=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...s)=>{ji();const a=sp(n),c=ka(t,n,e,s);return a(),Ui(),c});return r?o.unshift(i):o.push(i),i}else if(ye.env.NODE_ENV!=="production"){const o=H.toHandlerKey(xa[e].replace(/ hook$/,""));et(`${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 Zo=e=>(t,n=Sn)=>{(!wi||e==="sp")&&Hw(e,(...r)=>t(...r),n)},Mt=Zo("m"),Gw=Zo("bu"),jn=Zo("bum"),ja=Zo("um"),es="components",Kw="directives";function pe(e,t){return Ua(es,e,!0,t)||e}const Vd=Symbol.for("v-ndc");function Wr(e){return H.isString(e)?Ua(es,e,!1)||e:e||Vd}function dn(e){return Ua(Kw,e)}function Ua(e,t,n=!0,r=!1){const o=Jt||Sn;if(o){const i=o.type;if(e===es){const a=Xa(i,!1);if(a&&(a===t||a===H.camelize(t)||a===H.capitalize(H.camelize(t))))return i}const s=zd(o[e]||i[e],t)||zd(o.appContext[e],t);if(!s&&r)return i;if(ye.env.NODE_ENV!=="production"&&n&&!s){const a=e===es?`
5
- If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`:"";et(`Failed to resolve ${e.slice(0,-1)}: ${t}${a}`)}return s}else ye.env.NODE_ENV!=="production"&&et(`resolve${H.capitalize(e.slice(0,-1))} can only be used in render() or setup().`)}function zd(e,t){return e&&(e[t]||e[H.camelize(t)]||e[H.capitalize(H.camelize(t))])}function kt(e,t,n,r){let o;const i=n,s=H.isArray(e);if(s||H.isString(e)){const a=s&&Ur(e);let c=!1;a&&(c=!fn(e),e=Bo(e)),o=new Array(e.length);for(let u=0,l=e.length;u<l;u++)o[u]=t(c?sn(e[u]):e[u],u,void 0,i)}else if(typeof e=="number"){ye.env.NODE_ENV!=="production"&&!Number.isInteger(e)&&et(`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(H.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 Wd(e,t){for(let n=0;n<t.length;n++){const r=t[n];if(H.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 Ge(e,t,n={},r,o){if(Jt.ce||Jt.parent&&Vw(Jt.parent)&&Jt.parent.ce)return t!=="default"&&(n.name=t),J(),Ce(Qe,null,[be("slot",n,r&&r())],64);let i=e[t];ye.env.NODE_ENV!=="production"&&i&&i.length>1&&(et("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),J();const s=i&&Hd(i(n)),a=n.key||s&&s.key,c=Ce(Qe,{key:(a&&!H.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 Hd(e){return e.some(t=>rs(t)?!(t.type===bi||t.type===Qe&&!Hd(t.children)):!0)?e:null}function qa(e,t){const n={};if(ye.env.NODE_ENV!=="production"&&!H.isObject(e))return et("v-on with no argument expects an object value."),n;for(const r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:H.toHandlerKey(r)]=e[r];return n}const Va=e=>e?pS(e)?lp(e):Va(e.parent):null,za=H.extend(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>ye.env.NODE_ENV!=="production"?qo(e.props):e.props,$attrs:e=>ye.env.NODE_ENV!=="production"?qo(e.attrs):e.attrs,$slots:e=>ye.env.NODE_ENV!=="production"?qo(e.slots):e.slots,$refs:e=>ye.env.NODE_ENV!=="production"?qo(e.refs):e.refs,$parent:e=>Va(e.parent),$root:e=>Va(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Jw(e),$forceUpdate:e=>e.f||(e.f=()=>{Na(e.update)}),$nextTick:e=>e.n||(e.n=Gn.bind(e.proxy)),$watch:e=>sS.bind(e)}),Qw={};ye.env.NODE_ENV!=="production"&&(Qw.ownKeys=e=>(et("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 Xw(){return Yw().slots}function Yw(){const e=Ka();return ye.env.NODE_ENV!=="production"&&!e&&et("useContext() called without active instance."),e.setupContext||(e.setupContext=gS(e))}function Gd(e){return H.isArray(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Jw(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=>ts(c,u,s,!0)),ts(c,t,s)),H.isObject(t)&&i.set(t,c),c}function ts(e,t,n,r=!1){const{mixins:o,extends:i}=t;i&&ts(e,i,n,!0),o&&o.forEach(s=>ts(e,s,n,!0));for(const s in t)if(r&&s==="expose")ye.env.NODE_ENV!=="production"&&et('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const a=Zw[s]||n&&n[s];e[s]=a?a(e[s],t[s]):t[s]}return e}const Zw={data:Kd,props:Xd,emits:Xd,methods:Ki,computed:Ki,beforeCreate:pn,created:pn,beforeMount:pn,mounted:pn,beforeUpdate:pn,updated:pn,beforeDestroy:pn,beforeUnmount:pn,destroyed:pn,unmounted:pn,activated:pn,deactivated:pn,errorCaptured:pn,serverPrefetch:pn,components:Ki,directives:Ki,watch:tS,provide:Kd,inject:eS};function Kd(e,t){return t?e?function(){return H.extend(H.isFunction(e)?e.call(this,this):e,H.isFunction(t)?t.call(this,this):t)}:t:e}function eS(e,t){return Ki(Qd(e),Qd(t))}function Qd(e){if(H.isArray(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function pn(e,t){return e?[...new Set([].concat(e,t))]:t}function Ki(e,t){return e?H.extend(Object.create(null),e,t):t}function Xd(e,t){return e?H.isArray(e)&&H.isArray(t)?[...new Set([...e,...t])]:H.extend(Object.create(null),Gd(e),Gd(t??{})):t}function tS(e,t){if(!e)return t;if(!t)return e;const n=H.extend(Object.create(null),e);for(const r in t)n[r]=pn(e[r],t[r]);return n}let nS=null;function yi(e,t){if(!Sn)ye.env.NODE_ENV!=="production"&&et("provide() can only be used inside setup().");else{let n=Sn.provides;const r=Sn.parent&&Sn.parent.provides;r===n&&(n=Sn.provides=Object.create(r)),n[e]=t}}function dr(e,t,n=!1){const r=Sn||Jt;if(r||nS){const o=r?r.parent==null?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&&H.isFunction(t)?t.call(r&&r.proxy):t;ye.env.NODE_ENV!=="production"&&et(`injection "${String(e)}" not found.`)}else ye.env.NODE_ENV!=="production"&&et("inject() can only be used inside setup() or functional components.")}const rS={},Yd=e=>Object.getPrototypeOf(e)===rS,Wa=cS;function Jd(e,t,n=!1){const r=e.children,o=t.children;if(H.isArray(r)&&H.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]=dS(o[i]),a.el=s.el),!n&&a.patchFlag!==-2&&Jd(s,a)),a.type===ep&&(a.el=s.el),ye.env.NODE_ENV!=="production"&&a.type===bi&&!a.el&&(a.el=s.el)}}const iS=Symbol.for("v-scx"),oS=()=>{{const e=dr(iS);return e||ye.env.NODE_ENV!=="production"&&et("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function Tt(e,t,n){return ye.env.NODE_ENV!=="production"&&!H.isFunction(t)&&et("`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."),Zd(e,t,n)}function Zd(e,t,n=H.EMPTY_OBJ){const{immediate:r,deep:o,flush:i,once:s}=n;ye.env.NODE_ENV!=="production"&&!t&&(r!==void 0&&et('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&et('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),s!==void 0&&et('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const a=H.extend({},n);ye.env.NODE_ENV!=="production"&&(a.onWarn=et);const c=t&&r||!t&&i!=="post";let u;if(wi){if(i==="sync"){const m=oS();u=m.__watcherHandles||(m.__watcherHandles=[])}else if(!c){const m=()=>{};return m.stop=H.NOOP,m.resume=H.NOOP,m.pause=H.NOOP,m}}const l=Sn;a.call=(m,w,v)=>ka(m,l,w,v);let f=!1;i==="post"?a.scheduler=m=>{Wa(m,l&&l.suspense)}:i!=="sync"&&(f=!0,a.scheduler=(m,w)=>{w?m():Na(m)}),a.augmentJob=m=>{t&&(m.flags|=4),f&&(m.flags|=2,l&&(m.id=l.uid,m.i=l))};const d=ww(e,t,a);return wi&&(u?u.push(d):c&&d()),d}function sS(e,t,n){const r=this.proxy,o=H.isString(e)?e.includes(".")?aS(r,e):()=>r[e]:e.bind(r,r);let i;H.isFunction(t)?i=t:(i=t.handler,n=t);const s=sp(this),a=Zd(o,i.bind(r),n);return s(),a}function aS(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 lS=e=>e.__isSuspense;function cS(e,t){t&&t.pendingBranch?H.isArray(e)?t.effects.push(...e):t.effects.push(e):Id(e)}const Qe=Symbol.for("v-fgt"),ep=Symbol.for("v-txt"),bi=Symbol.for("v-cmt"),ns=[];let An=null;function J(e=!1){ns.push(An=e?null:[])}function uS(){ns.pop(),An=ns[ns.length-1]||null}let Qi=1;function tp(e,t=!1){Qi+=e,e<0&&An&&t&&(An.hasOnce=!0)}function np(e){return e.dynamicChildren=Qi>0?An||H.EMPTY_ARR:null,uS(),Qi>0&&An&&An.push(e),e}function ve(e,t,n,r,o,i){return np(fe(e,t,n,r,o,i,!0))}function Ce(e,t,n,r,o){return np(be(e,t,n,r,o,!0))}function rs(e){return e?e.__v_isVNode===!0:!1}const fS=(...e)=>ip(...e),rp=({key:e})=>e??null,is=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?H.isString(e)||Lt(e)||H.isFunction(e)?{i:Jt,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&&rp(t),ref:t&&is(t),scopeId:xd,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:Jt};return a?(Ga(c,n),i&128&&e.normalize(c)):n&&(c.shapeFlag|=H.isString(n)?8:16),ye.env.NODE_ENV!=="production"&&c.key!==c.key&&et("VNode created with invalid key (NaN). VNode type:",c.type),Qi>0&&!s&&An&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&An.push(c),c}const be=ye.env.NODE_ENV!=="production"?fS:ip;function ip(e,t=null,n=null,r=0,o=null,i=!1){if((!e||e===Vd)&&(ye.env.NODE_ENV!=="production"&&!e&&et(`Invalid vnode type when creating vnode: ${e}.`),e=bi),rs(e)){const a=vi(e,t,!0);return n&&Ga(a,n),Qi>0&&!i&&An&&(a.shapeFlag&6?An[An.indexOf(e)]=a:An.push(a)),a.patchFlag=-2,a}if(up(e)&&(e=e.__vccOpts),t){t=Ha(t);let{class:a,style:c}=t;a&&!H.isString(a)&&(t.class=H.normalizeClass(a)),H.isObject(c)&&(Vo(c)&&!H.isArray(c)&&(c=H.extend({},c)),t.style=H.normalizeStyle(c))}const s=H.isString(e)?1:lS(e)?128:Mw(e)?64:H.isObject(e)?4:H.isFunction(e)?2:0;return ye.env.NODE_ENV!=="production"&&s&4&&Vo(e)&&(e=nt(e),et("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 Ha(e){return e?Vo(e)||Yd(e)?H.extend({},e):e:null}function vi(e,t,n=!1,r=!1){const{props:o,ref:i,patchFlag:s,children:a,transition:c}=e,u=t?Zt(o||{},t):o,l={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&rp(u),ref:t&&t.ref?n&&i?H.isArray(i)?i.concat(is(t)):[i,is(t)]:is(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:ye.env.NODE_ENV!=="production"&&s===-1&&H.isArray(a)?a.map(op):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&&vi(e.ssContent),ssFallback:e.ssFallback&&vi(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&jd(l,c.clone(l)),l}function op(e){const t=vi(e);return H.isArray(e.children)&&(t.children=e.children.map(op)),t}function Vt(e=" ",t=0){return be(ep,null,e,t)}function Oe(e="",t=!1){return t?(J(),Ce(bi,null,e)):be(bi,null,e)}function dS(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:vi(e)}function Ga(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(H.isArray(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),Ga(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Yd(t)?t._ctx=Jt:o===3&&Jt&&(Jt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else H.isFunction(t)?(t={default:t,_ctx:Jt},n=32):(t=String(t),r&64?(n=16,t=[Vt(t)]):n=8);e.children=t,e.shapeFlag|=n}function Zt(...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=H.normalizeClass([t.class,r.class]));else if(o==="style")t.style=H.normalizeStyle([t.style,r.style]);else if(H.isOn(o)){const i=t[o],s=r[o];s&&i!==s&&!(H.isArray(i)&&i.includes(s))&&(t[o]=i?[].concat(i,s):s)}else o!==""&&(t[o]=r[o])}return t}let Sn=null;const Ka=()=>Sn||Jt;let Qa;{const e=H.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)}};Qa=t("__VUE_INSTANCE_SETTERS__",n=>Sn=n),t("__VUE_SSR_SETTERS__",n=>wi=n)}const sp=e=>{const t=Sn;return Qa(e),e.scope.on(),()=>{e.scope.off(),Qa(t)}};function pS(e){return e.vnode.shapeFlag&4}let wi=!1;const ap=ye.env.NODE_ENV!=="production"?{get(e,t){return nn(e,"get",""),e[t]},set(){return et("setupContext.attrs is readonly."),!1},deleteProperty(){return et("setupContext.attrs is readonly."),!1}}:{get(e,t){return nn(e,"get",""),e[t]}};function hS(e){return new Proxy(e.slots,{get(t,n){return nn(e,"get","$slots"),t[n]}})}function gS(e){const t=n=>{if(ye.env.NODE_ENV!=="production"&&(e.exposed&&et("expose() should be called only once per setup()."),n!=null)){let r=typeof n;r==="object"&&(H.isArray(n)?r="array":Lt(n)&&(r="ref")),r!=="object"&&et(`expose() should be passed a plain object, received ${r}.`)}e.exposed=n||{}};if(ye.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=hS(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 lp(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(fw(aw(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in za)return za[n](e)},has(t,n){return n in t||n in za}})):e.proxy}const mS=/(?:^|[-_])(\w)/g,yS=e=>e.replace(mS,t=>t.toUpperCase()).replace(/[-_]/g,"");function Xa(e,t=!0){return H.isFunction(e)?e.displayName||e.name:e.name||t&&e.__name}function cp(e,t,n=!1){let r=Xa(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?yS(r):n?"App":"Anonymous"}function up(e){return H.isFunction(e)&&"__vccOpts"in e}const U=(e,t)=>{const n=bw(e,t,wi);if(ye.env.NODE_ENV!=="production"){const r=Ka();r&&r.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function fp(e,t,n){const r=arguments.length;return r===2?H.isObject(t)&&!H.isArray(t)?rs(t)?be(e,null,[t]):be(e,t):be(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&rs(n)&&(n=[n]),be(e,t,n))}function bS(){if(ye.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(f){return H.isObject(f)?f.__isVue?["div",e,"VueInstance"]:Lt(f)?["div",{},["span",e,l(f)],"<",a("_value"in f?f._value:f),">"]:Ur(f)?["div",{},["span",e,fn(f)?"ShallowReactive":"Reactive"],"<",a(f),`>${cr(f)?" (readonly)":""}`]:cr(f)?["div",{},["span",e,fn(f)?"ShallowReadonly":"Readonly"],"<",a(f),">"]:null:null},hasBody(f){return f&&f.__isVue},body(f){if(f&&f.__isVue)return["div",{},...i(f.$)]}};function i(f){const d=[];f.type.props&&f.props&&d.push(s("props",nt(f.props))),f.setupState!==H.EMPTY_OBJ&&d.push(s("setup",f.setupState)),f.data!==H.EMPTY_OBJ&&d.push(s("data",nt(f.data)));const m=c(f,"computed");m&&d.push(s("computed",m));const w=c(f,"inject");return w&&d.push(s("injected",w)),d.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:f}]]),d}function s(f,d){return d=H.extend({},d),Object.keys(d).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},f],["div",{style:"padding-left:1.25em"},...Object.keys(d).map(m=>["div",{},["span",r,m+": "],a(d[m],!1)])]]:["span",{}]}function a(f,d=!0){return typeof f=="number"?["span",t,f]:typeof f=="string"?["span",n,JSON.stringify(f)]:typeof f=="boolean"?["span",r,f]:H.isObject(f)?["object",{object:d?nt(f):f}]:["span",n,String(f)]}function c(f,d){const m=f.type;if(H.isFunction(m))return;const w={};for(const v in f.ctx)u(m,v,d)&&(w[v]=f.ctx[v]);return w}function u(f,d,m){const w=f[m];if(H.isArray(w)&&w.includes(d)||H.isObject(w)&&d in w||f.extends&&u(f.extends,d,m)||f.mixins&&f.mixins.some(v=>u(v,d,m)))return!0}function l(f){return fn(f)?"ShallowRef":f.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(o):window.devtoolsFormatters=[o]}const vS=ye.env.NODE_ENV!=="production"?et:H.NOOP;ye.env.NODE_ENV,ye.env.NODE_ENV;let wS;const dp=typeof window<"u"&&window.trustedTypes;if(dp)try{wS=dp.createPolicy("vue",{createHTML:e=>e})}catch(e){ye.env.NODE_ENV!=="production"&&vS(`Error creating trusted types policy: ${e}`)}const pp=Symbol("_vod"),SS=Symbol("_vsh"),Ya={beforeMount(e,{value:t},{transition:n}){e[pp]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Xi(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),Xi(e,!0),r.enter(e)):r.leave(e,()=>{Xi(e,!1)}):Xi(e,t))},beforeUnmount(e,{value:t}){Xi(e,t)}};ye.env.NODE_ENV!=="production"&&(Ya.name="show");function Xi(e,t){e.style.display=t?e[pp]:"none",e[SS]=!t}Symbol(ye.env.NODE_ENV!=="production"?"CSS_VAR_TEXT":"");function Yi(e,t,n,r){e.addEventListener(t,n,r)}const hp=e=>{const t=e.props["onUpdate:modelValue"]||!1;return H.isArray(t)?n=>H.invokeArrayFns(t,n):t};function ES(e){e.target.composing=!0}function gp(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ja=Symbol("_assign"),TS={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e[Ja]=hp(o);const i=r||o.props&&o.props.type==="number";Yi(e,t?"change":"input",s=>{if(s.target.composing)return;let a=e.value;n&&(a=a.trim()),i&&(a=H.looseToNumber(a)),e[Ja](a)}),n&&Yi(e,"change",()=>{e.value=e.value.trim()}),t||(Yi(e,"compositionstart",ES),Yi(e,"compositionend",gp),Yi(e,"change",gp))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:o,number:i}},s){if(e[Ja]=hp(s),e.composing)return;const a=(i||e.type==="number")&&!/^0\d/.test(e.value)?H.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))}},AS=["ctrl","shift","alt","meta"],RS={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)=>AS.some(n=>e[`${n}Key`]&&!t.includes(n))},Rn=(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=RS[t[s]];if(a&&a(o,t))return}return e(o,...i)})},_S={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ji=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=o=>{if(!("key"in o))return;const i=H.hyphenate(o.key);if(t.some(s=>s===i||_S[s]===i))return e(o)})};function IS(){bS()}ye.env.NODE_ENV!=="production"&&IS();const hn=()=>qt.useAbility(),os=()=>U(()=>!!document.getElementById("files-global-search-options"));function mp(e){if(e===void 0)throw new Error('cloneStateObject: cannot clone "undefined"');return JSON.parse(JSON.stringify(e))}const Zi=(e,t)=>!e||!t?!1:e.id===t.id;var Cr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Za(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var el,yp;function CS(){if(yp)return el;yp=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,f=0;f<=o.length;++f){if(f<o.length)l=o.charCodeAt(f);else{if(l===47)break;l=47}if(l===47){if(!(c===f-1||u===1))if(c!==f-1&&u===2){if(s.length<2||a!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var d=s.lastIndexOf("/");if(d!==s.length-1){d===-1?(s="",a=0):(s=s.slice(0,d),a=s.length-1-s.lastIndexOf("/")),c=f,u=0;continue}}else if(s.length===2||s.length===1){s="",a=0,c=f,u=0;continue}}i&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+o.slice(c+1,f):s=o.slice(c+1,f),a=f-c-1;c=f,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=ye.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 f=s.length,d=f-l,m=u<d?u:d,w=-1,v=0;v<=m;++v){if(v===m){if(d>m){if(s.charCodeAt(l+v)===47)return s.slice(l+v+1);if(v===0)return s.slice(l+v)}else u>m&&(i.charCodeAt(a+v)===47?w=v:v===0&&(w=0));break}var T=i.charCodeAt(a+v),b=s.charCodeAt(l+v);if(T!==b)break;T===47&&(w=v)}var g="";for(v=a+w+1;v<=c;++v)(v===c||i.charCodeAt(v)===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 f=s.length-1,d=-1;for(l=i.length-1;l>=0;--l){var m=i.charCodeAt(l);if(m===47){if(!u){a=l+1;break}}else d===-1&&(u=!1,d=l+1),f>=0&&(m===s.charCodeAt(f)?--f===-1&&(c=l):(f=-1,c=d))}return a===c?c=d: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,f=i.length-1;f>=0;--f){var d=i.charCodeAt(f);if(d===47){if(!u){a=f+1;break}continue}c===-1&&(u=!1,c=f+1),d===46?s===-1?s=f: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,f=0,d=-1,m=!0,w=i.length-1,v=0;w>=u;--w){if(a=i.charCodeAt(w),a===47){if(!m){f=w+1;break}continue}d===-1&&(m=!1,d=w+1),a===46?l===-1?l=w:v!==1&&(v=1):l!==-1&&(v=-1)}return l===-1||d===-1||v===0||v===1&&l===d-1&&l===f+1?d!==-1&&(f===0&&c?s.base=s.name=i.slice(1,d):s.base=s.name=i.slice(f,d)):(f===0&&c?(s.name=i.slice(1,l),s.base=i.slice(1,d)):(s.name=i.slice(f,l),s.base=i.slice(f,d)),s.ext=i.slice(l,d)),f>0?s.dir=i.slice(0,f-1):c&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return r.posix=r,el=r,el}var gt=CS();const ss=Za(gt),PS=Me({name:"SpaceMoveInfoModal",props:{modal:{type:Object,required:!0}}}),Ve=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},FS=["textContent"],OS=["textContent"];function xS(e,t,n,r,o,i){return J(),ve(Qe,null,[fe("p",{class:"oc-mt-rm",textContent:H.toDisplayString(e.$gettext("Moving files from one space to another is not possible. Do you want to copy instead?"))},null,8,FS),fe("p",{class:"oc-mb-rm",textContent:H.toDisplayString(e.$gettext("Note: Links and shares of the original file are not copied."))},null,8,OS)],64)}const bp=Ve(PS,[["render",xS]]),kS=Me({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}=bt(),{$gettext:n}=Ne.useGettext(),r=oe(!1),o=U(()=>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=U(()=>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=U(()=>e.confirmSecondaryTextOverwrite||n("Replace"));return{message:i,checkboxValue:r,checkboxLabel:o,confirmSecondaryText:s,onConfirm:()=>{t(e.modal.id),e.callbackFn({strategy:qn.KEEP_BOTH,doForAllConflicts:p(r)})},onConfirmSecondary:()=>{t(e.modal.id);const l=e.suggestMerge?qn.MERGE:qn.REPLACE;e.callbackFn({strategy:l,doForAllConflicts:p(r)})},onCancel:()=>{t(e.modal.id),e.callbackFn({strategy:qn.SKIP,doForAllConflicts:p(r)})}}}}),NS=["textContent"],$S={class:"oc-my-m"},DS={class:"oc-flex oc-flex-right oc-flex-middle oc-mt-m"},LS={class:"oc-modal-body-actions-grid"};function MS(e,t,n,r,o,i){const s=pe("oc-checkbox"),a=pe("oc-button");return J(),ve(Qe,null,[fe("span",{class:"oc-display-inline-block oc-mb-m",textContent:H.toDisplayString(e.message)},null,8,NS),fe("div",$S,[e.conflictCount>1?(J(),Ce(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"])):Oe("",!0)]),fe("div",DS,[fe("div",LS,[be(a,{class:"oc-modal-body-actions-cancel oc-ml-s",onClick:e.onCancel},{default:Te(()=>[Vt(H.toDisplayString(e.$gettext("Skip")),1)]),_:1},8,["onClick"]),be(a,{class:"oc-modal-body-actions-secondary oc-ml-s",onClick:e.onConfirmSecondary},{default:Te(()=>[Vt(H.toDisplayString(e.confirmSecondaryText),1)]),_:1},8,["onClick"]),be(a,{class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",onClick:e.onConfirm},{default:Te(()=>[Vt(H.toDisplayString(e.$gettext("Keep both")),1)]),_:1},8,["onClick"])])])],64)}const vp=Ve(kS,[["render",MS]]);class tl{constructor(t,n){this.$gettext=t,this.$ngettext=n}async resolveAllConflicts(t,n,r){const o=[];for(const u of t){const l=gt.join(n.path,u.name);r.some(d=>d.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,f=await this.resolveFileExists(u.resource,l);u.strategy=f.strategy,c.push(u),i+=1,f.doForAllConflicts&&(s=!0,a=f.strategy)}return c}resolveFileExists(t,n,r=!1,o=!1){const{dispatchModal:i}=bt();return new Promise(s=>{i({title:t.isFolder?this.$gettext("Folder already exists"):this.$gettext("File already exists"),hideActions:!0,customComponent:vp,customComponentAttrs:()=>({resource:t,conflictCount:n,suggestMerge:r,separateSkipHandling:o,callbackFn:a=>{s(a)}})})})}resolveDoCopyInsteadOfMoveForSpaces(){const{dispatchModal:t}=bt();return new Promise(n=>{t({title:this.$gettext("Copy here?"),customComponent:bp,confirmText:this.$gettext("Copy here"),onCancel:()=>{n(!1)},onConfirm:()=>Promise.resolve(n(!0))})})}}const Un=(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)?Un(e,t,n,r+1):o},wp=(e,t,n,r)=>e.id===n.id&&gt.dirname(t.path)===r.path;var qn=(e=>(e[e.SKIP=0]="SKIP",e[e.REPLACE=1]="REPLACE",e[e.KEEP_BOTH=2]="KEEP_BOTH",e[e.MERGE=3]="MERGE",e))(qn||{}),pr=(e=>(e[e.COPY=0]="COPY",e[e.MOVE=1]="MOVE",e))(pr||{});class Sp extends tl{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);rt().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===pr.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);rt().showMessage({title:l,status:"success"});return}let o=r===pr.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===pr.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")),rt().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===pr.MOVE){if(!await this.resolveDoCopyInsteadOfMoveForSpaces())return[];t=pr.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,f=r.some(w=>w.resource.id===c);let d=u,m=!1;if(f){const w=(i=r.find(v=>v.resource.id===c))==null?void 0:i.strategy;if(w===qn.SKIP)continue;if(w===qn.REPLACE){if(this.isOverwritingParentFolder(a,this.targetFolder,n)){const v=new Error;this.showResultMessage([{error:v,resourceName:u}],[],t);continue}m=!0}w===qn.KEEP_BOTH&&(d=Un(u,l,n),a.name=d)}wp(this.sourceSpace,a,this.targetSpace,this.targetFolder)&&m||o.push({resource:a,sourceSpace:this.sourceSpace,targetSpace:this.targetSpace,targetFolder:this.targetFolder,path:gt.join(this.targetFolder.path,d),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=gt.basename(t.path),i=gt.join(n.path,o);return r.some(a=>a.path===i)}}const nl={ignoreLocation:!0,threshold:0,useExtendedSearch:!0},BS=(e,t,n)=>new Yf(e,{...nl,keys:["name","type","icon","extension","tags"]}).search(t,{limit:n}).map(o=>o.item),Ep="oc-resource-icon-mapping",jS={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","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 Tp(){const e={};return Object.values(jS).forEach(t=>{t.extensions.forEach(n=>{e[n]=t.icon})}),e}function rl(e,t,n){return t.name=gt.basename(n),t.path=n,t.webDavPath=gt.join(e.webDavPath,n),t.extension=ee.extractExtensionFromFile(t),t}function US(){this.__data__=[],this.size=0}function eo(e,t){return e===t||e!==e&&t!==t}function as(e,t){for(var n=e.length;n--;)if(eo(e[n][0],t))return n;return-1}var qS=Array.prototype,VS=qS.splice;function zS(e){var t=this.__data__,n=as(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():VS.call(t,n,1),--this.size,!0}function WS(e){var t=this.__data__,n=as(t,e);return n<0?void 0:t[n][1]}function HS(e){return as(this.__data__,e)>-1}function GS(e,t){var n=this.__data__,r=as(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function hr(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])}}hr.prototype.clear=US,hr.prototype.delete=zS,hr.prototype.get=WS,hr.prototype.has=HS,hr.prototype.set=GS;function KS(){this.__data__=new hr,this.size=0}function QS(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function XS(e){return this.__data__.get(e)}function YS(e){return this.__data__.has(e)}const Pr=globalThis||void 0||self;var Ap=typeof Pr=="object"&&Pr&&Pr.Object===Object&&Pr,JS=typeof self=="object"&&self&&self.Object===Object&&self,Kn=Ap||JS||Function("return this")(),Fn=Kn.Symbol,Rp=Object.prototype,ZS=Rp.hasOwnProperty,eE=Rp.toString,to=Fn?Fn.toStringTag:void 0;function tE(e){var t=ZS.call(e,to),n=e[to];try{e[to]=void 0;var r=!0}catch{}var o=eE.call(e);return r&&(t?e[to]=n:delete e[to]),o}var nE=Object.prototype,rE=nE.toString;function iE(e){return rE.call(e)}var oE="[object Null]",sE="[object Undefined]",_p=Fn?Fn.toStringTag:void 0;function Hr(e){return e==null?e===void 0?sE:oE:_p&&_p in Object(e)?tE(e):iE(e)}function Qn(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var aE="[object AsyncFunction]",lE="[object Function]",cE="[object GeneratorFunction]",uE="[object Proxy]";function il(e){if(!Qn(e))return!1;var t=Hr(e);return t==lE||t==cE||t==aE||t==uE}var ol=Kn["__core-js_shared__"],Ip=function(){var e=/[^.]+$/.exec(ol&&ol.keys&&ol.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function fE(e){return!!Ip&&Ip in e}var dE=Function.prototype,pE=dE.toString;function Gr(e){if(e!=null){try{return pE.call(e)}catch{}try{return e+""}catch{}}return""}var hE=/[\\^$.*+?()[\]{}|]/g,gE=/^\[object .+?Constructor\]$/,mE=Function.prototype,yE=Object.prototype,bE=mE.toString,vE=yE.hasOwnProperty,wE=RegExp("^"+bE.call(vE).replace(hE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function SE(e){if(!Qn(e)||fE(e))return!1;var t=il(e)?wE:gE;return t.test(Gr(e))}function EE(e,t){return e==null?void 0:e[t]}function Kr(e,t){var n=EE(e,t);return SE(n)?n:void 0}var no=Kr(Kn,"Map"),ro=Kr(Object,"create");function TE(){this.__data__=ro?ro(null):{},this.size=0}function AE(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var RE="__lodash_hash_undefined__",_E=Object.prototype,IE=_E.hasOwnProperty;function CE(e){var t=this.__data__;if(ro){var n=t[e];return n===RE?void 0:n}return IE.call(t,e)?t[e]:void 0}var PE=Object.prototype,FE=PE.hasOwnProperty;function OE(e){var t=this.__data__;return ro?t[e]!==void 0:FE.call(t,e)}var xE="__lodash_hash_undefined__";function kE(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ro&&t===void 0?xE:t,this}function Qr(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])}}Qr.prototype.clear=TE,Qr.prototype.delete=AE,Qr.prototype.get=CE,Qr.prototype.has=OE,Qr.prototype.set=kE;function NE(){this.size=0,this.__data__={hash:new Qr,map:new(no||hr),string:new Qr}}function $E(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ls(e,t){var n=e.__data__;return $E(t)?n[typeof t=="string"?"string":"hash"]:n.map}function DE(e){var t=ls(this,e).delete(e);return this.size-=t?1:0,t}function LE(e){return ls(this,e).get(e)}function ME(e){return ls(this,e).has(e)}function BE(e,t){var n=ls(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function gr(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])}}gr.prototype.clear=NE,gr.prototype.delete=DE,gr.prototype.get=LE,gr.prototype.has=ME,gr.prototype.set=BE;var jE=200;function UE(e,t){var n=this.__data__;if(n instanceof hr){var r=n.__data__;if(!no||r.length<jE-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new gr(r)}return n.set(e,t),this.size=n.size,this}function Xn(e){var t=this.__data__=new hr(e);this.size=t.size}Xn.prototype.clear=KS,Xn.prototype.delete=QS,Xn.prototype.get=XS,Xn.prototype.has=YS,Xn.prototype.set=UE;var cs=function(){try{var e=Kr(Object,"defineProperty");return e({},"",{}),e}catch{}}();function sl(e,t,n){t=="__proto__"&&cs?cs(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function al(e,t,n){(n!==void 0&&!eo(e[t],n)||n===void 0&&!(t in e))&&sl(e,t,n)}function qE(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 VE=qE(),Cp=typeof L=="object"&&L&&!L.nodeType&&L,Pp=Cp&&typeof module=="object"&&module&&!module.nodeType&&module,zE=Pp&&Pp.exports===Cp,Fp=zE?Kn.Buffer:void 0,Op=Fp?Fp.allocUnsafe:void 0;function xp(e,t){if(t)return e.slice();var n=e.length,r=Op?Op(n):new e.constructor(n);return e.copy(r),r}var us=Kn.Uint8Array;function ll(e){var t=new e.constructor(e.byteLength);return new us(t).set(new us(e)),t}function kp(e,t){var n=t?ll(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function WE(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Np=Object.create,HE=function(){function e(){}return function(t){if(!Qn(t))return{};if(Np)return Np(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function $p(e,t){return function(n){return e(t(n))}}var cl=$p(Object.getPrototypeOf,Object),GE=Object.prototype;function fs(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||GE;return e===n}function KE(e){return typeof e.constructor=="function"&&!fs(e)?HE(cl(e)):{}}function Yn(e){return e!=null&&typeof e=="object"}var QE="[object Arguments]";function Dp(e){return Yn(e)&&Hr(e)==QE}var Lp=Object.prototype,XE=Lp.hasOwnProperty,YE=Lp.propertyIsEnumerable,io=Dp(function(){return arguments}())?Dp:function(e){return Yn(e)&&XE.call(e,"callee")&&!YE.call(e,"callee")},On=Array.isArray,JE=9007199254740991;function Mp(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=JE}function oo(e){return e!=null&&Mp(e.length)&&!il(e)}function ZE(e){return Yn(e)&&oo(e)}function e1(){return!1}var Bp=typeof L=="object"&&L&&!L.nodeType&&L,jp=Bp&&typeof module=="object"&&module&&!module.nodeType&&module,t1=jp&&jp.exports===Bp,Up=t1?Kn.Buffer:void 0,n1=Up?Up.isBuffer:void 0,Si=n1||e1,r1="[object Object]",i1=Function.prototype,o1=Object.prototype,qp=i1.toString,s1=o1.hasOwnProperty,a1=qp.call(Object);function ul(e){if(!Yn(e)||Hr(e)!=r1)return!1;var t=cl(e);if(t===null)return!0;var n=s1.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&qp.call(n)==a1}var l1="[object Arguments]",c1="[object Array]",u1="[object Boolean]",f1="[object Date]",d1="[object Error]",p1="[object Function]",h1="[object Map]",g1="[object Number]",m1="[object Object]",y1="[object RegExp]",b1="[object Set]",v1="[object String]",w1="[object WeakMap]",S1="[object ArrayBuffer]",E1="[object DataView]",T1="[object Float32Array]",A1="[object Float64Array]",R1="[object Int8Array]",_1="[object Int16Array]",I1="[object Int32Array]",C1="[object Uint8Array]",P1="[object Uint8ClampedArray]",F1="[object Uint16Array]",O1="[object Uint32Array]",wt={};wt[T1]=wt[A1]=wt[R1]=wt[_1]=wt[I1]=wt[C1]=wt[P1]=wt[F1]=wt[O1]=!0,wt[l1]=wt[c1]=wt[S1]=wt[u1]=wt[E1]=wt[f1]=wt[d1]=wt[p1]=wt[h1]=wt[g1]=wt[m1]=wt[y1]=wt[b1]=wt[v1]=wt[w1]=!1;function x1(e){return Yn(e)&&Mp(e.length)&&!!wt[Hr(e)]}function fl(e){return function(t){return e(t)}}var Vp=typeof L=="object"&&L&&!L.nodeType&&L,so=Vp&&typeof module=="object"&&module&&!module.nodeType&&module,k1=so&&so.exports===Vp,dl=k1&&Ap.process,Ei=function(){try{var e=so&&so.require&&so.require("util").types;return e||dl&&dl.binding&&dl.binding("util")}catch{}}(),zp=Ei&&Ei.isTypedArray,ds=zp?fl(zp):x1;function pl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var N1=Object.prototype,$1=N1.hasOwnProperty;function Wp(e,t,n){var r=e[t];(!($1.call(e,t)&&eo(r,n))||n===void 0&&!(t in e))&&sl(e,t,n)}function Hp(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?sl(n,a,c):Wp(n,a,c)}return n}function D1(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var L1=9007199254740991,M1=/^(?:0|[1-9]\d*)$/;function Gp(e,t){var n=typeof e;return t=t??L1,!!t&&(n=="number"||n!="symbol"&&M1.test(e))&&e>-1&&e%1==0&&e<t}var B1=Object.prototype,j1=B1.hasOwnProperty;function Kp(e,t){var n=On(e),r=!n&&io(e),o=!n&&!r&&Si(e),i=!n&&!r&&!o&&ds(e),s=n||r||o||i,a=s?D1(e.length,String):[],c=a.length;for(var u in e)(t||j1.call(e,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Gp(u,c)))&&a.push(u);return a}function U1(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var q1=Object.prototype,V1=q1.hasOwnProperty;function z1(e){if(!Qn(e))return U1(e);var t=fs(e),n=[];for(var r in e)r=="constructor"&&(t||!V1.call(e,r))||n.push(r);return n}function hl(e){return oo(e)?Kp(e,!0):z1(e)}function W1(e){return Hp(e,hl(e))}function H1(e,t,n,r,o,i,s){var a=pl(e,n),c=pl(t,n),u=s.get(c);if(u){al(e,n,u);return}var l=i?i(a,c,n+"",e,t,s):void 0,f=l===void 0;if(f){var d=On(c),m=!d&&Si(c),w=!d&&!m&&ds(c);l=c,d||m||w?On(a)?l=a:ZE(a)?l=WE(a):m?(f=!1,l=xp(c,!0)):w?(f=!1,l=kp(c,!0)):l=[]:ul(c)||io(c)?(l=a,io(a)?l=W1(a):(!Qn(a)||il(a))&&(l=KE(c))):f=!1}f&&(s.set(c,l),o(l,c,r,i,s),s.delete(c)),al(e,n,l)}function Qp(e,t,n,r,o){e!==t&&VE(t,function(i,s){if(o||(o=new Xn),Qn(i))H1(e,t,s,n,Qp,r,o);else{var a=r?r(pl(e,s),i,s+"",e,t,o):void 0;a===void 0&&(a=i),al(e,s,a)}},hl)}function Xp(e){return e}function G1(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 Yp=Math.max;function Jp(e,t,n){return t=Yp(t===void 0?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=Yp(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),G1(e,this,a)}}function K1(e){return function(){return e}}var Q1=cs?function(e,t){return cs(e,"toString",{configurable:!0,enumerable:!1,value:K1(t),writable:!0})}:Xp,X1=800,Y1=16,J1=Date.now;function Z1(e){var t=0,n=0;return function(){var r=J1(),o=Y1-(r-n);if(n=r,o>0){if(++t>=X1)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Zp=Z1(Q1);function eT(e,t){return Zp(Jp(e,t,Xp),e+"")}function tT(e,t,n){if(!Qn(n))return!1;var r=typeof t;return(r=="number"?oo(n)&&Gp(t,n.length):r=="string"&&t in n)?eo(n[t],e):!1}function nT(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 ao=nT(function(e,t,n){Qp(e,t,n)});const gl=(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)},lo=(...e)=>(t,...n)=>{if(!n.length)return gl(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 gl(t,r,...o)};function I2(e){return e}const co=(e,...t)=>ao({},{name:e},...t.map(n=>({...n.params&&{params:n.params},...n.query&&{query:n.query}}))),Ti=(e,t={})=>co(e,t),eh=Ti("files-common-favorites"),th=Ti("files-common-search"),At=lo(eh,th),rT=e=>[{path:"/search",component:e.App,children:[{name:th.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:eh.name,path:"",component:e.Favorites,meta:{authContext:"user",title:"Favorite files"}}]}],xn=(e,t={})=>co(e,t),nh=xn("files-spaces-projects"),ml=xn("files-spaces-generic"),at=lo(nh,ml),iT=e=>[{path:"/spaces",component:e.App,children:[{path:"projects",name:nh.name,component:e.Spaces.Projects,meta:{authContext:"user",title:"Spaces"}},{path:":driveAliasAndItem(.*)?",name:ml.name,component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0,contextQueryItems:["sort-by","sort-dir"]}}]}],kn=(e,t={})=>co(e,t),oT=kn("files-shares"),ps=kn("files-shares-with-me"),yl=kn("files-shares-with-others"),bl=kn("files-shares-via-link"),Nt=lo(ps,yl,bl),sT=e=>[{name:oT.name,path:"/shares",component:e.App,redirect:ps,children:[{name:ps.name,path:"with-me",component:e.Shares.SharedWithMe,meta:{authContext:"user",title:"Files shared with me"}},{name:yl.name,path:"with-others",component:e.Shares.SharedWithOthers,meta:{authContext:"user",title:"Files shared with others"}},{name:bl.name,path:"via-link",component:e.Shares.SharedViaLink,meta:{authContext:"user",title:"Files shared via link"}}]}],Ai=(e,t={})=>co(e,t),vl=Ai("files-public-link"),wl=Ai("files-public-upload"),_n=lo(vl,wl),aT=e=>[{path:"/link",component:e.App,meta:{auth:!1},children:[{name:vl.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"publicLink",patchCleanPath:!0}}]},{path:"/upload",component:e.App,meta:{auth:!1},children:[{name:wl.name,path:":token?",component:e.FilesDrop,meta:{authContext:"publicLink",title:"Public file upload"}}]}],Ri=(e,t={})=>co(e,t),rh=Ri("files-trash-generic"),ih=Ri("files-trash-overview"),In=lo(rh,ih),lT=e=>[{path:"/trash",component:e.App,children:[{path:"overview",name:ih.name,component:e.Trash.Overview,meta:{authContext:"user",title:"Trash overview"}},{name:rh.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0}}]}];function oh(e){return{applicationConfig:U(()=>e.appsStore.externalAppConfig[e.applicationId]||{})}}const cT=["anonymous","user","idp","publicLink","hybrid"],mr=e=>dr(e),ze=()=>mr("$router"),en=()=>ze().currentRoute,Sl=e=>e.path.split("/")[1],uT=()=>{const e=en();return U(()=>Sl(p(e)))},Jn=(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)&&!Et.isUndefined(t.fileId)&&{fileId:`${t.fileId}`}}}},fT=(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},Zn=He.defineStore("apps",()=>{const e=oe({}),t=oe({}),n=oe([]),r=U(()=>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,f,d;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||((d=(f=(l=p(t))==null?void 0:l[c])==null?void 0:f.priorityExtensions)==null?void 0:d.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)}}),Xr=He.defineStore("auth",()=>{const e=oe(),t=oe(!1),n=oe(!1),r=oe(),o=oe(),i=oe(),s=oe(!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})}}}),sh={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}},rn=He.defineStore("capabilities",()=>{const e=oe(!1),t=oe(sh),n=_=>{t.value=ao({...sh},_.capabilities),e.value=!0},r=U(()=>p(t).core["support-url-signing"]),o=U(()=>p(t).core["support-sse"]),i=U(()=>p(t).graph["personal-data-export"]),s=U(()=>p(t).core.status),a=U(()=>p(t).dav.reports),c=U(()=>p(t).dav.trashbin),u=U(()=>p(t).spaces.max_quota),l=U(()=>p(t).spaces.projects),f=U(()=>p(t).graph.users.create_disabled),d=U(()=>p(t).graph.users.delete_disabled),m=U(()=>p(t).graph.users.change_password_self_disabled),w=U(()=>p(t).graph.users.read_only_attributes),v=U(()=>p(t).files.app_providers),T=U(()=>p(t).files.favorites),b=U(()=>p(t).files.thumbnail),g=U(()=>p(t).files.archivers),h=U(()=>p(t).files.privateLinks),y=U(()=>p(t).files.permanent_deletion),S=U(()=>p(t).files.tags),E=U(()=>p(t).files.undelete),R=U(()=>p(t).files_sharing.api_enabled),I=U(()=>p(t).files_sharing.deny_access),A=U(()=>p(t).files_sharing.can_rename),$=U(()=>p(t).files_sharing.allow_custom),D=U(()=>{var _;return(_=p(t).files_sharing.public)==null?void 0:_.enabled}),k=U(()=>{var _;return(_=p(t).files_sharing.public)==null?void 0:_.can_edit}),N=U(()=>{var _;return(_=p(t).files_sharing.public)==null?void 0:_.can_contribute}),j=U(()=>{var _;return(_=p(t).files_sharing.public)==null?void 0:_.alias}),W=U(()=>{var _;return(_=p(t).files_sharing.public)==null?void 0:_.default_permissions}),X=U(()=>{var _;return(_=p(t).files_sharing.public)==null?void 0:_.password.enforced_for}),ie=U(()=>p(t).files_sharing.search_min_length),de=U(()=>{var _;return(_=p(t).files_sharing.user)==null?void 0:_.profile_picture}),se=U(()=>{var _;return(_=p(t).files.tus_support)==null?void 0:_.max_chunk_size}),we=U(()=>{var _;return(_=p(t).files.tus_support)==null?void 0:_.extension}),Se=U(()=>{var _;return(_=p(t).files.tus_support)==null?void 0:_.http_method_override}),Z=U(()=>p(t).notifications["ocs-endpoints"]),ne=U(()=>p(t).password_policy),le=U(()=>{var _;return(_=p(t).search.property)==null?void 0:_.mtime}),Ie=U(()=>{var _;return(_=p(t).search.property)==null?void 0:_.mediatype}),Y=U(()=>{var _;return(_=p(t).search.property)==null?void 0:_.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:f,graphUsersDeleteDisabled:d,graphUsersChangeSelfPasswordDisabled:m,graphUsersReadOnlyAttributes:w,filesAppProviders:v,filesFavorites:T,filesThumbnail:b,filesArchivers:g,filesPrivateLinks:h,filesPermanentDeletion:y,filesTags:S,filesUndelete:E,sharingApiEnabled:R,sharingDenyAccess:I,sharingCanRename:A,sharingAllowCustom:$,sharingPublicEnabled:D,sharingPublicCanEdit:k,sharingPublicCanContribute:N,sharingPublicAlias:j,sharingPublicDefaultPermissions:W,sharingPublicPasswordEnforcedFor:X,sharingSearchMinLength:ie,sharingUserProfilePicture:de,tusMaxChunkSize:se,tusExtension:we,tusHttpMethodOverride:Se,notificationsOcsEndpoints:Z,passwordPolicy:ne,searchLastMofifiedDate:le,searchMediaType:Ie,searchContent:Y}});class dT{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 El{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 dT(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 hs=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)},pT=({sharedAncestor:e,matchingSpace:t})=>t?xn("files-spaces-generic",Jn(t,{path:e.path,fileId:e.id})):{},hT=e=>{var n;const t=(n=document.querySelectorAll(`[data-item-id="${e}"] input[type=checkbox]`))==null?void 0:n[0];t&&t.focus()};class Yr{}Ee(Yr,"sortByQueryName","sort-by"),Ee(Yr,"sortDirQueryName","sort-dir");var gT="[object Symbol]";function gs(e){return typeof e=="symbol"||Yn(e)&&Hr(e)==gT}var mT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yT=/^\w*$/;function bT(e,t){if(On(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||gs(e)?!0:yT.test(e)||!mT.test(e)||t!=null&&e in Object(t)}var vT="Expected a function";function Tl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(vT);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(Tl.Cache||gr),n}Tl.Cache=gr;var wT=500;function ST(e){var t=Tl(e,function(r){return n.size===wT&&n.clear(),r}),n=t.cache;return t}var ET=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,TT=/\\(\\)?/g,AT=ST(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(ET,function(n,r,o,i){t.push(o?i.replace(TT,"$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 lh=Fn?Fn.prototype:void 0,ch=lh?lh.toString:void 0;function uh(e){if(typeof e=="string")return e;if(On(e))return ah(e,uh)+"";if(gs(e))return ch?ch.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Al(e){return e==null?"":uh(e)}function Rl(e,t){return On(e)?e:bT(e,t)?[e]:AT(Al(e))}function fh(e){if(typeof e=="string"||gs(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function dh(e,t){t=Rl(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[fh(t[n++])];return n&&n==r?e:void 0}function _l(e,t,n){var r=e==null?void 0:dh(e,t);return r===void 0?n:r}var Bt=(e=>(e.Desc="desc",e.Asc="asc",e))(Bt||{});function RT(e){const t=ze(),n=_T(e),r=IT(e),o=U(()=>{var u;return hh(p(n))||p((u=Il(p(s)))==null?void 0:u.name)}),i=U(()=>PT(p(r))||CT(p(o),p(s))),s=e.fields;return{items:U(()=>{const u=p(e.items);return p(o)?ph(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)||Yr.sortByQueryName]:u,[p(e.sortDirQueryName)||Yr.sortDirQueryName]:l}})}}function _T(e){var t;return e.sortBy?Lt(e.sortBy)?e.sortBy:oe(e.sortBy):wr({name:p(e.sortByQueryName)||Yr.sortByQueryName,defaultValue:p((t=Il(p(e.fields)))==null?void 0:t.name),storagePrefix:p(e.routeName)||p(Ws())})}function IT(e){var t;return e.sortDir?Lt(e.sortDir)?e.sortDir:oe(e.sortDir):wr({name:p(e.sortDirQueryName)||Yr.sortDirQueryName,defaultValue:p((t=Il(p(e.fields)))==null?void 0:t.sortDir),storagePrefix:p(e.routeName)||p(Ws())})}const Il=e=>{const t=e.filter(n=>n.sortable);return t?t[0]:null},CT=(e,t)=>{const n=t.find(r=>r.name===e);return n&&n.sortDir?p(n.sortDir):"desc"},ph=(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)=>Cl(u,l,s,n,r,i)),c=[...e.filter(u=>u.type!=="folder")].sort((u,l)=>Cl(u,l,s,n,r,i));return r==="asc"?a.concat(c):c.concat(a)}return[...e].sort((a,c)=>Cl(a,c,s,o.prop||o.name,r,i))},Cl=(e,t,n,r,o,i)=>{let s=_l(e,r),a=_l(t,r);const c=o==="asc"?1:-1;if(i)if(typeof i=="string"){const l=f=>f.map(d=>d[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},hh=e=>Array.isArray(e)?e[0]:e,PT=e=>{switch(hh(e)){case"asc":return"asc";case"desc":return"desc"}return null},gh=e=>e?[{name:"name",sortable:!0,sortDir:Bt.Asc},{name:"size",sortable:!0,sortDir:Bt.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:Bt.Asc},{name:"owner",sortable:"displayName",sortDir:Bt.Asc},{name:"mdate",sortable:t=>new Date(t).valueOf(),sortDir:Bt.Desc},{name:"sdate",sortable:t=>new Date(t).valueOf(),sortDir:Bt.Desc},{name:"ddate",sortable:t=>new Date(t).valueOf(),sortDir:Bt.Desc}].filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[];function C2(e){return e}const mh=[{label:"A-Z",name:"name",sortable:!0,sortDir:Bt.Asc},{label:"Z-A",name:"name",sortable:!0,sortDir:Bt.Desc},{label:"Newest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Bt.Desc},{label:"Oldest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Bt.Asc},{label:"Largest",name:"size",sortable:!0,sortDir:Bt.Desc},{label:"Smallest",name:"size",sortable:!0,sortDir:Bt.Asc},{label:"Remaining quota",name:"remainingQuota",prop:"spaceQuota.remaining",sortable:!0,sortDir:Bt.Desc},{label:"Total quota",name:"totalQuota",prop:"spaceQuota.total",sortable:!0,sortDir:Bt.Desc},{label:"Used quota",name:"usedQuota",prop:"spaceQuota.used",sortable:!0,sortDir:Bt.Desc}],FT=e=>e?mh.filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[],OT=(e,{$gettext:t})=>e.map(n=>({...n,label:t(n.label)})),xT=me.z.object({icon:me.z.string(),name:me.z.string(),secure_view:me.z.boolean().optional().default(!1),target_ext:me.z.string().optional()}),kT=me.z.object({allow_creation:me.z.boolean().optional(),app_providers:me.z.array(xT),default_application:me.z.string().optional(),description:me.z.string().optional(),ext:me.z.string().optional(),mime_type:me.z.string(),name:me.z.string().optional()}),yh=me.z.object({"mime-types":me.z.array(kT)});class NT{constructor(t,n){Ee(this,"_mimeTypes",oe([]));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:yh});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 bh={},ms={};ms.byteLength=LT,ms.toByteArray=BT,ms.fromByteArray=qT;for(var er=[],Nn=[],$T=typeof Uint8Array<"u"?Uint8Array:Array,Pl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_i=0,DT=Pl.length;_i<DT;++_i)er[_i]=Pl[_i],Nn[Pl.charCodeAt(_i)]=_i;Nn[45]=62,Nn[95]=63;function vh(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 LT(e){var t=vh(e),n=t[0],r=t[1];return(n+r)*3/4-r}function MT(e,t,n){return(t+n)*3/4-n}function BT(e){var t,n=vh(e),r=n[0],o=n[1],i=new $T(MT(e,r,o)),s=0,a=o>0?r-4:r,c;for(c=0;c<a;c+=4)t=Nn[e.charCodeAt(c)]<<18|Nn[e.charCodeAt(c+1)]<<12|Nn[e.charCodeAt(c+2)]<<6|Nn[e.charCodeAt(c+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=t&255;return o===2&&(t=Nn[e.charCodeAt(c)]<<2|Nn[e.charCodeAt(c+1)]>>4,i[s++]=t&255),o===1&&(t=Nn[e.charCodeAt(c)]<<10|Nn[e.charCodeAt(c+1)]<<4|Nn[e.charCodeAt(c+2)]>>2,i[s++]=t>>8&255,i[s++]=t&255),i}function jT(e){return er[e>>18&63]+er[e>>12&63]+er[e>>6&63]+er[e&63]}function UT(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(jT(r));return o.join("")}function qT(e){for(var t,n=e.length,r=n%3,o=[],i=16383,s=0,a=n-r;s<a;s+=i)o.push(UT(e,s,s+i>a?a:s+i));return r===1?(t=e[n-1],o.push(er[t>>2]+er[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(er[t>>10]+er[t>>4&63]+er[t<<2&63]+"=")),o.join("")}var Fl={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Fl.read=function(e,t,n,r,o){var i,s,a=o*8-r-1,c=(1<<a)-1,u=c>>1,l=-7,f=n?o-1:0,d=n?-1:1,m=e[t+f];for(f+=d,i=m&(1<<-l)-1,m>>=-l,l+=a;l>0;i=i*256+e[t+f],f+=d,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=r;l>0;s=s*256+e[t+f],f+=d,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)},Fl.write=function(e,t,n,r,o,i){var s,a,c,u=i*8-o-1,l=(1<<u)-1,f=l>>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:i-1,w=r?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=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+f>=1?t+=d/c:t+=d*Math.pow(2,1-f),t*c>=2&&(s++,c/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*c-1)*Math.pow(2,o),s=s+f):(a=t*Math.pow(2,f-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]|=v*128};/*!
3
+ `,...Rw(o)),console.warn(...i)}Ui(),Oa=!1}function Aw(){let e=Vr[Vr.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 Rw(e){const t=[];return e.forEach((n,r)=>{t.push(...r===0?[]:[`
4
+ `],..._w(n))}),t}function _w({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",r=e.component?e.component.parent==null:!1,o=` at <${cp(e.component,e.type,r)}`,i=">"+n;return e.props?[o,...Iw(e.props),i]:[o+i]}function Iw(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(r=>{t.push(...Ad(r,e[r]))}),n.length>3&&t.push(" ..."),t}function Ad(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}`]:Lt(t)?(t=Ad(e,nt(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):W.isFunction(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=nt(t),n?t:[`${e}=`,t])}const xa={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Ho(e,t,n,r){try{return r?e(...r):e()}catch(o){Go(o,t,n)}}function ka(e,t,n,r){if(W.isFunction(e)){const o=Ho(e,t,n,r);return o&&W.isPromise(o)&&o.catch(i=>{Go(i,t,n)}),o}if(W.isArray(e)){const o=[];for(let i=0;i<e.length;i++)o.push(ka(e[i],t,n,r));return o}else be.env.NODE_ENV!=="production"&&et(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function Go(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=be.env.NODE_ENV!=="production"?xa[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const l=a.ec;if(l){for(let f=0;f<l.length;f++)if(l[f](e,c,u)===!1)return}a=a.parent}if(i){ji(),Ho(i,null,10,[e,c,u]),Ui();return}}Cw(e,n,o,r,s)}function Cw(e,t,n,r=!0,o=!1){if(be.env.NODE_ENV!=="production"){const i=xa[t];if(n&&Ew(n),et(`Unhandled error${i?` during execution of ${i}`:""}`),n&&Tw(),r)throw e;console.error(e)}else{if(o)throw e;console.error(e)}}const Fn=[];let fr=-1;const gi=[];let _r=null,mi=0;const Rd=Promise.resolve();let Ko=null;const Fw=100;function Gn(e){const t=Ko||Rd;return e?t.then(this?e.bind(this):e):t}function Pw(e){let t=fr+1,n=Fn.length;for(;t<n;){const r=t+n>>>1,o=Fn[r],i=Wi(o);i<e||i===e&&o.flags&2?t=r+1:n=r}return t}function Na(e){if(!(e.flags&1)){const t=Wi(e),n=Fn[Fn.length-1];!n||!(e.flags&2)&&t>=Wi(n)?Fn.push(e):Fn.splice(Pw(t),0,e),e.flags|=1,_d()}}function _d(){Ko||(Ko=Rd.then(Cd))}function Id(e){W.isArray(e)?gi.push(...e):_r&&e.id===-1?_r.splice(mi+1,0,e):e.flags&1||(gi.push(e),e.flags|=1),_d()}function Ow(e){if(gi.length){const t=[...new Set(gi)].sort((n,r)=>Wi(n)-Wi(r));if(gi.length=0,_r){_r.push(...t);return}for(_r=t,be.env.NODE_ENV!=="production"&&(e=e||new Map),mi=0;mi<_r.length;mi++){const n=_r[mi];be.env.NODE_ENV!=="production"&&Fd(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}_r=null,mi=0}}const Wi=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Cd(e){be.env.NODE_ENV!=="production"&&(e=e||new Map);const t=be.env.NODE_ENV!=="production"?n=>Fd(e,n):W.NOOP;try{for(fr=0;fr<Fn.length;fr++){const n=Fn[fr];if(n&&!(n.flags&8)){if(be.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),Ho(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;fr<Fn.length;fr++){const n=Fn[fr];n&&(n.flags&=-2)}fr=-1,Fn.length=0,Ow(e),Ko=null,(Fn.length||gi.length)&&Cd(e)}}function Fd(e,t){const n=e.get(t)||0;if(n>Fw){const r=t.i,o=r&&Xa(r.type);return Go(`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 Hi=!1;const $a=new Map;be.env.NODE_ENV!=="production"&&(W.getGlobalThis().__VUE_HMR_RUNTIME__={createRecord:Da(xw),rerender:Da(kw),reload:Da(Nw)});const Qo=new Map;function xw(e,t){return Qo.has(e)?!1:(Qo.set(e,{initialDef:Xo(t),instances:new Set}),!0)}function Xo(e){return up(e)?e.__vccOpts:e}function kw(e,t){const n=Qo.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(r=>{t&&(r.render=t,Xo(r.type).render=t),r.renderCache=[],Hi=!0,r.update(),Hi=!1}))}function Nw(e,t){const n=Qo.get(e);if(!n)return;t=Xo(t),Pd(n.initialDef,t);const r=[...n.instances];for(let o=0;o<r.length;o++){const i=r[o],s=Xo(i.type);let a=$a.get(s);a||(s!==n.initialDef&&Pd(s,t),$a.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?Na(()=>{Hi=!0,i.parent.update(),Hi=!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)}Id(()=>{$a.clear()})}function Pd(e,t){W.extend(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function Da(e){return(t,n)=>{try{return e(t,n)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let Ir,Gi=[],La=!1;function $w(e,...t){Ir?Ir.emit(e,...t):La||Gi.push({event:e,args:t})}function Od(e,t){var n,r;Ir=e,Ir?(Ir.enabled=!0,Gi.forEach(({event:o,args:i})=>Ir.emit(o,...i)),Gi=[]):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=>{Od(i,t)}),setTimeout(()=>{Ir||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,La=!0,Gi=[])},3e3)):(La=!0,Gi=[])}const Dw=Lw("component:updated");/*! #__NO_SIDE_EFFECTS__ */function Lw(e){return t=>{$w(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let Jt=null,xd=null;function kd(e){const t=Jt;return Jt=e,xd=e&&e.type.__scopeId||null,t}function Te(e,t=Jt,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&tp(-1);const i=kd(t);let s;try{s=e(...o)}finally{kd(i),r._d&&tp(1)}return be.env.NODE_ENV!=="production"&&Dw(t),s};return r._n=!0,r._c=!0,r._d=!0,r}function ot(e,t){if(Jt===null)return be.env.NODE_ENV!=="production"&&et("withDirectives can only be used inside render functions."),e;const n=lp(Jt),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&&ur(s),r.push({dir:i,instance:n,value:s,oldValue:void 0,arg:a,modifiers:c}))}return e}const Mw=Symbol("_vte"),Bw=e=>e.__isTeleport,zr=e=>e&&(e.disabled||e.disabled===""),Nd=e=>e&&(e.defer||e.defer===""),$d=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Dd=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ma=(e,t)=>{const n=e&&e.to;if(W.isString(n))if(t){const r=t(n);return be.env.NODE_ENV!=="production"&&!r&&!zr(e)&&et(`Failed to locate Teleport target with selector "${n}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`),r}else return be.env.NODE_ENV!=="production"&&et("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"),null;else return be.env.NODE_ENV!=="production"&&!n&&!zr(e)&&et(`Invalid Teleport target: ${n}`),n},Ld={name:"Teleport",__isTeleport:!0,process(e,t,n,r,o,i,s,a,c,u){const{mc:l,pc:f,pbc:d,o:{insert:m,querySelector:w,createText:b,createComment:T}}=u,v=zr(t.props);let{shapeFlag:g,children:h,dynamicChildren:y}=t;if(be.env.NODE_ENV!=="production"&&Hi&&(c=!1,y=null),e==null){const S=t.el=be.env.NODE_ENV!=="production"?T("teleport start"):b(""),E=t.anchor=be.env.NODE_ENV!=="production"?T("teleport end"):b("");m(S,n,r),m(E,n,r);const R=(A,$)=>{g&16&&(o&&o.isCE&&(o.ce._teleportTarget=A),l(h,A,$,o,i,s,a,c))},I=()=>{const A=t.target=Ma(t.props,w),$=Bd(A,t,b,m);A?(s!=="svg"&&$d(A)?s="svg":s!=="mathml"&&Dd(A)&&(s="mathml"),v||(R(A,$),Jo(t,!1))):be.env.NODE_ENV!=="production"&&!v&&et("Invalid Teleport target on mount:",A,`(${typeof A})`)};v&&(R(n,E),Jo(t,!0)),Nd(t.props)?Wa(()=>{I(),t.el.__isMounted=!0},i):I()}else{if(Nd(t.props)&&!e.el.__isMounted){Wa(()=>{Ld.process(e,t,n,r,o,i,s,a,c,u),delete e.el.__isMounted},i);return}t.el=e.el,t.targetStart=e.targetStart;const S=t.anchor=e.anchor,E=t.target=e.target,R=t.targetAnchor=e.targetAnchor,I=zr(e.props),A=I?n:E,$=I?S:R;if(s==="svg"||$d(E)?s="svg":(s==="mathml"||Dd(E))&&(s="mathml"),y?(d(e.dynamicChildren,y,A,o,i,s,a),Jd(e,t,!0)):c||f(e,t,A,$,o,i,s,a,!1),v)I?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Yo(t,n,S,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const D=t.target=Ma(t.props,w);D?Yo(t,D,null,u,0):be.env.NODE_ENV!=="production"&&et("Invalid Teleport target on update:",E,`(${typeof E})`)}else I&&Yo(t,E,R,u,1);Jo(t,v)}},remove(e,t,n,{um:r,o:{remove:o}},i){const{shapeFlag:s,children:a,anchor:c,targetStart:u,targetAnchor:l,target:f,props:d}=e;if(f&&(o(u),o(l)),i&&o(c),s&16){const m=i||!zr(d);for(let w=0;w<a.length;w++){const b=a[w];r(b,t,n,m,!!b.dynamicChildren)}}},move:Yo,hydrate:jw};function Yo(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,f=i===2;if(f&&r(s,t,n),(!f||zr(l))&&c&16)for(let d=0;d<u.length;d++)o(u[d],t,n,2);f&&r(a,t,n)}function jw(e,t,n,r,o,i,{o:{nextSibling:s,parentNode:a,querySelector:c,insert:u,createText:l}},f){const d=t.target=Ma(t.props,c);if(d){const m=zr(t.props),w=d._lpa||d.firstChild;if(t.shapeFlag&16)if(m)t.anchor=f(s(e),t,a(e),n,r,o,i),t.targetStart=w,t.targetAnchor=w&&s(w);else{t.anchor=s(e);let b=w;for(;b;){if(b&&b.nodeType===8){if(b.data==="teleport start anchor")t.targetStart=b;else if(b.data==="teleport anchor"){t.targetAnchor=b,d._lpa=t.targetAnchor&&s(t.targetAnchor);break}}b=s(b)}t.targetAnchor||Bd(d,t,l,u),f(w&&s(w),t,d,n,r,o,i)}Jo(t,m)}return t.anchor&&s(t.anchor)}const Md=Ld;function Jo(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 Bd(e,t,n,r){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Mw]=i,e&&(r(o,e),r(i,e)),i}function jd(e,t){e.shapeFlag&6&&e.component?(e.transition=t,jd(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 Me(e,t){return W.isFunction(e)?W.extend({name:e.name},t,{setup:e}):e}function Uw(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const qw=new WeakSet;function Ud(e){const t=Ka(),n=cw(null);if(t){const o=t.refs===W.EMPTY_OBJ?t.refs={}:t.refs;let i;be.env.NODE_ENV!=="production"&&(i=Object.getOwnPropertyDescriptor(o,e))&&!i.configurable?et(`useTemplateRef('${e}') already exists.`):Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:s=>n.value=s})}else be.env.NODE_ENV!=="production"&&et("useTemplateRef() is called when there is no active component instance to be associated with.");const r=be.env.NODE_ENV!=="production"?lr(n):n;return be.env.NODE_ENV!=="production"&&qw.add(r),r}const qd=e=>e.nodeType===8;W.getGlobalThis().requestIdleCallback,W.getGlobalThis().cancelIdleCallback;function Vw(e,t){if(qd(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(qd(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const zw=e=>!!e.type.__asyncLoader;/*! #__NO_SIDE_EFFECTS__ */function Ww(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,f=0;const d=()=>(f++,u=null,m()),m=()=>{let w;return u||(w=u=t().catch(b=>{if(b=b instanceof Error?b:new Error(String(b)),c)return new Promise((T,v)=>{c(b,()=>T(d()),()=>v(b),f+1)});throw b}).then(b=>{if(w!==u&&u)return u;if(be.env.NODE_ENV!=="production"&&!b&&et("Async component loader resolved to undefined. If you are using retry(), make sure to return its return value."),b&&(b.__esModule||b[Symbol.toStringTag]==="Module")&&(b=b.default),be.env.NODE_ENV!=="production"&&b&&!W.isObject(b)&&!W.isFunction(b))throw new Error(`Invalid async component load result: ${b}`);return l=b,b}))};return Me({name:"AsyncComponentWrapper",__asyncLoader:m,__asyncHydrate(w,b,T){const v=i?()=>{const g=i(T,h=>Vw(w,h));g&&(b.bum||(b.bum=[])).push(g)}:T;l?v():m().then(()=>!b.isUnmounted&&v())},get __asyncResolved(){return l},setup(){const w=Sn;if(Uw(w),l)return()=>Ba(l,w);const b=h=>{u=null,Go(h,w,13,!r)};if(a&&w.suspense||wi)return m().then(h=>()=>Ba(h,w)).catch(h=>(b(h),()=>r?ve(r,{error:h}):null));const T=ae(!1),v=ae(),g=ae(!!o);return o&&setTimeout(()=>{g.value=!1},o),s!=null&&setTimeout(()=>{if(!T.value&&!v.value){const h=new Error(`Async component timed out after ${s}ms.`);b(h),v.value=h}},s),m().then(()=>{T.value=!0,w.parent&&Hw(w.parent.vnode)&&w.parent.update()}).catch(h=>{b(h),v.value=h}),()=>{if(T.value&&l)return Ba(l,w);if(v.value&&r)return ve(r,{error:v.value});if(n&&!g.value)return ve(n)}}})}function Ba(e,t){const{ref:n,props:r,children:o,ce:i}=t.vnode,s=ve(e,r,o);return s.ref=n,s.ce=i,delete t.vnode.ce,s}const Hw=e=>e.type.__isKeepAlive;function Gw(e,t,n=Sn,r=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...s)=>{ji();const a=sp(n),c=ka(t,n,e,s);return a(),Ui(),c});return r?o.unshift(i):o.push(i),i}else if(be.env.NODE_ENV!=="production"){const o=W.toHandlerKey(xa[e].replace(/ hook$/,""));et(`${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 Zo=e=>(t,n=Sn)=>{(!wi||e==="sp")&&Gw(e,(...r)=>t(...r),n)},Mt=Zo("m"),Kw=Zo("bu"),jn=Zo("bum"),ja=Zo("um"),es="components",Qw="directives";function he(e,t){return Ua(es,e,!0,t)||e}const Vd=Symbol.for("v-ndc");function Wr(e){return W.isString(e)?Ua(es,e,!1)||e:e||Vd}function dn(e){return Ua(Qw,e)}function Ua(e,t,n=!0,r=!1){const o=Jt||Sn;if(o){const i=o.type;if(e===es){const a=Xa(i,!1);if(a&&(a===t||a===W.camelize(t)||a===W.capitalize(W.camelize(t))))return i}const s=zd(o[e]||i[e],t)||zd(o.appContext[e],t);if(!s&&r)return i;if(be.env.NODE_ENV!=="production"&&n&&!s){const a=e===es?`
5
+ If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`:"";et(`Failed to resolve ${e.slice(0,-1)}: ${t}${a}`)}return s}else be.env.NODE_ENV!=="production"&&et(`resolve${W.capitalize(e.slice(0,-1))} can only be used in render() or setup().`)}function zd(e,t){return e&&(e[t]||e[W.camelize(t)]||e[W.capitalize(W.camelize(t))])}function kt(e,t,n,r){let o;const i=n,s=W.isArray(e);if(s||W.isString(e)){const a=s&&Ur(e);let c=!1;a&&(c=!fn(e),e=Bo(e)),o=new Array(e.length);for(let u=0,l=e.length;u<l;u++)o[u]=t(c?sn(e[u]):e[u],u,void 0,i)}else if(typeof e=="number"){be.env.NODE_ENV!=="production"&&!Number.isInteger(e)&&et(`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 Wd(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 Ge(e,t,n={},r,o){if(Jt.ce||Jt.parent&&zw(Jt.parent)&&Jt.parent.ce)return t!=="default"&&(n.name=t),J(),Ce(Qe,null,[ve("slot",n,r&&r())],64);let i=e[t];be.env.NODE_ENV!=="production"&&i&&i.length>1&&(et("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),J();const s=i&&Hd(i(n)),a=n.key||s&&s.key,c=Ce(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 Hd(e){return e.some(t=>rs(t)?!(t.type===bi||t.type===Qe&&!Hd(t.children)):!0)?e:null}function qa(e,t){const n={};if(be.env.NODE_ENV!=="production"&&!W.isObject(e))return et("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 Va=e=>e?hS(e)?lp(e):Va(e.parent):null,za=W.extend(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>be.env.NODE_ENV!=="production"?qo(e.props):e.props,$attrs:e=>be.env.NODE_ENV!=="production"?qo(e.attrs):e.attrs,$slots:e=>be.env.NODE_ENV!=="production"?qo(e.slots):e.slots,$refs:e=>be.env.NODE_ENV!=="production"?qo(e.refs):e.refs,$parent:e=>Va(e.parent),$root:e=>Va(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Zw(e),$forceUpdate:e=>e.f||(e.f=()=>{Na(e.update)}),$nextTick:e=>e.n||(e.n=Gn.bind(e.proxy)),$watch:e=>aS.bind(e)}),Xw={};be.env.NODE_ENV!=="production"&&(Xw.ownKeys=e=>(et("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 Yw(){return Jw().slots}function Jw(){const e=Ka();return be.env.NODE_ENV!=="production"&&!e&&et("useContext() called without active instance."),e.setupContext||(e.setupContext=mS(e))}function Gd(e){return W.isArray(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Zw(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=>ts(c,u,s,!0)),ts(c,t,s)),W.isObject(t)&&i.set(t,c),c}function ts(e,t,n,r=!1){const{mixins:o,extends:i}=t;i&&ts(e,i,n,!0),o&&o.forEach(s=>ts(e,s,n,!0));for(const s in t)if(r&&s==="expose")be.env.NODE_ENV!=="production"&&et('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const a=eS[s]||n&&n[s];e[s]=a?a(e[s],t[s]):t[s]}return e}const eS={data:Kd,props:Xd,emits:Xd,methods:Ki,computed:Ki,beforeCreate:pn,created:pn,beforeMount:pn,mounted:pn,beforeUpdate:pn,updated:pn,beforeDestroy:pn,beforeUnmount:pn,destroyed:pn,unmounted:pn,activated:pn,deactivated:pn,errorCaptured:pn,serverPrefetch:pn,components:Ki,directives:Ki,watch:nS,provide:Kd,inject:tS};function Kd(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 tS(e,t){return Ki(Qd(e),Qd(t))}function Qd(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 pn(e,t){return e?[...new Set([].concat(e,t))]:t}function Ki(e,t){return e?W.extend(Object.create(null),e,t):t}function Xd(e,t){return e?W.isArray(e)&&W.isArray(t)?[...new Set([...e,...t])]:W.extend(Object.create(null),Gd(e),Gd(t??{})):t}function nS(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]=pn(e[r],t[r]);return n}let rS=null;function yi(e,t){if(!Sn)be.env.NODE_ENV!=="production"&&et("provide() can only be used inside setup().");else{let n=Sn.provides;const r=Sn.parent&&Sn.parent.provides;r===n&&(n=Sn.provides=Object.create(r)),n[e]=t}}function dr(e,t,n=!1){const r=Sn||Jt;if(r||rS){const o=r?r.parent==null?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;be.env.NODE_ENV!=="production"&&et(`injection "${String(e)}" not found.`)}else be.env.NODE_ENV!=="production"&&et("inject() can only be used inside setup() or functional components.")}const iS={},Yd=e=>Object.getPrototypeOf(e)===iS,Wa=uS;function Jd(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]=pS(o[i]),a.el=s.el),!n&&a.patchFlag!==-2&&Jd(s,a)),a.type===ep&&(a.el=s.el),be.env.NODE_ENV!=="production"&&a.type===bi&&!a.el&&(a.el=s.el)}}const oS=Symbol.for("v-scx"),sS=()=>{{const e=dr(oS);return e||be.env.NODE_ENV!=="production"&&et("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function Tt(e,t,n){return be.env.NODE_ENV!=="production"&&!W.isFunction(t)&&et("`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."),Zd(e,t,n)}function Zd(e,t,n=W.EMPTY_OBJ){const{immediate:r,deep:o,flush:i,once:s}=n;be.env.NODE_ENV!=="production"&&!t&&(r!==void 0&&et('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&et('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),s!==void 0&&et('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const a=W.extend({},n);be.env.NODE_ENV!=="production"&&(a.onWarn=et);const c=t&&r||!t&&i!=="post";let u;if(wi){if(i==="sync"){const m=sS();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=Sn;a.call=(m,w,b)=>ka(m,l,w,b);let f=!1;i==="post"?a.scheduler=m=>{Wa(m,l&&l.suspense)}:i!=="sync"&&(f=!0,a.scheduler=(m,w)=>{w?m():Na(m)}),a.augmentJob=m=>{t&&(m.flags|=4),f&&(m.flags|=2,l&&(m.id=l.uid,m.i=l))};const d=Sw(e,t,a);return wi&&(u?u.push(d):c&&d()),d}function aS(e,t,n){const r=this.proxy,o=W.isString(e)?e.includes(".")?lS(r,e):()=>r[e]:e.bind(r,r);let i;W.isFunction(t)?i=t:(i=t.handler,n=t);const s=sp(this),a=Zd(o,i.bind(r),n);return s(),a}function lS(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 cS=e=>e.__isSuspense;function uS(e,t){t&&t.pendingBranch?W.isArray(e)?t.effects.push(...e):t.effects.push(e):Id(e)}const Qe=Symbol.for("v-fgt"),ep=Symbol.for("v-txt"),bi=Symbol.for("v-cmt"),ns=[];let An=null;function J(e=!1){ns.push(An=e?null:[])}function fS(){ns.pop(),An=ns[ns.length-1]||null}let Qi=1;function tp(e,t=!1){Qi+=e,e<0&&An&&t&&(An.hasOnce=!0)}function np(e){return e.dynamicChildren=Qi>0?An||W.EMPTY_ARR:null,fS(),Qi>0&&An&&An.push(e),e}function Se(e,t,n,r,o,i){return np(pe(e,t,n,r,o,i,!0))}function Ce(e,t,n,r,o){return np(ve(e,t,n,r,o,!0))}function rs(e){return e?e.__v_isVNode===!0:!1}const dS=(...e)=>ip(...e),rp=({key:e})=>e??null,is=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?W.isString(e)||Lt(e)||W.isFunction(e)?{i:Jt,r:e,k:t,f:!!n}:e:null);function pe(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&&rp(t),ref:t&&is(t),scopeId:xd,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:Jt};return a?(Ga(c,n),i&128&&e.normalize(c)):n&&(c.shapeFlag|=W.isString(n)?8:16),be.env.NODE_ENV!=="production"&&c.key!==c.key&&et("VNode created with invalid key (NaN). VNode type:",c.type),Qi>0&&!s&&An&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&An.push(c),c}const ve=be.env.NODE_ENV!=="production"?dS:ip;function ip(e,t=null,n=null,r=0,o=null,i=!1){if((!e||e===Vd)&&(be.env.NODE_ENV!=="production"&&!e&&et(`Invalid vnode type when creating vnode: ${e}.`),e=bi),rs(e)){const a=vi(e,t,!0);return n&&Ga(a,n),Qi>0&&!i&&An&&(a.shapeFlag&6?An[An.indexOf(e)]=a:An.push(a)),a.patchFlag=-2,a}if(up(e)&&(e=e.__vccOpts),t){t=Ha(t);let{class:a,style:c}=t;a&&!W.isString(a)&&(t.class=W.normalizeClass(a)),W.isObject(c)&&(Vo(c)&&!W.isArray(c)&&(c=W.extend({},c)),t.style=W.normalizeStyle(c))}const s=W.isString(e)?1:cS(e)?128:Bw(e)?64:W.isObject(e)?4:W.isFunction(e)?2:0;return be.env.NODE_ENV!=="production"&&s&4&&Vo(e)&&(e=nt(e),et("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)),pe(e,t,n,r,o,s,i,!0)}function Ha(e){return e?Vo(e)||Yd(e)?W.extend({},e):e:null}function vi(e,t,n=!1,r=!1){const{props:o,ref:i,patchFlag:s,children:a,transition:c}=e,u=t?Zt(o||{},t):o,l={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&rp(u),ref:t&&t.ref?n&&i?W.isArray(i)?i.concat(is(t)):[i,is(t)]:is(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:be.env.NODE_ENV!=="production"&&s===-1&&W.isArray(a)?a.map(op):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&&vi(e.ssContent),ssFallback:e.ssFallback&&vi(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&jd(l,c.clone(l)),l}function op(e){const t=vi(e);return W.isArray(e.children)&&(t.children=e.children.map(op)),t}function Vt(e=" ",t=0){return ve(ep,null,e,t)}function Oe(e="",t=!1){return t?(J(),Ce(bi,null,e)):ve(bi,null,e)}function pS(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:vi(e)}function Ga(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),Ga(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Yd(t)?t._ctx=Jt:o===3&&Jt&&(Jt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else W.isFunction(t)?(t={default:t,_ctx:Jt},n=32):(t=String(t),r&64?(n=16,t=[Vt(t)]):n=8);e.children=t,e.shapeFlag|=n}function Zt(...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 Sn=null;const Ka=()=>Sn||Jt;let Qa;{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)}};Qa=t("__VUE_INSTANCE_SETTERS__",n=>Sn=n),t("__VUE_SSR_SETTERS__",n=>wi=n)}const sp=e=>{const t=Sn;return Qa(e),e.scope.on(),()=>{e.scope.off(),Qa(t)}};function hS(e){return e.vnode.shapeFlag&4}let wi=!1;const ap=be.env.NODE_ENV!=="production"?{get(e,t){return nn(e,"get",""),e[t]},set(){return et("setupContext.attrs is readonly."),!1},deleteProperty(){return et("setupContext.attrs is readonly."),!1}}:{get(e,t){return nn(e,"get",""),e[t]}};function gS(e){return new Proxy(e.slots,{get(t,n){return nn(e,"get","$slots"),t[n]}})}function mS(e){const t=n=>{if(be.env.NODE_ENV!=="production"&&(e.exposed&&et("expose() should be called only once per setup()."),n!=null)){let r=typeof n;r==="object"&&(W.isArray(n)?r="array":Lt(n)&&(r="ref")),r!=="object"&&et(`expose() should be passed a plain object, received ${r}.`)}e.exposed=n||{}};if(be.env.NODE_ENV!=="production"){let n,r;return Object.freeze({get attrs(){return n||(n=new Proxy(e.attrs,ap))},get slots(){return r||(r=gS(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 lp(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(dw(lw(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in za)return za[n](e)},has(t,n){return n in t||n in za}})):e.proxy}const yS=/(?:^|[-_])(\w)/g,bS=e=>e.replace(yS,t=>t.toUpperCase()).replace(/[-_]/g,"");function Xa(e,t=!0){return W.isFunction(e)?e.displayName||e.name:e.name||t&&e.__name}function cp(e,t,n=!1){let r=Xa(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 up(e){return W.isFunction(e)&&"__vccOpts"in e}const j=(e,t)=>{const n=vw(e,t,wi);if(be.env.NODE_ENV!=="production"){const r=Ka();r&&r.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function fp(e,t,n){const r=arguments.length;return r===2?W.isObject(t)&&!W.isArray(t)?rs(t)?ve(e,null,[t]):ve(e,t):ve(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&rs(n)&&(n=[n]),ve(e,t,n))}function vS(){if(be.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},n={style:"color:#f5222d"},r={style:"color:#eb2f96"},o={__vue_custom_formatter:!0,header(f){return W.isObject(f)?f.__isVue?["div",e,"VueInstance"]:Lt(f)?["div",{},["span",e,l(f)],"<",a("_value"in f?f._value:f),">"]:Ur(f)?["div",{},["span",e,fn(f)?"ShallowReactive":"Reactive"],"<",a(f),`>${cr(f)?" (readonly)":""}`]:cr(f)?["div",{},["span",e,fn(f)?"ShallowReadonly":"Readonly"],"<",a(f),">"]:null:null},hasBody(f){return f&&f.__isVue},body(f){if(f&&f.__isVue)return["div",{},...i(f.$)]}};function i(f){const d=[];f.type.props&&f.props&&d.push(s("props",nt(f.props))),f.setupState!==W.EMPTY_OBJ&&d.push(s("setup",f.setupState)),f.data!==W.EMPTY_OBJ&&d.push(s("data",nt(f.data)));const m=c(f,"computed");m&&d.push(s("computed",m));const w=c(f,"inject");return w&&d.push(s("injected",w)),d.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:f}]]),d}function s(f,d){return d=W.extend({},d),Object.keys(d).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},f],["div",{style:"padding-left:1.25em"},...Object.keys(d).map(m=>["div",{},["span",r,m+": "],a(d[m],!1)])]]:["span",{}]}function a(f,d=!0){return typeof f=="number"?["span",t,f]:typeof f=="string"?["span",n,JSON.stringify(f)]:typeof f=="boolean"?["span",r,f]:W.isObject(f)?["object",{object:d?nt(f):f}]:["span",n,String(f)]}function c(f,d){const m=f.type;if(W.isFunction(m))return;const w={};for(const b in f.ctx)u(m,b,d)&&(w[b]=f.ctx[b]);return w}function u(f,d,m){const w=f[m];if(W.isArray(w)&&w.includes(d)||W.isObject(w)&&d in w||f.extends&&u(f.extends,d,m)||f.mixins&&f.mixins.some(b=>u(b,d,m)))return!0}function l(f){return fn(f)?"ShallowRef":f.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(o):window.devtoolsFormatters=[o]}const wS=be.env.NODE_ENV!=="production"?et:W.NOOP;be.env.NODE_ENV,be.env.NODE_ENV;let SS;const dp=typeof window<"u"&&window.trustedTypes;if(dp)try{SS=dp.createPolicy("vue",{createHTML:e=>e})}catch(e){be.env.NODE_ENV!=="production"&&wS(`Error creating trusted types policy: ${e}`)}const pp=Symbol("_vod"),ES=Symbol("_vsh"),Ya={beforeMount(e,{value:t},{transition:n}){e[pp]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Xi(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),Xi(e,!0),r.enter(e)):r.leave(e,()=>{Xi(e,!1)}):Xi(e,t))},beforeUnmount(e,{value:t}){Xi(e,t)}};be.env.NODE_ENV!=="production"&&(Ya.name="show");function Xi(e,t){e.style.display=t?e[pp]:"none",e[ES]=!t}Symbol(be.env.NODE_ENV!=="production"?"CSS_VAR_TEXT":"");function Yi(e,t,n,r){e.addEventListener(t,n,r)}const hp=e=>{const t=e.props["onUpdate:modelValue"]||!1;return W.isArray(t)?n=>W.invokeArrayFns(t,n):t};function TS(e){e.target.composing=!0}function gp(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ja=Symbol("_assign"),AS={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e[Ja]=hp(o);const i=r||o.props&&o.props.type==="number";Yi(e,t?"change":"input",s=>{if(s.target.composing)return;let a=e.value;n&&(a=a.trim()),i&&(a=W.looseToNumber(a)),e[Ja](a)}),n&&Yi(e,"change",()=>{e.value=e.value.trim()}),t||(Yi(e,"compositionstart",TS),Yi(e,"compositionend",gp),Yi(e,"change",gp))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:o,number:i}},s){if(e[Ja]=hp(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))}},RS=["ctrl","shift","alt","meta"],_S={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)=>RS.some(n=>e[`${n}Key`]&&!t.includes(n))},Rn=(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=_S[t[s]];if(a&&a(o,t))return}return e(o,...i)})},IS={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ji=(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||IS[s]===i))return e(o)})};function CS(){vS()}be.env.NODE_ENV!=="production"&&CS();const hn=()=>qt.useAbility(),os=()=>j(()=>!!document.getElementById("files-global-search-options"));function mp(e){if(e===void 0)throw new Error('cloneStateObject: cannot clone "undefined"');return JSON.parse(JSON.stringify(e))}const Zi=(e,t)=>!e||!t?!1:e.id===t.id;var Cr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Za(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var el,yp;function FS(){if(yp)return el;yp=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,f=0;f<=o.length;++f){if(f<o.length)l=o.charCodeAt(f);else{if(l===47)break;l=47}if(l===47){if(!(c===f-1||u===1))if(c!==f-1&&u===2){if(s.length<2||a!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var d=s.lastIndexOf("/");if(d!==s.length-1){d===-1?(s="",a=0):(s=s.slice(0,d),a=s.length-1-s.lastIndexOf("/")),c=f,u=0;continue}}else if(s.length===2||s.length===1){s="",a=0,c=f,u=0;continue}}i&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+o.slice(c+1,f):s=o.slice(c+1,f),a=f-c-1;c=f,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=be.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 f=s.length,d=f-l,m=u<d?u:d,w=-1,b=0;b<=m;++b){if(b===m){if(d>m){if(s.charCodeAt(l+b)===47)return s.slice(l+b+1);if(b===0)return s.slice(l+b)}else u>m&&(i.charCodeAt(a+b)===47?w=b:b===0&&(w=0));break}var T=i.charCodeAt(a+b),v=s.charCodeAt(l+b);if(T!==v)break;T===47&&(w=b)}var g="";for(b=a+w+1;b<=c;++b)(b===c||i.charCodeAt(b)===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 f=s.length-1,d=-1;for(l=i.length-1;l>=0;--l){var m=i.charCodeAt(l);if(m===47){if(!u){a=l+1;break}}else d===-1&&(u=!1,d=l+1),f>=0&&(m===s.charCodeAt(f)?--f===-1&&(c=l):(f=-1,c=d))}return a===c?c=d: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,f=i.length-1;f>=0;--f){var d=i.charCodeAt(f);if(d===47){if(!u){a=f+1;break}continue}c===-1&&(u=!1,c=f+1),d===46?s===-1?s=f: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,f=0,d=-1,m=!0,w=i.length-1,b=0;w>=u;--w){if(a=i.charCodeAt(w),a===47){if(!m){f=w+1;break}continue}d===-1&&(m=!1,d=w+1),a===46?l===-1?l=w:b!==1&&(b=1):l!==-1&&(b=-1)}return l===-1||d===-1||b===0||b===1&&l===d-1&&l===f+1?d!==-1&&(f===0&&c?s.base=s.name=i.slice(1,d):s.base=s.name=i.slice(f,d)):(f===0&&c?(s.name=i.slice(1,l),s.base=i.slice(1,d)):(s.name=i.slice(f,l),s.base=i.slice(f,d)),s.ext=i.slice(l,d)),f>0?s.dir=i.slice(0,f-1):c&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return r.posix=r,el=r,el}var gt=FS();const ss=Za(gt),PS=Me({name:"SpaceMoveInfoModal",props:{modal:{type:Object,required:!0}}}),Ve=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},OS=["textContent"],xS=["textContent"];function kS(e,t,n,r,o,i){return J(),Se(Qe,null,[pe("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,OS),pe("p",{class:"oc-mb-rm",textContent:W.toDisplayString(e.$gettext("Note: Links and shares of the original file are not copied."))},null,8,xS)],64)}const bp=Ve(PS,[["render",kS]]),NS=Me({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}=bt(),{$gettext:n}=Ne.useGettext(),r=ae(!1),o=j(()=>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=j(()=>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=j(()=>e.confirmSecondaryTextOverwrite||n("Replace"));return{message:i,checkboxValue:r,checkboxLabel:o,confirmSecondaryText:s,onConfirm:()=>{t(e.modal.id),e.callbackFn({strategy:qn.KEEP_BOTH,doForAllConflicts:p(r)})},onConfirmSecondary:()=>{t(e.modal.id);const l=e.suggestMerge?qn.MERGE:qn.REPLACE;e.callbackFn({strategy:l,doForAllConflicts:p(r)})},onCancel:()=>{t(e.modal.id),e.callbackFn({strategy:qn.SKIP,doForAllConflicts:p(r)})}}}}),$S=["textContent"],DS={class:"oc-my-m"},LS={class:"oc-flex oc-flex-right oc-flex-middle oc-mt-m"},MS={class:"oc-modal-body-actions-grid"};function BS(e,t,n,r,o,i){const s=he("oc-checkbox"),a=he("oc-button");return J(),Se(Qe,null,[pe("span",{class:"oc-display-inline-block oc-mb-m",textContent:W.toDisplayString(e.message)},null,8,$S),pe("div",DS,[e.conflictCount>1?(J(),Ce(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"])):Oe("",!0)]),pe("div",LS,[pe("div",MS,[ve(a,{class:"oc-modal-body-actions-cancel oc-ml-s",onClick:e.onCancel},{default:Te(()=>[Vt(W.toDisplayString(e.$gettext("Skip")),1)]),_:1},8,["onClick"]),ve(a,{class:"oc-modal-body-actions-secondary oc-ml-s",onClick:e.onConfirmSecondary},{default:Te(()=>[Vt(W.toDisplayString(e.confirmSecondaryText),1)]),_:1},8,["onClick"]),ve(a,{class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",onClick:e.onConfirm},{default:Te(()=>[Vt(W.toDisplayString(e.$gettext("Keep both")),1)]),_:1},8,["onClick"])])])],64)}const vp=Ve(NS,[["render",BS]]);class tl{constructor(t,n){this.$gettext=t,this.$ngettext=n}async resolveAllConflicts(t,n,r){const o=[];for(const u of t){const l=gt.join(n.path,u.name);r.some(d=>d.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,f=await this.resolveFileExists(u.resource,l);u.strategy=f.strategy,c.push(u),i+=1,f.doForAllConflicts&&(s=!0,a=f.strategy)}return c}resolveFileExists(t,n,r=!1,o=!1){const{dispatchModal:i}=bt();return new Promise(s=>{i({title:t.isFolder?this.$gettext("Folder already exists"):this.$gettext("File already exists"),hideActions:!0,customComponent:vp,customComponentAttrs:()=>({resource:t,conflictCount:n,suggestMerge:r,separateSkipHandling:o,callbackFn:a=>{s(a)}})})})}resolveDoCopyInsteadOfMoveForSpaces(){const{dispatchModal:t}=bt();return new Promise(n=>{t({title:this.$gettext("Copy here?"),customComponent:bp,confirmText:this.$gettext("Copy here"),onCancel:()=>{n(!1)},onConfirm:()=>Promise.resolve(n(!0))})})}}const Un=(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)?Un(e,t,n,r+1):o},wp=(e,t,n,r)=>e.id===n.id&&gt.dirname(t.path)===r.path;var qn=(e=>(e[e.SKIP=0]="SKIP",e[e.REPLACE=1]="REPLACE",e[e.KEEP_BOTH=2]="KEEP_BOTH",e[e.MERGE=3]="MERGE",e))(qn||{}),pr=(e=>(e[e.COPY=0]="COPY",e[e.MOVE=1]="MOVE",e))(pr||{});class Sp extends tl{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);rt().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===pr.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);rt().showMessage({title:l,status:"success"});return}let o=r===pr.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===pr.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")),rt().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===pr.MOVE){if(!await this.resolveDoCopyInsteadOfMoveForSpaces())return[];t=pr.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,f=r.some(w=>w.resource.id===c);let d=u,m=!1;if(f){const w=(i=r.find(b=>b.resource.id===c))==null?void 0:i.strategy;if(w===qn.SKIP)continue;if(w===qn.REPLACE){if(this.isOverwritingParentFolder(a,this.targetFolder,n)){const b=new Error;this.showResultMessage([{error:b,resourceName:u}],[],t);continue}m=!0}w===qn.KEEP_BOTH&&(d=Un(u,l,n),a.name=d)}wp(this.sourceSpace,a,this.targetSpace,this.targetFolder)&&m||o.push({resource:a,sourceSpace:this.sourceSpace,targetSpace:this.targetSpace,targetFolder:this.targetFolder,path:gt.join(this.targetFolder.path,d),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=gt.basename(t.path),i=gt.join(n.path,o);return r.some(a=>a.path===i)}}const nl={ignoreLocation:!0,threshold:0,useExtendedSearch:!0},jS=(e,t,n)=>new Yf(e,{...nl,keys:["name","type","icon","extension","tags"]}).search(t,{limit:n}).map(o=>o.item),Ep="oc-resource-icon-mapping",US={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","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 Tp(){const e={};return Object.values(US).forEach(t=>{t.extensions.forEach(n=>{e[n]=t.icon})}),e}function rl(e,t,n){return t.name=gt.basename(n),t.path=n,t.webDavPath=gt.join(e.webDavPath,n),t.extension=ee.extractExtensionFromFile(t),t}function qS(){this.__data__=[],this.size=0}function eo(e,t){return e===t||e!==e&&t!==t}function as(e,t){for(var n=e.length;n--;)if(eo(e[n][0],t))return n;return-1}var VS=Array.prototype,zS=VS.splice;function WS(e){var t=this.__data__,n=as(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():zS.call(t,n,1),--this.size,!0}function HS(e){var t=this.__data__,n=as(t,e);return n<0?void 0:t[n][1]}function GS(e){return as(this.__data__,e)>-1}function KS(e,t){var n=this.__data__,r=as(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function hr(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])}}hr.prototype.clear=qS,hr.prototype.delete=WS,hr.prototype.get=HS,hr.prototype.has=GS,hr.prototype.set=KS;function QS(){this.__data__=new hr,this.size=0}function XS(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function YS(e){return this.__data__.get(e)}function JS(e){return this.__data__.has(e)}const Fr=globalThis||void 0||self;var Ap=typeof Fr=="object"&&Fr&&Fr.Object===Object&&Fr,ZS=typeof self=="object"&&self&&self.Object===Object&&self,Kn=Ap||ZS||Function("return this")(),Pn=Kn.Symbol,Rp=Object.prototype,eE=Rp.hasOwnProperty,tE=Rp.toString,to=Pn?Pn.toStringTag:void 0;function nE(e){var t=eE.call(e,to),n=e[to];try{e[to]=void 0;var r=!0}catch{}var o=tE.call(e);return r&&(t?e[to]=n:delete e[to]),o}var rE=Object.prototype,iE=rE.toString;function oE(e){return iE.call(e)}var sE="[object Null]",aE="[object Undefined]",_p=Pn?Pn.toStringTag:void 0;function Hr(e){return e==null?e===void 0?aE:sE:_p&&_p in Object(e)?nE(e):oE(e)}function Qn(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var lE="[object AsyncFunction]",cE="[object Function]",uE="[object GeneratorFunction]",fE="[object Proxy]";function il(e){if(!Qn(e))return!1;var t=Hr(e);return t==cE||t==uE||t==lE||t==fE}var ol=Kn["__core-js_shared__"],Ip=function(){var e=/[^.]+$/.exec(ol&&ol.keys&&ol.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function dE(e){return!!Ip&&Ip in e}var pE=Function.prototype,hE=pE.toString;function Gr(e){if(e!=null){try{return hE.call(e)}catch{}try{return e+""}catch{}}return""}var gE=/[\\^$.*+?()[\]{}|]/g,mE=/^\[object .+?Constructor\]$/,yE=Function.prototype,bE=Object.prototype,vE=yE.toString,wE=bE.hasOwnProperty,SE=RegExp("^"+vE.call(wE).replace(gE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function EE(e){if(!Qn(e)||dE(e))return!1;var t=il(e)?SE:mE;return t.test(Gr(e))}function TE(e,t){return e==null?void 0:e[t]}function Kr(e,t){var n=TE(e,t);return EE(n)?n:void 0}var no=Kr(Kn,"Map"),ro=Kr(Object,"create");function AE(){this.__data__=ro?ro(null):{},this.size=0}function RE(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var _E="__lodash_hash_undefined__",IE=Object.prototype,CE=IE.hasOwnProperty;function FE(e){var t=this.__data__;if(ro){var n=t[e];return n===_E?void 0:n}return CE.call(t,e)?t[e]:void 0}var PE=Object.prototype,OE=PE.hasOwnProperty;function xE(e){var t=this.__data__;return ro?t[e]!==void 0:OE.call(t,e)}var kE="__lodash_hash_undefined__";function NE(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ro&&t===void 0?kE:t,this}function Qr(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])}}Qr.prototype.clear=AE,Qr.prototype.delete=RE,Qr.prototype.get=FE,Qr.prototype.has=xE,Qr.prototype.set=NE;function $E(){this.size=0,this.__data__={hash:new Qr,map:new(no||hr),string:new Qr}}function DE(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ls(e,t){var n=e.__data__;return DE(t)?n[typeof t=="string"?"string":"hash"]:n.map}function LE(e){var t=ls(this,e).delete(e);return this.size-=t?1:0,t}function ME(e){return ls(this,e).get(e)}function BE(e){return ls(this,e).has(e)}function jE(e,t){var n=ls(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function gr(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])}}gr.prototype.clear=$E,gr.prototype.delete=LE,gr.prototype.get=ME,gr.prototype.has=BE,gr.prototype.set=jE;var UE=200;function qE(e,t){var n=this.__data__;if(n instanceof hr){var r=n.__data__;if(!no||r.length<UE-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new gr(r)}return n.set(e,t),this.size=n.size,this}function Xn(e){var t=this.__data__=new hr(e);this.size=t.size}Xn.prototype.clear=QS,Xn.prototype.delete=XS,Xn.prototype.get=YS,Xn.prototype.has=JS,Xn.prototype.set=qE;var cs=function(){try{var e=Kr(Object,"defineProperty");return e({},"",{}),e}catch{}}();function sl(e,t,n){t=="__proto__"&&cs?cs(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function al(e,t,n){(n!==void 0&&!eo(e[t],n)||n===void 0&&!(t in e))&&sl(e,t,n)}function VE(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 zE=VE(),Cp=typeof L=="object"&&L&&!L.nodeType&&L,Fp=Cp&&typeof module=="object"&&module&&!module.nodeType&&module,WE=Fp&&Fp.exports===Cp,Pp=WE?Kn.Buffer:void 0,Op=Pp?Pp.allocUnsafe:void 0;function xp(e,t){if(t)return e.slice();var n=e.length,r=Op?Op(n):new e.constructor(n);return e.copy(r),r}var us=Kn.Uint8Array;function ll(e){var t=new e.constructor(e.byteLength);return new us(t).set(new us(e)),t}function kp(e,t){var n=t?ll(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function HE(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Np=Object.create,GE=function(){function e(){}return function(t){if(!Qn(t))return{};if(Np)return Np(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function $p(e,t){return function(n){return e(t(n))}}var cl=$p(Object.getPrototypeOf,Object),KE=Object.prototype;function fs(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||KE;return e===n}function QE(e){return typeof e.constructor=="function"&&!fs(e)?GE(cl(e)):{}}function Yn(e){return e!=null&&typeof e=="object"}var XE="[object Arguments]";function Dp(e){return Yn(e)&&Hr(e)==XE}var Lp=Object.prototype,YE=Lp.hasOwnProperty,JE=Lp.propertyIsEnumerable,io=Dp(function(){return arguments}())?Dp:function(e){return Yn(e)&&YE.call(e,"callee")&&!JE.call(e,"callee")},On=Array.isArray,ZE=9007199254740991;function Mp(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ZE}function oo(e){return e!=null&&Mp(e.length)&&!il(e)}function e1(e){return Yn(e)&&oo(e)}function t1(){return!1}var Bp=typeof L=="object"&&L&&!L.nodeType&&L,jp=Bp&&typeof module=="object"&&module&&!module.nodeType&&module,n1=jp&&jp.exports===Bp,Up=n1?Kn.Buffer:void 0,r1=Up?Up.isBuffer:void 0,Si=r1||t1,i1="[object Object]",o1=Function.prototype,s1=Object.prototype,qp=o1.toString,a1=s1.hasOwnProperty,l1=qp.call(Object);function ul(e){if(!Yn(e)||Hr(e)!=i1)return!1;var t=cl(e);if(t===null)return!0;var n=a1.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&qp.call(n)==l1}var c1="[object Arguments]",u1="[object Array]",f1="[object Boolean]",d1="[object Date]",p1="[object Error]",h1="[object Function]",g1="[object Map]",m1="[object Number]",y1="[object Object]",b1="[object RegExp]",v1="[object Set]",w1="[object String]",S1="[object WeakMap]",E1="[object ArrayBuffer]",T1="[object DataView]",A1="[object Float32Array]",R1="[object Float64Array]",_1="[object Int8Array]",I1="[object Int16Array]",C1="[object Int32Array]",F1="[object Uint8Array]",P1="[object Uint8ClampedArray]",O1="[object Uint16Array]",x1="[object Uint32Array]",wt={};wt[A1]=wt[R1]=wt[_1]=wt[I1]=wt[C1]=wt[F1]=wt[P1]=wt[O1]=wt[x1]=!0,wt[c1]=wt[u1]=wt[E1]=wt[f1]=wt[T1]=wt[d1]=wt[p1]=wt[h1]=wt[g1]=wt[m1]=wt[y1]=wt[b1]=wt[v1]=wt[w1]=wt[S1]=!1;function k1(e){return Yn(e)&&Mp(e.length)&&!!wt[Hr(e)]}function fl(e){return function(t){return e(t)}}var Vp=typeof L=="object"&&L&&!L.nodeType&&L,so=Vp&&typeof module=="object"&&module&&!module.nodeType&&module,N1=so&&so.exports===Vp,dl=N1&&Ap.process,Ei=function(){try{var e=so&&so.require&&so.require("util").types;return e||dl&&dl.binding&&dl.binding("util")}catch{}}(),zp=Ei&&Ei.isTypedArray,ds=zp?fl(zp):k1;function pl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var $1=Object.prototype,D1=$1.hasOwnProperty;function Wp(e,t,n){var r=e[t];(!(D1.call(e,t)&&eo(r,n))||n===void 0&&!(t in e))&&sl(e,t,n)}function Hp(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?sl(n,a,c):Wp(n,a,c)}return n}function L1(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var M1=9007199254740991,B1=/^(?:0|[1-9]\d*)$/;function Gp(e,t){var n=typeof e;return t=t??M1,!!t&&(n=="number"||n!="symbol"&&B1.test(e))&&e>-1&&e%1==0&&e<t}var j1=Object.prototype,U1=j1.hasOwnProperty;function Kp(e,t){var n=On(e),r=!n&&io(e),o=!n&&!r&&Si(e),i=!n&&!r&&!o&&ds(e),s=n||r||o||i,a=s?L1(e.length,String):[],c=a.length;for(var u in e)(t||U1.call(e,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Gp(u,c)))&&a.push(u);return a}function q1(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var V1=Object.prototype,z1=V1.hasOwnProperty;function W1(e){if(!Qn(e))return q1(e);var t=fs(e),n=[];for(var r in e)r=="constructor"&&(t||!z1.call(e,r))||n.push(r);return n}function hl(e){return oo(e)?Kp(e,!0):W1(e)}function H1(e){return Hp(e,hl(e))}function G1(e,t,n,r,o,i,s){var a=pl(e,n),c=pl(t,n),u=s.get(c);if(u){al(e,n,u);return}var l=i?i(a,c,n+"",e,t,s):void 0,f=l===void 0;if(f){var d=On(c),m=!d&&Si(c),w=!d&&!m&&ds(c);l=c,d||m||w?On(a)?l=a:e1(a)?l=HE(a):m?(f=!1,l=xp(c,!0)):w?(f=!1,l=kp(c,!0)):l=[]:ul(c)||io(c)?(l=a,io(a)?l=H1(a):(!Qn(a)||il(a))&&(l=QE(c))):f=!1}f&&(s.set(c,l),o(l,c,r,i,s),s.delete(c)),al(e,n,l)}function Qp(e,t,n,r,o){e!==t&&zE(t,function(i,s){if(o||(o=new Xn),Qn(i))G1(e,t,s,n,Qp,r,o);else{var a=r?r(pl(e,s),i,s+"",e,t,o):void 0;a===void 0&&(a=i),al(e,s,a)}},hl)}function Xp(e){return e}function K1(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 Yp=Math.max;function Jp(e,t,n){return t=Yp(t===void 0?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=Yp(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),K1(e,this,a)}}function Q1(e){return function(){return e}}var X1=cs?function(e,t){return cs(e,"toString",{configurable:!0,enumerable:!1,value:Q1(t),writable:!0})}:Xp,Y1=800,J1=16,Z1=Date.now;function eT(e){var t=0,n=0;return function(){var r=Z1(),o=J1-(r-n);if(n=r,o>0){if(++t>=Y1)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Zp=eT(X1);function tT(e,t){return Zp(Jp(e,t,Xp),e+"")}function nT(e,t,n){if(!Qn(n))return!1;var r=typeof t;return(r=="number"?oo(n)&&Gp(t,n.length):r=="string"&&t in n)?eo(n[t],e):!1}function rT(e){return tT(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&&nT(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 ao=rT(function(e,t,n){Qp(e,t,n)});const gl=(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)},lo=(...e)=>(t,...n)=>{if(!n.length)return gl(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 gl(t,r,...o)};function C2(e){return e}const co=(e,...t)=>ao({},{name:e},...t.map(n=>({...n.params&&{params:n.params},...n.query&&{query:n.query}}))),Ti=(e,t={})=>co(e,t),eh=Ti("files-common-favorites"),th=Ti("files-common-search"),At=lo(eh,th),iT=e=>[{path:"/search",component:e.App,children:[{name:th.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:eh.name,path:"",component:e.Favorites,meta:{authContext:"user",title:"Favorite files"}}]}],xn=(e,t={})=>co(e,t),nh=xn("files-spaces-projects"),ml=xn("files-spaces-generic"),at=lo(nh,ml),oT=e=>[{path:"/spaces",component:e.App,children:[{path:"projects",name:nh.name,component:e.Spaces.Projects,meta:{authContext:"user",title:"Spaces"}},{path:":driveAliasAndItem(.*)?",name:ml.name,component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0,contextQueryItems:["sort-by","sort-dir"]}}]}],kn=(e,t={})=>co(e,t),sT=kn("files-shares"),ps=kn("files-shares-with-me"),yl=kn("files-shares-with-others"),bl=kn("files-shares-via-link"),Nt=lo(ps,yl,bl),aT=e=>[{name:sT.name,path:"/shares",component:e.App,redirect:ps,children:[{name:ps.name,path:"with-me",component:e.Shares.SharedWithMe,meta:{authContext:"user",title:"Files shared with me"}},{name:yl.name,path:"with-others",component:e.Shares.SharedWithOthers,meta:{authContext:"user",title:"Files shared with others"}},{name:bl.name,path:"via-link",component:e.Shares.SharedViaLink,meta:{authContext:"user",title:"Files shared via link"}}]}],Ai=(e,t={})=>co(e,t),vl=Ai("files-public-link"),wl=Ai("files-public-upload"),_n=lo(vl,wl),lT=e=>[{path:"/link",component:e.App,meta:{auth:!1},children:[{name:vl.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"publicLink",patchCleanPath:!0}}]},{path:"/upload",component:e.App,meta:{auth:!1},children:[{name:wl.name,path:":token?",component:e.FilesDrop,meta:{authContext:"publicLink",title:"Public file upload"}}]}],Ri=(e,t={})=>co(e,t),rh=Ri("files-trash-generic"),ih=Ri("files-trash-overview"),In=lo(rh,ih),cT=e=>[{path:"/trash",component:e.App,children:[{path:"overview",name:ih.name,component:e.Trash.Overview,meta:{authContext:"user",title:"Trash overview"}},{name:rh.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0}}]}];function oh(e){return{applicationConfig:j(()=>e.appsStore.externalAppConfig[e.applicationId]||{})}}const uT=["anonymous","user","idp","publicLink","hybrid"],mr=e=>dr(e),ze=()=>mr("$router"),en=()=>ze().currentRoute,Sl=e=>e.path.split("/")[1],fT=()=>{const e=en();return j(()=>Sl(p(e)))},Jn=(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)&&!Et.isUndefined(t.fileId)&&{fileId:`${t.fileId}`}}}},dT=(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},Zn=He.defineStore("apps",()=>{const e=ae({}),t=ae({}),n=ae([]),r=j(()=>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,f,d;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||((d=(f=(l=p(t))==null?void 0:l[c])==null?void 0:f.priorityExtensions)==null?void 0:d.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)}}),Xr=He.defineStore("auth",()=>{const e=ae(),t=ae(!1),n=ae(!1),r=ae(),o=ae(),i=ae(),s=ae(!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})}}}),sh={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}},rn=He.defineStore("capabilities",()=>{const e=ae(!1),t=ae(sh),n=_=>{t.value=ao({...sh},_.capabilities),e.value=!0},r=j(()=>p(t).core["support-url-signing"]),o=j(()=>p(t).core["support-sse"]),i=j(()=>p(t).graph["personal-data-export"]),s=j(()=>p(t).core.status),a=j(()=>p(t).dav.reports),c=j(()=>p(t).dav.trashbin),u=j(()=>p(t).spaces.max_quota),l=j(()=>p(t).spaces.projects),f=j(()=>p(t).graph.users.create_disabled),d=j(()=>p(t).graph.users.delete_disabled),m=j(()=>p(t).graph.users.change_password_self_disabled),w=j(()=>p(t).graph.users.read_only_attributes),b=j(()=>p(t).files.app_providers),T=j(()=>p(t).files.favorites),v=j(()=>p(t).files.thumbnail),g=j(()=>p(t).files.archivers),h=j(()=>p(t).files.privateLinks),y=j(()=>p(t).files.permanent_deletion),S=j(()=>p(t).files.tags),E=j(()=>p(t).files.undelete),R=j(()=>p(t).files_sharing.api_enabled),I=j(()=>p(t).files_sharing.deny_access),A=j(()=>p(t).files_sharing.can_rename),$=j(()=>p(t).files_sharing.allow_custom),D=j(()=>{var _;return(_=p(t).files_sharing.public)==null?void 0:_.enabled}),k=j(()=>{var _;return(_=p(t).files_sharing.public)==null?void 0:_.can_edit}),N=j(()=>{var _;return(_=p(t).files_sharing.public)==null?void 0:_.can_contribute}),z=j(()=>{var _;return(_=p(t).files_sharing.public)==null?void 0:_.alias}),G=j(()=>{var _;return(_=p(t).files_sharing.public)==null?void 0:_.default_permissions}),X=j(()=>{var _;return(_=p(t).files_sharing.public)==null?void 0:_.password.enforced_for}),se=j(()=>p(t).files_sharing.search_min_length),ne=j(()=>{var _;return(_=p(t).files_sharing.user)==null?void 0:_.profile_picture}),oe=j(()=>{var _;return(_=p(t).files.tus_support)==null?void 0:_.max_chunk_size}),fe=j(()=>{var _;return(_=p(t).files.tus_support)==null?void 0:_.extension}),we=j(()=>{var _;return(_=p(t).files.tus_support)==null?void 0:_.http_method_override}),Z=j(()=>p(t).notifications["ocs-endpoints"]),re=j(()=>p(t).password_policy),ce=j(()=>{var _;return(_=p(t).search.property)==null?void 0:_.mtime}),Ie=j(()=>{var _;return(_=p(t).search.property)==null?void 0:_.mediatype}),Y=j(()=>{var _;return(_=p(t).search.property)==null?void 0:_.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:f,graphUsersDeleteDisabled:d,graphUsersChangeSelfPasswordDisabled:m,graphUsersReadOnlyAttributes:w,filesAppProviders:b,filesFavorites:T,filesThumbnail:v,filesArchivers:g,filesPrivateLinks:h,filesPermanentDeletion:y,filesTags:S,filesUndelete:E,sharingApiEnabled:R,sharingDenyAccess:I,sharingCanRename:A,sharingAllowCustom:$,sharingPublicEnabled:D,sharingPublicCanEdit:k,sharingPublicCanContribute:N,sharingPublicAlias:z,sharingPublicDefaultPermissions:G,sharingPublicPasswordEnforcedFor:X,sharingSearchMinLength:se,sharingUserProfilePicture:ne,tusMaxChunkSize:oe,tusExtension:fe,tusHttpMethodOverride:we,notificationsOcsEndpoints:Z,passwordPolicy:re,searchLastMofifiedDate:ce,searchMediaType:Ie,searchContent:Y}});class pT{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 El{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 pT(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 hs=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)},hT=({sharedAncestor:e,matchingSpace:t})=>t?xn("files-spaces-generic",Jn(t,{path:e.path,fileId:e.id})):{},ah=({sharesStore:e,spacesStore:t,userStore:n,space:r,sharedDriveItem:o})=>{var u;const i=((u=o==null?void 0:o.remoteItem)==null?void 0:u.permissions)||[];if(!i.length)return;const s=[];i.forEach(l=>{if(l["@libre.graph.permissions.actions"]){s.push(...l["@libre.graph.permissions.actions"]);return}const f=e.graphRoles[l.roles[0]];if(!f)return;const d=f.rolePermissions.flatMap(m=>m.allowedResourceActions);s.push(...d)});const a=[...new Set(s)],c={grantedTo:{user:{id:n.user.id,displayName:n.user.displayName}},permissions:a,roleId:""};t.updateSpaceField({id:r.id,field:"members",value:{[n.user.id]:c}})},gT=e=>{var n;const t=(n=document.querySelectorAll(`[data-item-id="${e}"] input[type=checkbox]`))==null?void 0:n[0];t&&t.focus()};class Yr{}Ee(Yr,"sortByQueryName","sort-by"),Ee(Yr,"sortDirQueryName","sort-dir");var mT="[object Symbol]";function gs(e){return typeof e=="symbol"||Yn(e)&&Hr(e)==mT}var yT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bT=/^\w*$/;function vT(e,t){if(On(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||gs(e)?!0:bT.test(e)||!yT.test(e)||t!=null&&e in Object(t)}var wT="Expected a function";function Tl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(wT);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(Tl.Cache||gr),n}Tl.Cache=gr;var ST=500;function ET(e){var t=Tl(e,function(r){return n.size===ST&&n.clear(),r}),n=t.cache;return t}var TT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,AT=/\\(\\)?/g,RT=ET(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(TT,function(n,r,o,i){t.push(o?i.replace(AT,"$1"):r||n)}),t});function lh(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 ch=Pn?Pn.prototype:void 0,uh=ch?ch.toString:void 0;function fh(e){if(typeof e=="string")return e;if(On(e))return lh(e,fh)+"";if(gs(e))return uh?uh.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Al(e){return e==null?"":fh(e)}function Rl(e,t){return On(e)?e:vT(e,t)?[e]:RT(Al(e))}function dh(e){if(typeof e=="string"||gs(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function ph(e,t){t=Rl(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[dh(t[n++])];return n&&n==r?e:void 0}function _l(e,t,n){var r=e==null?void 0:ph(e,t);return r===void 0?n:r}var Bt=(e=>(e.Desc="desc",e.Asc="asc",e))(Bt||{});function _T(e){const t=ze(),n=IT(e),r=CT(e),o=j(()=>{var u;return gh(p(n))||p((u=Il(p(s)))==null?void 0:u.name)}),i=j(()=>PT(p(r))||FT(p(o),p(s))),s=e.fields;return{items:j(()=>{const u=p(e.items);return p(o)?hh(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)||Yr.sortByQueryName]:u,[p(e.sortDirQueryName)||Yr.sortDirQueryName]:l}})}}function IT(e){var t;return e.sortBy?Lt(e.sortBy)?e.sortBy:ae(e.sortBy):wr({name:p(e.sortByQueryName)||Yr.sortByQueryName,defaultValue:p((t=Il(p(e.fields)))==null?void 0:t.name),storagePrefix:p(e.routeName)||p(Ws())})}function CT(e){var t;return e.sortDir?Lt(e.sortDir)?e.sortDir:ae(e.sortDir):wr({name:p(e.sortDirQueryName)||Yr.sortDirQueryName,defaultValue:p((t=Il(p(e.fields)))==null?void 0:t.sortDir),storagePrefix:p(e.routeName)||p(Ws())})}const Il=e=>{const t=e.filter(n=>n.sortable);return t?t[0]:null},FT=(e,t)=>{const n=t.find(r=>r.name===e);return n&&n.sortDir?p(n.sortDir):"desc"},hh=(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)=>Cl(u,l,s,n,r,i)),c=[...e.filter(u=>u.type!=="folder")].sort((u,l)=>Cl(u,l,s,n,r,i));return r==="asc"?a.concat(c):c.concat(a)}return[...e].sort((a,c)=>Cl(a,c,s,o.prop||o.name,r,i))},Cl=(e,t,n,r,o,i)=>{let s=_l(e,r),a=_l(t,r);const c=o==="asc"?1:-1;if(i)if(typeof i=="string"){const l=f=>f.map(d=>d[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},gh=e=>Array.isArray(e)?e[0]:e,PT=e=>{switch(gh(e)){case"asc":return"asc";case"desc":return"desc"}return null},mh=e=>e?[{name:"name",sortable:!0,sortDir:Bt.Asc},{name:"size",sortable:!0,sortDir:Bt.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:Bt.Asc},{name:"owner",sortable:"displayName",sortDir:Bt.Asc},{name:"mdate",sortable:t=>new Date(t).valueOf(),sortDir:Bt.Desc},{name:"sdate",sortable:t=>new Date(t).valueOf(),sortDir:Bt.Desc},{name:"ddate",sortable:t=>new Date(t).valueOf(),sortDir:Bt.Desc}].filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[];function F2(e){return e}const yh=[{label:"A-Z",name:"name",sortable:!0,sortDir:Bt.Asc},{label:"Z-A",name:"name",sortable:!0,sortDir:Bt.Desc},{label:"Newest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Bt.Desc},{label:"Oldest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Bt.Asc},{label:"Largest",name:"size",sortable:!0,sortDir:Bt.Desc},{label:"Smallest",name:"size",sortable:!0,sortDir:Bt.Asc},{label:"Remaining quota",name:"remainingQuota",prop:"spaceQuota.remaining",sortable:!0,sortDir:Bt.Desc},{label:"Total quota",name:"totalQuota",prop:"spaceQuota.total",sortable:!0,sortDir:Bt.Desc},{label:"Used quota",name:"usedQuota",prop:"spaceQuota.used",sortable:!0,sortDir:Bt.Desc}],OT=e=>e?yh.filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[],xT=(e,{$gettext:t})=>e.map(n=>({...n,label:t(n.label)})),kT=ye.z.object({icon:ye.z.string(),name:ye.z.string(),secure_view:ye.z.boolean().optional().default(!1),target_ext:ye.z.string().optional()}),NT=ye.z.object({allow_creation:ye.z.boolean().optional(),app_providers:ye.z.array(kT),default_application:ye.z.string().optional(),description:ye.z.string().optional(),ext:ye.z.string().optional(),mime_type:ye.z.string(),name:ye.z.string().optional()}),bh=ye.z.object({"mime-types":ye.z.array(NT)});class $T{constructor(t,n){Ee(this,"_mimeTypes",ae([]));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:bh});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 vh={},ms={};ms.byteLength=MT,ms.toByteArray=jT,ms.fromByteArray=VT;for(var er=[],Nn=[],DT=typeof Uint8Array<"u"?Uint8Array:Array,Fl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_i=0,LT=Fl.length;_i<LT;++_i)er[_i]=Fl[_i],Nn[Fl.charCodeAt(_i)]=_i;Nn[45]=62,Nn[95]=63;function wh(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 MT(e){var t=wh(e),n=t[0],r=t[1];return(n+r)*3/4-r}function BT(e,t,n){return(t+n)*3/4-n}function jT(e){var t,n=wh(e),r=n[0],o=n[1],i=new DT(BT(e,r,o)),s=0,a=o>0?r-4:r,c;for(c=0;c<a;c+=4)t=Nn[e.charCodeAt(c)]<<18|Nn[e.charCodeAt(c+1)]<<12|Nn[e.charCodeAt(c+2)]<<6|Nn[e.charCodeAt(c+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=t&255;return o===2&&(t=Nn[e.charCodeAt(c)]<<2|Nn[e.charCodeAt(c+1)]>>4,i[s++]=t&255),o===1&&(t=Nn[e.charCodeAt(c)]<<10|Nn[e.charCodeAt(c+1)]<<4|Nn[e.charCodeAt(c+2)]>>2,i[s++]=t>>8&255,i[s++]=t&255),i}function UT(e){return er[e>>18&63]+er[e>>12&63]+er[e>>6&63]+er[e&63]}function qT(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(UT(r));return o.join("")}function VT(e){for(var t,n=e.length,r=n%3,o=[],i=16383,s=0,a=n-r;s<a;s+=i)o.push(qT(e,s,s+i>a?a:s+i));return r===1?(t=e[n-1],o.push(er[t>>2]+er[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(er[t>>10]+er[t>>4&63]+er[t<<2&63]+"=")),o.join("")}var Pl={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Pl.read=function(e,t,n,r,o){var i,s,a=o*8-r-1,c=(1<<a)-1,u=c>>1,l=-7,f=n?o-1:0,d=n?-1:1,m=e[t+f];for(f+=d,i=m&(1<<-l)-1,m>>=-l,l+=a;l>0;i=i*256+e[t+f],f+=d,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=r;l>0;s=s*256+e[t+f],f+=d,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)},Pl.write=function(e,t,n,r,o,i){var s,a,c,u=i*8-o-1,l=(1<<u)-1,f=l>>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:i-1,w=r?1:-1,b=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+f>=1?t+=d/c:t+=d*Math.pow(2,1-f),t*c>=2&&(s++,c/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*c-1)*Math.pow(2,o),s=s+f):(a=t*Math.pow(2,f-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]|=b*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=ms,n=Fl,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 M=new i(1),C={foo:function(){return 42}};return Object.setPrototypeOf(C,i.prototype),Object.setPrototypeOf(M,C),M.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(M){if(M>o)throw new RangeError('The value "'+M+'" is invalid for option "size"');const C=new i(M);return Object.setPrototypeOf(C,l.prototype),C}function l(M,C,O){if(typeof M=="number"){if(typeof C=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(M)}return f(M,C,O)}l.poolSize=8192;function f(M,C,O){if(typeof M=="string")return v(M,C);if(s.isView(M))return b(M);if(M==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof M);if(ct(M,s)||M&&ct(M.buffer,s)||typeof a<"u"&&(ct(M,a)||M&&ct(M.buffer,a)))return g(M,C,O);if(typeof M=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const G=M.valueOf&&M.valueOf();if(G!=null&&G!==M)return l.from(G,C,O);const te=h(M);if(te)return te;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof M[Symbol.toPrimitive]=="function")return l.from(M[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 M)}l.from=function(M,C,O){return f(M,C,O)},Object.setPrototypeOf(l.prototype,i.prototype),Object.setPrototypeOf(l,i);function d(M){if(typeof M!="number")throw new TypeError('"size" argument must be of type number');if(M<0)throw new RangeError('The value "'+M+'" is invalid for option "size"')}function m(M,C,O){return d(M),M<=0?u(M):C!==void 0?typeof O=="string"?u(M).fill(C,O):u(M).fill(C):u(M)}l.alloc=function(M,C,O){return m(M,C,O)};function w(M){return d(M),u(M<0?0:y(M)|0)}l.allocUnsafe=function(M){return w(M)},l.allocUnsafeSlow=function(M){return w(M)};function v(M,C){if((typeof C!="string"||C==="")&&(C="utf8"),!l.isEncoding(C))throw new TypeError("Unknown encoding: "+C);const O=E(M,C)|0;let G=u(O);const te=G.write(M,C);return te!==O&&(G=G.slice(0,te)),G}function T(M){const C=M.length<0?0:y(M.length)|0,O=u(C);for(let G=0;G<C;G+=1)O[G]=M[G]&255;return O}function b(M){if(ct(M,i)){const C=new i(M);return g(C.buffer,C.byteOffset,C.byteLength)}return T(M)}function g(M,C,O){if(C<0||M.byteLength<C)throw new RangeError('"offset" is outside of buffer bounds');if(M.byteLength<C+(O||0))throw new RangeError('"length" is outside of buffer bounds');let G;return C===void 0&&O===void 0?G=new i(M):O===void 0?G=new i(M,C):G=new i(M,C,O),Object.setPrototypeOf(G,l.prototype),G}function h(M){if(l.isBuffer(M)){const C=y(M.length)|0,O=u(C);return O.length===0||M.copy(O,0,0,C),O}if(M.length!==void 0)return typeof M.length!="number"||Qt(M.length)?u(0):T(M);if(M.type==="Buffer"&&Array.isArray(M.data))return T(M.data)}function y(M){if(M>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return M|0}function S(M){return+M!=M&&(M=0),l.alloc(+M)}l.isBuffer=function(C){return C!=null&&C._isBuffer===!0&&C!==l.prototype},l.compare=function(C,O){if(ct(C,i)&&(C=l.from(C,C.offset,C.byteLength)),ct(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 G=C.length,te=O.length;for(let ue=0,Ae=Math.min(G,te);ue<Ae;++ue)if(C[ue]!==O[ue]){G=C[ue],te=O[ue];break}return G<te?-1:te<G?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 G;if(O===void 0)for(O=0,G=0;G<C.length;++G)O+=C[G].length;const te=l.allocUnsafe(O);let ue=0;for(G=0;G<C.length;++G){let Ae=C[G];if(ct(Ae,i))ue+Ae.length>te.length?(l.isBuffer(Ae)||(Ae=l.from(Ae)),Ae.copy(te,ue)):i.prototype.set.call(te,Ae,ue);else if(l.isBuffer(Ae))Ae.copy(te,ue);else throw new TypeError('"list" argument must be an Array of Buffers');ue+=Ae.length}return te};function E(M,C){if(l.isBuffer(M))return M.length;if(s.isView(M)||ct(M,s))return M.byteLength;if(typeof M!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof M);const O=M.length,G=arguments.length>2&&arguments[2]===!0;if(!G&&O===0)return 0;let te=!1;for(;;)switch(C){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return ae(M).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return Je(M).length;default:if(te)return G?-1:ae(M).length;C=(""+C).toLowerCase(),te=!0}}l.byteLength=E;function R(M,C,O){let G=!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(M||(M="utf8");;)switch(M){case"hex":return Z(this,C,O);case"utf8":case"utf-8":return ie(this,C,O);case"ascii":return we(this,C,O);case"latin1":case"binary":return Se(this,C,O);case"base64":return X(this,C,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,C,O);default:if(G)throw new TypeError("Unknown encoding: "+M);M=(M+"").toLowerCase(),G=!0}}l.prototype._isBuffer=!0;function I(M,C,O){const G=M[C];M[C]=M[O],M[O]=G}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)I(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)I(this,O,O+3),I(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)I(this,O,O+7),I(this,O+1,O+6),I(this,O+2,O+5),I(this,O+3,O+4);return this},l.prototype.toString=function(){const C=this.length;return C===0?"":arguments.length===0?ie(this,0,C):R.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,G,te,ue){if(ct(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),G===void 0&&(G=C?C.length:0),te===void 0&&(te=0),ue===void 0&&(ue=this.length),O<0||G>C.length||te<0||ue>this.length)throw new RangeError("out of range index");if(te>=ue&&O>=G)return 0;if(te>=ue)return-1;if(O>=G)return 1;if(O>>>=0,G>>>=0,te>>>=0,ue>>>=0,this===C)return 0;let Ae=ue-te,Ze=G-O;const ft=Math.min(Ae,Ze),Fe=this.slice(te,ue),je=C.slice(O,G);for(let We=0;We<ft;++We)if(Fe[We]!==je[We]){Ae=Fe[We],Ze=je[We];break}return Ae<Ze?-1:Ze<Ae?1:0};function A(M,C,O,G,te){if(M.length===0)return-1;if(typeof O=="string"?(G=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,Qt(O)&&(O=te?0:M.length-1),O<0&&(O=M.length+O),O>=M.length){if(te)return-1;O=M.length-1}else if(O<0)if(te)O=0;else return-1;if(typeof C=="string"&&(C=l.from(C,G)),l.isBuffer(C))return C.length===0?-1:$(M,C,O,G,te);if(typeof C=="number")return C=C&255,typeof i.prototype.indexOf=="function"?te?i.prototype.indexOf.call(M,C,O):i.prototype.lastIndexOf.call(M,C,O):$(M,[C],O,G,te);throw new TypeError("val must be string, number or Buffer")}function $(M,C,O,G,te){let ue=1,Ae=M.length,Ze=C.length;if(G!==void 0&&(G=String(G).toLowerCase(),G==="ucs2"||G==="ucs-2"||G==="utf16le"||G==="utf-16le")){if(M.length<2||C.length<2)return-1;ue=2,Ae/=2,Ze/=2,O/=2}function ft(je,We){return ue===1?je[We]:je.readUInt16BE(We*ue)}let Fe;if(te){let je=-1;for(Fe=O;Fe<Ae;Fe++)if(ft(M,Fe)===ft(C,je===-1?0:Fe-je)){if(je===-1&&(je=Fe),Fe-je+1===Ze)return je*ue}else je!==-1&&(Fe-=Fe-je),je=-1}else for(O+Ze>Ae&&(O=Ae-Ze),Fe=O;Fe>=0;Fe--){let je=!0;for(let We=0;We<Ze;We++)if(ft(M,Fe+We)!==ft(C,We)){je=!1;break}if(je)return Fe}return-1}l.prototype.includes=function(C,O,G){return this.indexOf(C,O,G)!==-1},l.prototype.indexOf=function(C,O,G){return A(this,C,O,G,!0)},l.prototype.lastIndexOf=function(C,O,G){return A(this,C,O,G,!1)};function D(M,C,O,G){O=Number(O)||0;const te=M.length-O;G?(G=Number(G),G>te&&(G=te)):G=te;const ue=C.length;G>ue/2&&(G=ue/2);let Ae;for(Ae=0;Ae<G;++Ae){const Ze=parseInt(C.substr(Ae*2,2),16);if(Qt(Ze))return Ae;M[O+Ae]=Ze}return Ae}function k(M,C,O,G){return ut(ae(C,M.length-O),M,O,G)}function N(M,C,O,G){return ut($e(C),M,O,G)}function j(M,C,O,G){return ut(Je(C),M,O,G)}function W(M,C,O,G){return ut(De(C,M.length-O),M,O,G)}l.prototype.write=function(C,O,G,te){if(O===void 0)te="utf8",G=this.length,O=0;else if(G===void 0&&typeof O=="string")te=O,G=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(G)?(G=G>>>0,te===void 0&&(te="utf8")):(te=G,G=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ue=this.length-O;if((G===void 0||G>ue)&&(G=ue),C.length>0&&(G<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");te||(te="utf8");let Ae=!1;for(;;)switch(te){case"hex":return D(this,C,O,G);case"utf8":case"utf-8":return k(this,C,O,G);case"ascii":case"latin1":case"binary":return N(this,C,O,G);case"base64":return j(this,C,O,G);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,C,O,G);default:if(Ae)throw new TypeError("Unknown encoding: "+te);te=(""+te).toLowerCase(),Ae=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function X(M,C,O){return C===0&&O===M.length?t.fromByteArray(M):t.fromByteArray(M.slice(C,O))}function ie(M,C,O){O=Math.min(M.length,O);const G=[];let te=C;for(;te<O;){const ue=M[te];let Ae=null,Ze=ue>239?4:ue>223?3:ue>191?2:1;if(te+Ze<=O){let ft,Fe,je,We;switch(Ze){case 1:ue<128&&(Ae=ue);break;case 2:ft=M[te+1],(ft&192)===128&&(We=(ue&31)<<6|ft&63,We>127&&(Ae=We));break;case 3:ft=M[te+1],Fe=M[te+2],(ft&192)===128&&(Fe&192)===128&&(We=(ue&15)<<12|(ft&63)<<6|Fe&63,We>2047&&(We<55296||We>57343)&&(Ae=We));break;case 4:ft=M[te+1],Fe=M[te+2],je=M[te+3],(ft&192)===128&&(Fe&192)===128&&(je&192)===128&&(We=(ue&15)<<18|(ft&63)<<12|(Fe&63)<<6|je&63,We>65535&&We<1114112&&(Ae=We))}}Ae===null?(Ae=65533,Ze=1):Ae>65535&&(Ae-=65536,G.push(Ae>>>10&1023|55296),Ae=56320|Ae&1023),G.push(Ae),te+=Ze}return se(G)}const de=4096;function se(M){const C=M.length;if(C<=de)return String.fromCharCode.apply(String,M);let O="",G=0;for(;G<C;)O+=String.fromCharCode.apply(String,M.slice(G,G+=de));return O}function we(M,C,O){let G="";O=Math.min(M.length,O);for(let te=C;te<O;++te)G+=String.fromCharCode(M[te]&127);return G}function Se(M,C,O){let G="";O=Math.min(M.length,O);for(let te=C;te<O;++te)G+=String.fromCharCode(M[te]);return G}function Z(M,C,O){const G=M.length;(!C||C<0)&&(C=0),(!O||O<0||O>G)&&(O=G);let te="";for(let ue=C;ue<O;++ue)te+=Xt[M[ue]];return te}function ne(M,C,O){const G=M.slice(C,O);let te="";for(let ue=0;ue<G.length-1;ue+=2)te+=String.fromCharCode(G[ue]+G[ue+1]*256);return te}l.prototype.slice=function(C,O){const G=this.length;C=~~C,O=O===void 0?G:~~O,C<0?(C+=G,C<0&&(C=0)):C>G&&(C=G),O<0?(O+=G,O<0&&(O=0)):O>G&&(O=G),O<C&&(O=C);const te=this.subarray(C,O);return Object.setPrototypeOf(te,l.prototype),te};function le(M,C,O){if(M%1!==0||M<0)throw new RangeError("offset is not uint");if(M+C>O)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUintLE=l.prototype.readUIntLE=function(C,O,G){C=C>>>0,O=O>>>0,G||le(C,O,this.length);let te=this[C],ue=1,Ae=0;for(;++Ae<O&&(ue*=256);)te+=this[C+Ae]*ue;return te},l.prototype.readUintBE=l.prototype.readUIntBE=function(C,O,G){C=C>>>0,O=O>>>0,G||le(C,O,this.length);let te=this[C+--O],ue=1;for(;O>0&&(ue*=256);)te+=this[C+--O]*ue;return te},l.prototype.readUint8=l.prototype.readUInt8=function(C,O){return C=C>>>0,O||le(C,1,this.length),this[C]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(C,O){return C=C>>>0,O||le(C,2,this.length),this[C]|this[C+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(C,O){return C=C>>>0,O||le(C,2,this.length),this[C]<<8|this[C+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(C,O){return C=C>>>0,O||le(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||le(C,4,this.length),this[C]*16777216+(this[C+1]<<16|this[C+2]<<8|this[C+3])},l.prototype.readBigUInt64LE=Pt(function(C){C=C>>>0,ke(C,"offset");const O=this[C],G=this[C+7];(O===void 0||G===void 0)&&Pe(C,this.length-8);const te=O+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24,ue=this[++C]+this[++C]*2**8+this[++C]*2**16+G*2**24;return BigInt(te)+(BigInt(ue)<<BigInt(32))}),l.prototype.readBigUInt64BE=Pt(function(C){C=C>>>0,ke(C,"offset");const O=this[C],G=this[C+7];(O===void 0||G===void 0)&&Pe(C,this.length-8);const te=O*2**24+this[++C]*2**16+this[++C]*2**8+this[++C],ue=this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+G;return(BigInt(te)<<BigInt(32))+BigInt(ue)}),l.prototype.readIntLE=function(C,O,G){C=C>>>0,O=O>>>0,G||le(C,O,this.length);let te=this[C],ue=1,Ae=0;for(;++Ae<O&&(ue*=256);)te+=this[C+Ae]*ue;return ue*=128,te>=ue&&(te-=Math.pow(2,8*O)),te},l.prototype.readIntBE=function(C,O,G){C=C>>>0,O=O>>>0,G||le(C,O,this.length);let te=O,ue=1,Ae=this[C+--te];for(;te>0&&(ue*=256);)Ae+=this[C+--te]*ue;return ue*=128,Ae>=ue&&(Ae-=Math.pow(2,8*O)),Ae},l.prototype.readInt8=function(C,O){return C=C>>>0,O||le(C,1,this.length),this[C]&128?(255-this[C]+1)*-1:this[C]},l.prototype.readInt16LE=function(C,O){C=C>>>0,O||le(C,2,this.length);const G=this[C]|this[C+1]<<8;return G&32768?G|4294901760:G},l.prototype.readInt16BE=function(C,O){C=C>>>0,O||le(C,2,this.length);const G=this[C+1]|this[C]<<8;return G&32768?G|4294901760:G},l.prototype.readInt32LE=function(C,O){return C=C>>>0,O||le(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||le(C,4,this.length),this[C]<<24|this[C+1]<<16|this[C+2]<<8|this[C+3]},l.prototype.readBigInt64LE=Pt(function(C){C=C>>>0,ke(C,"offset");const O=this[C],G=this[C+7];(O===void 0||G===void 0)&&Pe(C,this.length-8);const te=this[C+4]+this[C+5]*2**8+this[C+6]*2**16+(G<<24);return(BigInt(te)<<BigInt(32))+BigInt(O+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24)}),l.prototype.readBigInt64BE=Pt(function(C){C=C>>>0,ke(C,"offset");const O=this[C],G=this[C+7];(O===void 0||G===void 0)&&Pe(C,this.length-8);const te=(O<<24)+this[++C]*2**16+this[++C]*2**8+this[++C];return(BigInt(te)<<BigInt(32))+BigInt(this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+G)}),l.prototype.readFloatLE=function(C,O){return C=C>>>0,O||le(C,4,this.length),n.read(this,C,!0,23,4)},l.prototype.readFloatBE=function(C,O){return C=C>>>0,O||le(C,4,this.length),n.read(this,C,!1,23,4)},l.prototype.readDoubleLE=function(C,O){return C=C>>>0,O||le(C,8,this.length),n.read(this,C,!0,52,8)},l.prototype.readDoubleBE=function(C,O){return C=C>>>0,O||le(C,8,this.length),n.read(this,C,!1,52,8)};function Ie(M,C,O,G,te,ue){if(!l.isBuffer(M))throw new TypeError('"buffer" argument must be a Buffer instance');if(C>te||C<ue)throw new RangeError('"value" argument is out of bounds');if(O+G>M.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(C,O,G,te){if(C=+C,O=O>>>0,G=G>>>0,!te){const Ze=Math.pow(2,8*G)-1;Ie(this,C,O,G,Ze,0)}let ue=1,Ae=0;for(this[O]=C&255;++Ae<G&&(ue*=256);)this[O+Ae]=C/ue&255;return O+G},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(C,O,G,te){if(C=+C,O=O>>>0,G=G>>>0,!te){const Ze=Math.pow(2,8*G)-1;Ie(this,C,O,G,Ze,0)}let ue=G-1,Ae=1;for(this[O+ue]=C&255;--ue>=0&&(Ae*=256);)this[O+ue]=C/Ae&255;return O+G},l.prototype.writeUint8=l.prototype.writeUInt8=function(C,O,G){return C=+C,O=O>>>0,G||Ie(this,C,O,1,255,0),this[O]=C&255,O+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(C,O,G){return C=+C,O=O>>>0,G||Ie(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,G){return C=+C,O=O>>>0,G||Ie(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,G){return C=+C,O=O>>>0,G||Ie(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,G){return C=+C,O=O>>>0,G||Ie(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 Y(M,C,O,G,te){Le(C,G,te,M,O,7);let ue=Number(C&BigInt(4294967295));M[O++]=ue,ue=ue>>8,M[O++]=ue,ue=ue>>8,M[O++]=ue,ue=ue>>8,M[O++]=ue;let Ae=Number(C>>BigInt(32)&BigInt(4294967295));return M[O++]=Ae,Ae=Ae>>8,M[O++]=Ae,Ae=Ae>>8,M[O++]=Ae,Ae=Ae>>8,M[O++]=Ae,O}function _(M,C,O,G,te){Le(C,G,te,M,O,7);let ue=Number(C&BigInt(4294967295));M[O+7]=ue,ue=ue>>8,M[O+6]=ue,ue=ue>>8,M[O+5]=ue,ue=ue>>8,M[O+4]=ue;let Ae=Number(C>>BigInt(32)&BigInt(4294967295));return M[O+3]=Ae,Ae=Ae>>8,M[O+2]=Ae,Ae=Ae>>8,M[O+1]=Ae,Ae=Ae>>8,M[O]=Ae,O+8}l.prototype.writeBigUInt64LE=Pt(function(C,O=0){return Y(this,C,O,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=Pt(function(C,O=0){return _(this,C,O,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(C,O,G,te){if(C=+C,O=O>>>0,!te){const ft=Math.pow(2,8*G-1);Ie(this,C,O,G,ft-1,-ft)}let ue=0,Ae=1,Ze=0;for(this[O]=C&255;++ue<G&&(Ae*=256);)C<0&&Ze===0&&this[O+ue-1]!==0&&(Ze=1),this[O+ue]=(C/Ae>>0)-Ze&255;return O+G},l.prototype.writeIntBE=function(C,O,G,te){if(C=+C,O=O>>>0,!te){const ft=Math.pow(2,8*G-1);Ie(this,C,O,G,ft-1,-ft)}let ue=G-1,Ae=1,Ze=0;for(this[O+ue]=C&255;--ue>=0&&(Ae*=256);)C<0&&Ze===0&&this[O+ue+1]!==0&&(Ze=1),this[O+ue]=(C/Ae>>0)-Ze&255;return O+G},l.prototype.writeInt8=function(C,O,G){return C=+C,O=O>>>0,G||Ie(this,C,O,1,127,-128),C<0&&(C=255+C+1),this[O]=C&255,O+1},l.prototype.writeInt16LE=function(C,O,G){return C=+C,O=O>>>0,G||Ie(this,C,O,2,32767,-32768),this[O]=C&255,this[O+1]=C>>>8,O+2},l.prototype.writeInt16BE=function(C,O,G){return C=+C,O=O>>>0,G||Ie(this,C,O,2,32767,-32768),this[O]=C>>>8,this[O+1]=C&255,O+2},l.prototype.writeInt32LE=function(C,O,G){return C=+C,O=O>>>0,G||Ie(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,G){return C=+C,O=O>>>0,G||Ie(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=Pt(function(C,O=0){return Y(this,C,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=Pt(function(C,O=0){return _(this,C,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function F(M,C,O,G,te,ue){if(O+G>M.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function K(M,C,O,G,te){return C=+C,O=O>>>0,te||F(M,C,O,4),n.write(M,C,O,G,23,4),O+4}l.prototype.writeFloatLE=function(C,O,G){return K(this,C,O,!0,G)},l.prototype.writeFloatBE=function(C,O,G){return K(this,C,O,!1,G)};function z(M,C,O,G,te){return C=+C,O=O>>>0,te||F(M,C,O,8),n.write(M,C,O,G,52,8),O+8}l.prototype.writeDoubleLE=function(C,O,G){return z(this,C,O,!0,G)},l.prototype.writeDoubleBE=function(C,O,G){return z(this,C,O,!1,G)},l.prototype.copy=function(C,O,G,te){if(!l.isBuffer(C))throw new TypeError("argument should be a Buffer");if(G||(G=0),!te&&te!==0&&(te=this.length),O>=C.length&&(O=C.length),O||(O=0),te>0&&te<G&&(te=G),te===G||C.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(G<0||G>=this.length)throw new RangeError("Index out of range");if(te<0)throw new RangeError("sourceEnd out of bounds");te>this.length&&(te=this.length),C.length-O<te-G&&(te=C.length-O+G);const ue=te-G;return this===C&&typeof i.prototype.copyWithin=="function"?this.copyWithin(O,G,te):i.prototype.set.call(C,this.subarray(G,te),O),ue},l.prototype.fill=function(C,O,G,te){if(typeof C=="string"){if(typeof O=="string"?(te=O,O=0,G=this.length):typeof G=="string"&&(te=G,G=this.length),te!==void 0&&typeof te!="string")throw new TypeError("encoding must be a string");if(typeof te=="string"&&!l.isEncoding(te))throw new TypeError("Unknown encoding: "+te);if(C.length===1){const Ae=C.charCodeAt(0);(te==="utf8"&&Ae<128||te==="latin1")&&(C=Ae)}}else typeof C=="number"?C=C&255:typeof C=="boolean"&&(C=Number(C));if(O<0||this.length<O||this.length<G)throw new RangeError("Out of range index");if(G<=O)return this;O=O>>>0,G=G===void 0?this.length:G>>>0,C||(C=0);let ue;if(typeof C=="number")for(ue=O;ue<G;++ue)this[ue]=C;else{const Ae=l.isBuffer(C)?C:l.from(C,te),Ze=Ae.length;if(Ze===0)throw new TypeError('The value "'+C+'" is invalid for argument "value"');for(ue=0;ue<G-O;++ue)this[ue+O]=Ae[ue%Ze]}return this};const B={};function V(M,C,O){B[M]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:C.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${M}]`,this.stack,delete this.name}get code(){return M}set code(te){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:te,writable:!0})}toString(){return`${this.name} [${M}]: ${this.message}`}}}V("ERR_BUFFER_OUT_OF_BOUNDS",function(M){return M?`${M} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),V("ERR_INVALID_ARG_TYPE",function(M,C){return`The "${M}" argument must be of type number. Received type ${typeof C}`},TypeError),V("ERR_OUT_OF_RANGE",function(M,C,O){let G=`The value of "${M}" is out of range.`,te=O;return Number.isInteger(O)&&Math.abs(O)>2**32?te=ce(String(O)):typeof O=="bigint"&&(te=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(te=ce(te)),te+="n"),G+=` It must be ${C}. Received ${te}`,G},RangeError);function ce(M){let C="",O=M.length;const G=M[0]==="-"?1:0;for(;O>=G+4;O-=3)C=`_${M.slice(O-3,O)}${C}`;return`${M.slice(0,O)}${C}`}function Re(M,C,O){ke(C,"offset"),(M[C]===void 0||M[C+O]===void 0)&&Pe(C,M.length-(O+1))}function Le(M,C,O,G,te,ue){if(M>O||M<C){const Ae=typeof C=="bigint"?"n":"";let Ze;throw C===0||C===BigInt(0)?Ze=`>= 0${Ae} and < 2${Ae} ** ${(ue+1)*8}${Ae}`:Ze=`>= -(2${Ae} ** ${(ue+1)*8-1}${Ae}) and < 2 ** ${(ue+1)*8-1}${Ae}`,new B.ERR_OUT_OF_RANGE("value",Ze,M)}Re(G,te,ue)}function ke(M,C){if(typeof M!="number")throw new B.ERR_INVALID_ARG_TYPE(C,"number",M)}function Pe(M,C,O){throw Math.floor(M)!==M?(ke(M,O),new B.ERR_OUT_OF_RANGE("offset","an integer",M)):C<0?new B.ERR_BUFFER_OUT_OF_BOUNDS:new B.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${C}`,M)}const Be=/[^+/0-9A-Za-z-_]/g;function he(M){if(M=M.split("=")[0],M=M.trim().replace(Be,""),M.length<2)return"";for(;M.length%4!==0;)M=M+"=";return M}function ae(M,C){C=C||1/0;let O;const G=M.length;let te=null;const ue=[];for(let Ae=0;Ae<G;++Ae){if(O=M.charCodeAt(Ae),O>55295&&O<57344){if(!te){if(O>56319){(C-=3)>-1&&ue.push(239,191,189);continue}else if(Ae+1===G){(C-=3)>-1&&ue.push(239,191,189);continue}te=O;continue}if(O<56320){(C-=3)>-1&&ue.push(239,191,189),te=O;continue}O=(te-55296<<10|O-56320)+65536}else te&&(C-=3)>-1&&ue.push(239,191,189);if(te=null,O<128){if((C-=1)<0)break;ue.push(O)}else if(O<2048){if((C-=2)<0)break;ue.push(O>>6|192,O&63|128)}else if(O<65536){if((C-=3)<0)break;ue.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((C-=4)<0)break;ue.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return ue}function $e(M){const C=[];for(let O=0;O<M.length;++O)C.push(M.charCodeAt(O)&255);return C}function De(M,C){let O,G,te;const ue=[];for(let Ae=0;Ae<M.length&&!((C-=2)<0);++Ae)O=M.charCodeAt(Ae),G=O>>8,te=O%256,ue.push(te),ue.push(G);return ue}function Je(M){return t.toByteArray(he(M))}function ut(M,C,O,G){let te;for(te=0;te<G&&!(te+O>=C.length||te>=M.length);++te)C[te+O]=M[te];return te}function ct(M,C){return M instanceof C||M!=null&&M.constructor!=null&&M.constructor.name!=null&&M.constructor.name===C.name}function Qt(M){return M!==M}const Xt=function(){const M="0123456789abcdef",C=new Array(256);for(let O=0;O<16;++O){const G=O*16;for(let te=0;te<16;++te)C[G+te]=M[O]+M[te]}return C}();function Pt(M){return typeof BigInt>"u"?Ue:M}function Ue(){throw new Error("BigInt not supported")}})(bh);const yr=bh.Buffer;var Ol,wh;function Sh(){return wh||(wh=1,Ol=typeof ye=="object"&&ye.env&&ye.env.NODE_DEBUG&&/\bsemver\b/i.test(ye.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),Ol}var xl,Eh;function Th(){if(Eh)return xl;Eh=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,o=t-6;return xl={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},xl}var ys={exports:{}},Ah;function VT(){return Ah||(Ah=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:o}=Th(),i=Sh();t=e.exports={};const s=t.re=[],a=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],l=t.t={};let f=0;const d="[a-zA-Z0-9-]",m=[["\\s",1],["\\d",o],[d,r]],w=T=>{for(const[b,g]of m)T=T.split(`${b}*`).join(`${b}{0,${g}}`).split(`${b}+`).join(`${b}{1,${g}}`);return T},v=(T,b,g)=>{const h=w(b),y=f++;i(T,y,b),l[T]=y,c[y]=b,u[y]=h,s[y]=new RegExp(b,g?"g":void 0),a[y]=new RegExp(h,g?"g":void 0)};v("NUMERICIDENTIFIER","0|[1-9]\\d*"),v("NUMERICIDENTIFIERLOOSE","\\d+"),v("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),v("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),v("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASEIDENTIFIER",`(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`),v("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`),v("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),v("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),v("BUILDIDENTIFIER",`${d}+`),v("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),v("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),v("FULL",`^${c[l.FULLPLAIN]}$`),v("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),v("LOOSE",`^${c[l.LOOSEPLAIN]}$`),v("GTLT","((?:<|>)?=?)"),v("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),v("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),v("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),v("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),v("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),v("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),v("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),v("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),v("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`),v("COERCERTL",c[l.COERCE],!0),v("COERCERTLFULL",c[l.COERCEFULL],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",v("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),v("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),v("LONECARET","(?:\\^)"),v("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",v("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),v("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),v("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),v("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),v("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),v("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(ys,ys.exports)),ys.exports}var kl,Rh;function zT(){if(Rh)return kl;Rh=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return kl=r=>r?typeof r!="object"?e:r:t,kl}var Nl,_h;function WT(){if(_h)return Nl;_h=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 Nl={compareIdentifiers:t,rcompareIdentifiers:(r,o)=>t(o,r)},Nl}var $l,Ih;function Ch(){if(Ih)return $l;Ih=1;const e=Sh(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=Th(),{safeRe:r,safeSrc:o,t:i}=VT(),s=zT(),{compareIdentifiers:a}=WT();class c{constructor(l,f){if(f=s(f),l instanceof c){if(l.loose===!!f.loose&&l.includePrerelease===!!f.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",l,f),this.options=f,this.loose=!!f.loose,this.includePrerelease=!!f.includePrerelease;const d=l.trim().match(f.loose?r[i.LOOSE]:r[i.FULL]);if(!d)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,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(m=>{if(/^[0-9]+$/.test(m)){const w=+m;if(w>=0&&w<n)return w}return m}):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(l){if(e("SemVer.compare",this.version,this.options,l),!(l instanceof c)){if(typeof l=="string"&&l===this.version)return 0;l=new c(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof c||(l=new c(l,this.options)),a(this.major,l.major)||a(this.minor,l.minor)||a(this.patch,l.patch)}comparePre(l){if(l instanceof c||(l=new c(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let f=0;do{const d=this.prerelease[f],m=l.prerelease[f];if(e("prerelease compare",f,d,m),d===void 0&&m===void 0)return 0;if(m===void 0)return 1;if(d===void 0)return-1;if(d===m)continue;return a(d,m)}while(++f)}compareBuild(l){l instanceof c||(l=new c(l,this.options));let f=0;do{const d=this.build[f],m=l.build[f];if(e("build compare",f,d,m),d===void 0&&m===void 0)return 0;if(m===void 0)return 1;if(d===void 0)return-1;if(d===m)continue;return a(d,m)}while(++f)}inc(l,f,d){if(l.startsWith("pre")){if(!f&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(f){const m=new RegExp(`^${this.options.loose?o[i.PRERELEASELOOSE]:o[i.PRERELEASE]}$`),w=`-${f}`.match(m);if(!w||w[1]!==f)throw new Error(`invalid identifier: ${f}`)}}switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",f,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",f,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",f,d),this.inc("pre",f,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",f,d),this.inc("pre",f,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 m=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[m];else{let w=this.prerelease.length;for(;--w>=0;)typeof this.prerelease[w]=="number"&&(this.prerelease[w]++,w=-2);if(w===-1){if(f===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(m)}}if(f){let w=[f,m];d===!1&&(w=[f]),a(this.prerelease[0],f)===0?isNaN(this.prerelease[1])&&(this.prerelease=w):this.prerelease=w}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return $l=c,$l}var Dl,Ph;function HT(){if(Ph)return Dl;Ph=1;const e=Ch();return Dl=(n,r)=>new e(n,r).major,Dl}var GT=HT();const Fh=Za(GT);var Ll,Oh;function KT(){if(Oh)return Ll;Oh=1;const e=Ch();return Ll=(n,r,o)=>new e(n,o).compare(new e(r,o)),Ll}var Ml,xh;function QT(){if(xh)return Ml;xh=1;const e=KT();return Ml=(n,r,o)=>e(r,n,o),Ml}var XT=QT();const YT=Za(XT);class Ii extends Error{constructor(n,...r){super([n,...r].filter(Boolean).join(", "));Ee(this,"name","RuntimeError");Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class JT extends Ii{constructor(){super(...arguments);Ee(this,"name","ApiError")}}const Bl=(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 ZT{constructor(t,n,r,o=oe([])){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=U(()=>{const i=p(o).filter(s=>s.enabled).sort((s,a)=>YT(s.version,a.version));return i.length?i[0]:null}),this.available=U(()=>{var i;return!!((i=p(this.capability))!=null&&i.version)}),this.fileIdsSupported=U(()=>{var i;return Fh((i=p(this.capability))==null?void 0:i.version)>=2})}async triggerDownload(t){var o,i,s;if(!p(this.available))throw new Ii("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 Ii("requested archive with empty list of resources");const n=this.buildDownloadUrl({...t});if(!n)throw new Ii("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 this.clientService.httpUnAuthenticated.get(r,{headers:{...!!t.publicLinkPassword&&{Authorization:"Basic "+yr.from(["public",t.publicLinkPassword].join(":")).toString("base64")}},responseType:"arraybuffer"}),c=new Blob([a.data],{type:"application/octet-stream"}),u=URL.createObjectURL(c),l=this.getFileNameFromResponseHeaders(a.headers);return Bl(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}`),Fh(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 Ii("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["content-disposition"])==null?void 0:r.split('"')[1];return decodeURI(n)}}const eA=new El({ttl:10*1e3,capacity:250}),tA=new El({ttl:10*1e3,capacity:250});class nA{get avatarUrl(){return tA}get filePreview(){return eA}}const jl=new nA;class kh{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 "+yr.from(["public",this.publicLinkPassword].join(":")).toString("base64")},...this.accessToken&&!this.publicLinkPassword&&{Authorization:"Bearer "+this.accessToken}}}}class Ul{constructor(t,n){Ee(this,"instance");Ee(this,"cancelToken");this.cancelToken=ko.CancelToken.source(),this.instance=ko.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 ao({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 iA=15e3;class oA{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 A0.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()*iA)}})}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 ql=null;const sA=(e,t)=>(ql||(ql=new oA(new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse",e).href,t)),ql),aA=(e,t)=>({headers:{Authorization:`Bearer ${e.accessToken}`,"Accept-Language":t,"X-Request-ID":Yt.v4(),"X-Requested-With":"XMLHttpRequest"}});class lA{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",Yt.v4());Ee(this,"staticHeaders",{"Initiator-ID":this.initiatorId,"X-Requested-With":"XMLHttpRequest"});this.configStore=t.configStore,this.language=t.language,this.authStore=t.authStore,this.initGraphClient(),this.initOcsClient(),this.initWebDavClient(),this.httpAuthenticatedClient=new Ul({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.httpUnAuthenticatedClient=new Ul({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 sA(this.configStore.serverUrl,aA({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=ko.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=ko.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 "+yr.from(["public",this.authStore.publicLinkPassword].join(":")).toString("base64")),t})}getDynamicHeaders({useAuth:t=!0}={}){return{"Accept-Language":this.currentLanguage,"X-Request-ID":Yt.v4(),...t&&{Authorization:"Bearer "+this.authStore.accessToken}}}}class Nh{constructor(){Ee(this,"topics");this.topics=new Map}subscribe(t,n){const r={token:Yt.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 Xe=new Nh;var cA=$p(Object.keys,Object),uA=Object.prototype,fA=uA.hasOwnProperty;function $h(e){if(!fs(e))return cA(e);var t=[];for(var n in Object(e))fA.call(e,n)&&n!="constructor"&&t.push(n);return t}var Vl=Kr(Kn,"DataView"),zl=Kr(Kn,"Promise"),Wl=Kr(Kn,"Set"),Hl=Kr(Kn,"WeakMap"),Dh="[object Map]",dA="[object Object]",Lh="[object Promise]",Mh="[object Set]",Bh="[object WeakMap]",jh="[object DataView]",pA=Gr(Vl),hA=Gr(no),gA=Gr(zl),mA=Gr(Wl),yA=Gr(Hl),$n=Hr;(Vl&&$n(new Vl(new ArrayBuffer(1)))!=jh||no&&$n(new no)!=Dh||zl&&$n(zl.resolve())!=Lh||Wl&&$n(new Wl)!=Mh||Hl&&$n(new Hl)!=Bh)&&($n=function(e){var t=Hr(e),n=t==dA?e.constructor:void 0,r=n?Gr(n):"";if(r)switch(r){case pA:return jh;case hA:return Dh;case gA:return Lh;case mA:return Mh;case yA:return Bh}return t});var bA="[object Map]",vA="[object Set]",wA=Object.prototype,SA=wA.hasOwnProperty;function EA(e){if(e==null)return!0;if(oo(e)&&(On(e)||typeof e=="string"||typeof e.splice=="function"||Si(e)||ds(e)||io(e)))return!e.length;var t=$n(e);if(t==bA||t==vA)return!e.size;if(fs(e))return!$h(e).length;for(var n in e)if(SA.call(e,n))return!1;return!0}class Uh{isEnabled(){return!0}isActive(t){return at(t,"files-spaces-projects")?!1:at(t,"files-spaces-generic")||_n(t,"files-public-link")}getTask(t){const{router:n,clientService:r,resourcesStore:o,userStore:i,authService:s,spacesStore:a,sharesStore:c,configStore:u}=t,{webdav:l,graphAuthenticated:f}=r,{replaceInvalidFileRoute:d}=zs({router:n}),m=this.setCurrentUserShareSpacePermissions;return un.useTask(function*(w,v,T,b=null,g=null,h={}){try{o.clearResourceList();let{resource:y,children:S}=yield*ee.call(l.listFiles(T,{path:b,fileId:g},{signal:w}));y.id&&d({space:T,resource:y,path:b,fileId:g});let E;if(b==="/"&&(ee.isShareSpaceResource(T)?(E=yield*ee.call(hs({graphClient:f,spacesStore:a,space:T,signal:w})),E&&(y=ee.buildIncomingShareResource({graphRoles:c.graphRoles,driveItem:E,serverUrl:u.serverUrl}))):!ee.isPersonalSpaceResource(T)&&!ee.isPublicSpaceResource(T)&&(y=T)),yield o.loadAncestorMetaData({folder:y,space:T,client:l,signal:w}),h.loadShares){const R=o.ancestorMetaData;for(const I of S)I.indicators=Eo({space:T,resource:I,ancestorMetaData:R,user:i.user})}ee.isShareSpaceResource(T)&&(S.forEach(R=>R.remoteItemId=T.id),EA(T.members)&&(E||(E=yield*ee.call(hs({graphClient:f,spacesStore:a,space:T,signal:w}))),m({sharesStore:c,spacesStore:a,userStore:i,space:T,sharedDriveItem:E}))),o.initResourceList({currentFolder:y,resources:S})}catch(y){if(o.setCurrentFolder(null),console.error(y),y.statusCode===401)return s.handleAuthError(p(n.currentRoute))}}).restartable()}setCurrentUserShareSpacePermissions({sharesStore:t,spacesStore:n,userStore:r,space:o,sharedDriveItem:i}){var l;const s=((l=i==null?void 0:i.remoteItem)==null?void 0:l.permissions)||[];if(!s.length)return;const a=[];s.forEach(f=>{if(f["@libre.graph.permissions.actions"]){a.push(...f["@libre.graph.permissions.actions"]);return}const d=t.graphRoles[f.roles[0]];if(!d)return;const m=d.rolePermissions.flatMap(w=>w.allowedResourceActions);a.push(...m)});const c=[...new Set(a)],u={grantedTo:{user:{id:r.user.id,displayName:r.user.displayName}},permissions:c,roleId:""};n.updateSpaceField({id:o.id,field:"members",value:{[r.user.id]:u}})}}class qh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return At(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 un.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 Vh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return Nt(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 un.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(f=>f.permissions.some(({link:d})=>!!d)).map(f=>ee.buildOutgoingShareResource({driveItem:f,user:n.user,serverUrl:i.serverUrl}));s.initResourceList({currentFolder:null,resources:l})})}}class zh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return Nt(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 un.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(f=>ee.buildIncomingShareResource({driveItem:f,graphRoles:s.graphRoles,serverUrl:o.serverUrl}));i.initResourceList({currentFolder:null,resources:l})})}}class Wh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return Nt(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 un.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(f=>f.permissions.some(({link:d})=>!d)).map(f=>ee.buildOutgoingShareResource({driveItem:f,user:n.user,serverUrl:i.serverUrl}));s.initResourceList({currentFolder:null,resources:l})})}}class Cn{}Ee(Cn,"Shared","S"),Ee(Cn,"Shareable","R"),Ee(Cn,"Mounted","M"),Ee(Cn,"Deletable","D"),Ee(Cn,"Renameable","N"),Ee(Cn,"Moveable","V"),Ee(Cn,"Updateable","NV"),Ee(Cn,"FileUpdateable","W"),Ee(Cn,"FolderCreateable","CK"),Ee(Cn,"Deny","Z"),Ee(Cn,"SecureView","X");const bs=e=>({value:e,type:null}),TA=e=>bs(e),dt=e=>bs(e),Gl=e=>bs(e),AA=e=>bs(e),RA={Permissions:dt("permissions"),IsFavorite:Gl("favorite"),FileId:dt("fileid"),FileParent:dt("file-parent"),Name:dt("name"),OwnerId:dt("owner-id"),OwnerDisplayName:dt("owner-display-name"),PrivateLink:dt("privatelink"),ContentLength:Gl("getcontentlength"),ContentSize:Gl("size"),LastModifiedDate:dt("getlastmodified"),Tags:TA("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:dt("getetag"),MimeType:dt("getcontenttype"),ResourceType:AA("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:dt("owner"),LockTime:dt("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:dt("downloadURL"),Highlights:dt("highlights"),MetaPathForUser:dt("meta-path-for-user"),RemoteItemId:dt("remote-item-id"),ShareId:dt("shareid"),ShareRoot:dt("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:dt("share-permissions"),TrashbinOriginalFilename:dt("trashbin-original-filename"),TrashbinOriginalLocation:dt("trashbin-original-location"),TrashbinDeletedDate:dt("trashbin-delete-datetime"),PublicLinkItemType:dt("public-link-item-type"),PublicLinkPermission:dt("public-link-permission"),PublicLinkExpiration:dt("public-link-expiration"),PublicLinkShareDate:dt("public-link-share-datetime"),PublicLinkShareOwner:dt("public-link-share-owner")},qe=Object.fromEntries(Object.entries(RA).map(([e,t])=>[e,t.value])),ci=class ci{};Ee(ci,"Default",[qe.Permissions,qe.IsFavorite,qe.FileId,qe.FileParent,qe.Name,qe.LockDiscovery,qe.ActiveLock,qe.OwnerId,qe.OwnerDisplayName,qe.RemoteItemId,qe.ShareRoot,qe.ShareTypes,qe.PrivateLink,qe.ContentLength,qe.ContentSize,qe.LastModifiedDate,qe.ETag,qe.MimeType,qe.ResourceType,qe.DownloadURL,qe.Tags,qe.Audio,qe.Location,qe.Image,qe.Photo]),Ee(ci,"PublicLink",ci.Default.concat([qe.PublicLinkItemType,qe.PublicLinkPermission,qe.PublicLinkExpiration,qe.PublicLinkShareDate,qe.PublicLinkShareOwner])),Ee(ci,"Trashbin",[qe.ContentLength,qe.ResourceType,qe.TrashbinOriginalLocation,qe.TrashbinOriginalFilename,qe.TrashbinDeletedDate,qe.Permissions,qe.FileParent]),Ee(ci,"DavNamespace",[qe.ContentLength,qe.LastModifiedDate,qe.ETag,qe.MimeType,qe.ResourceType,qe.LockDiscovery,qe.ActiveLock]);let vs=ci;var Kl={},ws={exports:{}},Hh;function Ql(){if(Hh)return ws.exports;Hh=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(S,E,R){return Function.prototype.apply.call(S,E,R)},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(y){console&&console.warn&&console.warn(y)}var o=Number.isNaN||function(S){return S!==S};function i(){i.init.call(this)}ws.exports=i,ws.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(y){if(typeof y!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof y)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(y){if(typeof y!="number"||y<0||o(y))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+y+".");s=y}}),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(y){return y._maxListeners===void 0?i.defaultMaxListeners:y._maxListeners}i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(S){for(var E=[],R=1;R<arguments.length;R++)E.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 $;if(E.length>0&&($=E[0]),$ instanceof Error)throw $;var D=new Error("Unhandled error."+($?" ("+$.message+")":""));throw D.context=$,D}var k=A[S];if(k===void 0)return!1;if(typeof k=="function")t(k,this,E);else for(var N=k.length,j=w(k,N),R=0;R<N;++R)t(j[R],this,E);return!0};function u(y,S,E,R){var I,A,$;if(a(E),A=y._events,A===void 0?(A=y._events=Object.create(null),y._eventsCount=0):(A.newListener!==void 0&&(y.emit("newListener",S,E.listener?E.listener:E),A=y._events),$=A[S]),$===void 0)$=A[S]=E,++y._eventsCount;else if(typeof $=="function"?$=A[S]=R?[E,$]:[$,E]:R?$.unshift(E):$.push(E),I=c(y),I>0&&$.length>I&&!$.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=y,D.type=S,D.count=$.length,r(D)}return y}i.prototype.addListener=function(S,E){return u(this,S,E,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(S,E){return u(this,S,E,!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 f(y,S,E){var R={fired:!1,wrapFn:void 0,target:y,type:S,listener:E},I=l.bind(R);return I.listener=E,R.wrapFn=I,I}i.prototype.once=function(S,E){return a(E),this.on(S,f(this,S,E)),this},i.prototype.prependOnceListener=function(S,E){return a(E),this.prependListener(S,f(this,S,E)),this},i.prototype.removeListener=function(S,E){var R,I,A,$,D;if(a(E),I=this._events,I===void 0)return this;if(R=I[S],R===void 0)return this;if(R===E||R.listener===E)--this._eventsCount===0?this._events=Object.create(null):(delete I[S],I.removeListener&&this.emit("removeListener",S,R.listener||E));else if(typeof R!="function"){for(A=-1,$=R.length-1;$>=0;$--)if(R[$]===E||R[$].listener===E){D=R[$].listener,A=$;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,D||E)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(S){var E,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),$;for(I=0;I<A.length;++I)$=A[I],$!=="removeListener"&&this.removeAllListeners($);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(E=R[S],typeof E=="function")this.removeListener(S,E);else if(E!==void 0)for(I=E.length-1;I>=0;I--)this.removeListener(S,E[I]);return this};function d(y,S,E){var R=y._events;if(R===void 0)return[];var I=R[S];return I===void 0?[]:typeof I=="function"?E?[I.listener||I]:[I]:E?T(I):w(I,I.length)}i.prototype.listeners=function(S){return d(this,S,!0)},i.prototype.rawListeners=function(S){return d(this,S,!1)},i.listenerCount=function(y,S){return typeof y.listenerCount=="function"?y.listenerCount(S):m.call(y,S)},i.prototype.listenerCount=m;function m(y){var S=this._events;if(S!==void 0){var E=S[y];if(typeof E=="function")return 1;if(E!==void 0)return E.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function w(y,S){for(var E=new Array(S),R=0;R<S;++R)E[R]=y[R];return E}function v(y,S){for(;S+1<y.length;S++)y[S]=y[S+1];y.pop()}function T(y){for(var S=new Array(y.length),E=0;E<S.length;++E)S[E]=y[E].listener||y[E];return S}function b(y,S){return new Promise(function(E,R){function I($){y.removeListener(S,A),R($)}function A(){typeof y.removeListener=="function"&&y.removeListener("error",I),E([].slice.call(arguments))}h(y,S,A,{once:!0}),S!=="error"&&g(y,I,{once:!0})})}function g(y,S,E){typeof y.on=="function"&&h(y,"error",S,E)}function h(y,S,E,R){if(typeof y.on=="function")R.once?y.once(S,E):y.on(S,E);else if(typeof y.addEventListener=="function")y.addEventListener(S,function I(A){R.once&&y.removeEventListener(S,I),E(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof y)}return ws.exports}var Ss={exports:{}},Gh;function Jr(){return Gh||(Gh=1,typeof Object.create=="function"?Ss.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Ss.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}}),Ss.exports}var Xl,Kh;function Qh(){return Kh||(Kh=1,Xl=Ql().EventEmitter),Xl}var Yl={},Xh;function Es(){return Xh||(Xh=1,function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},n={};n.byteLength=l,n.toByteArray=d,n.fromByteArray=v;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 h=g.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=g.indexOf("=");y===-1&&(y=h);var S=y===h?0:4-y%4;return[y,S]}function l(g){var h=u(g),y=h[0],S=h[1];return(y+S)*3/4-S}function f(g,h,y){return(h+y)*3/4-y}function d(g){var h,y=u(g),S=y[0],E=y[1],R=new i(f(g,S,E)),I=0,A=E>0?S-4:S,$;for($=0;$<A;$+=4)h=o[g.charCodeAt($)]<<18|o[g.charCodeAt($+1)]<<12|o[g.charCodeAt($+2)]<<6|o[g.charCodeAt($+3)],R[I++]=h>>16&255,R[I++]=h>>8&255,R[I++]=h&255;return E===2&&(h=o[g.charCodeAt($)]<<2|o[g.charCodeAt($+1)]>>4,R[I++]=h&255),E===1&&(h=o[g.charCodeAt($)]<<10|o[g.charCodeAt($+1)]<<4|o[g.charCodeAt($+2)]>>2,R[I++]=h>>8&255,R[I++]=h&255),R}function m(g){return r[g>>18&63]+r[g>>12&63]+r[g>>6&63]+r[g&63]}function w(g,h,y){for(var S,E=[],R=h;R<y;R+=3)S=(g[R]<<16&16711680)+(g[R+1]<<8&65280)+(g[R+2]&255),E.push(m(S));return E.join("")}function v(g){for(var h,y=g.length,S=y%3,E=[],R=16383,I=0,A=y-S;I<A;I+=R)E.push(w(g,I,I+R>A?A:I+R));return S===1?(h=g[y-1],E.push(r[h>>2]+r[h<<4&63]+"==")):S===2&&(h=(g[y-2]<<8)+g[y-1],E.push(r[h>>10]+r[h>>4&63]+r[h<<2&63]+"=")),E.join("")}var T={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */T.read=function(g,h,y,S,E){var R,I,A=E*8-S-1,$=(1<<A)-1,D=$>>1,k=-7,N=y?E-1:0,j=y?-1:1,W=g[h+N];for(N+=j,R=W&(1<<-k)-1,W>>=-k,k+=A;k>0;R=R*256+g[h+N],N+=j,k-=8);for(I=R&(1<<-k)-1,R>>=-k,k+=S;k>0;I=I*256+g[h+N],N+=j,k-=8);if(R===0)R=1-D;else{if(R===$)return I?NaN:(W?-1:1)*(1/0);I=I+Math.pow(2,S),R=R-D}return(W?-1:1)*I*Math.pow(2,R-S)},T.write=function(g,h,y,S,E,R){var I,A,$,D=R*8-E-1,k=(1<<D)-1,N=k>>1,j=E===23?Math.pow(2,-24)-Math.pow(2,-77):0,W=S?0:R-1,X=S?1:-1,ie=h<0||h===0&&1/h<0?1:0;for(h=Math.abs(h),isNaN(h)||h===1/0?(A=isNaN(h)?1:0,I=k):(I=Math.floor(Math.log(h)/Math.LN2),h*($=Math.pow(2,-I))<1&&(I--,$*=2),I+N>=1?h+=j/$:h+=j*Math.pow(2,1-N),h*$>=2&&(I++,$/=2),I+N>=k?(A=0,I=k):I+N>=1?(A=(h*$-1)*Math.pow(2,E),I=I+N):(A=h*Math.pow(2,N-1)*Math.pow(2,E),I=0));E>=8;g[y+W]=A&255,W+=X,A/=256,E-=8);for(I=I<<E|A,D+=E;D>0;g[y+W]=I&255,W+=X,I/=256,D-=8);g[y+W-X]|=ie*128};/*!
11
+ */(function(e){const t=ms,n=Pl,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 M=new i(1),C={foo:function(){return 42}};return Object.setPrototypeOf(C,i.prototype),Object.setPrototypeOf(M,C),M.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(M){if(M>o)throw new RangeError('The value "'+M+'" is invalid for option "size"');const C=new i(M);return Object.setPrototypeOf(C,l.prototype),C}function l(M,C,O){if(typeof M=="number"){if(typeof C=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(M)}return f(M,C,O)}l.poolSize=8192;function f(M,C,O){if(typeof M=="string")return b(M,C);if(s.isView(M))return v(M);if(M==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof M);if(ct(M,s)||M&&ct(M.buffer,s)||typeof a<"u"&&(ct(M,a)||M&&ct(M.buffer,a)))return g(M,C,O);if(typeof M=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const H=M.valueOf&&M.valueOf();if(H!=null&&H!==M)return l.from(H,C,O);const te=h(M);if(te)return te;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof M[Symbol.toPrimitive]=="function")return l.from(M[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 M)}l.from=function(M,C,O){return f(M,C,O)},Object.setPrototypeOf(l.prototype,i.prototype),Object.setPrototypeOf(l,i);function d(M){if(typeof M!="number")throw new TypeError('"size" argument must be of type number');if(M<0)throw new RangeError('The value "'+M+'" is invalid for option "size"')}function m(M,C,O){return d(M),M<=0?u(M):C!==void 0?typeof O=="string"?u(M).fill(C,O):u(M).fill(C):u(M)}l.alloc=function(M,C,O){return m(M,C,O)};function w(M){return d(M),u(M<0?0:y(M)|0)}l.allocUnsafe=function(M){return w(M)},l.allocUnsafeSlow=function(M){return w(M)};function b(M,C){if((typeof C!="string"||C==="")&&(C="utf8"),!l.isEncoding(C))throw new TypeError("Unknown encoding: "+C);const O=E(M,C)|0;let H=u(O);const te=H.write(M,C);return te!==O&&(H=H.slice(0,te)),H}function T(M){const C=M.length<0?0:y(M.length)|0,O=u(C);for(let H=0;H<C;H+=1)O[H]=M[H]&255;return O}function v(M){if(ct(M,i)){const C=new i(M);return g(C.buffer,C.byteOffset,C.byteLength)}return T(M)}function g(M,C,O){if(C<0||M.byteLength<C)throw new RangeError('"offset" is outside of buffer bounds');if(M.byteLength<C+(O||0))throw new RangeError('"length" is outside of buffer bounds');let H;return C===void 0&&O===void 0?H=new i(M):O===void 0?H=new i(M,C):H=new i(M,C,O),Object.setPrototypeOf(H,l.prototype),H}function h(M){if(l.isBuffer(M)){const C=y(M.length)|0,O=u(C);return O.length===0||M.copy(O,0,0,C),O}if(M.length!==void 0)return typeof M.length!="number"||Qt(M.length)?u(0):T(M);if(M.type==="Buffer"&&Array.isArray(M.data))return T(M.data)}function y(M){if(M>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return M|0}function S(M){return+M!=M&&(M=0),l.alloc(+M)}l.isBuffer=function(C){return C!=null&&C._isBuffer===!0&&C!==l.prototype},l.compare=function(C,O){if(ct(C,i)&&(C=l.from(C,C.offset,C.byteLength)),ct(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 H=C.length,te=O.length;for(let de=0,Ae=Math.min(H,te);de<Ae;++de)if(C[de]!==O[de]){H=C[de],te=O[de];break}return H<te?-1:te<H?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 H;if(O===void 0)for(O=0,H=0;H<C.length;++H)O+=C[H].length;const te=l.allocUnsafe(O);let de=0;for(H=0;H<C.length;++H){let Ae=C[H];if(ct(Ae,i))de+Ae.length>te.length?(l.isBuffer(Ae)||(Ae=l.from(Ae)),Ae.copy(te,de)):i.prototype.set.call(te,Ae,de);else if(l.isBuffer(Ae))Ae.copy(te,de);else throw new TypeError('"list" argument must be an Array of Buffers');de+=Ae.length}return te};function E(M,C){if(l.isBuffer(M))return M.length;if(s.isView(M)||ct(M,s))return M.byteLength;if(typeof M!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof M);const O=M.length,H=arguments.length>2&&arguments[2]===!0;if(!H&&O===0)return 0;let te=!1;for(;;)switch(C){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return le(M).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return Je(M).length;default:if(te)return H?-1:le(M).length;C=(""+C).toLowerCase(),te=!0}}l.byteLength=E;function R(M,C,O){let H=!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(M||(M="utf8");;)switch(M){case"hex":return Z(this,C,O);case"utf8":case"utf-8":return se(this,C,O);case"ascii":return fe(this,C,O);case"latin1":case"binary":return we(this,C,O);case"base64":return X(this,C,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,C,O);default:if(H)throw new TypeError("Unknown encoding: "+M);M=(M+"").toLowerCase(),H=!0}}l.prototype._isBuffer=!0;function I(M,C,O){const H=M[C];M[C]=M[O],M[O]=H}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)I(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)I(this,O,O+3),I(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)I(this,O,O+7),I(this,O+1,O+6),I(this,O+2,O+5),I(this,O+3,O+4);return this},l.prototype.toString=function(){const C=this.length;return C===0?"":arguments.length===0?se(this,0,C):R.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,H,te,de){if(ct(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),H===void 0&&(H=C?C.length:0),te===void 0&&(te=0),de===void 0&&(de=this.length),O<0||H>C.length||te<0||de>this.length)throw new RangeError("out of range index");if(te>=de&&O>=H)return 0;if(te>=de)return-1;if(O>=H)return 1;if(O>>>=0,H>>>=0,te>>>=0,de>>>=0,this===C)return 0;let Ae=de-te,Ze=H-O;const ft=Math.min(Ae,Ze),Pe=this.slice(te,de),je=C.slice(O,H);for(let We=0;We<ft;++We)if(Pe[We]!==je[We]){Ae=Pe[We],Ze=je[We];break}return Ae<Ze?-1:Ze<Ae?1:0};function A(M,C,O,H,te){if(M.length===0)return-1;if(typeof O=="string"?(H=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,Qt(O)&&(O=te?0:M.length-1),O<0&&(O=M.length+O),O>=M.length){if(te)return-1;O=M.length-1}else if(O<0)if(te)O=0;else return-1;if(typeof C=="string"&&(C=l.from(C,H)),l.isBuffer(C))return C.length===0?-1:$(M,C,O,H,te);if(typeof C=="number")return C=C&255,typeof i.prototype.indexOf=="function"?te?i.prototype.indexOf.call(M,C,O):i.prototype.lastIndexOf.call(M,C,O):$(M,[C],O,H,te);throw new TypeError("val must be string, number or Buffer")}function $(M,C,O,H,te){let de=1,Ae=M.length,Ze=C.length;if(H!==void 0&&(H=String(H).toLowerCase(),H==="ucs2"||H==="ucs-2"||H==="utf16le"||H==="utf-16le")){if(M.length<2||C.length<2)return-1;de=2,Ae/=2,Ze/=2,O/=2}function ft(je,We){return de===1?je[We]:je.readUInt16BE(We*de)}let Pe;if(te){let je=-1;for(Pe=O;Pe<Ae;Pe++)if(ft(M,Pe)===ft(C,je===-1?0:Pe-je)){if(je===-1&&(je=Pe),Pe-je+1===Ze)return je*de}else je!==-1&&(Pe-=Pe-je),je=-1}else for(O+Ze>Ae&&(O=Ae-Ze),Pe=O;Pe>=0;Pe--){let je=!0;for(let We=0;We<Ze;We++)if(ft(M,Pe+We)!==ft(C,We)){je=!1;break}if(je)return Pe}return-1}l.prototype.includes=function(C,O,H){return this.indexOf(C,O,H)!==-1},l.prototype.indexOf=function(C,O,H){return A(this,C,O,H,!0)},l.prototype.lastIndexOf=function(C,O,H){return A(this,C,O,H,!1)};function D(M,C,O,H){O=Number(O)||0;const te=M.length-O;H?(H=Number(H),H>te&&(H=te)):H=te;const de=C.length;H>de/2&&(H=de/2);let Ae;for(Ae=0;Ae<H;++Ae){const Ze=parseInt(C.substr(Ae*2,2),16);if(Qt(Ze))return Ae;M[O+Ae]=Ze}return Ae}function k(M,C,O,H){return ut(le(C,M.length-O),M,O,H)}function N(M,C,O,H){return ut($e(C),M,O,H)}function z(M,C,O,H){return ut(Je(C),M,O,H)}function G(M,C,O,H){return ut(De(C,M.length-O),M,O,H)}l.prototype.write=function(C,O,H,te){if(O===void 0)te="utf8",H=this.length,O=0;else if(H===void 0&&typeof O=="string")te=O,H=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(H)?(H=H>>>0,te===void 0&&(te="utf8")):(te=H,H=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const de=this.length-O;if((H===void 0||H>de)&&(H=de),C.length>0&&(H<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");te||(te="utf8");let Ae=!1;for(;;)switch(te){case"hex":return D(this,C,O,H);case"utf8":case"utf-8":return k(this,C,O,H);case"ascii":case"latin1":case"binary":return N(this,C,O,H);case"base64":return z(this,C,O,H);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,C,O,H);default:if(Ae)throw new TypeError("Unknown encoding: "+te);te=(""+te).toLowerCase(),Ae=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function X(M,C,O){return C===0&&O===M.length?t.fromByteArray(M):t.fromByteArray(M.slice(C,O))}function se(M,C,O){O=Math.min(M.length,O);const H=[];let te=C;for(;te<O;){const de=M[te];let Ae=null,Ze=de>239?4:de>223?3:de>191?2:1;if(te+Ze<=O){let ft,Pe,je,We;switch(Ze){case 1:de<128&&(Ae=de);break;case 2:ft=M[te+1],(ft&192)===128&&(We=(de&31)<<6|ft&63,We>127&&(Ae=We));break;case 3:ft=M[te+1],Pe=M[te+2],(ft&192)===128&&(Pe&192)===128&&(We=(de&15)<<12|(ft&63)<<6|Pe&63,We>2047&&(We<55296||We>57343)&&(Ae=We));break;case 4:ft=M[te+1],Pe=M[te+2],je=M[te+3],(ft&192)===128&&(Pe&192)===128&&(je&192)===128&&(We=(de&15)<<18|(ft&63)<<12|(Pe&63)<<6|je&63,We>65535&&We<1114112&&(Ae=We))}}Ae===null?(Ae=65533,Ze=1):Ae>65535&&(Ae-=65536,H.push(Ae>>>10&1023|55296),Ae=56320|Ae&1023),H.push(Ae),te+=Ze}return oe(H)}const ne=4096;function oe(M){const C=M.length;if(C<=ne)return String.fromCharCode.apply(String,M);let O="",H=0;for(;H<C;)O+=String.fromCharCode.apply(String,M.slice(H,H+=ne));return O}function fe(M,C,O){let H="";O=Math.min(M.length,O);for(let te=C;te<O;++te)H+=String.fromCharCode(M[te]&127);return H}function we(M,C,O){let H="";O=Math.min(M.length,O);for(let te=C;te<O;++te)H+=String.fromCharCode(M[te]);return H}function Z(M,C,O){const H=M.length;(!C||C<0)&&(C=0),(!O||O<0||O>H)&&(O=H);let te="";for(let de=C;de<O;++de)te+=Xt[M[de]];return te}function re(M,C,O){const H=M.slice(C,O);let te="";for(let de=0;de<H.length-1;de+=2)te+=String.fromCharCode(H[de]+H[de+1]*256);return te}l.prototype.slice=function(C,O){const H=this.length;C=~~C,O=O===void 0?H:~~O,C<0?(C+=H,C<0&&(C=0)):C>H&&(C=H),O<0?(O+=H,O<0&&(O=0)):O>H&&(O=H),O<C&&(O=C);const te=this.subarray(C,O);return Object.setPrototypeOf(te,l.prototype),te};function ce(M,C,O){if(M%1!==0||M<0)throw new RangeError("offset is not uint");if(M+C>O)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUintLE=l.prototype.readUIntLE=function(C,O,H){C=C>>>0,O=O>>>0,H||ce(C,O,this.length);let te=this[C],de=1,Ae=0;for(;++Ae<O&&(de*=256);)te+=this[C+Ae]*de;return te},l.prototype.readUintBE=l.prototype.readUIntBE=function(C,O,H){C=C>>>0,O=O>>>0,H||ce(C,O,this.length);let te=this[C+--O],de=1;for(;O>0&&(de*=256);)te+=this[C+--O]*de;return te},l.prototype.readUint8=l.prototype.readUInt8=function(C,O){return C=C>>>0,O||ce(C,1,this.length),this[C]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(C,O){return C=C>>>0,O||ce(C,2,this.length),this[C]|this[C+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(C,O){return C=C>>>0,O||ce(C,2,this.length),this[C]<<8|this[C+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(C,O){return C=C>>>0,O||ce(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||ce(C,4,this.length),this[C]*16777216+(this[C+1]<<16|this[C+2]<<8|this[C+3])},l.prototype.readBigUInt64LE=Ft(function(C){C=C>>>0,ke(C,"offset");const O=this[C],H=this[C+7];(O===void 0||H===void 0)&&Fe(C,this.length-8);const te=O+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24,de=this[++C]+this[++C]*2**8+this[++C]*2**16+H*2**24;return BigInt(te)+(BigInt(de)<<BigInt(32))}),l.prototype.readBigUInt64BE=Ft(function(C){C=C>>>0,ke(C,"offset");const O=this[C],H=this[C+7];(O===void 0||H===void 0)&&Fe(C,this.length-8);const te=O*2**24+this[++C]*2**16+this[++C]*2**8+this[++C],de=this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+H;return(BigInt(te)<<BigInt(32))+BigInt(de)}),l.prototype.readIntLE=function(C,O,H){C=C>>>0,O=O>>>0,H||ce(C,O,this.length);let te=this[C],de=1,Ae=0;for(;++Ae<O&&(de*=256);)te+=this[C+Ae]*de;return de*=128,te>=de&&(te-=Math.pow(2,8*O)),te},l.prototype.readIntBE=function(C,O,H){C=C>>>0,O=O>>>0,H||ce(C,O,this.length);let te=O,de=1,Ae=this[C+--te];for(;te>0&&(de*=256);)Ae+=this[C+--te]*de;return de*=128,Ae>=de&&(Ae-=Math.pow(2,8*O)),Ae},l.prototype.readInt8=function(C,O){return C=C>>>0,O||ce(C,1,this.length),this[C]&128?(255-this[C]+1)*-1:this[C]},l.prototype.readInt16LE=function(C,O){C=C>>>0,O||ce(C,2,this.length);const H=this[C]|this[C+1]<<8;return H&32768?H|4294901760:H},l.prototype.readInt16BE=function(C,O){C=C>>>0,O||ce(C,2,this.length);const H=this[C+1]|this[C]<<8;return H&32768?H|4294901760:H},l.prototype.readInt32LE=function(C,O){return C=C>>>0,O||ce(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||ce(C,4,this.length),this[C]<<24|this[C+1]<<16|this[C+2]<<8|this[C+3]},l.prototype.readBigInt64LE=Ft(function(C){C=C>>>0,ke(C,"offset");const O=this[C],H=this[C+7];(O===void 0||H===void 0)&&Fe(C,this.length-8);const te=this[C+4]+this[C+5]*2**8+this[C+6]*2**16+(H<<24);return(BigInt(te)<<BigInt(32))+BigInt(O+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24)}),l.prototype.readBigInt64BE=Ft(function(C){C=C>>>0,ke(C,"offset");const O=this[C],H=this[C+7];(O===void 0||H===void 0)&&Fe(C,this.length-8);const te=(O<<24)+this[++C]*2**16+this[++C]*2**8+this[++C];return(BigInt(te)<<BigInt(32))+BigInt(this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+H)}),l.prototype.readFloatLE=function(C,O){return C=C>>>0,O||ce(C,4,this.length),n.read(this,C,!0,23,4)},l.prototype.readFloatBE=function(C,O){return C=C>>>0,O||ce(C,4,this.length),n.read(this,C,!1,23,4)},l.prototype.readDoubleLE=function(C,O){return C=C>>>0,O||ce(C,8,this.length),n.read(this,C,!0,52,8)},l.prototype.readDoubleBE=function(C,O){return C=C>>>0,O||ce(C,8,this.length),n.read(this,C,!1,52,8)};function Ie(M,C,O,H,te,de){if(!l.isBuffer(M))throw new TypeError('"buffer" argument must be a Buffer instance');if(C>te||C<de)throw new RangeError('"value" argument is out of bounds');if(O+H>M.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(C,O,H,te){if(C=+C,O=O>>>0,H=H>>>0,!te){const Ze=Math.pow(2,8*H)-1;Ie(this,C,O,H,Ze,0)}let de=1,Ae=0;for(this[O]=C&255;++Ae<H&&(de*=256);)this[O+Ae]=C/de&255;return O+H},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(C,O,H,te){if(C=+C,O=O>>>0,H=H>>>0,!te){const Ze=Math.pow(2,8*H)-1;Ie(this,C,O,H,Ze,0)}let de=H-1,Ae=1;for(this[O+de]=C&255;--de>=0&&(Ae*=256);)this[O+de]=C/Ae&255;return O+H},l.prototype.writeUint8=l.prototype.writeUInt8=function(C,O,H){return C=+C,O=O>>>0,H||Ie(this,C,O,1,255,0),this[O]=C&255,O+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(C,O,H){return C=+C,O=O>>>0,H||Ie(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,H){return C=+C,O=O>>>0,H||Ie(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,H){return C=+C,O=O>>>0,H||Ie(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,H){return C=+C,O=O>>>0,H||Ie(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 Y(M,C,O,H,te){Le(C,H,te,M,O,7);let de=Number(C&BigInt(4294967295));M[O++]=de,de=de>>8,M[O++]=de,de=de>>8,M[O++]=de,de=de>>8,M[O++]=de;let Ae=Number(C>>BigInt(32)&BigInt(4294967295));return M[O++]=Ae,Ae=Ae>>8,M[O++]=Ae,Ae=Ae>>8,M[O++]=Ae,Ae=Ae>>8,M[O++]=Ae,O}function _(M,C,O,H,te){Le(C,H,te,M,O,7);let de=Number(C&BigInt(4294967295));M[O+7]=de,de=de>>8,M[O+6]=de,de=de>>8,M[O+5]=de,de=de>>8,M[O+4]=de;let Ae=Number(C>>BigInt(32)&BigInt(4294967295));return M[O+3]=Ae,Ae=Ae>>8,M[O+2]=Ae,Ae=Ae>>8,M[O+1]=Ae,Ae=Ae>>8,M[O]=Ae,O+8}l.prototype.writeBigUInt64LE=Ft(function(C,O=0){return Y(this,C,O,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=Ft(function(C,O=0){return _(this,C,O,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(C,O,H,te){if(C=+C,O=O>>>0,!te){const ft=Math.pow(2,8*H-1);Ie(this,C,O,H,ft-1,-ft)}let de=0,Ae=1,Ze=0;for(this[O]=C&255;++de<H&&(Ae*=256);)C<0&&Ze===0&&this[O+de-1]!==0&&(Ze=1),this[O+de]=(C/Ae>>0)-Ze&255;return O+H},l.prototype.writeIntBE=function(C,O,H,te){if(C=+C,O=O>>>0,!te){const ft=Math.pow(2,8*H-1);Ie(this,C,O,H,ft-1,-ft)}let de=H-1,Ae=1,Ze=0;for(this[O+de]=C&255;--de>=0&&(Ae*=256);)C<0&&Ze===0&&this[O+de+1]!==0&&(Ze=1),this[O+de]=(C/Ae>>0)-Ze&255;return O+H},l.prototype.writeInt8=function(C,O,H){return C=+C,O=O>>>0,H||Ie(this,C,O,1,127,-128),C<0&&(C=255+C+1),this[O]=C&255,O+1},l.prototype.writeInt16LE=function(C,O,H){return C=+C,O=O>>>0,H||Ie(this,C,O,2,32767,-32768),this[O]=C&255,this[O+1]=C>>>8,O+2},l.prototype.writeInt16BE=function(C,O,H){return C=+C,O=O>>>0,H||Ie(this,C,O,2,32767,-32768),this[O]=C>>>8,this[O+1]=C&255,O+2},l.prototype.writeInt32LE=function(C,O,H){return C=+C,O=O>>>0,H||Ie(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,H){return C=+C,O=O>>>0,H||Ie(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=Ft(function(C,O=0){return Y(this,C,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=Ft(function(C,O=0){return _(this,C,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function P(M,C,O,H,te,de){if(O+H>M.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function K(M,C,O,H,te){return C=+C,O=O>>>0,te||P(M,C,O,4),n.write(M,C,O,H,23,4),O+4}l.prototype.writeFloatLE=function(C,O,H){return K(this,C,O,!0,H)},l.prototype.writeFloatBE=function(C,O,H){return K(this,C,O,!1,H)};function V(M,C,O,H,te){return C=+C,O=O>>>0,te||P(M,C,O,8),n.write(M,C,O,H,52,8),O+8}l.prototype.writeDoubleLE=function(C,O,H){return V(this,C,O,!0,H)},l.prototype.writeDoubleBE=function(C,O,H){return V(this,C,O,!1,H)},l.prototype.copy=function(C,O,H,te){if(!l.isBuffer(C))throw new TypeError("argument should be a Buffer");if(H||(H=0),!te&&te!==0&&(te=this.length),O>=C.length&&(O=C.length),O||(O=0),te>0&&te<H&&(te=H),te===H||C.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(H<0||H>=this.length)throw new RangeError("Index out of range");if(te<0)throw new RangeError("sourceEnd out of bounds");te>this.length&&(te=this.length),C.length-O<te-H&&(te=C.length-O+H);const de=te-H;return this===C&&typeof i.prototype.copyWithin=="function"?this.copyWithin(O,H,te):i.prototype.set.call(C,this.subarray(H,te),O),de},l.prototype.fill=function(C,O,H,te){if(typeof C=="string"){if(typeof O=="string"?(te=O,O=0,H=this.length):typeof H=="string"&&(te=H,H=this.length),te!==void 0&&typeof te!="string")throw new TypeError("encoding must be a string");if(typeof te=="string"&&!l.isEncoding(te))throw new TypeError("Unknown encoding: "+te);if(C.length===1){const Ae=C.charCodeAt(0);(te==="utf8"&&Ae<128||te==="latin1")&&(C=Ae)}}else typeof C=="number"?C=C&255:typeof C=="boolean"&&(C=Number(C));if(O<0||this.length<O||this.length<H)throw new RangeError("Out of range index");if(H<=O)return this;O=O>>>0,H=H===void 0?this.length:H>>>0,C||(C=0);let de;if(typeof C=="number")for(de=O;de<H;++de)this[de]=C;else{const Ae=l.isBuffer(C)?C:l.from(C,te),Ze=Ae.length;if(Ze===0)throw new TypeError('The value "'+C+'" is invalid for argument "value"');for(de=0;de<H-O;++de)this[de+O]=Ae[de%Ze]}return this};const B={};function q(M,C,O){B[M]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:C.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${M}]`,this.stack,delete this.name}get code(){return M}set code(te){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:te,writable:!0})}toString(){return`${this.name} [${M}]: ${this.message}`}}}q("ERR_BUFFER_OUT_OF_BOUNDS",function(M){return M?`${M} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),q("ERR_INVALID_ARG_TYPE",function(M,C){return`The "${M}" argument must be of type number. Received type ${typeof C}`},TypeError),q("ERR_OUT_OF_RANGE",function(M,C,O){let H=`The value of "${M}" is out of range.`,te=O;return Number.isInteger(O)&&Math.abs(O)>2**32?te=ue(String(O)):typeof O=="bigint"&&(te=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(te=ue(te)),te+="n"),H+=` It must be ${C}. Received ${te}`,H},RangeError);function ue(M){let C="",O=M.length;const H=M[0]==="-"?1:0;for(;O>=H+4;O-=3)C=`_${M.slice(O-3,O)}${C}`;return`${M.slice(0,O)}${C}`}function Re(M,C,O){ke(C,"offset"),(M[C]===void 0||M[C+O]===void 0)&&Fe(C,M.length-(O+1))}function Le(M,C,O,H,te,de){if(M>O||M<C){const Ae=typeof C=="bigint"?"n":"";let Ze;throw C===0||C===BigInt(0)?Ze=`>= 0${Ae} and < 2${Ae} ** ${(de+1)*8}${Ae}`:Ze=`>= -(2${Ae} ** ${(de+1)*8-1}${Ae}) and < 2 ** ${(de+1)*8-1}${Ae}`,new B.ERR_OUT_OF_RANGE("value",Ze,M)}Re(H,te,de)}function ke(M,C){if(typeof M!="number")throw new B.ERR_INVALID_ARG_TYPE(C,"number",M)}function Fe(M,C,O){throw Math.floor(M)!==M?(ke(M,O),new B.ERR_OUT_OF_RANGE("offset","an integer",M)):C<0?new B.ERR_BUFFER_OUT_OF_BOUNDS:new B.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${C}`,M)}const Be=/[^+/0-9A-Za-z-_]/g;function ge(M){if(M=M.split("=")[0],M=M.trim().replace(Be,""),M.length<2)return"";for(;M.length%4!==0;)M=M+"=";return M}function le(M,C){C=C||1/0;let O;const H=M.length;let te=null;const de=[];for(let Ae=0;Ae<H;++Ae){if(O=M.charCodeAt(Ae),O>55295&&O<57344){if(!te){if(O>56319){(C-=3)>-1&&de.push(239,191,189);continue}else if(Ae+1===H){(C-=3)>-1&&de.push(239,191,189);continue}te=O;continue}if(O<56320){(C-=3)>-1&&de.push(239,191,189),te=O;continue}O=(te-55296<<10|O-56320)+65536}else te&&(C-=3)>-1&&de.push(239,191,189);if(te=null,O<128){if((C-=1)<0)break;de.push(O)}else if(O<2048){if((C-=2)<0)break;de.push(O>>6|192,O&63|128)}else if(O<65536){if((C-=3)<0)break;de.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((C-=4)<0)break;de.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return de}function $e(M){const C=[];for(let O=0;O<M.length;++O)C.push(M.charCodeAt(O)&255);return C}function De(M,C){let O,H,te;const de=[];for(let Ae=0;Ae<M.length&&!((C-=2)<0);++Ae)O=M.charCodeAt(Ae),H=O>>8,te=O%256,de.push(te),de.push(H);return de}function Je(M){return t.toByteArray(ge(M))}function ut(M,C,O,H){let te;for(te=0;te<H&&!(te+O>=C.length||te>=M.length);++te)C[te+O]=M[te];return te}function ct(M,C){return M instanceof C||M!=null&&M.constructor!=null&&M.constructor.name!=null&&M.constructor.name===C.name}function Qt(M){return M!==M}const Xt=function(){const M="0123456789abcdef",C=new Array(256);for(let O=0;O<16;++O){const H=O*16;for(let te=0;te<16;++te)C[H+te]=M[O]+M[te]}return C}();function Ft(M){return typeof BigInt>"u"?Ue:M}function Ue(){throw new Error("BigInt not supported")}})(vh);const yr=vh.Buffer;var Ol,Sh;function Eh(){return Sh||(Sh=1,Ol=typeof be=="object"&&be.env&&be.env.NODE_DEBUG&&/\bsemver\b/i.test(be.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),Ol}var xl,Th;function Ah(){if(Th)return xl;Th=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,o=t-6;return xl={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},xl}var ys={exports:{}},Rh;function zT(){return Rh||(Rh=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:o}=Ah(),i=Eh();t=e.exports={};const s=t.re=[],a=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],l=t.t={};let f=0;const d="[a-zA-Z0-9-]",m=[["\\s",1],["\\d",o],[d,r]],w=T=>{for(const[v,g]of m)T=T.split(`${v}*`).join(`${v}{0,${g}}`).split(`${v}+`).join(`${v}{1,${g}}`);return T},b=(T,v,g)=>{const h=w(v),y=f++;i(T,y,v),l[T]=y,c[y]=v,u[y]=h,s[y]=new RegExp(v,g?"g":void 0),a[y]=new RegExp(h,g?"g":void 0)};b("NUMERICIDENTIFIER","0|[1-9]\\d*"),b("NUMERICIDENTIFIERLOOSE","\\d+"),b("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),b("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),b("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),b("PRERELEASEIDENTIFIER",`(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`),b("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`),b("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),b("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),b("BUILDIDENTIFIER",`${d}+`),b("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),b("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),b("FULL",`^${c[l.FULLPLAIN]}$`),b("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),b("LOOSE",`^${c[l.LOOSEPLAIN]}$`),b("GTLT","((?:<|>)?=?)"),b("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),b("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),b("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),b("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),b("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),b("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),b("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),b("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),b("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`),b("COERCERTL",c[l.COERCE],!0),b("COERCERTLFULL",c[l.COERCEFULL],!0),b("LONETILDE","(?:~>?)"),b("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",b("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),b("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),b("LONECARET","(?:\\^)"),b("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",b("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),b("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),b("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),b("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),b("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",b("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),b("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),b("STAR","(<|>)?=?\\s*\\*"),b("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),b("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(ys,ys.exports)),ys.exports}var kl,_h;function WT(){if(_h)return kl;_h=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return kl=r=>r?typeof r!="object"?e:r:t,kl}var Nl,Ih;function HT(){if(Ih)return Nl;Ih=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 Nl={compareIdentifiers:t,rcompareIdentifiers:(r,o)=>t(o,r)},Nl}var $l,Ch;function Fh(){if(Ch)return $l;Ch=1;const e=Eh(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=Ah(),{safeRe:r,safeSrc:o,t:i}=zT(),s=WT(),{compareIdentifiers:a}=HT();class c{constructor(l,f){if(f=s(f),l instanceof c){if(l.loose===!!f.loose&&l.includePrerelease===!!f.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",l,f),this.options=f,this.loose=!!f.loose,this.includePrerelease=!!f.includePrerelease;const d=l.trim().match(f.loose?r[i.LOOSE]:r[i.FULL]);if(!d)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,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(m=>{if(/^[0-9]+$/.test(m)){const w=+m;if(w>=0&&w<n)return w}return m}):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(l){if(e("SemVer.compare",this.version,this.options,l),!(l instanceof c)){if(typeof l=="string"&&l===this.version)return 0;l=new c(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof c||(l=new c(l,this.options)),a(this.major,l.major)||a(this.minor,l.minor)||a(this.patch,l.patch)}comparePre(l){if(l instanceof c||(l=new c(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let f=0;do{const d=this.prerelease[f],m=l.prerelease[f];if(e("prerelease compare",f,d,m),d===void 0&&m===void 0)return 0;if(m===void 0)return 1;if(d===void 0)return-1;if(d===m)continue;return a(d,m)}while(++f)}compareBuild(l){l instanceof c||(l=new c(l,this.options));let f=0;do{const d=this.build[f],m=l.build[f];if(e("build compare",f,d,m),d===void 0&&m===void 0)return 0;if(m===void 0)return 1;if(d===void 0)return-1;if(d===m)continue;return a(d,m)}while(++f)}inc(l,f,d){if(l.startsWith("pre")){if(!f&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(f){const m=new RegExp(`^${this.options.loose?o[i.PRERELEASELOOSE]:o[i.PRERELEASE]}$`),w=`-${f}`.match(m);if(!w||w[1]!==f)throw new Error(`invalid identifier: ${f}`)}}switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",f,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",f,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",f,d),this.inc("pre",f,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",f,d),this.inc("pre",f,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 m=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[m];else{let w=this.prerelease.length;for(;--w>=0;)typeof this.prerelease[w]=="number"&&(this.prerelease[w]++,w=-2);if(w===-1){if(f===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(m)}}if(f){let w=[f,m];d===!1&&(w=[f]),a(this.prerelease[0],f)===0?isNaN(this.prerelease[1])&&(this.prerelease=w):this.prerelease=w}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return $l=c,$l}var Dl,Ph;function GT(){if(Ph)return Dl;Ph=1;const e=Fh();return Dl=(n,r)=>new e(n,r).major,Dl}var KT=GT();const Oh=Za(KT);var Ll,xh;function QT(){if(xh)return Ll;xh=1;const e=Fh();return Ll=(n,r,o)=>new e(n,o).compare(new e(r,o)),Ll}var Ml,kh;function XT(){if(kh)return Ml;kh=1;const e=QT();return Ml=(n,r,o)=>e(r,n,o),Ml}var YT=XT();const JT=Za(YT);class Ii extends Error{constructor(n,...r){super([n,...r].filter(Boolean).join(", "));Ee(this,"name","RuntimeError");Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class ZT extends Ii{constructor(){super(...arguments);Ee(this,"name","ApiError")}}const Bl=(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 eA{constructor(t,n,r,o=ae([])){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=j(()=>{const i=p(o).filter(s=>s.enabled).sort((s,a)=>JT(s.version,a.version));return i.length?i[0]:null}),this.available=j(()=>{var i;return!!((i=p(this.capability))!=null&&i.version)}),this.fileIdsSupported=j(()=>{var i;return Oh((i=p(this.capability))==null?void 0:i.version)>=2})}async triggerDownload(t){var o,i,s;if(!p(this.available))throw new Ii("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 Ii("requested archive with empty list of resources");const n=this.buildDownloadUrl({...t});if(!n)throw new Ii("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 this.clientService.httpUnAuthenticated.get(r,{headers:{...!!t.publicLinkPassword&&{Authorization:"Basic "+yr.from(["public",t.publicLinkPassword].join(":")).toString("base64")}},responseType:"arraybuffer"}),c=new Blob([a.data],{type:"application/octet-stream"}),u=URL.createObjectURL(c),l=this.getFileNameFromResponseHeaders(a.headers);return Bl(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}`),Oh(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 Ii("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["content-disposition"])==null?void 0:r.split('"')[1];return decodeURI(n)}}const tA=new El({ttl:10*1e3,capacity:250}),nA=new El({ttl:10*1e3,capacity:250});class rA{get avatarUrl(){return nA}get filePreview(){return tA}}const jl=new rA;class Nh{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 "+yr.from(["public",this.publicLinkPassword].join(":")).toString("base64")},...this.accessToken&&!this.publicLinkPassword&&{Authorization:"Bearer "+this.accessToken}}}}class Ul{constructor(t,n){Ee(this,"instance");Ee(this,"cancelToken");this.cancelToken=ko.CancelToken.source(),this.instance=ko.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 ao({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 iA extends Error{constructor(){super(...arguments);Ee(this,"name","RetriableError")}}const oA=15e3;class sA{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 R0.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 iA},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()*oA)}})}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 ql=null;const aA=(e,t)=>(ql||(ql=new sA(new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse",e).href,t)),ql),lA=(e,t)=>({headers:{Authorization:`Bearer ${e.accessToken}`,"Accept-Language":t,"X-Request-ID":Yt.v4(),"X-Requested-With":"XMLHttpRequest"}});class cA{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",Yt.v4());Ee(this,"staticHeaders",{"Initiator-ID":this.initiatorId,"X-Requested-With":"XMLHttpRequest"});this.configStore=t.configStore,this.language=t.language,this.authStore=t.authStore,this.initGraphClient(),this.initOcsClient(),this.initWebDavClient(),this.httpAuthenticatedClient=new Ul({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.httpUnAuthenticatedClient=new Ul({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 aA(this.configStore.serverUrl,lA({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=ko.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=ko.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 "+yr.from(["public",this.authStore.publicLinkPassword].join(":")).toString("base64")),t})}getDynamicHeaders({useAuth:t=!0}={}){return{"Accept-Language":this.currentLanguage,"X-Request-ID":Yt.v4(),...t&&{Authorization:"Bearer "+this.authStore.accessToken}}}}class $h{constructor(){Ee(this,"topics");this.topics=new Map}subscribe(t,n){const r={token:Yt.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 Xe=new $h;var uA=$p(Object.keys,Object),fA=Object.prototype,dA=fA.hasOwnProperty;function Dh(e){if(!fs(e))return uA(e);var t=[];for(var n in Object(e))dA.call(e,n)&&n!="constructor"&&t.push(n);return t}var Vl=Kr(Kn,"DataView"),zl=Kr(Kn,"Promise"),Wl=Kr(Kn,"Set"),Hl=Kr(Kn,"WeakMap"),Lh="[object Map]",pA="[object Object]",Mh="[object Promise]",Bh="[object Set]",jh="[object WeakMap]",Uh="[object DataView]",hA=Gr(Vl),gA=Gr(no),mA=Gr(zl),yA=Gr(Wl),bA=Gr(Hl),$n=Hr;(Vl&&$n(new Vl(new ArrayBuffer(1)))!=Uh||no&&$n(new no)!=Lh||zl&&$n(zl.resolve())!=Mh||Wl&&$n(new Wl)!=Bh||Hl&&$n(new Hl)!=jh)&&($n=function(e){var t=Hr(e),n=t==pA?e.constructor:void 0,r=n?Gr(n):"";if(r)switch(r){case hA:return Uh;case gA:return Lh;case mA:return Mh;case yA:return Bh;case bA:return jh}return t});var vA="[object Map]",wA="[object Set]",SA=Object.prototype,EA=SA.hasOwnProperty;function TA(e){if(e==null)return!0;if(oo(e)&&(On(e)||typeof e=="string"||typeof e.splice=="function"||Si(e)||ds(e)||io(e)))return!e.length;var t=$n(e);if(t==vA||t==wA)return!e.size;if(fs(e))return!Dh(e).length;for(var n in e)if(EA.call(e,n))return!1;return!0}class qh{isEnabled(){return!0}isActive(t){return at(t,"files-spaces-projects")?!1:at(t,"files-spaces-generic")||_n(t,"files-public-link")}getTask(t){const{router:n,clientService:r,resourcesStore:o,userStore:i,authService:s,spacesStore:a,sharesStore:c,configStore:u}=t,{webdav:l,graphAuthenticated:f}=r,{replaceInvalidFileRoute:d}=zs({router:n});return un.useTask(function*(m,w,b,T=null,v=null,g={}){try{o.clearResourceList();let{resource:h,children:y}=yield*ee.call(l.listFiles(b,{path:T,fileId:v},{signal:m}));h.id&&d({space:b,resource:h,path:T,fileId:v});let S;if(T==="/"&&(ee.isShareSpaceResource(b)?(S=yield*ee.call(hs({graphClient:f,spacesStore:a,space:b,signal:m})),S&&(h=ee.buildIncomingShareResource({graphRoles:c.graphRoles,driveItem:S,serverUrl:u.serverUrl}))):!ee.isPersonalSpaceResource(b)&&!ee.isPublicSpaceResource(b)&&(h=b)),yield o.loadAncestorMetaData({folder:h,space:b,client:l,signal:m}),g.loadShares){const E=o.ancestorMetaData;for(const R of y)R.indicators=Eo({space:b,resource:R,ancestorMetaData:E,user:i.user})}ee.isShareSpaceResource(b)&&(y.forEach(E=>E.remoteItemId=b.id),TA(b.members)&&(S||(S=yield*ee.call(hs({graphClient:f,spacesStore:a,space:b,signal:m}))),ah({sharesStore:c,spacesStore:a,userStore:i,space:b,sharedDriveItem:S}))),o.initResourceList({currentFolder:h,resources:y})}catch(h){if(o.setCurrentFolder(null),console.error(h),h.statusCode===401)return s.handleAuthError(p(n.currentRoute))}}).restartable()}}class Vh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return At(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 un.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 zh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return Nt(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 un.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(f=>f.permissions.some(({link:d})=>!!d)).map(f=>ee.buildOutgoingShareResource({driveItem:f,user:n.user,serverUrl:i.serverUrl}));s.initResourceList({currentFolder:null,resources:l})})}}class Wh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return Nt(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 un.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(f=>ee.buildIncomingShareResource({driveItem:f,graphRoles:s.graphRoles,serverUrl:o.serverUrl}));i.initResourceList({currentFolder:null,resources:l})})}}class Hh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return Nt(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 un.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(f=>f.permissions.some(({link:d})=>!d)).map(f=>ee.buildOutgoingShareResource({driveItem:f,user:n.user,serverUrl:i.serverUrl}));s.initResourceList({currentFolder:null,resources:l})})}}class Cn{}Ee(Cn,"Shared","S"),Ee(Cn,"Shareable","R"),Ee(Cn,"Mounted","M"),Ee(Cn,"Deletable","D"),Ee(Cn,"Renameable","N"),Ee(Cn,"Moveable","V"),Ee(Cn,"Updateable","NV"),Ee(Cn,"FileUpdateable","W"),Ee(Cn,"FolderCreateable","CK"),Ee(Cn,"Deny","Z"),Ee(Cn,"SecureView","X");const bs=e=>({value:e,type:null}),AA=e=>bs(e),dt=e=>bs(e),Gl=e=>bs(e),RA=e=>bs(e),_A={Permissions:dt("permissions"),IsFavorite:Gl("favorite"),FileId:dt("fileid"),FileParent:dt("file-parent"),Name:dt("name"),OwnerId:dt("owner-id"),OwnerDisplayName:dt("owner-display-name"),PrivateLink:dt("privatelink"),ContentLength:Gl("getcontentlength"),ContentSize:Gl("size"),LastModifiedDate:dt("getlastmodified"),Tags:AA("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:dt("getetag"),MimeType:dt("getcontenttype"),ResourceType:RA("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:dt("owner"),LockTime:dt("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:dt("downloadURL"),Highlights:dt("highlights"),MetaPathForUser:dt("meta-path-for-user"),RemoteItemId:dt("remote-item-id"),ShareId:dt("shareid"),ShareRoot:dt("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:dt("share-permissions"),TrashbinOriginalFilename:dt("trashbin-original-filename"),TrashbinOriginalLocation:dt("trashbin-original-location"),TrashbinDeletedDate:dt("trashbin-delete-datetime"),PublicLinkItemType:dt("public-link-item-type"),PublicLinkPermission:dt("public-link-permission"),PublicLinkExpiration:dt("public-link-expiration"),PublicLinkShareDate:dt("public-link-share-datetime"),PublicLinkShareOwner:dt("public-link-share-owner")},qe=Object.fromEntries(Object.entries(_A).map(([e,t])=>[e,t.value])),ci=class ci{};Ee(ci,"Default",[qe.Permissions,qe.IsFavorite,qe.FileId,qe.FileParent,qe.Name,qe.LockDiscovery,qe.ActiveLock,qe.OwnerId,qe.OwnerDisplayName,qe.RemoteItemId,qe.ShareRoot,qe.ShareTypes,qe.PrivateLink,qe.ContentLength,qe.ContentSize,qe.LastModifiedDate,qe.ETag,qe.MimeType,qe.ResourceType,qe.DownloadURL,qe.Tags,qe.Audio,qe.Location,qe.Image,qe.Photo]),Ee(ci,"PublicLink",ci.Default.concat([qe.PublicLinkItemType,qe.PublicLinkPermission,qe.PublicLinkExpiration,qe.PublicLinkShareDate,qe.PublicLinkShareOwner])),Ee(ci,"Trashbin",[qe.ContentLength,qe.ResourceType,qe.TrashbinOriginalLocation,qe.TrashbinOriginalFilename,qe.TrashbinDeletedDate,qe.Permissions,qe.FileParent]),Ee(ci,"DavNamespace",[qe.ContentLength,qe.LastModifiedDate,qe.ETag,qe.MimeType,qe.ResourceType,qe.LockDiscovery,qe.ActiveLock]);let vs=ci;var Kl={},ws={exports:{}},Gh;function Ql(){if(Gh)return ws.exports;Gh=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(S,E,R){return Function.prototype.apply.call(S,E,R)},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(y){console&&console.warn&&console.warn(y)}var o=Number.isNaN||function(S){return S!==S};function i(){i.init.call(this)}ws.exports=i,ws.exports.once=v,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(y){if(typeof y!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof y)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(y){if(typeof y!="number"||y<0||o(y))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+y+".");s=y}}),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(y){return y._maxListeners===void 0?i.defaultMaxListeners:y._maxListeners}i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(S){for(var E=[],R=1;R<arguments.length;R++)E.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 $;if(E.length>0&&($=E[0]),$ instanceof Error)throw $;var D=new Error("Unhandled error."+($?" ("+$.message+")":""));throw D.context=$,D}var k=A[S];if(k===void 0)return!1;if(typeof k=="function")t(k,this,E);else for(var N=k.length,z=w(k,N),R=0;R<N;++R)t(z[R],this,E);return!0};function u(y,S,E,R){var I,A,$;if(a(E),A=y._events,A===void 0?(A=y._events=Object.create(null),y._eventsCount=0):(A.newListener!==void 0&&(y.emit("newListener",S,E.listener?E.listener:E),A=y._events),$=A[S]),$===void 0)$=A[S]=E,++y._eventsCount;else if(typeof $=="function"?$=A[S]=R?[E,$]:[$,E]:R?$.unshift(E):$.push(E),I=c(y),I>0&&$.length>I&&!$.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=y,D.type=S,D.count=$.length,r(D)}return y}i.prototype.addListener=function(S,E){return u(this,S,E,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(S,E){return u(this,S,E,!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 f(y,S,E){var R={fired:!1,wrapFn:void 0,target:y,type:S,listener:E},I=l.bind(R);return I.listener=E,R.wrapFn=I,I}i.prototype.once=function(S,E){return a(E),this.on(S,f(this,S,E)),this},i.prototype.prependOnceListener=function(S,E){return a(E),this.prependListener(S,f(this,S,E)),this},i.prototype.removeListener=function(S,E){var R,I,A,$,D;if(a(E),I=this._events,I===void 0)return this;if(R=I[S],R===void 0)return this;if(R===E||R.listener===E)--this._eventsCount===0?this._events=Object.create(null):(delete I[S],I.removeListener&&this.emit("removeListener",S,R.listener||E));else if(typeof R!="function"){for(A=-1,$=R.length-1;$>=0;$--)if(R[$]===E||R[$].listener===E){D=R[$].listener,A=$;break}if(A<0)return this;A===0?R.shift():b(R,A),R.length===1&&(I[S]=R[0]),I.removeListener!==void 0&&this.emit("removeListener",S,D||E)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(S){var E,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),$;for(I=0;I<A.length;++I)$=A[I],$!=="removeListener"&&this.removeAllListeners($);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(E=R[S],typeof E=="function")this.removeListener(S,E);else if(E!==void 0)for(I=E.length-1;I>=0;I--)this.removeListener(S,E[I]);return this};function d(y,S,E){var R=y._events;if(R===void 0)return[];var I=R[S];return I===void 0?[]:typeof I=="function"?E?[I.listener||I]:[I]:E?T(I):w(I,I.length)}i.prototype.listeners=function(S){return d(this,S,!0)},i.prototype.rawListeners=function(S){return d(this,S,!1)},i.listenerCount=function(y,S){return typeof y.listenerCount=="function"?y.listenerCount(S):m.call(y,S)},i.prototype.listenerCount=m;function m(y){var S=this._events;if(S!==void 0){var E=S[y];if(typeof E=="function")return 1;if(E!==void 0)return E.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function w(y,S){for(var E=new Array(S),R=0;R<S;++R)E[R]=y[R];return E}function b(y,S){for(;S+1<y.length;S++)y[S]=y[S+1];y.pop()}function T(y){for(var S=new Array(y.length),E=0;E<S.length;++E)S[E]=y[E].listener||y[E];return S}function v(y,S){return new Promise(function(E,R){function I($){y.removeListener(S,A),R($)}function A(){typeof y.removeListener=="function"&&y.removeListener("error",I),E([].slice.call(arguments))}h(y,S,A,{once:!0}),S!=="error"&&g(y,I,{once:!0})})}function g(y,S,E){typeof y.on=="function"&&h(y,"error",S,E)}function h(y,S,E,R){if(typeof y.on=="function")R.once?y.once(S,E):y.on(S,E);else if(typeof y.addEventListener=="function")y.addEventListener(S,function I(A){R.once&&y.removeEventListener(S,I),E(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof y)}return ws.exports}var Ss={exports:{}},Kh;function Jr(){return Kh||(Kh=1,typeof Object.create=="function"?Ss.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Ss.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}}),Ss.exports}var Xl,Qh;function Xh(){return Qh||(Qh=1,Xl=Ql().EventEmitter),Xl}var Yl={},Yh;function Es(){return Yh||(Yh=1,function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},n={};n.byteLength=l,n.toByteArray=d,n.fromByteArray=b;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 h=g.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=g.indexOf("=");y===-1&&(y=h);var S=y===h?0:4-y%4;return[y,S]}function l(g){var h=u(g),y=h[0],S=h[1];return(y+S)*3/4-S}function f(g,h,y){return(h+y)*3/4-y}function d(g){var h,y=u(g),S=y[0],E=y[1],R=new i(f(g,S,E)),I=0,A=E>0?S-4:S,$;for($=0;$<A;$+=4)h=o[g.charCodeAt($)]<<18|o[g.charCodeAt($+1)]<<12|o[g.charCodeAt($+2)]<<6|o[g.charCodeAt($+3)],R[I++]=h>>16&255,R[I++]=h>>8&255,R[I++]=h&255;return E===2&&(h=o[g.charCodeAt($)]<<2|o[g.charCodeAt($+1)]>>4,R[I++]=h&255),E===1&&(h=o[g.charCodeAt($)]<<10|o[g.charCodeAt($+1)]<<4|o[g.charCodeAt($+2)]>>2,R[I++]=h>>8&255,R[I++]=h&255),R}function m(g){return r[g>>18&63]+r[g>>12&63]+r[g>>6&63]+r[g&63]}function w(g,h,y){for(var S,E=[],R=h;R<y;R+=3)S=(g[R]<<16&16711680)+(g[R+1]<<8&65280)+(g[R+2]&255),E.push(m(S));return E.join("")}function b(g){for(var h,y=g.length,S=y%3,E=[],R=16383,I=0,A=y-S;I<A;I+=R)E.push(w(g,I,I+R>A?A:I+R));return S===1?(h=g[y-1],E.push(r[h>>2]+r[h<<4&63]+"==")):S===2&&(h=(g[y-2]<<8)+g[y-1],E.push(r[h>>10]+r[h>>4&63]+r[h<<2&63]+"=")),E.join("")}var T={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */T.read=function(g,h,y,S,E){var R,I,A=E*8-S-1,$=(1<<A)-1,D=$>>1,k=-7,N=y?E-1:0,z=y?-1:1,G=g[h+N];for(N+=z,R=G&(1<<-k)-1,G>>=-k,k+=A;k>0;R=R*256+g[h+N],N+=z,k-=8);for(I=R&(1<<-k)-1,R>>=-k,k+=S;k>0;I=I*256+g[h+N],N+=z,k-=8);if(R===0)R=1-D;else{if(R===$)return I?NaN:(G?-1:1)*(1/0);I=I+Math.pow(2,S),R=R-D}return(G?-1:1)*I*Math.pow(2,R-S)},T.write=function(g,h,y,S,E,R){var I,A,$,D=R*8-E-1,k=(1<<D)-1,N=k>>1,z=E===23?Math.pow(2,-24)-Math.pow(2,-77):0,G=S?0:R-1,X=S?1:-1,se=h<0||h===0&&1/h<0?1:0;for(h=Math.abs(h),isNaN(h)||h===1/0?(A=isNaN(h)?1:0,I=k):(I=Math.floor(Math.log(h)/Math.LN2),h*($=Math.pow(2,-I))<1&&(I--,$*=2),I+N>=1?h+=z/$:h+=z*Math.pow(2,1-N),h*$>=2&&(I++,$/=2),I+N>=k?(A=0,I=k):I+N>=1?(A=(h*$-1)*Math.pow(2,E),I=I+N):(A=h*Math.pow(2,N-1)*Math.pow(2,E),I=0));E>=8;g[y+G]=A&255,G+=X,A/=256,E-=8);for(I=I<<E|A,D+=E;D>0;g[y+G]=I&255,G+=X,I/=256,D-=8);g[y+G-X]|=se*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 h=n,y=T,S=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;g.Buffer=k,g.SlowBuffer=ne,g.INSPECT_MAX_BYTES=50;const E=2147483647;g.kMaxLength=E;const{Uint8Array:R,ArrayBuffer:I,SharedArrayBuffer:A}=globalThis;k.TYPED_ARRAY_SUPPORT=$(),!k.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 q=new R(1),P={foo:function(){return 42}};return Object.setPrototypeOf(P,R.prototype),Object.setPrototypeOf(q,P),q.foo()===42}catch{return!1}}Object.defineProperty(k.prototype,"parent",{enumerable:!0,get:function(){if(k.isBuffer(this))return this.buffer}}),Object.defineProperty(k.prototype,"offset",{enumerable:!0,get:function(){if(k.isBuffer(this))return this.byteOffset}});function D(q){if(q>E)throw new RangeError('The value "'+q+'" is invalid for option "size"');const P=new R(q);return Object.setPrototypeOf(P,k.prototype),P}function k(q,P,x){if(typeof q=="number"){if(typeof P=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return X(q)}return N(q,P,x)}k.poolSize=8192;function N(q,P,x){if(typeof q=="string")return ie(q,P);if(I.isView(q))return se(q);if(q==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof q);if(rr(q,I)||q&&rr(q.buffer,I)||typeof A<"u"&&(rr(q,A)||q&&rr(q.buffer,A)))return we(q,P,x);if(typeof q=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Q=q.valueOf&&q.valueOf();if(Q!=null&&Q!==q)return k.from(Q,P,x);const re=Se(q);if(re)return re;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof q[Symbol.toPrimitive]=="function")return k.from(q[Symbol.toPrimitive]("string"),P,x);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof q)}k.from=function(q,P,x){return N(q,P,x)},Object.setPrototypeOf(k.prototype,R.prototype),Object.setPrototypeOf(k,R);function j(q){if(typeof q!="number")throw new TypeError('"size" argument must be of type number');if(q<0)throw new RangeError('The value "'+q+'" is invalid for option "size"')}function W(q,P,x){return j(q),q<=0?D(q):P!==void 0?typeof x=="string"?D(q).fill(P,x):D(q).fill(P):D(q)}k.alloc=function(q,P,x){return W(q,P,x)};function X(q){return j(q),D(q<0?0:Z(q)|0)}k.allocUnsafe=function(q){return X(q)},k.allocUnsafeSlow=function(q){return X(q)};function ie(q,P){if((typeof P!="string"||P==="")&&(P="utf8"),!k.isEncoding(P))throw new TypeError("Unknown encoding: "+P);const x=le(q,P)|0;let Q=D(x);const re=Q.write(q,P);return re!==x&&(Q=Q.slice(0,re)),Q}function de(q){const P=q.length<0?0:Z(q.length)|0,x=D(P);for(let Q=0;Q<P;Q+=1)x[Q]=q[Q]&255;return x}function se(q){if(rr(q,R)){const P=new R(q);return we(P.buffer,P.byteOffset,P.byteLength)}return de(q)}function we(q,P,x){if(P<0||q.byteLength<P)throw new RangeError('"offset" is outside of buffer bounds');if(q.byteLength<P+(x||0))throw new RangeError('"length" is outside of buffer bounds');let Q;return P===void 0&&x===void 0?Q=new R(q):x===void 0?Q=new R(q,P):Q=new R(q,P,x),Object.setPrototypeOf(Q,k.prototype),Q}function Se(q){if(k.isBuffer(q)){const P=Z(q.length)|0,x=D(P);return x.length===0||q.copy(x,0,0,P),x}if(q.length!==void 0)return typeof q.length!="number"||Kf(q.length)?D(0):de(q);if(q.type==="Buffer"&&Array.isArray(q.data))return de(q.data)}function Z(q){if(q>=E)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+E.toString(16)+" bytes");return q|0}function ne(q){return+q!=q&&(q=0),k.alloc(+q)}k.isBuffer=function(P){return P!=null&&P._isBuffer===!0&&P!==k.prototype},k.compare=function(P,x){if(rr(P,R)&&(P=k.from(P,P.offset,P.byteLength)),rr(x,R)&&(x=k.from(x,x.offset,x.byteLength)),!k.isBuffer(P)||!k.isBuffer(x))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(P===x)return 0;let Q=P.length,re=x.length;for(let ge=0,_e=Math.min(Q,re);ge<_e;++ge)if(P[ge]!==x[ge]){Q=P[ge],re=x[ge];break}return Q<re?-1:re<Q?1:0},k.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}},k.concat=function(P,x){if(!Array.isArray(P))throw new TypeError('"list" argument must be an Array of Buffers');if(P.length===0)return k.alloc(0);let Q;if(x===void 0)for(x=0,Q=0;Q<P.length;++Q)x+=P[Q].length;const re=k.allocUnsafe(x);let ge=0;for(Q=0;Q<P.length;++Q){let _e=P[Q];if(rr(_e,R))ge+_e.length>re.length?(k.isBuffer(_e)||(_e=k.from(_e)),_e.copy(re,ge)):R.prototype.set.call(re,_e,ge);else if(k.isBuffer(_e))_e.copy(re,ge);else throw new TypeError('"list" argument must be an Array of Buffers');ge+=_e.length}return re};function le(q,P){if(k.isBuffer(q))return q.length;if(I.isView(q)||rr(q,I))return q.byteLength;if(typeof q!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof q);const x=q.length,Q=arguments.length>2&&arguments[2]===!0;if(!Q&&x===0)return 0;let re=!1;for(;;)switch(P){case"ascii":case"latin1":case"binary":return x;case"utf8":case"utf-8":return ft(q).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x*2;case"hex":return x>>>1;case"base64":return We(q).length;default:if(re)return Q?-1:ft(q).length;P=(""+P).toLowerCase(),re=!0}}k.byteLength=le;function Ie(q,P,x){let Q=!1;if((P===void 0||P<0)&&(P=0),P>this.length||((x===void 0||x>this.length)&&(x=this.length),x<=0)||(x>>>=0,P>>>=0,x<=P))return"";for(q||(q="utf8");;)switch(q){case"hex":return ae(this,P,x);case"utf8":case"utf-8":return Le(this,P,x);case"ascii":return Be(this,P,x);case"latin1":case"binary":return he(this,P,x);case"base64":return Re(this,P,x);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $e(this,P,x);default:if(Q)throw new TypeError("Unknown encoding: "+q);q=(q+"").toLowerCase(),Q=!0}}k.prototype._isBuffer=!0;function Y(q,P,x){const Q=q[P];q[P]=q[x],q[x]=Q}k.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 x=0;x<P;x+=2)Y(this,x,x+1);return this},k.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 x=0;x<P;x+=4)Y(this,x,x+3),Y(this,x+1,x+2);return this},k.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 x=0;x<P;x+=8)Y(this,x,x+7),Y(this,x+1,x+6),Y(this,x+2,x+5),Y(this,x+3,x+4);return this},k.prototype.toString=function(){const P=this.length;return P===0?"":arguments.length===0?Le(this,0,P):Ie.apply(this,arguments)},k.prototype.toLocaleString=k.prototype.toString,k.prototype.equals=function(P){if(!k.isBuffer(P))throw new TypeError("Argument must be a Buffer");return this===P?!0:k.compare(this,P)===0},k.prototype.inspect=function(){let P="";const x=g.INSPECT_MAX_BYTES;return P=this.toString("hex",0,x).replace(/(.{2})/g,"$1 ").trim(),this.length>x&&(P+=" ... "),"<Buffer "+P+">"},S&&(k.prototype[S]=k.prototype.inspect),k.prototype.compare=function(P,x,Q,re,ge){if(rr(P,R)&&(P=k.from(P,P.offset,P.byteLength)),!k.isBuffer(P))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof P);if(x===void 0&&(x=0),Q===void 0&&(Q=P?P.length:0),re===void 0&&(re=0),ge===void 0&&(ge=this.length),x<0||Q>P.length||re<0||ge>this.length)throw new RangeError("out of range index");if(re>=ge&&x>=Q)return 0;if(re>=ge)return-1;if(x>=Q)return 1;if(x>>>=0,Q>>>=0,re>>>=0,ge>>>=0,this===P)return 0;let _e=ge-re,tt=Q-x;const Ft=Math.min(_e,tt),_t=this.slice(re,ge),Ot=P.slice(x,Q);for(let ht=0;ht<Ft;++ht)if(_t[ht]!==Ot[ht]){_e=_t[ht],tt=Ot[ht];break}return _e<tt?-1:tt<_e?1:0};function _(q,P,x,Q,re){if(q.length===0)return-1;if(typeof x=="string"?(Q=x,x=0):x>2147483647?x=2147483647:x<-2147483648&&(x=-2147483648),x=+x,Kf(x)&&(x=re?0:q.length-1),x<0&&(x=q.length+x),x>=q.length){if(re)return-1;x=q.length-1}else if(x<0)if(re)x=0;else return-1;if(typeof P=="string"&&(P=k.from(P,Q)),k.isBuffer(P))return P.length===0?-1:F(q,P,x,Q,re);if(typeof P=="number")return P=P&255,typeof R.prototype.indexOf=="function"?re?R.prototype.indexOf.call(q,P,x):R.prototype.lastIndexOf.call(q,P,x):F(q,[P],x,Q,re);throw new TypeError("val must be string, number or Buffer")}function F(q,P,x,Q,re){let ge=1,_e=q.length,tt=P.length;if(Q!==void 0&&(Q=String(Q).toLowerCase(),Q==="ucs2"||Q==="ucs-2"||Q==="utf16le"||Q==="utf-16le")){if(q.length<2||P.length<2)return-1;ge=2,_e/=2,tt/=2,x/=2}function Ft(Ot,ht){return ge===1?Ot[ht]:Ot.readUInt16BE(ht*ge)}let _t;if(re){let Ot=-1;for(_t=x;_t<_e;_t++)if(Ft(q,_t)===Ft(P,Ot===-1?0:_t-Ot)){if(Ot===-1&&(Ot=_t),_t-Ot+1===tt)return Ot*ge}else Ot!==-1&&(_t-=_t-Ot),Ot=-1}else for(x+tt>_e&&(x=_e-tt),_t=x;_t>=0;_t--){let Ot=!0;for(let ht=0;ht<tt;ht++)if(Ft(q,_t+ht)!==Ft(P,ht)){Ot=!1;break}if(Ot)return _t}return-1}k.prototype.includes=function(P,x,Q){return this.indexOf(P,x,Q)!==-1},k.prototype.indexOf=function(P,x,Q){return _(this,P,x,Q,!0)},k.prototype.lastIndexOf=function(P,x,Q){return _(this,P,x,Q,!1)};function K(q,P,x,Q){x=Number(x)||0;const re=q.length-x;Q?(Q=Number(Q),Q>re&&(Q=re)):Q=re;const ge=P.length;Q>ge/2&&(Q=ge/2);let _e;for(_e=0;_e<Q;++_e){const tt=parseInt(P.substr(_e*2,2),16);if(Kf(tt))return _e;q[x+_e]=tt}return _e}function z(q,P,x,Q){return wn(ft(P,q.length-x),q,x,Q)}function B(q,P,x,Q){return wn(Fe(P),q,x,Q)}function V(q,P,x,Q){return wn(We(P),q,x,Q)}function ce(q,P,x,Q){return wn(je(P,q.length-x),q,x,Q)}k.prototype.write=function(P,x,Q,re){if(x===void 0)re="utf8",Q=this.length,x=0;else if(Q===void 0&&typeof x=="string")re=x,Q=this.length,x=0;else if(isFinite(x))x=x>>>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 ge=this.length-x;if((Q===void 0||Q>ge)&&(Q=ge),P.length>0&&(Q<0||x<0)||x>this.length)throw new RangeError("Attempt to write outside buffer bounds");re||(re="utf8");let _e=!1;for(;;)switch(re){case"hex":return K(this,P,x,Q);case"utf8":case"utf-8":return z(this,P,x,Q);case"ascii":case"latin1":case"binary":return B(this,P,x,Q);case"base64":return V(this,P,x,Q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ce(this,P,x,Q);default:if(_e)throw new TypeError("Unknown encoding: "+re);re=(""+re).toLowerCase(),_e=!0}},k.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Re(q,P,x){return P===0&&x===q.length?h.fromByteArray(q):h.fromByteArray(q.slice(P,x))}function Le(q,P,x){x=Math.min(q.length,x);const Q=[];let re=P;for(;re<x;){const ge=q[re];let _e=null,tt=ge>239?4:ge>223?3:ge>191?2:1;if(re+tt<=x){let Ft,_t,Ot,ht;switch(tt){case 1:ge<128&&(_e=ge);break;case 2:Ft=q[re+1],(Ft&192)===128&&(ht=(ge&31)<<6|Ft&63,ht>127&&(_e=ht));break;case 3:Ft=q[re+1],_t=q[re+2],(Ft&192)===128&&(_t&192)===128&&(ht=(ge&15)<<12|(Ft&63)<<6|_t&63,ht>2047&&(ht<55296||ht>57343)&&(_e=ht));break;case 4:Ft=q[re+1],_t=q[re+2],Ot=q[re+3],(Ft&192)===128&&(_t&192)===128&&(Ot&192)===128&&(ht=(ge&15)<<18|(Ft&63)<<12|(_t&63)<<6|Ot&63,ht>65535&&ht<1114112&&(_e=ht))}}_e===null?(_e=65533,tt=1):_e>65535&&(_e-=65536,Q.push(_e>>>10&1023|55296),_e=56320|_e&1023),Q.push(_e),re+=tt}return Pe(Q)}const ke=4096;function Pe(q){const P=q.length;if(P<=ke)return String.fromCharCode.apply(String,q);let x="",Q=0;for(;Q<P;)x+=String.fromCharCode.apply(String,q.slice(Q,Q+=ke));return x}function Be(q,P,x){let Q="";x=Math.min(q.length,x);for(let re=P;re<x;++re)Q+=String.fromCharCode(q[re]&127);return Q}function he(q,P,x){let Q="";x=Math.min(q.length,x);for(let re=P;re<x;++re)Q+=String.fromCharCode(q[re]);return Q}function ae(q,P,x){const Q=q.length;(!P||P<0)&&(P=0),(!x||x<0||x>Q)&&(x=Q);let re="";for(let ge=P;ge<x;++ge)re+=T2[q[ge]];return re}function $e(q,P,x){const Q=q.slice(P,x);let re="";for(let ge=0;ge<Q.length-1;ge+=2)re+=String.fromCharCode(Q[ge]+Q[ge+1]*256);return re}k.prototype.slice=function(P,x){const Q=this.length;P=~~P,x=x===void 0?Q:~~x,P<0?(P+=Q,P<0&&(P=0)):P>Q&&(P=Q),x<0?(x+=Q,x<0&&(x=0)):x>Q&&(x=Q),x<P&&(x=P);const re=this.subarray(P,x);return Object.setPrototypeOf(re,k.prototype),re};function De(q,P,x){if(q%1!==0||q<0)throw new RangeError("offset is not uint");if(q+P>x)throw new RangeError("Trying to access beyond buffer length")}k.prototype.readUintLE=k.prototype.readUIntLE=function(P,x,Q){P=P>>>0,x=x>>>0,Q||De(P,x,this.length);let re=this[P],ge=1,_e=0;for(;++_e<x&&(ge*=256);)re+=this[P+_e]*ge;return re},k.prototype.readUintBE=k.prototype.readUIntBE=function(P,x,Q){P=P>>>0,x=x>>>0,Q||De(P,x,this.length);let re=this[P+--x],ge=1;for(;x>0&&(ge*=256);)re+=this[P+--x]*ge;return re},k.prototype.readUint8=k.prototype.readUInt8=function(P,x){return P=P>>>0,x||De(P,1,this.length),this[P]},k.prototype.readUint16LE=k.prototype.readUInt16LE=function(P,x){return P=P>>>0,x||De(P,2,this.length),this[P]|this[P+1]<<8},k.prototype.readUint16BE=k.prototype.readUInt16BE=function(P,x){return P=P>>>0,x||De(P,2,this.length),this[P]<<8|this[P+1]},k.prototype.readUint32LE=k.prototype.readUInt32LE=function(P,x){return P=P>>>0,x||De(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+this[P+3]*16777216},k.prototype.readUint32BE=k.prototype.readUInt32BE=function(P,x){return P=P>>>0,x||De(P,4,this.length),this[P]*16777216+(this[P+1]<<16|this[P+2]<<8|this[P+3])},k.prototype.readBigUInt64LE=$r(function(P){P=P>>>0,te(P,"offset");const x=this[P],Q=this[P+7];(x===void 0||Q===void 0)&&ue(P,this.length-8);const re=x+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24,ge=this[++P]+this[++P]*2**8+this[++P]*2**16+Q*2**24;return BigInt(re)+(BigInt(ge)<<BigInt(32))}),k.prototype.readBigUInt64BE=$r(function(P){P=P>>>0,te(P,"offset");const x=this[P],Q=this[P+7];(x===void 0||Q===void 0)&&ue(P,this.length-8);const re=x*2**24+this[++P]*2**16+this[++P]*2**8+this[++P],ge=this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+Q;return(BigInt(re)<<BigInt(32))+BigInt(ge)}),k.prototype.readIntLE=function(P,x,Q){P=P>>>0,x=x>>>0,Q||De(P,x,this.length);let re=this[P],ge=1,_e=0;for(;++_e<x&&(ge*=256);)re+=this[P+_e]*ge;return ge*=128,re>=ge&&(re-=Math.pow(2,8*x)),re},k.prototype.readIntBE=function(P,x,Q){P=P>>>0,x=x>>>0,Q||De(P,x,this.length);let re=x,ge=1,_e=this[P+--re];for(;re>0&&(ge*=256);)_e+=this[P+--re]*ge;return ge*=128,_e>=ge&&(_e-=Math.pow(2,8*x)),_e},k.prototype.readInt8=function(P,x){return P=P>>>0,x||De(P,1,this.length),this[P]&128?(255-this[P]+1)*-1:this[P]},k.prototype.readInt16LE=function(P,x){P=P>>>0,x||De(P,2,this.length);const Q=this[P]|this[P+1]<<8;return Q&32768?Q|4294901760:Q},k.prototype.readInt16BE=function(P,x){P=P>>>0,x||De(P,2,this.length);const Q=this[P+1]|this[P]<<8;return Q&32768?Q|4294901760:Q},k.prototype.readInt32LE=function(P,x){return P=P>>>0,x||De(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},k.prototype.readInt32BE=function(P,x){return P=P>>>0,x||De(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},k.prototype.readBigInt64LE=$r(function(P){P=P>>>0,te(P,"offset");const x=this[P],Q=this[P+7];(x===void 0||Q===void 0)&&ue(P,this.length-8);const re=this[P+4]+this[P+5]*2**8+this[P+6]*2**16+(Q<<24);return(BigInt(re)<<BigInt(32))+BigInt(x+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24)}),k.prototype.readBigInt64BE=$r(function(P){P=P>>>0,te(P,"offset");const x=this[P],Q=this[P+7];(x===void 0||Q===void 0)&&ue(P,this.length-8);const re=(x<<24)+this[++P]*2**16+this[++P]*2**8+this[++P];return(BigInt(re)<<BigInt(32))+BigInt(this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+Q)}),k.prototype.readFloatLE=function(P,x){return P=P>>>0,x||De(P,4,this.length),y.read(this,P,!0,23,4)},k.prototype.readFloatBE=function(P,x){return P=P>>>0,x||De(P,4,this.length),y.read(this,P,!1,23,4)},k.prototype.readDoubleLE=function(P,x){return P=P>>>0,x||De(P,8,this.length),y.read(this,P,!0,52,8)},k.prototype.readDoubleBE=function(P,x){return P=P>>>0,x||De(P,8,this.length),y.read(this,P,!1,52,8)};function Je(q,P,x,Q,re,ge){if(!k.isBuffer(q))throw new TypeError('"buffer" argument must be a Buffer instance');if(P>re||P<ge)throw new RangeError('"value" argument is out of bounds');if(x+Q>q.length)throw new RangeError("Index out of range")}k.prototype.writeUintLE=k.prototype.writeUIntLE=function(P,x,Q,re){if(P=+P,x=x>>>0,Q=Q>>>0,!re){const tt=Math.pow(2,8*Q)-1;Je(this,P,x,Q,tt,0)}let ge=1,_e=0;for(this[x]=P&255;++_e<Q&&(ge*=256);)this[x+_e]=P/ge&255;return x+Q},k.prototype.writeUintBE=k.prototype.writeUIntBE=function(P,x,Q,re){if(P=+P,x=x>>>0,Q=Q>>>0,!re){const tt=Math.pow(2,8*Q)-1;Je(this,P,x,Q,tt,0)}let ge=Q-1,_e=1;for(this[x+ge]=P&255;--ge>=0&&(_e*=256);)this[x+ge]=P/_e&255;return x+Q},k.prototype.writeUint8=k.prototype.writeUInt8=function(P,x,Q){return P=+P,x=x>>>0,Q||Je(this,P,x,1,255,0),this[x]=P&255,x+1},k.prototype.writeUint16LE=k.prototype.writeUInt16LE=function(P,x,Q){return P=+P,x=x>>>0,Q||Je(this,P,x,2,65535,0),this[x]=P&255,this[x+1]=P>>>8,x+2},k.prototype.writeUint16BE=k.prototype.writeUInt16BE=function(P,x,Q){return P=+P,x=x>>>0,Q||Je(this,P,x,2,65535,0),this[x]=P>>>8,this[x+1]=P&255,x+2},k.prototype.writeUint32LE=k.prototype.writeUInt32LE=function(P,x,Q){return P=+P,x=x>>>0,Q||Je(this,P,x,4,4294967295,0),this[x+3]=P>>>24,this[x+2]=P>>>16,this[x+1]=P>>>8,this[x]=P&255,x+4},k.prototype.writeUint32BE=k.prototype.writeUInt32BE=function(P,x,Q){return P=+P,x=x>>>0,Q||Je(this,P,x,4,4294967295,0),this[x]=P>>>24,this[x+1]=P>>>16,this[x+2]=P>>>8,this[x+3]=P&255,x+4};function ut(q,P,x,Q,re){G(P,Q,re,q,x,7);let ge=Number(P&BigInt(4294967295));q[x++]=ge,ge=ge>>8,q[x++]=ge,ge=ge>>8,q[x++]=ge,ge=ge>>8,q[x++]=ge;let _e=Number(P>>BigInt(32)&BigInt(4294967295));return q[x++]=_e,_e=_e>>8,q[x++]=_e,_e=_e>>8,q[x++]=_e,_e=_e>>8,q[x++]=_e,x}function ct(q,P,x,Q,re){G(P,Q,re,q,x,7);let ge=Number(P&BigInt(4294967295));q[x+7]=ge,ge=ge>>8,q[x+6]=ge,ge=ge>>8,q[x+5]=ge,ge=ge>>8,q[x+4]=ge;let _e=Number(P>>BigInt(32)&BigInt(4294967295));return q[x+3]=_e,_e=_e>>8,q[x+2]=_e,_e=_e>>8,q[x+1]=_e,_e=_e>>8,q[x]=_e,x+8}k.prototype.writeBigUInt64LE=$r(function(P,x=0){return ut(this,P,x,BigInt(0),BigInt("0xffffffffffffffff"))}),k.prototype.writeBigUInt64BE=$r(function(P,x=0){return ct(this,P,x,BigInt(0),BigInt("0xffffffffffffffff"))}),k.prototype.writeIntLE=function(P,x,Q,re){if(P=+P,x=x>>>0,!re){const Ft=Math.pow(2,8*Q-1);Je(this,P,x,Q,Ft-1,-Ft)}let ge=0,_e=1,tt=0;for(this[x]=P&255;++ge<Q&&(_e*=256);)P<0&&tt===0&&this[x+ge-1]!==0&&(tt=1),this[x+ge]=(P/_e>>0)-tt&255;return x+Q},k.prototype.writeIntBE=function(P,x,Q,re){if(P=+P,x=x>>>0,!re){const Ft=Math.pow(2,8*Q-1);Je(this,P,x,Q,Ft-1,-Ft)}let ge=Q-1,_e=1,tt=0;for(this[x+ge]=P&255;--ge>=0&&(_e*=256);)P<0&&tt===0&&this[x+ge+1]!==0&&(tt=1),this[x+ge]=(P/_e>>0)-tt&255;return x+Q},k.prototype.writeInt8=function(P,x,Q){return P=+P,x=x>>>0,Q||Je(this,P,x,1,127,-128),P<0&&(P=255+P+1),this[x]=P&255,x+1},k.prototype.writeInt16LE=function(P,x,Q){return P=+P,x=x>>>0,Q||Je(this,P,x,2,32767,-32768),this[x]=P&255,this[x+1]=P>>>8,x+2},k.prototype.writeInt16BE=function(P,x,Q){return P=+P,x=x>>>0,Q||Je(this,P,x,2,32767,-32768),this[x]=P>>>8,this[x+1]=P&255,x+2},k.prototype.writeInt32LE=function(P,x,Q){return P=+P,x=x>>>0,Q||Je(this,P,x,4,2147483647,-2147483648),this[x]=P&255,this[x+1]=P>>>8,this[x+2]=P>>>16,this[x+3]=P>>>24,x+4},k.prototype.writeInt32BE=function(P,x,Q){return P=+P,x=x>>>0,Q||Je(this,P,x,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),this[x]=P>>>24,this[x+1]=P>>>16,this[x+2]=P>>>8,this[x+3]=P&255,x+4},k.prototype.writeBigInt64LE=$r(function(P,x=0){return ut(this,P,x,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),k.prototype.writeBigInt64BE=$r(function(P,x=0){return ct(this,P,x,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Qt(q,P,x,Q,re,ge){if(x+Q>q.length)throw new RangeError("Index out of range");if(x<0)throw new RangeError("Index out of range")}function Xt(q,P,x,Q,re){return P=+P,x=x>>>0,re||Qt(q,P,x,4),y.write(q,P,x,Q,23,4),x+4}k.prototype.writeFloatLE=function(P,x,Q){return Xt(this,P,x,!0,Q)},k.prototype.writeFloatBE=function(P,x,Q){return Xt(this,P,x,!1,Q)};function Pt(q,P,x,Q,re){return P=+P,x=x>>>0,re||Qt(q,P,x,8),y.write(q,P,x,Q,52,8),x+8}k.prototype.writeDoubleLE=function(P,x,Q){return Pt(this,P,x,!0,Q)},k.prototype.writeDoubleBE=function(P,x,Q){return Pt(this,P,x,!1,Q)},k.prototype.copy=function(P,x,Q,re){if(!k.isBuffer(P))throw new TypeError("argument should be a Buffer");if(Q||(Q=0),!re&&re!==0&&(re=this.length),x>=P.length&&(x=P.length),x||(x=0),re>0&&re<Q&&(re=Q),re===Q||P.length===0||this.length===0)return 0;if(x<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),P.length-x<re-Q&&(re=P.length-x+Q);const ge=re-Q;return this===P&&typeof R.prototype.copyWithin=="function"?this.copyWithin(x,Q,re):R.prototype.set.call(P,this.subarray(Q,re),x),ge},k.prototype.fill=function(P,x,Q,re){if(typeof P=="string"){if(typeof x=="string"?(re=x,x=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"&&!k.isEncoding(re))throw new TypeError("Unknown encoding: "+re);if(P.length===1){const _e=P.charCodeAt(0);(re==="utf8"&&_e<128||re==="latin1")&&(P=_e)}}else typeof P=="number"?P=P&255:typeof P=="boolean"&&(P=Number(P));if(x<0||this.length<x||this.length<Q)throw new RangeError("Out of range index");if(Q<=x)return this;x=x>>>0,Q=Q===void 0?this.length:Q>>>0,P||(P=0);let ge;if(typeof P=="number")for(ge=x;ge<Q;++ge)this[ge]=P;else{const _e=k.isBuffer(P)?P:k.from(P,re),tt=_e.length;if(tt===0)throw new TypeError('The value "'+P+'" is invalid for argument "value"');for(ge=0;ge<Q-x;++ge)this[ge+x]=_e[ge%tt]}return this};const Ue={};function M(q,P,x){Ue[q]=class extends x{constructor(){super(),Object.defineProperty(this,"message",{value:P.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${q}]`,this.stack,delete this.name}get code(){return q}set code(re){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:re,writable:!0})}toString(){return`${this.name} [${q}]: ${this.message}`}}}M("ERR_BUFFER_OUT_OF_BOUNDS",function(q){return q?`${q} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),M("ERR_INVALID_ARG_TYPE",function(q,P){return`The "${q}" argument must be of type number. Received type ${typeof P}`},TypeError),M("ERR_OUT_OF_RANGE",function(q,P,x){let Q=`The value of "${q}" is out of range.`,re=x;return Number.isInteger(x)&&Math.abs(x)>2**32?re=C(String(x)):typeof x=="bigint"&&(re=String(x),(x>BigInt(2)**BigInt(32)||x<-(BigInt(2)**BigInt(32)))&&(re=C(re)),re+="n"),Q+=` It must be ${P}. Received ${re}`,Q},RangeError);function C(q){let P="",x=q.length;const Q=q[0]==="-"?1:0;for(;x>=Q+4;x-=3)P=`_${q.slice(x-3,x)}${P}`;return`${q.slice(0,x)}${P}`}function O(q,P,x){te(P,"offset"),(q[P]===void 0||q[P+x]===void 0)&&ue(P,q.length-(x+1))}function G(q,P,x,Q,re,ge){if(q>x||q<P){const _e=typeof P=="bigint"?"n":"";let tt;throw P===0||P===BigInt(0)?tt=`>= 0${_e} and < 2${_e} ** ${(ge+1)*8}${_e}`:tt=`>= -(2${_e} ** ${(ge+1)*8-1}${_e}) and < 2 ** ${(ge+1)*8-1}${_e}`,new Ue.ERR_OUT_OF_RANGE("value",tt,q)}O(Q,re,ge)}function te(q,P){if(typeof q!="number")throw new Ue.ERR_INVALID_ARG_TYPE(P,"number",q)}function ue(q,P,x){throw Math.floor(q)!==q?(te(q,x),new Ue.ERR_OUT_OF_RANGE("offset","an integer",q)):P<0?new Ue.ERR_BUFFER_OUT_OF_BOUNDS:new Ue.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${P}`,q)}const Ae=/[^+/0-9A-Za-z-_]/g;function Ze(q){if(q=q.split("=")[0],q=q.trim().replace(Ae,""),q.length<2)return"";for(;q.length%4!==0;)q=q+"=";return q}function ft(q,P){P=P||1/0;let x;const Q=q.length;let re=null;const ge=[];for(let _e=0;_e<Q;++_e){if(x=q.charCodeAt(_e),x>55295&&x<57344){if(!re){if(x>56319){(P-=3)>-1&&ge.push(239,191,189);continue}else if(_e+1===Q){(P-=3)>-1&&ge.push(239,191,189);continue}re=x;continue}if(x<56320){(P-=3)>-1&&ge.push(239,191,189),re=x;continue}x=(re-55296<<10|x-56320)+65536}else re&&(P-=3)>-1&&ge.push(239,191,189);if(re=null,x<128){if((P-=1)<0)break;ge.push(x)}else if(x<2048){if((P-=2)<0)break;ge.push(x>>6|192,x&63|128)}else if(x<65536){if((P-=3)<0)break;ge.push(x>>12|224,x>>6&63|128,x&63|128)}else if(x<1114112){if((P-=4)<0)break;ge.push(x>>18|240,x>>12&63|128,x>>6&63|128,x&63|128)}else throw new Error("Invalid code point")}return ge}function Fe(q){const P=[];for(let x=0;x<q.length;++x)P.push(q.charCodeAt(x)&255);return P}function je(q,P){let x,Q,re;const ge=[];for(let _e=0;_e<q.length&&!((P-=2)<0);++_e)x=q.charCodeAt(_e),Q=x>>8,re=x%256,ge.push(re),ge.push(Q);return ge}function We(q){return h.toByteArray(Ze(q))}function wn(q,P,x,Q){let re;for(re=0;re<Q&&!(re+x>=P.length||re>=q.length);++re)P[re+x]=q[re];return re}function rr(q,P){return q instanceof P||q!=null&&q.constructor!=null&&q.constructor.name!=null&&q.constructor.name===P.name}function Kf(q){return q!==q}const T2=function(){const q="0123456789abcdef",P=new Array(256);for(let x=0;x<16;++x){const Q=x*16;for(let re=0;re<16;++re)P[Q+re]=q[x]+q[re]}return P}();function $r(q){return typeof BigInt>"u"?A2:q}function A2(){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}(Yl)),Yl}var Jl={},Zl={},ec,Yh;function Jh(){return Yh||(Yh=1,ec=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}),ec}var tc,Zh;function Ts(){if(Zh)return tc;Zh=1;var e=Jh();return tc=function(){return e()&&!!Symbol.toStringTag},tc}var nc,eg;function tg(){return eg||(eg=1,nc=Object),nc}var rc,ng;function _A(){return ng||(ng=1,rc=Error),rc}var ic,rg;function IA(){return rg||(rg=1,ic=EvalError),ic}var oc,ig;function CA(){return ig||(ig=1,oc=RangeError),oc}var sc,og;function PA(){return og||(og=1,sc=ReferenceError),sc}var ac,sg;function ag(){return sg||(sg=1,ac=SyntaxError),ac}var lc,lg;function uo(){return lg||(lg=1,lc=TypeError),lc}var cc,cg;function FA(){return cg||(cg=1,cc=URIError),cc}var uc,ug;function OA(){return ug||(ug=1,uc=Math.abs),uc}var fc,fg;function xA(){return fg||(fg=1,fc=Math.floor),fc}var dc,dg;function kA(){return dg||(dg=1,dc=Math.max),dc}var pc,pg;function NA(){return pg||(pg=1,pc=Math.min),pc}var hc,hg;function $A(){return hg||(hg=1,hc=Math.pow),hc}var gc,gg;function DA(){return gg||(gg=1,gc=Math.round),gc}var mc,mg;function LA(){return mg||(mg=1,mc=Number.isNaN||function(t){return t!==t}),mc}var yc,yg;function MA(){if(yg)return yc;yg=1;var e=LA();return yc=function(n){return e(n)||n===0?n:n<0?-1:1},yc}var bc,bg;function BA(){return bg||(bg=1,bc=Object.getOwnPropertyDescriptor),bc}var vc,vg;function Ci(){if(vg)return vc;vg=1;var e=BA();if(e)try{e([],"length")}catch{e=null}return vc=e,vc}var wc,wg;function As(){if(wg)return wc;wg=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return wc=e,wc}var Sc,Sg;function jA(){if(Sg)return Sc;Sg=1;var e=typeof Symbol<"u"&&Symbol,t=Jh();return Sc=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Sc}var Ec,Eg;function Tg(){return Eg||(Eg=1,Ec=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Ec}var Tc,Ag;function Rg(){if(Ag)return Tc;Ag=1;var e=tg();return Tc=e.getPrototypeOf||null,Tc}var Ac,_g;function UA(){if(_g)return Ac;_g=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=[],f=0;f<c.length;f+=1)l[f]=c[f];for(var d=0;d<u.length;d+=1)l[d+c.length]=u[d];return l},i=function(c,u){for(var l=[],f=u,d=0;f<c.length;f+=1,d+=1)l[d]=c[f];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 Ac=function(c){var u=this;if(typeof u!="function"||t.apply(u)!==r)throw new TypeError(e+u);for(var l=i(arguments,1),f,d=function(){if(this instanceof f){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=[],v=0;v<m;v++)w[v]="$"+v;if(f=Function("binder","return function ("+s(w,",")+"){ return binder.apply(this,arguments); }")(d),u.prototype){var T=function(){};T.prototype=u.prototype,f.prototype=new T,T.prototype=null}return f},Ac}var Rc,Ig;function fo(){if(Ig)return Rc;Ig=1;var e=UA();return Rc=Function.prototype.bind||e,Rc}var _c,Cg;function Ic(){return Cg||(Cg=1,_c=Function.prototype.call),_c}var Cc,Pg;function Pc(){return Pg||(Pg=1,Cc=Function.prototype.apply),Cc}var Fc,Fg;function qA(){return Fg||(Fg=1,Fc=typeof Reflect<"u"&&Reflect&&Reflect.apply),Fc}var Oc,Og;function xg(){if(Og)return Oc;Og=1;var e=fo(),t=Pc(),n=Ic(),r=qA();return Oc=r||e.call(n,t),Oc}var xc,kg;function kc(){if(kg)return xc;kg=1;var e=fo(),t=uo(),n=Ic(),r=xg();return xc=function(i){if(i.length<1||typeof i[0]!="function")throw new t("a function is required");return r(e,n,i)},xc}var Nc,Ng;function VA(){if(Ng)return Nc;Ng=1;var e=kc(),t=Ci(),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 Nc=r&&typeof r.get=="function"?e([r.get]):typeof i=="function"?function(a){return i(a==null?a:o(a))}:!1,Nc}var $c,$g;function Dg(){if($g)return $c;$g=1;var e=Tg(),t=Rg(),n=VA();return $c=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,$c}var Dc,Lg;function Mg(){if(Lg)return Dc;Lg=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,n=fo();return Dc=n.call(e,t),Dc}var Lc,Bg;function jg(){if(Bg)return Lc;Bg=1;var e,t=tg(),n=_A(),r=IA(),o=CA(),i=PA(),s=ag(),a=uo(),c=FA(),u=OA(),l=xA(),f=kA(),d=NA(),m=$A(),w=DA(),v=MA(),T=Function,b=function(K){try{return T('"use strict"; return ('+K+").constructor;")()}catch{}},g=Ci(),h=As(),y=function(){throw new a},S=g?function(){try{return arguments.callee,y}catch{try{return g(arguments,"callee").get}catch{return y}}}():y,E=jA()(),R=Dg(),I=Rg(),A=Tg(),$=Pc(),D=Ic(),k={},N=typeof Uint8Array>"u"||!R?e:R(Uint8Array),j={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":E&&R?R([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":k,"%AsyncGenerator%":k,"%AsyncGeneratorFunction%":k,"%AsyncIteratorPrototype%":k,"%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%":T,"%GeneratorFunction%":k,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&R?R(R([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!E||!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%":o,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!E||!R?e:R(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&R?R(""[Symbol.iterator]()):e,"%Symbol%":E?Symbol:e,"%SyntaxError%":s,"%ThrowTypeError%":S,"%TypedArray%":N,"%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%":h,"%Object.getPrototypeOf%":I,"%Math.abs%":u,"%Math.floor%":l,"%Math.max%":f,"%Math.min%":d,"%Math.pow%":m,"%Math.round%":w,"%Math.sign%":v,"%Reflect.getPrototypeOf%":A};if(R)try{null.error}catch(K){var W=R(R(K));j["%Error.prototype%"]=W}var X=function K(z){var B;if(z==="%AsyncFunction%")B=b("async function () {}");else if(z==="%GeneratorFunction%")B=b("function* () {}");else if(z==="%AsyncGeneratorFunction%")B=b("async function* () {}");else if(z==="%AsyncGenerator%"){var V=K("%AsyncGeneratorFunction%");V&&(B=V.prototype)}else if(z==="%AsyncIteratorPrototype%"){var ce=K("%AsyncGenerator%");ce&&R&&(B=R(ce.prototype))}return j[z]=B,B},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"]},de=fo(),se=Mg(),we=de.call(D,Array.prototype.concat),Se=de.call($,Array.prototype.splice),Z=de.call(D,String.prototype.replace),ne=de.call(D,String.prototype.slice),le=de.call(D,RegExp.prototype.exec),Ie=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Y=/\\(\\)?/g,_=function(z){var B=ne(z,0,1),V=ne(z,-1);if(B==="%"&&V!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(V==="%"&&B!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var ce=[];return Z(z,Ie,function(Re,Le,ke,Pe){ce[ce.length]=ke?Z(Pe,Y,"$1"):Le||Re}),ce},F=function(z,B){var V=z,ce;if(se(ie,V)&&(ce=ie[V],V="%"+ce[0]+"%"),se(j,V)){var Re=j[V];if(Re===k&&(Re=X(V)),typeof Re>"u"&&!B)throw new a("intrinsic "+z+" exists, but is not available. Please file an issue!");return{alias:ce,name:V,value:Re}}throw new s("intrinsic "+z+" does not exist!")};return Lc=function(z,B){if(typeof z!="string"||z.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof B!="boolean")throw new a('"allowMissing" argument must be a boolean');if(le(/^%?[^%]*%?$/,z)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var V=_(z),ce=V.length>0?V[0]:"",Re=F("%"+ce+"%",B),Le=Re.name,ke=Re.value,Pe=!1,Be=Re.alias;Be&&(ce=Be[0],Se(V,we([0,1],Be)));for(var he=1,ae=!0;he<V.length;he+=1){var $e=V[he],De=ne($e,0,1),Je=ne($e,-1);if((De==='"'||De==="'"||De==="`"||Je==='"'||Je==="'"||Je==="`")&&De!==Je)throw new s("property names with quotes must have matching quotes");if(($e==="constructor"||!ae)&&(Pe=!0),ce+="."+$e,Le="%"+ce+"%",se(j,Le))ke=j[Le];else if(ke!=null){if(!($e in ke)){if(!B)throw new a("base intrinsic for "+z+" exists, but the property is not available.");return}if(g&&he+1>=V.length){var ut=g(ke,$e);ae=!!ut,ae&&"get"in ut&&!("originalValue"in ut.get)?ke=ut.get:ke=ke[$e]}else ae=se(ke,$e),ke=ke[$e];ae&&!Pe&&(j[Le]=ke)}}return ke},Lc}var Mc,Ug;function po(){if(Ug)return Mc;Ug=1;var e=jg(),t=kc(),n=t([e("%String.prototype.indexOf%")]);return Mc=function(o,i){var s=e(o,!!i);return typeof s=="function"&&n(o,".prototype.")>-1?t([s]):s},Mc}var Bc,qg;function zA(){if(qg)return Bc;qg=1;var e=Ts()(),t=po(),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,Bc=i?r:o,Bc}var jc,Vg;function WA(){if(Vg)return jc;Vg=1;var e=po(),t=Ts()(),n=Mg(),r=Ci(),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(d){if(!d||typeof d!="object")return!1;var m=r(d,"lastIndex"),w=m&&n(m,"value");if(!w)return!1;try{i(d,c)}catch(v){return v===s}}}else{var u=e("Object.prototype.toString"),l="[object RegExp]";o=function(d){return!d||typeof d!="object"&&typeof d!="function"?!1:u(d)===l}}return jc=o,jc}var Uc,zg;function HA(){if(zg)return Uc;zg=1;var e=po(),t=WA(),n=e("RegExp.prototype.exec"),r=uo();return Uc=function(i){if(!t(i))throw new r("`regex` must be a RegExp");return function(a){return n(i,a)!==null}},Uc}var qc,Wg;function GA(){if(Wg)return qc;Wg=1;var e=po(),t=HA(),n=t(/^\s*(?:function)?\*/),r=Ts()(),o=Dg(),i=e("Object.prototype.toString"),s=e("Function.prototype.toString"),a=function(){if(!r)return!1;try{return Function("return function*() {}")()}catch{}},c;return qc=function(l){if(typeof l!="function")return!1;if(n(s(l)))return!0;if(!r){var f=i(l);return f==="[object GeneratorFunction]"}if(!o)return!1;if(typeof c>"u"){var d=a();c=d?o(d):!1}return o(l)===c},qc}var Vc,Hg;function KA(){if(Hg)return Vc;Hg=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(h){try{var y=e.call(h);return o.test(y)}catch{return!1}},s=function(h){try{return i(h)?!1:(e.call(h),!0)}catch{return!1}},a=Object.prototype.toString,c="[object Object]",u="[object Function]",l="[object GeneratorFunction]",f="[object HTMLAllCollection]",d="[object HTML document.all class]",m="[object HTMLCollection]",w=typeof Symbol=="function"&&!!Symbol.toStringTag,v=!(0 in[,]),T=function(){return!1};if(typeof document=="object"){var b=document.all;a.call(b)===a.call(document.all)&&(T=function(h){if((v||!h)&&(typeof h>"u"||typeof h=="object"))try{var y=a.call(h);return(y===f||y===d||y===m||y===c)&&h("")==null}catch{}return!1})}return Vc=t?function(h){if(T(h))return!0;if(!h||typeof h!="function"&&typeof h!="object")return!1;try{t(h,null,n)}catch(y){if(y!==r)return!1}return!i(h)&&s(h)}:function(h){if(T(h))return!0;if(!h||typeof h!="function"&&typeof h!="object")return!1;if(w)return s(h);if(i(h))return!1;var y=a.call(h);return y!==u&&y!==l&&!/^\[object HTML/.test(y)?!1:s(h)},Vc}var zc,Gg;function QA(){if(Gg)return zc;Gg=1;var e=KA(),t=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(c,u,l){for(var f=0,d=c.length;f<d;f++)n.call(c,f)&&(l==null?u(c[f],f,c):u.call(l,c[f],f,c))},o=function(c,u,l){for(var f=0,d=c.length;f<d;f++)l==null?u(c.charAt(f),f,c):u.call(l,c.charAt(f),f,c)},i=function(c,u,l){for(var f in c)n.call(c,f)&&(l==null?u(c[f],f,c):u.call(l,c[f],f,c))};function s(a){return t.call(a)==="[object Array]"}return zc=function(c,u,l){if(!e(u))throw new TypeError("iterator must be a function");var f;arguments.length>=3&&(f=l),s(c)?r(c,u,f):typeof c=="string"?o(c,u,f):i(c,u,f)},zc}var Wc,Kg;function XA(){return Kg||(Kg=1,Wc=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Wc}var Hc,Qg;function YA(){if(Qg)return Hc;Qg=1;var e=XA(),t=typeof globalThis>"u"?Cr:globalThis;return Hc=function(){for(var r=[],o=0;o<e.length;o++)typeof t[e[o]]=="function"&&(r[r.length]=e[o]);return r},Hc}var Gc={exports:{}},Kc,Xg;function JA(){if(Xg)return Kc;Xg=1;var e=As(),t=ag(),n=uo(),r=Ci();return Kc=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,f=arguments.length>6?arguments[6]:!1,d=!!r&&r(i,s);if(e)e(i,s,{configurable:l===null&&d?d.configurable:!l,enumerable:c===null&&d?d.enumerable:!c,value:a,writable:u===null&&d?d.writable:!u});else if(f||!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.")},Kc}var Qc,Yg;function ZA(){if(Yg)return Qc;Yg=1;var e=As(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},Qc=t,Qc}var Xc,Jg;function eR(){if(Jg)return Xc;Jg=1;var e=jg(),t=JA(),n=ZA()(),r=Ci(),o=uo(),i=e("%Math.floor%");return Xc=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,f=!0;if("length"in a&&r){var d=r(a,"length");d&&!d.configurable&&(l=!1),d&&!d.writable&&(f=!1)}return(l||f||!u)&&(n?t(a,"length",c,!0,!0):t(a,"length",c)),a},Xc}var Yc,Zg;function tR(){if(Zg)return Yc;Zg=1;var e=fo(),t=Pc(),n=xg();return Yc=function(){return n(e,t,arguments)},Yc}var em;function nR(){return em||(em=1,function(e){var t=eR(),n=As(),r=kc(),o=tR();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}(Gc)),Gc.exports}var Jc,tm;function nm(){if(tm)return Jc;tm=1;var e=QA(),t=YA(),n=nR(),r=po(),o=Ci(),i=r("Object.prototype.toString"),s=Ts()(),a=typeof globalThis>"u"?Cr:globalThis,c=t(),u=r("String.prototype.slice"),l=Object.getPrototypeOf,f=r("Array.prototype.indexOf",!0)||function(T,b){for(var g=0;g<T.length;g+=1)if(T[g]===b)return g;return-1},d={__proto__:null};s&&o&&l?e(c,function(v){var T=new a[v];if(Symbol.toStringTag in T){var b=l(T),g=o(b,Symbol.toStringTag);if(!g){var h=l(b);g=o(h,Symbol.toStringTag)}d["$"+v]=n(g.get)}}):e(c,function(v){var T=new a[v],b=T.slice||T.set;b&&(d["$"+v]=n(b))});var m=function(T){var b=!1;return e(d,function(g,h){if(!b)try{"$"+g(T)===h&&(b=u(h,1))}catch{}}),b},w=function(T){var b=!1;return e(d,function(g,h){if(!b)try{g(T),b=u(h,1)}catch{}}),b};return Jc=function(T){if(!T||typeof T!="object")return!1;if(!s){var b=u(i(T),8,-1);return f(c,b)>-1?b:b!=="Object"?!1:w(T)}return o?m(T):null},Jc}var Zc,rm;function rR(){if(rm)return Zc;rm=1;var e=nm();return Zc=function(n){return!!e(n)},Zc}var im;function iR(){return im||(im=1,function(e){var t=zA(),n=GA(),r=nm(),o=rR();function i(he){return he.call.bind(he)}var s=typeof BigInt<"u",a=typeof Symbol<"u",c=i(Object.prototype.toString),u=i(Number.prototype.valueOf),l=i(String.prototype.valueOf),f=i(Boolean.prototype.valueOf);if(s)var d=i(BigInt.prototype.valueOf);if(a)var m=i(Symbol.prototype.valueOf);function w(he,ae){if(typeof he!="object")return!1;try{return ae(he),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=n,e.isTypedArray=o;function v(he){return typeof Promise<"u"&&he instanceof Promise||he!==null&&typeof he=="object"&&typeof he.then=="function"&&typeof he.catch=="function"}e.isPromise=v;function T(he){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(he):o(he)||ne(he)}e.isArrayBufferView=T;function b(he){return r(he)==="Uint8Array"}e.isUint8Array=b;function g(he){return r(he)==="Uint8ClampedArray"}e.isUint8ClampedArray=g;function h(he){return r(he)==="Uint16Array"}e.isUint16Array=h;function y(he){return r(he)==="Uint32Array"}e.isUint32Array=y;function S(he){return r(he)==="Int8Array"}e.isInt8Array=S;function E(he){return r(he)==="Int16Array"}e.isInt16Array=E;function R(he){return r(he)==="Int32Array"}e.isInt32Array=R;function I(he){return r(he)==="Float32Array"}e.isFloat32Array=I;function A(he){return r(he)==="Float64Array"}e.isFloat64Array=A;function $(he){return r(he)==="BigInt64Array"}e.isBigInt64Array=$;function D(he){return r(he)==="BigUint64Array"}e.isBigUint64Array=D;function k(he){return c(he)==="[object Map]"}k.working=typeof Map<"u"&&k(new Map);function N(he){return typeof Map>"u"?!1:k.working?k(he):he instanceof Map}e.isMap=N;function j(he){return c(he)==="[object Set]"}j.working=typeof Set<"u"&&j(new Set);function W(he){return typeof Set>"u"?!1:j.working?j(he):he instanceof Set}e.isSet=W;function X(he){return c(he)==="[object WeakMap]"}X.working=typeof WeakMap<"u"&&X(new WeakMap);function ie(he){return typeof WeakMap>"u"?!1:X.working?X(he):he instanceof WeakMap}e.isWeakMap=ie;function de(he){return c(he)==="[object WeakSet]"}de.working=typeof WeakSet<"u"&&de(new WeakSet);function se(he){return de(he)}e.isWeakSet=se;function we(he){return c(he)==="[object ArrayBuffer]"}we.working=typeof ArrayBuffer<"u"&&we(new ArrayBuffer);function Se(he){return typeof ArrayBuffer>"u"?!1:we.working?we(he):he instanceof ArrayBuffer}e.isArrayBuffer=Se;function Z(he){return c(he)==="[object DataView]"}Z.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Z(new DataView(new ArrayBuffer(1),0,1));function ne(he){return typeof DataView>"u"?!1:Z.working?Z(he):he instanceof DataView}e.isDataView=ne;var le=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Ie(he){return c(he)==="[object SharedArrayBuffer]"}function Y(he){return typeof le>"u"?!1:(typeof Ie.working>"u"&&(Ie.working=Ie(new le)),Ie.working?Ie(he):he instanceof le)}e.isSharedArrayBuffer=Y;function _(he){return c(he)==="[object AsyncFunction]"}e.isAsyncFunction=_;function F(he){return c(he)==="[object Map Iterator]"}e.isMapIterator=F;function K(he){return c(he)==="[object Set Iterator]"}e.isSetIterator=K;function z(he){return c(he)==="[object Generator]"}e.isGeneratorObject=z;function B(he){return c(he)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=B;function V(he){return w(he,u)}e.isNumberObject=V;function ce(he){return w(he,l)}e.isStringObject=ce;function Re(he){return w(he,f)}e.isBooleanObject=Re;function Le(he){return s&&w(he,d)}e.isBigIntObject=Le;function ke(he){return a&&w(he,m)}e.isSymbolObject=ke;function Pe(he){return V(he)||ce(he)||Re(he)||Le(he)||ke(he)}e.isBoxedPrimitive=Pe;function Be(he){return typeof Uint8Array<"u"&&(Se(he)||Y(he))}e.isAnyArrayBuffer=Be,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(he){Object.defineProperty(e,he,{enumerable:!1,value:function(){throw new Error(he+" is not supported in userland")}})})}(Zl)),Zl}var eu,om;function oR(){return om||(om=1,eu=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),eu}var sm;function am(){return sm||(sm=1,function(e){var t=Object.getOwnPropertyDescriptors||function(ne){for(var le=Object.keys(ne),Ie={},Y=0;Y<le.length;Y++)Ie[le[Y]]=Object.getOwnPropertyDescriptor(ne,le[Y]);return Ie},n=/%[sdj%]/g;e.format=function(Z){if(!S(Z)){for(var ne=[],le=0;le<arguments.length;le++)ne.push(s(arguments[le]));return ne.join(" ")}for(var le=1,Ie=arguments,Y=Ie.length,_=String(Z).replace(n,function(K){if(K==="%%")return"%";if(le>=Y)return K;switch(K){case"%s":return String(Ie[le++]);case"%d":return Number(Ie[le++]);case"%j":try{return JSON.stringify(Ie[le++])}catch{return"[Circular]"}default:return K}}),F=Ie[le];le<Y;F=Ie[++le])g(F)||!A(F)?_+=" "+F:_+=" "+s(F);return _},e.deprecate=function(Z,ne){if(typeof ye<"u"&&ye.noDeprecation===!0)return Z;if(typeof ye>"u")return function(){return e.deprecate(Z,ne).apply(this,arguments)};var le=!1;function Ie(){if(!le){if(ye.throwDeprecation)throw new Error(ne);ye.traceDeprecation?console.trace(ne):console.error(ne),le=!0}return Z.apply(this,arguments)}return Ie};var r={},o=/^$/;if(ye.env.NODE_DEBUG){var i=ye.env.NODE_DEBUG;i=i.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+i+"$","i")}e.debuglog=function(Z){if(Z=Z.toUpperCase(),!r[Z])if(o.test(Z)){var ne=ye.pid;r[Z]=function(){var le=e.format.apply(e,arguments);console.error("%s %d: %s",Z,ne,le)}}else r[Z]=function(){};return r[Z]};function s(Z,ne){var le={seen:[],stylize:c};return arguments.length>=3&&(le.depth=arguments[2]),arguments.length>=4&&(le.colors=arguments[3]),b(ne)?le.showHidden=ne:ne&&e._extend(le,ne),R(le.showHidden)&&(le.showHidden=!1),R(le.depth)&&(le.depth=2),R(le.colors)&&(le.colors=!1),R(le.customInspect)&&(le.customInspect=!0),le.colors&&(le.stylize=a),l(le,Z,le.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(Z,ne){var le=s.styles[ne];return le?"\x1B["+s.colors[le][0]+"m"+Z+"\x1B["+s.colors[le][1]+"m":Z}function c(Z,ne){return Z}function u(Z){var ne={};return Z.forEach(function(le,Ie){ne[le]=!0}),ne}function l(Z,ne,le){if(Z.customInspect&&ne&&k(ne.inspect)&&ne.inspect!==e.inspect&&!(ne.constructor&&ne.constructor.prototype===ne)){var Ie=ne.inspect(le,Z);return S(Ie)||(Ie=l(Z,Ie,le)),Ie}var Y=f(Z,ne);if(Y)return Y;var _=Object.keys(ne),F=u(_);if(Z.showHidden&&(_=Object.getOwnPropertyNames(ne)),D(ne)&&(_.indexOf("message")>=0||_.indexOf("description")>=0))return d(ne);if(_.length===0){if(k(ne)){var K=ne.name?": "+ne.name:"";return Z.stylize("[Function"+K+"]","special")}if(I(ne))return Z.stylize(RegExp.prototype.toString.call(ne),"regexp");if($(ne))return Z.stylize(Date.prototype.toString.call(ne),"date");if(D(ne))return d(ne)}var z="",B=!1,V=["{","}"];if(T(ne)&&(B=!0,V=["[","]"]),k(ne)){var ce=ne.name?": "+ne.name:"";z=" [Function"+ce+"]"}if(I(ne)&&(z=" "+RegExp.prototype.toString.call(ne)),$(ne)&&(z=" "+Date.prototype.toUTCString.call(ne)),D(ne)&&(z=" "+d(ne)),_.length===0&&(!B||ne.length==0))return V[0]+z+V[1];if(le<0)return I(ne)?Z.stylize(RegExp.prototype.toString.call(ne),"regexp"):Z.stylize("[Object]","special");Z.seen.push(ne);var Re;return B?Re=m(Z,ne,le,F,_):Re=_.map(function(Le){return w(Z,ne,le,F,Le,B)}),Z.seen.pop(),v(Re,z,V)}function f(Z,ne){if(R(ne))return Z.stylize("undefined","undefined");if(S(ne)){var le="'"+JSON.stringify(ne).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Z.stylize(le,"string")}if(y(ne))return Z.stylize(""+ne,"number");if(b(ne))return Z.stylize(""+ne,"boolean");if(g(ne))return Z.stylize("null","null")}function d(Z){return"["+Error.prototype.toString.call(Z)+"]"}function m(Z,ne,le,Ie,Y){for(var _=[],F=0,K=ne.length;F<K;++F)de(ne,String(F))?_.push(w(Z,ne,le,Ie,String(F),!0)):_.push("");return Y.forEach(function(z){z.match(/^\d+$/)||_.push(w(Z,ne,le,Ie,z,!0))}),_}function w(Z,ne,le,Ie,Y,_){var F,K,z;if(z=Object.getOwnPropertyDescriptor(ne,Y)||{value:ne[Y]},z.get?z.set?K=Z.stylize("[Getter/Setter]","special"):K=Z.stylize("[Getter]","special"):z.set&&(K=Z.stylize("[Setter]","special")),de(Ie,Y)||(F="["+Y+"]"),K||(Z.seen.indexOf(z.value)<0?(g(le)?K=l(Z,z.value,null):K=l(Z,z.value,le-1),K.indexOf(`
16
+ */(function(g){const h=n,y=T,S=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;g.Buffer=k,g.SlowBuffer=re,g.INSPECT_MAX_BYTES=50;const E=2147483647;g.kMaxLength=E;const{Uint8Array:R,ArrayBuffer:I,SharedArrayBuffer:A}=globalThis;k.TYPED_ARRAY_SUPPORT=$(),!k.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 R(1),F={foo:function(){return 42}};return Object.setPrototypeOf(F,R.prototype),Object.setPrototypeOf(U,F),U.foo()===42}catch{return!1}}Object.defineProperty(k.prototype,"parent",{enumerable:!0,get:function(){if(k.isBuffer(this))return this.buffer}}),Object.defineProperty(k.prototype,"offset",{enumerable:!0,get:function(){if(k.isBuffer(this))return this.byteOffset}});function D(U){if(U>E)throw new RangeError('The value "'+U+'" is invalid for option "size"');const F=new R(U);return Object.setPrototypeOf(F,k.prototype),F}function k(U,F,x){if(typeof U=="number"){if(typeof F=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return X(U)}return N(U,F,x)}k.poolSize=8192;function N(U,F,x){if(typeof U=="string")return se(U,F);if(I.isView(U))return oe(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(rr(U,I)||U&&rr(U.buffer,I)||typeof A<"u"&&(rr(U,A)||U&&rr(U.buffer,A)))return fe(U,F,x);if(typeof U=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Q=U.valueOf&&U.valueOf();if(Q!=null&&Q!==U)return k.from(Q,F,x);const ie=we(U);if(ie)return ie;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof U[Symbol.toPrimitive]=="function")return k.from(U[Symbol.toPrimitive]("string"),F,x);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U)}k.from=function(U,F,x){return N(U,F,x)},Object.setPrototypeOf(k.prototype,R.prototype),Object.setPrototypeOf(k,R);function z(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,F,x){return z(U),U<=0?D(U):F!==void 0?typeof x=="string"?D(U).fill(F,x):D(U).fill(F):D(U)}k.alloc=function(U,F,x){return G(U,F,x)};function X(U){return z(U),D(U<0?0:Z(U)|0)}k.allocUnsafe=function(U){return X(U)},k.allocUnsafeSlow=function(U){return X(U)};function se(U,F){if((typeof F!="string"||F==="")&&(F="utf8"),!k.isEncoding(F))throw new TypeError("Unknown encoding: "+F);const x=ce(U,F)|0;let Q=D(x);const ie=Q.write(U,F);return ie!==x&&(Q=Q.slice(0,ie)),Q}function ne(U){const F=U.length<0?0:Z(U.length)|0,x=D(F);for(let Q=0;Q<F;Q+=1)x[Q]=U[Q]&255;return x}function oe(U){if(rr(U,R)){const F=new R(U);return fe(F.buffer,F.byteOffset,F.byteLength)}return ne(U)}function fe(U,F,x){if(F<0||U.byteLength<F)throw new RangeError('"offset" is outside of buffer bounds');if(U.byteLength<F+(x||0))throw new RangeError('"length" is outside of buffer bounds');let Q;return F===void 0&&x===void 0?Q=new R(U):x===void 0?Q=new R(U,F):Q=new R(U,F,x),Object.setPrototypeOf(Q,k.prototype),Q}function we(U){if(k.isBuffer(U)){const F=Z(U.length)|0,x=D(F);return x.length===0||U.copy(x,0,0,F),x}if(U.length!==void 0)return typeof U.length!="number"||Kf(U.length)?D(0):ne(U);if(U.type==="Buffer"&&Array.isArray(U.data))return ne(U.data)}function Z(U){if(U>=E)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+E.toString(16)+" bytes");return U|0}function re(U){return+U!=U&&(U=0),k.alloc(+U)}k.isBuffer=function(F){return F!=null&&F._isBuffer===!0&&F!==k.prototype},k.compare=function(F,x){if(rr(F,R)&&(F=k.from(F,F.offset,F.byteLength)),rr(x,R)&&(x=k.from(x,x.offset,x.byteLength)),!k.isBuffer(F)||!k.isBuffer(x))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(F===x)return 0;let Q=F.length,ie=x.length;for(let me=0,_e=Math.min(Q,ie);me<_e;++me)if(F[me]!==x[me]){Q=F[me],ie=x[me];break}return Q<ie?-1:ie<Q?1:0},k.isEncoding=function(F){switch(String(F).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}},k.concat=function(F,x){if(!Array.isArray(F))throw new TypeError('"list" argument must be an Array of Buffers');if(F.length===0)return k.alloc(0);let Q;if(x===void 0)for(x=0,Q=0;Q<F.length;++Q)x+=F[Q].length;const ie=k.allocUnsafe(x);let me=0;for(Q=0;Q<F.length;++Q){let _e=F[Q];if(rr(_e,R))me+_e.length>ie.length?(k.isBuffer(_e)||(_e=k.from(_e)),_e.copy(ie,me)):R.prototype.set.call(ie,_e,me);else if(k.isBuffer(_e))_e.copy(ie,me);else throw new TypeError('"list" argument must be an Array of Buffers');me+=_e.length}return ie};function ce(U,F){if(k.isBuffer(U))return U.length;if(I.isView(U)||rr(U,I))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 x=U.length,Q=arguments.length>2&&arguments[2]===!0;if(!Q&&x===0)return 0;let ie=!1;for(;;)switch(F){case"ascii":case"latin1":case"binary":return x;case"utf8":case"utf-8":return ft(U).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x*2;case"hex":return x>>>1;case"base64":return We(U).length;default:if(ie)return Q?-1:ft(U).length;F=(""+F).toLowerCase(),ie=!0}}k.byteLength=ce;function Ie(U,F,x){let Q=!1;if((F===void 0||F<0)&&(F=0),F>this.length||((x===void 0||x>this.length)&&(x=this.length),x<=0)||(x>>>=0,F>>>=0,x<=F))return"";for(U||(U="utf8");;)switch(U){case"hex":return le(this,F,x);case"utf8":case"utf-8":return Le(this,F,x);case"ascii":return Be(this,F,x);case"latin1":case"binary":return ge(this,F,x);case"base64":return Re(this,F,x);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $e(this,F,x);default:if(Q)throw new TypeError("Unknown encoding: "+U);U=(U+"").toLowerCase(),Q=!0}}k.prototype._isBuffer=!0;function Y(U,F,x){const Q=U[F];U[F]=U[x],U[x]=Q}k.prototype.swap16=function(){const F=this.length;if(F%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let x=0;x<F;x+=2)Y(this,x,x+1);return this},k.prototype.swap32=function(){const F=this.length;if(F%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let x=0;x<F;x+=4)Y(this,x,x+3),Y(this,x+1,x+2);return this},k.prototype.swap64=function(){const F=this.length;if(F%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let x=0;x<F;x+=8)Y(this,x,x+7),Y(this,x+1,x+6),Y(this,x+2,x+5),Y(this,x+3,x+4);return this},k.prototype.toString=function(){const F=this.length;return F===0?"":arguments.length===0?Le(this,0,F):Ie.apply(this,arguments)},k.prototype.toLocaleString=k.prototype.toString,k.prototype.equals=function(F){if(!k.isBuffer(F))throw new TypeError("Argument must be a Buffer");return this===F?!0:k.compare(this,F)===0},k.prototype.inspect=function(){let F="";const x=g.INSPECT_MAX_BYTES;return F=this.toString("hex",0,x).replace(/(.{2})/g,"$1 ").trim(),this.length>x&&(F+=" ... "),"<Buffer "+F+">"},S&&(k.prototype[S]=k.prototype.inspect),k.prototype.compare=function(F,x,Q,ie,me){if(rr(F,R)&&(F=k.from(F,F.offset,F.byteLength)),!k.isBuffer(F))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof F);if(x===void 0&&(x=0),Q===void 0&&(Q=F?F.length:0),ie===void 0&&(ie=0),me===void 0&&(me=this.length),x<0||Q>F.length||ie<0||me>this.length)throw new RangeError("out of range index");if(ie>=me&&x>=Q)return 0;if(ie>=me)return-1;if(x>=Q)return 1;if(x>>>=0,Q>>>=0,ie>>>=0,me>>>=0,this===F)return 0;let _e=me-ie,tt=Q-x;const Pt=Math.min(_e,tt),_t=this.slice(ie,me),Ot=F.slice(x,Q);for(let ht=0;ht<Pt;++ht)if(_t[ht]!==Ot[ht]){_e=_t[ht],tt=Ot[ht];break}return _e<tt?-1:tt<_e?1:0};function _(U,F,x,Q,ie){if(U.length===0)return-1;if(typeof x=="string"?(Q=x,x=0):x>2147483647?x=2147483647:x<-2147483648&&(x=-2147483648),x=+x,Kf(x)&&(x=ie?0:U.length-1),x<0&&(x=U.length+x),x>=U.length){if(ie)return-1;x=U.length-1}else if(x<0)if(ie)x=0;else return-1;if(typeof F=="string"&&(F=k.from(F,Q)),k.isBuffer(F))return F.length===0?-1:P(U,F,x,Q,ie);if(typeof F=="number")return F=F&255,typeof R.prototype.indexOf=="function"?ie?R.prototype.indexOf.call(U,F,x):R.prototype.lastIndexOf.call(U,F,x):P(U,[F],x,Q,ie);throw new TypeError("val must be string, number or Buffer")}function P(U,F,x,Q,ie){let me=1,_e=U.length,tt=F.length;if(Q!==void 0&&(Q=String(Q).toLowerCase(),Q==="ucs2"||Q==="ucs-2"||Q==="utf16le"||Q==="utf-16le")){if(U.length<2||F.length<2)return-1;me=2,_e/=2,tt/=2,x/=2}function Pt(Ot,ht){return me===1?Ot[ht]:Ot.readUInt16BE(ht*me)}let _t;if(ie){let Ot=-1;for(_t=x;_t<_e;_t++)if(Pt(U,_t)===Pt(F,Ot===-1?0:_t-Ot)){if(Ot===-1&&(Ot=_t),_t-Ot+1===tt)return Ot*me}else Ot!==-1&&(_t-=_t-Ot),Ot=-1}else for(x+tt>_e&&(x=_e-tt),_t=x;_t>=0;_t--){let Ot=!0;for(let ht=0;ht<tt;ht++)if(Pt(U,_t+ht)!==Pt(F,ht)){Ot=!1;break}if(Ot)return _t}return-1}k.prototype.includes=function(F,x,Q){return this.indexOf(F,x,Q)!==-1},k.prototype.indexOf=function(F,x,Q){return _(this,F,x,Q,!0)},k.prototype.lastIndexOf=function(F,x,Q){return _(this,F,x,Q,!1)};function K(U,F,x,Q){x=Number(x)||0;const ie=U.length-x;Q?(Q=Number(Q),Q>ie&&(Q=ie)):Q=ie;const me=F.length;Q>me/2&&(Q=me/2);let _e;for(_e=0;_e<Q;++_e){const tt=parseInt(F.substr(_e*2,2),16);if(Kf(tt))return _e;U[x+_e]=tt}return _e}function V(U,F,x,Q){return wn(ft(F,U.length-x),U,x,Q)}function B(U,F,x,Q){return wn(Pe(F),U,x,Q)}function q(U,F,x,Q){return wn(We(F),U,x,Q)}function ue(U,F,x,Q){return wn(je(F,U.length-x),U,x,Q)}k.prototype.write=function(F,x,Q,ie){if(x===void 0)ie="utf8",Q=this.length,x=0;else if(Q===void 0&&typeof x=="string")ie=x,Q=this.length,x=0;else if(isFinite(x))x=x>>>0,isFinite(Q)?(Q=Q>>>0,ie===void 0&&(ie="utf8")):(ie=Q,Q=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const me=this.length-x;if((Q===void 0||Q>me)&&(Q=me),F.length>0&&(Q<0||x<0)||x>this.length)throw new RangeError("Attempt to write outside buffer bounds");ie||(ie="utf8");let _e=!1;for(;;)switch(ie){case"hex":return K(this,F,x,Q);case"utf8":case"utf-8":return V(this,F,x,Q);case"ascii":case"latin1":case"binary":return B(this,F,x,Q);case"base64":return q(this,F,x,Q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,F,x,Q);default:if(_e)throw new TypeError("Unknown encoding: "+ie);ie=(""+ie).toLowerCase(),_e=!0}},k.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Re(U,F,x){return F===0&&x===U.length?h.fromByteArray(U):h.fromByteArray(U.slice(F,x))}function Le(U,F,x){x=Math.min(U.length,x);const Q=[];let ie=F;for(;ie<x;){const me=U[ie];let _e=null,tt=me>239?4:me>223?3:me>191?2:1;if(ie+tt<=x){let Pt,_t,Ot,ht;switch(tt){case 1:me<128&&(_e=me);break;case 2:Pt=U[ie+1],(Pt&192)===128&&(ht=(me&31)<<6|Pt&63,ht>127&&(_e=ht));break;case 3:Pt=U[ie+1],_t=U[ie+2],(Pt&192)===128&&(_t&192)===128&&(ht=(me&15)<<12|(Pt&63)<<6|_t&63,ht>2047&&(ht<55296||ht>57343)&&(_e=ht));break;case 4:Pt=U[ie+1],_t=U[ie+2],Ot=U[ie+3],(Pt&192)===128&&(_t&192)===128&&(Ot&192)===128&&(ht=(me&15)<<18|(Pt&63)<<12|(_t&63)<<6|Ot&63,ht>65535&&ht<1114112&&(_e=ht))}}_e===null?(_e=65533,tt=1):_e>65535&&(_e-=65536,Q.push(_e>>>10&1023|55296),_e=56320|_e&1023),Q.push(_e),ie+=tt}return Fe(Q)}const ke=4096;function Fe(U){const F=U.length;if(F<=ke)return String.fromCharCode.apply(String,U);let x="",Q=0;for(;Q<F;)x+=String.fromCharCode.apply(String,U.slice(Q,Q+=ke));return x}function Be(U,F,x){let Q="";x=Math.min(U.length,x);for(let ie=F;ie<x;++ie)Q+=String.fromCharCode(U[ie]&127);return Q}function ge(U,F,x){let Q="";x=Math.min(U.length,x);for(let ie=F;ie<x;++ie)Q+=String.fromCharCode(U[ie]);return Q}function le(U,F,x){const Q=U.length;(!F||F<0)&&(F=0),(!x||x<0||x>Q)&&(x=Q);let ie="";for(let me=F;me<x;++me)ie+=A2[U[me]];return ie}function $e(U,F,x){const Q=U.slice(F,x);let ie="";for(let me=0;me<Q.length-1;me+=2)ie+=String.fromCharCode(Q[me]+Q[me+1]*256);return ie}k.prototype.slice=function(F,x){const Q=this.length;F=~~F,x=x===void 0?Q:~~x,F<0?(F+=Q,F<0&&(F=0)):F>Q&&(F=Q),x<0?(x+=Q,x<0&&(x=0)):x>Q&&(x=Q),x<F&&(x=F);const ie=this.subarray(F,x);return Object.setPrototypeOf(ie,k.prototype),ie};function De(U,F,x){if(U%1!==0||U<0)throw new RangeError("offset is not uint");if(U+F>x)throw new RangeError("Trying to access beyond buffer length")}k.prototype.readUintLE=k.prototype.readUIntLE=function(F,x,Q){F=F>>>0,x=x>>>0,Q||De(F,x,this.length);let ie=this[F],me=1,_e=0;for(;++_e<x&&(me*=256);)ie+=this[F+_e]*me;return ie},k.prototype.readUintBE=k.prototype.readUIntBE=function(F,x,Q){F=F>>>0,x=x>>>0,Q||De(F,x,this.length);let ie=this[F+--x],me=1;for(;x>0&&(me*=256);)ie+=this[F+--x]*me;return ie},k.prototype.readUint8=k.prototype.readUInt8=function(F,x){return F=F>>>0,x||De(F,1,this.length),this[F]},k.prototype.readUint16LE=k.prototype.readUInt16LE=function(F,x){return F=F>>>0,x||De(F,2,this.length),this[F]|this[F+1]<<8},k.prototype.readUint16BE=k.prototype.readUInt16BE=function(F,x){return F=F>>>0,x||De(F,2,this.length),this[F]<<8|this[F+1]},k.prototype.readUint32LE=k.prototype.readUInt32LE=function(F,x){return F=F>>>0,x||De(F,4,this.length),(this[F]|this[F+1]<<8|this[F+2]<<16)+this[F+3]*16777216},k.prototype.readUint32BE=k.prototype.readUInt32BE=function(F,x){return F=F>>>0,x||De(F,4,this.length),this[F]*16777216+(this[F+1]<<16|this[F+2]<<8|this[F+3])},k.prototype.readBigUInt64LE=$r(function(F){F=F>>>0,te(F,"offset");const x=this[F],Q=this[F+7];(x===void 0||Q===void 0)&&de(F,this.length-8);const ie=x+this[++F]*2**8+this[++F]*2**16+this[++F]*2**24,me=this[++F]+this[++F]*2**8+this[++F]*2**16+Q*2**24;return BigInt(ie)+(BigInt(me)<<BigInt(32))}),k.prototype.readBigUInt64BE=$r(function(F){F=F>>>0,te(F,"offset");const x=this[F],Q=this[F+7];(x===void 0||Q===void 0)&&de(F,this.length-8);const ie=x*2**24+this[++F]*2**16+this[++F]*2**8+this[++F],me=this[++F]*2**24+this[++F]*2**16+this[++F]*2**8+Q;return(BigInt(ie)<<BigInt(32))+BigInt(me)}),k.prototype.readIntLE=function(F,x,Q){F=F>>>0,x=x>>>0,Q||De(F,x,this.length);let ie=this[F],me=1,_e=0;for(;++_e<x&&(me*=256);)ie+=this[F+_e]*me;return me*=128,ie>=me&&(ie-=Math.pow(2,8*x)),ie},k.prototype.readIntBE=function(F,x,Q){F=F>>>0,x=x>>>0,Q||De(F,x,this.length);let ie=x,me=1,_e=this[F+--ie];for(;ie>0&&(me*=256);)_e+=this[F+--ie]*me;return me*=128,_e>=me&&(_e-=Math.pow(2,8*x)),_e},k.prototype.readInt8=function(F,x){return F=F>>>0,x||De(F,1,this.length),this[F]&128?(255-this[F]+1)*-1:this[F]},k.prototype.readInt16LE=function(F,x){F=F>>>0,x||De(F,2,this.length);const Q=this[F]|this[F+1]<<8;return Q&32768?Q|4294901760:Q},k.prototype.readInt16BE=function(F,x){F=F>>>0,x||De(F,2,this.length);const Q=this[F+1]|this[F]<<8;return Q&32768?Q|4294901760:Q},k.prototype.readInt32LE=function(F,x){return F=F>>>0,x||De(F,4,this.length),this[F]|this[F+1]<<8|this[F+2]<<16|this[F+3]<<24},k.prototype.readInt32BE=function(F,x){return F=F>>>0,x||De(F,4,this.length),this[F]<<24|this[F+1]<<16|this[F+2]<<8|this[F+3]},k.prototype.readBigInt64LE=$r(function(F){F=F>>>0,te(F,"offset");const x=this[F],Q=this[F+7];(x===void 0||Q===void 0)&&de(F,this.length-8);const ie=this[F+4]+this[F+5]*2**8+this[F+6]*2**16+(Q<<24);return(BigInt(ie)<<BigInt(32))+BigInt(x+this[++F]*2**8+this[++F]*2**16+this[++F]*2**24)}),k.prototype.readBigInt64BE=$r(function(F){F=F>>>0,te(F,"offset");const x=this[F],Q=this[F+7];(x===void 0||Q===void 0)&&de(F,this.length-8);const ie=(x<<24)+this[++F]*2**16+this[++F]*2**8+this[++F];return(BigInt(ie)<<BigInt(32))+BigInt(this[++F]*2**24+this[++F]*2**16+this[++F]*2**8+Q)}),k.prototype.readFloatLE=function(F,x){return F=F>>>0,x||De(F,4,this.length),y.read(this,F,!0,23,4)},k.prototype.readFloatBE=function(F,x){return F=F>>>0,x||De(F,4,this.length),y.read(this,F,!1,23,4)},k.prototype.readDoubleLE=function(F,x){return F=F>>>0,x||De(F,8,this.length),y.read(this,F,!0,52,8)},k.prototype.readDoubleBE=function(F,x){return F=F>>>0,x||De(F,8,this.length),y.read(this,F,!1,52,8)};function Je(U,F,x,Q,ie,me){if(!k.isBuffer(U))throw new TypeError('"buffer" argument must be a Buffer instance');if(F>ie||F<me)throw new RangeError('"value" argument is out of bounds');if(x+Q>U.length)throw new RangeError("Index out of range")}k.prototype.writeUintLE=k.prototype.writeUIntLE=function(F,x,Q,ie){if(F=+F,x=x>>>0,Q=Q>>>0,!ie){const tt=Math.pow(2,8*Q)-1;Je(this,F,x,Q,tt,0)}let me=1,_e=0;for(this[x]=F&255;++_e<Q&&(me*=256);)this[x+_e]=F/me&255;return x+Q},k.prototype.writeUintBE=k.prototype.writeUIntBE=function(F,x,Q,ie){if(F=+F,x=x>>>0,Q=Q>>>0,!ie){const tt=Math.pow(2,8*Q)-1;Je(this,F,x,Q,tt,0)}let me=Q-1,_e=1;for(this[x+me]=F&255;--me>=0&&(_e*=256);)this[x+me]=F/_e&255;return x+Q},k.prototype.writeUint8=k.prototype.writeUInt8=function(F,x,Q){return F=+F,x=x>>>0,Q||Je(this,F,x,1,255,0),this[x]=F&255,x+1},k.prototype.writeUint16LE=k.prototype.writeUInt16LE=function(F,x,Q){return F=+F,x=x>>>0,Q||Je(this,F,x,2,65535,0),this[x]=F&255,this[x+1]=F>>>8,x+2},k.prototype.writeUint16BE=k.prototype.writeUInt16BE=function(F,x,Q){return F=+F,x=x>>>0,Q||Je(this,F,x,2,65535,0),this[x]=F>>>8,this[x+1]=F&255,x+2},k.prototype.writeUint32LE=k.prototype.writeUInt32LE=function(F,x,Q){return F=+F,x=x>>>0,Q||Je(this,F,x,4,4294967295,0),this[x+3]=F>>>24,this[x+2]=F>>>16,this[x+1]=F>>>8,this[x]=F&255,x+4},k.prototype.writeUint32BE=k.prototype.writeUInt32BE=function(F,x,Q){return F=+F,x=x>>>0,Q||Je(this,F,x,4,4294967295,0),this[x]=F>>>24,this[x+1]=F>>>16,this[x+2]=F>>>8,this[x+3]=F&255,x+4};function ut(U,F,x,Q,ie){H(F,Q,ie,U,x,7);let me=Number(F&BigInt(4294967295));U[x++]=me,me=me>>8,U[x++]=me,me=me>>8,U[x++]=me,me=me>>8,U[x++]=me;let _e=Number(F>>BigInt(32)&BigInt(4294967295));return U[x++]=_e,_e=_e>>8,U[x++]=_e,_e=_e>>8,U[x++]=_e,_e=_e>>8,U[x++]=_e,x}function ct(U,F,x,Q,ie){H(F,Q,ie,U,x,7);let me=Number(F&BigInt(4294967295));U[x+7]=me,me=me>>8,U[x+6]=me,me=me>>8,U[x+5]=me,me=me>>8,U[x+4]=me;let _e=Number(F>>BigInt(32)&BigInt(4294967295));return U[x+3]=_e,_e=_e>>8,U[x+2]=_e,_e=_e>>8,U[x+1]=_e,_e=_e>>8,U[x]=_e,x+8}k.prototype.writeBigUInt64LE=$r(function(F,x=0){return ut(this,F,x,BigInt(0),BigInt("0xffffffffffffffff"))}),k.prototype.writeBigUInt64BE=$r(function(F,x=0){return ct(this,F,x,BigInt(0),BigInt("0xffffffffffffffff"))}),k.prototype.writeIntLE=function(F,x,Q,ie){if(F=+F,x=x>>>0,!ie){const Pt=Math.pow(2,8*Q-1);Je(this,F,x,Q,Pt-1,-Pt)}let me=0,_e=1,tt=0;for(this[x]=F&255;++me<Q&&(_e*=256);)F<0&&tt===0&&this[x+me-1]!==0&&(tt=1),this[x+me]=(F/_e>>0)-tt&255;return x+Q},k.prototype.writeIntBE=function(F,x,Q,ie){if(F=+F,x=x>>>0,!ie){const Pt=Math.pow(2,8*Q-1);Je(this,F,x,Q,Pt-1,-Pt)}let me=Q-1,_e=1,tt=0;for(this[x+me]=F&255;--me>=0&&(_e*=256);)F<0&&tt===0&&this[x+me+1]!==0&&(tt=1),this[x+me]=(F/_e>>0)-tt&255;return x+Q},k.prototype.writeInt8=function(F,x,Q){return F=+F,x=x>>>0,Q||Je(this,F,x,1,127,-128),F<0&&(F=255+F+1),this[x]=F&255,x+1},k.prototype.writeInt16LE=function(F,x,Q){return F=+F,x=x>>>0,Q||Je(this,F,x,2,32767,-32768),this[x]=F&255,this[x+1]=F>>>8,x+2},k.prototype.writeInt16BE=function(F,x,Q){return F=+F,x=x>>>0,Q||Je(this,F,x,2,32767,-32768),this[x]=F>>>8,this[x+1]=F&255,x+2},k.prototype.writeInt32LE=function(F,x,Q){return F=+F,x=x>>>0,Q||Je(this,F,x,4,2147483647,-2147483648),this[x]=F&255,this[x+1]=F>>>8,this[x+2]=F>>>16,this[x+3]=F>>>24,x+4},k.prototype.writeInt32BE=function(F,x,Q){return F=+F,x=x>>>0,Q||Je(this,F,x,4,2147483647,-2147483648),F<0&&(F=4294967295+F+1),this[x]=F>>>24,this[x+1]=F>>>16,this[x+2]=F>>>8,this[x+3]=F&255,x+4},k.prototype.writeBigInt64LE=$r(function(F,x=0){return ut(this,F,x,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),k.prototype.writeBigInt64BE=$r(function(F,x=0){return ct(this,F,x,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Qt(U,F,x,Q,ie,me){if(x+Q>U.length)throw new RangeError("Index out of range");if(x<0)throw new RangeError("Index out of range")}function Xt(U,F,x,Q,ie){return F=+F,x=x>>>0,ie||Qt(U,F,x,4),y.write(U,F,x,Q,23,4),x+4}k.prototype.writeFloatLE=function(F,x,Q){return Xt(this,F,x,!0,Q)},k.prototype.writeFloatBE=function(F,x,Q){return Xt(this,F,x,!1,Q)};function Ft(U,F,x,Q,ie){return F=+F,x=x>>>0,ie||Qt(U,F,x,8),y.write(U,F,x,Q,52,8),x+8}k.prototype.writeDoubleLE=function(F,x,Q){return Ft(this,F,x,!0,Q)},k.prototype.writeDoubleBE=function(F,x,Q){return Ft(this,F,x,!1,Q)},k.prototype.copy=function(F,x,Q,ie){if(!k.isBuffer(F))throw new TypeError("argument should be a Buffer");if(Q||(Q=0),!ie&&ie!==0&&(ie=this.length),x>=F.length&&(x=F.length),x||(x=0),ie>0&&ie<Q&&(ie=Q),ie===Q||F.length===0||this.length===0)return 0;if(x<0)throw new RangeError("targetStart out of bounds");if(Q<0||Q>=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),F.length-x<ie-Q&&(ie=F.length-x+Q);const me=ie-Q;return this===F&&typeof R.prototype.copyWithin=="function"?this.copyWithin(x,Q,ie):R.prototype.set.call(F,this.subarray(Q,ie),x),me},k.prototype.fill=function(F,x,Q,ie){if(typeof F=="string"){if(typeof x=="string"?(ie=x,x=0,Q=this.length):typeof Q=="string"&&(ie=Q,Q=this.length),ie!==void 0&&typeof ie!="string")throw new TypeError("encoding must be a string");if(typeof ie=="string"&&!k.isEncoding(ie))throw new TypeError("Unknown encoding: "+ie);if(F.length===1){const _e=F.charCodeAt(0);(ie==="utf8"&&_e<128||ie==="latin1")&&(F=_e)}}else typeof F=="number"?F=F&255:typeof F=="boolean"&&(F=Number(F));if(x<0||this.length<x||this.length<Q)throw new RangeError("Out of range index");if(Q<=x)return this;x=x>>>0,Q=Q===void 0?this.length:Q>>>0,F||(F=0);let me;if(typeof F=="number")for(me=x;me<Q;++me)this[me]=F;else{const _e=k.isBuffer(F)?F:k.from(F,ie),tt=_e.length;if(tt===0)throw new TypeError('The value "'+F+'" is invalid for argument "value"');for(me=0;me<Q-x;++me)this[me+x]=_e[me%tt]}return this};const Ue={};function M(U,F,x){Ue[U]=class extends x{constructor(){super(),Object.defineProperty(this,"message",{value:F.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}`}}}M("ERR_BUFFER_OUT_OF_BOUNDS",function(U){return U?`${U} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),M("ERR_INVALID_ARG_TYPE",function(U,F){return`The "${U}" argument must be of type number. Received type ${typeof F}`},TypeError),M("ERR_OUT_OF_RANGE",function(U,F,x){let Q=`The value of "${U}" is out of range.`,ie=x;return Number.isInteger(x)&&Math.abs(x)>2**32?ie=C(String(x)):typeof x=="bigint"&&(ie=String(x),(x>BigInt(2)**BigInt(32)||x<-(BigInt(2)**BigInt(32)))&&(ie=C(ie)),ie+="n"),Q+=` It must be ${F}. Received ${ie}`,Q},RangeError);function C(U){let F="",x=U.length;const Q=U[0]==="-"?1:0;for(;x>=Q+4;x-=3)F=`_${U.slice(x-3,x)}${F}`;return`${U.slice(0,x)}${F}`}function O(U,F,x){te(F,"offset"),(U[F]===void 0||U[F+x]===void 0)&&de(F,U.length-(x+1))}function H(U,F,x,Q,ie,me){if(U>x||U<F){const _e=typeof F=="bigint"?"n":"";let tt;throw F===0||F===BigInt(0)?tt=`>= 0${_e} and < 2${_e} ** ${(me+1)*8}${_e}`:tt=`>= -(2${_e} ** ${(me+1)*8-1}${_e}) and < 2 ** ${(me+1)*8-1}${_e}`,new Ue.ERR_OUT_OF_RANGE("value",tt,U)}O(Q,ie,me)}function te(U,F){if(typeof U!="number")throw new Ue.ERR_INVALID_ARG_TYPE(F,"number",U)}function de(U,F,x){throw Math.floor(U)!==U?(te(U,x),new Ue.ERR_OUT_OF_RANGE("offset","an integer",U)):F<0?new Ue.ERR_BUFFER_OUT_OF_BOUNDS:new Ue.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${F}`,U)}const Ae=/[^+/0-9A-Za-z-_]/g;function Ze(U){if(U=U.split("=")[0],U=U.trim().replace(Ae,""),U.length<2)return"";for(;U.length%4!==0;)U=U+"=";return U}function ft(U,F){F=F||1/0;let x;const Q=U.length;let ie=null;const me=[];for(let _e=0;_e<Q;++_e){if(x=U.charCodeAt(_e),x>55295&&x<57344){if(!ie){if(x>56319){(F-=3)>-1&&me.push(239,191,189);continue}else if(_e+1===Q){(F-=3)>-1&&me.push(239,191,189);continue}ie=x;continue}if(x<56320){(F-=3)>-1&&me.push(239,191,189),ie=x;continue}x=(ie-55296<<10|x-56320)+65536}else ie&&(F-=3)>-1&&me.push(239,191,189);if(ie=null,x<128){if((F-=1)<0)break;me.push(x)}else if(x<2048){if((F-=2)<0)break;me.push(x>>6|192,x&63|128)}else if(x<65536){if((F-=3)<0)break;me.push(x>>12|224,x>>6&63|128,x&63|128)}else if(x<1114112){if((F-=4)<0)break;me.push(x>>18|240,x>>12&63|128,x>>6&63|128,x&63|128)}else throw new Error("Invalid code point")}return me}function Pe(U){const F=[];for(let x=0;x<U.length;++x)F.push(U.charCodeAt(x)&255);return F}function je(U,F){let x,Q,ie;const me=[];for(let _e=0;_e<U.length&&!((F-=2)<0);++_e)x=U.charCodeAt(_e),Q=x>>8,ie=x%256,me.push(ie),me.push(Q);return me}function We(U){return h.toByteArray(Ze(U))}function wn(U,F,x,Q){let ie;for(ie=0;ie<Q&&!(ie+x>=F.length||ie>=U.length);++ie)F[ie+x]=U[ie];return ie}function rr(U,F){return U instanceof F||U!=null&&U.constructor!=null&&U.constructor.name!=null&&U.constructor.name===F.name}function Kf(U){return U!==U}const A2=function(){const U="0123456789abcdef",F=new Array(256);for(let x=0;x<16;++x){const Q=x*16;for(let ie=0;ie<16;++ie)F[Q+ie]=U[x]+U[ie]}return F}();function $r(U){return typeof BigInt>"u"?R2:U}function R2(){throw new Error("BigInt not supported")}})(t);const v=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=v,e.isAscii=t.isAscii,e.isUtf8=t.isUtf8,e.kMaxLength=t.kMaxLength,e.kStringMaxLength=t.kStringMaxLength,e.resolveObjectURL=t.resolveObjectURL,e.transcode=t.transcode}(Yl)),Yl}var Jl={},Zl={},ec,Jh;function Zh(){return Jh||(Jh=1,ec=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}),ec}var tc,eg;function Ts(){if(eg)return tc;eg=1;var e=Zh();return tc=function(){return e()&&!!Symbol.toStringTag},tc}var nc,tg;function ng(){return tg||(tg=1,nc=Object),nc}var rc,rg;function IA(){return rg||(rg=1,rc=Error),rc}var ic,ig;function CA(){return ig||(ig=1,ic=EvalError),ic}var oc,og;function FA(){return og||(og=1,oc=RangeError),oc}var sc,sg;function PA(){return sg||(sg=1,sc=ReferenceError),sc}var ac,ag;function lg(){return ag||(ag=1,ac=SyntaxError),ac}var lc,cg;function uo(){return cg||(cg=1,lc=TypeError),lc}var cc,ug;function OA(){return ug||(ug=1,cc=URIError),cc}var uc,fg;function xA(){return fg||(fg=1,uc=Math.abs),uc}var fc,dg;function kA(){return dg||(dg=1,fc=Math.floor),fc}var dc,pg;function NA(){return pg||(pg=1,dc=Math.max),dc}var pc,hg;function $A(){return hg||(hg=1,pc=Math.min),pc}var hc,gg;function DA(){return gg||(gg=1,hc=Math.pow),hc}var gc,mg;function LA(){return mg||(mg=1,gc=Math.round),gc}var mc,yg;function MA(){return yg||(yg=1,mc=Number.isNaN||function(t){return t!==t}),mc}var yc,bg;function BA(){if(bg)return yc;bg=1;var e=MA();return yc=function(n){return e(n)||n===0?n:n<0?-1:1},yc}var bc,vg;function jA(){return vg||(vg=1,bc=Object.getOwnPropertyDescriptor),bc}var vc,wg;function Ci(){if(wg)return vc;wg=1;var e=jA();if(e)try{e([],"length")}catch{e=null}return vc=e,vc}var wc,Sg;function As(){if(Sg)return wc;Sg=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return wc=e,wc}var Sc,Eg;function UA(){if(Eg)return Sc;Eg=1;var e=typeof Symbol<"u"&&Symbol,t=Zh();return Sc=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Sc}var Ec,Tg;function Ag(){return Tg||(Tg=1,Ec=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Ec}var Tc,Rg;function _g(){if(Rg)return Tc;Rg=1;var e=ng();return Tc=e.getPrototypeOf||null,Tc}var Ac,Ig;function qA(){if(Ig)return Ac;Ig=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=[],f=0;f<c.length;f+=1)l[f]=c[f];for(var d=0;d<u.length;d+=1)l[d+c.length]=u[d];return l},i=function(c,u){for(var l=[],f=u,d=0;f<c.length;f+=1,d+=1)l[d]=c[f];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 Ac=function(c){var u=this;if(typeof u!="function"||t.apply(u)!==r)throw new TypeError(e+u);for(var l=i(arguments,1),f,d=function(){if(this instanceof f){var v=u.apply(this,o(l,arguments));return Object(v)===v?v:this}return u.apply(c,o(l,arguments))},m=n(0,u.length-l.length),w=[],b=0;b<m;b++)w[b]="$"+b;if(f=Function("binder","return function ("+s(w,",")+"){ return binder.apply(this,arguments); }")(d),u.prototype){var T=function(){};T.prototype=u.prototype,f.prototype=new T,T.prototype=null}return f},Ac}var Rc,Cg;function fo(){if(Cg)return Rc;Cg=1;var e=qA();return Rc=Function.prototype.bind||e,Rc}var _c,Fg;function Ic(){return Fg||(Fg=1,_c=Function.prototype.call),_c}var Cc,Pg;function Fc(){return Pg||(Pg=1,Cc=Function.prototype.apply),Cc}var Pc,Og;function VA(){return Og||(Og=1,Pc=typeof Reflect<"u"&&Reflect&&Reflect.apply),Pc}var Oc,xg;function kg(){if(xg)return Oc;xg=1;var e=fo(),t=Fc(),n=Ic(),r=VA();return Oc=r||e.call(n,t),Oc}var xc,Ng;function kc(){if(Ng)return xc;Ng=1;var e=fo(),t=uo(),n=Ic(),r=kg();return xc=function(i){if(i.length<1||typeof i[0]!="function")throw new t("a function is required");return r(e,n,i)},xc}var Nc,$g;function zA(){if($g)return Nc;$g=1;var e=kc(),t=Ci(),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 Nc=r&&typeof r.get=="function"?e([r.get]):typeof i=="function"?function(a){return i(a==null?a:o(a))}:!1,Nc}var $c,Dg;function Lg(){if(Dg)return $c;Dg=1;var e=Ag(),t=_g(),n=zA();return $c=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,$c}var Dc,Mg;function Bg(){if(Mg)return Dc;Mg=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,n=fo();return Dc=n.call(e,t),Dc}var Lc,jg;function Ug(){if(jg)return Lc;jg=1;var e,t=ng(),n=IA(),r=CA(),o=FA(),i=PA(),s=lg(),a=uo(),c=OA(),u=xA(),l=kA(),f=NA(),d=$A(),m=DA(),w=LA(),b=BA(),T=Function,v=function(K){try{return T('"use strict"; return ('+K+").constructor;")()}catch{}},g=Ci(),h=As(),y=function(){throw new a},S=g?function(){try{return arguments.callee,y}catch{try{return g(arguments,"callee").get}catch{return y}}}():y,E=UA()(),R=Lg(),I=_g(),A=Ag(),$=Fc(),D=Ic(),k={},N=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%":E&&R?R([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":k,"%AsyncGenerator%":k,"%AsyncGeneratorFunction%":k,"%AsyncIteratorPrototype%":k,"%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%":T,"%GeneratorFunction%":k,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&R?R(R([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!E||!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%":o,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!E||!R?e:R(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&R?R(""[Symbol.iterator]()):e,"%Symbol%":E?Symbol:e,"%SyntaxError%":s,"%ThrowTypeError%":S,"%TypedArray%":N,"%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%":h,"%Object.getPrototypeOf%":I,"%Math.abs%":u,"%Math.floor%":l,"%Math.max%":f,"%Math.min%":d,"%Math.pow%":m,"%Math.round%":w,"%Math.sign%":b,"%Reflect.getPrototypeOf%":A};if(R)try{null.error}catch(K){var G=R(R(K));z["%Error.prototype%"]=G}var X=function K(V){var B;if(V==="%AsyncFunction%")B=v("async function () {}");else if(V==="%GeneratorFunction%")B=v("function* () {}");else if(V==="%AsyncGeneratorFunction%")B=v("async function* () {}");else if(V==="%AsyncGenerator%"){var q=K("%AsyncGeneratorFunction%");q&&(B=q.prototype)}else if(V==="%AsyncIteratorPrototype%"){var ue=K("%AsyncGenerator%");ue&&R&&(B=R(ue.prototype))}return z[V]=B,B},se={__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"]},ne=fo(),oe=Bg(),fe=ne.call(D,Array.prototype.concat),we=ne.call($,Array.prototype.splice),Z=ne.call(D,String.prototype.replace),re=ne.call(D,String.prototype.slice),ce=ne.call(D,RegExp.prototype.exec),Ie=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Y=/\\(\\)?/g,_=function(V){var B=re(V,0,1),q=re(V,-1);if(B==="%"&&q!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(q==="%"&&B!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var ue=[];return Z(V,Ie,function(Re,Le,ke,Fe){ue[ue.length]=ke?Z(Fe,Y,"$1"):Le||Re}),ue},P=function(V,B){var q=V,ue;if(oe(se,q)&&(ue=se[q],q="%"+ue[0]+"%"),oe(z,q)){var Re=z[q];if(Re===k&&(Re=X(q)),typeof Re>"u"&&!B)throw new a("intrinsic "+V+" exists, but is not available. Please file an issue!");return{alias:ue,name:q,value:Re}}throw new s("intrinsic "+V+" does not exist!")};return Lc=function(V,B){if(typeof V!="string"||V.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof B!="boolean")throw new a('"allowMissing" argument must be a boolean');if(ce(/^%?[^%]*%?$/,V)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var q=_(V),ue=q.length>0?q[0]:"",Re=P("%"+ue+"%",B),Le=Re.name,ke=Re.value,Fe=!1,Be=Re.alias;Be&&(ue=Be[0],we(q,fe([0,1],Be)));for(var ge=1,le=!0;ge<q.length;ge+=1){var $e=q[ge],De=re($e,0,1),Je=re($e,-1);if((De==='"'||De==="'"||De==="`"||Je==='"'||Je==="'"||Je==="`")&&De!==Je)throw new s("property names with quotes must have matching quotes");if(($e==="constructor"||!le)&&(Fe=!0),ue+="."+$e,Le="%"+ue+"%",oe(z,Le))ke=z[Le];else if(ke!=null){if(!($e in ke)){if(!B)throw new a("base intrinsic for "+V+" exists, but the property is not available.");return}if(g&&ge+1>=q.length){var ut=g(ke,$e);le=!!ut,le&&"get"in ut&&!("originalValue"in ut.get)?ke=ut.get:ke=ke[$e]}else le=oe(ke,$e),ke=ke[$e];le&&!Fe&&(z[Le]=ke)}}return ke},Lc}var Mc,qg;function po(){if(qg)return Mc;qg=1;var e=Ug(),t=kc(),n=t([e("%String.prototype.indexOf%")]);return Mc=function(o,i){var s=e(o,!!i);return typeof s=="function"&&n(o,".prototype.")>-1?t([s]):s},Mc}var Bc,Vg;function WA(){if(Vg)return Bc;Vg=1;var e=Ts()(),t=po(),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,Bc=i?r:o,Bc}var jc,zg;function HA(){if(zg)return jc;zg=1;var e=po(),t=Ts()(),n=Bg(),r=Ci(),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(d){if(!d||typeof d!="object")return!1;var m=r(d,"lastIndex"),w=m&&n(m,"value");if(!w)return!1;try{i(d,c)}catch(b){return b===s}}}else{var u=e("Object.prototype.toString"),l="[object RegExp]";o=function(d){return!d||typeof d!="object"&&typeof d!="function"?!1:u(d)===l}}return jc=o,jc}var Uc,Wg;function GA(){if(Wg)return Uc;Wg=1;var e=po(),t=HA(),n=e("RegExp.prototype.exec"),r=uo();return Uc=function(i){if(!t(i))throw new r("`regex` must be a RegExp");return function(a){return n(i,a)!==null}},Uc}var qc,Hg;function KA(){if(Hg)return qc;Hg=1;var e=po(),t=GA(),n=t(/^\s*(?:function)?\*/),r=Ts()(),o=Lg(),i=e("Object.prototype.toString"),s=e("Function.prototype.toString"),a=function(){if(!r)return!1;try{return Function("return function*() {}")()}catch{}},c;return qc=function(l){if(typeof l!="function")return!1;if(n(s(l)))return!0;if(!r){var f=i(l);return f==="[object GeneratorFunction]"}if(!o)return!1;if(typeof c>"u"){var d=a();c=d?o(d):!1}return o(l)===c},qc}var Vc,Gg;function QA(){if(Gg)return Vc;Gg=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(h){try{var y=e.call(h);return o.test(y)}catch{return!1}},s=function(h){try{return i(h)?!1:(e.call(h),!0)}catch{return!1}},a=Object.prototype.toString,c="[object Object]",u="[object Function]",l="[object GeneratorFunction]",f="[object HTMLAllCollection]",d="[object HTML document.all class]",m="[object HTMLCollection]",w=typeof Symbol=="function"&&!!Symbol.toStringTag,b=!(0 in[,]),T=function(){return!1};if(typeof document=="object"){var v=document.all;a.call(v)===a.call(document.all)&&(T=function(h){if((b||!h)&&(typeof h>"u"||typeof h=="object"))try{var y=a.call(h);return(y===f||y===d||y===m||y===c)&&h("")==null}catch{}return!1})}return Vc=t?function(h){if(T(h))return!0;if(!h||typeof h!="function"&&typeof h!="object")return!1;try{t(h,null,n)}catch(y){if(y!==r)return!1}return!i(h)&&s(h)}:function(h){if(T(h))return!0;if(!h||typeof h!="function"&&typeof h!="object")return!1;if(w)return s(h);if(i(h))return!1;var y=a.call(h);return y!==u&&y!==l&&!/^\[object HTML/.test(y)?!1:s(h)},Vc}var zc,Kg;function XA(){if(Kg)return zc;Kg=1;var e=QA(),t=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(c,u,l){for(var f=0,d=c.length;f<d;f++)n.call(c,f)&&(l==null?u(c[f],f,c):u.call(l,c[f],f,c))},o=function(c,u,l){for(var f=0,d=c.length;f<d;f++)l==null?u(c.charAt(f),f,c):u.call(l,c.charAt(f),f,c)},i=function(c,u,l){for(var f in c)n.call(c,f)&&(l==null?u(c[f],f,c):u.call(l,c[f],f,c))};function s(a){return t.call(a)==="[object Array]"}return zc=function(c,u,l){if(!e(u))throw new TypeError("iterator must be a function");var f;arguments.length>=3&&(f=l),s(c)?r(c,u,f):typeof c=="string"?o(c,u,f):i(c,u,f)},zc}var Wc,Qg;function YA(){return Qg||(Qg=1,Wc=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Wc}var Hc,Xg;function JA(){if(Xg)return Hc;Xg=1;var e=YA(),t=typeof globalThis>"u"?Cr:globalThis;return Hc=function(){for(var r=[],o=0;o<e.length;o++)typeof t[e[o]]=="function"&&(r[r.length]=e[o]);return r},Hc}var Gc={exports:{}},Kc,Yg;function ZA(){if(Yg)return Kc;Yg=1;var e=As(),t=lg(),n=uo(),r=Ci();return Kc=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,f=arguments.length>6?arguments[6]:!1,d=!!r&&r(i,s);if(e)e(i,s,{configurable:l===null&&d?d.configurable:!l,enumerable:c===null&&d?d.enumerable:!c,value:a,writable:u===null&&d?d.writable:!u});else if(f||!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.")},Kc}var Qc,Jg;function eR(){if(Jg)return Qc;Jg=1;var e=As(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},Qc=t,Qc}var Xc,Zg;function tR(){if(Zg)return Xc;Zg=1;var e=Ug(),t=ZA(),n=eR()(),r=Ci(),o=uo(),i=e("%Math.floor%");return Xc=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,f=!0;if("length"in a&&r){var d=r(a,"length");d&&!d.configurable&&(l=!1),d&&!d.writable&&(f=!1)}return(l||f||!u)&&(n?t(a,"length",c,!0,!0):t(a,"length",c)),a},Xc}var Yc,em;function nR(){if(em)return Yc;em=1;var e=fo(),t=Fc(),n=kg();return Yc=function(){return n(e,t,arguments)},Yc}var tm;function rR(){return tm||(tm=1,function(e){var t=tR(),n=As(),r=kc(),o=nR();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}(Gc)),Gc.exports}var Jc,nm;function rm(){if(nm)return Jc;nm=1;var e=XA(),t=JA(),n=rR(),r=po(),o=Ci(),i=r("Object.prototype.toString"),s=Ts()(),a=typeof globalThis>"u"?Cr:globalThis,c=t(),u=r("String.prototype.slice"),l=Object.getPrototypeOf,f=r("Array.prototype.indexOf",!0)||function(T,v){for(var g=0;g<T.length;g+=1)if(T[g]===v)return g;return-1},d={__proto__:null};s&&o&&l?e(c,function(b){var T=new a[b];if(Symbol.toStringTag in T){var v=l(T),g=o(v,Symbol.toStringTag);if(!g){var h=l(v);g=o(h,Symbol.toStringTag)}d["$"+b]=n(g.get)}}):e(c,function(b){var T=new a[b],v=T.slice||T.set;v&&(d["$"+b]=n(v))});var m=function(T){var v=!1;return e(d,function(g,h){if(!v)try{"$"+g(T)===h&&(v=u(h,1))}catch{}}),v},w=function(T){var v=!1;return e(d,function(g,h){if(!v)try{g(T),v=u(h,1)}catch{}}),v};return Jc=function(T){if(!T||typeof T!="object")return!1;if(!s){var v=u(i(T),8,-1);return f(c,v)>-1?v:v!=="Object"?!1:w(T)}return o?m(T):null},Jc}var Zc,im;function iR(){if(im)return Zc;im=1;var e=rm();return Zc=function(n){return!!e(n)},Zc}var om;function oR(){return om||(om=1,function(e){var t=WA(),n=KA(),r=rm(),o=iR();function i(ge){return ge.call.bind(ge)}var s=typeof BigInt<"u",a=typeof Symbol<"u",c=i(Object.prototype.toString),u=i(Number.prototype.valueOf),l=i(String.prototype.valueOf),f=i(Boolean.prototype.valueOf);if(s)var d=i(BigInt.prototype.valueOf);if(a)var m=i(Symbol.prototype.valueOf);function w(ge,le){if(typeof ge!="object")return!1;try{return le(ge),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=n,e.isTypedArray=o;function b(ge){return typeof Promise<"u"&&ge instanceof Promise||ge!==null&&typeof ge=="object"&&typeof ge.then=="function"&&typeof ge.catch=="function"}e.isPromise=b;function T(ge){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(ge):o(ge)||re(ge)}e.isArrayBufferView=T;function v(ge){return r(ge)==="Uint8Array"}e.isUint8Array=v;function g(ge){return r(ge)==="Uint8ClampedArray"}e.isUint8ClampedArray=g;function h(ge){return r(ge)==="Uint16Array"}e.isUint16Array=h;function y(ge){return r(ge)==="Uint32Array"}e.isUint32Array=y;function S(ge){return r(ge)==="Int8Array"}e.isInt8Array=S;function E(ge){return r(ge)==="Int16Array"}e.isInt16Array=E;function R(ge){return r(ge)==="Int32Array"}e.isInt32Array=R;function I(ge){return r(ge)==="Float32Array"}e.isFloat32Array=I;function A(ge){return r(ge)==="Float64Array"}e.isFloat64Array=A;function $(ge){return r(ge)==="BigInt64Array"}e.isBigInt64Array=$;function D(ge){return r(ge)==="BigUint64Array"}e.isBigUint64Array=D;function k(ge){return c(ge)==="[object Map]"}k.working=typeof Map<"u"&&k(new Map);function N(ge){return typeof Map>"u"?!1:k.working?k(ge):ge instanceof Map}e.isMap=N;function z(ge){return c(ge)==="[object Set]"}z.working=typeof Set<"u"&&z(new Set);function G(ge){return typeof Set>"u"?!1:z.working?z(ge):ge instanceof Set}e.isSet=G;function X(ge){return c(ge)==="[object WeakMap]"}X.working=typeof WeakMap<"u"&&X(new WeakMap);function se(ge){return typeof WeakMap>"u"?!1:X.working?X(ge):ge instanceof WeakMap}e.isWeakMap=se;function ne(ge){return c(ge)==="[object WeakSet]"}ne.working=typeof WeakSet<"u"&&ne(new WeakSet);function oe(ge){return ne(ge)}e.isWeakSet=oe;function fe(ge){return c(ge)==="[object ArrayBuffer]"}fe.working=typeof ArrayBuffer<"u"&&fe(new ArrayBuffer);function we(ge){return typeof ArrayBuffer>"u"?!1:fe.working?fe(ge):ge instanceof ArrayBuffer}e.isArrayBuffer=we;function Z(ge){return c(ge)==="[object DataView]"}Z.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Z(new DataView(new ArrayBuffer(1),0,1));function re(ge){return typeof DataView>"u"?!1:Z.working?Z(ge):ge instanceof DataView}e.isDataView=re;var ce=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Ie(ge){return c(ge)==="[object SharedArrayBuffer]"}function Y(ge){return typeof ce>"u"?!1:(typeof Ie.working>"u"&&(Ie.working=Ie(new ce)),Ie.working?Ie(ge):ge instanceof ce)}e.isSharedArrayBuffer=Y;function _(ge){return c(ge)==="[object AsyncFunction]"}e.isAsyncFunction=_;function P(ge){return c(ge)==="[object Map Iterator]"}e.isMapIterator=P;function K(ge){return c(ge)==="[object Set Iterator]"}e.isSetIterator=K;function V(ge){return c(ge)==="[object Generator]"}e.isGeneratorObject=V;function B(ge){return c(ge)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=B;function q(ge){return w(ge,u)}e.isNumberObject=q;function ue(ge){return w(ge,l)}e.isStringObject=ue;function Re(ge){return w(ge,f)}e.isBooleanObject=Re;function Le(ge){return s&&w(ge,d)}e.isBigIntObject=Le;function ke(ge){return a&&w(ge,m)}e.isSymbolObject=ke;function Fe(ge){return q(ge)||ue(ge)||Re(ge)||Le(ge)||ke(ge)}e.isBoxedPrimitive=Fe;function Be(ge){return typeof Uint8Array<"u"&&(we(ge)||Y(ge))}e.isAnyArrayBuffer=Be,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(ge){Object.defineProperty(e,ge,{enumerable:!1,value:function(){throw new Error(ge+" is not supported in userland")}})})}(Zl)),Zl}var eu,sm;function sR(){return sm||(sm=1,eu=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),eu}var am;function lm(){return am||(am=1,function(e){var t=Object.getOwnPropertyDescriptors||function(re){for(var ce=Object.keys(re),Ie={},Y=0;Y<ce.length;Y++)Ie[ce[Y]]=Object.getOwnPropertyDescriptor(re,ce[Y]);return Ie},n=/%[sdj%]/g;e.format=function(Z){if(!S(Z)){for(var re=[],ce=0;ce<arguments.length;ce++)re.push(s(arguments[ce]));return re.join(" ")}for(var ce=1,Ie=arguments,Y=Ie.length,_=String(Z).replace(n,function(K){if(K==="%%")return"%";if(ce>=Y)return K;switch(K){case"%s":return String(Ie[ce++]);case"%d":return Number(Ie[ce++]);case"%j":try{return JSON.stringify(Ie[ce++])}catch{return"[Circular]"}default:return K}}),P=Ie[ce];ce<Y;P=Ie[++ce])g(P)||!A(P)?_+=" "+P:_+=" "+s(P);return _},e.deprecate=function(Z,re){if(typeof be<"u"&&be.noDeprecation===!0)return Z;if(typeof be>"u")return function(){return e.deprecate(Z,re).apply(this,arguments)};var ce=!1;function Ie(){if(!ce){if(be.throwDeprecation)throw new Error(re);be.traceDeprecation?console.trace(re):console.error(re),ce=!0}return Z.apply(this,arguments)}return Ie};var r={},o=/^$/;if(be.env.NODE_DEBUG){var i=be.env.NODE_DEBUG;i=i.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+i+"$","i")}e.debuglog=function(Z){if(Z=Z.toUpperCase(),!r[Z])if(o.test(Z)){var re=be.pid;r[Z]=function(){var ce=e.format.apply(e,arguments);console.error("%s %d: %s",Z,re,ce)}}else r[Z]=function(){};return r[Z]};function s(Z,re){var ce={seen:[],stylize:c};return arguments.length>=3&&(ce.depth=arguments[2]),arguments.length>=4&&(ce.colors=arguments[3]),v(re)?ce.showHidden=re:re&&e._extend(ce,re),R(ce.showHidden)&&(ce.showHidden=!1),R(ce.depth)&&(ce.depth=2),R(ce.colors)&&(ce.colors=!1),R(ce.customInspect)&&(ce.customInspect=!0),ce.colors&&(ce.stylize=a),l(ce,Z,ce.depth)}e.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function a(Z,re){var ce=s.styles[re];return ce?"\x1B["+s.colors[ce][0]+"m"+Z+"\x1B["+s.colors[ce][1]+"m":Z}function c(Z,re){return Z}function u(Z){var re={};return Z.forEach(function(ce,Ie){re[ce]=!0}),re}function l(Z,re,ce){if(Z.customInspect&&re&&k(re.inspect)&&re.inspect!==e.inspect&&!(re.constructor&&re.constructor.prototype===re)){var Ie=re.inspect(ce,Z);return S(Ie)||(Ie=l(Z,Ie,ce)),Ie}var Y=f(Z,re);if(Y)return Y;var _=Object.keys(re),P=u(_);if(Z.showHidden&&(_=Object.getOwnPropertyNames(re)),D(re)&&(_.indexOf("message")>=0||_.indexOf("description")>=0))return d(re);if(_.length===0){if(k(re)){var K=re.name?": "+re.name:"";return Z.stylize("[Function"+K+"]","special")}if(I(re))return Z.stylize(RegExp.prototype.toString.call(re),"regexp");if($(re))return Z.stylize(Date.prototype.toString.call(re),"date");if(D(re))return d(re)}var V="",B=!1,q=["{","}"];if(T(re)&&(B=!0,q=["[","]"]),k(re)){var ue=re.name?": "+re.name:"";V=" [Function"+ue+"]"}if(I(re)&&(V=" "+RegExp.prototype.toString.call(re)),$(re)&&(V=" "+Date.prototype.toUTCString.call(re)),D(re)&&(V=" "+d(re)),_.length===0&&(!B||re.length==0))return q[0]+V+q[1];if(ce<0)return I(re)?Z.stylize(RegExp.prototype.toString.call(re),"regexp"):Z.stylize("[Object]","special");Z.seen.push(re);var Re;return B?Re=m(Z,re,ce,P,_):Re=_.map(function(Le){return w(Z,re,ce,P,Le,B)}),Z.seen.pop(),b(Re,V,q)}function f(Z,re){if(R(re))return Z.stylize("undefined","undefined");if(S(re)){var ce="'"+JSON.stringify(re).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Z.stylize(ce,"string")}if(y(re))return Z.stylize(""+re,"number");if(v(re))return Z.stylize(""+re,"boolean");if(g(re))return Z.stylize("null","null")}function d(Z){return"["+Error.prototype.toString.call(Z)+"]"}function m(Z,re,ce,Ie,Y){for(var _=[],P=0,K=re.length;P<K;++P)ne(re,String(P))?_.push(w(Z,re,ce,Ie,String(P),!0)):_.push("");return Y.forEach(function(V){V.match(/^\d+$/)||_.push(w(Z,re,ce,Ie,V,!0))}),_}function w(Z,re,ce,Ie,Y,_){var P,K,V;if(V=Object.getOwnPropertyDescriptor(re,Y)||{value:re[Y]},V.get?V.set?K=Z.stylize("[Getter/Setter]","special"):K=Z.stylize("[Getter]","special"):V.set&&(K=Z.stylize("[Setter]","special")),ne(Ie,Y)||(P="["+Y+"]"),K||(Z.seen.indexOf(V.value)<0?(g(ce)?K=l(Z,V.value,null):K=l(Z,V.value,ce-1),K.indexOf(`
17
17
  `)>-1&&(_?K=K.split(`
18
18
  `).map(function(B){return" "+B}).join(`
19
19
  `).slice(2):K=`
20
20
  `+K.split(`
21
21
  `).map(function(B){return" "+B}).join(`
22
- `))):K=Z.stylize("[Circular]","special")),R(F)){if(_&&Y.match(/^\d+$/))return K;F=JSON.stringify(""+Y),F.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(F=F.slice(1,-1),F=Z.stylize(F,"name")):(F=F.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),F=Z.stylize(F,"string"))}return F+": "+K}function v(Z,ne,le){var Ie=Z.reduce(function(Y,_){return _.indexOf(`
23
- `)>=0,Y+_.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Ie>60?le[0]+(ne===""?"":ne+`
22
+ `))):K=Z.stylize("[Circular]","special")),R(P)){if(_&&Y.match(/^\d+$/))return K;P=JSON.stringify(""+Y),P.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(P=P.slice(1,-1),P=Z.stylize(P,"name")):(P=P.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),P=Z.stylize(P,"string"))}return P+": "+K}function b(Z,re,ce){var Ie=Z.reduce(function(Y,_){return _.indexOf(`
23
+ `)>=0,Y+_.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Ie>60?ce[0]+(re===""?"":re+`
24
24
  `)+" "+Z.join(`,
25
- `)+" "+le[1]:le[0]+ne+" "+Z.join(", ")+" "+le[1]}e.types=iR();function T(Z){return Array.isArray(Z)}e.isArray=T;function b(Z){return typeof Z=="boolean"}e.isBoolean=b;function g(Z){return Z===null}e.isNull=g;function h(Z){return Z==null}e.isNullOrUndefined=h;function y(Z){return typeof Z=="number"}e.isNumber=y;function S(Z){return typeof Z=="string"}e.isString=S;function E(Z){return typeof Z=="symbol"}e.isSymbol=E;function R(Z){return Z===void 0}e.isUndefined=R;function I(Z){return A(Z)&&j(Z)==="[object RegExp]"}e.isRegExp=I,e.types.isRegExp=I;function A(Z){return typeof Z=="object"&&Z!==null}e.isObject=A;function $(Z){return A(Z)&&j(Z)==="[object Date]"}e.isDate=$,e.types.isDate=$;function D(Z){return A(Z)&&(j(Z)==="[object Error]"||Z instanceof Error)}e.isError=D,e.types.isNativeError=D;function k(Z){return typeof Z=="function"}e.isFunction=k;function N(Z){return Z===null||typeof Z=="boolean"||typeof Z=="number"||typeof Z=="string"||typeof Z=="symbol"||typeof Z>"u"}e.isPrimitive=N,e.isBuffer=oR();function j(Z){return Object.prototype.toString.call(Z)}function W(Z){return Z<10?"0"+Z.toString(10):Z.toString(10)}var X=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ie(){var Z=new Date,ne=[W(Z.getHours()),W(Z.getMinutes()),W(Z.getSeconds())].join(":");return[Z.getDate(),X[Z.getMonth()],ne].join(" ")}e.log=function(){console.log("%s - %s",ie(),e.format.apply(e,arguments))},e.inherits=Jr(),e._extend=function(Z,ne){if(!ne||!A(ne))return Z;for(var le=Object.keys(ne),Ie=le.length;Ie--;)Z[le[Ie]]=ne[le[Ie]];return Z};function de(Z,ne){return Object.prototype.hasOwnProperty.call(Z,ne)}var se=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(se&&ne[se]){var le=ne[se];if(typeof le!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(le,se,{value:le,enumerable:!1,writable:!1,configurable:!0}),le}function le(){for(var Ie,Y,_=new Promise(function(z,B){Ie=z,Y=B}),F=[],K=0;K<arguments.length;K++)F.push(arguments[K]);F.push(function(z,B){z?Y(z):Ie(B)});try{ne.apply(this,F)}catch(z){Y(z)}return _}return Object.setPrototypeOf(le,Object.getPrototypeOf(ne)),se&&Object.defineProperty(le,se,{value:le,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(le,t(ne))},e.promisify.custom=se;function we(Z,ne){if(!Z){var le=new Error("Promise was rejected with a falsy value");le.reason=Z,Z=le}return ne(Z)}function Se(Z){if(typeof Z!="function")throw new TypeError('The "original" argument must be of type Function');function ne(){for(var le=[],Ie=0;Ie<arguments.length;Ie++)le.push(arguments[Ie]);var Y=le.pop();if(typeof Y!="function")throw new TypeError("The last argument must be of type Function");var _=this,F=function(){return Y.apply(_,arguments)};Z.apply(this,le).then(function(K){ye.nextTick(F.bind(null,null,K))},function(K){ye.nextTick(we.bind(null,K,F))})}return Object.setPrototypeOf(ne,Object.getPrototypeOf(Z)),Object.defineProperties(ne,t(Z)),ne}e.callbackify=Se}(Jl)),Jl}var tu,lm;function sR(){if(lm)return tu;lm=1;function e(w,v){var T=Object.keys(w);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(w);v&&(b=b.filter(function(g){return Object.getOwnPropertyDescriptor(w,g).enumerable})),T.push.apply(T,b)}return T}function t(w){for(var v=1;v<arguments.length;v++){var T=arguments[v]!=null?arguments[v]:{};v%2?e(Object(T),!0).forEach(function(b){n(w,b,T[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(T)):e(Object(T)).forEach(function(b){Object.defineProperty(w,b,Object.getOwnPropertyDescriptor(T,b))})}return w}function n(w,v,T){return v=s(v),v in w?Object.defineProperty(w,v,{value:T,enumerable:!0,configurable:!0,writable:!0}):w[v]=T,w}function r(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function o(w,v){for(var T=0;T<v.length;T++){var b=v[T];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(w,s(b.key),b)}}function i(w,v,T){return v&&o(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 T=w[Symbol.toPrimitive];if(T!==void 0){var b=T.call(w,v);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(w)}var c=Es(),u=c.Buffer,l=am(),f=l.inspect,d=f&&f.custom||"inspect";function m(w,v,T){u.prototype.copy.call(w,v,T)}return tu=function(){function w(){r(this,w),this.head=null,this.tail=null,this.length=0}return i(w,[{key:"push",value:function(T){var b={data:T,next:null};this.length>0?this.tail.next=b:this.head=b,this.tail=b,++this.length}},{key:"unshift",value:function(T){var b={data:T,next:this.head};this.length===0&&(this.tail=b),this.head=b,++this.length}},{key:"shift",value:function(){if(this.length!==0){var T=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,T}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(T){if(this.length===0)return"";for(var b=this.head,g=""+b.data;b=b.next;)g+=T+b.data;return g}},{key:"concat",value:function(T){if(this.length===0)return u.alloc(0);for(var b=u.allocUnsafe(T>>>0),g=this.head,h=0;g;)m(g.data,b,h),h+=g.data.length,g=g.next;return b}},{key:"consume",value:function(T,b){var g;return T<this.head.data.length?(g=this.head.data.slice(0,T),this.head.data=this.head.data.slice(T)):T===this.head.data.length?g=this.shift():g=b?this._getString(T):this._getBuffer(T),g}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(T){var b=this.head,g=1,h=b.data;for(T-=h.length;b=b.next;){var y=b.data,S=T>y.length?y.length:T;if(S===y.length?h+=y:h+=y.slice(0,T),T-=S,T===0){S===y.length?(++g,b.next?this.head=b.next:this.head=this.tail=null):(this.head=b,b.data=y.slice(S));break}++g}return this.length-=g,h}},{key:"_getBuffer",value:function(T){var b=u.allocUnsafe(T),g=this.head,h=1;for(g.data.copy(b),T-=g.data.length;g=g.next;){var y=g.data,S=T>y.length?y.length:T;if(y.copy(b,b.length-T,0,S),T-=S,T===0){S===y.length?(++h,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=y.slice(S));break}++h}return this.length-=h,b}},{key:d,value:function(T,b){return f(this,t(t({},b),{},{depth:0,customInspect:!1}))}}]),w}(),tu}var nu,cm;function um(){if(cm)return nu;cm=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,ye.nextTick(o,this,s)):ye.nextTick(o,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(f){!a&&f?c._writableState?c._writableState.errorEmitted?ye.nextTick(n,c):(c._writableState.errorEmitted=!0,ye.nextTick(t,c,f)):ye.nextTick(t,c,f):a?(ye.nextTick(n,c),a(f)):ye.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 nu={destroy:e,undestroy:r,errorOrDestroy:i},nu}var ru={},fm;function Pi(){if(fm)return ru;fm=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(d,m,w){return typeof c=="string"?c:c(d,m,w)}var f=function(d){e(m,d);function m(w,v,T){return d.call(this,l(w,v,T))||this}return m}(u);f.prototype.name=u.name,f.prototype.code=a,t[a]=f}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 f;if(i(a," argument"))f="The ".concat(a," ").concat(l," ").concat(r(c,"type"));else{var d=s(a,".")?"property":"argument";f='The "'.concat(a,'" ').concat(d," ").concat(l," ").concat(r(c,"type"))}return f+=". Received type ".concat(typeof u),f},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"),ru.codes=t,ru}var iu,dm;function pm(){if(dm)return iu;dm=1;var e=Pi().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 iu={getHighWaterMark:n},iu}var ou,hm;function aR(){if(hm)return ou;hm=1,ou=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(!Cr.localStorage)return!1}catch{return!1}var r=Cr.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return ou}var su,gm;function mm(){if(gm)return su;gm=1,su=I;function e(Y){var _=this;this.next=null,this.entry=null,this.finish=function(){Ie(_,Y)}}var t;I.WritableState=E;var n={deprecate:aR()},r=Qh(),o=Es().Buffer,i=(typeof Cr<"u"?Cr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(Y){return o.from(Y)}function a(Y){return o.isBuffer(Y)||Y instanceof i}var c=um(),u=pm(),l=u.getHighWaterMark,f=Pi().codes,d=f.ERR_INVALID_ARG_TYPE,m=f.ERR_METHOD_NOT_IMPLEMENTED,w=f.ERR_MULTIPLE_CALLBACK,v=f.ERR_STREAM_CANNOT_PIPE,T=f.ERR_STREAM_DESTROYED,b=f.ERR_STREAM_NULL_VALUES,g=f.ERR_STREAM_WRITE_AFTER_END,h=f.ERR_UNKNOWN_ENCODING,y=c.errorOrDestroy;Jr()(I,r);function S(){}function E(Y,_,F){t=t||Fi(),Y=Y||{},typeof F!="boolean"&&(F=_ instanceof t),this.objectMode=!!Y.objectMode,F&&(this.objectMode=this.objectMode||!!Y.writableObjectMode),this.highWaterMark=l(this,Y,"writableHighWaterMark",F),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var K=Y.decodeStrings===!1;this.decodeStrings=!K,this.defaultEncoding=Y.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(z){X(_,z)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Y.emitClose!==!1,this.autoDestroy=!!Y.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}E.prototype.getBuffer=function(){for(var _=this.bufferedRequest,F=[];_;)F.push(_),_=_.next;return F},function(){try{Object.defineProperty(E.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var R;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(R=Function.prototype[Symbol.hasInstance],Object.defineProperty(I,Symbol.hasInstance,{value:function(_){return R.call(this,_)?!0:this!==I?!1:_&&_._writableState instanceof E}})):R=function(_){return _ instanceof this};function I(Y){t=t||Fi();var _=this instanceof t;if(!_&&!R.call(I,this))return new I(Y);this._writableState=new E(Y,this,_),this.writable=!0,Y&&(typeof Y.write=="function"&&(this._write=Y.write),typeof Y.writev=="function"&&(this._writev=Y.writev),typeof Y.destroy=="function"&&(this._destroy=Y.destroy),typeof Y.final=="function"&&(this._final=Y.final)),r.call(this)}I.prototype.pipe=function(){y(this,new v)};function A(Y,_){var F=new g;y(Y,F),ye.nextTick(_,F)}function $(Y,_,F,K){var z;return F===null?z=new b:typeof F!="string"&&!_.objectMode&&(z=new d("chunk",["string","Buffer"],F)),z?(y(Y,z),ye.nextTick(K,z),!1):!0}I.prototype.write=function(Y,_,F){var K=this._writableState,z=!1,B=!K.objectMode&&a(Y);return B&&!o.isBuffer(Y)&&(Y=s(Y)),typeof _=="function"&&(F=_,_=null),B?_="buffer":_||(_=K.defaultEncoding),typeof F!="function"&&(F=S),K.ending?A(this,F):(B||$(this,K,Y,F))&&(K.pendingcb++,z=k(this,K,B,Y,_,F)),z},I.prototype.cork=function(){this._writableState.corked++},I.prototype.uncork=function(){var Y=this._writableState;Y.corked&&(Y.corked--,!Y.writing&&!Y.corked&&!Y.bufferProcessing&&Y.bufferedRequest&&se(this,Y))},I.prototype.setDefaultEncoding=function(_){if(typeof _=="string"&&(_=_.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((_+"").toLowerCase())>-1))throw new h(_);return this._writableState.defaultEncoding=_,this},Object.defineProperty(I.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function D(Y,_,F){return!Y.objectMode&&Y.decodeStrings!==!1&&typeof _=="string"&&(_=o.from(_,F)),_}Object.defineProperty(I.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function k(Y,_,F,K,z,B){if(!F){var V=D(_,K,z);K!==V&&(F=!0,z="buffer",K=V)}var ce=_.objectMode?1:K.length;_.length+=ce;var Re=_.length<_.highWaterMark;if(Re||(_.needDrain=!0),_.writing||_.corked){var Le=_.lastBufferedRequest;_.lastBufferedRequest={chunk:K,encoding:z,isBuf:F,callback:B,next:null},Le?Le.next=_.lastBufferedRequest:_.bufferedRequest=_.lastBufferedRequest,_.bufferedRequestCount+=1}else N(Y,_,!1,ce,K,z,B);return Re}function N(Y,_,F,K,z,B,V){_.writelen=K,_.writecb=V,_.writing=!0,_.sync=!0,_.destroyed?_.onwrite(new T("write")):F?Y._writev(z,_.onwrite):Y._write(z,B,_.onwrite),_.sync=!1}function j(Y,_,F,K,z){--_.pendingcb,F?(ye.nextTick(z,K),ye.nextTick(ne,Y,_),Y._writableState.errorEmitted=!0,y(Y,K)):(z(K),Y._writableState.errorEmitted=!0,y(Y,K),ne(Y,_))}function W(Y){Y.writing=!1,Y.writecb=null,Y.length-=Y.writelen,Y.writelen=0}function X(Y,_){var F=Y._writableState,K=F.sync,z=F.writecb;if(typeof z!="function")throw new w;if(W(F),_)j(Y,F,K,_,z);else{var B=we(F)||Y.destroyed;!B&&!F.corked&&!F.bufferProcessing&&F.bufferedRequest&&se(Y,F),K?ye.nextTick(ie,Y,F,B,z):ie(Y,F,B,z)}}function ie(Y,_,F,K){F||de(Y,_),_.pendingcb--,K(),ne(Y,_)}function de(Y,_){_.length===0&&_.needDrain&&(_.needDrain=!1,Y.emit("drain"))}function se(Y,_){_.bufferProcessing=!0;var F=_.bufferedRequest;if(Y._writev&&F&&F.next){var K=_.bufferedRequestCount,z=new Array(K),B=_.corkedRequestsFree;B.entry=F;for(var V=0,ce=!0;F;)z[V]=F,F.isBuf||(ce=!1),F=F.next,V+=1;z.allBuffers=ce,N(Y,_,!0,_.length,z,"",B.finish),_.pendingcb++,_.lastBufferedRequest=null,B.next?(_.corkedRequestsFree=B.next,B.next=null):_.corkedRequestsFree=new e(_),_.bufferedRequestCount=0}else{for(;F;){var Re=F.chunk,Le=F.encoding,ke=F.callback,Pe=_.objectMode?1:Re.length;if(N(Y,_,!1,Pe,Re,Le,ke),F=F.next,_.bufferedRequestCount--,_.writing)break}F===null&&(_.lastBufferedRequest=null)}_.bufferedRequest=F,_.bufferProcessing=!1}I.prototype._write=function(Y,_,F){F(new m("_write()"))},I.prototype._writev=null,I.prototype.end=function(Y,_,F){var K=this._writableState;return typeof Y=="function"?(F=Y,Y=null,_=null):typeof _=="function"&&(F=_,_=null),Y!=null&&this.write(Y,_),K.corked&&(K.corked=1,this.uncork()),K.ending||le(this,K,F),this},Object.defineProperty(I.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function we(Y){return Y.ending&&Y.length===0&&Y.bufferedRequest===null&&!Y.finished&&!Y.writing}function Se(Y,_){Y._final(function(F){_.pendingcb--,F&&y(Y,F),_.prefinished=!0,Y.emit("prefinish"),ne(Y,_)})}function Z(Y,_){!_.prefinished&&!_.finalCalled&&(typeof Y._final=="function"&&!_.destroyed?(_.pendingcb++,_.finalCalled=!0,ye.nextTick(Se,Y,_)):(_.prefinished=!0,Y.emit("prefinish")))}function ne(Y,_){var F=we(_);if(F&&(Z(Y,_),_.pendingcb===0&&(_.finished=!0,Y.emit("finish"),_.autoDestroy))){var K=Y._readableState;(!K||K.autoDestroy&&K.endEmitted)&&Y.destroy()}return F}function le(Y,_,F){_.ending=!0,ne(Y,_),F&&(_.finished?ye.nextTick(F):Y.once("finish",F)),_.ended=!0,Y.writable=!1}function Ie(Y,_,F){var K=Y.entry;for(Y.entry=null;K;){var z=K.callback;_.pendingcb--,z(F),K=K.next}_.corkedRequestsFree.next=Y}return Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(_){this._writableState&&(this._writableState.destroyed=_)}}),I.prototype.destroy=c.destroy,I.prototype._undestroy=c.undestroy,I.prototype._destroy=function(Y,_){_(Y)},su}var au,ym;function Fi(){if(ym)return au;ym=1;var e=Object.keys||function(u){var l=[];for(var f in u)l.push(f);return l};au=s;var t=Am(),n=mm();Jr()(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||ye.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)}}),au}var lu={},Rs={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var bm;function lR(){return bm||(bm=1,function(e,t){var n=Es(),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)}}(Rs,Rs.exports)),Rs.exports}var vm;function cu(){if(vm)return lu;vm=1;var e=lR().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}lu.StringDecoder=o;function o(b){this.encoding=r(b);var g;switch(this.encoding){case"utf16le":this.text=f,this.end=d,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=v,this.end=T;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(g)}o.prototype.write=function(b){if(b.length===0)return"";var g,h;if(this.lastNeed){if(g=this.fillLast(b),g===void 0)return"";h=this.lastNeed,this.lastNeed=0}else h=0;return h<b.length?g?g+this.text(b,h):this.text(b,h):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,h){var y=g.length-1;if(y<h)return 0;var S=i(g[y]);return S>=0?(S>0&&(b.lastNeed=S-1),S):--y<h||S===-2?0:(S=i(g[y]),S>=0?(S>0&&(b.lastNeed=S-2),S):--y<h||S===-2?0:(S=i(g[y]),S>=0?(S>0&&(S===2?S=0:b.lastNeed=S-3),S):0))}function a(b,g,h){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,h=a(this,b);if(h!==void 0)return h;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 h=s(this,b,g);if(!this.lastNeed)return b.toString("utf8",g);this.lastTotal=h;var y=b.length-(h-this.lastNeed);return b.copy(this.lastChar,0,y),b.toString("utf8",g,y)}function l(b){var g=b&&b.length?this.write(b):"";return this.lastNeed?g+"�":g}function f(b,g){if((b.length-g)%2===0){var h=b.toString("utf16le",g);if(h){var y=h.charCodeAt(h.length-1);if(y>=55296&&y<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1],h.slice(0,-1)}return h}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=b[b.length-1],b.toString("utf16le",g,b.length-1)}function d(b){var g=b&&b.length?this.write(b):"";if(this.lastNeed){var h=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,h)}return g}function m(b,g){var h=(b.length-g)%3;return h===0?b.toString("base64",g):(this.lastNeed=3-h,this.lastTotal=3,h===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-h))}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 T(b){return b&&b.length?this.write(b):""}return lu}var uu,wm;function fu(){if(wm)return uu;wm=1;var e=Pi().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||d()},f=i._writableState&&i._writableState.finished,d=function(){u=!1,f=!0,c||a.call(i)},m=i._readableState&&i._readableState.endEmitted,w=function(){c=!1,m=!0,u||a.call(i)},v=function(h){a.call(i,h)},T=function(){var h;if(c&&!m)return(!i._readableState||!i._readableState.ended)&&(h=new e),a.call(i,h);if(u&&!f)return(!i._writableState||!i._writableState.ended)&&(h=new e),a.call(i,h)},b=function(){i.req.on("finish",d)};return r(i)?(i.on("complete",d),i.on("abort",T),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",d),s.error!==!1&&i.on("error",v),i.on("close",T),function(){i.removeListener("complete",d),i.removeListener("abort",T),i.removeListener("request",b),i.req&&i.req.removeListener("finish",d),i.removeListener("end",l),i.removeListener("close",l),i.removeListener("finish",d),i.removeListener("end",w),i.removeListener("error",v),i.removeListener("close",T)}}return uu=o,uu}var du,Sm;function cR(){if(Sm)return du;Sm=1;var e;function t(h,y,S){return y=n(y),y in h?Object.defineProperty(h,y,{value:S,enumerable:!0,configurable:!0,writable:!0}):h[y]=S,h}function n(h){var y=r(h,"string");return typeof y=="symbol"?y:String(y)}function r(h,y){if(typeof h!="object"||h===null)return h;var S=h[Symbol.toPrimitive];if(S!==void 0){var E=S.call(h,y);if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(y==="string"?String:Number)(h)}var o=fu(),i=Symbol("lastResolve"),s=Symbol("lastReject"),a=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),l=Symbol("handlePromise"),f=Symbol("stream");function d(h,y){return{value:h,done:y}}function m(h){var y=h[i];if(y!==null){var S=h[f].read();S!==null&&(h[u]=null,h[i]=null,h[s]=null,y(d(S,!1)))}}function w(h){ye.nextTick(m,h)}function v(h,y){return function(S,E){h.then(function(){if(y[c]){S(d(void 0,!0));return}y[l](S,E)},E)}}var T=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((e={get stream(){return this[f]},next:function(){var y=this,S=this[a];if(S!==null)return Promise.reject(S);if(this[c])return Promise.resolve(d(void 0,!0));if(this[f].destroyed)return new Promise(function(A,$){ye.nextTick(function(){y[a]?$(y[a]):A(d(void 0,!0))})});var E=this[u],R;if(E)R=new Promise(v(E,this));else{var I=this[f].read();if(I!==null)return Promise.resolve(d(I,!1));R=new Promise(this[l])}return this[u]=R,R}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var y=this;return new Promise(function(S,E){y[f].destroy(null,function(R){if(R){E(R);return}S(d(void 0,!0))})})}),e),T),g=function(y){var S,E=Object.create(b,(S={},t(S,f,{value:y,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:y._readableState.endEmitted,writable:!0}),t(S,l,{value:function(I,A){var $=E[f].read();$?(E[u]=null,E[i]=null,E[s]=null,I(d($,!1))):(E[i]=I,E[s]=A)},writable:!0}),S));return E[u]=null,o(y,function(R){if(R&&R.code!=="ERR_STREAM_PREMATURE_CLOSE"){var I=E[s];I!==null&&(E[u]=null,E[i]=null,E[s]=null,I(R)),E[a]=R;return}var A=E[i];A!==null&&(E[u]=null,E[i]=null,E[s]=null,A(d(void 0,!0))),E[c]=!0}),y.on("readable",w.bind(null,E)),E};return du=g,du}var pu,Em;function uR(){return Em||(Em=1,pu=function(){throw new Error("Readable.from is not available in the browser")}),pu}var hu,Tm;function Am(){if(Tm)return hu;Tm=1,hu=A;var e;A.ReadableState=I,Ql().EventEmitter;var t=function(V,ce){return V.listeners(ce).length},n=Qh(),r=Es().Buffer,o=(typeof Cr<"u"?Cr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i(B){return r.from(B)}function s(B){return r.isBuffer(B)||B instanceof o}var a=am(),c;a&&a.debuglog?c=a.debuglog("stream"):c=function(){};var u=sR(),l=um(),f=pm(),d=f.getHighWaterMark,m=Pi().codes,w=m.ERR_INVALID_ARG_TYPE,v=m.ERR_STREAM_PUSH_AFTER_EOF,T=m.ERR_METHOD_NOT_IMPLEMENTED,b=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,g,h,y;Jr()(A,n);var S=l.errorOrDestroy,E=["error","close","destroy","pause","resume"];function R(B,V,ce){if(typeof B.prependListener=="function")return B.prependListener(V,ce);!B._events||!B._events[V]?B.on(V,ce):Array.isArray(B._events[V])?B._events[V].unshift(ce):B._events[V]=[ce,B._events[V]]}function I(B,V,ce){e=e||Fi(),B=B||{},typeof ce!="boolean"&&(ce=V instanceof e),this.objectMode=!!B.objectMode,ce&&(this.objectMode=this.objectMode||!!B.readableObjectMode),this.highWaterMark=d(this,B,"readableHighWaterMark",ce),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=B.emitClose!==!1,this.autoDestroy=!!B.autoDestroy,this.destroyed=!1,this.defaultEncoding=B.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,B.encoding&&(g||(g=cu().StringDecoder),this.decoder=new g(B.encoding),this.encoding=B.encoding)}function A(B){if(e=e||Fi(),!(this instanceof A))return new A(B);var V=this instanceof e;this._readableState=new I(B,this,V),this.readable=!0,B&&(typeof B.read=="function"&&(this._read=B.read),typeof B.destroy=="function"&&(this._destroy=B.destroy)),n.call(this)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(V){this._readableState&&(this._readableState.destroyed=V)}}),A.prototype.destroy=l.destroy,A.prototype._undestroy=l.undestroy,A.prototype._destroy=function(B,V){V(B)},A.prototype.push=function(B,V){var ce=this._readableState,Re;return ce.objectMode?Re=!0:typeof B=="string"&&(V=V||ce.defaultEncoding,V!==ce.encoding&&(B=r.from(B,V),V=""),Re=!0),$(this,B,V,!1,Re)},A.prototype.unshift=function(B){return $(this,B,null,!0,!1)};function $(B,V,ce,Re,Le){c("readableAddChunk",V);var ke=B._readableState;if(V===null)ke.reading=!1,X(B,ke);else{var Pe;if(Le||(Pe=k(ke,V)),Pe)S(B,Pe);else if(ke.objectMode||V&&V.length>0)if(typeof V!="string"&&!ke.objectMode&&Object.getPrototypeOf(V)!==r.prototype&&(V=i(V)),Re)ke.endEmitted?S(B,new b):D(B,ke,V,!0);else if(ke.ended)S(B,new v);else{if(ke.destroyed)return!1;ke.reading=!1,ke.decoder&&!ce?(V=ke.decoder.write(V),ke.objectMode||V.length!==0?D(B,ke,V,!1):se(B,ke)):D(B,ke,V,!1)}else Re||(ke.reading=!1,se(B,ke))}return!ke.ended&&(ke.length<ke.highWaterMark||ke.length===0)}function D(B,V,ce,Re){V.flowing&&V.length===0&&!V.sync?(V.awaitDrain=0,B.emit("data",ce)):(V.length+=V.objectMode?1:ce.length,Re?V.buffer.unshift(ce):V.buffer.push(ce),V.needReadable&&ie(B)),se(B,V)}function k(B,V){var ce;return!s(V)&&typeof V!="string"&&V!==void 0&&!B.objectMode&&(ce=new w("chunk",["string","Buffer","Uint8Array"],V)),ce}A.prototype.isPaused=function(){return this._readableState.flowing===!1},A.prototype.setEncoding=function(B){g||(g=cu().StringDecoder);var V=new g(B);this._readableState.decoder=V,this._readableState.encoding=this._readableState.decoder.encoding;for(var ce=this._readableState.buffer.head,Re="";ce!==null;)Re+=V.write(ce.data),ce=ce.next;return this._readableState.buffer.clear(),Re!==""&&this._readableState.buffer.push(Re),this._readableState.length=Re.length,this};var N=1073741824;function j(B){return B>=N?B=N:(B--,B|=B>>>1,B|=B>>>2,B|=B>>>4,B|=B>>>8,B|=B>>>16,B++),B}function W(B,V){return B<=0||V.length===0&&V.ended?0:V.objectMode?1:B!==B?V.flowing&&V.length?V.buffer.head.data.length:V.length:(B>V.highWaterMark&&(V.highWaterMark=j(B)),B<=V.length?B:V.ended?V.length:(V.needReadable=!0,0))}A.prototype.read=function(B){c("read",B),B=parseInt(B,10);var V=this._readableState,ce=B;if(B!==0&&(V.emittedReadable=!1),B===0&&V.needReadable&&((V.highWaterMark!==0?V.length>=V.highWaterMark:V.length>0)||V.ended))return c("read: emitReadable",V.length,V.ended),V.length===0&&V.ended?F(this):ie(this),null;if(B=W(B,V),B===0&&V.ended)return V.length===0&&F(this),null;var Re=V.needReadable;c("need readable",Re),(V.length===0||V.length-B<V.highWaterMark)&&(Re=!0,c("length less than watermark",Re)),V.ended||V.reading?(Re=!1,c("reading or ended",Re)):Re&&(c("do read"),V.reading=!0,V.sync=!0,V.length===0&&(V.needReadable=!0),this._read(V.highWaterMark),V.sync=!1,V.reading||(B=W(ce,V)));var Le;return B>0?Le=_(B,V):Le=null,Le===null?(V.needReadable=V.length<=V.highWaterMark,B=0):(V.length-=B,V.awaitDrain=0),V.length===0&&(V.ended||(V.needReadable=!0),ce!==B&&V.ended&&F(this)),Le!==null&&this.emit("data",Le),Le};function X(B,V){if(c("onEofChunk"),!V.ended){if(V.decoder){var ce=V.decoder.end();ce&&ce.length&&(V.buffer.push(ce),V.length+=V.objectMode?1:ce.length)}V.ended=!0,V.sync?ie(B):(V.needReadable=!1,V.emittedReadable||(V.emittedReadable=!0,de(B)))}}function ie(B){var V=B._readableState;c("emitReadable",V.needReadable,V.emittedReadable),V.needReadable=!1,V.emittedReadable||(c("emitReadable",V.flowing),V.emittedReadable=!0,ye.nextTick(de,B))}function de(B){var V=B._readableState;c("emitReadable_",V.destroyed,V.length,V.ended),!V.destroyed&&(V.length||V.ended)&&(B.emit("readable"),V.emittedReadable=!1),V.needReadable=!V.flowing&&!V.ended&&V.length<=V.highWaterMark,Y(B)}function se(B,V){V.readingMore||(V.readingMore=!0,ye.nextTick(we,B,V))}function we(B,V){for(;!V.reading&&!V.ended&&(V.length<V.highWaterMark||V.flowing&&V.length===0);){var ce=V.length;if(c("maybeReadMore read 0"),B.read(0),ce===V.length)break}V.readingMore=!1}A.prototype._read=function(B){S(this,new T("_read()"))},A.prototype.pipe=function(B,V){var ce=this,Re=this._readableState;switch(Re.pipesCount){case 0:Re.pipes=B;break;case 1:Re.pipes=[Re.pipes,B];break;default:Re.pipes.push(B);break}Re.pipesCount+=1,c("pipe count=%d opts=%j",Re.pipesCount,V);var Le=(!V||V.end!==!1)&&B!==ye.stdout&&B!==ye.stderr,ke=Le?Be:Qt;Re.endEmitted?ye.nextTick(ke):ce.once("end",ke),B.on("unpipe",Pe);function Pe(Xt,Pt){c("onunpipe"),Xt===ce&&Pt&&Pt.hasUnpiped===!1&&(Pt.hasUnpiped=!0,$e())}function Be(){c("onend"),B.end()}var he=Se(ce);B.on("drain",he);var ae=!1;function $e(){c("cleanup"),B.removeListener("close",ut),B.removeListener("finish",ct),B.removeListener("drain",he),B.removeListener("error",Je),B.removeListener("unpipe",Pe),ce.removeListener("end",Be),ce.removeListener("end",Qt),ce.removeListener("data",De),ae=!0,Re.awaitDrain&&(!B._writableState||B._writableState.needDrain)&&he()}ce.on("data",De);function De(Xt){c("ondata");var Pt=B.write(Xt);c("dest.write",Pt),Pt===!1&&((Re.pipesCount===1&&Re.pipes===B||Re.pipesCount>1&&z(Re.pipes,B)!==-1)&&!ae&&(c("false write response, pause",Re.awaitDrain),Re.awaitDrain++),ce.pause())}function Je(Xt){c("onerror",Xt),Qt(),B.removeListener("error",Je),t(B,"error")===0&&S(B,Xt)}R(B,"error",Je);function ut(){B.removeListener("finish",ct),Qt()}B.once("close",ut);function ct(){c("onfinish"),B.removeListener("close",ut),Qt()}B.once("finish",ct);function Qt(){c("unpipe"),ce.unpipe(B)}return B.emit("pipe",ce),Re.flowing||(c("pipe resume"),ce.resume()),B};function Se(B){return function(){var ce=B._readableState;c("pipeOnDrain",ce.awaitDrain),ce.awaitDrain&&ce.awaitDrain--,ce.awaitDrain===0&&t(B,"data")&&(ce.flowing=!0,Y(B))}}A.prototype.unpipe=function(B){var V=this._readableState,ce={hasUnpiped:!1};if(V.pipesCount===0)return this;if(V.pipesCount===1)return B&&B!==V.pipes?this:(B||(B=V.pipes),V.pipes=null,V.pipesCount=0,V.flowing=!1,B&&B.emit("unpipe",this,ce),this);if(!B){var Re=V.pipes,Le=V.pipesCount;V.pipes=null,V.pipesCount=0,V.flowing=!1;for(var ke=0;ke<Le;ke++)Re[ke].emit("unpipe",this,{hasUnpiped:!1});return this}var Pe=z(V.pipes,B);return Pe===-1?this:(V.pipes.splice(Pe,1),V.pipesCount-=1,V.pipesCount===1&&(V.pipes=V.pipes[0]),B.emit("unpipe",this,ce),this)},A.prototype.on=function(B,V){var ce=n.prototype.on.call(this,B,V),Re=this._readableState;return B==="data"?(Re.readableListening=this.listenerCount("readable")>0,Re.flowing!==!1&&this.resume()):B==="readable"&&!Re.endEmitted&&!Re.readableListening&&(Re.readableListening=Re.needReadable=!0,Re.flowing=!1,Re.emittedReadable=!1,c("on readable",Re.length,Re.reading),Re.length?ie(this):Re.reading||ye.nextTick(ne,this)),ce},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(B,V){var ce=n.prototype.removeListener.call(this,B,V);return B==="readable"&&ye.nextTick(Z,this),ce},A.prototype.removeAllListeners=function(B){var V=n.prototype.removeAllListeners.apply(this,arguments);return(B==="readable"||B===void 0)&&ye.nextTick(Z,this),V};function Z(B){var V=B._readableState;V.readableListening=B.listenerCount("readable")>0,V.resumeScheduled&&!V.paused?V.flowing=!0:B.listenerCount("data")>0&&B.resume()}function ne(B){c("readable nexttick read 0"),B.read(0)}A.prototype.resume=function(){var B=this._readableState;return B.flowing||(c("resume"),B.flowing=!B.readableListening,le(this,B)),B.paused=!1,this};function le(B,V){V.resumeScheduled||(V.resumeScheduled=!0,ye.nextTick(Ie,B,V))}function Ie(B,V){c("resume",V.reading),V.reading||B.read(0),V.resumeScheduled=!1,B.emit("resume"),Y(B),V.flowing&&!V.reading&&B.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 Y(B){var V=B._readableState;for(c("flow",V.flowing);V.flowing&&B.read()!==null;);}A.prototype.wrap=function(B){var V=this,ce=this._readableState,Re=!1;B.on("end",function(){if(c("wrapped end"),ce.decoder&&!ce.ended){var Pe=ce.decoder.end();Pe&&Pe.length&&V.push(Pe)}V.push(null)}),B.on("data",function(Pe){if(c("wrapped data"),ce.decoder&&(Pe=ce.decoder.write(Pe)),!(ce.objectMode&&Pe==null)&&!(!ce.objectMode&&(!Pe||!Pe.length))){var Be=V.push(Pe);Be||(Re=!0,B.pause())}});for(var Le in B)this[Le]===void 0&&typeof B[Le]=="function"&&(this[Le]=function(Be){return function(){return B[Be].apply(B,arguments)}}(Le));for(var ke=0;ke<E.length;ke++)B.on(E[ke],this.emit.bind(this,E[ke]));return this._read=function(Pe){c("wrapped _read",Pe),Re&&(Re=!1,B.resume())},this},typeof Symbol=="function"&&(A.prototype[Symbol.asyncIterator]=function(){return h===void 0&&(h=cR()),h(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(V){this._readableState&&(this._readableState.flowing=V)}}),A._fromList=_,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function _(B,V){if(V.length===0)return null;var ce;return V.objectMode?ce=V.buffer.shift():!B||B>=V.length?(V.decoder?ce=V.buffer.join(""):V.buffer.length===1?ce=V.buffer.first():ce=V.buffer.concat(V.length),V.buffer.clear()):ce=V.buffer.consume(B,V.decoder),ce}function F(B){var V=B._readableState;c("endReadable",V.endEmitted),V.endEmitted||(V.ended=!0,ye.nextTick(K,V,B))}function K(B,V){if(c("endReadableNT",B.endEmitted,B.length),!B.endEmitted&&B.length===0&&(B.endEmitted=!0,V.readable=!1,V.emit("end"),B.autoDestroy)){var ce=V._writableState;(!ce||ce.autoDestroy&&ce.finished)&&V.destroy()}}typeof Symbol=="function"&&(A.from=function(B,V){return y===void 0&&(y=uR()),y(A,B,V)});function z(B,V){for(var ce=0,Re=B.length;ce<Re;ce++)if(B[ce]===V)return ce;return-1}return hu}var gu,Rm;function _m(){if(Rm)return gu;Rm=1,gu=a;var e=Pi().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=Fi();Jr()(a,i);function s(l,f){var d=this._transformState;d.transforming=!1;var m=d.writecb;if(m===null)return this.emit("error",new n);d.writechunk=null,d.writecb=null,f!=null&&this.push(f),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(f,d){u(l,f,d)}):u(this,null,null)}a.prototype.push=function(l,f){return this._transformState.needTransform=!1,i.prototype.push.call(this,l,f)},a.prototype._transform=function(l,f,d){d(new t("_transform()"))},a.prototype._write=function(l,f,d){var m=this._transformState;if(m.writecb=d,m.writechunk=l,m.writeencoding=f,!m.transforming){var w=this._readableState;(m.needTransform||w.needReadable||w.length<w.highWaterMark)&&this._read(w.highWaterMark)}},a.prototype._read=function(l){var f=this._transformState;f.writechunk!==null&&!f.transforming?(f.transforming=!0,this._transform(f.writechunk,f.writeencoding,f.afterTransform)):f.needTransform=!0},a.prototype._destroy=function(l,f){i.prototype._destroy.call(this,l,function(d){f(d)})};function u(l,f,d){if(f)return l.emit("error",f);if(d!=null&&l.push(d),l._writableState.length)throw new o;if(l._transformState.transforming)throw new r;return l.push(null)}return gu}var mu,Im;function fR(){if(Im)return mu;Im=1,mu=t;var e=_m();Jr()(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)},mu}var yu,Cm;function dR(){if(Cm)return yu;Cm=1;var e;function t(d){var m=!1;return function(){m||(m=!0,d.apply(void 0,arguments))}}var n=Pi().codes,r=n.ERR_MISSING_ARGS,o=n.ERR_STREAM_DESTROYED;function i(d){if(d)throw d}function s(d){return d.setHeader&&typeof d.abort=="function"}function a(d,m,w,v){v=t(v);var T=!1;d.on("close",function(){T=!0}),e===void 0&&(e=fu()),e(d,{readable:m,writable:w},function(g){if(g)return v(g);T=!0,v()});var b=!1;return function(g){if(!T&&!b){if(b=!0,s(d))return d.abort();if(typeof d.destroy=="function")return d.destroy();v(g||new o("pipe"))}}}function c(d){d()}function u(d,m){return d.pipe(m)}function l(d){return!d.length||typeof d[d.length-1]!="function"?i:d.pop()}function f(){for(var d=arguments.length,m=new Array(d),w=0;w<d;w++)m[w]=arguments[w];var v=l(m);if(Array.isArray(m[0])&&(m=m[0]),m.length<2)throw new r("streams");var T,b=m.map(function(g,h){var y=h<m.length-1,S=h>0;return a(g,y,S,function(E){T||(T=E),E&&b.forEach(c),!y&&(b.forEach(c),v(T))})});return m.reduce(u)}return yu=f,yu}var bu,Pm;function pR(){if(Pm)return bu;Pm=1,bu=n;var e=Ql().EventEmitter,t=Jr();t(n,e),n.Readable=Am(),n.Writable=mm(),n.Duplex=Fi(),n.Transform=_m(),n.PassThrough=fR(),n.finished=fu(),n.pipeline=dR(),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 f(m){if(d(),e.listenerCount(this,"error")===0)throw m}i.on("error",f),r.on("error",f);function d(){i.removeListener("data",s),r.removeListener("drain",a),i.removeListener("end",u),i.removeListener("close",l),i.removeListener("error",f),r.removeListener("error",f),i.removeListener("end",d),i.removeListener("close",d),r.removeListener("close",d)}return i.on("end",d),i.on("close",d),r.on("close",d),r.emit("pipe",i),r},bu}var Fm;function hR(){return Fm||(Fm=1,function(e){(function(t){t.parser=function(_,F){return new 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(_,F){if(!(this instanceof r))return new 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=!!_,K.noscript=!!(_||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=!_),K.trackPosition=K.opt.position!==!1,K.trackPosition&&(K.position=K.line=K.column=0),D(K,"onready")}Object.create||(Object.create=function(_){function F(){}F.prototype=_;var K=new F;return K}),Object.keys||(Object.keys=function(_){var F=[];for(var K in _)_.hasOwnProperty(K)&&F.push(K);return F});function o(_){for(var F=Math.max(t.MAX_BUFFER_LENGTH,10),K=0,z=0,B=n.length;z<B;z++){var V=_[n[z]].length;if(V>F)switch(n[z]){case"textNode":N(_);break;case"cdata":k(_,"oncdata",_.cdata),_.cdata="";break;case"script":k(_,"onscript",_.script),_.script="";break;default:W(_,"Max buffer length exceeded: "+n[z])}K=Math.max(K,V)}var ce=t.MAX_BUFFER_LENGTH-K;_.bufferCheckPosition=ce+_.position}function i(_){for(var F=0,K=n.length;F<K;F++)_[n[F]]=""}function s(_){N(_),_.cdata!==""&&(k(_,"oncdata",_.cdata),_.cdata=""),_.script!==""&&(k(_,"onscript",_.script),_.script="")}r.prototype={end:function(){X(this)},write:Y,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){s(this)}};var a;try{a=pR().Stream}catch{a=function(){}}a||(a=function(){});var c=t.EVENTS.filter(function(_){return _!=="error"&&_!=="end"});function u(_,F){return new l(_,F)}function l(_,F){if(!(this instanceof l))return new l(_,F);a.apply(this),this._parser=new 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(B){if(!B)return K.removeAllListeners(z),K._parser["on"+z]=B,B;K.on(z,B)},enumerable:!0,configurable:!1})})}l.prototype=Object.create(a.prototype,{constructor:{value:l}}),l.prototype.write=function(_){if(typeof yr=="function"&&typeof yr.isBuffer=="function"&&yr.isBuffer(_)){if(!this._decoder){var F=cu().StringDecoder;this._decoder=new F("utf8")}_=this._decoder.write(_)}return this._parser.write(_.toString()),this.emit("data",_),!0},l.prototype.end=function(_){return _&&_.length&&this.write(_),this._parser.end(),!0},l.prototype.on=function(_,F){var K=this;return!K._parser["on"+_]&&c.indexOf(_)!==-1&&(K._parser["on"+_]=function(){var z=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);z.splice(0,0,_),K.emit.apply(K,z)}),a.prototype.on.call(K,_,F)};var f="[CDATA[",d="DOCTYPE",m="http://www.w3.org/XML/1998/namespace",w="http://www.w3.org/2000/xmlns/",v={xml:m,xmlns:w},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]/,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]/,h=/[#:_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 y(_){return _===" "||_===`
26
- `||_==="\r"||_===" "}function S(_){return _==='"'||_==="'"}function E(_){return _===">"||y(_)}function R(_,F){return _.test(F)}function I(_,F){return!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(_){var F=t.ENTITIES[_],K=typeof F=="number"?String.fromCharCode(F):F;t.ENTITIES[_]=K});for(var $ in t.STATE)t.STATE[t.STATE[$]]=$;A=t.STATE;function D(_,F,K){_[F]&&_[F](K)}function k(_,F,K){_.textNode&&N(_),D(_,F,K)}function N(_){_.textNode=j(_.opt,_.textNode),_.textNode&&D(_,"ontext",_.textNode),_.textNode=""}function j(_,F){return _.trim&&(F=F.trim()),_.normalize&&(F=F.replace(/\s+/g," ")),F}function W(_,F){return N(_),_.trackPosition&&(F+=`
25
+ `)+" "+ce[1]:ce[0]+re+" "+Z.join(", ")+" "+ce[1]}e.types=oR();function T(Z){return Array.isArray(Z)}e.isArray=T;function v(Z){return typeof Z=="boolean"}e.isBoolean=v;function g(Z){return Z===null}e.isNull=g;function h(Z){return Z==null}e.isNullOrUndefined=h;function y(Z){return typeof Z=="number"}e.isNumber=y;function S(Z){return typeof Z=="string"}e.isString=S;function E(Z){return typeof Z=="symbol"}e.isSymbol=E;function R(Z){return Z===void 0}e.isUndefined=R;function I(Z){return A(Z)&&z(Z)==="[object RegExp]"}e.isRegExp=I,e.types.isRegExp=I;function A(Z){return typeof Z=="object"&&Z!==null}e.isObject=A;function $(Z){return A(Z)&&z(Z)==="[object Date]"}e.isDate=$,e.types.isDate=$;function D(Z){return A(Z)&&(z(Z)==="[object Error]"||Z instanceof Error)}e.isError=D,e.types.isNativeError=D;function k(Z){return typeof Z=="function"}e.isFunction=k;function N(Z){return Z===null||typeof Z=="boolean"||typeof Z=="number"||typeof Z=="string"||typeof Z=="symbol"||typeof Z>"u"}e.isPrimitive=N,e.isBuffer=sR();function z(Z){return Object.prototype.toString.call(Z)}function G(Z){return Z<10?"0"+Z.toString(10):Z.toString(10)}var X=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function se(){var Z=new Date,re=[G(Z.getHours()),G(Z.getMinutes()),G(Z.getSeconds())].join(":");return[Z.getDate(),X[Z.getMonth()],re].join(" ")}e.log=function(){console.log("%s - %s",se(),e.format.apply(e,arguments))},e.inherits=Jr(),e._extend=function(Z,re){if(!re||!A(re))return Z;for(var ce=Object.keys(re),Ie=ce.length;Ie--;)Z[ce[Ie]]=re[ce[Ie]];return Z};function ne(Z,re){return Object.prototype.hasOwnProperty.call(Z,re)}var oe=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(re){if(typeof re!="function")throw new TypeError('The "original" argument must be of type Function');if(oe&&re[oe]){var ce=re[oe];if(typeof ce!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ce,oe,{value:ce,enumerable:!1,writable:!1,configurable:!0}),ce}function ce(){for(var Ie,Y,_=new Promise(function(V,B){Ie=V,Y=B}),P=[],K=0;K<arguments.length;K++)P.push(arguments[K]);P.push(function(V,B){V?Y(V):Ie(B)});try{re.apply(this,P)}catch(V){Y(V)}return _}return Object.setPrototypeOf(ce,Object.getPrototypeOf(re)),oe&&Object.defineProperty(ce,oe,{value:ce,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(ce,t(re))},e.promisify.custom=oe;function fe(Z,re){if(!Z){var ce=new Error("Promise was rejected with a falsy value");ce.reason=Z,Z=ce}return re(Z)}function we(Z){if(typeof Z!="function")throw new TypeError('The "original" argument must be of type Function');function re(){for(var ce=[],Ie=0;Ie<arguments.length;Ie++)ce.push(arguments[Ie]);var Y=ce.pop();if(typeof Y!="function")throw new TypeError("The last argument must be of type Function");var _=this,P=function(){return Y.apply(_,arguments)};Z.apply(this,ce).then(function(K){be.nextTick(P.bind(null,null,K))},function(K){be.nextTick(fe.bind(null,K,P))})}return Object.setPrototypeOf(re,Object.getPrototypeOf(Z)),Object.defineProperties(re,t(Z)),re}e.callbackify=we}(Jl)),Jl}var tu,cm;function aR(){if(cm)return tu;cm=1;function e(w,b){var T=Object.keys(w);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(w);b&&(v=v.filter(function(g){return Object.getOwnPropertyDescriptor(w,g).enumerable})),T.push.apply(T,v)}return T}function t(w){for(var b=1;b<arguments.length;b++){var T=arguments[b]!=null?arguments[b]:{};b%2?e(Object(T),!0).forEach(function(v){n(w,v,T[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(T)):e(Object(T)).forEach(function(v){Object.defineProperty(w,v,Object.getOwnPropertyDescriptor(T,v))})}return w}function n(w,b,T){return b=s(b),b in w?Object.defineProperty(w,b,{value:T,enumerable:!0,configurable:!0,writable:!0}):w[b]=T,w}function r(w,b){if(!(w instanceof b))throw new TypeError("Cannot call a class as a function")}function o(w,b){for(var T=0;T<b.length;T++){var v=b[T];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(w,s(v.key),v)}}function i(w,b,T){return b&&o(w.prototype,b),Object.defineProperty(w,"prototype",{writable:!1}),w}function s(w){var b=a(w,"string");return typeof b=="symbol"?b:String(b)}function a(w,b){if(typeof w!="object"||w===null)return w;var T=w[Symbol.toPrimitive];if(T!==void 0){var v=T.call(w,b);if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(w)}var c=Es(),u=c.Buffer,l=lm(),f=l.inspect,d=f&&f.custom||"inspect";function m(w,b,T){u.prototype.copy.call(w,b,T)}return tu=function(){function w(){r(this,w),this.head=null,this.tail=null,this.length=0}return i(w,[{key:"push",value:function(T){var v={data:T,next:null};this.length>0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(T){var v={data:T,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value:function(){if(this.length!==0){var T=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,T}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(T){if(this.length===0)return"";for(var v=this.head,g=""+v.data;v=v.next;)g+=T+v.data;return g}},{key:"concat",value:function(T){if(this.length===0)return u.alloc(0);for(var v=u.allocUnsafe(T>>>0),g=this.head,h=0;g;)m(g.data,v,h),h+=g.data.length,g=g.next;return v}},{key:"consume",value:function(T,v){var g;return T<this.head.data.length?(g=this.head.data.slice(0,T),this.head.data=this.head.data.slice(T)):T===this.head.data.length?g=this.shift():g=v?this._getString(T):this._getBuffer(T),g}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(T){var v=this.head,g=1,h=v.data;for(T-=h.length;v=v.next;){var y=v.data,S=T>y.length?y.length:T;if(S===y.length?h+=y:h+=y.slice(0,T),T-=S,T===0){S===y.length?(++g,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=y.slice(S));break}++g}return this.length-=g,h}},{key:"_getBuffer",value:function(T){var v=u.allocUnsafe(T),g=this.head,h=1;for(g.data.copy(v),T-=g.data.length;g=g.next;){var y=g.data,S=T>y.length?y.length:T;if(y.copy(v,v.length-T,0,S),T-=S,T===0){S===y.length?(++h,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=y.slice(S));break}++h}return this.length-=h,v}},{key:d,value:function(T,v){return f(this,t(t({},v),{},{depth:0,customInspect:!1}))}}]),w}(),tu}var nu,um;function fm(){if(um)return nu;um=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,be.nextTick(o,this,s)):be.nextTick(o,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(f){!a&&f?c._writableState?c._writableState.errorEmitted?be.nextTick(n,c):(c._writableState.errorEmitted=!0,be.nextTick(t,c,f)):be.nextTick(t,c,f):a?(be.nextTick(n,c),a(f)):be.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 nu={destroy:e,undestroy:r,errorOrDestroy:i},nu}var ru={},dm;function Fi(){if(dm)return ru;dm=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(d,m,w){return typeof c=="string"?c:c(d,m,w)}var f=function(d){e(m,d);function m(w,b,T){return d.call(this,l(w,b,T))||this}return m}(u);f.prototype.name=u.name,f.prototype.code=a,t[a]=f}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 f;if(i(a," argument"))f="The ".concat(a," ").concat(l," ").concat(r(c,"type"));else{var d=s(a,".")?"property":"argument";f='The "'.concat(a,'" ').concat(d," ").concat(l," ").concat(r(c,"type"))}return f+=". Received type ".concat(typeof u),f},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"),ru.codes=t,ru}var iu,pm;function hm(){if(pm)return iu;pm=1;var e=Fi().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 iu={getHighWaterMark:n},iu}var ou,gm;function lR(){if(gm)return ou;gm=1,ou=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(!Cr.localStorage)return!1}catch{return!1}var r=Cr.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return ou}var su,mm;function ym(){if(mm)return su;mm=1,su=I;function e(Y){var _=this;this.next=null,this.entry=null,this.finish=function(){Ie(_,Y)}}var t;I.WritableState=E;var n={deprecate:lR()},r=Xh(),o=Es().Buffer,i=(typeof Cr<"u"?Cr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(Y){return o.from(Y)}function a(Y){return o.isBuffer(Y)||Y instanceof i}var c=fm(),u=hm(),l=u.getHighWaterMark,f=Fi().codes,d=f.ERR_INVALID_ARG_TYPE,m=f.ERR_METHOD_NOT_IMPLEMENTED,w=f.ERR_MULTIPLE_CALLBACK,b=f.ERR_STREAM_CANNOT_PIPE,T=f.ERR_STREAM_DESTROYED,v=f.ERR_STREAM_NULL_VALUES,g=f.ERR_STREAM_WRITE_AFTER_END,h=f.ERR_UNKNOWN_ENCODING,y=c.errorOrDestroy;Jr()(I,r);function S(){}function E(Y,_,P){t=t||Pi(),Y=Y||{},typeof P!="boolean"&&(P=_ instanceof t),this.objectMode=!!Y.objectMode,P&&(this.objectMode=this.objectMode||!!Y.writableObjectMode),this.highWaterMark=l(this,Y,"writableHighWaterMark",P),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var K=Y.decodeStrings===!1;this.decodeStrings=!K,this.defaultEncoding=Y.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(V){X(_,V)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Y.emitClose!==!1,this.autoDestroy=!!Y.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}E.prototype.getBuffer=function(){for(var _=this.bufferedRequest,P=[];_;)P.push(_),_=_.next;return P},function(){try{Object.defineProperty(E.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var R;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(R=Function.prototype[Symbol.hasInstance],Object.defineProperty(I,Symbol.hasInstance,{value:function(_){return R.call(this,_)?!0:this!==I?!1:_&&_._writableState instanceof E}})):R=function(_){return _ instanceof this};function I(Y){t=t||Pi();var _=this instanceof t;if(!_&&!R.call(I,this))return new I(Y);this._writableState=new E(Y,this,_),this.writable=!0,Y&&(typeof Y.write=="function"&&(this._write=Y.write),typeof Y.writev=="function"&&(this._writev=Y.writev),typeof Y.destroy=="function"&&(this._destroy=Y.destroy),typeof Y.final=="function"&&(this._final=Y.final)),r.call(this)}I.prototype.pipe=function(){y(this,new b)};function A(Y,_){var P=new g;y(Y,P),be.nextTick(_,P)}function $(Y,_,P,K){var V;return P===null?V=new v:typeof P!="string"&&!_.objectMode&&(V=new d("chunk",["string","Buffer"],P)),V?(y(Y,V),be.nextTick(K,V),!1):!0}I.prototype.write=function(Y,_,P){var K=this._writableState,V=!1,B=!K.objectMode&&a(Y);return B&&!o.isBuffer(Y)&&(Y=s(Y)),typeof _=="function"&&(P=_,_=null),B?_="buffer":_||(_=K.defaultEncoding),typeof P!="function"&&(P=S),K.ending?A(this,P):(B||$(this,K,Y,P))&&(K.pendingcb++,V=k(this,K,B,Y,_,P)),V},I.prototype.cork=function(){this._writableState.corked++},I.prototype.uncork=function(){var Y=this._writableState;Y.corked&&(Y.corked--,!Y.writing&&!Y.corked&&!Y.bufferProcessing&&Y.bufferedRequest&&oe(this,Y))},I.prototype.setDefaultEncoding=function(_){if(typeof _=="string"&&(_=_.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((_+"").toLowerCase())>-1))throw new h(_);return this._writableState.defaultEncoding=_,this},Object.defineProperty(I.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function D(Y,_,P){return!Y.objectMode&&Y.decodeStrings!==!1&&typeof _=="string"&&(_=o.from(_,P)),_}Object.defineProperty(I.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function k(Y,_,P,K,V,B){if(!P){var q=D(_,K,V);K!==q&&(P=!0,V="buffer",K=q)}var ue=_.objectMode?1:K.length;_.length+=ue;var Re=_.length<_.highWaterMark;if(Re||(_.needDrain=!0),_.writing||_.corked){var Le=_.lastBufferedRequest;_.lastBufferedRequest={chunk:K,encoding:V,isBuf:P,callback:B,next:null},Le?Le.next=_.lastBufferedRequest:_.bufferedRequest=_.lastBufferedRequest,_.bufferedRequestCount+=1}else N(Y,_,!1,ue,K,V,B);return Re}function N(Y,_,P,K,V,B,q){_.writelen=K,_.writecb=q,_.writing=!0,_.sync=!0,_.destroyed?_.onwrite(new T("write")):P?Y._writev(V,_.onwrite):Y._write(V,B,_.onwrite),_.sync=!1}function z(Y,_,P,K,V){--_.pendingcb,P?(be.nextTick(V,K),be.nextTick(re,Y,_),Y._writableState.errorEmitted=!0,y(Y,K)):(V(K),Y._writableState.errorEmitted=!0,y(Y,K),re(Y,_))}function G(Y){Y.writing=!1,Y.writecb=null,Y.length-=Y.writelen,Y.writelen=0}function X(Y,_){var P=Y._writableState,K=P.sync,V=P.writecb;if(typeof V!="function")throw new w;if(G(P),_)z(Y,P,K,_,V);else{var B=fe(P)||Y.destroyed;!B&&!P.corked&&!P.bufferProcessing&&P.bufferedRequest&&oe(Y,P),K?be.nextTick(se,Y,P,B,V):se(Y,P,B,V)}}function se(Y,_,P,K){P||ne(Y,_),_.pendingcb--,K(),re(Y,_)}function ne(Y,_){_.length===0&&_.needDrain&&(_.needDrain=!1,Y.emit("drain"))}function oe(Y,_){_.bufferProcessing=!0;var P=_.bufferedRequest;if(Y._writev&&P&&P.next){var K=_.bufferedRequestCount,V=new Array(K),B=_.corkedRequestsFree;B.entry=P;for(var q=0,ue=!0;P;)V[q]=P,P.isBuf||(ue=!1),P=P.next,q+=1;V.allBuffers=ue,N(Y,_,!0,_.length,V,"",B.finish),_.pendingcb++,_.lastBufferedRequest=null,B.next?(_.corkedRequestsFree=B.next,B.next=null):_.corkedRequestsFree=new e(_),_.bufferedRequestCount=0}else{for(;P;){var Re=P.chunk,Le=P.encoding,ke=P.callback,Fe=_.objectMode?1:Re.length;if(N(Y,_,!1,Fe,Re,Le,ke),P=P.next,_.bufferedRequestCount--,_.writing)break}P===null&&(_.lastBufferedRequest=null)}_.bufferedRequest=P,_.bufferProcessing=!1}I.prototype._write=function(Y,_,P){P(new m("_write()"))},I.prototype._writev=null,I.prototype.end=function(Y,_,P){var K=this._writableState;return typeof Y=="function"?(P=Y,Y=null,_=null):typeof _=="function"&&(P=_,_=null),Y!=null&&this.write(Y,_),K.corked&&(K.corked=1,this.uncork()),K.ending||ce(this,K,P),this},Object.defineProperty(I.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function fe(Y){return Y.ending&&Y.length===0&&Y.bufferedRequest===null&&!Y.finished&&!Y.writing}function we(Y,_){Y._final(function(P){_.pendingcb--,P&&y(Y,P),_.prefinished=!0,Y.emit("prefinish"),re(Y,_)})}function Z(Y,_){!_.prefinished&&!_.finalCalled&&(typeof Y._final=="function"&&!_.destroyed?(_.pendingcb++,_.finalCalled=!0,be.nextTick(we,Y,_)):(_.prefinished=!0,Y.emit("prefinish")))}function re(Y,_){var P=fe(_);if(P&&(Z(Y,_),_.pendingcb===0&&(_.finished=!0,Y.emit("finish"),_.autoDestroy))){var K=Y._readableState;(!K||K.autoDestroy&&K.endEmitted)&&Y.destroy()}return P}function ce(Y,_,P){_.ending=!0,re(Y,_),P&&(_.finished?be.nextTick(P):Y.once("finish",P)),_.ended=!0,Y.writable=!1}function Ie(Y,_,P){var K=Y.entry;for(Y.entry=null;K;){var V=K.callback;_.pendingcb--,V(P),K=K.next}_.corkedRequestsFree.next=Y}return Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(_){this._writableState&&(this._writableState.destroyed=_)}}),I.prototype.destroy=c.destroy,I.prototype._undestroy=c.undestroy,I.prototype._destroy=function(Y,_){_(Y)},su}var au,bm;function Pi(){if(bm)return au;bm=1;var e=Object.keys||function(u){var l=[];for(var f in u)l.push(f);return l};au=s;var t=Rm(),n=ym();Jr()(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||be.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)}}),au}var lu={},Rs={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var vm;function cR(){return vm||(vm=1,function(e,t){var n=Es(),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)}}(Rs,Rs.exports)),Rs.exports}var wm;function cu(){if(wm)return lu;wm=1;var e=cR().Buffer,t=e.isEncoding||function(v){switch(v=""+v,v&&v.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(v){if(!v)return"utf8";for(var g;;)switch(v){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 v;default:if(g)return;v=(""+v).toLowerCase(),g=!0}}function r(v){var g=n(v);if(typeof g!="string"&&(e.isEncoding===t||!t(v)))throw new Error("Unknown encoding: "+v);return g||v}lu.StringDecoder=o;function o(v){this.encoding=r(v);var g;switch(this.encoding){case"utf16le":this.text=f,this.end=d,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=b,this.end=T;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(g)}o.prototype.write=function(v){if(v.length===0)return"";var g,h;if(this.lastNeed){if(g=this.fillLast(v),g===void 0)return"";h=this.lastNeed,this.lastNeed=0}else h=0;return h<v.length?g?g+this.text(v,h):this.text(v,h):g||""},o.prototype.end=l,o.prototype.text=u,o.prototype.fillLast=function(v){if(this.lastNeed<=v.length)return v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,v.length),this.lastNeed-=v.length};function i(v){return v<=127?0:v>>5===6?2:v>>4===14?3:v>>3===30?4:v>>6===2?-1:-2}function s(v,g,h){var y=g.length-1;if(y<h)return 0;var S=i(g[y]);return S>=0?(S>0&&(v.lastNeed=S-1),S):--y<h||S===-2?0:(S=i(g[y]),S>=0?(S>0&&(v.lastNeed=S-2),S):--y<h||S===-2?0:(S=i(g[y]),S>=0?(S>0&&(S===2?S=0:v.lastNeed=S-3),S):0))}function a(v,g,h){if((g[0]&192)!==128)return v.lastNeed=0,"�";if(v.lastNeed>1&&g.length>1){if((g[1]&192)!==128)return v.lastNeed=1,"�";if(v.lastNeed>2&&g.length>2&&(g[2]&192)!==128)return v.lastNeed=2,"�"}}function c(v){var g=this.lastTotal-this.lastNeed,h=a(this,v);if(h!==void 0)return h;if(this.lastNeed<=v.length)return v.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,g,0,v.length),this.lastNeed-=v.length}function u(v,g){var h=s(this,v,g);if(!this.lastNeed)return v.toString("utf8",g);this.lastTotal=h;var y=v.length-(h-this.lastNeed);return v.copy(this.lastChar,0,y),v.toString("utf8",g,y)}function l(v){var g=v&&v.length?this.write(v):"";return this.lastNeed?g+"�":g}function f(v,g){if((v.length-g)%2===0){var h=v.toString("utf16le",g);if(h){var y=h.charCodeAt(h.length-1);if(y>=55296&&y<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1],h.slice(0,-1)}return h}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=v[v.length-1],v.toString("utf16le",g,v.length-1)}function d(v){var g=v&&v.length?this.write(v):"";if(this.lastNeed){var h=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,h)}return g}function m(v,g){var h=(v.length-g)%3;return h===0?v.toString("base64",g):(this.lastNeed=3-h,this.lastTotal=3,h===1?this.lastChar[0]=v[v.length-1]:(this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1]),v.toString("base64",g,v.length-h))}function w(v){var g=v&&v.length?this.write(v):"";return this.lastNeed?g+this.lastChar.toString("base64",0,3-this.lastNeed):g}function b(v){return v.toString(this.encoding)}function T(v){return v&&v.length?this.write(v):""}return lu}var uu,Sm;function fu(){if(Sm)return uu;Sm=1;var e=Fi().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||d()},f=i._writableState&&i._writableState.finished,d=function(){u=!1,f=!0,c||a.call(i)},m=i._readableState&&i._readableState.endEmitted,w=function(){c=!1,m=!0,u||a.call(i)},b=function(h){a.call(i,h)},T=function(){var h;if(c&&!m)return(!i._readableState||!i._readableState.ended)&&(h=new e),a.call(i,h);if(u&&!f)return(!i._writableState||!i._writableState.ended)&&(h=new e),a.call(i,h)},v=function(){i.req.on("finish",d)};return r(i)?(i.on("complete",d),i.on("abort",T),i.req?v():i.on("request",v)):u&&!i._writableState&&(i.on("end",l),i.on("close",l)),i.on("end",w),i.on("finish",d),s.error!==!1&&i.on("error",b),i.on("close",T),function(){i.removeListener("complete",d),i.removeListener("abort",T),i.removeListener("request",v),i.req&&i.req.removeListener("finish",d),i.removeListener("end",l),i.removeListener("close",l),i.removeListener("finish",d),i.removeListener("end",w),i.removeListener("error",b),i.removeListener("close",T)}}return uu=o,uu}var du,Em;function uR(){if(Em)return du;Em=1;var e;function t(h,y,S){return y=n(y),y in h?Object.defineProperty(h,y,{value:S,enumerable:!0,configurable:!0,writable:!0}):h[y]=S,h}function n(h){var y=r(h,"string");return typeof y=="symbol"?y:String(y)}function r(h,y){if(typeof h!="object"||h===null)return h;var S=h[Symbol.toPrimitive];if(S!==void 0){var E=S.call(h,y);if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(y==="string"?String:Number)(h)}var o=fu(),i=Symbol("lastResolve"),s=Symbol("lastReject"),a=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),l=Symbol("handlePromise"),f=Symbol("stream");function d(h,y){return{value:h,done:y}}function m(h){var y=h[i];if(y!==null){var S=h[f].read();S!==null&&(h[u]=null,h[i]=null,h[s]=null,y(d(S,!1)))}}function w(h){be.nextTick(m,h)}function b(h,y){return function(S,E){h.then(function(){if(y[c]){S(d(void 0,!0));return}y[l](S,E)},E)}}var T=Object.getPrototypeOf(function(){}),v=Object.setPrototypeOf((e={get stream(){return this[f]},next:function(){var y=this,S=this[a];if(S!==null)return Promise.reject(S);if(this[c])return Promise.resolve(d(void 0,!0));if(this[f].destroyed)return new Promise(function(A,$){be.nextTick(function(){y[a]?$(y[a]):A(d(void 0,!0))})});var E=this[u],R;if(E)R=new Promise(b(E,this));else{var I=this[f].read();if(I!==null)return Promise.resolve(d(I,!1));R=new Promise(this[l])}return this[u]=R,R}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var y=this;return new Promise(function(S,E){y[f].destroy(null,function(R){if(R){E(R);return}S(d(void 0,!0))})})}),e),T),g=function(y){var S,E=Object.create(v,(S={},t(S,f,{value:y,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:y._readableState.endEmitted,writable:!0}),t(S,l,{value:function(I,A){var $=E[f].read();$?(E[u]=null,E[i]=null,E[s]=null,I(d($,!1))):(E[i]=I,E[s]=A)},writable:!0}),S));return E[u]=null,o(y,function(R){if(R&&R.code!=="ERR_STREAM_PREMATURE_CLOSE"){var I=E[s];I!==null&&(E[u]=null,E[i]=null,E[s]=null,I(R)),E[a]=R;return}var A=E[i];A!==null&&(E[u]=null,E[i]=null,E[s]=null,A(d(void 0,!0))),E[c]=!0}),y.on("readable",w.bind(null,E)),E};return du=g,du}var pu,Tm;function fR(){return Tm||(Tm=1,pu=function(){throw new Error("Readable.from is not available in the browser")}),pu}var hu,Am;function Rm(){if(Am)return hu;Am=1,hu=A;var e;A.ReadableState=I,Ql().EventEmitter;var t=function(q,ue){return q.listeners(ue).length},n=Xh(),r=Es().Buffer,o=(typeof Cr<"u"?Cr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i(B){return r.from(B)}function s(B){return r.isBuffer(B)||B instanceof o}var a=lm(),c;a&&a.debuglog?c=a.debuglog("stream"):c=function(){};var u=aR(),l=fm(),f=hm(),d=f.getHighWaterMark,m=Fi().codes,w=m.ERR_INVALID_ARG_TYPE,b=m.ERR_STREAM_PUSH_AFTER_EOF,T=m.ERR_METHOD_NOT_IMPLEMENTED,v=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,g,h,y;Jr()(A,n);var S=l.errorOrDestroy,E=["error","close","destroy","pause","resume"];function R(B,q,ue){if(typeof B.prependListener=="function")return B.prependListener(q,ue);!B._events||!B._events[q]?B.on(q,ue):Array.isArray(B._events[q])?B._events[q].unshift(ue):B._events[q]=[ue,B._events[q]]}function I(B,q,ue){e=e||Pi(),B=B||{},typeof ue!="boolean"&&(ue=q instanceof e),this.objectMode=!!B.objectMode,ue&&(this.objectMode=this.objectMode||!!B.readableObjectMode),this.highWaterMark=d(this,B,"readableHighWaterMark",ue),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=B.emitClose!==!1,this.autoDestroy=!!B.autoDestroy,this.destroyed=!1,this.defaultEncoding=B.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,B.encoding&&(g||(g=cu().StringDecoder),this.decoder=new g(B.encoding),this.encoding=B.encoding)}function A(B){if(e=e||Pi(),!(this instanceof A))return new A(B);var q=this instanceof e;this._readableState=new I(B,this,q),this.readable=!0,B&&(typeof B.read=="function"&&(this._read=B.read),typeof B.destroy=="function"&&(this._destroy=B.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(B,q){q(B)},A.prototype.push=function(B,q){var ue=this._readableState,Re;return ue.objectMode?Re=!0:typeof B=="string"&&(q=q||ue.defaultEncoding,q!==ue.encoding&&(B=r.from(B,q),q=""),Re=!0),$(this,B,q,!1,Re)},A.prototype.unshift=function(B){return $(this,B,null,!0,!1)};function $(B,q,ue,Re,Le){c("readableAddChunk",q);var ke=B._readableState;if(q===null)ke.reading=!1,X(B,ke);else{var Fe;if(Le||(Fe=k(ke,q)),Fe)S(B,Fe);else if(ke.objectMode||q&&q.length>0)if(typeof q!="string"&&!ke.objectMode&&Object.getPrototypeOf(q)!==r.prototype&&(q=i(q)),Re)ke.endEmitted?S(B,new v):D(B,ke,q,!0);else if(ke.ended)S(B,new b);else{if(ke.destroyed)return!1;ke.reading=!1,ke.decoder&&!ue?(q=ke.decoder.write(q),ke.objectMode||q.length!==0?D(B,ke,q,!1):oe(B,ke)):D(B,ke,q,!1)}else Re||(ke.reading=!1,oe(B,ke))}return!ke.ended&&(ke.length<ke.highWaterMark||ke.length===0)}function D(B,q,ue,Re){q.flowing&&q.length===0&&!q.sync?(q.awaitDrain=0,B.emit("data",ue)):(q.length+=q.objectMode?1:ue.length,Re?q.buffer.unshift(ue):q.buffer.push(ue),q.needReadable&&se(B)),oe(B,q)}function k(B,q){var ue;return!s(q)&&typeof q!="string"&&q!==void 0&&!B.objectMode&&(ue=new w("chunk",["string","Buffer","Uint8Array"],q)),ue}A.prototype.isPaused=function(){return this._readableState.flowing===!1},A.prototype.setEncoding=function(B){g||(g=cu().StringDecoder);var q=new g(B);this._readableState.decoder=q,this._readableState.encoding=this._readableState.decoder.encoding;for(var ue=this._readableState.buffer.head,Re="";ue!==null;)Re+=q.write(ue.data),ue=ue.next;return this._readableState.buffer.clear(),Re!==""&&this._readableState.buffer.push(Re),this._readableState.length=Re.length,this};var N=1073741824;function z(B){return B>=N?B=N:(B--,B|=B>>>1,B|=B>>>2,B|=B>>>4,B|=B>>>8,B|=B>>>16,B++),B}function G(B,q){return B<=0||q.length===0&&q.ended?0:q.objectMode?1:B!==B?q.flowing&&q.length?q.buffer.head.data.length:q.length:(B>q.highWaterMark&&(q.highWaterMark=z(B)),B<=q.length?B:q.ended?q.length:(q.needReadable=!0,0))}A.prototype.read=function(B){c("read",B),B=parseInt(B,10);var q=this._readableState,ue=B;if(B!==0&&(q.emittedReadable=!1),B===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?P(this):se(this),null;if(B=G(B,q),B===0&&q.ended)return q.length===0&&P(this),null;var Re=q.needReadable;c("need readable",Re),(q.length===0||q.length-B<q.highWaterMark)&&(Re=!0,c("length less than watermark",Re)),q.ended||q.reading?(Re=!1,c("reading or ended",Re)):Re&&(c("do read"),q.reading=!0,q.sync=!0,q.length===0&&(q.needReadable=!0),this._read(q.highWaterMark),q.sync=!1,q.reading||(B=G(ue,q)));var Le;return B>0?Le=_(B,q):Le=null,Le===null?(q.needReadable=q.length<=q.highWaterMark,B=0):(q.length-=B,q.awaitDrain=0),q.length===0&&(q.ended||(q.needReadable=!0),ue!==B&&q.ended&&P(this)),Le!==null&&this.emit("data",Le),Le};function X(B,q){if(c("onEofChunk"),!q.ended){if(q.decoder){var ue=q.decoder.end();ue&&ue.length&&(q.buffer.push(ue),q.length+=q.objectMode?1:ue.length)}q.ended=!0,q.sync?se(B):(q.needReadable=!1,q.emittedReadable||(q.emittedReadable=!0,ne(B)))}}function se(B){var q=B._readableState;c("emitReadable",q.needReadable,q.emittedReadable),q.needReadable=!1,q.emittedReadable||(c("emitReadable",q.flowing),q.emittedReadable=!0,be.nextTick(ne,B))}function ne(B){var q=B._readableState;c("emitReadable_",q.destroyed,q.length,q.ended),!q.destroyed&&(q.length||q.ended)&&(B.emit("readable"),q.emittedReadable=!1),q.needReadable=!q.flowing&&!q.ended&&q.length<=q.highWaterMark,Y(B)}function oe(B,q){q.readingMore||(q.readingMore=!0,be.nextTick(fe,B,q))}function fe(B,q){for(;!q.reading&&!q.ended&&(q.length<q.highWaterMark||q.flowing&&q.length===0);){var ue=q.length;if(c("maybeReadMore read 0"),B.read(0),ue===q.length)break}q.readingMore=!1}A.prototype._read=function(B){S(this,new T("_read()"))},A.prototype.pipe=function(B,q){var ue=this,Re=this._readableState;switch(Re.pipesCount){case 0:Re.pipes=B;break;case 1:Re.pipes=[Re.pipes,B];break;default:Re.pipes.push(B);break}Re.pipesCount+=1,c("pipe count=%d opts=%j",Re.pipesCount,q);var Le=(!q||q.end!==!1)&&B!==be.stdout&&B!==be.stderr,ke=Le?Be:Qt;Re.endEmitted?be.nextTick(ke):ue.once("end",ke),B.on("unpipe",Fe);function Fe(Xt,Ft){c("onunpipe"),Xt===ue&&Ft&&Ft.hasUnpiped===!1&&(Ft.hasUnpiped=!0,$e())}function Be(){c("onend"),B.end()}var ge=we(ue);B.on("drain",ge);var le=!1;function $e(){c("cleanup"),B.removeListener("close",ut),B.removeListener("finish",ct),B.removeListener("drain",ge),B.removeListener("error",Je),B.removeListener("unpipe",Fe),ue.removeListener("end",Be),ue.removeListener("end",Qt),ue.removeListener("data",De),le=!0,Re.awaitDrain&&(!B._writableState||B._writableState.needDrain)&&ge()}ue.on("data",De);function De(Xt){c("ondata");var Ft=B.write(Xt);c("dest.write",Ft),Ft===!1&&((Re.pipesCount===1&&Re.pipes===B||Re.pipesCount>1&&V(Re.pipes,B)!==-1)&&!le&&(c("false write response, pause",Re.awaitDrain),Re.awaitDrain++),ue.pause())}function Je(Xt){c("onerror",Xt),Qt(),B.removeListener("error",Je),t(B,"error")===0&&S(B,Xt)}R(B,"error",Je);function ut(){B.removeListener("finish",ct),Qt()}B.once("close",ut);function ct(){c("onfinish"),B.removeListener("close",ut),Qt()}B.once("finish",ct);function Qt(){c("unpipe"),ue.unpipe(B)}return B.emit("pipe",ue),Re.flowing||(c("pipe resume"),ue.resume()),B};function we(B){return function(){var ue=B._readableState;c("pipeOnDrain",ue.awaitDrain),ue.awaitDrain&&ue.awaitDrain--,ue.awaitDrain===0&&t(B,"data")&&(ue.flowing=!0,Y(B))}}A.prototype.unpipe=function(B){var q=this._readableState,ue={hasUnpiped:!1};if(q.pipesCount===0)return this;if(q.pipesCount===1)return B&&B!==q.pipes?this:(B||(B=q.pipes),q.pipes=null,q.pipesCount=0,q.flowing=!1,B&&B.emit("unpipe",this,ue),this);if(!B){var Re=q.pipes,Le=q.pipesCount;q.pipes=null,q.pipesCount=0,q.flowing=!1;for(var ke=0;ke<Le;ke++)Re[ke].emit("unpipe",this,{hasUnpiped:!1});return this}var Fe=V(q.pipes,B);return Fe===-1?this:(q.pipes.splice(Fe,1),q.pipesCount-=1,q.pipesCount===1&&(q.pipes=q.pipes[0]),B.emit("unpipe",this,ue),this)},A.prototype.on=function(B,q){var ue=n.prototype.on.call(this,B,q),Re=this._readableState;return B==="data"?(Re.readableListening=this.listenerCount("readable")>0,Re.flowing!==!1&&this.resume()):B==="readable"&&!Re.endEmitted&&!Re.readableListening&&(Re.readableListening=Re.needReadable=!0,Re.flowing=!1,Re.emittedReadable=!1,c("on readable",Re.length,Re.reading),Re.length?se(this):Re.reading||be.nextTick(re,this)),ue},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(B,q){var ue=n.prototype.removeListener.call(this,B,q);return B==="readable"&&be.nextTick(Z,this),ue},A.prototype.removeAllListeners=function(B){var q=n.prototype.removeAllListeners.apply(this,arguments);return(B==="readable"||B===void 0)&&be.nextTick(Z,this),q};function Z(B){var q=B._readableState;q.readableListening=B.listenerCount("readable")>0,q.resumeScheduled&&!q.paused?q.flowing=!0:B.listenerCount("data")>0&&B.resume()}function re(B){c("readable nexttick read 0"),B.read(0)}A.prototype.resume=function(){var B=this._readableState;return B.flowing||(c("resume"),B.flowing=!B.readableListening,ce(this,B)),B.paused=!1,this};function ce(B,q){q.resumeScheduled||(q.resumeScheduled=!0,be.nextTick(Ie,B,q))}function Ie(B,q){c("resume",q.reading),q.reading||B.read(0),q.resumeScheduled=!1,B.emit("resume"),Y(B),q.flowing&&!q.reading&&B.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 Y(B){var q=B._readableState;for(c("flow",q.flowing);q.flowing&&B.read()!==null;);}A.prototype.wrap=function(B){var q=this,ue=this._readableState,Re=!1;B.on("end",function(){if(c("wrapped end"),ue.decoder&&!ue.ended){var Fe=ue.decoder.end();Fe&&Fe.length&&q.push(Fe)}q.push(null)}),B.on("data",function(Fe){if(c("wrapped data"),ue.decoder&&(Fe=ue.decoder.write(Fe)),!(ue.objectMode&&Fe==null)&&!(!ue.objectMode&&(!Fe||!Fe.length))){var Be=q.push(Fe);Be||(Re=!0,B.pause())}});for(var Le in B)this[Le]===void 0&&typeof B[Le]=="function"&&(this[Le]=function(Be){return function(){return B[Be].apply(B,arguments)}}(Le));for(var ke=0;ke<E.length;ke++)B.on(E[ke],this.emit.bind(this,E[ke]));return this._read=function(Fe){c("wrapped _read",Fe),Re&&(Re=!1,B.resume())},this},typeof Symbol=="function"&&(A.prototype[Symbol.asyncIterator]=function(){return h===void 0&&(h=uR()),h(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=_,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function _(B,q){if(q.length===0)return null;var ue;return q.objectMode?ue=q.buffer.shift():!B||B>=q.length?(q.decoder?ue=q.buffer.join(""):q.buffer.length===1?ue=q.buffer.first():ue=q.buffer.concat(q.length),q.buffer.clear()):ue=q.buffer.consume(B,q.decoder),ue}function P(B){var q=B._readableState;c("endReadable",q.endEmitted),q.endEmitted||(q.ended=!0,be.nextTick(K,q,B))}function K(B,q){if(c("endReadableNT",B.endEmitted,B.length),!B.endEmitted&&B.length===0&&(B.endEmitted=!0,q.readable=!1,q.emit("end"),B.autoDestroy)){var ue=q._writableState;(!ue||ue.autoDestroy&&ue.finished)&&q.destroy()}}typeof Symbol=="function"&&(A.from=function(B,q){return y===void 0&&(y=fR()),y(A,B,q)});function V(B,q){for(var ue=0,Re=B.length;ue<Re;ue++)if(B[ue]===q)return ue;return-1}return hu}var gu,_m;function Im(){if(_m)return gu;_m=1,gu=a;var e=Fi().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=Pi();Jr()(a,i);function s(l,f){var d=this._transformState;d.transforming=!1;var m=d.writecb;if(m===null)return this.emit("error",new n);d.writechunk=null,d.writecb=null,f!=null&&this.push(f),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(f,d){u(l,f,d)}):u(this,null,null)}a.prototype.push=function(l,f){return this._transformState.needTransform=!1,i.prototype.push.call(this,l,f)},a.prototype._transform=function(l,f,d){d(new t("_transform()"))},a.prototype._write=function(l,f,d){var m=this._transformState;if(m.writecb=d,m.writechunk=l,m.writeencoding=f,!m.transforming){var w=this._readableState;(m.needTransform||w.needReadable||w.length<w.highWaterMark)&&this._read(w.highWaterMark)}},a.prototype._read=function(l){var f=this._transformState;f.writechunk!==null&&!f.transforming?(f.transforming=!0,this._transform(f.writechunk,f.writeencoding,f.afterTransform)):f.needTransform=!0},a.prototype._destroy=function(l,f){i.prototype._destroy.call(this,l,function(d){f(d)})};function u(l,f,d){if(f)return l.emit("error",f);if(d!=null&&l.push(d),l._writableState.length)throw new o;if(l._transformState.transforming)throw new r;return l.push(null)}return gu}var mu,Cm;function dR(){if(Cm)return mu;Cm=1,mu=t;var e=Im();Jr()(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)},mu}var yu,Fm;function pR(){if(Fm)return yu;Fm=1;var e;function t(d){var m=!1;return function(){m||(m=!0,d.apply(void 0,arguments))}}var n=Fi().codes,r=n.ERR_MISSING_ARGS,o=n.ERR_STREAM_DESTROYED;function i(d){if(d)throw d}function s(d){return d.setHeader&&typeof d.abort=="function"}function a(d,m,w,b){b=t(b);var T=!1;d.on("close",function(){T=!0}),e===void 0&&(e=fu()),e(d,{readable:m,writable:w},function(g){if(g)return b(g);T=!0,b()});var v=!1;return function(g){if(!T&&!v){if(v=!0,s(d))return d.abort();if(typeof d.destroy=="function")return d.destroy();b(g||new o("pipe"))}}}function c(d){d()}function u(d,m){return d.pipe(m)}function l(d){return!d.length||typeof d[d.length-1]!="function"?i:d.pop()}function f(){for(var d=arguments.length,m=new Array(d),w=0;w<d;w++)m[w]=arguments[w];var b=l(m);if(Array.isArray(m[0])&&(m=m[0]),m.length<2)throw new r("streams");var T,v=m.map(function(g,h){var y=h<m.length-1,S=h>0;return a(g,y,S,function(E){T||(T=E),E&&v.forEach(c),!y&&(v.forEach(c),b(T))})});return m.reduce(u)}return yu=f,yu}var bu,Pm;function hR(){if(Pm)return bu;Pm=1,bu=n;var e=Ql().EventEmitter,t=Jr();t(n,e),n.Readable=Rm(),n.Writable=ym(),n.Duplex=Pi(),n.Transform=Im(),n.PassThrough=dR(),n.finished=fu(),n.pipeline=pR(),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 f(m){if(d(),e.listenerCount(this,"error")===0)throw m}i.on("error",f),r.on("error",f);function d(){i.removeListener("data",s),r.removeListener("drain",a),i.removeListener("end",u),i.removeListener("close",l),i.removeListener("error",f),r.removeListener("error",f),i.removeListener("end",d),i.removeListener("close",d),r.removeListener("close",d)}return i.on("end",d),i.on("close",d),r.on("close",d),r.emit("pipe",i),r},bu}var Om;function gR(){return Om||(Om=1,function(e){(function(t){t.parser=function(_,P){return new r(_,P)},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(_,P){if(!(this instanceof r))return new r(_,P);var K=this;i(K),K.q=K.c="",K.bufferCheckPosition=t.MAX_BUFFER_LENGTH,K.opt=P||{},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=!!_,K.noscript=!!(_||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(b)),K.opt.unquotedAttributeValues===void 0&&(K.opt.unquotedAttributeValues=!_),K.trackPosition=K.opt.position!==!1,K.trackPosition&&(K.position=K.line=K.column=0),D(K,"onready")}Object.create||(Object.create=function(_){function P(){}P.prototype=_;var K=new P;return K}),Object.keys||(Object.keys=function(_){var P=[];for(var K in _)_.hasOwnProperty(K)&&P.push(K);return P});function o(_){for(var P=Math.max(t.MAX_BUFFER_LENGTH,10),K=0,V=0,B=n.length;V<B;V++){var q=_[n[V]].length;if(q>P)switch(n[V]){case"textNode":N(_);break;case"cdata":k(_,"oncdata",_.cdata),_.cdata="";break;case"script":k(_,"onscript",_.script),_.script="";break;default:G(_,"Max buffer length exceeded: "+n[V])}K=Math.max(K,q)}var ue=t.MAX_BUFFER_LENGTH-K;_.bufferCheckPosition=ue+_.position}function i(_){for(var P=0,K=n.length;P<K;P++)_[n[P]]=""}function s(_){N(_),_.cdata!==""&&(k(_,"oncdata",_.cdata),_.cdata=""),_.script!==""&&(k(_,"onscript",_.script),_.script="")}r.prototype={end:function(){X(this)},write:Y,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){s(this)}};var a;try{a=hR().Stream}catch{a=function(){}}a||(a=function(){});var c=t.EVENTS.filter(function(_){return _!=="error"&&_!=="end"});function u(_,P){return new l(_,P)}function l(_,P){if(!(this instanceof l))return new l(_,P);a.apply(this),this._parser=new r(_,P),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,c.forEach(function(V){Object.defineProperty(K,"on"+V,{get:function(){return K._parser["on"+V]},set:function(B){if(!B)return K.removeAllListeners(V),K._parser["on"+V]=B,B;K.on(V,B)},enumerable:!0,configurable:!1})})}l.prototype=Object.create(a.prototype,{constructor:{value:l}}),l.prototype.write=function(_){if(typeof yr=="function"&&typeof yr.isBuffer=="function"&&yr.isBuffer(_)){if(!this._decoder){var P=cu().StringDecoder;this._decoder=new P("utf8")}_=this._decoder.write(_)}return this._parser.write(_.toString()),this.emit("data",_),!0},l.prototype.end=function(_){return _&&_.length&&this.write(_),this._parser.end(),!0},l.prototype.on=function(_,P){var K=this;return!K._parser["on"+_]&&c.indexOf(_)!==-1&&(K._parser["on"+_]=function(){var V=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);V.splice(0,0,_),K.emit.apply(K,V)}),a.prototype.on.call(K,_,P)};var f="[CDATA[",d="DOCTYPE",m="http://www.w3.org/XML/1998/namespace",w="http://www.w3.org/2000/xmlns/",b={xml:m,xmlns:w},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]/,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-]/,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]/,h=/[#:_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 y(_){return _===" "||_===`
26
+ `||_==="\r"||_===" "}function S(_){return _==='"'||_==="'"}function E(_){return _===">"||y(_)}function R(_,P){return _.test(P)}function I(_,P){return!R(_,P)}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(_){var P=t.ENTITIES[_],K=typeof P=="number"?String.fromCharCode(P):P;t.ENTITIES[_]=K});for(var $ in t.STATE)t.STATE[t.STATE[$]]=$;A=t.STATE;function D(_,P,K){_[P]&&_[P](K)}function k(_,P,K){_.textNode&&N(_),D(_,P,K)}function N(_){_.textNode=z(_.opt,_.textNode),_.textNode&&D(_,"ontext",_.textNode),_.textNode=""}function z(_,P){return _.trim&&(P=P.trim()),_.normalize&&(P=P.replace(/\s+/g," ")),P}function G(_,P){return N(_),_.trackPosition&&(P+=`
27
27
  Line: `+_.line+`
28
28
  Column: `+_.column+`
29
- Char: `+_.c),F=new Error(F),_.error=F,D(_,"onerror",F),_}function X(_){return _.sawRoot&&!_.closedRoot&&ie(_,"Unclosed root tag"),_.state!==A.BEGIN&&_.state!==A.BEGIN_WHITESPACE&&_.state!==A.TEXT&&W(_,"Unexpected end"),N(_),_.c="",_.closed=!0,D(_,"onend"),r.call(_,_.strict,_.opt),_}function ie(_,F){if(typeof _!="object"||!(_ instanceof r))throw new Error("bad call to strictFail");_.strict&&W(_,F)}function de(_){_.strict||(_.tagName=_.tagName[_.looseCase]());var F=_.tags[_.tags.length-1]||_,K=_.tag={name:_.tagName,attributes:{}};_.opt.xmlns&&(K.ns=F.ns),_.attribList.length=0,k(_,"onopentagstart",K)}function se(_,F){var K=_.indexOf(":"),z=K<0?["",_]:_.split(":"),B=z[0],V=z[1];return F&&_==="xmlns"&&(B="xmlns",V=""),{prefix:B,local:V}}function we(_){if(_.strict||(_.attribName=_.attribName[_.looseCase]()),_.attribList.indexOf(_.attribName)!==-1||_.tag.attributes.hasOwnProperty(_.attribName)){_.attribName=_.attribValue="";return}if(_.opt.xmlns){var F=se(_.attribName,!0),K=F.prefix,z=F.local;if(K==="xmlns")if(z==="xml"&&_.attribValue!==m)ie(_,"xml: prefix must be bound to "+m+`
30
- Actual: `+_.attribValue);else if(z==="xmlns"&&_.attribValue!==w)ie(_,"xmlns: prefix must be bound to "+w+`
31
- Actual: `+_.attribValue);else{var B=_.tag,V=_.tags[_.tags.length-1]||_;B.ns===V.ns&&(B.ns=Object.create(V.ns)),B.ns[z]=_.attribValue}_.attribList.push([_.attribName,_.attribValue])}else _.tag.attributes[_.attribName]=_.attribValue,k(_,"onattribute",{name:_.attribName,value:_.attribValue});_.attribName=_.attribValue=""}function Se(_,F){if(_.opt.xmlns){var K=_.tag,z=se(_.tagName);K.prefix=z.prefix,K.local=z.local,K.uri=K.ns[z.prefix]||"",K.prefix&&!K.uri&&(ie(_,"Unbound namespace prefix: "+JSON.stringify(_.tagName)),K.uri=z.prefix);var B=_.tags[_.tags.length-1]||_;K.ns&&B.ns!==K.ns&&Object.keys(K.ns).forEach(function(De){k(_,"onopennamespace",{prefix:De,uri:K.ns[De]})});for(var V=0,ce=_.attribList.length;V<ce;V++){var Re=_.attribList[V],Le=Re[0],ke=Re[1],Pe=se(Le,!0),Be=Pe.prefix,he=Pe.local,ae=Be===""?"":K.ns[Be]||"",$e={name:Le,value:ke,prefix:Be,local:he,uri:ae};Be&&Be!=="xmlns"&&!ae&&(ie(_,"Unbound namespace prefix: "+JSON.stringify(Be)),$e.uri=Be),_.tag.attributes[Le]=$e,k(_,"onattribute",$e)}_.attribList.length=0}_.tag.isSelfClosing=!!F,_.sawRoot=!0,_.tags.push(_.tag),k(_,"onopentag",_.tag),F||(!_.noscript&&_.tagName.toLowerCase()==="script"?_.state=A.SCRIPT:_.state=A.TEXT,_.tag=null,_.tagName=""),_.attribName=_.attribValue="",_.attribList.length=0}function Z(_){if(!_.tagName){ie(_,"Weird empty close tag."),_.textNode+="</>",_.state=A.TEXT;return}if(_.script){if(_.tagName!=="script"){_.script+="</"+_.tagName+">",_.tagName="",_.state=A.SCRIPT;return}k(_,"onscript",_.script),_.script=""}var F=_.tags.length,K=_.tagName;_.strict||(K=K[_.looseCase]());for(var z=K;F--;){var B=_.tags[F];if(B.name!==z)ie(_,"Unexpected close tag");else break}if(F<0){ie(_,"Unmatched closing tag: "+_.tagName),_.textNode+="</"+_.tagName+">",_.state=A.TEXT;return}_.tagName=K;for(var V=_.tags.length;V-- >F;){var ce=_.tag=_.tags.pop();_.tagName=_.tag.name,k(_,"onclosetag",_.tagName);var Re={};for(var Le in ce.ns)Re[Le]=ce.ns[Le];var ke=_.tags[_.tags.length-1]||_;_.opt.xmlns&&ce.ns!==ke.ns&&Object.keys(ce.ns).forEach(function(Pe){var Be=ce.ns[Pe];k(_,"onclosenamespace",{prefix:Pe,uri:Be})})}F===0&&(_.closedRoot=!0),_.tagName=_.attribValue=_.attribName="",_.attribList.length=0,_.state=A.TEXT}function ne(_){var F=_.entity,K=F.toLowerCase(),z,B="";return _.ENTITIES[F]?_.ENTITIES[F]:_.ENTITIES[K]?_.ENTITIES[K]:(F=K,F.charAt(0)==="#"&&(F.charAt(1)==="x"?(F=F.slice(2),z=parseInt(F,16),B=z.toString(16)):(F=F.slice(1),z=parseInt(F,10),B=z.toString(10))),F=F.replace(/^0+/,""),isNaN(z)||B.toLowerCase()!==F?(ie(_,"Invalid character entity"),"&"+_.entity+";"):String.fromCodePoint(z))}function le(_,F){F==="<"?(_.state=A.OPEN_WAKA,_.startTagPosition=_.position):y(F)||(ie(_,"Non-whitespace before first tag."),_.textNode=F,_.state=A.TEXT)}function Ie(_,F){var K="";return F<_.length&&(K=_.charAt(F)),K}function Y(_){var F=this;if(this.error)throw this.error;if(F.closed)return W(F,"Cannot write after close. Assign an onready handler.");if(_===null)return X(F);typeof _=="object"&&(_=_.toString());for(var K=0,z="";z=Ie(_,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;le(F,z);continue;case A.BEGIN_WHITESPACE:le(F,z);continue;case A.TEXT:if(F.sawRoot&&!F.closedRoot){for(var B=K-1;z&&z!=="<"&&z!=="&";)z=Ie(_,K++),z&&F.trackPosition&&(F.position++,z===`
33
- `?(F.line++,F.column=0):F.column++);F.textNode+=_.substring(B,K-1)}z==="<"&&!(F.sawRoot&&F.closedRoot&&!F.strict)?(F.state=A.OPEN_WAKA,F.startTagPosition=F.position):(!y(z)&&(!F.sawRoot||F.closedRoot)&&ie(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(!y(z))if(R(T,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(ie(F,"Unencoded <"),F.startTagPosition+1<F.position){var V=F.position-F.startTagPosition;z=new Array(V).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()===f?(k(F,"onopencdata"),F.state=A.CDATA,F.sgmlDecl="",F.cdata=""):(F.sgmlDecl+z).toUpperCase()===d?(F.state=A.DOCTYPE,(F.doctype||F.sawRoot)&&ie(F,"Inappropriately located doctype declaration"),F.doctype="",F.sgmlDecl=""):z===">"?(k(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,k(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=j(F.opt,F.comment),F.comment&&k(F,"oncomment",F.comment),F.comment=""):(F.comment+="-"+z,F.state=A.COMMENT);continue;case A.COMMENT_ENDED:z!==">"?(ie(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&&k(F,"oncdata",F.cdata),k(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:y(z)?F.state=A.PROC_INST_BODY:F.procInstName+=z;continue;case A.PROC_INST_BODY:if(!F.procInstBody&&y(z))continue;z==="?"?F.state=A.PROC_INST_ENDING:F.procInstBody+=z;continue;case A.PROC_INST_ENDING:z===">"?(k(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:R(b,z)?F.tagName+=z:(de(F),z===">"?Se(F):z==="/"?F.state=A.OPEN_TAG_SLASH:(y(z)||ie(F,"Invalid character in tag name"),F.state=A.ATTRIB));continue;case A.OPEN_TAG_SLASH:z===">"?(Se(F,!0),Z(F)):(ie(F,"Forward-slash in opening tag not followed by >"),F.state=A.ATTRIB);continue;case A.ATTRIB:if(y(z))continue;z===">"?Se(F):z==="/"?F.state=A.OPEN_TAG_SLASH:R(T,z)?(F.attribName=z,F.attribValue="",F.state=A.ATTRIB_NAME):ie(F,"Invalid attribute name");continue;case A.ATTRIB_NAME:z==="="?F.state=A.ATTRIB_VALUE:z===">"?(ie(F,"Attribute without value"),F.attribValue=F.attribName,we(F),Se(F)):y(z)?F.state=A.ATTRIB_NAME_SAW_WHITE:R(b,z)?F.attribName+=z:ie(F,"Invalid attribute name");continue;case A.ATTRIB_NAME_SAW_WHITE:if(z==="=")F.state=A.ATTRIB_VALUE;else{if(y(z))continue;ie(F,"Attribute without value"),F.tag.attributes[F.attribName]="",F.attribValue="",k(F,"onattribute",{name:F.attribName,value:""}),F.attribName="",z===">"?Se(F):R(T,z)?(F.attribName=z,F.state=A.ATTRIB_NAME):(ie(F,"Invalid attribute name"),F.state=A.ATTRIB)}continue;case A.ATTRIB_VALUE:if(y(z))continue;S(z)?(F.q=z,F.state=A.ATTRIB_VALUE_QUOTED):(F.opt.unquotedAttributeValues||W(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}we(F),F.q="",F.state=A.ATTRIB_VALUE_CLOSED;continue;case A.ATTRIB_VALUE_CLOSED:y(z)?F.state=A.ATTRIB:z===">"?Se(F):z==="/"?F.state=A.OPEN_TAG_SLASH:R(T,z)?(ie(F,"No whitespace between attributes"),F.attribName=z,F.attribValue="",F.state=A.ATTRIB_NAME):ie(F,"Invalid attribute name");continue;case A.ATTRIB_VALUE_UNQUOTED:if(!E(z)){z==="&"?F.state=A.ATTRIB_VALUE_ENTITY_U:F.attribValue+=z;continue}we(F),z===">"?Se(F):F.state=A.ATTRIB;continue;case A.CLOSE_TAG:if(F.tagName)z===">"?Z(F):R(b,z)?F.tagName+=z:F.script?(F.script+="</"+F.tagName,F.tagName="",F.state=A.SCRIPT):(y(z)||ie(F,"Invalid tagname in closing tag"),F.state=A.CLOSE_TAG_SAW_WHITE);else{if(y(z))continue;I(T,z)?F.script?(F.script+="</"+z,F.state=A.SCRIPT):ie(F,"Invalid tagname in closing tag."):F.tagName=z}continue;case A.CLOSE_TAG_SAW_WHITE:if(y(z))continue;z===">"?Z(F):ie(F,"Invalid characters in closing tag");continue;case A.TEXT_ENTITY:case A.ATTRIB_VALUE_ENTITY_Q:case A.ATTRIB_VALUE_ENTITY_U:var ce,Re;switch(F.state){case A.TEXT_ENTITY:ce=A.TEXT,Re="textNode";break;case A.ATTRIB_VALUE_ENTITY_Q:ce=A.ATTRIB_VALUE_QUOTED,Re="attribValue";break;case A.ATTRIB_VALUE_ENTITY_U:ce=A.ATTRIB_VALUE_UNQUOTED,Re="attribValue";break}if(z===";"){var Le=ne(F);F.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(Le)?(F.entity="",F.state=ce,F.write(Le)):(F[Re]+=Le,F.entity="",F.state=ce)}else R(F.entity.length?h:g,z)?F.entity+=z:(ie(F,"Invalid character in entity name"),F[Re]+="&"+F.entity+z,F.entity="",F.state=ce);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 _=String.fromCharCode,F=Math.floor,K=function(){var z=16384,B=[],V,ce,Re=-1,Le=arguments.length;if(!Le)return"";for(var ke="";++Re<Le;){var Pe=Number(arguments[Re]);if(!isFinite(Pe)||Pe<0||Pe>1114111||F(Pe)!==Pe)throw RangeError("Invalid code point: "+Pe);Pe<=65535?B.push(Pe):(Pe-=65536,V=(Pe>>10)+55296,ce=Pe%1024+56320,B.push(V,ce)),(Re+1===Le||B.length>z)&&(ke+=_.apply(null,B),B.length=0)}return ke};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:K,configurable:!0,writable:!0}):String.fromCodePoint=K}()})(e)}(Kl)),Kl}var vu,Om;function wu(){return Om||(Om=1,vu={isArray:function(e){return Array.isArray?Array.isArray(e):Object.prototype.toString.call(e)==="[object Array]"}}),vu}var Su,xm;function Eu(){if(xm)return Su;xm=1;var e=wu().isArray;return Su={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}},Su}var Tu,km;function Nm(){if(km)return Tu;km=1;var e=hR(),t=Eu(),n=wu().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 h=b.toLowerCase();return h==="true"?!0:h==="false"?!1:b}function a(b,g){var h;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(h in g)if(g.hasOwnProperty(h))if("instructionFn"in r)g[h]=r.instructionFn(g[h],h,o);else{var y=g[h];delete g[h],g[r.instructionNameFn(h,y,o)]=y}}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(h in g)if(g.hasOwnProperty(h))break;S[r.nameKey]="instructionNameFn"in r?r.instructionNameFn(h,g,o):h,r.instructionHasAttributes?(S[r.attributesKey]=g[h][r.attributesKey],"instructionFn"in r&&(S[r.attributesKey]=r.instructionFn(S[r.attributesKey],h,o))):("instructionFn"in r&&(g[h]=r.instructionFn(g[h],h,o)),S[r.instructionKey]=g[h])}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 h=b[g];delete b[g],b[r.attributeNameFn(g,b[g],o)]=h}}return b}function u(b){var g={};if(b.body&&(b.name.toLowerCase()==="xml"||r.instructionHasAttributes)){for(var h=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,y;(y=h.exec(b.body))!==null;)g[y[1]]=y[2]||y[3]||y[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 h;if(typeof b=="object"&&(g=b.attributes,b=b.name),g=c(g),"elementNameFn"in r&&(b=r.elementNameFn(b,o)),r.compact){if(h={},!r.ignoreAttributes&&g&&Object.keys(g).length){h[r.attributesKey]={};var y;for(y in g)g.hasOwnProperty(y)&&(h[r.attributesKey][y]=g[y])}!(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(h):o[b]=h}else o[r.elementsKey]||(o[r.elementsKey]=[]),h={},h[r.typeKey]="element",h[r.nameKey]=b,!r.ignoreAttributes&&g&&Object.keys(g).length&&(h[r.attributesKey]=g),r.alwaysChildren&&(h[r.elementsKey]=[]),o[r.elementsKey].push(h);h[r.parentKey]=o,o=h}function f(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 d(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 v(b){r.ignoreDoctype||(b=b.replace(/^ /,""),r.trim&&(b=b.trim()),a("doctype",b))}function T(b){b.note=b}return Tu=function(b,g){var h=e.parser(!0,{}),y={};if(o=y,r=i(g),h.opt={strictEntities:!0},h.onopentag=l,h.ontext=f,h.oncomment=d,h.onclosetag=m,h.onerror=T,h.oncdata=w,h.ondoctype=v,h.onprocessinginstruction=u,h.write(b).close(),y[r.elementsKey]){var S=y[r.elementsKey];delete y[r.elementsKey],y[r.elementsKey]=S,delete y.text}return y},Tu}var Au,$m;function gR(){if($m)return Au;$m=1;var e=Eu(),t=Nm();function n(r){var o=e.copyOptions(r);return e.ensureSpacesExists(o),o}return Au=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")},Au}var Ru,Dm;function Lm(){if(Dm)return Ru;Dm=1;var e=Eu(),t=wu().isArray,n,r;function o(h){var y=e.copyOptions(h);return e.ensureFlagExists("ignoreDeclaration",y),e.ensureFlagExists("ignoreInstruction",y),e.ensureFlagExists("ignoreAttributes",y),e.ensureFlagExists("ignoreText",y),e.ensureFlagExists("ignoreComment",y),e.ensureFlagExists("ignoreCdata",y),e.ensureFlagExists("ignoreDoctype",y),e.ensureFlagExists("compact",y),e.ensureFlagExists("indentText",y),e.ensureFlagExists("indentCdata",y),e.ensureFlagExists("indentAttributes",y),e.ensureFlagExists("indentInstruction",y),e.ensureFlagExists("fullTagEmptyElement",y),e.ensureFlagExists("noQuotesForNativeAttributes",y),e.ensureSpacesExists(y),typeof y.spaces=="number"&&(y.spaces=Array(y.spaces+1).join(" ")),e.ensureKeyExists("declaration",y),e.ensureKeyExists("instruction",y),e.ensureKeyExists("attributes",y),e.ensureKeyExists("text",y),e.ensureKeyExists("comment",y),e.ensureKeyExists("cdata",y),e.ensureKeyExists("doctype",y),e.ensureKeyExists("type",y),e.ensureKeyExists("name",y),e.ensureKeyExists("elements",y),e.checkFnExists("doctype",y),e.checkFnExists("instruction",y),e.checkFnExists("cdata",y),e.checkFnExists("comment",y),e.checkFnExists("text",y),e.checkFnExists("instructionName",y),e.checkFnExists("elementName",y),e.checkFnExists("attributeName",y),e.checkFnExists("attributeValue",y),e.checkFnExists("attributes",y),e.checkFnExists("fullTagEmptyElement",y),y}function i(h,y,S){return(!S&&h.spaces?`
34
- `:"")+Array(y+1).join(h.spaces)}function s(h,y,S){if(y.ignoreAttributes)return"";"attributesFn"in y&&(h=y.attributesFn(h,r,n));var E,R,I,A,$=[];for(E in h)h.hasOwnProperty(E)&&h[E]!==null&&h[E]!==void 0&&(A=y.noQuotesForNativeAttributes&&typeof h[E]!="string"?"":'"',R=""+h[E],R=R.replace(/"/g,"&quot;"),I="attributeNameFn"in y?y.attributeNameFn(E,R,r,n):E,$.push(y.spaces&&y.indentAttributes?i(y,S+1,!1):" "),$.push(I+"="+A+("attributeValueFn"in y?y.attributeValueFn(R,E,r,n):R)+A));return h&&Object.keys(h).length&&y.spaces&&y.indentAttributes&&$.push(i(y,S,!1)),$.join("")}function a(h,y,S){return n=h,r="xml",y.ignoreDeclaration?"":"<?xml"+s(h[y.attributesKey],y,S)+"?>"}function c(h,y,S){if(y.ignoreInstruction)return"";var E;for(E in h)if(h.hasOwnProperty(E))break;var R="instructionNameFn"in y?y.instructionNameFn(E,h[E],r,n):E;if(typeof h[E]=="object")return n=h,r=R,"<?"+R+s(h[E][y.attributesKey],y,S)+"?>";var I=h[E]?h[E]:"";return"instructionFn"in y&&(I=y.instructionFn(I,E,r,n)),"<?"+R+(I?" "+I:"")+"?>"}function u(h,y){return y.ignoreComment?"":"<!--"+("commentFn"in y?y.commentFn(h,r,n):h)+"-->"}function l(h,y){return y.ignoreCdata?"":"<![CDATA["+("cdataFn"in y?y.cdataFn(h,r,n):h.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function f(h,y){return y.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in y?y.doctypeFn(h,r,n):h)+">"}function d(h,y){return y.ignoreText?"":(h=""+h,h=h.replace(/&amp;/g,"&"),h=h.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"textFn"in y?y.textFn(h,r,n):h)}function m(h,y){var S;if(h.elements&&h.elements.length)for(S=0;S<h.elements.length;++S)switch(h.elements[S][y.typeKey]){case"text":if(y.indentText)return!0;break;case"cdata":if(y.indentCdata)return!0;break;case"instruction":if(y.indentInstruction)return!0;break;case"doctype":case"comment":case"element":return!0;default:return!0}return!1}function w(h,y,S){n=h,r=h.name;var E=[],R="elementNameFn"in y?y.elementNameFn(h.name,h):h.name;E.push("<"+R),h[y.attributesKey]&&E.push(s(h[y.attributesKey],y,S));var I=h[y.elementsKey]&&h[y.elementsKey].length||h[y.attributesKey]&&h[y.attributesKey]["xml:space"]==="preserve";return I||("fullTagEmptyElementFn"in y?I=y.fullTagEmptyElementFn(h.name,h):I=y.fullTagEmptyElement),I?(E.push(">"),h[y.elementsKey]&&h[y.elementsKey].length&&(E.push(v(h[y.elementsKey],y,S+1)),n=h,r=h.name),E.push(y.spaces&&m(h,y)?`
35
- `+Array(S+1).join(y.spaces):""),E.push("</"+R+">")):E.push("/>"),E.join("")}function v(h,y,S,E){return h.reduce(function(R,I){var A=i(y,S,E&&!R);switch(I.type){case"element":return R+A+w(I,y,S);case"comment":return R+A+u(I[y.commentKey],y);case"doctype":return R+A+f(I[y.doctypeKey],y);case"cdata":return R+(y.indentCdata?A:"")+l(I[y.cdataKey],y);case"text":return R+(y.indentText?A:"")+d(I[y.textKey],y);case"instruction":var $={};return $[I[y.nameKey]]=I[y.attributesKey]?I:I[y.instructionKey],R+(y.indentInstruction?A:"")+c($,y,S)}},"")}function T(h,y,S){var E;for(E in h)if(h.hasOwnProperty(E))switch(E){case y.parentKey:case y.attributesKey:break;case y.textKey:if(y.indentText||S)return!0;break;case y.cdataKey:if(y.indentCdata||S)return!0;break;case y.instructionKey:if(y.indentInstruction||S)return!0;break;case y.doctypeKey:case y.commentKey:return!0;default:return!0}return!1}function b(h,y,S,E,R){n=h,r=y;var I="elementNameFn"in S?S.elementNameFn(y,h):y;if(typeof h>"u"||h===null||h==="")return"fullTagEmptyElementFn"in S&&S.fullTagEmptyElementFn(y,h)||S.fullTagEmptyElement?"<"+I+"></"+I+">":"<"+I+"/>";var A=[];if(y){if(A.push("<"+I),typeof h!="object")return A.push(">"+d(h,S)+"</"+I+">"),A.join("");h[S.attributesKey]&&A.push(s(h[S.attributesKey],S,E));var $=T(h,S,!0)||h[S.attributesKey]&&h[S.attributesKey]["xml:space"]==="preserve";if($||("fullTagEmptyElementFn"in S?$=S.fullTagEmptyElementFn(y,h):$=S.fullTagEmptyElement),$)A.push(">");else return A.push("/>"),A.join("")}return A.push(g(h,S,E+1,!1)),n=h,r=y,y&&A.push((R?i(S,E,!1):"")+"</"+I+">"),A.join("")}function g(h,y,S,E){var R,I,A,$=[];for(I in h)if(h.hasOwnProperty(I))for(A=t(h[I])?h[I]:[h[I]],R=0;R<A.length;++R){switch(I){case y.declarationKey:$.push(a(A[R],y,S));break;case y.instructionKey:$.push((y.indentInstruction?i(y,S,E):"")+c(A[R],y,S));break;case y.attributesKey:case y.parentKey:break;case y.textKey:$.push((y.indentText?i(y,S,E):"")+d(A[R],y));break;case y.cdataKey:$.push((y.indentCdata?i(y,S,E):"")+l(A[R],y));break;case y.doctypeKey:$.push(i(y,S,E)+f(A[R],y));break;case y.commentKey:$.push(i(y,S,E)+u(A[R],y));break;default:$.push(i(y,S,E)+b(A[R],I,y,S,T(A[R],y)))}E=E&&!$.length}return $.join("")}return Ru=function(h,y){y=o(y);var S=[];return n=h,r="_root_",y.compact?S.push(g(h,y,0,!0)):(h[y.declarationKey]&&S.push(a(h[y.declarationKey],y,0)),h[y.elementsKey]&&h[y.elementsKey].length&&S.push(v(h[y.elementsKey],y,0,!S.length))),S.join("")},Ru}var _u,Mm;function mR(){if(Mm)return _u;Mm=1;var e=Lm();return _u=function(t,n){t instanceof yr&&(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)},_u}var Iu,Bm;function yR(){if(Bm)return Iu;Bm=1;var e=Nm(),t=gR(),n=Lm(),r=mR();return Iu={xml2js:e,xml2json:t,js2xml:n,json2xml:r},Iu}yR();/*! For license information please see index.js.LICENSE.txt */var bR={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,f,d=s.indexOf(o),m=s.indexOf(i,d+1),w=d;if(d>=0&&m>0){for(a=[],u=s.length;w>=0&&!f;)w==d?(a.push(w),d=s.indexOf(o,w+1)):a.length==1?f=[a.pop(),m]:((c=a.pop())<u&&(u=c,l=m),m=s.indexOf(i,w+1)),w=d<m&&d>=0?d:m;a.length&&(f=[u,l])}return f}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 Pr=="object"&&Pr);i.global!==i&&i.window;var s=function(f){this.message=f};(s.prototype=new Error).name="InvalidCharacterError";var a=function(f){throw new s(f)},c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,l={encode:function(f){f=String(f),/[^\0-\xFF]/.test(f)&&a("The string to be encoded contains characters outside of the Latin1 range.");for(var d,m,w,v,T=f.length%3,b="",g=-1,h=f.length-T;++g<h;)d=f.charCodeAt(g)<<16,m=f.charCodeAt(++g)<<8,w=f.charCodeAt(++g),b+=c.charAt((v=d+m+w)>>18&63)+c.charAt(v>>12&63)+c.charAt(v>>6&63)+c.charAt(63&v);return T==2?(d=f.charCodeAt(g)<<8,m=f.charCodeAt(++g),b+=c.charAt((v=d+m)>>10)+c.charAt(v>>4&63)+c.charAt(v<<2&63)+"="):T==1&&(v=f.charCodeAt(g),b+=c.charAt(v>>2)+c.charAt(v<<4&63)+"=="),b},decode:function(f){var d=(f=String(f).replace(u,"")).length;d%4==0&&(d=(f=f.replace(/==?$/,"")).length),(d%4==1||/[^+a-zA-Z0-9/]/.test(f))&&a("Invalid character: the string to be decoded is not correctly encoded.");for(var m,w,v=0,T="",b=-1;++b<d;)w=c.indexOf(f.charAt(b)),m=v%4?64*m+w:w,v++%4&&(T+=String.fromCharCode(255&m>>(-2*v&6)));return T},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 f=0;f<l;f++)u.push(c[f]);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===`
29
+ Char: `+_.c),P=new Error(P),_.error=P,D(_,"onerror",P),_}function X(_){return _.sawRoot&&!_.closedRoot&&se(_,"Unclosed root tag"),_.state!==A.BEGIN&&_.state!==A.BEGIN_WHITESPACE&&_.state!==A.TEXT&&G(_,"Unexpected end"),N(_),_.c="",_.closed=!0,D(_,"onend"),r.call(_,_.strict,_.opt),_}function se(_,P){if(typeof _!="object"||!(_ instanceof r))throw new Error("bad call to strictFail");_.strict&&G(_,P)}function ne(_){_.strict||(_.tagName=_.tagName[_.looseCase]());var P=_.tags[_.tags.length-1]||_,K=_.tag={name:_.tagName,attributes:{}};_.opt.xmlns&&(K.ns=P.ns),_.attribList.length=0,k(_,"onopentagstart",K)}function oe(_,P){var K=_.indexOf(":"),V=K<0?["",_]:_.split(":"),B=V[0],q=V[1];return P&&_==="xmlns"&&(B="xmlns",q=""),{prefix:B,local:q}}function fe(_){if(_.strict||(_.attribName=_.attribName[_.looseCase]()),_.attribList.indexOf(_.attribName)!==-1||_.tag.attributes.hasOwnProperty(_.attribName)){_.attribName=_.attribValue="";return}if(_.opt.xmlns){var P=oe(_.attribName,!0),K=P.prefix,V=P.local;if(K==="xmlns")if(V==="xml"&&_.attribValue!==m)se(_,"xml: prefix must be bound to "+m+`
30
+ Actual: `+_.attribValue);else if(V==="xmlns"&&_.attribValue!==w)se(_,"xmlns: prefix must be bound to "+w+`
31
+ Actual: `+_.attribValue);else{var B=_.tag,q=_.tags[_.tags.length-1]||_;B.ns===q.ns&&(B.ns=Object.create(q.ns)),B.ns[V]=_.attribValue}_.attribList.push([_.attribName,_.attribValue])}else _.tag.attributes[_.attribName]=_.attribValue,k(_,"onattribute",{name:_.attribName,value:_.attribValue});_.attribName=_.attribValue=""}function we(_,P){if(_.opt.xmlns){var K=_.tag,V=oe(_.tagName);K.prefix=V.prefix,K.local=V.local,K.uri=K.ns[V.prefix]||"",K.prefix&&!K.uri&&(se(_,"Unbound namespace prefix: "+JSON.stringify(_.tagName)),K.uri=V.prefix);var B=_.tags[_.tags.length-1]||_;K.ns&&B.ns!==K.ns&&Object.keys(K.ns).forEach(function(De){k(_,"onopennamespace",{prefix:De,uri:K.ns[De]})});for(var q=0,ue=_.attribList.length;q<ue;q++){var Re=_.attribList[q],Le=Re[0],ke=Re[1],Fe=oe(Le,!0),Be=Fe.prefix,ge=Fe.local,le=Be===""?"":K.ns[Be]||"",$e={name:Le,value:ke,prefix:Be,local:ge,uri:le};Be&&Be!=="xmlns"&&!le&&(se(_,"Unbound namespace prefix: "+JSON.stringify(Be)),$e.uri=Be),_.tag.attributes[Le]=$e,k(_,"onattribute",$e)}_.attribList.length=0}_.tag.isSelfClosing=!!P,_.sawRoot=!0,_.tags.push(_.tag),k(_,"onopentag",_.tag),P||(!_.noscript&&_.tagName.toLowerCase()==="script"?_.state=A.SCRIPT:_.state=A.TEXT,_.tag=null,_.tagName=""),_.attribName=_.attribValue="",_.attribList.length=0}function Z(_){if(!_.tagName){se(_,"Weird empty close tag."),_.textNode+="</>",_.state=A.TEXT;return}if(_.script){if(_.tagName!=="script"){_.script+="</"+_.tagName+">",_.tagName="",_.state=A.SCRIPT;return}k(_,"onscript",_.script),_.script=""}var P=_.tags.length,K=_.tagName;_.strict||(K=K[_.looseCase]());for(var V=K;P--;){var B=_.tags[P];if(B.name!==V)se(_,"Unexpected close tag");else break}if(P<0){se(_,"Unmatched closing tag: "+_.tagName),_.textNode+="</"+_.tagName+">",_.state=A.TEXT;return}_.tagName=K;for(var q=_.tags.length;q-- >P;){var ue=_.tag=_.tags.pop();_.tagName=_.tag.name,k(_,"onclosetag",_.tagName);var Re={};for(var Le in ue.ns)Re[Le]=ue.ns[Le];var ke=_.tags[_.tags.length-1]||_;_.opt.xmlns&&ue.ns!==ke.ns&&Object.keys(ue.ns).forEach(function(Fe){var Be=ue.ns[Fe];k(_,"onclosenamespace",{prefix:Fe,uri:Be})})}P===0&&(_.closedRoot=!0),_.tagName=_.attribValue=_.attribName="",_.attribList.length=0,_.state=A.TEXT}function re(_){var P=_.entity,K=P.toLowerCase(),V,B="";return _.ENTITIES[P]?_.ENTITIES[P]:_.ENTITIES[K]?_.ENTITIES[K]:(P=K,P.charAt(0)==="#"&&(P.charAt(1)==="x"?(P=P.slice(2),V=parseInt(P,16),B=V.toString(16)):(P=P.slice(1),V=parseInt(P,10),B=V.toString(10))),P=P.replace(/^0+/,""),isNaN(V)||B.toLowerCase()!==P?(se(_,"Invalid character entity"),"&"+_.entity+";"):String.fromCodePoint(V))}function ce(_,P){P==="<"?(_.state=A.OPEN_WAKA,_.startTagPosition=_.position):y(P)||(se(_,"Non-whitespace before first tag."),_.textNode=P,_.state=A.TEXT)}function Ie(_,P){var K="";return P<_.length&&(K=_.charAt(P)),K}function Y(_){var P=this;if(this.error)throw this.error;if(P.closed)return G(P,"Cannot write after close. Assign an onready handler.");if(_===null)return X(P);typeof _=="object"&&(_=_.toString());for(var K=0,V="";V=Ie(_,K++),P.c=V,!!V;)switch(P.trackPosition&&(P.position++,V===`
32
+ `?(P.line++,P.column=0):P.column++),P.state){case A.BEGIN:if(P.state=A.BEGIN_WHITESPACE,V==="\uFEFF")continue;ce(P,V);continue;case A.BEGIN_WHITESPACE:ce(P,V);continue;case A.TEXT:if(P.sawRoot&&!P.closedRoot){for(var B=K-1;V&&V!=="<"&&V!=="&";)V=Ie(_,K++),V&&P.trackPosition&&(P.position++,V===`
33
+ `?(P.line++,P.column=0):P.column++);P.textNode+=_.substring(B,K-1)}V==="<"&&!(P.sawRoot&&P.closedRoot&&!P.strict)?(P.state=A.OPEN_WAKA,P.startTagPosition=P.position):(!y(V)&&(!P.sawRoot||P.closedRoot)&&se(P,"Text data outside of root node."),V==="&"?P.state=A.TEXT_ENTITY:P.textNode+=V);continue;case A.SCRIPT:V==="<"?P.state=A.SCRIPT_ENDING:P.script+=V;continue;case A.SCRIPT_ENDING:V==="/"?P.state=A.CLOSE_TAG:(P.script+="<"+V,P.state=A.SCRIPT);continue;case A.OPEN_WAKA:if(V==="!")P.state=A.SGML_DECL,P.sgmlDecl="";else if(!y(V))if(R(T,V))P.state=A.OPEN_TAG,P.tagName=V;else if(V==="/")P.state=A.CLOSE_TAG,P.tagName="";else if(V==="?")P.state=A.PROC_INST,P.procInstName=P.procInstBody="";else{if(se(P,"Unencoded <"),P.startTagPosition+1<P.position){var q=P.position-P.startTagPosition;V=new Array(q).join(" ")+V}P.textNode+="<"+V,P.state=A.TEXT}continue;case A.SGML_DECL:if(P.sgmlDecl+V==="--"){P.state=A.COMMENT,P.comment="",P.sgmlDecl="";continue}P.doctype&&P.doctype!==!0&&P.sgmlDecl?(P.state=A.DOCTYPE_DTD,P.doctype+="<!"+P.sgmlDecl+V,P.sgmlDecl=""):(P.sgmlDecl+V).toUpperCase()===f?(k(P,"onopencdata"),P.state=A.CDATA,P.sgmlDecl="",P.cdata=""):(P.sgmlDecl+V).toUpperCase()===d?(P.state=A.DOCTYPE,(P.doctype||P.sawRoot)&&se(P,"Inappropriately located doctype declaration"),P.doctype="",P.sgmlDecl=""):V===">"?(k(P,"onsgmldeclaration",P.sgmlDecl),P.sgmlDecl="",P.state=A.TEXT):(S(V)&&(P.state=A.SGML_DECL_QUOTED),P.sgmlDecl+=V);continue;case A.SGML_DECL_QUOTED:V===P.q&&(P.state=A.SGML_DECL,P.q=""),P.sgmlDecl+=V;continue;case A.DOCTYPE:V===">"?(P.state=A.TEXT,k(P,"ondoctype",P.doctype),P.doctype=!0):(P.doctype+=V,V==="["?P.state=A.DOCTYPE_DTD:S(V)&&(P.state=A.DOCTYPE_QUOTED,P.q=V));continue;case A.DOCTYPE_QUOTED:P.doctype+=V,V===P.q&&(P.q="",P.state=A.DOCTYPE);continue;case A.DOCTYPE_DTD:V==="]"?(P.doctype+=V,P.state=A.DOCTYPE):V==="<"?(P.state=A.OPEN_WAKA,P.startTagPosition=P.position):S(V)?(P.doctype+=V,P.state=A.DOCTYPE_DTD_QUOTED,P.q=V):P.doctype+=V;continue;case A.DOCTYPE_DTD_QUOTED:P.doctype+=V,V===P.q&&(P.state=A.DOCTYPE_DTD,P.q="");continue;case A.COMMENT:V==="-"?P.state=A.COMMENT_ENDING:P.comment+=V;continue;case A.COMMENT_ENDING:V==="-"?(P.state=A.COMMENT_ENDED,P.comment=z(P.opt,P.comment),P.comment&&k(P,"oncomment",P.comment),P.comment=""):(P.comment+="-"+V,P.state=A.COMMENT);continue;case A.COMMENT_ENDED:V!==">"?(se(P,"Malformed comment"),P.comment+="--"+V,P.state=A.COMMENT):P.doctype&&P.doctype!==!0?P.state=A.DOCTYPE_DTD:P.state=A.TEXT;continue;case A.CDATA:V==="]"?P.state=A.CDATA_ENDING:P.cdata+=V;continue;case A.CDATA_ENDING:V==="]"?P.state=A.CDATA_ENDING_2:(P.cdata+="]"+V,P.state=A.CDATA);continue;case A.CDATA_ENDING_2:V===">"?(P.cdata&&k(P,"oncdata",P.cdata),k(P,"onclosecdata"),P.cdata="",P.state=A.TEXT):V==="]"?P.cdata+="]":(P.cdata+="]]"+V,P.state=A.CDATA);continue;case A.PROC_INST:V==="?"?P.state=A.PROC_INST_ENDING:y(V)?P.state=A.PROC_INST_BODY:P.procInstName+=V;continue;case A.PROC_INST_BODY:if(!P.procInstBody&&y(V))continue;V==="?"?P.state=A.PROC_INST_ENDING:P.procInstBody+=V;continue;case A.PROC_INST_ENDING:V===">"?(k(P,"onprocessinginstruction",{name:P.procInstName,body:P.procInstBody}),P.procInstName=P.procInstBody="",P.state=A.TEXT):(P.procInstBody+="?"+V,P.state=A.PROC_INST_BODY);continue;case A.OPEN_TAG:R(v,V)?P.tagName+=V:(ne(P),V===">"?we(P):V==="/"?P.state=A.OPEN_TAG_SLASH:(y(V)||se(P,"Invalid character in tag name"),P.state=A.ATTRIB));continue;case A.OPEN_TAG_SLASH:V===">"?(we(P,!0),Z(P)):(se(P,"Forward-slash in opening tag not followed by >"),P.state=A.ATTRIB);continue;case A.ATTRIB:if(y(V))continue;V===">"?we(P):V==="/"?P.state=A.OPEN_TAG_SLASH:R(T,V)?(P.attribName=V,P.attribValue="",P.state=A.ATTRIB_NAME):se(P,"Invalid attribute name");continue;case A.ATTRIB_NAME:V==="="?P.state=A.ATTRIB_VALUE:V===">"?(se(P,"Attribute without value"),P.attribValue=P.attribName,fe(P),we(P)):y(V)?P.state=A.ATTRIB_NAME_SAW_WHITE:R(v,V)?P.attribName+=V:se(P,"Invalid attribute name");continue;case A.ATTRIB_NAME_SAW_WHITE:if(V==="=")P.state=A.ATTRIB_VALUE;else{if(y(V))continue;se(P,"Attribute without value"),P.tag.attributes[P.attribName]="",P.attribValue="",k(P,"onattribute",{name:P.attribName,value:""}),P.attribName="",V===">"?we(P):R(T,V)?(P.attribName=V,P.state=A.ATTRIB_NAME):(se(P,"Invalid attribute name"),P.state=A.ATTRIB)}continue;case A.ATTRIB_VALUE:if(y(V))continue;S(V)?(P.q=V,P.state=A.ATTRIB_VALUE_QUOTED):(P.opt.unquotedAttributeValues||G(P,"Unquoted attribute value"),P.state=A.ATTRIB_VALUE_UNQUOTED,P.attribValue=V);continue;case A.ATTRIB_VALUE_QUOTED:if(V!==P.q){V==="&"?P.state=A.ATTRIB_VALUE_ENTITY_Q:P.attribValue+=V;continue}fe(P),P.q="",P.state=A.ATTRIB_VALUE_CLOSED;continue;case A.ATTRIB_VALUE_CLOSED:y(V)?P.state=A.ATTRIB:V===">"?we(P):V==="/"?P.state=A.OPEN_TAG_SLASH:R(T,V)?(se(P,"No whitespace between attributes"),P.attribName=V,P.attribValue="",P.state=A.ATTRIB_NAME):se(P,"Invalid attribute name");continue;case A.ATTRIB_VALUE_UNQUOTED:if(!E(V)){V==="&"?P.state=A.ATTRIB_VALUE_ENTITY_U:P.attribValue+=V;continue}fe(P),V===">"?we(P):P.state=A.ATTRIB;continue;case A.CLOSE_TAG:if(P.tagName)V===">"?Z(P):R(v,V)?P.tagName+=V:P.script?(P.script+="</"+P.tagName,P.tagName="",P.state=A.SCRIPT):(y(V)||se(P,"Invalid tagname in closing tag"),P.state=A.CLOSE_TAG_SAW_WHITE);else{if(y(V))continue;I(T,V)?P.script?(P.script+="</"+V,P.state=A.SCRIPT):se(P,"Invalid tagname in closing tag."):P.tagName=V}continue;case A.CLOSE_TAG_SAW_WHITE:if(y(V))continue;V===">"?Z(P):se(P,"Invalid characters in closing tag");continue;case A.TEXT_ENTITY:case A.ATTRIB_VALUE_ENTITY_Q:case A.ATTRIB_VALUE_ENTITY_U:var ue,Re;switch(P.state){case A.TEXT_ENTITY:ue=A.TEXT,Re="textNode";break;case A.ATTRIB_VALUE_ENTITY_Q:ue=A.ATTRIB_VALUE_QUOTED,Re="attribValue";break;case A.ATTRIB_VALUE_ENTITY_U:ue=A.ATTRIB_VALUE_UNQUOTED,Re="attribValue";break}if(V===";"){var Le=re(P);P.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(Le)?(P.entity="",P.state=ue,P.write(Le)):(P[Re]+=Le,P.entity="",P.state=ue)}else R(P.entity.length?h:g,V)?P.entity+=V:(se(P,"Invalid character in entity name"),P[Re]+="&"+P.entity+V,P.entity="",P.state=ue);continue;default:throw new Error(P,"Unknown state: "+P.state)}return P.position>=P.bufferCheckPosition&&o(P),P}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||function(){var _=String.fromCharCode,P=Math.floor,K=function(){var V=16384,B=[],q,ue,Re=-1,Le=arguments.length;if(!Le)return"";for(var ke="";++Re<Le;){var Fe=Number(arguments[Re]);if(!isFinite(Fe)||Fe<0||Fe>1114111||P(Fe)!==Fe)throw RangeError("Invalid code point: "+Fe);Fe<=65535?B.push(Fe):(Fe-=65536,q=(Fe>>10)+55296,ue=Fe%1024+56320,B.push(q,ue)),(Re+1===Le||B.length>V)&&(ke+=_.apply(null,B),B.length=0)}return ke};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:K,configurable:!0,writable:!0}):String.fromCodePoint=K}()})(e)}(Kl)),Kl}var vu,xm;function wu(){return xm||(xm=1,vu={isArray:function(e){return Array.isArray?Array.isArray(e):Object.prototype.toString.call(e)==="[object Array]"}}),vu}var Su,km;function Eu(){if(km)return Su;km=1;var e=wu().isArray;return Su={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}},Su}var Tu,Nm;function $m(){if(Nm)return Tu;Nm=1;var e=gR(),t=Eu(),n=wu().isArray,r,o;function i(v){return r=t.copyOptions(v),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(v){var g=Number(v);if(!isNaN(g))return g;var h=v.toLowerCase();return h==="true"?!0:h==="false"?!1:v}function a(v,g){var h;if(r.compact){if(!o[r[v+"Key"]]&&(n(r.alwaysArray)?r.alwaysArray.indexOf(r[v+"Key"])!==-1:r.alwaysArray)&&(o[r[v+"Key"]]=[]),o[r[v+"Key"]]&&!n(o[r[v+"Key"]])&&(o[r[v+"Key"]]=[o[r[v+"Key"]]]),v+"Fn"in r&&typeof g=="string"&&(g=r[v+"Fn"](g,o)),v==="instruction"&&("instructionFn"in r||"instructionNameFn"in r)){for(h in g)if(g.hasOwnProperty(h))if("instructionFn"in r)g[h]=r.instructionFn(g[h],h,o);else{var y=g[h];delete g[h],g[r.instructionNameFn(h,y,o)]=y}}n(o[r[v+"Key"]])?o[r[v+"Key"]].push(g):o[r[v+"Key"]]=g}else{o[r.elementsKey]||(o[r.elementsKey]=[]);var S={};if(S[r.typeKey]=v,v==="instruction"){for(h in g)if(g.hasOwnProperty(h))break;S[r.nameKey]="instructionNameFn"in r?r.instructionNameFn(h,g,o):h,r.instructionHasAttributes?(S[r.attributesKey]=g[h][r.attributesKey],"instructionFn"in r&&(S[r.attributesKey]=r.instructionFn(S[r.attributesKey],h,o))):("instructionFn"in r&&(g[h]=r.instructionFn(g[h],h,o)),S[r.instructionKey]=g[h])}else v+"Fn"in r&&(g=r[v+"Fn"](g,o)),S[r[v+"Key"]]=g;r.addParent&&(S[r.parentKey]=o),o[r.elementsKey].push(S)}}function c(v){if("attributesFn"in r&&v&&(v=r.attributesFn(v,o)),(r.trim||"attributeValueFn"in r||"attributeNameFn"in r||r.nativeTypeAttributes)&&v){var g;for(g in v)if(v.hasOwnProperty(g)&&(r.trim&&(v[g]=v[g].trim()),r.nativeTypeAttributes&&(v[g]=s(v[g])),"attributeValueFn"in r&&(v[g]=r.attributeValueFn(v[g],g,o)),"attributeNameFn"in r)){var h=v[g];delete v[g],v[r.attributeNameFn(g,v[g],o)]=h}}return v}function u(v){var g={};if(v.body&&(v.name.toLowerCase()==="xml"||r.instructionHasAttributes)){for(var h=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,y;(y=h.exec(v.body))!==null;)g[y[1]]=y[2]||y[3]||y[4];g=c(g)}if(v.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&&(v.body=v.body.trim());var S={};r.instructionHasAttributes&&Object.keys(g).length?(S[v.name]={},S[v.name][r.attributesKey]=g):S[v.name]=v.body,a("instruction",S)}}function l(v,g){var h;if(typeof v=="object"&&(g=v.attributes,v=v.name),g=c(g),"elementNameFn"in r&&(v=r.elementNameFn(v,o)),r.compact){if(h={},!r.ignoreAttributes&&g&&Object.keys(g).length){h[r.attributesKey]={};var y;for(y in g)g.hasOwnProperty(y)&&(h[r.attributesKey][y]=g[y])}!(v in o)&&(n(r.alwaysArray)?r.alwaysArray.indexOf(v)!==-1:r.alwaysArray)&&(o[v]=[]),o[v]&&!n(o[v])&&(o[v]=[o[v]]),n(o[v])?o[v].push(h):o[v]=h}else o[r.elementsKey]||(o[r.elementsKey]=[]),h={},h[r.typeKey]="element",h[r.nameKey]=v,!r.ignoreAttributes&&g&&Object.keys(g).length&&(h[r.attributesKey]=g),r.alwaysChildren&&(h[r.elementsKey]=[]),o[r.elementsKey].push(h);h[r.parentKey]=o,o=h}function f(v){r.ignoreText||!v.trim()&&!r.captureSpacesBetweenElements||(r.trim&&(v=v.trim()),r.nativeType&&(v=s(v)),r.sanitize&&(v=v.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")),a("text",v))}function d(v){r.ignoreComment||(r.trim&&(v=v.trim()),a("comment",v))}function m(v){var g=o[r.parentKey];r.addParent||delete o[r.parentKey],o=g}function w(v){r.ignoreCdata||(r.trim&&(v=v.trim()),a("cdata",v))}function b(v){r.ignoreDoctype||(v=v.replace(/^ /,""),r.trim&&(v=v.trim()),a("doctype",v))}function T(v){v.note=v}return Tu=function(v,g){var h=e.parser(!0,{}),y={};if(o=y,r=i(g),h.opt={strictEntities:!0},h.onopentag=l,h.ontext=f,h.oncomment=d,h.onclosetag=m,h.onerror=T,h.oncdata=w,h.ondoctype=b,h.onprocessinginstruction=u,h.write(v).close(),y[r.elementsKey]){var S=y[r.elementsKey];delete y[r.elementsKey],y[r.elementsKey]=S,delete y.text}return y},Tu}var Au,Dm;function mR(){if(Dm)return Au;Dm=1;var e=Eu(),t=$m();function n(r){var o=e.copyOptions(r);return e.ensureSpacesExists(o),o}return Au=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")},Au}var Ru,Lm;function Mm(){if(Lm)return Ru;Lm=1;var e=Eu(),t=wu().isArray,n,r;function o(h){var y=e.copyOptions(h);return e.ensureFlagExists("ignoreDeclaration",y),e.ensureFlagExists("ignoreInstruction",y),e.ensureFlagExists("ignoreAttributes",y),e.ensureFlagExists("ignoreText",y),e.ensureFlagExists("ignoreComment",y),e.ensureFlagExists("ignoreCdata",y),e.ensureFlagExists("ignoreDoctype",y),e.ensureFlagExists("compact",y),e.ensureFlagExists("indentText",y),e.ensureFlagExists("indentCdata",y),e.ensureFlagExists("indentAttributes",y),e.ensureFlagExists("indentInstruction",y),e.ensureFlagExists("fullTagEmptyElement",y),e.ensureFlagExists("noQuotesForNativeAttributes",y),e.ensureSpacesExists(y),typeof y.spaces=="number"&&(y.spaces=Array(y.spaces+1).join(" ")),e.ensureKeyExists("declaration",y),e.ensureKeyExists("instruction",y),e.ensureKeyExists("attributes",y),e.ensureKeyExists("text",y),e.ensureKeyExists("comment",y),e.ensureKeyExists("cdata",y),e.ensureKeyExists("doctype",y),e.ensureKeyExists("type",y),e.ensureKeyExists("name",y),e.ensureKeyExists("elements",y),e.checkFnExists("doctype",y),e.checkFnExists("instruction",y),e.checkFnExists("cdata",y),e.checkFnExists("comment",y),e.checkFnExists("text",y),e.checkFnExists("instructionName",y),e.checkFnExists("elementName",y),e.checkFnExists("attributeName",y),e.checkFnExists("attributeValue",y),e.checkFnExists("attributes",y),e.checkFnExists("fullTagEmptyElement",y),y}function i(h,y,S){return(!S&&h.spaces?`
34
+ `:"")+Array(y+1).join(h.spaces)}function s(h,y,S){if(y.ignoreAttributes)return"";"attributesFn"in y&&(h=y.attributesFn(h,r,n));var E,R,I,A,$=[];for(E in h)h.hasOwnProperty(E)&&h[E]!==null&&h[E]!==void 0&&(A=y.noQuotesForNativeAttributes&&typeof h[E]!="string"?"":'"',R=""+h[E],R=R.replace(/"/g,"&quot;"),I="attributeNameFn"in y?y.attributeNameFn(E,R,r,n):E,$.push(y.spaces&&y.indentAttributes?i(y,S+1,!1):" "),$.push(I+"="+A+("attributeValueFn"in y?y.attributeValueFn(R,E,r,n):R)+A));return h&&Object.keys(h).length&&y.spaces&&y.indentAttributes&&$.push(i(y,S,!1)),$.join("")}function a(h,y,S){return n=h,r="xml",y.ignoreDeclaration?"":"<?xml"+s(h[y.attributesKey],y,S)+"?>"}function c(h,y,S){if(y.ignoreInstruction)return"";var E;for(E in h)if(h.hasOwnProperty(E))break;var R="instructionNameFn"in y?y.instructionNameFn(E,h[E],r,n):E;if(typeof h[E]=="object")return n=h,r=R,"<?"+R+s(h[E][y.attributesKey],y,S)+"?>";var I=h[E]?h[E]:"";return"instructionFn"in y&&(I=y.instructionFn(I,E,r,n)),"<?"+R+(I?" "+I:"")+"?>"}function u(h,y){return y.ignoreComment?"":"<!--"+("commentFn"in y?y.commentFn(h,r,n):h)+"-->"}function l(h,y){return y.ignoreCdata?"":"<![CDATA["+("cdataFn"in y?y.cdataFn(h,r,n):h.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function f(h,y){return y.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in y?y.doctypeFn(h,r,n):h)+">"}function d(h,y){return y.ignoreText?"":(h=""+h,h=h.replace(/&amp;/g,"&"),h=h.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"textFn"in y?y.textFn(h,r,n):h)}function m(h,y){var S;if(h.elements&&h.elements.length)for(S=0;S<h.elements.length;++S)switch(h.elements[S][y.typeKey]){case"text":if(y.indentText)return!0;break;case"cdata":if(y.indentCdata)return!0;break;case"instruction":if(y.indentInstruction)return!0;break;case"doctype":case"comment":case"element":return!0;default:return!0}return!1}function w(h,y,S){n=h,r=h.name;var E=[],R="elementNameFn"in y?y.elementNameFn(h.name,h):h.name;E.push("<"+R),h[y.attributesKey]&&E.push(s(h[y.attributesKey],y,S));var I=h[y.elementsKey]&&h[y.elementsKey].length||h[y.attributesKey]&&h[y.attributesKey]["xml:space"]==="preserve";return I||("fullTagEmptyElementFn"in y?I=y.fullTagEmptyElementFn(h.name,h):I=y.fullTagEmptyElement),I?(E.push(">"),h[y.elementsKey]&&h[y.elementsKey].length&&(E.push(b(h[y.elementsKey],y,S+1)),n=h,r=h.name),E.push(y.spaces&&m(h,y)?`
35
+ `+Array(S+1).join(y.spaces):""),E.push("</"+R+">")):E.push("/>"),E.join("")}function b(h,y,S,E){return h.reduce(function(R,I){var A=i(y,S,E&&!R);switch(I.type){case"element":return R+A+w(I,y,S);case"comment":return R+A+u(I[y.commentKey],y);case"doctype":return R+A+f(I[y.doctypeKey],y);case"cdata":return R+(y.indentCdata?A:"")+l(I[y.cdataKey],y);case"text":return R+(y.indentText?A:"")+d(I[y.textKey],y);case"instruction":var $={};return $[I[y.nameKey]]=I[y.attributesKey]?I:I[y.instructionKey],R+(y.indentInstruction?A:"")+c($,y,S)}},"")}function T(h,y,S){var E;for(E in h)if(h.hasOwnProperty(E))switch(E){case y.parentKey:case y.attributesKey:break;case y.textKey:if(y.indentText||S)return!0;break;case y.cdataKey:if(y.indentCdata||S)return!0;break;case y.instructionKey:if(y.indentInstruction||S)return!0;break;case y.doctypeKey:case y.commentKey:return!0;default:return!0}return!1}function v(h,y,S,E,R){n=h,r=y;var I="elementNameFn"in S?S.elementNameFn(y,h):y;if(typeof h>"u"||h===null||h==="")return"fullTagEmptyElementFn"in S&&S.fullTagEmptyElementFn(y,h)||S.fullTagEmptyElement?"<"+I+"></"+I+">":"<"+I+"/>";var A=[];if(y){if(A.push("<"+I),typeof h!="object")return A.push(">"+d(h,S)+"</"+I+">"),A.join("");h[S.attributesKey]&&A.push(s(h[S.attributesKey],S,E));var $=T(h,S,!0)||h[S.attributesKey]&&h[S.attributesKey]["xml:space"]==="preserve";if($||("fullTagEmptyElementFn"in S?$=S.fullTagEmptyElementFn(y,h):$=S.fullTagEmptyElement),$)A.push(">");else return A.push("/>"),A.join("")}return A.push(g(h,S,E+1,!1)),n=h,r=y,y&&A.push((R?i(S,E,!1):"")+"</"+I+">"),A.join("")}function g(h,y,S,E){var R,I,A,$=[];for(I in h)if(h.hasOwnProperty(I))for(A=t(h[I])?h[I]:[h[I]],R=0;R<A.length;++R){switch(I){case y.declarationKey:$.push(a(A[R],y,S));break;case y.instructionKey:$.push((y.indentInstruction?i(y,S,E):"")+c(A[R],y,S));break;case y.attributesKey:case y.parentKey:break;case y.textKey:$.push((y.indentText?i(y,S,E):"")+d(A[R],y));break;case y.cdataKey:$.push((y.indentCdata?i(y,S,E):"")+l(A[R],y));break;case y.doctypeKey:$.push(i(y,S,E)+f(A[R],y));break;case y.commentKey:$.push(i(y,S,E)+u(A[R],y));break;default:$.push(i(y,S,E)+v(A[R],I,y,S,T(A[R],y)))}E=E&&!$.length}return $.join("")}return Ru=function(h,y){y=o(y);var S=[];return n=h,r="_root_",y.compact?S.push(g(h,y,0,!0)):(h[y.declarationKey]&&S.push(a(h[y.declarationKey],y,0)),h[y.elementsKey]&&h[y.elementsKey].length&&S.push(b(h[y.elementsKey],y,0,!S.length))),S.join("")},Ru}var _u,Bm;function yR(){if(Bm)return _u;Bm=1;var e=Mm();return _u=function(t,n){t instanceof yr&&(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)},_u}var Iu,jm;function bR(){if(jm)return Iu;jm=1;var e=$m(),t=mR(),n=Mm(),r=yR();return Iu={xml2js:e,xml2json:t,js2xml:n,json2xml:r},Iu}bR();/*! For license information please see index.js.LICENSE.txt */var vR={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,f,d=s.indexOf(o),m=s.indexOf(i,d+1),w=d;if(d>=0&&m>0){for(a=[],u=s.length;w>=0&&!f;)w==d?(a.push(w),d=s.indexOf(o,w+1)):a.length==1?f=[a.pop(),m]:((c=a.pop())<u&&(u=c,l=m),m=s.indexOf(i,w+1)),w=d<m&&d>=0?d:m;a.length&&(f=[u,l])}return f}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 Fr=="object"&&Fr);i.global!==i&&i.window;var s=function(f){this.message=f};(s.prototype=new Error).name="InvalidCharacterError";var a=function(f){throw new s(f)},c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,l={encode:function(f){f=String(f),/[^\0-\xFF]/.test(f)&&a("The string to be encoded contains characters outside of the Latin1 range.");for(var d,m,w,b,T=f.length%3,v="",g=-1,h=f.length-T;++g<h;)d=f.charCodeAt(g)<<16,m=f.charCodeAt(++g)<<8,w=f.charCodeAt(++g),v+=c.charAt((b=d+m+w)>>18&63)+c.charAt(b>>12&63)+c.charAt(b>>6&63)+c.charAt(63&b);return T==2?(d=f.charCodeAt(g)<<8,m=f.charCodeAt(++g),v+=c.charAt((b=d+m)>>10)+c.charAt(b>>4&63)+c.charAt(b<<2&63)+"="):T==1&&(b=f.charCodeAt(g),v+=c.charAt(b>>2)+c.charAt(b<<4&63)+"=="),v},decode:function(f){var d=(f=String(f).replace(u,"")).length;d%4==0&&(d=(f=f.replace(/==?$/,"")).length),(d%4==1||/[^+a-zA-Z0-9/]/.test(f))&&a("Invalid character: the string to be decoded is not correctly encoded.");for(var m,w,b=0,T="",v=-1;++v<d;)w=c.indexOf(f.charAt(v)),m=b%4?64*m+w:w,b++%4&&(T+=String.fromCharCode(255&m>>(-2*b&6)));return T},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 f=0;f<l;f++)u.push(c[f]);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
36
  `||g==="\r"}function s(g,h){const y=h;for(;h<g.length;h++)if(!(g[h]!="?"&&g[h]!=" ")){const S=g.substr(y,h-y);if(h>5&&S==="xml")return w("InvalidXml","XML declaration allowed only at the start of the document.",T(g,h));if(g[h]=="?"&&g[h+1]==">"){h++;break}}return h}function a(g,h){if(g.length>h+5&&g[h+1]==="-"&&g[h+2]==="-"){for(h+=3;h<g.length;h++)if(g[h]==="-"&&g[h+1]==="-"&&g[h+2]===">"){h+=2;break}}else if(g.length>h+8&&g[h+1]==="D"&&g[h+2]==="O"&&g[h+3]==="C"&&g[h+4]==="T"&&g[h+5]==="Y"&&g[h+6]==="P"&&g[h+7]==="E"){let y=1;for(h+=8;h<g.length;h++)if(g[h]==="<")y++;else if(g[h]===">"&&(y--,y===0))break}else if(g.length>h+9&&g[h+1]==="["&&g[h+2]==="C"&&g[h+3]==="D"&&g[h+4]==="A"&&g[h+5]==="T"&&g[h+6]==="A"&&g[h+7]==="["){for(h+=8;h<g.length;h++)if(g[h]==="]"&&g[h+1]==="]"&&g[h+2]===">"){h+=2;break}}return h}t.validate=function(g,h){h=Object.assign({},o,h);const y=[];let S=!1,E=!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(i(g[I]))continue;return w("InvalidChar","char '"+g[I]+"' is not expected.",T(g,I))}{let A=I;if(I++,g[I]==="!"){I=a(g,I);continue}{let $=!1;g[I]==="/"&&($=!0,I++);let D="";for(;I<g.length&&g[I]!==">"&&g[I]!==" "&&g[I]!==" "&&g[I]!==`
37
- `&&g[I]!=="\r";I++)D+=g[I];if(D=D.trim(),D[D.length-1]==="/"&&(D=D.substring(0,D.length-1),I--),R=D,!r.isName(R)){let j;return j=D.trim().length===0?"Invalid space after '<'.":"Tag '"+D+"' is an invalid name.",w("InvalidTag",j,T(g,I))}const k=l(g,I);if(k===!1)return w("InvalidAttr","Attributes for '"+D+"' have open quote.",T(g,I));let N=k.value;if(I=k.index,N[N.length-1]==="/"){const j=I-N.length;N=N.substring(0,N.length-1);const W=d(N,h);if(W!==!0)return w(W.err.code,W.err.msg,T(g,j+W.err.line));S=!0}else if($){if(!k.tagClosed)return w("InvalidTag","Closing tag '"+D+"' doesn't have proper closing.",T(g,I));if(N.trim().length>0)return w("InvalidTag","Closing tag '"+D+"' can't have attributes or invalid starting.",T(g,A));if(y.length===0)return w("InvalidTag","Closing tag '"+D+"' has not been opened.",T(g,A));{const j=y.pop();if(D!==j.tagName){let W=T(g,j.tagStartPos);return w("InvalidTag","Expected closing tag '"+j.tagName+"' (opened in line "+W.line+", col "+W.col+") instead of closing tag '"+D+"'.",T(g,A))}y.length==0&&(E=!0)}}else{const j=d(N,h);if(j!==!0)return w(j.err.code,j.err.msg,T(g,I-N.length+j.err.line));if(E===!0)return w("InvalidXml","Multiple possible root nodes found.",T(g,I));h.unpairedTags.indexOf(D)!==-1||y.push({tagName:D,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 j=m(g,I);if(j==-1)return w("InvalidChar","char '&' is not expected.",T(g,I));I=j}else if(E===!0&&!i(g[I]))return w("InvalidXml","Extra text at the end",T(g,I));g[I]==="<"&&I--}}}var R;return S?y.length==1?w("InvalidTag","Unclosed tag '"+y[0].tagName+"'.",T(g,y[0].tagStartPos)):!(y.length>0)||w("InvalidXml","Invalid '"+JSON.stringify(y.map(I=>I.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):w("InvalidXml","Start tag expected.",1)};const c='"',u="'";function l(g,h){let y="",S="",E=!1;for(;h<g.length;h++){if(g[h]===c||g[h]===u)S===""?S=g[h]:S!==g[h]||(S="");else if(g[h]===">"&&S===""){E=!0;break}y+=g[h]}return S===""&&{value:y,index:h,tagClosed:E}}const f=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function d(g,h){const y=r.getAllMatches(g,f),S={};for(let E=0;E<y.length;E++){if(y[E][1].length===0)return w("InvalidAttr","Attribute '"+y[E][2]+"' has no space in starting.",b(y[E]));if(y[E][3]!==void 0&&y[E][4]===void 0)return w("InvalidAttr","Attribute '"+y[E][2]+"' is without value.",b(y[E]));if(y[E][3]===void 0&&!h.allowBooleanAttributes)return w("InvalidAttr","boolean attribute '"+y[E][2]+"' is not allowed.",b(y[E]));const R=y[E][2];if(!v(R))return w("InvalidAttr","Attribute '"+R+"' is an invalid name.",b(y[E]));if(S.hasOwnProperty(R))return w("InvalidAttr","Attribute '"+R+"' is repeated.",b(y[E]));S[R]=1}return!0}function m(g,h){if(g[++h]===";")return-1;if(g[h]==="#")return function(S,E){let R=/\d/;for(S[E]==="x"&&(E++,R=/[\da-fA-F]/);E<S.length;E++){if(S[E]===";")return E;if(!S[E].match(R))break}return-1}(g,++h);let y=0;for(;h<g.length;h++,y++)if(!(g[h].match(/\w/)&&y<20)){if(g[h]===";")break;return-1}return h}function w(g,h,y){return{err:{code:g,msg:h,line:y.line||y,col:y.col}}}function v(g){return r.isName(g)}function T(g,h){const y=g.substring(0,h).split(/\r?\n/);return{line:y.length,col:y[y.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,f){return f},attributeValueProcessor:function(l,f){return f},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=`>
37
+ `&&g[I]!=="\r";I++)D+=g[I];if(D=D.trim(),D[D.length-1]==="/"&&(D=D.substring(0,D.length-1),I--),R=D,!r.isName(R)){let z;return z=D.trim().length===0?"Invalid space after '<'.":"Tag '"+D+"' is an invalid name.",w("InvalidTag",z,T(g,I))}const k=l(g,I);if(k===!1)return w("InvalidAttr","Attributes for '"+D+"' have open quote.",T(g,I));let N=k.value;if(I=k.index,N[N.length-1]==="/"){const z=I-N.length;N=N.substring(0,N.length-1);const G=d(N,h);if(G!==!0)return w(G.err.code,G.err.msg,T(g,z+G.err.line));S=!0}else if($){if(!k.tagClosed)return w("InvalidTag","Closing tag '"+D+"' doesn't have proper closing.",T(g,I));if(N.trim().length>0)return w("InvalidTag","Closing tag '"+D+"' can't have attributes or invalid starting.",T(g,A));if(y.length===0)return w("InvalidTag","Closing tag '"+D+"' has not been opened.",T(g,A));{const z=y.pop();if(D!==z.tagName){let G=T(g,z.tagStartPos);return w("InvalidTag","Expected closing tag '"+z.tagName+"' (opened in line "+G.line+", col "+G.col+") instead of closing tag '"+D+"'.",T(g,A))}y.length==0&&(E=!0)}}else{const z=d(N,h);if(z!==!0)return w(z.err.code,z.err.msg,T(g,I-N.length+z.err.line));if(E===!0)return w("InvalidXml","Multiple possible root nodes found.",T(g,I));h.unpairedTags.indexOf(D)!==-1||y.push({tagName:D,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.",T(g,I));I=z}else if(E===!0&&!i(g[I]))return w("InvalidXml","Extra text at the end",T(g,I));g[I]==="<"&&I--}}}var R;return S?y.length==1?w("InvalidTag","Unclosed tag '"+y[0].tagName+"'.",T(g,y[0].tagStartPos)):!(y.length>0)||w("InvalidXml","Invalid '"+JSON.stringify(y.map(I=>I.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):w("InvalidXml","Start tag expected.",1)};const c='"',u="'";function l(g,h){let y="",S="",E=!1;for(;h<g.length;h++){if(g[h]===c||g[h]===u)S===""?S=g[h]:S!==g[h]||(S="");else if(g[h]===">"&&S===""){E=!0;break}y+=g[h]}return S===""&&{value:y,index:h,tagClosed:E}}const f=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function d(g,h){const y=r.getAllMatches(g,f),S={};for(let E=0;E<y.length;E++){if(y[E][1].length===0)return w("InvalidAttr","Attribute '"+y[E][2]+"' has no space in starting.",v(y[E]));if(y[E][3]!==void 0&&y[E][4]===void 0)return w("InvalidAttr","Attribute '"+y[E][2]+"' is without value.",v(y[E]));if(y[E][3]===void 0&&!h.allowBooleanAttributes)return w("InvalidAttr","boolean attribute '"+y[E][2]+"' is not allowed.",v(y[E]));const R=y[E][2];if(!b(R))return w("InvalidAttr","Attribute '"+R+"' is an invalid name.",v(y[E]));if(S.hasOwnProperty(R))return w("InvalidAttr","Attribute '"+R+"' is repeated.",v(y[E]));S[R]=1}return!0}function m(g,h){if(g[++h]===";")return-1;if(g[h]==="#")return function(S,E){let R=/\d/;for(S[E]==="x"&&(E++,R=/[\da-fA-F]/);E<S.length;E++){if(S[E]===";")return E;if(!S[E].match(R))break}return-1}(g,++h);let y=0;for(;h<g.length;h++,y++)if(!(g[h].match(/\w/)&&y<20)){if(g[h]===";")break;return-1}return h}function w(g,h,y){return{err:{code:g,msg:h,line:y.line||y,col:y.col}}}function b(g){return r.isName(g)}function T(g,h){const y=g.substring(0,h).split(/\r?\n/);return{line:y.length,col:y[y.length-1].length+1}}function v(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,f){return f},attributeValueProcessor:function(l,f){return f},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=`>
38
38
  `,this.newLine=`
39
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function a(l,f,d,m){const w=this.j2x(l,d+1,m.concat(f));return l[this.options.textNodeName]!==void 0&&Object.keys(l).length===1?this.buildTextValNode(l[this.options.textNodeName],f,w.attrStr,d):this.buildObjectNode(w.val,f,w.attrStr,d)}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,f,d){let m="",w="";const v=d.join(".");for(let T in l)if(Object.prototype.hasOwnProperty.call(l,T))if(l[T]===void 0)this.isAttribute(T)&&(w+="");else if(l[T]===null)this.isAttribute(T)?w+="":T[0]==="?"?w+=this.indentate(f)+"<"+T+"?"+this.tagEndChar:w+=this.indentate(f)+"<"+T+"/"+this.tagEndChar;else if(l[T]instanceof Date)w+=this.buildTextValNode(l[T],T,"",f);else if(typeof l[T]!="object"){const b=this.isAttribute(T);if(b&&!this.ignoreAttributesFn(b,v))m+=this.buildAttrPairStr(b,""+l[T]);else if(!b)if(T===this.options.textNodeName){let g=this.options.tagValueProcessor(T,""+l[T]);w+=this.replaceEntitiesValue(g)}else w+=this.buildTextValNode(l[T],T,"",f)}else if(Array.isArray(l[T])){const b=l[T].length;let g="",h="";for(let y=0;y<b;y++){const S=l[T][y];if(S!==void 0)if(S===null)T[0]==="?"?w+=this.indentate(f)+"<"+T+"?"+this.tagEndChar:w+=this.indentate(f)+"<"+T+"/"+this.tagEndChar;else if(typeof S=="object")if(this.options.oneListGroup){const E=this.j2x(S,f+1,d.concat(T));g+=E.val,this.options.attributesGroupName&&S.hasOwnProperty(this.options.attributesGroupName)&&(h+=E.attrStr)}else g+=this.processTextOrObjNode(S,T,f,d);else if(this.options.oneListGroup){let E=this.options.tagValueProcessor(T,S);E=this.replaceEntitiesValue(E),g+=E}else g+=this.buildTextValNode(S,T,"",f)}this.options.oneListGroup&&(g=this.buildObjectNode(g,T,h,f)),w+=g}else if(this.options.attributesGroupName&&T===this.options.attributesGroupName){const b=Object.keys(l[T]),g=b.length;for(let h=0;h<g;h++)m+=this.buildAttrPairStr(b[h],""+l[T][b[h]])}else w+=this.processTextOrObjNode(l[T],T,f,d);return{attrStr:m,val:w}},s.prototype.buildAttrPairStr=function(l,f){return f=this.options.attributeValueProcessor(l,""+f),f=this.replaceEntitiesValue(f),this.options.suppressBooleanAttributes&&f==="true"?" "+l:" "+l+'="'+f+'"'},s.prototype.buildObjectNode=function(l,f,d,m){if(l==="")return f[0]==="?"?this.indentate(m)+"<"+f+d+"?"+this.tagEndChar:this.indentate(m)+"<"+f+d+this.closeTag(f)+this.tagEndChar;{let w="</"+f+this.tagEndChar,v="";return f[0]==="?"&&(v="?",w=""),!d&&d!==""||l.indexOf("<")!==-1?this.options.commentPropName!==!1&&f===this.options.commentPropName&&v.length===0?this.indentate(m)+`<!--${l}-->`+this.newLine:this.indentate(m)+"<"+f+d+v+this.tagEndChar+l+this.indentate(m)+w:this.indentate(m)+"<"+f+d+v+">"+l+w}},s.prototype.closeTag=function(l){let f="";return this.options.unpairedTags.indexOf(l)!==-1?this.options.suppressUnpairedNode||(f="/"):f=this.options.suppressEmptyNode?"/":`></${l}`,f},s.prototype.buildTextValNode=function(l,f,d,m){if(this.options.cdataPropName!==!1&&f===this.options.cdataPropName)return this.indentate(m)+`<![CDATA[${l}]]>`+this.newLine;if(this.options.commentPropName!==!1&&f===this.options.commentPropName)return this.indentate(m)+`<!--${l}-->`+this.newLine;if(f[0]==="?")return this.indentate(m)+"<"+f+d+"?"+this.tagEndChar;{let w=this.options.tagValueProcessor(f,l);return w=this.replaceEntitiesValue(w),w===""?this.indentate(m)+"<"+f+d+this.closeTag(f)+this.tagEndChar:this.indentate(m)+"<"+f+d+">"+w+"</"+f+this.tagEndChar}},s.prototype.replaceEntitiesValue=function(l){if(l&&l.length>0&&this.options.processEntities)for(let f=0;f<this.options.entities.length;f++){const d=this.options.entities[f];l=l.replace(d.regex,d.val)}return l},e.exports=s},87:e=>{function t(s,a,c,u){let l="",f=!1;for(let d=0;d<s.length;d++){const m=s[d],w=n(m);if(w===void 0)continue;let v="";if(v=c.length===0?w:`${c}.${w}`,w===a.textNodeName){let h=m[w];o(v,a)||(h=a.tagValueProcessor(w,h),h=i(h,a)),f&&(l+=u),l+=h,f=!1;continue}if(w===a.cdataPropName){f&&(l+=u),l+=`<![CDATA[${m[w][0][a.textNodeName]}]]>`,f=!1;continue}if(w===a.commentPropName){l+=u+`<!--${m[w][0][a.textNodeName]}-->`,f=!0;continue}if(w[0]==="?"){const h=r(m[":@"],a),y=w==="?xml"?"":u;let S=m[w][0][a.textNodeName];S=S.length!==0?" "+S:"",l+=y+`<${w}${S}${h}?>`,f=!0;continue}let T=u;T!==""&&(T+=a.indentBy);const b=u+`<${w}${r(m[":@"],a)}`,g=t(m[w],a,v,T);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+"/>",f=!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(f,d){let m="";for(;d<f.length&&f[d]!=="'"&&f[d]!=='"';d++)m+=f[d];if(m=m.trim(),m.indexOf(" ")!==-1)throw new Error("External entites are not supported");const w=f[d++];let v="";for(;d<f.length&&f[d]!==w;d++)v+=f[d];return[m,v,d]}function i(f,d){return f[d+1]==="!"&&f[d+2]==="-"&&f[d+3]==="-"}function s(f,d){return f[d+1]==="!"&&f[d+2]==="E"&&f[d+3]==="N"&&f[d+4]==="T"&&f[d+5]==="I"&&f[d+6]==="T"&&f[d+7]==="Y"}function a(f,d){return f[d+1]==="!"&&f[d+2]==="E"&&f[d+3]==="L"&&f[d+4]==="E"&&f[d+5]==="M"&&f[d+6]==="E"&&f[d+7]==="N"&&f[d+8]==="T"}function c(f,d){return f[d+1]==="!"&&f[d+2]==="A"&&f[d+3]==="T"&&f[d+4]==="T"&&f[d+5]==="L"&&f[d+6]==="I"&&f[d+7]==="S"&&f[d+8]==="T"}function u(f,d){return f[d+1]==="!"&&f[d+2]==="N"&&f[d+3]==="O"&&f[d+4]==="T"&&f[d+5]==="A"&&f[d+6]==="T"&&f[d+7]==="I"&&f[d+8]==="O"&&f[d+9]==="N"}function l(f){if(r.isName(f))return f;throw new Error(`Invalid entity name ${f}`)}e.exports=function(f,d){const m={};if(f[d+3]!=="O"||f[d+4]!=="C"||f[d+5]!=="T"||f[d+6]!=="Y"||f[d+7]!=="P"||f[d+8]!=="E")throw new Error("Invalid Tag instead of DOCTYPE");{d+=9;let w=1,v=!1,T=!1,b="";for(;d<f.length;d++)if(f[d]!=="<"||T)if(f[d]===">"){if(T?f[d-1]==="-"&&f[d-2]==="-"&&(T=!1,w--):w--,w===0)break}else f[d]==="["?v=!0:b+=f[d];else{if(v&&s(f,d)){let g,h;d+=7,[g,h,d]=o(f,d+1),h.indexOf("&")===-1&&(m[l(g)]={regx:RegExp(`&${g};`,"g"),val:h})}else if(v&&a(f,d))d+=8;else if(v&&c(f,d))d+=8;else if(v&&u(f,d))d+=9;else{if(!i)throw new Error("Invalid DOCTYPE");T=!0}w++,b=""}if(w!==0)throw new Error("Unclosed DOCTYPE")}return{entities:m,i:d}}},63:(e,t)=>{const n={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(r,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(E){const R=Object.keys(E);for(let I=0;I<R.length;I++){const A=R[I];this.lastEntities[A]={regex:new RegExp("&"+A+";","g"),val:E[A]}}}function u(E,R,I,A,$,D,k){if(E!==void 0&&(this.options.trimValues&&!A&&(E=E.trim()),E.length>0)){k||(E=this.replaceEntitiesValue(E));const N=this.options.tagValueProcessor(R,E,I,$,D);return N==null?E:typeof N!=typeof E||N!==E?N:this.options.trimValues||E.trim()===E?S(E,this.options.parseTagValue,this.options.numberParseOptions):E}}function l(E){if(this.options.removeNSPrefix){const R=E.split(":"),I=E.charAt(0)==="/"?"/":"";if(R[0]==="xmlns")return"";R.length===2&&(E=I+R[1])}return E}const f=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function d(E,R,I){if(this.options.ignoreAttributes!==!0&&typeof E=="string"){const A=r.getAllMatches(E,f),$=A.length,D={};for(let k=0;k<$;k++){const N=this.resolveNameSpace(A[k][1]);if(this.ignoreAttributesFn(N,R))continue;let j=A[k][4],W=this.options.attributeNamePrefix+N;if(N.length)if(this.options.transformAttributeName&&(W=this.options.transformAttributeName(W)),W==="__proto__"&&(W="#__proto__"),j!==void 0){this.options.trimValues&&(j=j.trim()),j=this.replaceEntitiesValue(j);const X=this.options.attributeValueProcessor(N,j,R);D[W]=X==null?j:typeof X!=typeof j||X!==j?X:S(j,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(D[W]=!0)}if(!Object.keys(D).length)return;if(this.options.attributesGroupName){const k={};return k[this.options.attributesGroupName]=D,k}return D}}const m=function(E){E=E.replace(/\r\n?/g,`
41
- `);const R=new o("!xml");let I=R,A="",$="";for(let D=0;D<E.length;D++)if(E[D]==="<")if(E[D+1]==="/"){const k=g(E,">",D,"Closing Tag is not closed.");let N=E.substring(D+2,k).trim();if(this.options.removeNSPrefix){const X=N.indexOf(":");X!==-1&&(N=N.substr(X+1))}this.options.transformTagName&&(N=this.options.transformTagName(N)),I&&(A=this.saveTextToParentTag(A,I,$));const j=$.substring($.lastIndexOf(".")+1);if(N&&this.options.unpairedTags.indexOf(N)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${N}>`);let W=0;j&&this.options.unpairedTags.indexOf(j)!==-1?(W=$.lastIndexOf(".",$.lastIndexOf(".")-1),this.tagsNodeStack.pop()):W=$.lastIndexOf("."),$=$.substring(0,W),I=this.tagsNodeStack.pop(),A="",D=k}else if(E[D+1]==="?"){let k=h(E,D,!1,"?>");if(!k)throw new Error("Pi Tag is not closed.");if(A=this.saveTextToParentTag(A,I,$),!(this.options.ignoreDeclaration&&k.tagName==="?xml"||this.options.ignorePiTags)){const N=new o(k.tagName);N.add(this.options.textNodeName,""),k.tagName!==k.tagExp&&k.attrExpPresent&&(N[":@"]=this.buildAttributesMap(k.tagExp,$,k.tagName)),this.addChild(I,N,$)}D=k.closeIndex+1}else if(E.substr(D+1,3)==="!--"){const k=g(E,"-->",D+4,"Comment is not closed.");if(this.options.commentPropName){const N=E.substring(D+4,k-2);A=this.saveTextToParentTag(A,I,$),I.add(this.options.commentPropName,[{[this.options.textNodeName]:N}])}D=k}else if(E.substr(D+1,2)==="!D"){const k=i(E,D);this.docTypeEntities=k.entities,D=k.i}else if(E.substr(D+1,2)==="!["){const k=g(E,"]]>",D,"CDATA is not closed.")-2,N=E.substring(D+9,k);A=this.saveTextToParentTag(A,I,$);let j=this.parseTextData(N,I.tagname,$,!0,!1,!0,!0);j==null&&(j=""),this.options.cdataPropName?I.add(this.options.cdataPropName,[{[this.options.textNodeName]:N}]):I.add(this.options.textNodeName,j),D=k+2}else{let k=h(E,D,this.options.removeNSPrefix),N=k.tagName;const j=k.rawTagName;let W=k.tagExp,X=k.attrExpPresent,ie=k.closeIndex;this.options.transformTagName&&(N=this.options.transformTagName(N)),I&&A&&I.tagname!=="!xml"&&(A=this.saveTextToParentTag(A,I,$,!1));const de=I;if(de&&this.options.unpairedTags.indexOf(de.tagname)!==-1&&(I=this.tagsNodeStack.pop(),$=$.substring(0,$.lastIndexOf("."))),N!==R.tagname&&($+=$?"."+N:N),this.isItStopNode(this.options.stopNodes,$,N)){let se="";if(W.length>0&&W.lastIndexOf("/")===W.length-1)N[N.length-1]==="/"?(N=N.substr(0,N.length-1),$=$.substr(0,$.length-1),W=N):W=W.substr(0,W.length-1),D=k.closeIndex;else if(this.options.unpairedTags.indexOf(N)!==-1)D=k.closeIndex;else{const Se=this.readStopNodeData(E,j,ie+1);if(!Se)throw new Error(`Unexpected end of ${j}`);D=Se.i,se=Se.tagContent}const we=new o(N);N!==W&&X&&(we[":@"]=this.buildAttributesMap(W,$,N)),se&&(se=this.parseTextData(se,N,$,!0,X,!0,!0)),$=$.substr(0,$.lastIndexOf(".")),we.add(this.options.textNodeName,se),this.addChild(I,we,$)}else{if(W.length>0&&W.lastIndexOf("/")===W.length-1){N[N.length-1]==="/"?(N=N.substr(0,N.length-1),$=$.substr(0,$.length-1),W=N):W=W.substr(0,W.length-1),this.options.transformTagName&&(N=this.options.transformTagName(N));const se=new o(N);N!==W&&X&&(se[":@"]=this.buildAttributesMap(W,$,N)),this.addChild(I,se,$),$=$.substr(0,$.lastIndexOf("."))}else{const se=new o(N);this.tagsNodeStack.push(I),N!==W&&X&&(se[":@"]=this.buildAttributesMap(W,$,N)),this.addChild(I,se,$),I=se}A="",D=ie}}else A+=E[D];return R.child};function w(E,R,I){const A=this.options.updateTag(R.tagname,I,R[":@"]);A===!1||(typeof A=="string"&&(R.tagname=A),E.addChild(R))}const v=function(E){if(this.options.processEntities){for(let R in this.docTypeEntities){const I=this.docTypeEntities[R];E=E.replace(I.regx,I.val)}for(let R in this.lastEntities){const I=this.lastEntities[R];E=E.replace(I.regex,I.val)}if(this.options.htmlEntities)for(let R in this.htmlEntities){const I=this.htmlEntities[R];E=E.replace(I.regex,I.val)}E=E.replace(this.ampEntity.regex,this.ampEntity.val)}return E};function T(E,R,I,A){return E&&(A===void 0&&(A=Object.keys(R.child).length===0),(E=this.parseTextData(E,R.tagname,I,!1,!!R[":@"]&&Object.keys(R[":@"]).length!==0,A))!==void 0&&E!==""&&R.add(this.options.textNodeName,E),E=""),E}function b(E,R,I){const A="*."+I;for(const $ in E){const D=E[$];if(A===D||R===D)return!0}return!1}function g(E,R,I,A){const $=E.indexOf(R,I);if($===-1)throw new Error(A);return $+R.length-1}function h(E,R,I){const A=function(X,ie){let de,se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",we="";for(let Se=ie;Se<X.length;Se++){let Z=X[Se];if(de)Z===de&&(de="");else if(Z==='"'||Z==="'")de=Z;else if(Z===se[0]){if(!se[1])return{data:we,index:Se};if(X[Se+1]===se[1])return{data:we,index:Se}}else Z===" "&&(Z=" ");we+=Z}}(E,R+1,arguments.length>3&&arguments[3]!==void 0?arguments[3]:">");if(!A)return;let $=A.data;const D=A.index,k=$.search(/\s/);let N=$,j=!0;k!==-1&&(N=$.substring(0,k),$=$.substring(k+1).trimStart());const W=N;if(I){const X=N.indexOf(":");X!==-1&&(N=N.substr(X+1),j=N!==A.data.substr(X+1))}return{tagName:N,tagExp:$,closeIndex:D,attrExpPresent:j,rawTagName:W}}function y(E,R,I){const A=I;let $=1;for(;I<E.length;I++)if(E[I]==="<")if(E[I+1]==="/"){const D=g(E,">",I,`${R} is not closed`);if(E.substring(I+2,D).trim()===R&&($--,$===0))return{tagContent:E.substring(A,I),i:D};I=D}else if(E[I+1]==="?")I=g(E,"?>",I+1,"StopNode is not closed.");else if(E.substr(I+1,3)==="!--")I=g(E,"-->",I+3,"StopNode is not closed.");else if(E.substr(I+1,2)==="![")I=g(E,"]]>",I,"StopNode is not closed.")-2;else{const D=h(E,I,">");D&&((D&&D.tagName)===R&&D.tagExp[D.tagExp.length-1]!=="/"&&$++,I=D.closeIndex)}}function S(E,R,I){if(R&&typeof E=="string"){const A=E.trim();return A==="true"||A!=="false"&&s(E,I)}return r.isExist(E)?E:""}e.exports=class{constructor(E){this.options=E,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=c,this.parseXml=m,this.parseTextData=u,this.resolveNameSpace=l,this.buildAttributesMap=d,this.isItStopNode=b,this.replaceEntitiesValue=v,this.readStopNodeData=y,this.saveTextToParentTag=T,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 f=s.validate(a,c);if(f!==!0)throw Error(`${f.err.msg}:${f.err.line}:${f.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 f=0;f<s.length;f++){const d=s[f],m=r(d);let w="";if(w=c===void 0?m:c+"."+m,m===a.textNodeName)u===void 0?u=d[m]:u+=""+d[m];else{if(m===void 0)continue;if(d[m]){let v=n(d[m],a,w);const T=i(v,a);d[":@"]?o(v,d[":@"],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],l[m]!==void 0&&l.hasOwnProperty(m)?(Array.isArray(l[m])||(l[m]=[l[m]]),l[m].push(v)):a.isArray(m,w,T)?l[m]=[v]:l[m]=v}}}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),f=l.length;for(let d=0;d<f;d++){const m=l[d];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),f=8*c.length,d=1732584193,m=-271733879,w=-1732584194,v=271733878,T=0;T<l.length;T++)l[T]=16711935&(l[T]<<8|l[T]>>>24)|4278255360&(l[T]<<24|l[T]>>>8);l[f>>>5]|=128<<f%32,l[14+(f+64>>>9<<4)]=f;var b=a._ff,g=a._gg,h=a._hh,y=a._ii;for(T=0;T<l.length;T+=16){var S=d,E=m,R=w,I=v;d=b(d,m,w,v,l[T+0],7,-680876936),v=b(v,d,m,w,l[T+1],12,-389564586),w=b(w,v,d,m,l[T+2],17,606105819),m=b(m,w,v,d,l[T+3],22,-1044525330),d=b(d,m,w,v,l[T+4],7,-176418897),v=b(v,d,m,w,l[T+5],12,1200080426),w=b(w,v,d,m,l[T+6],17,-1473231341),m=b(m,w,v,d,l[T+7],22,-45705983),d=b(d,m,w,v,l[T+8],7,1770035416),v=b(v,d,m,w,l[T+9],12,-1958414417),w=b(w,v,d,m,l[T+10],17,-42063),m=b(m,w,v,d,l[T+11],22,-1990404162),d=b(d,m,w,v,l[T+12],7,1804603682),v=b(v,d,m,w,l[T+13],12,-40341101),w=b(w,v,d,m,l[T+14],17,-1502002290),d=g(d,m=b(m,w,v,d,l[T+15],22,1236535329),w,v,l[T+1],5,-165796510),v=g(v,d,m,w,l[T+6],9,-1069501632),w=g(w,v,d,m,l[T+11],14,643717713),m=g(m,w,v,d,l[T+0],20,-373897302),d=g(d,m,w,v,l[T+5],5,-701558691),v=g(v,d,m,w,l[T+10],9,38016083),w=g(w,v,d,m,l[T+15],14,-660478335),m=g(m,w,v,d,l[T+4],20,-405537848),d=g(d,m,w,v,l[T+9],5,568446438),v=g(v,d,m,w,l[T+14],9,-1019803690),w=g(w,v,d,m,l[T+3],14,-187363961),m=g(m,w,v,d,l[T+8],20,1163531501),d=g(d,m,w,v,l[T+13],5,-1444681467),v=g(v,d,m,w,l[T+2],9,-51403784),w=g(w,v,d,m,l[T+7],14,1735328473),d=h(d,m=g(m,w,v,d,l[T+12],20,-1926607734),w,v,l[T+5],4,-378558),v=h(v,d,m,w,l[T+8],11,-2022574463),w=h(w,v,d,m,l[T+11],16,1839030562),m=h(m,w,v,d,l[T+14],23,-35309556),d=h(d,m,w,v,l[T+1],4,-1530992060),v=h(v,d,m,w,l[T+4],11,1272893353),w=h(w,v,d,m,l[T+7],16,-155497632),m=h(m,w,v,d,l[T+10],23,-1094730640),d=h(d,m,w,v,l[T+13],4,681279174),v=h(v,d,m,w,l[T+0],11,-358537222),w=h(w,v,d,m,l[T+3],16,-722521979),m=h(m,w,v,d,l[T+6],23,76029189),d=h(d,m,w,v,l[T+9],4,-640364487),v=h(v,d,m,w,l[T+12],11,-421815835),w=h(w,v,d,m,l[T+15],16,530742520),d=y(d,m=h(m,w,v,d,l[T+2],23,-995338651),w,v,l[T+0],6,-198630844),v=y(v,d,m,w,l[T+7],10,1126891415),w=y(w,v,d,m,l[T+14],15,-1416354905),m=y(m,w,v,d,l[T+5],21,-57434055),d=y(d,m,w,v,l[T+12],6,1700485571),v=y(v,d,m,w,l[T+3],10,-1894986606),w=y(w,v,d,m,l[T+10],15,-1051523),m=y(m,w,v,d,l[T+1],21,-2054922799),d=y(d,m,w,v,l[T+8],6,1873313359),v=y(v,d,m,w,l[T+15],10,-30611744),w=y(w,v,d,m,l[T+6],15,-1560198380),m=y(m,w,v,d,l[T+13],21,1309151649),d=y(d,m,w,v,l[T+4],6,-145523070),v=y(v,d,m,w,l[T+11],10,-1120210379),w=y(w,v,d,m,l[T+2],15,718787259),m=y(m,w,v,d,l[T+9],21,-343485551),d=d+S>>>0,m=m+E>>>0,w=w+R>>>0,v=v+I>>>0}return r.endian([d,m,w,v])};a._ff=function(c,u,l,f,d,m,w){var v=c+(u&l|~u&f)+(d>>>0)+w;return(v<<m|v>>>32-m)+u},a._gg=function(c,u,l,f,d,m,w){var v=c+(u&f|l&~f)+(d>>>0)+w;return(v<<m|v>>>32-m)+u},a._hh=function(c,u,l,f,d,m,w){var v=c+(u^l^f)+(d>>>0)+w;return(v<<m|v>>>32-m)+u},a._ii=function(c,u,l,f,d,m,w){var v=c+(l^(u|~f))+(d>>>0)+w;return(v<<m|v>>>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)),T(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 f(b){if(!b)return[""];var g=[],h=r("{","}",b);if(!h)return b.split(",");var y=h.pre,S=h.body,E=h.post,R=y.split(",");R[R.length-1]+="{"+S+"}";var I=f(E);return E.length&&(R[R.length-1]+=I.shift(),R.push.apply(R,I)),g.push.apply(g,R),g}function d(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 T(b,g){var h=[],y=r("{","}",b);if(!y)return[b];var S=y.pre,E=y.post.length?T(y.post,!1):[""];if(/\$$/.test(y.pre))for(var R=0;R<E.length;R++){var I=S+"{"+y.body+"}"+E[R];h.push(I)}else{var A,$,D=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(y.body),k=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(y.body),N=D||k,j=y.body.indexOf(",")>=0;if(!N&&!j)return y.post.match(/,.*\}/)?T(b=y.pre+"{"+y.body+s+y.post):[b];if(N)A=y.body.split(/\.\./);else if((A=f(y.body)).length===1&&(A=T(A[0],!1).map(d)).length===1)return E.map(function(Y){return y.pre+A[0]+Y});if(N){var W=u(A[0]),X=u(A[1]),ie=Math.max(A[0].length,A[1].length),de=A.length==3?Math.abs(u(A[2])):1,se=w;X<W&&(de*=-1,se=v);var we=A.some(m);$=[];for(var Se=W;se(Se,X);Se+=de){var Z;if(k)(Z=String.fromCharCode(Se))==="\\"&&(Z="");else if(Z=String(Se),we){var ne=ie-Z.length;if(ne>0){var le=new Array(ne+1).join("0");Z=Se<0?"-"+le+Z.slice(1):le+Z}}$.push(Z)}}else{$=[];for(var Ie=0;Ie<A.length;Ie++)$.push.apply($,T(A[Ie],!1))}for(Ie=0;Ie<$.length;Ie++)for(R=0;R<E.length;R++)I=S+$[Ie]+E[R],(!g||N||I)&&h.push(I)}return h}},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(f){if(f===null||(d=f,Function.toString.call(d).indexOf("[native code]")===-1))return f;var d;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(l!==void 0){if(l.has(f))return l.get(f);l.set(f,m)}function m(){return r(f,arguments,i(this).constructor)}return m.prototype=Object.create(f.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),o(m,f)},n(u)}function r(u,l,f){return r=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}()?Reflect.construct:function(d,m,w){var v=[null];v.push.apply(v,m);var T=new(Function.bind.apply(d,v));return w&&o(T,w.prototype),T},r.apply(null,arguments)}function o(u,l){return o=Object.setPrototypeOf||function(f,d){return f.__proto__=d,f},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(f){var d;return function(m,w){if(!(m instanceof w))throw new TypeError("Cannot call a class as a function")}(this,l),(d=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,i(l).call(this,f))).name="ObjectPrototypeMutationError",d}return function(f,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");f.prototype=Object.create(d&&d.prototype,{constructor:{value:f,writable:!0,configurable:!0}}),d&&o(f,d)}(l,u),l}(n(Error));function a(u,l){for(var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},d=l.split("."),m=d.length,w=function(b){var g=d[b];if(!u)return{v:void 0};if(g==="+"){if(Array.isArray(u))return{v:u.map(function(y,S){var E=d.slice(b+1);return E.length>0?a(y,E.join("."),f):f(u,S,d,b)})};var h=d.slice(0,b).join(".");throw new Error("Object at wildcard (".concat(h,") is not an array"))}u=f(u,g,d,b)},v=0;v<m;v++){var T=w(v);if(t(T)==="object")return T.v}return u}function c(u,l){return u.length===l+1}e.exports={set:function(u,l,f){if(t(u)!="object"||u===null||l===void 0)return u;if(typeof l=="number")return u[l]=f,u[l];try{return a(u,l,function(d,m,w,v){if(d===Reflect.getPrototypeOf({}))throw new s("Attempting to mutate Object.prototype");if(!d[m]){var T=Number.isInteger(Number(w[v+1])),b=w[v+1]==="+";d[m]=T||b?[]:{}}return c(w,v)&&(d[m]=f),d[m]})}catch(d){if(d instanceof s)throw d;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(f,d){return f[d]})}catch{return u}},has:function(u,l){var f=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 d=!1;return a(u,l,function(m,w,v,T){if(!c(v,T))return m&&m[w];d=f.own?m.hasOwnProperty(w):w in m}),d}catch{return!1}},hasOwn:function(u,l,f){return this.has(u,l,f||{own:!0})},isIn:function(u,l,f){var d=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(v,T,b,g){return m=m||v===f||!!v&&v[T]===f,w=c(b,g)&&t(v)==="object"&&T in v,v&&v[T]}),d.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 f=[],d=0;d<u.length;d++){var m=u[d];m&&m!=="."&&(m===".."?f.length&&f[f.length-1]!==".."?f.pop():l&&f.push(".."):f.push(m))}return f}var s=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a={};function c(u){return s.exec(u).slice(1)}a.resolve=function(){for(var u="",l=!1,f=arguments.length-1;f>=-1&&!l;f--){var d=f>=0?arguments[f]:ye.cwd();if(!o(d))throw new TypeError("Arguments to path.resolve must be strings");d&&(u=d+"/"+u,l=d.charAt(0)==="/")}return(l?"/":"")+(u=i(u.split("/"),!l).join("/"))||"."},a.normalize=function(u){var l=a.isAbsolute(u),f=u.substr(-1)==="/";return(u=i(u.split("/"),!l).join("/"))||l||(u="."),u&&f&&(u+="/"),(l?"/":"")+u},a.isAbsolute=function(u){return u.charAt(0)==="/"},a.join=function(){for(var u="",l=0;l<arguments.length;l++){var f=arguments[l];if(!o(f))throw new TypeError("Arguments to path.join must be strings");f&&(u+=u?"/"+f:f)}return a.normalize(u)},a.relative=function(u,l){function f(g){for(var h=0;h<g.length&&g[h]==="";h++);for(var y=g.length-1;y>=0&&g[y]==="";y--);return h>y?[]:g.slice(h,y+1)}u=a.resolve(u).substr(1),l=a.resolve(l).substr(1);for(var d=f(u.split("/")),m=f(l.split("/")),w=Math.min(d.length,m.length),v=w,T=0;T<w;T++)if(d[T]!==m[T]){v=T;break}var b=[];for(T=v;T<d.length;T++)b.push("..");return(b=b.concat(m.slice(v))).join("/")},a._makeLong=function(u){return u},a.dirname=function(u){var l=c(u),f=l[0],d=l[1];return f||d?(d&&(d=d.substr(0,d.length-1)),f+d):"."},a.basename=function(u,l){var f=c(u)[2];return l&&f.substr(-1*l.length)===l&&(f=f.substr(0,f.length-l.length)),f},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 f=((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 d=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||d?i.eNotation?m:o:s.indexOf(".")!==-1?w==="0"&&f===""||w===f||u&&w==="-"+f?m:o:l?f===w||u+f===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 f(g){return(g||"").toString().replace(i,"")}var d=[["#","hash"],["?","query"],function(g,h){return v(h.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 h,y=(typeof window<"u"?window:typeof Pr<"u"?Pr:typeof self<"u"?self:{}).location||{},S={},E=typeof(g=g||y);if(g.protocol==="blob:")S=new b(unescape(g.pathname),{});else if(E==="string")for(h in S=new b(g,{}),m)delete S[h];else if(E==="object"){for(h in g)h in m||(S[h]=g[h]);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 T(g,h){g=(g=f(g)).replace(s,""),h=h||{};var y,S=u.exec(g),E=S[1]?S[1].toLowerCase():"",R=!!S[2],I=!!S[3],A=0;return R?I?(y=S[2]+S[3]+S[4],A=S[2].length+S[3].length):(y=S[2]+S[4],A=S[2].length):I?(y=S[3]+S[4],A=S[3].length):y=S[4],E==="file:"?A>=2&&(y=y.slice(2)):v(E)?y=S[4]:E?R&&(y=y.slice(2)):A>=2&&v(h.protocol)&&(y=S[4]),{protocol:E,slashes:R||v(E),slashesCount:A,rest:y}}function b(g,h,y){if(g=(g=f(g)).replace(s,""),!(this instanceof b))return new b(g,h,y);var S,E,R,I,A,$,D=d.slice(),k=typeof h,N=this,j=0;for(k!=="object"&&k!=="string"&&(y=h,h=null),y&&typeof y!="function"&&(y=o.parse),S=!(E=T(g||"",h=w(h))).protocol&&!E.slashes,N.slashes=E.slashes||S&&h.slashes,N.protocol=E.protocol||h.protocol||"",g=E.rest,(E.protocol==="file:"&&(E.slashesCount!==2||l.test(g))||!E.slashes&&(E.protocol||E.slashesCount<2||!v(N.protocol)))&&(D[3]=[/(.*)/,"pathname"]);j<D.length;j++)typeof(I=D[j])!="function"?(R=I[0],$=I[1],R!=R?N[$]=g:typeof R=="string"?~(A=R==="@"?g.lastIndexOf(R):g.indexOf(R))&&(typeof I[2]=="number"?(N[$]=g.slice(0,A),g=g.slice(A+I[2])):(N[$]=g.slice(A),g=g.slice(0,A))):(A=R.exec(g))&&(N[$]=A[1],g=g.slice(0,A.index)),N[$]=N[$]||S&&I[3]&&h[$]||"",I[4]&&(N[$]=N[$].toLowerCase())):g=I(g,N);y&&(N.query=y(N.query)),S&&h.slashes&&N.pathname.charAt(0)!=="/"&&(N.pathname!==""||h.pathname!=="")&&(N.pathname=function(W,X){if(W==="")return X;for(var ie=(X||"/").split("/").slice(0,-1).concat(W.split("/")),de=ie.length,se=ie[de-1],we=!1,Se=0;de--;)ie[de]==="."?ie.splice(de,1):ie[de]===".."?(ie.splice(de,1),Se++):Se&&(de===0&&(we=!0),ie.splice(de,1),Se--);return we&&ie.unshift(""),se!=="."&&se!==".."||ie.push(""),ie.join("/")}(N.pathname,h.pathname)),N.pathname.charAt(0)!=="/"&&v(N.protocol)&&(N.pathname="/"+N.pathname),r(N.port,N.protocol)||(N.host=N.hostname,N.port=""),N.username=N.password="",N.auth&&(~(A=N.auth.indexOf(":"))?(N.username=N.auth.slice(0,A),N.username=encodeURIComponent(decodeURIComponent(N.username)),N.password=N.auth.slice(A+1),N.password=encodeURIComponent(decodeURIComponent(N.password))):N.username=encodeURIComponent(decodeURIComponent(N.auth)),N.auth=N.password?N.username+":"+N.password:N.username),N.origin=N.protocol!=="file:"&&v(N.protocol)&&N.host?N.protocol+"//"+N.host:"null",N.href=N.toString()}b.prototype={set:function(g,h,y){var S=this;switch(g){case"query":typeof h=="string"&&h.length&&(h=(y||o.parse)(h)),S[g]=h;break;case"port":S[g]=h,r(h,S.protocol)?h&&(S.host=S.hostname+":"+h):(S.host=S.hostname,S[g]="");break;case"hostname":S[g]=h,S.port&&(h+=":"+S.port),S.host=h;break;case"host":S[g]=h,c.test(h)?(h=h.split(":"),S.port=h.pop(),S.hostname=h.join(":")):(S.hostname=h,S.port="");break;case"protocol":S.protocol=h.toLowerCase(),S.slashes=!y;break;case"pathname":case"hash":if(h){var E=g==="pathname"?"/":"#";S[g]=h.charAt(0)!==E?E+h:h}else S[g]=h;break;case"username":case"password":S[g]=encodeURIComponent(h);break;case"auth":var R=h.indexOf(":");~R?(S.username=h.slice(0,R),S.username=encodeURIComponent(decodeURIComponent(S.username)),S.password=h.slice(R+1),S.password=encodeURIComponent(decodeURIComponent(S.password))):S.username=encodeURIComponent(decodeURIComponent(h))}for(var I=0;I<d.length;I++){var A=d[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=o.stringify);var h,y=this,S=y.host,E=y.protocol;E&&E.charAt(E.length-1)!==":"&&(E+=":");var R=E+(y.protocol&&y.slashes||v(y.protocol)?"//":"");return y.username?(R+=y.username,y.password&&(R+=":"+y.password),R+="@"):y.password?(R+=":"+y.password,R+="@"):y.protocol!=="file:"&&v(y.protocol)&&!S&&y.pathname!=="/"&&(R+="@"),(S[S.length-1]===":"||c.test(y.hostname)&&!y.port)&&(S+=":"),R+=S+y.pathname,(h=typeof y.query=="object"?g(y.query):y.query)&&(R+=h.charAt(0)!=="?"?"?"+h:h),y.hash&&(R+=y.hash),R}},b.extractProtocol=T,b.location=w,b.trimLeft=f,b.qs=o,e.exports=b},410:()=>{},388:()=>{},805:()=>{},345:()=>{},800:()=>{}},jm={};function pt(e){var t=jm[e];if(t!==void 0)return t.exports;var n=jm[e]={id:e,loaded:!1,exports:{}};return bR[e].call(n.exports,n,n.exports,pt),n.loaded=!0,n.exports}pt.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return pt.d(t,{a:t}),t},pt.d=(e,t)=>{for(var n in t)pt.o(t,n)&&!pt.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},pt.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),pt.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var Dn={};pt.d(Dn,{hT:()=>mn,O4:()=>br,Kd:()=>IR,YK:()=>CR,UU:()=>N_,Gu:()=>Ym,ky:()=>py,h4:()=>bo,ch:()=>Ns,hq:()=>Zr,i5:()=>hy});var vR=pt(737),wR=pt.n(vR);function Cu(e){if(!Pu(e))throw new Error("Parameter was not an error")}function Pu(e){return!!e&&typeof e=="object"&&(t=e,Object.prototype.toString.call(t)==="[object Error]")||e instanceof Error;var t}class gn extends Error{constructor(t,n){const r=[...arguments],{options:o,shortMessage:i}=function(a){let c,u="";if(a.length===0)c={};else if(Pu(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 Cu(t),t._cause&&Pu(t._cause)?t._cause:null}static fullStack(t){Cu(t);const n=gn.cause(t);return n?`${t.stack}
42
- caused by: ${gn.fullStack(n)}`:t.stack??""}static info(t){Cu(t);const n={},r=gn.cause(t);return r&&Object.assign(n,gn.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 SR=pt(47),_s=pt.n(SR);const Um="__PATH_SEPARATOR_POSIX__",qm="__PATH_SEPARATOR_WINDOWS__";function It(e){try{const t=e.replace(/\//g,Um).replace(/\\\\/g,qm);return encodeURIComponent(t).split(qm).join("\\\\").split(Um).join("/")}catch(t){throw new gn(t,"Failed encoding path")}}function Vm(e){return e.startsWith("/")?e:"/"+e}function ho(e){let t=e;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function ER(e){let t=new(wR())(e).pathname;return t.length<=0&&(t="/"),ho(t)}function Ct(){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 TR=pt(542),go=pt.n(TR);const AR="abcdef0123456789";function zm(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(d,m,w,v,T,b,g){const h=g||go()(`${m}:${w}:${v}`);return d&&d.toLowerCase()==="md5-sess"?go()(`${h}:${T}:${b}`):h}(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),c=go()(`${o}:${r}`),u=i?go()(`${a}:${t.nonce}:${s}:${t.cnonce}:${i}:${c}`):go()(`${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},f=[];for(const d in l)l[d]&&(d==="qop"||d==="nc"||d==="algorithm"?f.push(`${d}=${l[d]}`):f.push(`${d}="${l[d]}"`));return`Digest ${f.join(", ")}`}function Wm(e){return(e.headers&&e.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var RR=pt(101),Hm=pt.n(RR);function Gm(e){return Hm().decode(e)}function Km(e,t){var n;return`Basic ${n=`${e}:${t}`,Hm().encode(n)}`}const Is=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,_R=Is.fetch.bind(Is),IR=Is.Request,CR=Is.Response;let mn=function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e}({}),br=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 Qm(e,t,n,r,o){switch(e.authType){case mn.Auto:t&&n&&(e.headers.Authorization=Km(t,n));break;case mn.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 mn.None:break;case mn.Password:e.headers.Authorization=Km(t,n);break;case mn.Token:e.headers.Authorization=`${(i=r).token_type} ${i.access_token}`;break;default:throw new gn({info:{code:br.InvalidAuthType}},`Invalid auth type: ${e.authType}`)}var i}pt(345),pt(800);const Xm="@@HOTPATCHER",PR=()=>{};function Fu(e){return{original:e,methods:[e],final:!1}}class FR{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=Xm}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__!==Xm)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)||PR;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]=Fu(n);else if(this.isPatched(t)){const{original:i}=this.configuration.registry[t];this.configuration.registry[t]=Object.assign(Fu(n),{original:i})}else this.configuration.registry[t]=Fu(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 Ou=null;function Ym(){return Ou||(Ou=new FR),Ou}function Cs(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 Jm(){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?Zm(r,i):Cs(i)}return r}function Zm(e,t){const n=Cs(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]?Zm(n[r],t[r]):Cs(t[r]):n[r]=t[r]:n[r]=t[r]}),n}function OR(e){const t={};for(const n of e.keys())t[n]=e.get(n);return t}function xu(){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),{})}pt(805);const xR=typeof ArrayBuffer=="function",{toString:kR}=Object.prototype;function ey(e){return xR&&(e instanceof ArrayBuffer||kR.call(e)==="[object ArrayBuffer]")}function ty(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function ku(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 Nu(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const ny=ku(function(e){const t=e._digest;return delete e._digest,t.hasDigestAuth&&(e=Jm(e,{headers:{Authorization:zm(e,t)}})),Nu(Ps(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(!Wm(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}${AR[Math.floor(16*Math.random())]}`;return u}(),!0}(n,t),function(){if(t.hasDigestAuth)return Nu(Ps(e=Jm(e,{headers:{Authorization:zm(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})}),NR=ku(function(e,t){return Nu(Ps(e),function(n){return n.ok?(t.authType=mn.Password,n):n.status==401&&Wm(n)?(t.authType=mn.Digest,Qm(t,t.username,t.password,void 0,void 0),e._digest=t.digest,ny(e)):n})}),zt=ku(function(e,t){return t.authType===mn.Auto?NR(e,t):e._digest?ny(e):Ps(e)});function Wt(e,t,n){const r=Cs(e);return r.headers=xu(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 Ps(e){const t=Ym();return t.patchInline("request",n=>t.patchInline("fetch",_R,n.url,function(r){let o={};const i={method:r.method};if(r.headers&&(o=xu(o,r.headers)),r.data!==void 0){const[s,a]=function(c){if(typeof c=="string")return[c,{}];if(ty(c))return[c,{}];if(ey(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=xu(o,a)}return r.signal&&(i.signal=r.signal),r.withCredentials&&(i.credentials="include"),i.headers=o,i}(n)),e)}var $R=pt(285);const Fs=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},DR={"[: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]},mo=e=>e.replace(/[[\]\\-]/g,"\\$&"),ry=e=>e.join(""),LR=(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,f="";e:for(;i<e.length;){const v=e.charAt(i);if(v!=="!"&&v!=="^"||i!==n+1){if(v==="]"&&s&&!c){l=i+1;break}if(s=!0,v!=="\\"||c){if(v==="["&&!c){for(const[T,[b,g,h]]of Object.entries(DR))if(e.startsWith(T,i)){if(f)return["$.",!1,e.length-n,!0];i+=T.length,h?o.push(b):r.push(b),a=a||g;continue e}}c=!1,f?(v>f?r.push(mo(f)+"-"+mo(v)):v===f&&r.push(mo(v)),f="",i++):e.startsWith("-]",i+1)?(r.push(mo(v+"-")),i+=2):e.startsWith("-",i+1)?(f=v,i+=2):(r.push(mo(v)),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[(d=r[0].length===2?r[0].slice(-1):r[0],d.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,l-n,!1];var d;const m="["+(u?"^":"")+ry(r)+"]",w="["+(u?"":"^")+ry(o)+"]";return[r.length&&o.length?"("+m+"|"+w+")":r.length?m:w,a,l-n,!0]},yo=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")},MR=new Set(["!","?","+","*","@"]),iy=e=>MR.has(e),$u="(?!\\.)",BR=new Set(["[","."]),jR=new Set(["..","."]),UR=new Set("().*{}+?[]^$\\!"),Du="[^/]",oy=Du+"*?",sy=Du+"+?",vn=class vn{constructor(t,n){Tn(this,di);Ee(this,"type");Tn(this,Kt);Tn(this,tn);Tn(this,Ar,!1);Tn(this,Rt,[]);Tn(this,Ut);Tn(this,xr);Tn(this,ui);Tn(this,kr,!1);Tn(this,nr);Tn(this,fi);Tn(this,xo,!1);let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&$t(this,tn,!0),$t(this,Ut,n),$t(this,Kt,xe(this,Ut)?xe(xe(this,Ut),Kt):this),$t(this,nr,xe(this,Kt)===this?r:xe(xe(this,Kt),nr)),$t(this,ui,xe(this,Kt)===this?[]:xe(xe(this,Kt),ui)),t!=="!"||xe(xe(this,Kt),kr)||xe(this,ui).push(this),$t(this,xr,xe(this,Ut)?xe(xe(this,Ut),Rt).length:0)}get hasMagic(){if(xe(this,tn)!==void 0)return xe(this,tn);for(const t of xe(this,Rt))if(typeof t!="string"&&(t.type||t.hasMagic))return $t(this,tn,!0);return xe(this,tn)}toString(){return xe(this,fi)!==void 0?xe(this,fi):this.type?$t(this,fi,this.type+"("+xe(this,Rt).map(t=>String(t)).join("|")+")"):$t(this,fi,xe(this,Rt).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 vn&&xe(o,Ut)===this))throw new Error("invalid part: "+o);xe(this,Rt).push(o)}}toJSON(){var n;const t=this.type===null?xe(this,Rt).slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...xe(this,Rt).map(r=>r.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===xe(this,Kt)||xe(xe(this,Kt),kr)&&((n=xe(this,Ut))==null?void 0:n.type)==="!")&&t.push({}),t}isStart(){var n;if(xe(this,Kt)===this)return!0;if(!((n=xe(this,Ut))!=null&&n.isStart()))return!1;if(xe(this,xr)===0)return!0;const t=xe(this,Ut);for(let r=0;r<xe(this,xr);r++){const o=xe(t,Rt)[r];if(!(o instanceof vn&&o.type==="!"))return!1}return!0}isEnd(){var n,r,o;if(xe(this,Kt)===this||((n=xe(this,Ut))==null?void 0:n.type)==="!")return!0;if(!((r=xe(this,Ut))!=null&&r.isEnd()))return!1;if(!this.type)return(o=xe(this,Ut))==null?void 0:o.isEnd();const t=xe(this,Ut)?xe(xe(this,Ut),Rt).length:0;return xe(this,xr)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const n=new vn(this.type,t);for(const r of xe(this,Rt))n.copyIn(r);return n}static fromGlob(t){var o;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=new vn(null,void 0,n);return Dr(o=vn,Nr,ha).call(o,t,r,0,n),r}toMMPattern(){if(this!==xe(this,Kt))return xe(this,Kt).toMMPattern();const t=this.toString(),[n,r,o,i]=this.toRegExpSource();if(!(o||xe(this,tn)||xe(this,nr).nocase&&!xe(this,nr).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;const s=(xe(this,nr).nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${n}$`,s),{_src:n,_glob:t})}get options(){return xe(this,nr)}toRegExpSource(t){var c;const n=t??!!xe(this,nr).dot;if(xe(this,Kt)===this&&Dr(this,di,E0).call(this),!this.type){const u=this.isStart()&&this.isEnd(),l=xe(this,Rt).map(m=>{var g;const[w,v,T,b]=typeof m=="string"?Dr(g=vn,Nr,T0).call(g,m,xe(this,tn),u):m.toRegExpSource(t);return $t(this,tn,xe(this,tn)||T),$t(this,Ar,xe(this,Ar)||b),w}).join("");let f="";if(this.isStart()&&typeof xe(this,Rt)[0]=="string"&&(xe(this,Rt).length!==1||!jR.has(xe(this,Rt)[0]))){const m=BR,w=n&&m.has(l.charAt(0))||l.startsWith("\\.")&&m.has(l.charAt(2))||l.startsWith("\\.\\.")&&m.has(l.charAt(4)),v=!n&&!t&&m.has(l.charAt(0));f=w?"(?!(?:^|/)\\.\\.?(?:$|/))":v?$u:""}let d="";return this.isEnd()&&xe(xe(this,Kt),kr)&&((c=xe(this,Ut))==null?void 0:c.type)==="!"&&(d="(?:$|\\/)"),[f+l+d,yo(l),$t(this,tn,!!xe(this,tn)),xe(this,Ar)]}const r=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:";let i=Dr(this,di,Xf).call(this,n);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){const u=this.toString();return $t(this,Rt,[u]),this.type=null,$t(this,tn,void 0),[u,yo(this.toString()),!1,!1]}let s=!r||t||n?"":Dr(this,di,Xf).call(this,!0);s===i&&(s=""),s&&(i=`(?:${i})(?:${s})*?`);let a="";return a=this.type==="!"&&xe(this,xo)?(this.isStart()&&!n?$u:"")+sy:o+i+(this.type==="!"?"))"+(!this.isStart()||n||t?"":$u)+oy+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`),[a,yo(i),$t(this,tn,!!xe(this,tn)),xe(this,Ar)]}};Kt=new WeakMap,tn=new WeakMap,Ar=new WeakMap,Rt=new WeakMap,Ut=new WeakMap,xr=new WeakMap,ui=new WeakMap,kr=new WeakMap,nr=new WeakMap,fi=new WeakMap,xo=new WeakMap,di=new WeakSet,E0=function(){if(this!==xe(this,Kt))throw new Error("should only call on root");if(xe(this,kr))return this;let t;for(this.toString(),$t(this,kr,!0);t=xe(this,ui).pop();){if(t.type!=="!")continue;let n=t,r=xe(n,Ut);for(;r;){for(let o=xe(n,xr)+1;!r.type&&o<xe(r,Rt).length;o++)for(const i of xe(t,Rt)){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(xe(r,Rt)[o])}n=r,r=xe(n,Ut)}}return this},Nr=new WeakSet,ha=function(t,n,r,o){var m,w;let i=!1,s=!1,a=-1,c=!1;if(n.type===null){let v=r,T="";for(;v<t.length;){const b=t.charAt(v++);if(i||b==="\\")i=!i,T+=b;else if(s)v===a+1?b!=="^"&&b!=="!"||(c=!0):b!=="]"||v===a+2&&c||(s=!1),T+=b;else if(b!=="[")if(o.noext||!iy(b)||t.charAt(v)!=="(")T+=b;else{n.push(T),T="";const g=new vn(b,n);v=Dr(m=vn,Nr,ha).call(m,t,g,v,o),n.push(g)}else s=!0,a=v,c=!1,T+=b}return n.push(T),v}let u=r+1,l=new vn(null,n);const f=[];let d="";for(;u<t.length;){const v=t.charAt(u++);if(i||v==="\\")i=!i,d+=v;else if(s)u===a+1?v!=="^"&&v!=="!"||(c=!0):v!=="]"||u===a+2&&c||(s=!1),d+=v;else if(v!=="[")if(iy(v)&&t.charAt(u)==="("){l.push(d),d="";const T=new vn(v,l);l.push(T),u=Dr(w=vn,Nr,ha).call(w,t,T,u,o)}else if(v!=="|"){if(v===")")return d===""&&xe(n,Rt).length===0&&$t(n,xo,!0),l.push(d),d="",n.push(...f,l),u;d+=v}else l.push(d),d="",f.push(l),l=new vn(null,n);else s=!0,a=u,c=!1,d+=v}return n.type=null,$t(n,tn,void 0),$t(n,Rt,[t.substring(r-1)]),u},Xf=function(t){return xe(this,Rt).map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");const[r,o,i,s]=n.toRegExpSource(t);return $t(this,Ar,xe(this,Ar)||s),r}).filter(n=>!(this.isStart()&&this.isEnd()&&!n)).join("|")},T0=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+=(UR.has(c)?"\\":"")+c;else if(c!=="\\"){if(c==="["){const[u,l,f,d]=LR(t,a);if(f){i+=u,s=s||l,a+=f-1,n=n||d;continue}}c!=="*"?c!=="?"?i+=c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(i+=Du,n=!0):(i+=r&&t==="*"?sy:oy,n=!0)}else a===t.length-1?i+="\\\\":o=!0}return[i,yo(t),!!n,s]},Tn(vn,Nr);let Os=vn;const an=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Fs(t),!(!n.nocomment&&t.charAt(0)==="#")&&new xs(t,n).match(e)},qR=/^\*+([^+@!?\*\[\(]*)$/,VR=e=>t=>!t.startsWith(".")&&t.endsWith(e),zR=e=>t=>t.endsWith(e),WR=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),HR=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),GR=/^\*+\.\*+$/,KR=e=>!e.startsWith(".")&&e.includes("."),QR=e=>e!=="."&&e!==".."&&e.includes("."),XR=/^\.\*+$/,YR=e=>e!=="."&&e!==".."&&e.startsWith("."),JR=/^\*+$/,ZR=e=>e.length!==0&&!e.startsWith("."),e_=e=>e.length!==0&&e!=="."&&e!=="..",t_=/^\?+([^+@!?\*\[\(]*)?$/,n_=e=>{let[t,n=""]=e;const r=ay([t]);return n?(n=n.toLowerCase(),o=>r(o)&&o.toLowerCase().endsWith(n)):r},r_=e=>{let[t,n=""]=e;const r=ly([t]);return n?(n=n.toLowerCase(),o=>r(o)&&o.toLowerCase().endsWith(n)):r},i_=e=>{let[t,n=""]=e;const r=ly([t]);return n?o=>r(o)&&o.endsWith(n):r},o_=e=>{let[t,n=""]=e;const r=ay([t]);return n?o=>r(o)&&o.endsWith(n):r},ay=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&!r.startsWith(".")},ly=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&r!=="."&&r!==".."},cy=typeof ye=="object"&&ye?typeof ye.env=="object"&&ye.env&&ye.env.__MINIMATCH_TESTING_PLATFORM__||ye.platform:"posix";an.sep=cy==="win32"?"\\":"/";const Ln=Symbol("globstar **");an.GLOBSTAR=Ln,an.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>an(n,e,t)};const Mn=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};an.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return an;const t=an;return Object.assign(function(n,r){return t(n,r,Mn(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))},{Minimatch:class extends t.Minimatch{constructor(n){super(n,Mn(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(n){return t.defaults(Mn(e,n)).Minimatch}},AST:class extends t.AST{constructor(n,r){super(n,r,Mn(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,Mn(e,r))}},unescape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(n,Mn(e,r))},escape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(n,Mn(e,r))},filter:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(n,Mn(e,r))},defaults:n=>t.defaults(Mn(e,n)),makeRe:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(n,Mn(e,r))},braceExpand:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(n,Mn(e,r))},match:function(n,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(n,r,Mn(e,o))},sep:t.sep,GLOBSTAR:Ln})};const uy=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Fs(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:$R(e)};an.braceExpand=uy,an.makeRe=function(e){return new xs(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},an.match=function(e,t){const n=new xs(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 fy=/[?*]|[+@!]\(.*?\)|\[|\]/;class xs{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]:{};Fs(t),n=n||{},this.options=n,this.pattern=t,this.platform=n.platform||cy,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]!=="?"&&fy.test(i[2])||fy.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 v=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),T=!v&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),b=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),g=T?3:v?0:void 0,h=!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 h=="number"){const[y,S]=[t[g],n[h]];y.toLowerCase()===S.toLowerCase()&&(n[h]=y,h>g?n=n.slice(h):g>h&&(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],f=t[s];if(this.debug(n,l,f),l===!1)return!1;if(l===Ln){this.debug("GLOBSTAR",[n,l,f]);var d=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(;d<c;){var w=t[d];if(this.debug(`
39
+ `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function a(l,f,d,m){const w=this.j2x(l,d+1,m.concat(f));return l[this.options.textNodeName]!==void 0&&Object.keys(l).length===1?this.buildTextValNode(l[this.options.textNodeName],f,w.attrStr,d):this.buildObjectNode(w.val,f,w.attrStr,d)}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,f,d){let m="",w="";const b=d.join(".");for(let T in l)if(Object.prototype.hasOwnProperty.call(l,T))if(l[T]===void 0)this.isAttribute(T)&&(w+="");else if(l[T]===null)this.isAttribute(T)?w+="":T[0]==="?"?w+=this.indentate(f)+"<"+T+"?"+this.tagEndChar:w+=this.indentate(f)+"<"+T+"/"+this.tagEndChar;else if(l[T]instanceof Date)w+=this.buildTextValNode(l[T],T,"",f);else if(typeof l[T]!="object"){const v=this.isAttribute(T);if(v&&!this.ignoreAttributesFn(v,b))m+=this.buildAttrPairStr(v,""+l[T]);else if(!v)if(T===this.options.textNodeName){let g=this.options.tagValueProcessor(T,""+l[T]);w+=this.replaceEntitiesValue(g)}else w+=this.buildTextValNode(l[T],T,"",f)}else if(Array.isArray(l[T])){const v=l[T].length;let g="",h="";for(let y=0;y<v;y++){const S=l[T][y];if(S!==void 0)if(S===null)T[0]==="?"?w+=this.indentate(f)+"<"+T+"?"+this.tagEndChar:w+=this.indentate(f)+"<"+T+"/"+this.tagEndChar;else if(typeof S=="object")if(this.options.oneListGroup){const E=this.j2x(S,f+1,d.concat(T));g+=E.val,this.options.attributesGroupName&&S.hasOwnProperty(this.options.attributesGroupName)&&(h+=E.attrStr)}else g+=this.processTextOrObjNode(S,T,f,d);else if(this.options.oneListGroup){let E=this.options.tagValueProcessor(T,S);E=this.replaceEntitiesValue(E),g+=E}else g+=this.buildTextValNode(S,T,"",f)}this.options.oneListGroup&&(g=this.buildObjectNode(g,T,h,f)),w+=g}else if(this.options.attributesGroupName&&T===this.options.attributesGroupName){const v=Object.keys(l[T]),g=v.length;for(let h=0;h<g;h++)m+=this.buildAttrPairStr(v[h],""+l[T][v[h]])}else w+=this.processTextOrObjNode(l[T],T,f,d);return{attrStr:m,val:w}},s.prototype.buildAttrPairStr=function(l,f){return f=this.options.attributeValueProcessor(l,""+f),f=this.replaceEntitiesValue(f),this.options.suppressBooleanAttributes&&f==="true"?" "+l:" "+l+'="'+f+'"'},s.prototype.buildObjectNode=function(l,f,d,m){if(l==="")return f[0]==="?"?this.indentate(m)+"<"+f+d+"?"+this.tagEndChar:this.indentate(m)+"<"+f+d+this.closeTag(f)+this.tagEndChar;{let w="</"+f+this.tagEndChar,b="";return f[0]==="?"&&(b="?",w=""),!d&&d!==""||l.indexOf("<")!==-1?this.options.commentPropName!==!1&&f===this.options.commentPropName&&b.length===0?this.indentate(m)+`<!--${l}-->`+this.newLine:this.indentate(m)+"<"+f+d+b+this.tagEndChar+l+this.indentate(m)+w:this.indentate(m)+"<"+f+d+b+">"+l+w}},s.prototype.closeTag=function(l){let f="";return this.options.unpairedTags.indexOf(l)!==-1?this.options.suppressUnpairedNode||(f="/"):f=this.options.suppressEmptyNode?"/":`></${l}`,f},s.prototype.buildTextValNode=function(l,f,d,m){if(this.options.cdataPropName!==!1&&f===this.options.cdataPropName)return this.indentate(m)+`<![CDATA[${l}]]>`+this.newLine;if(this.options.commentPropName!==!1&&f===this.options.commentPropName)return this.indentate(m)+`<!--${l}-->`+this.newLine;if(f[0]==="?")return this.indentate(m)+"<"+f+d+"?"+this.tagEndChar;{let w=this.options.tagValueProcessor(f,l);return w=this.replaceEntitiesValue(w),w===""?this.indentate(m)+"<"+f+d+this.closeTag(f)+this.tagEndChar:this.indentate(m)+"<"+f+d+">"+w+"</"+f+this.tagEndChar}},s.prototype.replaceEntitiesValue=function(l){if(l&&l.length>0&&this.options.processEntities)for(let f=0;f<this.options.entities.length;f++){const d=this.options.entities[f];l=l.replace(d.regex,d.val)}return l},e.exports=s},87:e=>{function t(s,a,c,u){let l="",f=!1;for(let d=0;d<s.length;d++){const m=s[d],w=n(m);if(w===void 0)continue;let b="";if(b=c.length===0?w:`${c}.${w}`,w===a.textNodeName){let h=m[w];o(b,a)||(h=a.tagValueProcessor(w,h),h=i(h,a)),f&&(l+=u),l+=h,f=!1;continue}if(w===a.cdataPropName){f&&(l+=u),l+=`<![CDATA[${m[w][0][a.textNodeName]}]]>`,f=!1;continue}if(w===a.commentPropName){l+=u+`<!--${m[w][0][a.textNodeName]}-->`,f=!0;continue}if(w[0]==="?"){const h=r(m[":@"],a),y=w==="?xml"?"":u;let S=m[w][0][a.textNodeName];S=S.length!==0?" "+S:"",l+=y+`<${w}${S}${h}?>`,f=!0;continue}let T=u;T!==""&&(T+=a.indentBy);const v=u+`<${w}${r(m[":@"],a)}`,g=t(m[w],a,b,T);a.unpairedTags.indexOf(w)!==-1?a.suppressUnpairedNode?l+=v+">":l+=v+"/>":g&&g.length!==0||!a.suppressEmptyNode?g&&g.endsWith(">")?l+=v+`>${g}${u}</${w}>`:(l+=v+">",g&&u!==""&&(g.includes("/>")||g.includes("</"))?l+=u+a.indentBy+g+u:l+=g,l+=`</${w}>`):l+=v+"/>",f=!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(f,d){let m="";for(;d<f.length&&f[d]!=="'"&&f[d]!=='"';d++)m+=f[d];if(m=m.trim(),m.indexOf(" ")!==-1)throw new Error("External entites are not supported");const w=f[d++];let b="";for(;d<f.length&&f[d]!==w;d++)b+=f[d];return[m,b,d]}function i(f,d){return f[d+1]==="!"&&f[d+2]==="-"&&f[d+3]==="-"}function s(f,d){return f[d+1]==="!"&&f[d+2]==="E"&&f[d+3]==="N"&&f[d+4]==="T"&&f[d+5]==="I"&&f[d+6]==="T"&&f[d+7]==="Y"}function a(f,d){return f[d+1]==="!"&&f[d+2]==="E"&&f[d+3]==="L"&&f[d+4]==="E"&&f[d+5]==="M"&&f[d+6]==="E"&&f[d+7]==="N"&&f[d+8]==="T"}function c(f,d){return f[d+1]==="!"&&f[d+2]==="A"&&f[d+3]==="T"&&f[d+4]==="T"&&f[d+5]==="L"&&f[d+6]==="I"&&f[d+7]==="S"&&f[d+8]==="T"}function u(f,d){return f[d+1]==="!"&&f[d+2]==="N"&&f[d+3]==="O"&&f[d+4]==="T"&&f[d+5]==="A"&&f[d+6]==="T"&&f[d+7]==="I"&&f[d+8]==="O"&&f[d+9]==="N"}function l(f){if(r.isName(f))return f;throw new Error(`Invalid entity name ${f}`)}e.exports=function(f,d){const m={};if(f[d+3]!=="O"||f[d+4]!=="C"||f[d+5]!=="T"||f[d+6]!=="Y"||f[d+7]!=="P"||f[d+8]!=="E")throw new Error("Invalid Tag instead of DOCTYPE");{d+=9;let w=1,b=!1,T=!1,v="";for(;d<f.length;d++)if(f[d]!=="<"||T)if(f[d]===">"){if(T?f[d-1]==="-"&&f[d-2]==="-"&&(T=!1,w--):w--,w===0)break}else f[d]==="["?b=!0:v+=f[d];else{if(b&&s(f,d)){let g,h;d+=7,[g,h,d]=o(f,d+1),h.indexOf("&")===-1&&(m[l(g)]={regx:RegExp(`&${g};`,"g"),val:h})}else if(b&&a(f,d))d+=8;else if(b&&c(f,d))d+=8;else if(b&&u(f,d))d+=9;else{if(!i)throw new Error("Invalid DOCTYPE");T=!0}w++,v=""}if(w!==0)throw new Error("Unclosed DOCTYPE")}return{entities:m,i:d}}},63:(e,t)=>{const n={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(r,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(E){const R=Object.keys(E);for(let I=0;I<R.length;I++){const A=R[I];this.lastEntities[A]={regex:new RegExp("&"+A+";","g"),val:E[A]}}}function u(E,R,I,A,$,D,k){if(E!==void 0&&(this.options.trimValues&&!A&&(E=E.trim()),E.length>0)){k||(E=this.replaceEntitiesValue(E));const N=this.options.tagValueProcessor(R,E,I,$,D);return N==null?E:typeof N!=typeof E||N!==E?N:this.options.trimValues||E.trim()===E?S(E,this.options.parseTagValue,this.options.numberParseOptions):E}}function l(E){if(this.options.removeNSPrefix){const R=E.split(":"),I=E.charAt(0)==="/"?"/":"";if(R[0]==="xmlns")return"";R.length===2&&(E=I+R[1])}return E}const f=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function d(E,R,I){if(this.options.ignoreAttributes!==!0&&typeof E=="string"){const A=r.getAllMatches(E,f),$=A.length,D={};for(let k=0;k<$;k++){const N=this.resolveNameSpace(A[k][1]);if(this.ignoreAttributesFn(N,R))continue;let z=A[k][4],G=this.options.attributeNamePrefix+N;if(N.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 X=this.options.attributeValueProcessor(N,z,R);D[G]=X==null?z:typeof X!=typeof z||X!==z?X:S(z,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(D[G]=!0)}if(!Object.keys(D).length)return;if(this.options.attributesGroupName){const k={};return k[this.options.attributesGroupName]=D,k}return D}}const m=function(E){E=E.replace(/\r\n?/g,`
41
+ `);const R=new o("!xml");let I=R,A="",$="";for(let D=0;D<E.length;D++)if(E[D]==="<")if(E[D+1]==="/"){const k=g(E,">",D,"Closing Tag is not closed.");let N=E.substring(D+2,k).trim();if(this.options.removeNSPrefix){const X=N.indexOf(":");X!==-1&&(N=N.substr(X+1))}this.options.transformTagName&&(N=this.options.transformTagName(N)),I&&(A=this.saveTextToParentTag(A,I,$));const z=$.substring($.lastIndexOf(".")+1);if(N&&this.options.unpairedTags.indexOf(N)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${N}>`);let G=0;z&&this.options.unpairedTags.indexOf(z)!==-1?(G=$.lastIndexOf(".",$.lastIndexOf(".")-1),this.tagsNodeStack.pop()):G=$.lastIndexOf("."),$=$.substring(0,G),I=this.tagsNodeStack.pop(),A="",D=k}else if(E[D+1]==="?"){let k=h(E,D,!1,"?>");if(!k)throw new Error("Pi Tag is not closed.");if(A=this.saveTextToParentTag(A,I,$),!(this.options.ignoreDeclaration&&k.tagName==="?xml"||this.options.ignorePiTags)){const N=new o(k.tagName);N.add(this.options.textNodeName,""),k.tagName!==k.tagExp&&k.attrExpPresent&&(N[":@"]=this.buildAttributesMap(k.tagExp,$,k.tagName)),this.addChild(I,N,$)}D=k.closeIndex+1}else if(E.substr(D+1,3)==="!--"){const k=g(E,"-->",D+4,"Comment is not closed.");if(this.options.commentPropName){const N=E.substring(D+4,k-2);A=this.saveTextToParentTag(A,I,$),I.add(this.options.commentPropName,[{[this.options.textNodeName]:N}])}D=k}else if(E.substr(D+1,2)==="!D"){const k=i(E,D);this.docTypeEntities=k.entities,D=k.i}else if(E.substr(D+1,2)==="!["){const k=g(E,"]]>",D,"CDATA is not closed.")-2,N=E.substring(D+9,k);A=this.saveTextToParentTag(A,I,$);let z=this.parseTextData(N,I.tagname,$,!0,!1,!0,!0);z==null&&(z=""),this.options.cdataPropName?I.add(this.options.cdataPropName,[{[this.options.textNodeName]:N}]):I.add(this.options.textNodeName,z),D=k+2}else{let k=h(E,D,this.options.removeNSPrefix),N=k.tagName;const z=k.rawTagName;let G=k.tagExp,X=k.attrExpPresent,se=k.closeIndex;this.options.transformTagName&&(N=this.options.transformTagName(N)),I&&A&&I.tagname!=="!xml"&&(A=this.saveTextToParentTag(A,I,$,!1));const ne=I;if(ne&&this.options.unpairedTags.indexOf(ne.tagname)!==-1&&(I=this.tagsNodeStack.pop(),$=$.substring(0,$.lastIndexOf("."))),N!==R.tagname&&($+=$?"."+N:N),this.isItStopNode(this.options.stopNodes,$,N)){let oe="";if(G.length>0&&G.lastIndexOf("/")===G.length-1)N[N.length-1]==="/"?(N=N.substr(0,N.length-1),$=$.substr(0,$.length-1),G=N):G=G.substr(0,G.length-1),D=k.closeIndex;else if(this.options.unpairedTags.indexOf(N)!==-1)D=k.closeIndex;else{const we=this.readStopNodeData(E,z,se+1);if(!we)throw new Error(`Unexpected end of ${z}`);D=we.i,oe=we.tagContent}const fe=new o(N);N!==G&&X&&(fe[":@"]=this.buildAttributesMap(G,$,N)),oe&&(oe=this.parseTextData(oe,N,$,!0,X,!0,!0)),$=$.substr(0,$.lastIndexOf(".")),fe.add(this.options.textNodeName,oe),this.addChild(I,fe,$)}else{if(G.length>0&&G.lastIndexOf("/")===G.length-1){N[N.length-1]==="/"?(N=N.substr(0,N.length-1),$=$.substr(0,$.length-1),G=N):G=G.substr(0,G.length-1),this.options.transformTagName&&(N=this.options.transformTagName(N));const oe=new o(N);N!==G&&X&&(oe[":@"]=this.buildAttributesMap(G,$,N)),this.addChild(I,oe,$),$=$.substr(0,$.lastIndexOf("."))}else{const oe=new o(N);this.tagsNodeStack.push(I),N!==G&&X&&(oe[":@"]=this.buildAttributesMap(G,$,N)),this.addChild(I,oe,$),I=oe}A="",D=se}}else A+=E[D];return R.child};function w(E,R,I){const A=this.options.updateTag(R.tagname,I,R[":@"]);A===!1||(typeof A=="string"&&(R.tagname=A),E.addChild(R))}const b=function(E){if(this.options.processEntities){for(let R in this.docTypeEntities){const I=this.docTypeEntities[R];E=E.replace(I.regx,I.val)}for(let R in this.lastEntities){const I=this.lastEntities[R];E=E.replace(I.regex,I.val)}if(this.options.htmlEntities)for(let R in this.htmlEntities){const I=this.htmlEntities[R];E=E.replace(I.regex,I.val)}E=E.replace(this.ampEntity.regex,this.ampEntity.val)}return E};function T(E,R,I,A){return E&&(A===void 0&&(A=Object.keys(R.child).length===0),(E=this.parseTextData(E,R.tagname,I,!1,!!R[":@"]&&Object.keys(R[":@"]).length!==0,A))!==void 0&&E!==""&&R.add(this.options.textNodeName,E),E=""),E}function v(E,R,I){const A="*."+I;for(const $ in E){const D=E[$];if(A===D||R===D)return!0}return!1}function g(E,R,I,A){const $=E.indexOf(R,I);if($===-1)throw new Error(A);return $+R.length-1}function h(E,R,I){const A=function(X,se){let ne,oe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",fe="";for(let we=se;we<X.length;we++){let Z=X[we];if(ne)Z===ne&&(ne="");else if(Z==='"'||Z==="'")ne=Z;else if(Z===oe[0]){if(!oe[1])return{data:fe,index:we};if(X[we+1]===oe[1])return{data:fe,index:we}}else Z===" "&&(Z=" ");fe+=Z}}(E,R+1,arguments.length>3&&arguments[3]!==void 0?arguments[3]:">");if(!A)return;let $=A.data;const D=A.index,k=$.search(/\s/);let N=$,z=!0;k!==-1&&(N=$.substring(0,k),$=$.substring(k+1).trimStart());const G=N;if(I){const X=N.indexOf(":");X!==-1&&(N=N.substr(X+1),z=N!==A.data.substr(X+1))}return{tagName:N,tagExp:$,closeIndex:D,attrExpPresent:z,rawTagName:G}}function y(E,R,I){const A=I;let $=1;for(;I<E.length;I++)if(E[I]==="<")if(E[I+1]==="/"){const D=g(E,">",I,`${R} is not closed`);if(E.substring(I+2,D).trim()===R&&($--,$===0))return{tagContent:E.substring(A,I),i:D};I=D}else if(E[I+1]==="?")I=g(E,"?>",I+1,"StopNode is not closed.");else if(E.substr(I+1,3)==="!--")I=g(E,"-->",I+3,"StopNode is not closed.");else if(E.substr(I+1,2)==="![")I=g(E,"]]>",I,"StopNode is not closed.")-2;else{const D=h(E,I,">");D&&((D&&D.tagName)===R&&D.tagExp[D.tagExp.length-1]!=="/"&&$++,I=D.closeIndex)}}function S(E,R,I){if(R&&typeof E=="string"){const A=E.trim();return A==="true"||A!=="false"&&s(E,I)}return r.isExist(E)?E:""}e.exports=class{constructor(E){this.options=E,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=c,this.parseXml=m,this.parseTextData=u,this.resolveNameSpace=l,this.buildAttributesMap=d,this.isItStopNode=v,this.replaceEntitiesValue=b,this.readStopNodeData=y,this.saveTextToParentTag=T,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 f=s.validate(a,c);if(f!==!0)throw Error(`${f.err.msg}:${f.err.line}:${f.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 f=0;f<s.length;f++){const d=s[f],m=r(d);let w="";if(w=c===void 0?m:c+"."+m,m===a.textNodeName)u===void 0?u=d[m]:u+=""+d[m];else{if(m===void 0)continue;if(d[m]){let b=n(d[m],a,w);const T=i(b,a);d[":@"]?o(b,d[":@"],w,a):Object.keys(b).length!==1||b[a.textNodeName]===void 0||a.alwaysCreateTextNode?Object.keys(b).length===0&&(a.alwaysCreateTextNode?b[a.textNodeName]="":b=""):b=b[a.textNodeName],l[m]!==void 0&&l.hasOwnProperty(m)?(Array.isArray(l[m])||(l[m]=[l[m]]),l[m].push(b)):a.isArray(m,w,T)?l[m]=[b]:l[m]=b}}}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),f=l.length;for(let d=0;d<f;d++){const m=l[d];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),f=8*c.length,d=1732584193,m=-271733879,w=-1732584194,b=271733878,T=0;T<l.length;T++)l[T]=16711935&(l[T]<<8|l[T]>>>24)|4278255360&(l[T]<<24|l[T]>>>8);l[f>>>5]|=128<<f%32,l[14+(f+64>>>9<<4)]=f;var v=a._ff,g=a._gg,h=a._hh,y=a._ii;for(T=0;T<l.length;T+=16){var S=d,E=m,R=w,I=b;d=v(d,m,w,b,l[T+0],7,-680876936),b=v(b,d,m,w,l[T+1],12,-389564586),w=v(w,b,d,m,l[T+2],17,606105819),m=v(m,w,b,d,l[T+3],22,-1044525330),d=v(d,m,w,b,l[T+4],7,-176418897),b=v(b,d,m,w,l[T+5],12,1200080426),w=v(w,b,d,m,l[T+6],17,-1473231341),m=v(m,w,b,d,l[T+7],22,-45705983),d=v(d,m,w,b,l[T+8],7,1770035416),b=v(b,d,m,w,l[T+9],12,-1958414417),w=v(w,b,d,m,l[T+10],17,-42063),m=v(m,w,b,d,l[T+11],22,-1990404162),d=v(d,m,w,b,l[T+12],7,1804603682),b=v(b,d,m,w,l[T+13],12,-40341101),w=v(w,b,d,m,l[T+14],17,-1502002290),d=g(d,m=v(m,w,b,d,l[T+15],22,1236535329),w,b,l[T+1],5,-165796510),b=g(b,d,m,w,l[T+6],9,-1069501632),w=g(w,b,d,m,l[T+11],14,643717713),m=g(m,w,b,d,l[T+0],20,-373897302),d=g(d,m,w,b,l[T+5],5,-701558691),b=g(b,d,m,w,l[T+10],9,38016083),w=g(w,b,d,m,l[T+15],14,-660478335),m=g(m,w,b,d,l[T+4],20,-405537848),d=g(d,m,w,b,l[T+9],5,568446438),b=g(b,d,m,w,l[T+14],9,-1019803690),w=g(w,b,d,m,l[T+3],14,-187363961),m=g(m,w,b,d,l[T+8],20,1163531501),d=g(d,m,w,b,l[T+13],5,-1444681467),b=g(b,d,m,w,l[T+2],9,-51403784),w=g(w,b,d,m,l[T+7],14,1735328473),d=h(d,m=g(m,w,b,d,l[T+12],20,-1926607734),w,b,l[T+5],4,-378558),b=h(b,d,m,w,l[T+8],11,-2022574463),w=h(w,b,d,m,l[T+11],16,1839030562),m=h(m,w,b,d,l[T+14],23,-35309556),d=h(d,m,w,b,l[T+1],4,-1530992060),b=h(b,d,m,w,l[T+4],11,1272893353),w=h(w,b,d,m,l[T+7],16,-155497632),m=h(m,w,b,d,l[T+10],23,-1094730640),d=h(d,m,w,b,l[T+13],4,681279174),b=h(b,d,m,w,l[T+0],11,-358537222),w=h(w,b,d,m,l[T+3],16,-722521979),m=h(m,w,b,d,l[T+6],23,76029189),d=h(d,m,w,b,l[T+9],4,-640364487),b=h(b,d,m,w,l[T+12],11,-421815835),w=h(w,b,d,m,l[T+15],16,530742520),d=y(d,m=h(m,w,b,d,l[T+2],23,-995338651),w,b,l[T+0],6,-198630844),b=y(b,d,m,w,l[T+7],10,1126891415),w=y(w,b,d,m,l[T+14],15,-1416354905),m=y(m,w,b,d,l[T+5],21,-57434055),d=y(d,m,w,b,l[T+12],6,1700485571),b=y(b,d,m,w,l[T+3],10,-1894986606),w=y(w,b,d,m,l[T+10],15,-1051523),m=y(m,w,b,d,l[T+1],21,-2054922799),d=y(d,m,w,b,l[T+8],6,1873313359),b=y(b,d,m,w,l[T+15],10,-30611744),w=y(w,b,d,m,l[T+6],15,-1560198380),m=y(m,w,b,d,l[T+13],21,1309151649),d=y(d,m,w,b,l[T+4],6,-145523070),b=y(b,d,m,w,l[T+11],10,-1120210379),w=y(w,b,d,m,l[T+2],15,718787259),m=y(m,w,b,d,l[T+9],21,-343485551),d=d+S>>>0,m=m+E>>>0,w=w+R>>>0,b=b+I>>>0}return r.endian([d,m,w,b])};a._ff=function(c,u,l,f,d,m,w){var b=c+(u&l|~u&f)+(d>>>0)+w;return(b<<m|b>>>32-m)+u},a._gg=function(c,u,l,f,d,m,w){var b=c+(u&f|l&~f)+(d>>>0)+w;return(b<<m|b>>>32-m)+u},a._hh=function(c,u,l,f,d,m,w){var b=c+(u^l^f)+(d>>>0)+w;return(b<<m|b>>>32-m)+u},a._ii=function(c,u,l,f,d,m,w){var b=c+(l^(u|~f))+(d>>>0)+w;return(b<<m|b>>>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(v){return v?(v.substr(0,2)==="{}"&&(v="\\{\\}"+v.substr(2)),T(function(g){return g.split("\\\\").join(o).split("\\{").join(i).split("\\}").join(s).split("\\,").join(a).split("\\.").join(c)}(v),!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(v){return parseInt(v,10)==v?parseInt(v,10):v.charCodeAt(0)}function l(v){return v.split(o).join("\\").split(i).join("{").split(s).join("}").split(a).join(",").split(c).join(".")}function f(v){if(!v)return[""];var g=[],h=r("{","}",v);if(!h)return v.split(",");var y=h.pre,S=h.body,E=h.post,R=y.split(",");R[R.length-1]+="{"+S+"}";var I=f(E);return E.length&&(R[R.length-1]+=I.shift(),R.push.apply(R,I)),g.push.apply(g,R),g}function d(v){return"{"+v+"}"}function m(v){return/^-?0\d/.test(v)}function w(v,g){return v<=g}function b(v,g){return v>=g}function T(v,g){var h=[],y=r("{","}",v);if(!y)return[v];var S=y.pre,E=y.post.length?T(y.post,!1):[""];if(/\$$/.test(y.pre))for(var R=0;R<E.length;R++){var I=S+"{"+y.body+"}"+E[R];h.push(I)}else{var A,$,D=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(y.body),k=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(y.body),N=D||k,z=y.body.indexOf(",")>=0;if(!N&&!z)return y.post.match(/,.*\}/)?T(v=y.pre+"{"+y.body+s+y.post):[v];if(N)A=y.body.split(/\.\./);else if((A=f(y.body)).length===1&&(A=T(A[0],!1).map(d)).length===1)return E.map(function(Y){return y.pre+A[0]+Y});if(N){var G=u(A[0]),X=u(A[1]),se=Math.max(A[0].length,A[1].length),ne=A.length==3?Math.abs(u(A[2])):1,oe=w;X<G&&(ne*=-1,oe=b);var fe=A.some(m);$=[];for(var we=G;oe(we,X);we+=ne){var Z;if(k)(Z=String.fromCharCode(we))==="\\"&&(Z="");else if(Z=String(we),fe){var re=se-Z.length;if(re>0){var ce=new Array(re+1).join("0");Z=we<0?"-"+ce+Z.slice(1):ce+Z}}$.push(Z)}}else{$=[];for(var Ie=0;Ie<A.length;Ie++)$.push.apply($,T(A[Ie],!1))}for(Ie=0;Ie<$.length;Ie++)for(R=0;R<E.length;R++)I=S+$[Ie]+E[R],(!g||N||I)&&h.push(I)}return h}},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(f){if(f===null||(d=f,Function.toString.call(d).indexOf("[native code]")===-1))return f;var d;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(l!==void 0){if(l.has(f))return l.get(f);l.set(f,m)}function m(){return r(f,arguments,i(this).constructor)}return m.prototype=Object.create(f.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),o(m,f)},n(u)}function r(u,l,f){return r=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}()?Reflect.construct:function(d,m,w){var b=[null];b.push.apply(b,m);var T=new(Function.bind.apply(d,b));return w&&o(T,w.prototype),T},r.apply(null,arguments)}function o(u,l){return o=Object.setPrototypeOf||function(f,d){return f.__proto__=d,f},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(f){var d;return function(m,w){if(!(m instanceof w))throw new TypeError("Cannot call a class as a function")}(this,l),(d=function(m,w){return!w||t(w)!=="object"&&typeof w!="function"?function(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}(m):w}(this,i(l).call(this,f))).name="ObjectPrototypeMutationError",d}return function(f,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");f.prototype=Object.create(d&&d.prototype,{constructor:{value:f,writable:!0,configurable:!0}}),d&&o(f,d)}(l,u),l}(n(Error));function a(u,l){for(var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},d=l.split("."),m=d.length,w=function(v){var g=d[v];if(!u)return{v:void 0};if(g==="+"){if(Array.isArray(u))return{v:u.map(function(y,S){var E=d.slice(v+1);return E.length>0?a(y,E.join("."),f):f(u,S,d,v)})};var h=d.slice(0,v).join(".");throw new Error("Object at wildcard (".concat(h,") is not an array"))}u=f(u,g,d,v)},b=0;b<m;b++){var T=w(b);if(t(T)==="object")return T.v}return u}function c(u,l){return u.length===l+1}e.exports={set:function(u,l,f){if(t(u)!="object"||u===null||l===void 0)return u;if(typeof l=="number")return u[l]=f,u[l];try{return a(u,l,function(d,m,w,b){if(d===Reflect.getPrototypeOf({}))throw new s("Attempting to mutate Object.prototype");if(!d[m]){var T=Number.isInteger(Number(w[b+1])),v=w[b+1]==="+";d[m]=T||v?[]:{}}return c(w,b)&&(d[m]=f),d[m]})}catch(d){if(d instanceof s)throw d;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(f,d){return f[d]})}catch{return u}},has:function(u,l){var f=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 d=!1;return a(u,l,function(m,w,b,T){if(!c(b,T))return m&&m[w];d=f.own?m.hasOwnProperty(w):w in m}),d}catch{return!1}},hasOwn:function(u,l,f){return this.has(u,l,f||{own:!0})},isIn:function(u,l,f){var d=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(b,T,v,g){return m=m||b===f||!!b&&b[T]===f,w=c(v,g)&&t(b)==="object"&&T in b,b&&b[T]}),d.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 f=[],d=0;d<u.length;d++){var m=u[d];m&&m!=="."&&(m===".."?f.length&&f[f.length-1]!==".."?f.pop():l&&f.push(".."):f.push(m))}return f}var s=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a={};function c(u){return s.exec(u).slice(1)}a.resolve=function(){for(var u="",l=!1,f=arguments.length-1;f>=-1&&!l;f--){var d=f>=0?arguments[f]:be.cwd();if(!o(d))throw new TypeError("Arguments to path.resolve must be strings");d&&(u=d+"/"+u,l=d.charAt(0)==="/")}return(l?"/":"")+(u=i(u.split("/"),!l).join("/"))||"."},a.normalize=function(u){var l=a.isAbsolute(u),f=u.substr(-1)==="/";return(u=i(u.split("/"),!l).join("/"))||l||(u="."),u&&f&&(u+="/"),(l?"/":"")+u},a.isAbsolute=function(u){return u.charAt(0)==="/"},a.join=function(){for(var u="",l=0;l<arguments.length;l++){var f=arguments[l];if(!o(f))throw new TypeError("Arguments to path.join must be strings");f&&(u+=u?"/"+f:f)}return a.normalize(u)},a.relative=function(u,l){function f(g){for(var h=0;h<g.length&&g[h]==="";h++);for(var y=g.length-1;y>=0&&g[y]==="";y--);return h>y?[]:g.slice(h,y+1)}u=a.resolve(u).substr(1),l=a.resolve(l).substr(1);for(var d=f(u.split("/")),m=f(l.split("/")),w=Math.min(d.length,m.length),b=w,T=0;T<w;T++)if(d[T]!==m[T]){b=T;break}var v=[];for(T=b;T<d.length;T++)v.push("..");return(v=v.concat(m.slice(b))).join("/")},a._makeLong=function(u){return u},a.dirname=function(u){var l=c(u),f=l[0],d=l[1];return f||d?(d&&(d=d.substr(0,d.length-1)),f+d):"."},a.basename=function(u,l){var f=c(u)[2];return l&&f.substr(-1*l.length)===l&&(f=f.substr(0,f.length-l.length)),f},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 f=((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 d=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||d?i.eNotation?m:o:s.indexOf(".")!==-1?w==="0"&&f===""||w===f||u&&w==="-"+f?m:o:l?f===w||u+f===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 f(g){return(g||"").toString().replace(i,"")}var d=[["#","hash"],["?","query"],function(g,h){return b(h.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 h,y=(typeof window<"u"?window:typeof Fr<"u"?Fr:typeof self<"u"?self:{}).location||{},S={},E=typeof(g=g||y);if(g.protocol==="blob:")S=new v(unescape(g.pathname),{});else if(E==="string")for(h in S=new v(g,{}),m)delete S[h];else if(E==="object"){for(h in g)h in m||(S[h]=g[h]);S.slashes===void 0&&(S.slashes=a.test(g.href))}return S}function b(g){return g==="file:"||g==="ftp:"||g==="http:"||g==="https:"||g==="ws:"||g==="wss:"}function T(g,h){g=(g=f(g)).replace(s,""),h=h||{};var y,S=u.exec(g),E=S[1]?S[1].toLowerCase():"",R=!!S[2],I=!!S[3],A=0;return R?I?(y=S[2]+S[3]+S[4],A=S[2].length+S[3].length):(y=S[2]+S[4],A=S[2].length):I?(y=S[3]+S[4],A=S[3].length):y=S[4],E==="file:"?A>=2&&(y=y.slice(2)):b(E)?y=S[4]:E?R&&(y=y.slice(2)):A>=2&&b(h.protocol)&&(y=S[4]),{protocol:E,slashes:R||b(E),slashesCount:A,rest:y}}function v(g,h,y){if(g=(g=f(g)).replace(s,""),!(this instanceof v))return new v(g,h,y);var S,E,R,I,A,$,D=d.slice(),k=typeof h,N=this,z=0;for(k!=="object"&&k!=="string"&&(y=h,h=null),y&&typeof y!="function"&&(y=o.parse),S=!(E=T(g||"",h=w(h))).protocol&&!E.slashes,N.slashes=E.slashes||S&&h.slashes,N.protocol=E.protocol||h.protocol||"",g=E.rest,(E.protocol==="file:"&&(E.slashesCount!==2||l.test(g))||!E.slashes&&(E.protocol||E.slashesCount<2||!b(N.protocol)))&&(D[3]=[/(.*)/,"pathname"]);z<D.length;z++)typeof(I=D[z])!="function"?(R=I[0],$=I[1],R!=R?N[$]=g:typeof R=="string"?~(A=R==="@"?g.lastIndexOf(R):g.indexOf(R))&&(typeof I[2]=="number"?(N[$]=g.slice(0,A),g=g.slice(A+I[2])):(N[$]=g.slice(A),g=g.slice(0,A))):(A=R.exec(g))&&(N[$]=A[1],g=g.slice(0,A.index)),N[$]=N[$]||S&&I[3]&&h[$]||"",I[4]&&(N[$]=N[$].toLowerCase())):g=I(g,N);y&&(N.query=y(N.query)),S&&h.slashes&&N.pathname.charAt(0)!=="/"&&(N.pathname!==""||h.pathname!=="")&&(N.pathname=function(G,X){if(G==="")return X;for(var se=(X||"/").split("/").slice(0,-1).concat(G.split("/")),ne=se.length,oe=se[ne-1],fe=!1,we=0;ne--;)se[ne]==="."?se.splice(ne,1):se[ne]===".."?(se.splice(ne,1),we++):we&&(ne===0&&(fe=!0),se.splice(ne,1),we--);return fe&&se.unshift(""),oe!=="."&&oe!==".."||se.push(""),se.join("/")}(N.pathname,h.pathname)),N.pathname.charAt(0)!=="/"&&b(N.protocol)&&(N.pathname="/"+N.pathname),r(N.port,N.protocol)||(N.host=N.hostname,N.port=""),N.username=N.password="",N.auth&&(~(A=N.auth.indexOf(":"))?(N.username=N.auth.slice(0,A),N.username=encodeURIComponent(decodeURIComponent(N.username)),N.password=N.auth.slice(A+1),N.password=encodeURIComponent(decodeURIComponent(N.password))):N.username=encodeURIComponent(decodeURIComponent(N.auth)),N.auth=N.password?N.username+":"+N.password:N.username),N.origin=N.protocol!=="file:"&&b(N.protocol)&&N.host?N.protocol+"//"+N.host:"null",N.href=N.toString()}v.prototype={set:function(g,h,y){var S=this;switch(g){case"query":typeof h=="string"&&h.length&&(h=(y||o.parse)(h)),S[g]=h;break;case"port":S[g]=h,r(h,S.protocol)?h&&(S.host=S.hostname+":"+h):(S.host=S.hostname,S[g]="");break;case"hostname":S[g]=h,S.port&&(h+=":"+S.port),S.host=h;break;case"host":S[g]=h,c.test(h)?(h=h.split(":"),S.port=h.pop(),S.hostname=h.join(":")):(S.hostname=h,S.port="");break;case"protocol":S.protocol=h.toLowerCase(),S.slashes=!y;break;case"pathname":case"hash":if(h){var E=g==="pathname"?"/":"#";S[g]=h.charAt(0)!==E?E+h:h}else S[g]=h;break;case"username":case"password":S[g]=encodeURIComponent(h);break;case"auth":var R=h.indexOf(":");~R?(S.username=h.slice(0,R),S.username=encodeURIComponent(decodeURIComponent(S.username)),S.password=h.slice(R+1),S.password=encodeURIComponent(decodeURIComponent(S.password))):S.username=encodeURIComponent(decodeURIComponent(h))}for(var I=0;I<d.length;I++){var A=d[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:"&&b(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 h,y=this,S=y.host,E=y.protocol;E&&E.charAt(E.length-1)!==":"&&(E+=":");var R=E+(y.protocol&&y.slashes||b(y.protocol)?"//":"");return y.username?(R+=y.username,y.password&&(R+=":"+y.password),R+="@"):y.password?(R+=":"+y.password,R+="@"):y.protocol!=="file:"&&b(y.protocol)&&!S&&y.pathname!=="/"&&(R+="@"),(S[S.length-1]===":"||c.test(y.hostname)&&!y.port)&&(S+=":"),R+=S+y.pathname,(h=typeof y.query=="object"?g(y.query):y.query)&&(R+=h.charAt(0)!=="?"?"?"+h:h),y.hash&&(R+=y.hash),R}},v.extractProtocol=T,v.location=w,v.trimLeft=f,v.qs=o,e.exports=v},410:()=>{},388:()=>{},805:()=>{},345:()=>{},800:()=>{}},Um={};function pt(e){var t=Um[e];if(t!==void 0)return t.exports;var n=Um[e]={id:e,loaded:!1,exports:{}};return vR[e].call(n.exports,n,n.exports,pt),n.loaded=!0,n.exports}pt.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return pt.d(t,{a:t}),t},pt.d=(e,t)=>{for(var n in t)pt.o(t,n)&&!pt.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},pt.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),pt.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var Dn={};pt.d(Dn,{hT:()=>mn,O4:()=>br,Kd:()=>CR,YK:()=>FR,UU:()=>$_,Gu:()=>Jm,ky:()=>hy,h4:()=>bo,ch:()=>Ns,hq:()=>Zr,i5:()=>gy});var wR=pt(737),SR=pt.n(wR);function Cu(e){if(!Fu(e))throw new Error("Parameter was not an error")}function Fu(e){return!!e&&typeof e=="object"&&(t=e,Object.prototype.toString.call(t)==="[object Error]")||e instanceof Error;var t}class gn extends Error{constructor(t,n){const r=[...arguments],{options:o,shortMessage:i}=function(a){let c,u="";if(a.length===0)c={};else if(Fu(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 Cu(t),t._cause&&Fu(t._cause)?t._cause:null}static fullStack(t){Cu(t);const n=gn.cause(t);return n?`${t.stack}
42
+ caused by: ${gn.fullStack(n)}`:t.stack??""}static info(t){Cu(t);const n={},r=gn.cause(t);return r&&Object.assign(n,gn.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 ER=pt(47),_s=pt.n(ER);const qm="__PATH_SEPARATOR_POSIX__",Vm="__PATH_SEPARATOR_WINDOWS__";function It(e){try{const t=e.replace(/\//g,qm).replace(/\\\\/g,Vm);return encodeURIComponent(t).split(Vm).join("\\\\").split(qm).join("/")}catch(t){throw new gn(t,"Failed encoding path")}}function zm(e){return e.startsWith("/")?e:"/"+e}function ho(e){let t=e;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function TR(e){let t=new(SR())(e).pathname;return t.length<=0&&(t="/"),ho(t)}function Ct(){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 AR=pt(542),go=pt.n(AR);const RR="abcdef0123456789";function Wm(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(d,m,w,b,T,v,g){const h=g||go()(`${m}:${w}:${b}`);return d&&d.toLowerCase()==="md5-sess"?go()(`${h}:${T}:${v}`):h}(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),c=go()(`${o}:${r}`),u=i?go()(`${a}:${t.nonce}:${s}:${t.cnonce}:${i}:${c}`):go()(`${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},f=[];for(const d in l)l[d]&&(d==="qop"||d==="nc"||d==="algorithm"?f.push(`${d}=${l[d]}`):f.push(`${d}="${l[d]}"`));return`Digest ${f.join(", ")}`}function Hm(e){return(e.headers&&e.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var _R=pt(101),Gm=pt.n(_R);function Km(e){return Gm().decode(e)}function Qm(e,t){var n;return`Basic ${n=`${e}:${t}`,Gm().encode(n)}`}const Is=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,IR=Is.fetch.bind(Is),CR=Is.Request,FR=Is.Response;let mn=function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e}({}),br=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 Xm(e,t,n,r,o){switch(e.authType){case mn.Auto:t&&n&&(e.headers.Authorization=Qm(t,n));break;case mn.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 mn.None:break;case mn.Password:e.headers.Authorization=Qm(t,n);break;case mn.Token:e.headers.Authorization=`${(i=r).token_type} ${i.access_token}`;break;default:throw new gn({info:{code:br.InvalidAuthType}},`Invalid auth type: ${e.authType}`)}var i}pt(345),pt(800);const Ym="@@HOTPATCHER",PR=()=>{};function Pu(e){return{original:e,methods:[e],final:!1}}class OR{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=Ym}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__!==Ym)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)||PR;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]=Pu(n);else if(this.isPatched(t)){const{original:i}=this.configuration.registry[t];this.configuration.registry[t]=Object.assign(Pu(n),{original:i})}else this.configuration.registry[t]=Pu(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 Ou=null;function Jm(){return Ou||(Ou=new OR),Ou}function Cs(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 Zm(){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?ey(r,i):Cs(i)}return r}function ey(e,t){const n=Cs(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]?ey(n[r],t[r]):Cs(t[r]):n[r]=t[r]:n[r]=t[r]}),n}function xR(e){const t={};for(const n of e.keys())t[n]=e.get(n);return t}function xu(){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),{})}pt(805);const kR=typeof ArrayBuffer=="function",{toString:NR}=Object.prototype;function ty(e){return kR&&(e instanceof ArrayBuffer||NR.call(e)==="[object ArrayBuffer]")}function ny(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function ku(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 Nu(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const ry=ku(function(e){const t=e._digest;return delete e._digest,t.hasDigestAuth&&(e=Zm(e,{headers:{Authorization:Wm(e,t)}})),Nu(Fs(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(!Hm(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}${RR[Math.floor(16*Math.random())]}`;return u}(),!0}(n,t),function(){if(t.hasDigestAuth)return Nu(Fs(e=Zm(e,{headers:{Authorization:Wm(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})}),$R=ku(function(e,t){return Nu(Fs(e),function(n){return n.ok?(t.authType=mn.Password,n):n.status==401&&Hm(n)?(t.authType=mn.Digest,Xm(t,t.username,t.password,void 0,void 0),e._digest=t.digest,ry(e)):n})}),zt=ku(function(e,t){return t.authType===mn.Auto?$R(e,t):e._digest?ry(e):Fs(e)});function Wt(e,t,n){const r=Cs(e);return r.headers=xu(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 Fs(e){const t=Jm();return t.patchInline("request",n=>t.patchInline("fetch",IR,n.url,function(r){let o={};const i={method:r.method};if(r.headers&&(o=xu(o,r.headers)),r.data!==void 0){const[s,a]=function(c){if(typeof c=="string")return[c,{}];if(ny(c))return[c,{}];if(ty(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=xu(o,a)}return r.signal&&(i.signal=r.signal),r.withCredentials&&(i.credentials="include"),i.headers=o,i}(n)),e)}var DR=pt(285);const Ps=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},LR={"[: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]},mo=e=>e.replace(/[[\]\\-]/g,"\\$&"),iy=e=>e.join(""),MR=(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,f="";e:for(;i<e.length;){const b=e.charAt(i);if(b!=="!"&&b!=="^"||i!==n+1){if(b==="]"&&s&&!c){l=i+1;break}if(s=!0,b!=="\\"||c){if(b==="["&&!c){for(const[T,[v,g,h]]of Object.entries(LR))if(e.startsWith(T,i)){if(f)return["$.",!1,e.length-n,!0];i+=T.length,h?o.push(v):r.push(v),a=a||g;continue e}}c=!1,f?(b>f?r.push(mo(f)+"-"+mo(b)):b===f&&r.push(mo(b)),f="",i++):e.startsWith("-]",i+1)?(r.push(mo(b+"-")),i+=2):e.startsWith("-",i+1)?(f=b,i+=2):(r.push(mo(b)),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[(d=r[0].length===2?r[0].slice(-1):r[0],d.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,l-n,!1];var d;const m="["+(u?"^":"")+iy(r)+"]",w="["+(u?"":"^")+iy(o)+"]";return[r.length&&o.length?"("+m+"|"+w+")":r.length?m:w,a,l-n,!0]},yo=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")},BR=new Set(["!","?","+","*","@"]),oy=e=>BR.has(e),$u="(?!\\.)",jR=new Set(["[","."]),UR=new Set(["..","."]),qR=new Set("().*{}+?[]^$\\!"),Du="[^/]",sy=Du+"*?",ay=Du+"+?",vn=class vn{constructor(t,n){Tn(this,di);Ee(this,"type");Tn(this,Kt);Tn(this,tn);Tn(this,Ar,!1);Tn(this,Rt,[]);Tn(this,Ut);Tn(this,xr);Tn(this,ui);Tn(this,kr,!1);Tn(this,nr);Tn(this,fi);Tn(this,xo,!1);let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&$t(this,tn,!0),$t(this,Ut,n),$t(this,Kt,xe(this,Ut)?xe(xe(this,Ut),Kt):this),$t(this,nr,xe(this,Kt)===this?r:xe(xe(this,Kt),nr)),$t(this,ui,xe(this,Kt)===this?[]:xe(xe(this,Kt),ui)),t!=="!"||xe(xe(this,Kt),kr)||xe(this,ui).push(this),$t(this,xr,xe(this,Ut)?xe(xe(this,Ut),Rt).length:0)}get hasMagic(){if(xe(this,tn)!==void 0)return xe(this,tn);for(const t of xe(this,Rt))if(typeof t!="string"&&(t.type||t.hasMagic))return $t(this,tn,!0);return xe(this,tn)}toString(){return xe(this,fi)!==void 0?xe(this,fi):this.type?$t(this,fi,this.type+"("+xe(this,Rt).map(t=>String(t)).join("|")+")"):$t(this,fi,xe(this,Rt).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 vn&&xe(o,Ut)===this))throw new Error("invalid part: "+o);xe(this,Rt).push(o)}}toJSON(){var n;const t=this.type===null?xe(this,Rt).slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...xe(this,Rt).map(r=>r.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===xe(this,Kt)||xe(xe(this,Kt),kr)&&((n=xe(this,Ut))==null?void 0:n.type)==="!")&&t.push({}),t}isStart(){var n;if(xe(this,Kt)===this)return!0;if(!((n=xe(this,Ut))!=null&&n.isStart()))return!1;if(xe(this,xr)===0)return!0;const t=xe(this,Ut);for(let r=0;r<xe(this,xr);r++){const o=xe(t,Rt)[r];if(!(o instanceof vn&&o.type==="!"))return!1}return!0}isEnd(){var n,r,o;if(xe(this,Kt)===this||((n=xe(this,Ut))==null?void 0:n.type)==="!")return!0;if(!((r=xe(this,Ut))!=null&&r.isEnd()))return!1;if(!this.type)return(o=xe(this,Ut))==null?void 0:o.isEnd();const t=xe(this,Ut)?xe(xe(this,Ut),Rt).length:0;return xe(this,xr)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const n=new vn(this.type,t);for(const r of xe(this,Rt))n.copyIn(r);return n}static fromGlob(t){var o;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=new vn(null,void 0,n);return Dr(o=vn,Nr,ha).call(o,t,r,0,n),r}toMMPattern(){if(this!==xe(this,Kt))return xe(this,Kt).toMMPattern();const t=this.toString(),[n,r,o,i]=this.toRegExpSource();if(!(o||xe(this,tn)||xe(this,nr).nocase&&!xe(this,nr).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;const s=(xe(this,nr).nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${n}$`,s),{_src:n,_glob:t})}get options(){return xe(this,nr)}toRegExpSource(t){var c;const n=t??!!xe(this,nr).dot;if(xe(this,Kt)===this&&Dr(this,di,T0).call(this),!this.type){const u=this.isStart()&&this.isEnd(),l=xe(this,Rt).map(m=>{var g;const[w,b,T,v]=typeof m=="string"?Dr(g=vn,Nr,A0).call(g,m,xe(this,tn),u):m.toRegExpSource(t);return $t(this,tn,xe(this,tn)||T),$t(this,Ar,xe(this,Ar)||v),w}).join("");let f="";if(this.isStart()&&typeof xe(this,Rt)[0]=="string"&&(xe(this,Rt).length!==1||!UR.has(xe(this,Rt)[0]))){const m=jR,w=n&&m.has(l.charAt(0))||l.startsWith("\\.")&&m.has(l.charAt(2))||l.startsWith("\\.\\.")&&m.has(l.charAt(4)),b=!n&&!t&&m.has(l.charAt(0));f=w?"(?!(?:^|/)\\.\\.?(?:$|/))":b?$u:""}let d="";return this.isEnd()&&xe(xe(this,Kt),kr)&&((c=xe(this,Ut))==null?void 0:c.type)==="!"&&(d="(?:$|\\/)"),[f+l+d,yo(l),$t(this,tn,!!xe(this,tn)),xe(this,Ar)]}const r=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:";let i=Dr(this,di,Xf).call(this,n);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){const u=this.toString();return $t(this,Rt,[u]),this.type=null,$t(this,tn,void 0),[u,yo(this.toString()),!1,!1]}let s=!r||t||n?"":Dr(this,di,Xf).call(this,!0);s===i&&(s=""),s&&(i=`(?:${i})(?:${s})*?`);let a="";return a=this.type==="!"&&xe(this,xo)?(this.isStart()&&!n?$u:"")+ay:o+i+(this.type==="!"?"))"+(!this.isStart()||n||t?"":$u)+sy+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`),[a,yo(i),$t(this,tn,!!xe(this,tn)),xe(this,Ar)]}};Kt=new WeakMap,tn=new WeakMap,Ar=new WeakMap,Rt=new WeakMap,Ut=new WeakMap,xr=new WeakMap,ui=new WeakMap,kr=new WeakMap,nr=new WeakMap,fi=new WeakMap,xo=new WeakMap,di=new WeakSet,T0=function(){if(this!==xe(this,Kt))throw new Error("should only call on root");if(xe(this,kr))return this;let t;for(this.toString(),$t(this,kr,!0);t=xe(this,ui).pop();){if(t.type!=="!")continue;let n=t,r=xe(n,Ut);for(;r;){for(let o=xe(n,xr)+1;!r.type&&o<xe(r,Rt).length;o++)for(const i of xe(t,Rt)){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(xe(r,Rt)[o])}n=r,r=xe(n,Ut)}}return this},Nr=new WeakSet,ha=function(t,n,r,o){var m,w;let i=!1,s=!1,a=-1,c=!1;if(n.type===null){let b=r,T="";for(;b<t.length;){const v=t.charAt(b++);if(i||v==="\\")i=!i,T+=v;else if(s)b===a+1?v!=="^"&&v!=="!"||(c=!0):v!=="]"||b===a+2&&c||(s=!1),T+=v;else if(v!=="[")if(o.noext||!oy(v)||t.charAt(b)!=="(")T+=v;else{n.push(T),T="";const g=new vn(v,n);b=Dr(m=vn,Nr,ha).call(m,t,g,b,o),n.push(g)}else s=!0,a=b,c=!1,T+=v}return n.push(T),b}let u=r+1,l=new vn(null,n);const f=[];let d="";for(;u<t.length;){const b=t.charAt(u++);if(i||b==="\\")i=!i,d+=b;else if(s)u===a+1?b!=="^"&&b!=="!"||(c=!0):b!=="]"||u===a+2&&c||(s=!1),d+=b;else if(b!=="[")if(oy(b)&&t.charAt(u)==="("){l.push(d),d="";const T=new vn(b,l);l.push(T),u=Dr(w=vn,Nr,ha).call(w,t,T,u,o)}else if(b!=="|"){if(b===")")return d===""&&xe(n,Rt).length===0&&$t(n,xo,!0),l.push(d),d="",n.push(...f,l),u;d+=b}else l.push(d),d="",f.push(l),l=new vn(null,n);else s=!0,a=u,c=!1,d+=b}return n.type=null,$t(n,tn,void 0),$t(n,Rt,[t.substring(r-1)]),u},Xf=function(t){return xe(this,Rt).map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");const[r,o,i,s]=n.toRegExpSource(t);return $t(this,Ar,xe(this,Ar)||s),r}).filter(n=>!(this.isStart()&&this.isEnd()&&!n)).join("|")},A0=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,f,d]=MR(t,a);if(f){i+=u,s=s||l,a+=f-1,n=n||d;continue}}c!=="*"?c!=="?"?i+=c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(i+=Du,n=!0):(i+=r&&t==="*"?ay:sy,n=!0)}else a===t.length-1?i+="\\\\":o=!0}return[i,yo(t),!!n,s]},Tn(vn,Nr);let Os=vn;const an=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Ps(t),!(!n.nocomment&&t.charAt(0)==="#")&&new xs(t,n).match(e)},VR=/^\*+([^+@!?\*\[\(]*)$/,zR=e=>t=>!t.startsWith(".")&&t.endsWith(e),WR=e=>t=>t.endsWith(e),HR=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),GR=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),KR=/^\*+\.\*+$/,QR=e=>!e.startsWith(".")&&e.includes("."),XR=e=>e!=="."&&e!==".."&&e.includes("."),YR=/^\.\*+$/,JR=e=>e!=="."&&e!==".."&&e.startsWith("."),ZR=/^\*+$/,e_=e=>e.length!==0&&!e.startsWith("."),t_=e=>e.length!==0&&e!=="."&&e!=="..",n_=/^\?+([^+@!?\*\[\(]*)?$/,r_=e=>{let[t,n=""]=e;const r=ly([t]);return n?(n=n.toLowerCase(),o=>r(o)&&o.toLowerCase().endsWith(n)):r},i_=e=>{let[t,n=""]=e;const r=cy([t]);return n?(n=n.toLowerCase(),o=>r(o)&&o.toLowerCase().endsWith(n)):r},o_=e=>{let[t,n=""]=e;const r=cy([t]);return n?o=>r(o)&&o.endsWith(n):r},s_=e=>{let[t,n=""]=e;const r=ly([t]);return n?o=>r(o)&&o.endsWith(n):r},ly=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&!r.startsWith(".")},cy=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&r!=="."&&r!==".."},uy=typeof be=="object"&&be?typeof be.env=="object"&&be.env&&be.env.__MINIMATCH_TESTING_PLATFORM__||be.platform:"posix";an.sep=uy==="win32"?"\\":"/";const Ln=Symbol("globstar **");an.GLOBSTAR=Ln,an.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>an(n,e,t)};const Mn=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};an.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return an;const t=an;return Object.assign(function(n,r){return t(n,r,Mn(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))},{Minimatch:class extends t.Minimatch{constructor(n){super(n,Mn(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(n){return t.defaults(Mn(e,n)).Minimatch}},AST:class extends t.AST{constructor(n,r){super(n,r,Mn(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,Mn(e,r))}},unescape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(n,Mn(e,r))},escape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(n,Mn(e,r))},filter:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(n,Mn(e,r))},defaults:n=>t.defaults(Mn(e,n)),makeRe:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(n,Mn(e,r))},braceExpand:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(n,Mn(e,r))},match:function(n,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(n,r,Mn(e,o))},sep:t.sep,GLOBSTAR:Ln})};const fy=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ps(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:DR(e)};an.braceExpand=fy,an.makeRe=function(e){return new xs(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},an.match=function(e,t){const n=new xs(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 dy=/[?*]|[+@!]\(.*?\)|\[|\]/;class xs{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]:{};Ps(t),n=n||{},this.options=n,this.pattern=t,this.platform=n.platform||uy,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const n of t)if(typeof n!="string")return!0;return!1}debug(){}make(){const t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#")return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=function(){return console.error(...arguments)}),this.debug(this.pattern,this.globSet);const r=this.globSet.map(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]!=="?"&&dy.test(i[2])||dy.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 b=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),T=!b&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),v=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),g=T?3:b?0:void 0,h=!v&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])?3:v?0:void 0;if(typeof g=="number"&&typeof h=="number"){const[y,S]=[t[g],n[h]];y.toLowerCase()===S.toLowerCase()&&(n[h]=y,h>g?n=n.slice(h):g>h&&(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],f=t[s];if(this.debug(n,l,f),l===!1)return!1;if(l===Ln){this.debug("GLOBSTAR",[n,l,f]);var d=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(;d<c;){var w=t[d];if(this.debug(`
43
43
  globstar while`,t,d,n,m,w),this.matchOne(t.slice(d),n.slice(m),r))return this.debug("globstar found match!",d,c,w),!0;if(w==="."||w===".."||!o.dot&&w.charAt(0)==="."){this.debug("dot detected!",t,d,n,m);break}this.debug("globstar swallow a segment, and continue"),d++}return!(!r||(this.debug(`
44
- >>> no match, partial?`,t,d,n,m),d!==c))}let v;if(typeof l=="string"?(v=f===l,this.debug("string match",l,f,v)):(v=l.test(f),this.debug("pattern match",l,f,v)),!v)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 uy(this.pattern,this.options)}parse(t){Fs(t);const n=this.options;if(t==="**")return Ln;if(t==="")return"";let r,o=null;(r=t.match(JR))?o=n.dot?e_:ZR:(r=t.match(qR))?o=(n.nocase?n.dot?HR:WR:n.dot?zR:VR)(r[1]):(r=t.match(t_))?o=(n.nocase?n.dot?r_:n_:n.dot?i_:o_)(r):(r=t.match(GR))?o=n.dot?QR:KR:(r=t.match(XR))&&(o=YR);const i=Os.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 f of l.flags.split(""))o.add(f);return typeof l=="string"?l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):l===Ln?Ln:l._src});return u.forEach((l,f)=>{const d=u[f+1],m=u[f-1];l===Ln&&m!==Ln&&(m===void 0?d!==void 0&&d!==Ln?u[f+1]="(?:\\/|"+r+"\\/)?"+d:u[f]=r:d===void 0?u[f-1]=m+"(?:\\/|"+r+")?":d!==Ln&&(u[f-1]=m+"(?:\\/|\\/"+r+"\\/)"+d,u[f+1]=Ln))}),u.filter(l=>l!==Ln).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 an.defaults(t).Minimatch}}function Lu(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 Ht(e,t){const{status:n}=t;if(n===401&&e.digest)return t;if(n>=400)throw Lu(t);return t}function Zr(e,t){return arguments.length>2&&arguments[2]!==void 0&&arguments[2]?{data:t,headers:e.headers?OR(e.headers):{},status:e.status,statusText:e.statusText}:t}an.AST=Os,an.Minimatch=xs,an.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},an.unescape=yo;const s_=(dy=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=Wt({url:Ct(e.remoteURL,It(t)),method:"COPY",headers:{Destination:Ct(e.remoteURL,It(n)),Overwrite:r.overwrite===!1?"F":"T",Depth:r.shallow?"0":"infinity"}},e,r);return s=function(a){Ht(e,a)},(i=zt(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(dy.apply(this,e))}catch(n){return Promise.reject(n)}});var dy,Mu=pt(635),a_=pt(829),vr=pt.n(a_),Oi=function(e){return e.Array="array",e.Object="object",e.Original="original",e}(Oi||{});function ks(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Oi.Original;const r=vr().get(e,t);return n==="array"&&Array.isArray(r)===!1?[r]:n==="object"&&Array.isArray(r)?r[0]:r}function bo(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 vr().set(o,"multistatus.response",ks(o,"multistatus.response",Oi.Array)),vr().set(o,"multistatus.response",vr().get(o,"multistatus.response").map(i=>function(s){const a=Object.assign({},s);return a.status?vr().set(a,"status",ks(a,"status",Oi.Object)):(vr().set(a,"propstat",ks(a,"propstat",Oi.Object)),vr().set(a,"propstat.prop",ks(a,"propstat.prop",Oi.Object))),a}(i))),o}(new Mu.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 Ns(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:_s().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 py(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 Ns(o,ho(t),n)}function hy(e){switch(String(e)){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(String(e),10)}}function Bu(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const ju=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=Wt({url:Ct(e.remoteURL,It(t)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,n);return Bu(zt(o,e),function(i){return Ht(e,i),Bu(i.text(),function(s){return Bu(bo(s),function(a){const c=py(a,t,r);return Zr(i,c,r)})})})});function gy(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const l_=my(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=_s().dirname(s);while(s&&s!=="/");return a}(ho(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[by]=="function"){let v=function(T){try{for(;!(c=f.next()).done;)if((T=s(c.value))&&T.then){if(!vy(T))return void T.then(v,l||(l=yn.bind(null,u=new xi,2)));T=T.v}u?yn(u,1,T):u=T}catch(b){yn(u||(u=new xi),2,b)}};var c,u,l,f=i[by]();if(v(),f.return){var d=function(T){try{c.done||f.return()}catch{}return T};if(u&&u.then)return u.then(d,function(T){throw d(T)});d()}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(v,T,b){var g,h,y=-1;return function S(E){try{for(;++y<v.length&&(!b||!b());)if((E=T(y))&&E.then){if(!vy(E))return void E.then(S,h||(h=yn.bind(null,g=new xi,2)));E=E.v}g?yn(g,1,E):g=E}catch(R){yn(g||(g=new xi),2,R)}}(),g}(m,function(v){return s(m[v])},a)}(r,function(i){return s=function(){return function(c,u){try{var l=gy(ju(e,i),function(f){if(f.type!=="directory")throw new Error(`Path includes a file: ${t}`)})}catch(f){return u(f)}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,yy(Uu(e,i,{...n,recursive:!1}));throw c}()})},(a=function(){if(o)return yy(Uu(e,i,{...n,recursive:!1}))}())&&a.then?a.then(s):s();var s,a},function(){return!1})});function my(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 c_(){}function yy(e,t){return e&&e.then?e.then(c_):Promise.resolve()}const by=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function yn(e,t,n){if(!e.s){if(n instanceof xi){if(!n.s)return void(n.o=yn.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(yn.bind(null,e,t),yn.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const xi=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{yn(r,1,i(this.v))}catch(s){yn(r,2,s)}return r}return this}return this.o=function(i){try{const s=i.v;1&i.s?yn(r,1,t?t(s):s):n?yn(r,1,n(s)):yn(r,2,s)}catch(s){yn(r,2,s)}},r},e}();function vy(e){return e instanceof xi&&1&e.s}const Uu=my(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(n.recursive===!0)return l_(e,t,n);const r=Wt({url:Ct(e.remoteURL,(o=It(t),o.endsWith("/")?o:o+"/")),method:"MKCOL"},e,n);var o;return gy(zt(r,e),function(i){Ht(e,i)})});var u_=pt(388),wy=pt.n(u_);const f_=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=Wt({url:Ct(e.remoteURL,It(t)),method:"GET",headers:r},e,n);return s=function(a){if(Ht(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=zt(o,e))&&i.then||(i=Promise.resolve(i)),s?i.then(s):i;var i,s}),d_=()=>{},p_=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=Ct(e.remoteURL,It(t)));const r=Wt(n,e,{});return i=function(s){return Ht(e,s),s},(o=zt(r,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i}),h_=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=Wt({url:Ct(e.remoteURL,It(t)),method:"DELETE"},e,n);return i=function(s){Ht(e,s)},(o=zt(r,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i}),g_=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=ju(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 qu(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const m_=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=Wt({url:Ct(e.remoteURL,It(t),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:n.deep?"infinity":"1"}},e,n);return qu(zt(r,e),function(o){return Ht(e,o),qu(o.text(),function(i){if(!i)throw new Error("Failed parsing directory contents: Empty response");return qu(bo(i),function(s){const a=Vm(t);let c=function(u,l,f){let d=arguments.length>3&&arguments[3]!==void 0&&arguments[3],m=arguments.length>4&&arguments[4]!==void 0&&arguments[4];const w=_s().join(l,"/"),{multistatus:{response:v}}=u,T=v.map(b=>{const g=function(y){try{return y.replace(/^https?:\/\/[^\/]+/,"")}catch(S){throw new gn(S,"Failed normalising HREF")}}(b.href),{propstat:{prop:h}}=b;return Ns(h,w==="/"?decodeURIComponent(ho(g)):ho(_s().relative(decodeURIComponent(w),decodeURIComponent(g))),d)});return m?T:T.filter(b=>b.basename&&(b.type==="file"||b.filename!==f.replace(/\/$/,"")))}(s,Vm(e.remoteBasePath||e.remotePath),a,n.details,n.includeSelf);return n.glob&&(c=function(u,l){return u.filter(f=>an(f.filename,l,{matchBase:!0}))}(c,n.glob)),Zr(o,c,n.details)})})})});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)}}}const y_=Vu(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Wt({url:Ct(e.remoteURL,It(t)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[w_]},e,n);return $s(zt(r,e),function(o){return Ht(e,o),$s(o.text(),function(i){return Zr(o,i,n.details)})})});function $s(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const b_=Vu(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Wt({url:Ct(e.remoteURL,It(t)),method:"GET"},e,n);return $s(zt(r,e),function(o){let i;return Ht(e,o),function(s,a){var c=s();return c&&c.then?c.then(a):a()}(function(){return $s(o.arrayBuffer(),function(s){i=s})},function(){return Zr(o,i,n.details)})})}),v_=Vu(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 gn({info:{code:br.InvalidOutputFormat}},`Invalid output format: ${r}`);return r==="text"?y_(e,t,n):b_(e,t,n)}),w_=e=>e;function S_(e){return new Mu.XMLBuilder({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(Sy({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:e}}},"d"))}function Sy(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}`]=Sy(n[r],t),delete n[r]):/^@_/.test(r)===!1&&(n[`${t}:${r}`]=n[r],delete n[r]));return n}function zu(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Ey(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 E_=Ey(function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=Wt({url:Ct(e.remoteURL,It(t)),method:"UNLOCK",headers:{"Lock-Token":n}},e,r);return zu(zt(o,e),function(i){if(Ht(e,i),i.status!==204&&i.status!==200)throw Lu(i)})}),T_=Ey(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{refreshToken:r,timeout:o=A_}=n,i={Accept:"text/plain,application/xml",Timeout:o};r&&(i.If=r);const s=Wt({url:Ct(e.remoteURL,It(t)),method:"LOCK",headers:i,data:S_(e.contactHref)},e,n);return zu(zt(s,e),function(a){return Ht(e,a),zu(a.text(),function(c){const u=(d=c,new Mu.XMLParser({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(d)),l=vr().get(u,"prop.lockdiscovery.activelock.locktoken.href"),f=vr().get(u,"prop.lockdiscovery.activelock.timeout");var d;if(!l)throw Lu(a,"No lock token received: ");return{token:l,serverTimeout:f}})})}),A_="Infinite, Second-4100000000";function Wu(e,t,n){return n?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=[],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=Wt({url:Ct(e.remoteURL,n),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,t);return Wu(zt(r,e),function(o){return Ht(e,o),Wu(o.text(),function(i){return Wu(bo(i),function(s){const a=function(c){try{const[u]=c.multistatus.response,{propstat:{prop:{"quota-used-bytes":l,"quota-available-bytes":f}}}=u;return l!==void 0&&f!==void 0?{used:parseInt(String(l),10),available:hy(f)}:null}catch{}return null}(s);return Zr(o,a,t.details)})})})});function Hu(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const __=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=Wt({url:Ct(e.remoteURL,It(t)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":e.headers["Content-Type"]||"application/xml; charset=utf-8"}},e,n);return Hu(zt(o,e),function(i){return Ht(e,i),Hu(i.text(),function(s){return Hu(bo(s),function(a){const c=function(u,l,f){const d={truncated:!1,results:[]};return d.truncated=u.multistatus.response.some(m=>{var w,v;return((v=(m.status||((w=m.propstat)==null?void 0:w.status)).split(" ",3))==null?void 0:v[1])==="507"&&m.href.replace(/\/$/,"").endsWith(It(l).replace(/\/$/,""))}),u.multistatus.response.forEach(m=>{if(m.propstat===void 0)return;const w=m.href.split("/").map(decodeURIComponent).join("/");d.results.push(Ns(m.propstat.prop,w,f))}),d}(a,t,r);return Zr(i,c,r)})})})}),I_=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=Wt({url:Ct(e.remoteURL,It(t)),method:"MOVE",headers:{Destination:Ct(e.remoteURL,It(n)),Overwrite:r.overwrite===!1?"F":"T"}},e,r);return s=function(a){Ht(e,a)},(i=zt(o,e))&&i.then||(i=Promise.resolve(i)),s?i.then(s):i;var i,s});var C_=pt(172);const P_=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(ey(l))return l.byteLength;if(ty(l))return l.length;if(typeof l=="string")return(0,C_.d)(l);throw new gn({info:{code:br.DataTypeNoLength}},"Cannot calculate data length: Invalid type")}(n)}`),i||(s["If-None-Match"]="*");const a=Wt({url:Ct(e.remoteURL,It(t)),method:"PUT",headers:s,data:n},e,r);return u=function(l){try{Ht(e,l)}catch(f){const d=f;if(d.status!==412||i)throw d;return!1}return!0},(c=zt(a,e))&&c.then||(c=Promise.resolve(c)),u?c.then(u):c;var c,u}),Ty=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=Wt({url:Ct(e.remoteURL,It(t)),method:"OPTIONS"},e,n);return i=function(s){try{Ht(e,s)}catch(a){throw a}return{compliance:(s.headers.get("DAV")??"").split(",").map(a=>a.trim()),server:s.headers.get("Server")??""}},(o=zt(r,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i});function vo(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const F_=Gu(function(e,t,n,r,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new gn({info:{code:br.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=Wt({url:Ct(e.remoteURL,It(t)),method:"PUT",headers:s,data:o},e,i);return vo(zt(a,e),function(c){Ht(e,c)})});function Ay(e,t){var n=e();return n&&n.then?n.then(t):t(n)}const O_=Gu(function(e,t,n,r,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new gn({info:{code:br.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=Wt({url:Ct(e.remoteURL,It(t)),method:"PATCH",headers:s,data:o},e,i);return vo(zt(a,e),function(c){Ht(e,c)})});function Gu(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 x_=Gu(function(e,t,n,r,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};return vo(Ty(e,t,i),function(s){let a=!1;return Ay(function(){if(s.compliance.includes("sabredav-partialupdate"))return vo(O_(e,t,n,r,o,i),function(c){return a=!0,c})},function(c){let u=!1;return a?c:Ay(function(){if(s.server.includes("Apache")&&s.compliance.includes("<http://apache.org/dav/propset/fs/1>"))return vo(F_(e,t,n,r,o,i),function(l){return u=!0,l})},function(l){if(u)return l;throw new gn({info:{code:br.NotSupported}},"Not supported")})})})}),k_="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function N_(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{authType:n=null,remoteBasePath:r,contactHref:o=k_,ha1:i,headers:s={},httpAgent:a,httpsAgent:c,password:u,token:l,username:f,withCredentials:d}=t;let m=n;m||(m=f||u?mn.Password:mn.None);const w={authType:m,remoteBasePath:r,contactHref:o,ha1:i,headers:Object.assign({},s),httpAgent:a,httpsAgent:c,password:u,remotePath:ER(e),remoteURL:e,token:l,username:f,withCredentials:d};return Qm(w,f,u,l,i),{copyFile:(v,T,b)=>s_(w,v,T,b),createDirectory:(v,T)=>Uu(w,v,T),createReadStream:(v,T)=>function(b,g){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const y=new(wy()).PassThrough;return f_(b,g,h).then(S=>{S.pipe(y)}).catch(S=>{y.emit("error",S)}),y}(w,v,T),createWriteStream:(v,T,b)=>function(g,h){let y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},S=arguments.length>3&&arguments[3]!==void 0?arguments[3]:d_;const E=new(wy()).PassThrough,R={};y.overwrite===!1&&(R["If-None-Match"]="*");const I=Wt({url:Ct(g.remoteURL,It(h)),method:"PUT",headers:R,data:E,maxRedirects:0},g,y);return zt(I,g).then(A=>Ht(g,A)).then(A=>{setTimeout(()=>{S(A)},0)}).catch(A=>{E.emit("error",A)}),E}(w,v,T,b),customRequest:(v,T)=>p_(w,v,T),deleteFile:(v,T)=>h_(w,v,T),exists:(v,T)=>g_(w,v,T),getDirectoryContents:(v,T)=>m_(w,v,T),getFileContents:(v,T)=>v_(w,v,T),getFileDownloadLink:v=>function(T,b){let g=Ct(T.remoteURL,It(b));const h=/^https:/i.test(g)?"https":"http";switch(T.authType){case mn.None:break;case mn.Password:{const y=Gm(T.headers.Authorization.replace(/^Basic /i,"").trim());g=g.replace(/^https?:\/\//,`${h}://${y}@`);break}default:throw new gn({info:{code:br.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${T.authType}`)}return g}(w,v),getFileUploadLink:v=>function(T,b){let g=`${Ct(T.remoteURL,It(b))}?Content-Type=application/octet-stream`;const h=/^https:/i.test(g)?"https":"http";switch(T.authType){case mn.None:break;case mn.Password:{const y=Gm(T.headers.Authorization.replace(/^Basic /i,"").trim());g=g.replace(/^https?:\/\//,`${h}://${y}@`);break}default:throw new gn({info:{code:br.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${T.authType}`)}return g}(w,v),getHeaders:()=>Object.assign({},w.headers),getQuota:v=>R_(w,v),lock:(v,T)=>T_(w,v,T),moveFile:(v,T,b)=>I_(w,v,T,b),putFileContents:(v,T,b)=>P_(w,v,T,b),partialUpdateFileContents:(v,T,b,g,h)=>x_(w,v,T,b,g,h),getDAVCompliance:v=>Ty(w,v),search:(v,T)=>__(w,v,T),setHeaders:v=>{w.headers=Object.assign({},v)},stat:(v,T)=>ju(w,v,T),unlock:(v,T,b)=>E_(w,v,T,b)}}Dn.hT,Dn.O4,Dn.Kd,Dn.YK,Dn.UU,Dn.Gu,Dn.ky,Dn.h4,Dn.ch,Dn.hq,Dn.i5;var Ku={},Qu={},Ry;function Xu(){return Ry||(Ry=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 f=[];f.startIndex=c.lastIndex-l[0].length;const d=l.length;for(let m=0;m<d;m++)f.push(l[m]);u.push(f),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),f=l.length;for(let d=0;d<f;d++)u==="strict"?a[l[d]]=[c[l[d]]]:a[l[d]]=c[l[d]]}},e.getValue=function(a){return e.isExist(a)?a:""},e.isName=s,e.getAllMatches=i,e.nameRegexp=r}(Qu)),Qu}var _y;function Iy(){if(_y)return Ku;_y=1;const e=Xu(),t={allowBooleanAttributes:!1,unpairedTags:[]};Ku.validate=function(b,g){g=Object.assign({},t,g);const h=[];let y=!1,S=!1;b[0]==="\uFEFF"&&(b=b.substr(1));for(let E=0;E<b.length;E++)if(b[E]==="<"&&b[E+1]==="?"){if(E+=2,E=r(b,E),E.err)return E}else if(b[E]==="<"){let R=E;if(E++,b[E]==="!"){E=o(b,E);continue}else{let I=!1;b[E]==="/"&&(I=!0,E++);let A="";for(;E<b.length&&b[E]!==">"&&b[E]!==" "&&b[E]!==" "&&b[E]!==`
45
- `&&b[E]!=="\r";E++)A+=b[E];if(A=A.trim(),A[A.length-1]==="/"&&(A=A.substring(0,A.length-1),E--),!w(A)){let k;return A.trim().length===0?k="Invalid space after '<'.":k="Tag '"+A+"' is an invalid name.",d("InvalidTag",k,v(b,E))}const $=a(b,E);if($===!1)return d("InvalidAttr","Attributes for '"+A+"' have open quote.",v(b,E));let D=$.value;if(E=$.index,D[D.length-1]==="/"){const k=E-D.length;D=D.substring(0,D.length-1);const N=u(D,g);if(N===!0)y=!0;else return d(N.err.code,N.err.msg,v(b,k+N.err.line))}else if(I)if($.tagClosed){if(D.trim().length>0)return d("InvalidTag","Closing tag '"+A+"' can't have attributes or invalid starting.",v(b,R));if(h.length===0)return d("InvalidTag","Closing tag '"+A+"' has not been opened.",v(b,R));{const k=h.pop();if(A!==k.tagName){let N=v(b,k.tagStartPos);return d("InvalidTag","Expected closing tag '"+k.tagName+"' (opened in line "+N.line+", col "+N.col+") instead of closing tag '"+A+"'.",v(b,R))}h.length==0&&(S=!0)}}else return d("InvalidTag","Closing tag '"+A+"' doesn't have proper closing.",v(b,E));else{const k=u(D,g);if(k!==!0)return d(k.err.code,k.err.msg,v(b,E-D.length+k.err.line));if(S===!0)return d("InvalidXml","Multiple possible root nodes found.",v(b,E));g.unpairedTags.indexOf(A)!==-1||h.push({tagName:A,tagStartPos:R}),y=!0}for(E++;E<b.length;E++)if(b[E]==="<")if(b[E+1]==="!"){E++,E=o(b,E);continue}else if(b[E+1]==="?"){if(E=r(b,++E),E.err)return E}else break;else if(b[E]==="&"){const k=f(b,E);if(k==-1)return d("InvalidChar","char '&' is not expected.",v(b,E));E=k}else if(S===!0&&!n(b[E]))return d("InvalidXml","Extra text at the end",v(b,E));b[E]==="<"&&E--}}else{if(n(b[E]))continue;return d("InvalidChar","char '"+b[E]+"' is not expected.",v(b,E))}if(y){if(h.length==1)return d("InvalidTag","Unclosed tag '"+h[0].tagName+"'.",v(b,h[0].tagStartPos));if(h.length>0)return d("InvalidXml","Invalid '"+JSON.stringify(h.map(E=>E.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return d("InvalidXml","Start tag expected.",1);return!0};function n(b){return b===" "||b===" "||b===`
46
- `||b==="\r"}function r(b,g){const h=g;for(;g<b.length;g++)if(b[g]=="?"||b[g]==" "){const y=b.substr(h,g-h);if(g>5&&y==="xml")return d("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 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 h=1;for(g+=8;g<b.length;g++)if(b[g]==="<")h++;else if(b[g]===">"&&(h--,h===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 h="",y="",S=!1;for(;g<b.length;g++){if(b[g]===i||b[g]===s)y===""?y=b[g]:y!==b[g]||(y="");else if(b[g]===">"&&y===""){S=!0;break}h+=b[g]}return y!==""?!1:{value:h,index:g,tagClosed:S}}const c=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function u(b,g){const h=e.getAllMatches(b,c),y={};for(let S=0;S<h.length;S++){if(h[S][1].length===0)return d("InvalidAttr","Attribute '"+h[S][2]+"' has no space in starting.",T(h[S]));if(h[S][3]!==void 0&&h[S][4]===void 0)return d("InvalidAttr","Attribute '"+h[S][2]+"' is without value.",T(h[S]));if(h[S][3]===void 0&&!g.allowBooleanAttributes)return d("InvalidAttr","boolean attribute '"+h[S][2]+"' is not allowed.",T(h[S]));const E=h[S][2];if(!m(E))return d("InvalidAttr","Attribute '"+E+"' is an invalid name.",T(h[S]));if(!y.hasOwnProperty(E))y[E]=1;else return d("InvalidAttr","Attribute '"+E+"' is repeated.",T(h[S]))}return!0}function l(b,g){let h=/\d/;for(b[g]==="x"&&(g++,h=/[\da-fA-F]/);g<b.length;g++){if(b[g]===";")return g;if(!b[g].match(h))break}return-1}function f(b,g){if(g++,b[g]===";")return-1;if(b[g]==="#")return g++,l(b,g);let h=0;for(;g<b.length;g++,h++)if(!(b[g].match(/\w/)&&h<20)){if(b[g]===";")break;return-1}return g}function d(b,g,h){return{err:{code:b,msg:g,line:h.line||h,col:h.col}}}function m(b){return e.isName(b)}function w(b){return e.isName(b)}function v(b,g){const h=b.substring(0,g).split(/\r?\n/);return{line:h.length,col:h[h.length-1].length+1}}function T(b){return b.startIndex+b[1].length}return Ku}var Ds={},Cy;function $_(){if(Cy)return Ds;Cy=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 Ds.buildOptions=t,Ds.defaultOptions=e,Ds}var Yu,Py;function D_(){if(Py)return Yu;Py=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 Yu=e,Yu}var Ju,Fy;function L_(){if(Fy)return Ju;Fy=1;const e=Xu();function t(u,l){const f={};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 d=1,m=!1,w=!1,v="";for(;l<u.length;l++)if(u[l]==="<"&&!w){if(m&&o(u,l)){l+=7;let T,b;[T,b,l]=n(u,l+1),b.indexOf("&")===-1&&(f[c(T)]={regx:RegExp(`&${T};`,"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");d++,v=""}else if(u[l]===">"){if(w?u[l-1]==="-"&&u[l-2]==="-"&&(w=!1,d--):d--,d===0)break}else u[l]==="["?m=!0:v+=u[l];if(d!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:f,i:l}}function n(u,l){let f="";for(;l<u.length&&u[l]!=="'"&&u[l]!=='"';l++)f+=u[l];if(f=f.trim(),f.indexOf(" ")!==-1)throw new Error("External entites are not supported");const d=u[l++];let m="";for(;l<u.length&&u[l]!==d;l++)m+=u[l];return[f,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 Ju=t,Ju}var Zu,Oy;function M_(){if(Oy)return Zu;Oy=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;if(s==="0")return 0;let c=s.trim();if(a.skipLike!==void 0&&a.skipLike.test(c))return s;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],f=u[2];let d=o(u[3]);if(!a.leadingZeros&&f.length>0&&l&&c[2]!==".")return s;if(!a.leadingZeros&&f.length>0&&!l&&c[1]!==".")return s;if(a.leadingZeros&&f===s)return 0;{const m=Number(c),w=""+m;return w.search(/[eE]/)!==-1?a.eNotation?m:s:c.indexOf(".")!==-1?w==="0"&&d===""||w===d||l&&w==="-"+d?m:s:f?d===w||l+d===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 Zu=r,Zu}var ef,xy;function ky(){if(xy)return ef;xy=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 ef=e,ef}var tf,Ny;function B_(){if(Ny)return tf;Ny=1;const e=Xu(),t=D_(),n=L_(),r=M_(),o=ky();class i{constructor(E){this.options=E,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=f,this.parseTextData=a,this.resolveNameSpace=c,this.buildAttributesMap=l,this.isItStopNode=v,this.replaceEntitiesValue=m,this.readStopNodeData=h,this.saveTextToParentTag=w,this.addChild=d,this.ignoreAttributesFn=o(this.options.ignoreAttributes)}}function s(S){const E=Object.keys(S);for(let R=0;R<E.length;R++){const I=E[R];this.lastEntities[I]={regex:new RegExp("&"+I+";","g"),val:S[I]}}}function a(S,E,R,I,A,$,D){if(S!==void 0&&(this.options.trimValues&&!I&&(S=S.trim()),S.length>0)){D||(S=this.replaceEntitiesValue(S));const k=this.options.tagValueProcessor(E,S,R,A,$);return k==null?S:typeof k!=typeof S||k!==S?k:this.options.trimValues?y(S,this.options.parseTagValue,this.options.numberParseOptions):S.trim()===S?y(S,this.options.parseTagValue,this.options.numberParseOptions):S}}function c(S){if(this.options.removeNSPrefix){const E=S.split(":"),R=S.charAt(0)==="/"?"/":"";if(E[0]==="xmlns")return"";E.length===2&&(S=R+E[1])}return S}const u=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function l(S,E,R){if(this.options.ignoreAttributes!==!0&&typeof S=="string"){const I=e.getAllMatches(S,u),A=I.length,$={};for(let D=0;D<A;D++){const k=this.resolveNameSpace(I[D][1]);if(this.ignoreAttributesFn(k,E))continue;let N=I[D][4],j=this.options.attributeNamePrefix+k;if(k.length)if(this.options.transformAttributeName&&(j=this.options.transformAttributeName(j)),j==="__proto__"&&(j="#__proto__"),N!==void 0){this.options.trimValues&&(N=N.trim()),N=this.replaceEntitiesValue(N);const W=this.options.attributeValueProcessor(k,N,E);W==null?$[j]=N:typeof W!=typeof N||W!==N?$[j]=W:$[j]=y(N,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&($[j]=!0)}if(!Object.keys($).length)return;if(this.options.attributesGroupName){const D={};return D[this.options.attributesGroupName]=$,D}return $}}const f=function(S){S=S.replace(/\r\n?/g,`
47
- `);const E=new t("!xml");let R=E,I="",A="";for(let $=0;$<S.length;$++)if(S[$]==="<")if(S[$+1]==="/"){const k=b(S,">",$,"Closing Tag is not closed.");let N=S.substring($+2,k).trim();if(this.options.removeNSPrefix){const X=N.indexOf(":");X!==-1&&(N=N.substr(X+1))}this.options.transformTagName&&(N=this.options.transformTagName(N)),R&&(I=this.saveTextToParentTag(I,R,A));const j=A.substring(A.lastIndexOf(".")+1);if(N&&this.options.unpairedTags.indexOf(N)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${N}>`);let W=0;j&&this.options.unpairedTags.indexOf(j)!==-1?(W=A.lastIndexOf(".",A.lastIndexOf(".")-1),this.tagsNodeStack.pop()):W=A.lastIndexOf("."),A=A.substring(0,W),R=this.tagsNodeStack.pop(),I="",$=k}else if(S[$+1]==="?"){let k=g(S,$,!1,"?>");if(!k)throw new Error("Pi Tag is not closed.");if(I=this.saveTextToParentTag(I,R,A),!(this.options.ignoreDeclaration&&k.tagName==="?xml"||this.options.ignorePiTags)){const N=new t(k.tagName);N.add(this.options.textNodeName,""),k.tagName!==k.tagExp&&k.attrExpPresent&&(N[":@"]=this.buildAttributesMap(k.tagExp,A,k.tagName)),this.addChild(R,N,A)}$=k.closeIndex+1}else if(S.substr($+1,3)==="!--"){const k=b(S,"-->",$+4,"Comment is not closed.");if(this.options.commentPropName){const N=S.substring($+4,k-2);I=this.saveTextToParentTag(I,R,A),R.add(this.options.commentPropName,[{[this.options.textNodeName]:N}])}$=k}else if(S.substr($+1,2)==="!D"){const k=n(S,$);this.docTypeEntities=k.entities,$=k.i}else if(S.substr($+1,2)==="!["){const k=b(S,"]]>",$,"CDATA is not closed.")-2,N=S.substring($+9,k);I=this.saveTextToParentTag(I,R,A);let j=this.parseTextData(N,R.tagname,A,!0,!1,!0,!0);j==null&&(j=""),this.options.cdataPropName?R.add(this.options.cdataPropName,[{[this.options.textNodeName]:N}]):R.add(this.options.textNodeName,j),$=k+2}else{let k=g(S,$,this.options.removeNSPrefix),N=k.tagName;const j=k.rawTagName;let W=k.tagExp,X=k.attrExpPresent,ie=k.closeIndex;this.options.transformTagName&&(N=this.options.transformTagName(N)),R&&I&&R.tagname!=="!xml"&&(I=this.saveTextToParentTag(I,R,A,!1));const de=R;if(de&&this.options.unpairedTags.indexOf(de.tagname)!==-1&&(R=this.tagsNodeStack.pop(),A=A.substring(0,A.lastIndexOf("."))),N!==E.tagname&&(A+=A?"."+N:N),this.isItStopNode(this.options.stopNodes,A,N)){let se="";if(W.length>0&&W.lastIndexOf("/")===W.length-1)N[N.length-1]==="/"?(N=N.substr(0,N.length-1),A=A.substr(0,A.length-1),W=N):W=W.substr(0,W.length-1),$=k.closeIndex;else if(this.options.unpairedTags.indexOf(N)!==-1)$=k.closeIndex;else{const Se=this.readStopNodeData(S,j,ie+1);if(!Se)throw new Error(`Unexpected end of ${j}`);$=Se.i,se=Se.tagContent}const we=new t(N);N!==W&&X&&(we[":@"]=this.buildAttributesMap(W,A,N)),se&&(se=this.parseTextData(se,N,A,!0,X,!0,!0)),A=A.substr(0,A.lastIndexOf(".")),we.add(this.options.textNodeName,se),this.addChild(R,we,A)}else{if(W.length>0&&W.lastIndexOf("/")===W.length-1){N[N.length-1]==="/"?(N=N.substr(0,N.length-1),A=A.substr(0,A.length-1),W=N):W=W.substr(0,W.length-1),this.options.transformTagName&&(N=this.options.transformTagName(N));const se=new t(N);N!==W&&X&&(se[":@"]=this.buildAttributesMap(W,A,N)),this.addChild(R,se,A),A=A.substr(0,A.lastIndexOf("."))}else{const se=new t(N);this.tagsNodeStack.push(R),N!==W&&X&&(se[":@"]=this.buildAttributesMap(W,A,N)),this.addChild(R,se,A),R=se}I="",$=ie}}else I+=S[$];return E.child};function d(S,E,R){const I=this.options.updateTag(E.tagname,R,E[":@"]);I===!1||(typeof I=="string"&&(E.tagname=I),S.addChild(E))}const m=function(S){if(this.options.processEntities){for(let E in this.docTypeEntities){const R=this.docTypeEntities[E];S=S.replace(R.regx,R.val)}for(let E in this.lastEntities){const R=this.lastEntities[E];S=S.replace(R.regex,R.val)}if(this.options.htmlEntities)for(let E in this.htmlEntities){const R=this.htmlEntities[E];S=S.replace(R.regex,R.val)}S=S.replace(this.ampEntity.regex,this.ampEntity.val)}return S};function w(S,E,R,I){return S&&(I===void 0&&(I=E.child.length===0),S=this.parseTextData(S,E.tagname,R,!1,E[":@"]?Object.keys(E[":@"]).length!==0:!1,I),S!==void 0&&S!==""&&E.add(this.options.textNodeName,S),S=""),S}function v(S,E,R){const I="*."+R;for(const A in S){const $=S[A];if(I===$||E===$)return!0}return!1}function T(S,E,R=">"){let I,A="";for(let $=E;$<S.length;$++){let D=S[$];if(I)D===I&&(I="");else if(D==='"'||D==="'")I=D;else if(D===R[0])if(R[1]){if(S[$+1]===R[1])return{data:A,index:$}}else return{data:A,index:$};else D===" "&&(D=" ");A+=D}}function b(S,E,R,I){const A=S.indexOf(E,R);if(A===-1)throw new Error(I);return A+E.length-1}function g(S,E,R,I=">"){const A=T(S,E+1,I);if(!A)return;let $=A.data;const D=A.index,k=$.search(/\s/);let N=$,j=!0;k!==-1&&(N=$.substring(0,k),$=$.substring(k+1).trimStart());const W=N;if(R){const X=N.indexOf(":");X!==-1&&(N=N.substr(X+1),j=N!==A.data.substr(X+1))}return{tagName:N,tagExp:$,closeIndex:D,attrExpPresent:j,rawTagName:W}}function h(S,E,R){const I=R;let A=1;for(;R<S.length;R++)if(S[R]==="<")if(S[R+1]==="/"){const $=b(S,">",R,`${E} is not closed`);if(S.substring(R+2,$).trim()===E&&(A--,A===0))return{tagContent:S.substring(I,R),i:$};R=$}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 $=g(S,R,">");$&&(($&&$.tagName)===E&&$.tagExp[$.tagExp.length-1]!=="/"&&A++,R=$.closeIndex)}}function y(S,E,R){if(E&&typeof S=="string"){const I=S.trim();return I==="true"?!0:I==="false"?!1:r(S,R)}else return e.isExist(S)?S:""}return tf=i,tf}var nf={},$y;function j_(){if($y)return nf;$y=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 f=i[l],d=n(f);let m="";if(a===void 0?m=d:m=a+"."+d,d===s.textNodeName)c===void 0?c=f[d]:c+=""+f[d];else{if(d===void 0)continue;if(f[d]){let w=t(f[d],s,m);const v=o(w,s);f[":@"]?r(w,f[":@"],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[d]!==void 0&&u.hasOwnProperty(d)?(Array.isArray(u[d])||(u[d]=[u[d]]),u[d].push(w)):s.isArray(d,m,v)?u[d]=[w]:u[d]=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 f=0;f<l;f++){const d=u[f];c.isArray(d,a+"."+d,!0,!0)?i[d]=[s[d]]:i[d]=s[d]}}}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 nf.prettify=e,nf}var rf,Dy;function U_(){if(Dy)return rf;Dy=1;const{buildOptions:e}=$_(),t=B_(),{prettify:n}=j_(),r=Iy();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 rf=o,rf}var of,Ly;function q_(){if(Ly)return of;Ly=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 f="",d=!1;for(let m=0;m<a.length;m++){const w=a[m],v=r(w);if(v===void 0)continue;let T="";if(u.length===0?T=v:T=`${u}.${v}`,v===c.textNodeName){let S=w[v];i(T,c)||(S=c.tagValueProcessor(v,S),S=s(S,c)),d&&(f+=l),f+=S,d=!1;continue}else if(v===c.cdataPropName){d&&(f+=l),f+=`<![CDATA[${w[v][0][c.textNodeName]}]]>`,d=!1;continue}else if(v===c.commentPropName){f+=l+`<!--${w[v][0][c.textNodeName]}-->`,d=!0;continue}else if(v[0]==="?"){const S=o(w[":@"],c),E=v==="?xml"?"":l;let R=w[v][0][c.textNodeName];R=R.length!==0?" "+R:"",f+=E+`<${v}${R}${S}?>`,d=!0;continue}let b=l;b!==""&&(b+=c.indentBy);const g=o(w[":@"],c),h=l+`<${v}${g}`,y=n(w[v],c,T,b);c.unpairedTags.indexOf(v)!==-1?c.suppressUnpairedNode?f+=h+">":f+=h+"/>":(!y||y.length===0)&&c.suppressEmptyNode?f+=h+"/>":y&&y.endsWith(">")?f+=h+`>${y}${l}</${v}>`:(f+=h+">",y&&l!==""&&(y.includes("/>")||y.includes("</"))?f+=l+c.indentBy+y+l:f+=y,f+=`</${v}>`),d=!0}return f}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 f=c.attributeValueProcessor(l,a[l]);f=s(f,c),f===!0&&c.suppressBooleanAttributes?u+=` ${l.substr(c.attributeNamePrefix.length)}`:u+=` ${l.substr(c.attributeNamePrefix.length)}="${f}"`}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 of=t,of}var sf,My;function V_(){if(My)return sf;My=1;const e=q_(),t=ky(),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=`>
44
+ >>> no match, partial?`,t,d,n,m),d!==c))}let b;if(typeof l=="string"?(b=f===l,this.debug("string match",l,f,b)):(b=l.test(f),this.debug("pattern match",l,f,b)),!b)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 fy(this.pattern,this.options)}parse(t){Ps(t);const n=this.options;if(t==="**")return Ln;if(t==="")return"";let r,o=null;(r=t.match(ZR))?o=n.dot?t_:e_:(r=t.match(VR))?o=(n.nocase?n.dot?GR:HR:n.dot?WR:zR)(r[1]):(r=t.match(n_))?o=(n.nocase?n.dot?i_:r_:n.dot?o_:s_)(r):(r=t.match(KR))?o=n.dot?XR:QR:(r=t.match(YR))&&(o=JR);const i=Os.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 f of l.flags.split(""))o.add(f);return typeof l=="string"?l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):l===Ln?Ln:l._src});return u.forEach((l,f)=>{const d=u[f+1],m=u[f-1];l===Ln&&m!==Ln&&(m===void 0?d!==void 0&&d!==Ln?u[f+1]="(?:\\/|"+r+"\\/)?"+d:u[f]=r:d===void 0?u[f-1]=m+"(?:\\/|"+r+")?":d!==Ln&&(u[f-1]=m+"(?:\\/|\\/"+r+"\\/)"+d,u[f+1]=Ln))}),u.filter(l=>l!==Ln).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 an.defaults(t).Minimatch}}function Lu(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 Ht(e,t){const{status:n}=t;if(n===401&&e.digest)return t;if(n>=400)throw Lu(t);return t}function Zr(e,t){return arguments.length>2&&arguments[2]!==void 0&&arguments[2]?{data:t,headers:e.headers?xR(e.headers):{},status:e.status,statusText:e.statusText}:t}an.AST=Os,an.Minimatch=xs,an.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},an.unescape=yo;const a_=(py=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=Wt({url:Ct(e.remoteURL,It(t)),method:"COPY",headers:{Destination:Ct(e.remoteURL,It(n)),Overwrite:r.overwrite===!1?"F":"T",Depth:r.shallow?"0":"infinity"}},e,r);return s=function(a){Ht(e,a)},(i=zt(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(py.apply(this,e))}catch(n){return Promise.reject(n)}});var py,Mu=pt(635),l_=pt(829),vr=pt.n(l_),Oi=function(e){return e.Array="array",e.Object="object",e.Original="original",e}(Oi||{});function ks(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Oi.Original;const r=vr().get(e,t);return n==="array"&&Array.isArray(r)===!1?[r]:n==="object"&&Array.isArray(r)?r[0]:r}function bo(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 vr().set(o,"multistatus.response",ks(o,"multistatus.response",Oi.Array)),vr().set(o,"multistatus.response",vr().get(o,"multistatus.response").map(i=>function(s){const a=Object.assign({},s);return a.status?vr().set(a,"status",ks(a,"status",Oi.Object)):(vr().set(a,"propstat",ks(a,"propstat",Oi.Object)),vr().set(a,"propstat.prop",ks(a,"propstat.prop",Oi.Object))),a}(i))),o}(new Mu.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 Ns(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:_s().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 hy(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 Ns(o,ho(t),n)}function gy(e){switch(String(e)){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(String(e),10)}}function Bu(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const ju=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=Wt({url:Ct(e.remoteURL,It(t)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,n);return Bu(zt(o,e),function(i){return Ht(e,i),Bu(i.text(),function(s){return Bu(bo(s),function(a){const c=hy(a,t,r);return Zr(i,c,r)})})})});function my(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const c_=yy(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=_s().dirname(s);while(s&&s!=="/");return a}(ho(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[vy]=="function"){let b=function(T){try{for(;!(c=f.next()).done;)if((T=s(c.value))&&T.then){if(!wy(T))return void T.then(b,l||(l=yn.bind(null,u=new xi,2)));T=T.v}u?yn(u,1,T):u=T}catch(v){yn(u||(u=new xi),2,v)}};var c,u,l,f=i[vy]();if(b(),f.return){var d=function(T){try{c.done||f.return()}catch{}return T};if(u&&u.then)return u.then(d,function(T){throw d(T)});d()}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(b,T,v){var g,h,y=-1;return function S(E){try{for(;++y<b.length&&(!v||!v());)if((E=T(y))&&E.then){if(!wy(E))return void E.then(S,h||(h=yn.bind(null,g=new xi,2)));E=E.v}g?yn(g,1,E):g=E}catch(R){yn(g||(g=new xi),2,R)}}(),g}(m,function(b){return s(m[b])},a)}(r,function(i){return s=function(){return function(c,u){try{var l=my(ju(e,i),function(f){if(f.type!=="directory")throw new Error(`Path includes a file: ${t}`)})}catch(f){return u(f)}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,by(Uu(e,i,{...n,recursive:!1}));throw c}()})},(a=function(){if(o)return by(Uu(e,i,{...n,recursive:!1}))}())&&a.then?a.then(s):s();var s,a},function(){return!1})});function yy(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 u_(){}function by(e,t){return e&&e.then?e.then(u_):Promise.resolve()}const vy=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function yn(e,t,n){if(!e.s){if(n instanceof xi){if(!n.s)return void(n.o=yn.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(yn.bind(null,e,t),yn.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const xi=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{yn(r,1,i(this.v))}catch(s){yn(r,2,s)}return r}return this}return this.o=function(i){try{const s=i.v;1&i.s?yn(r,1,t?t(s):s):n?yn(r,1,n(s)):yn(r,2,s)}catch(s){yn(r,2,s)}},r},e}();function wy(e){return e instanceof xi&&1&e.s}const Uu=yy(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(n.recursive===!0)return c_(e,t,n);const r=Wt({url:Ct(e.remoteURL,(o=It(t),o.endsWith("/")?o:o+"/")),method:"MKCOL"},e,n);var o;return my(zt(r,e),function(i){Ht(e,i)})});var f_=pt(388),Sy=pt.n(f_);const d_=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=Wt({url:Ct(e.remoteURL,It(t)),method:"GET",headers:r},e,n);return s=function(a){if(Ht(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=zt(o,e))&&i.then||(i=Promise.resolve(i)),s?i.then(s):i;var i,s}),p_=()=>{},h_=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=Ct(e.remoteURL,It(t)));const r=Wt(n,e,{});return i=function(s){return Ht(e,s),s},(o=zt(r,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i}),g_=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=Wt({url:Ct(e.remoteURL,It(t)),method:"DELETE"},e,n);return i=function(s){Ht(e,s)},(o=zt(r,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i}),m_=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=ju(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 qu(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const y_=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=Wt({url:Ct(e.remoteURL,It(t),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:n.deep?"infinity":"1"}},e,n);return qu(zt(r,e),function(o){return Ht(e,o),qu(o.text(),function(i){if(!i)throw new Error("Failed parsing directory contents: Empty response");return qu(bo(i),function(s){const a=zm(t);let c=function(u,l,f){let d=arguments.length>3&&arguments[3]!==void 0&&arguments[3],m=arguments.length>4&&arguments[4]!==void 0&&arguments[4];const w=_s().join(l,"/"),{multistatus:{response:b}}=u,T=b.map(v=>{const g=function(y){try{return y.replace(/^https?:\/\/[^\/]+/,"")}catch(S){throw new gn(S,"Failed normalising HREF")}}(v.href),{propstat:{prop:h}}=v;return Ns(h,w==="/"?decodeURIComponent(ho(g)):ho(_s().relative(decodeURIComponent(w),decodeURIComponent(g))),d)});return m?T:T.filter(v=>v.basename&&(v.type==="file"||v.filename!==f.replace(/\/$/,"")))}(s,zm(e.remoteBasePath||e.remotePath),a,n.details,n.includeSelf);return n.glob&&(c=function(u,l){return u.filter(f=>an(f.filename,l,{matchBase:!0}))}(c,n.glob)),Zr(o,c,n.details)})})})});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)}}}const b_=Vu(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Wt({url:Ct(e.remoteURL,It(t)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[S_]},e,n);return $s(zt(r,e),function(o){return Ht(e,o),$s(o.text(),function(i){return Zr(o,i,n.details)})})});function $s(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const v_=Vu(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Wt({url:Ct(e.remoteURL,It(t)),method:"GET"},e,n);return $s(zt(r,e),function(o){let i;return Ht(e,o),function(s,a){var c=s();return c&&c.then?c.then(a):a()}(function(){return $s(o.arrayBuffer(),function(s){i=s})},function(){return Zr(o,i,n.details)})})}),w_=Vu(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 gn({info:{code:br.InvalidOutputFormat}},`Invalid output format: ${r}`);return r==="text"?b_(e,t,n):v_(e,t,n)}),S_=e=>e;function E_(e){return new Mu.XMLBuilder({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(Ey({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:e}}},"d"))}function Ey(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}`]=Ey(n[r],t),delete n[r]):/^@_/.test(r)===!1&&(n[`${t}:${r}`]=n[r],delete n[r]));return n}function zu(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Ty(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 T_=Ty(function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=Wt({url:Ct(e.remoteURL,It(t)),method:"UNLOCK",headers:{"Lock-Token":n}},e,r);return zu(zt(o,e),function(i){if(Ht(e,i),i.status!==204&&i.status!==200)throw Lu(i)})}),A_=Ty(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{refreshToken:r,timeout:o=R_}=n,i={Accept:"text/plain,application/xml",Timeout:o};r&&(i.If=r);const s=Wt({url:Ct(e.remoteURL,It(t)),method:"LOCK",headers:i,data:E_(e.contactHref)},e,n);return zu(zt(s,e),function(a){return Ht(e,a),zu(a.text(),function(c){const u=(d=c,new Mu.XMLParser({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(d)),l=vr().get(u,"prop.lockdiscovery.activelock.locktoken.href"),f=vr().get(u,"prop.lockdiscovery.activelock.timeout");var d;if(!l)throw Lu(a,"No lock token received: ");return{token:l,serverTimeout:f}})})}),R_="Infinite, Second-4100000000";function Wu(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const __=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=Wt({url:Ct(e.remoteURL,n),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,t);return Wu(zt(r,e),function(o){return Ht(e,o),Wu(o.text(),function(i){return Wu(bo(i),function(s){const a=function(c){try{const[u]=c.multistatus.response,{propstat:{prop:{"quota-used-bytes":l,"quota-available-bytes":f}}}=u;return l!==void 0&&f!==void 0?{used:parseInt(String(l),10),available:gy(f)}:null}catch{}return null}(s);return Zr(o,a,t.details)})})})});function Hu(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const I_=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=Wt({url:Ct(e.remoteURL,It(t)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":e.headers["Content-Type"]||"application/xml; charset=utf-8"}},e,n);return Hu(zt(o,e),function(i){return Ht(e,i),Hu(i.text(),function(s){return Hu(bo(s),function(a){const c=function(u,l,f){const d={truncated:!1,results:[]};return d.truncated=u.multistatus.response.some(m=>{var w,b;return((b=(m.status||((w=m.propstat)==null?void 0:w.status)).split(" ",3))==null?void 0:b[1])==="507"&&m.href.replace(/\/$/,"").endsWith(It(l).replace(/\/$/,""))}),u.multistatus.response.forEach(m=>{if(m.propstat===void 0)return;const w=m.href.split("/").map(decodeURIComponent).join("/");d.results.push(Ns(m.propstat.prop,w,f))}),d}(a,t,r);return Zr(i,c,r)})})})}),C_=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=Wt({url:Ct(e.remoteURL,It(t)),method:"MOVE",headers:{Destination:Ct(e.remoteURL,It(n)),Overwrite:r.overwrite===!1?"F":"T"}},e,r);return s=function(a){Ht(e,a)},(i=zt(o,e))&&i.then||(i=Promise.resolve(i)),s?i.then(s):i;var i,s});var F_=pt(172);const P_=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(ty(l))return l.byteLength;if(ny(l))return l.length;if(typeof l=="string")return(0,F_.d)(l);throw new gn({info:{code:br.DataTypeNoLength}},"Cannot calculate data length: Invalid type")}(n)}`),i||(s["If-None-Match"]="*");const a=Wt({url:Ct(e.remoteURL,It(t)),method:"PUT",headers:s,data:n},e,r);return u=function(l){try{Ht(e,l)}catch(f){const d=f;if(d.status!==412||i)throw d;return!1}return!0},(c=zt(a,e))&&c.then||(c=Promise.resolve(c)),u?c.then(u):c;var c,u}),Ay=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=Wt({url:Ct(e.remoteURL,It(t)),method:"OPTIONS"},e,n);return i=function(s){try{Ht(e,s)}catch(a){throw a}return{compliance:(s.headers.get("DAV")??"").split(",").map(a=>a.trim()),server:s.headers.get("Server")??""}},(o=zt(r,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i});function vo(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const O_=Gu(function(e,t,n,r,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new gn({info:{code:br.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=Wt({url:Ct(e.remoteURL,It(t)),method:"PUT",headers:s,data:o},e,i);return vo(zt(a,e),function(c){Ht(e,c)})});function Ry(e,t){var n=e();return n&&n.then?n.then(t):t(n)}const x_=Gu(function(e,t,n,r,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new gn({info:{code:br.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=Wt({url:Ct(e.remoteURL,It(t)),method:"PATCH",headers:s,data:o},e,i);return vo(zt(a,e),function(c){Ht(e,c)})});function Gu(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 k_=Gu(function(e,t,n,r,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};return vo(Ay(e,t,i),function(s){let a=!1;return Ry(function(){if(s.compliance.includes("sabredav-partialupdate"))return vo(x_(e,t,n,r,o,i),function(c){return a=!0,c})},function(c){let u=!1;return a?c:Ry(function(){if(s.server.includes("Apache")&&s.compliance.includes("<http://apache.org/dav/propset/fs/1>"))return vo(O_(e,t,n,r,o,i),function(l){return u=!0,l})},function(l){if(u)return l;throw new gn({info:{code:br.NotSupported}},"Not supported")})})})}),N_="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function $_(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{authType:n=null,remoteBasePath:r,contactHref:o=N_,ha1:i,headers:s={},httpAgent:a,httpsAgent:c,password:u,token:l,username:f,withCredentials:d}=t;let m=n;m||(m=f||u?mn.Password:mn.None);const w={authType:m,remoteBasePath:r,contactHref:o,ha1:i,headers:Object.assign({},s),httpAgent:a,httpsAgent:c,password:u,remotePath:TR(e),remoteURL:e,token:l,username:f,withCredentials:d};return Xm(w,f,u,l,i),{copyFile:(b,T,v)=>a_(w,b,T,v),createDirectory:(b,T)=>Uu(w,b,T),createReadStream:(b,T)=>function(v,g){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const y=new(Sy()).PassThrough;return d_(v,g,h).then(S=>{S.pipe(y)}).catch(S=>{y.emit("error",S)}),y}(w,b,T),createWriteStream:(b,T,v)=>function(g,h){let y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},S=arguments.length>3&&arguments[3]!==void 0?arguments[3]:p_;const E=new(Sy()).PassThrough,R={};y.overwrite===!1&&(R["If-None-Match"]="*");const I=Wt({url:Ct(g.remoteURL,It(h)),method:"PUT",headers:R,data:E,maxRedirects:0},g,y);return zt(I,g).then(A=>Ht(g,A)).then(A=>{setTimeout(()=>{S(A)},0)}).catch(A=>{E.emit("error",A)}),E}(w,b,T,v),customRequest:(b,T)=>h_(w,b,T),deleteFile:(b,T)=>g_(w,b,T),exists:(b,T)=>m_(w,b,T),getDirectoryContents:(b,T)=>y_(w,b,T),getFileContents:(b,T)=>w_(w,b,T),getFileDownloadLink:b=>function(T,v){let g=Ct(T.remoteURL,It(v));const h=/^https:/i.test(g)?"https":"http";switch(T.authType){case mn.None:break;case mn.Password:{const y=Km(T.headers.Authorization.replace(/^Basic /i,"").trim());g=g.replace(/^https?:\/\//,`${h}://${y}@`);break}default:throw new gn({info:{code:br.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${T.authType}`)}return g}(w,b),getFileUploadLink:b=>function(T,v){let g=`${Ct(T.remoteURL,It(v))}?Content-Type=application/octet-stream`;const h=/^https:/i.test(g)?"https":"http";switch(T.authType){case mn.None:break;case mn.Password:{const y=Km(T.headers.Authorization.replace(/^Basic /i,"").trim());g=g.replace(/^https?:\/\//,`${h}://${y}@`);break}default:throw new gn({info:{code:br.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${T.authType}`)}return g}(w,b),getHeaders:()=>Object.assign({},w.headers),getQuota:b=>__(w,b),lock:(b,T)=>A_(w,b,T),moveFile:(b,T,v)=>C_(w,b,T,v),putFileContents:(b,T,v)=>P_(w,b,T,v),partialUpdateFileContents:(b,T,v,g,h)=>k_(w,b,T,v,g,h),getDAVCompliance:b=>Ay(w,b),search:(b,T)=>I_(w,b,T),setHeaders:b=>{w.headers=Object.assign({},b)},stat:(b,T)=>ju(w,b,T),unlock:(b,T,v)=>T_(w,b,T,v)}}Dn.hT,Dn.O4,Dn.Kd,Dn.YK,Dn.UU,Dn.Gu,Dn.ky,Dn.h4,Dn.ch,Dn.hq,Dn.i5;var Ku={},Qu={},_y;function Xu(){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 f=[];f.startIndex=c.lastIndex-l[0].length;const d=l.length;for(let m=0;m<d;m++)f.push(l[m]);u.push(f),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),f=l.length;for(let d=0;d<f;d++)u==="strict"?a[l[d]]=[c[l[d]]]:a[l[d]]=c[l[d]]}},e.getValue=function(a){return e.isExist(a)?a:""},e.isName=s,e.getAllMatches=i,e.nameRegexp=r}(Qu)),Qu}var Iy;function Cy(){if(Iy)return Ku;Iy=1;const e=Xu(),t={allowBooleanAttributes:!1,unpairedTags:[]};Ku.validate=function(v,g){g=Object.assign({},t,g);const h=[];let y=!1,S=!1;v[0]==="\uFEFF"&&(v=v.substr(1));for(let E=0;E<v.length;E++)if(v[E]==="<"&&v[E+1]==="?"){if(E+=2,E=r(v,E),E.err)return E}else if(v[E]==="<"){let R=E;if(E++,v[E]==="!"){E=o(v,E);continue}else{let I=!1;v[E]==="/"&&(I=!0,E++);let A="";for(;E<v.length&&v[E]!==">"&&v[E]!==" "&&v[E]!==" "&&v[E]!==`
45
+ `&&v[E]!=="\r";E++)A+=v[E];if(A=A.trim(),A[A.length-1]==="/"&&(A=A.substring(0,A.length-1),E--),!w(A)){let k;return A.trim().length===0?k="Invalid space after '<'.":k="Tag '"+A+"' is an invalid name.",d("InvalidTag",k,b(v,E))}const $=a(v,E);if($===!1)return d("InvalidAttr","Attributes for '"+A+"' have open quote.",b(v,E));let D=$.value;if(E=$.index,D[D.length-1]==="/"){const k=E-D.length;D=D.substring(0,D.length-1);const N=u(D,g);if(N===!0)y=!0;else return d(N.err.code,N.err.msg,b(v,k+N.err.line))}else if(I)if($.tagClosed){if(D.trim().length>0)return d("InvalidTag","Closing tag '"+A+"' can't have attributes or invalid starting.",b(v,R));if(h.length===0)return d("InvalidTag","Closing tag '"+A+"' has not been opened.",b(v,R));{const k=h.pop();if(A!==k.tagName){let N=b(v,k.tagStartPos);return d("InvalidTag","Expected closing tag '"+k.tagName+"' (opened in line "+N.line+", col "+N.col+") instead of closing tag '"+A+"'.",b(v,R))}h.length==0&&(S=!0)}}else return d("InvalidTag","Closing tag '"+A+"' doesn't have proper closing.",b(v,E));else{const k=u(D,g);if(k!==!0)return d(k.err.code,k.err.msg,b(v,E-D.length+k.err.line));if(S===!0)return d("InvalidXml","Multiple possible root nodes found.",b(v,E));g.unpairedTags.indexOf(A)!==-1||h.push({tagName:A,tagStartPos:R}),y=!0}for(E++;E<v.length;E++)if(v[E]==="<")if(v[E+1]==="!"){E++,E=o(v,E);continue}else if(v[E+1]==="?"){if(E=r(v,++E),E.err)return E}else break;else if(v[E]==="&"){const k=f(v,E);if(k==-1)return d("InvalidChar","char '&' is not expected.",b(v,E));E=k}else if(S===!0&&!n(v[E]))return d("InvalidXml","Extra text at the end",b(v,E));v[E]==="<"&&E--}}else{if(n(v[E]))continue;return d("InvalidChar","char '"+v[E]+"' is not expected.",b(v,E))}if(y){if(h.length==1)return d("InvalidTag","Unclosed tag '"+h[0].tagName+"'.",b(v,h[0].tagStartPos));if(h.length>0)return d("InvalidXml","Invalid '"+JSON.stringify(h.map(E=>E.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return d("InvalidXml","Start tag expected.",1);return!0};function n(v){return v===" "||v===" "||v===`
46
+ `||v==="\r"}function r(v,g){const h=g;for(;g<v.length;g++)if(v[g]=="?"||v[g]==" "){const y=v.substr(h,g-h);if(g>5&&y==="xml")return d("InvalidXml","XML declaration allowed only at the start of the document.",b(v,g));if(v[g]=="?"&&v[g+1]==">"){g++;break}else continue}return g}function o(v,g){if(v.length>g+5&&v[g+1]==="-"&&v[g+2]==="-"){for(g+=3;g<v.length;g++)if(v[g]==="-"&&v[g+1]==="-"&&v[g+2]===">"){g+=2;break}}else if(v.length>g+8&&v[g+1]==="D"&&v[g+2]==="O"&&v[g+3]==="C"&&v[g+4]==="T"&&v[g+5]==="Y"&&v[g+6]==="P"&&v[g+7]==="E"){let h=1;for(g+=8;g<v.length;g++)if(v[g]==="<")h++;else if(v[g]===">"&&(h--,h===0))break}else if(v.length>g+9&&v[g+1]==="["&&v[g+2]==="C"&&v[g+3]==="D"&&v[g+4]==="A"&&v[g+5]==="T"&&v[g+6]==="A"&&v[g+7]==="["){for(g+=8;g<v.length;g++)if(v[g]==="]"&&v[g+1]==="]"&&v[g+2]===">"){g+=2;break}}return g}const i='"',s="'";function a(v,g){let h="",y="",S=!1;for(;g<v.length;g++){if(v[g]===i||v[g]===s)y===""?y=v[g]:y!==v[g]||(y="");else if(v[g]===">"&&y===""){S=!0;break}h+=v[g]}return y!==""?!1:{value:h,index:g,tagClosed:S}}const c=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function u(v,g){const h=e.getAllMatches(v,c),y={};for(let S=0;S<h.length;S++){if(h[S][1].length===0)return d("InvalidAttr","Attribute '"+h[S][2]+"' has no space in starting.",T(h[S]));if(h[S][3]!==void 0&&h[S][4]===void 0)return d("InvalidAttr","Attribute '"+h[S][2]+"' is without value.",T(h[S]));if(h[S][3]===void 0&&!g.allowBooleanAttributes)return d("InvalidAttr","boolean attribute '"+h[S][2]+"' is not allowed.",T(h[S]));const E=h[S][2];if(!m(E))return d("InvalidAttr","Attribute '"+E+"' is an invalid name.",T(h[S]));if(!y.hasOwnProperty(E))y[E]=1;else return d("InvalidAttr","Attribute '"+E+"' is repeated.",T(h[S]))}return!0}function l(v,g){let h=/\d/;for(v[g]==="x"&&(g++,h=/[\da-fA-F]/);g<v.length;g++){if(v[g]===";")return g;if(!v[g].match(h))break}return-1}function f(v,g){if(g++,v[g]===";")return-1;if(v[g]==="#")return g++,l(v,g);let h=0;for(;g<v.length;g++,h++)if(!(v[g].match(/\w/)&&h<20)){if(v[g]===";")break;return-1}return g}function d(v,g,h){return{err:{code:v,msg:g,line:h.line||h,col:h.col}}}function m(v){return e.isName(v)}function w(v){return e.isName(v)}function b(v,g){const h=v.substring(0,g).split(/\r?\n/);return{line:h.length,col:h[h.length-1].length+1}}function T(v){return v.startIndex+v[1].length}return Ku}var Ds={},Fy;function D_(){if(Fy)return Ds;Fy=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 Ds.buildOptions=t,Ds.defaultOptions=e,Ds}var Yu,Py;function L_(){if(Py)return Yu;Py=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 Yu=e,Yu}var Ju,Oy;function M_(){if(Oy)return Ju;Oy=1;const e=Xu();function t(u,l){const f={};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 d=1,m=!1,w=!1,b="";for(;l<u.length;l++)if(u[l]==="<"&&!w){if(m&&o(u,l)){l+=7;let T,v;[T,v,l]=n(u,l+1),v.indexOf("&")===-1&&(f[c(T)]={regx:RegExp(`&${T};`,"g"),val:v})}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");d++,b=""}else if(u[l]===">"){if(w?u[l-1]==="-"&&u[l-2]==="-"&&(w=!1,d--):d--,d===0)break}else u[l]==="["?m=!0:b+=u[l];if(d!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:f,i:l}}function n(u,l){let f="";for(;l<u.length&&u[l]!=="'"&&u[l]!=='"';l++)f+=u[l];if(f=f.trim(),f.indexOf(" ")!==-1)throw new Error("External entites are not supported");const d=u[l++];let m="";for(;l<u.length&&u[l]!==d;l++)m+=u[l];return[f,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 Ju=t,Ju}var Zu,xy;function B_(){if(xy)return Zu;xy=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;if(s==="0")return 0;let c=s.trim();if(a.skipLike!==void 0&&a.skipLike.test(c))return s;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],f=u[2];let d=o(u[3]);if(!a.leadingZeros&&f.length>0&&l&&c[2]!==".")return s;if(!a.leadingZeros&&f.length>0&&!l&&c[1]!==".")return s;if(a.leadingZeros&&f===s)return 0;{const m=Number(c),w=""+m;return w.search(/[eE]/)!==-1?a.eNotation?m:s:c.indexOf(".")!==-1?w==="0"&&d===""||w===d||l&&w==="-"+d?m:s:f?d===w||l+d===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 Zu=r,Zu}var ef,ky;function Ny(){if(ky)return ef;ky=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 ef=e,ef}var tf,$y;function j_(){if($y)return tf;$y=1;const e=Xu(),t=L_(),n=M_(),r=B_(),o=Ny();class i{constructor(E){this.options=E,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=f,this.parseTextData=a,this.resolveNameSpace=c,this.buildAttributesMap=l,this.isItStopNode=b,this.replaceEntitiesValue=m,this.readStopNodeData=h,this.saveTextToParentTag=w,this.addChild=d,this.ignoreAttributesFn=o(this.options.ignoreAttributes)}}function s(S){const E=Object.keys(S);for(let R=0;R<E.length;R++){const I=E[R];this.lastEntities[I]={regex:new RegExp("&"+I+";","g"),val:S[I]}}}function a(S,E,R,I,A,$,D){if(S!==void 0&&(this.options.trimValues&&!I&&(S=S.trim()),S.length>0)){D||(S=this.replaceEntitiesValue(S));const k=this.options.tagValueProcessor(E,S,R,A,$);return k==null?S:typeof k!=typeof S||k!==S?k:this.options.trimValues?y(S,this.options.parseTagValue,this.options.numberParseOptions):S.trim()===S?y(S,this.options.parseTagValue,this.options.numberParseOptions):S}}function c(S){if(this.options.removeNSPrefix){const E=S.split(":"),R=S.charAt(0)==="/"?"/":"";if(E[0]==="xmlns")return"";E.length===2&&(S=R+E[1])}return S}const u=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function l(S,E,R){if(this.options.ignoreAttributes!==!0&&typeof S=="string"){const I=e.getAllMatches(S,u),A=I.length,$={};for(let D=0;D<A;D++){const k=this.resolveNameSpace(I[D][1]);if(this.ignoreAttributesFn(k,E))continue;let N=I[D][4],z=this.options.attributeNamePrefix+k;if(k.length)if(this.options.transformAttributeName&&(z=this.options.transformAttributeName(z)),z==="__proto__"&&(z="#__proto__"),N!==void 0){this.options.trimValues&&(N=N.trim()),N=this.replaceEntitiesValue(N);const G=this.options.attributeValueProcessor(k,N,E);G==null?$[z]=N:typeof G!=typeof N||G!==N?$[z]=G:$[z]=y(N,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&($[z]=!0)}if(!Object.keys($).length)return;if(this.options.attributesGroupName){const D={};return D[this.options.attributesGroupName]=$,D}return $}}const f=function(S){S=S.replace(/\r\n?/g,`
47
+ `);const E=new t("!xml");let R=E,I="",A="";for(let $=0;$<S.length;$++)if(S[$]==="<")if(S[$+1]==="/"){const k=v(S,">",$,"Closing Tag is not closed.");let N=S.substring($+2,k).trim();if(this.options.removeNSPrefix){const X=N.indexOf(":");X!==-1&&(N=N.substr(X+1))}this.options.transformTagName&&(N=this.options.transformTagName(N)),R&&(I=this.saveTextToParentTag(I,R,A));const z=A.substring(A.lastIndexOf(".")+1);if(N&&this.options.unpairedTags.indexOf(N)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${N}>`);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="",$=k}else if(S[$+1]==="?"){let k=g(S,$,!1,"?>");if(!k)throw new Error("Pi Tag is not closed.");if(I=this.saveTextToParentTag(I,R,A),!(this.options.ignoreDeclaration&&k.tagName==="?xml"||this.options.ignorePiTags)){const N=new t(k.tagName);N.add(this.options.textNodeName,""),k.tagName!==k.tagExp&&k.attrExpPresent&&(N[":@"]=this.buildAttributesMap(k.tagExp,A,k.tagName)),this.addChild(R,N,A)}$=k.closeIndex+1}else if(S.substr($+1,3)==="!--"){const k=v(S,"-->",$+4,"Comment is not closed.");if(this.options.commentPropName){const N=S.substring($+4,k-2);I=this.saveTextToParentTag(I,R,A),R.add(this.options.commentPropName,[{[this.options.textNodeName]:N}])}$=k}else if(S.substr($+1,2)==="!D"){const k=n(S,$);this.docTypeEntities=k.entities,$=k.i}else if(S.substr($+1,2)==="!["){const k=v(S,"]]>",$,"CDATA is not closed.")-2,N=S.substring($+9,k);I=this.saveTextToParentTag(I,R,A);let z=this.parseTextData(N,R.tagname,A,!0,!1,!0,!0);z==null&&(z=""),this.options.cdataPropName?R.add(this.options.cdataPropName,[{[this.options.textNodeName]:N}]):R.add(this.options.textNodeName,z),$=k+2}else{let k=g(S,$,this.options.removeNSPrefix),N=k.tagName;const z=k.rawTagName;let G=k.tagExp,X=k.attrExpPresent,se=k.closeIndex;this.options.transformTagName&&(N=this.options.transformTagName(N)),R&&I&&R.tagname!=="!xml"&&(I=this.saveTextToParentTag(I,R,A,!1));const ne=R;if(ne&&this.options.unpairedTags.indexOf(ne.tagname)!==-1&&(R=this.tagsNodeStack.pop(),A=A.substring(0,A.lastIndexOf("."))),N!==E.tagname&&(A+=A?"."+N:N),this.isItStopNode(this.options.stopNodes,A,N)){let oe="";if(G.length>0&&G.lastIndexOf("/")===G.length-1)N[N.length-1]==="/"?(N=N.substr(0,N.length-1),A=A.substr(0,A.length-1),G=N):G=G.substr(0,G.length-1),$=k.closeIndex;else if(this.options.unpairedTags.indexOf(N)!==-1)$=k.closeIndex;else{const we=this.readStopNodeData(S,z,se+1);if(!we)throw new Error(`Unexpected end of ${z}`);$=we.i,oe=we.tagContent}const fe=new t(N);N!==G&&X&&(fe[":@"]=this.buildAttributesMap(G,A,N)),oe&&(oe=this.parseTextData(oe,N,A,!0,X,!0,!0)),A=A.substr(0,A.lastIndexOf(".")),fe.add(this.options.textNodeName,oe),this.addChild(R,fe,A)}else{if(G.length>0&&G.lastIndexOf("/")===G.length-1){N[N.length-1]==="/"?(N=N.substr(0,N.length-1),A=A.substr(0,A.length-1),G=N):G=G.substr(0,G.length-1),this.options.transformTagName&&(N=this.options.transformTagName(N));const oe=new t(N);N!==G&&X&&(oe[":@"]=this.buildAttributesMap(G,A,N)),this.addChild(R,oe,A),A=A.substr(0,A.lastIndexOf("."))}else{const oe=new t(N);this.tagsNodeStack.push(R),N!==G&&X&&(oe[":@"]=this.buildAttributesMap(G,A,N)),this.addChild(R,oe,A),R=oe}I="",$=se}}else I+=S[$];return E.child};function d(S,E,R){const I=this.options.updateTag(E.tagname,R,E[":@"]);I===!1||(typeof I=="string"&&(E.tagname=I),S.addChild(E))}const m=function(S){if(this.options.processEntities){for(let E in this.docTypeEntities){const R=this.docTypeEntities[E];S=S.replace(R.regx,R.val)}for(let E in this.lastEntities){const R=this.lastEntities[E];S=S.replace(R.regex,R.val)}if(this.options.htmlEntities)for(let E in this.htmlEntities){const R=this.htmlEntities[E];S=S.replace(R.regex,R.val)}S=S.replace(this.ampEntity.regex,this.ampEntity.val)}return S};function w(S,E,R,I){return S&&(I===void 0&&(I=E.child.length===0),S=this.parseTextData(S,E.tagname,R,!1,E[":@"]?Object.keys(E[":@"]).length!==0:!1,I),S!==void 0&&S!==""&&E.add(this.options.textNodeName,S),S=""),S}function b(S,E,R){const I="*."+R;for(const A in S){const $=S[A];if(I===$||E===$)return!0}return!1}function T(S,E,R=">"){let I,A="";for(let $=E;$<S.length;$++){let D=S[$];if(I)D===I&&(I="");else if(D==='"'||D==="'")I=D;else if(D===R[0])if(R[1]){if(S[$+1]===R[1])return{data:A,index:$}}else return{data:A,index:$};else D===" "&&(D=" ");A+=D}}function v(S,E,R,I){const A=S.indexOf(E,R);if(A===-1)throw new Error(I);return A+E.length-1}function g(S,E,R,I=">"){const A=T(S,E+1,I);if(!A)return;let $=A.data;const D=A.index,k=$.search(/\s/);let N=$,z=!0;k!==-1&&(N=$.substring(0,k),$=$.substring(k+1).trimStart());const G=N;if(R){const X=N.indexOf(":");X!==-1&&(N=N.substr(X+1),z=N!==A.data.substr(X+1))}return{tagName:N,tagExp:$,closeIndex:D,attrExpPresent:z,rawTagName:G}}function h(S,E,R){const I=R;let A=1;for(;R<S.length;R++)if(S[R]==="<")if(S[R+1]==="/"){const $=v(S,">",R,`${E} is not closed`);if(S.substring(R+2,$).trim()===E&&(A--,A===0))return{tagContent:S.substring(I,R),i:$};R=$}else if(S[R+1]==="?")R=v(S,"?>",R+1,"StopNode is not closed.");else if(S.substr(R+1,3)==="!--")R=v(S,"-->",R+3,"StopNode is not closed.");else if(S.substr(R+1,2)==="![")R=v(S,"]]>",R,"StopNode is not closed.")-2;else{const $=g(S,R,">");$&&(($&&$.tagName)===E&&$.tagExp[$.tagExp.length-1]!=="/"&&A++,R=$.closeIndex)}}function y(S,E,R){if(E&&typeof S=="string"){const I=S.trim();return I==="true"?!0:I==="false"?!1:r(S,R)}else return e.isExist(S)?S:""}return tf=i,tf}var nf={},Dy;function U_(){if(Dy)return nf;Dy=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 f=i[l],d=n(f);let m="";if(a===void 0?m=d:m=a+"."+d,d===s.textNodeName)c===void 0?c=f[d]:c+=""+f[d];else{if(d===void 0)continue;if(f[d]){let w=t(f[d],s,m);const b=o(w,s);f[":@"]?r(w,f[":@"],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[d]!==void 0&&u.hasOwnProperty(d)?(Array.isArray(u[d])||(u[d]=[u[d]]),u[d].push(w)):s.isArray(d,m,b)?u[d]=[w]:u[d]=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 f=0;f<l;f++){const d=u[f];c.isArray(d,a+"."+d,!0,!0)?i[d]=[s[d]]:i[d]=s[d]}}}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 nf.prettify=e,nf}var rf,Ly;function q_(){if(Ly)return rf;Ly=1;const{buildOptions:e}=D_(),t=j_(),{prettify:n}=U_(),r=Cy();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 rf=o,rf}var of,My;function V_(){if(My)return of;My=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 f="",d=!1;for(let m=0;m<a.length;m++){const w=a[m],b=r(w);if(b===void 0)continue;let T="";if(u.length===0?T=b:T=`${u}.${b}`,b===c.textNodeName){let S=w[b];i(T,c)||(S=c.tagValueProcessor(b,S),S=s(S,c)),d&&(f+=l),f+=S,d=!1;continue}else if(b===c.cdataPropName){d&&(f+=l),f+=`<![CDATA[${w[b][0][c.textNodeName]}]]>`,d=!1;continue}else if(b===c.commentPropName){f+=l+`<!--${w[b][0][c.textNodeName]}-->`,d=!0;continue}else if(b[0]==="?"){const S=o(w[":@"],c),E=b==="?xml"?"":l;let R=w[b][0][c.textNodeName];R=R.length!==0?" "+R:"",f+=E+`<${b}${R}${S}?>`,d=!0;continue}let v=l;v!==""&&(v+=c.indentBy);const g=o(w[":@"],c),h=l+`<${b}${g}`,y=n(w[b],c,T,v);c.unpairedTags.indexOf(b)!==-1?c.suppressUnpairedNode?f+=h+">":f+=h+"/>":(!y||y.length===0)&&c.suppressEmptyNode?f+=h+"/>":y&&y.endsWith(">")?f+=h+`>${y}${l}</${b}>`:(f+=h+">",y&&l!==""&&(y.includes("/>")||y.includes("</"))?f+=l+c.indentBy+y+l:f+=y,f+=`</${b}>`),d=!0}return f}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 f=c.attributeValueProcessor(l,a[l]);f=s(f,c),f===!0&&c.suppressBooleanAttributes?u+=` ${l.substr(c.attributeNamePrefix.length)}`:u+=` ${l.substr(c.attributeNamePrefix.length)}="${f}"`}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 of=t,of}var sf,By;function z_(){if(By)return sf;By=1;const e=V_(),t=Ny(),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=`>
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="",f="";const d=u.join(".");for(let m in a)if(Object.prototype.hasOwnProperty.call(a,m))if(typeof a[m]>"u")this.isAttribute(m)&&(f+="");else if(a[m]===null)this.isAttribute(m)||m===this.options.cdataPropName?f+="":m[0]==="?"?f+=this.indentate(c)+"<"+m+"?"+this.tagEndChar:f+=this.indentate(c)+"<"+m+"/"+this.tagEndChar;else if(a[m]instanceof Date)f+=this.buildTextValNode(a[m],m,"",c);else if(typeof a[m]!="object"){const w=this.isAttribute(m);if(w&&!this.ignoreAttributesFn(w,d))l+=this.buildAttrPairStr(w,""+a[m]);else if(!w)if(m===this.options.textNodeName){let v=this.options.tagValueProcessor(m,""+a[m]);f+=this.replaceEntitiesValue(v)}else f+=this.buildTextValNode(a[m],m,"",c)}else if(Array.isArray(a[m])){const w=a[m].length;let v="",T="";for(let b=0;b<w;b++){const g=a[m][b];if(!(typeof g>"u"))if(g===null)m[0]==="?"?f+=this.indentate(c)+"<"+m+"?"+this.tagEndChar:f+=this.indentate(c)+"<"+m+"/"+this.tagEndChar;else if(typeof g=="object")if(this.options.oneListGroup){const h=this.j2x(g,c+1,u.concat(m));v+=h.val,this.options.attributesGroupName&&g.hasOwnProperty(this.options.attributesGroupName)&&(T+=h.attrStr)}else v+=this.processTextOrObjNode(g,m,c,u);else if(this.options.oneListGroup){let h=this.options.tagValueProcessor(m,g);h=this.replaceEntitiesValue(h),v+=h}else v+=this.buildTextValNode(g,m,"",c)}this.options.oneListGroup&&(v=this.buildObjectNode(v,m,T,c)),f+=v}else if(this.options.attributesGroupName&&m===this.options.attributesGroupName){const w=Object.keys(a[m]),v=w.length;for(let T=0;T<v;T++)l+=this.buildAttrPairStr(w[T],""+a[m][w[T]])}else f+=this.processTextOrObjNode(a[m],m,c,u);return{attrStr:l,val:f}},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 f=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,f.attrStr,u):this.buildObjectNode(f.val,c,f.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 f="</"+c+this.tagEndChar,d="";return c[0]==="?"&&(d="?",f=""),(u||u==="")&&a.indexOf("<")===-1?this.indentate(l)+"<"+c+u+d+">"+a+f:this.options.commentPropName!==!1&&c===this.options.commentPropName&&d.length===0?this.indentate(l)+`<!--${a}-->`+this.newLine:this.indentate(l)+"<"+c+u+d+this.tagEndChar+a+this.indentate(l)+f}},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 f=this.options.tagValueProcessor(c,a);return f=this.replaceEntitiesValue(f),f===""?this.indentate(l)+"<"+c+u+this.closeTag(c)+this.tagEndChar:this.indentate(l)+"<"+c+u+">"+f+"</"+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 sf=r,sf}var af,By;function z_(){if(By)return af;By=1;const e=Iy(),t=U_(),n=V_();return af={XMLParser:t,XMLValidator:e,XMLBuilder:n},af}z_();class jy{isEnabled(){return!0}isActive(t){return In(t,"files-trash-generic")}getTask(t){const{resourcesStore:n,clientService:{webdav:r}}=t;return un.useTask(function*(o,i,s){n.clearResourceList(),n.setAncestorMetaData({});const{resource:a,children:c}=yield r.listFiles(s,{},{depth:1,davProperties:vs.Trashbin,isTrash:!0,signal:o});n.initResourceList({currentFolder:a,resources:c})})}}class Uy{constructor(){Ee(this,"loaders");this.loaders=[new Uh,new qh,new Vh,new zh,new Wh,new jy]}getTask(){const t=vt(),n=lt(),r=rn(),o=ze(),i=Ye(),s=st(),a=Ke(),c=jt(),u=yf(),l=this.loaders.find(f=>f.isEnabled()&&f.isActive(p(o)));if(!l){console.debug("No folder loader found for route");return}return un.useTask(function*(...f){const d={clientService:i,configStore:s,userStore:t,spacesStore:n,capabilityStore:r,resourcesStore:a,sharesStore:c,router:o,authService:u};try{yield l.getTask(d).perform(...f)}catch(m){console.error(m)}})}}const qy=new Uy;var Fr=(e=>(e.add="loading-service.add",e.remove="loading-service.remove",e.setProgress="loading-service.set-progress",e))(Fr||{});const W_=200;class H_{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=W_,indeterminate:r=!0}={}){const o={id:Yt.v4(),active:!1,...!r&&{state:{total:0,current:0}}};return this.tasks.length||window.addEventListener("beforeunload",this.onBeforeUnload),this.tasks.push(o),Et.debounce(()=>{o.active=!0,Xe.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),Xe.publish("loading-service.remove")}setProgress({task:t,total:n,current:r}){t.state||(t.state={total:0,current:0}),t.state.total=n,t.state.current=r,Xe.publish("loading-service.set-progress")}onBeforeUnload(t){t.preventDefault()}}var G_="__lodash_hash_undefined__";function K_(e){return this.__data__.set(e,G_),this}function Q_(e){return this.__data__.has(e)}function Ls(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new gr;++t<n;)this.add(e[t])}Ls.prototype.add=Ls.prototype.push=K_,Ls.prototype.has=Q_;function X_(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 Y_(e,t){return e.has(t)}var J_=1,Z_=2;function Vy(e,t,n,r,o,i){var s=n&J_,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 f=-1,d=!0,m=n&Z_?new Ls:void 0;for(i.set(e,t),i.set(t,e);++f<a;){var w=e[f],v=t[f];if(r)var T=s?r(v,w,f,t,e,i):r(w,v,f,e,t,i);if(T!==void 0){if(T)continue;d=!1;break}if(m){if(!X_(t,function(b,g){if(!Y_(m,g)&&(w===b||o(w,b,n,r,i)))return m.push(g)})){d=!1;break}}else if(!(w===v||o(w,v,n,r,i))){d=!1;break}}return i.delete(e),i.delete(t),d}function eI(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}function tI(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var nI=1,rI=2,iI="[object Boolean]",oI="[object Date]",sI="[object Error]",aI="[object Map]",lI="[object Number]",cI="[object RegExp]",uI="[object Set]",fI="[object String]",dI="[object Symbol]",pI="[object ArrayBuffer]",hI="[object DataView]",zy=Fn?Fn.prototype:void 0,lf=zy?zy.valueOf:void 0;function gI(e,t,n,r,o,i,s){switch(n){case hI:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case pI:return!(e.byteLength!=t.byteLength||!i(new us(e),new us(t)));case iI:case oI:case lI:return eo(+e,+t);case sI:return e.name==t.name&&e.message==t.message;case cI:case fI:return e==t+"";case aI:var a=eI;case uI:var c=r&nI;if(a||(a=tI),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;r|=rI,s.set(e,t);var l=Vy(a(e),a(t),r,o,i,s);return s.delete(e),l;case dI:if(lf)return lf.call(e)==lf.call(t)}return!1}function cf(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function Wy(e,t,n){var r=t(e);return On(e)?r:cf(r,n(e))}function mI(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 Hy(){return[]}var yI=Object.prototype,bI=yI.propertyIsEnumerable,Gy=Object.getOwnPropertySymbols,Ky=Gy?function(e){return e==null?[]:(e=Object(e),mI(Gy(e),function(t){return bI.call(e,t)}))}:Hy;function vI(e){return oo(e)?Kp(e):$h(e)}function Qy(e){return Wy(e,vI,Ky)}var wI=1,SI=Object.prototype,EI=SI.hasOwnProperty;function TI(e,t,n,r,o,i){var s=n&wI,a=Qy(e),c=a.length,u=Qy(t),l=u.length;if(c!=l&&!s)return!1;for(var f=c;f--;){var d=a[f];if(!(s?d in t:EI.call(t,d)))return!1}var m=i.get(e),w=i.get(t);if(m&&w)return m==t&&w==e;var v=!0;i.set(e,t),i.set(t,e);for(var T=s;++f<c;){d=a[f];var b=e[d],g=t[d];if(r)var h=s?r(g,b,d,t,e,i):r(b,g,d,e,t,i);if(!(h===void 0?b===g||o(b,g,n,r,i):h)){v=!1;break}T||(T=d=="constructor")}if(v&&!T){var y=e.constructor,S=t.constructor;y!=S&&"constructor"in e&&"constructor"in t&&!(typeof y=="function"&&y instanceof y&&typeof S=="function"&&S instanceof S)&&(v=!1)}return i.delete(e),i.delete(t),v}var AI=1,Xy="[object Arguments]",Yy="[object Array]",Ms="[object Object]",RI=Object.prototype,Jy=RI.hasOwnProperty;function _I(e,t,n,r,o,i){var s=On(e),a=On(t),c=s?Yy:$n(e),u=a?Yy:$n(t);c=c==Xy?Ms:c,u=u==Xy?Ms:u;var l=c==Ms,f=u==Ms,d=c==u;if(d&&Si(e)){if(!Si(t))return!1;s=!0,l=!1}if(d&&!l)return i||(i=new Xn),s||ds(e)?Vy(e,t,n,r,o,i):gI(e,t,c,n,r,o,i);if(!(n&AI)){var m=l&&Jy.call(e,"__wrapped__"),w=f&&Jy.call(t,"__wrapped__");if(m||w){var v=m?e.value():e,T=w?t.value():t;return i||(i=new Xn),o(v,T,n,r,i)}}return d?(i||(i=new Xn),TI(e,t,n,r,o,i)):!1}function Zy(e,t,n,r,o){return e===t?!0:e==null||t==null||!Yn(e)&&!Yn(t)?e!==e&&t!==t:_I(e,t,n,r,Zy,o)}function eb(e,t){return Zy(e,t)}const uf=(e="")=>e.split("/").map(encodeURIComponent).join("/"),II=e=>{const t=[],n=(r,o="")=>Object.keys(r).forEach(i=>{ul(r[i])?n(r[i],`${o}${i}.`):t.push(`${o}${i}`)});return n(e),t};class CI{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","text/plain","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=jl.filePreview.get(o.id.toString());if(s&&s.etag===o.etag&&eb(i,s.dimensions))return s.src;try{const a=await this.privatePreviewBlob(t,!1,!0,r);return jl.filePreview.set(o.id.toString(),{src:a,etag:o.etag,dimensions:i},0).src}catch(a){if(n)return;throw a}}buildQueryString(t){return _0.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",uf(i.webDavPath),"?",this.buildQueryString({etag:i.etag,dimensions:s,processor:a})].join("");try{const{data:f}=await this.clientService.httpAuthenticated.get(c,{responseType:"blob",signal:o});return window.URL.createObjectURL(f)}catch(f){if([425,429].includes(f.status)){const d=((l=(u=f.response)==null?void 0:u.headers)==null?void 0:l["retry-after"])||5;return await new Promise(m=>setTimeout(m,d*1e3)),this.privatePreviewBlob(t,n,r,o)}throw f}}async publicPreviewUrl(t,n){var l,f;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:d}=await this.clientService.httpUnAuthenticated.head(u,{signal:n});if(d!==404)return u}catch(d){if([425,429].includes(d.status)){const m=((f=(l=d.response)==null?void 0:l.headers)==null?void 0:f["retry-after"])||5;return await new Promise(w=>setTimeout(w,m*1e3)),this.publicPreviewUrl(t,n)}throw d}}}const Bs=me.z.enum(["fit","resize","fill","thumbnail"]);class PI{constructor({$gettext:t}){Ee(this,"$gettext");this.$gettext=t}explain(t,n){return{code:"mustNotBeEmpty",message:this.$gettext("Must not be empty"),format:[],...Et.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>0}validate(){return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class FI{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],...Et.isBoolean(n)&&{verified:n}}}assert(t,n){return Array.from(n).filter(o=>t.characters.includes(o)).length>=t.minLength}validate(t){if(!Et.isObject(t))throw new Error("options should be an object");if(!Et.isNumber(t.minLength)||Et.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");if(!Et.isString(t.characters))throw new Error("characters should be a character sequence");return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class js{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(!Et.isObject(t))throw new Error("options should be an object");if(!Et.isNumber(t.minLength)||Et.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class OI extends js{constructor(t){super(t)}explain(t,n){return{code:"atLeastCharacters",message:this.$gettext("%{param1}+ letters"),format:[t.minLength],...Et.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>=t.minLength}}class xI extends js{constructor(t){super(t)}explain(t,n){return{code:"atLeastUppercaseCharacters",message:this.$gettext("%{param1}+ uppercase letters"),format:[t.minLength],...Et.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/[A-Z\xC0-\xD6\xD8-\xDE]/g))==null?void 0:o.length)>=t.minLength}}class kI extends js{constructor(t){super(t)}explain(t,n){return{code:"atLeastLowercaseCharacters",message:this.$gettext("%{param1}+ lowercase letters"),format:[t.minLength],...Et.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/[a-z\xDF-\xF6\xF8-\xFF]/g))==null?void 0:o.length)>=t.minLength}}class NI extends js{constructor(t){super(t)}explain(t,n){return{code:"atLeastDigits",message:this.$gettext("%{param1}+ numbers"),format:[t.minLength],...Et.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/\d/g))==null?void 0:o.length)>=t.minLength}}var ff={},tb;function $I(){if(tb)return ff;tb=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,f=i.numbers,d=i.symbols,m=i.minLengthLowercase,w=i.minLengthUppercase,v=i.minLengthNumbers,T=i.minLengthSymbols,b=i.exclude,g="abcdefghijklmnopqrstuvwxyz";g=n(g,b);var h="ABCDEFGHIJKLMNOPQRSTUVWXYZ";h=n(h,b);var y="0123456789";y=n(y,b);var S="!#$%&'()*+,-./:;<=>?@[]^_{|}~";S=n(S,b);for(var E=g.length,R=0;R<m;R++)a+=g.charAt(e(E));for(E=h.length,R=0;R<w;R++)a+=h.charAt(e(E));for(E=y.length,R=0;R<v;R++)a+=y.charAt(e(E));for(E=S.length,R=0;R<T;R++)a+=S.charAt(e(E));s+=function($){for(var D=$.split(""),k=D.length-1;k>0;k--){var N=Math.floor(Math.random()*(k+1)),j=D[k];D[k]=D[N],D[N]=j}return D.join("")}(a);var I="";I=u?I+g:I,I=l?I+h:I,I=f?I+y:I,I=d?I+S:I;var A=c-s.length;for(E=I.length,R=0;R<A;R++)s+=I.charAt(e(E));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 ff.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))},ff}var DI=$I();class LI{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 OI({...this.language}),mustNotBeEmpty:new PI({...this.language}),atLeastUppercaseCharacters:new xI({...this.language}),atLeastLowercaseCharacters:new kI({...this.language}),atLeastDigits:new NI({...this.language}),mustContain:new FI({...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 I0.PasswordPolicy(r,n)}getPolicy({enforcePassword:t=!1}={}){return this.buildPolicy({enforcePassword:t}),this.policy}generatePassword(){return DI.GeneratePassword({symbols:!0,length:this.generatePasswordRules.length,minLengthLowercase:this.generatePasswordRules.minLowercaseCharacters,minLengthUppercase:this.generatePasswordRules.minUppercaseCharacters,minLengthNumbers:this.generatePasswordRules.minDigits,minLengthSymbols:this.generatePasswordRules.minSpecialCharacters})}}function MI(e){return e.charCodeAt(0).toString(32)}function nb(e){let t="";return e.replace(/[^A-Z0-9]/gi,n=>(t+=`-${MI(n)}`,"/"))+t}function rb(e,t){let n=t||"uppy";return typeof e.name=="string"&&(n+=`-${nb(e.name.toLowerCase())}`),e.type!==void 0&&(n+=`-${e.type}`),e.meta&&typeof e.meta.relativePath=="string"&&(n+=`-${nb(e.meta.relativePath.toLowerCase())}`),e.data.size!==void 0&&(n+=`-${e.data.size}`),e.data.lastModified!==void 0&&(n+=`-${e.data.lastModified}`),n}class BI{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 C0({autoProceed:!1,onBeforeFileAdded:(r,o)=>(r.id in o&&(r.meta.retry=!0),r.meta.relativePath=this.getRelativeFilePath(r),r.id=rb(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,f,d)=>{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:d(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(P0,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(F0,o)}tusActive(){return!!this.uppy.getPlugin("Tus")}useDropTarget({targetSelector:t}){this.uppy.getPlugin("DropTarget")||this.uppy.use(O0,{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 Xe.subscribe(t,n)}unsubscribe(t,n){Xe.unsubscribe(t,n)}publish(t,n){Xe.publish(t,n)}setUpEvents(){this.uppy.on("progress",t=>{this.publish("progress",t)}),this.uppy.on("upload-progress",(t,n)=>{this.publish("upload-progress",{file:t,progress:n})}),this.uppy.on("cancel-all",()=>{this.publish("uploadCancelled"),this.clearInputs()}),this.uppy.on("complete",t=>{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 rb(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 jI(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var UI=Object.getOwnPropertySymbols,qI=UI?function(e){for(var t=[];e;)cf(t,Ky(e)),e=cl(e);return t}:Hy;function ib(e){return Wy(e,hl,qI)}var VI=Object.prototype,zI=VI.hasOwnProperty;function WI(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&zI.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function HI(e,t){var n=ll(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var GI=/\w*$/;function KI(e){var t=new e.constructor(e.source,GI.exec(e));return t.lastIndex=e.lastIndex,t}var ob=Fn?Fn.prototype:void 0,sb=ob?ob.valueOf:void 0;function QI(e){return sb?Object(sb.call(e)):{}}var XI="[object Boolean]",YI="[object Date]",JI="[object Map]",ZI="[object Number]",eC="[object RegExp]",tC="[object Set]",nC="[object String]",rC="[object Symbol]",iC="[object ArrayBuffer]",oC="[object DataView]",sC="[object Float32Array]",aC="[object Float64Array]",lC="[object Int8Array]",cC="[object Int16Array]",uC="[object Int32Array]",fC="[object Uint8Array]",dC="[object Uint8ClampedArray]",pC="[object Uint16Array]",hC="[object Uint32Array]";function gC(e,t,n){var r=e.constructor;switch(t){case iC:return ll(e);case XI:case YI:return new r(+e);case oC:return HI(e);case sC:case aC:case lC:case cC:case uC:case fC:case dC:case pC:case hC:return kp(e,n);case JI:return new r;case ZI:case nC:return new r(e);case eC:return KI(e);case tC:return new r;case rC:return QI(e)}}var mC="[object Map]";function yC(e){return Yn(e)&&$n(e)==mC}var ab=Ei&&Ei.isMap,bC=ab?fl(ab):yC,vC="[object Set]";function wC(e){return Yn(e)&&$n(e)==vC}var lb=Ei&&Ei.isSet,SC=lb?fl(lb):wC,EC=1,cb="[object Arguments]",TC="[object Array]",AC="[object Boolean]",RC="[object Date]",_C="[object Error]",ub="[object Function]",IC="[object GeneratorFunction]",CC="[object Map]",PC="[object Number]",fb="[object Object]",FC="[object RegExp]",OC="[object Set]",xC="[object String]",kC="[object Symbol]",NC="[object WeakMap]",$C="[object ArrayBuffer]",DC="[object DataView]",LC="[object Float32Array]",MC="[object Float64Array]",BC="[object Int8Array]",jC="[object Int16Array]",UC="[object Int32Array]",qC="[object Uint8Array]",VC="[object Uint8ClampedArray]",zC="[object Uint16Array]",WC="[object Uint32Array]",mt={};mt[cb]=mt[TC]=mt[$C]=mt[DC]=mt[AC]=mt[RC]=mt[LC]=mt[MC]=mt[BC]=mt[jC]=mt[UC]=mt[CC]=mt[PC]=mt[fb]=mt[FC]=mt[OC]=mt[xC]=mt[kC]=mt[qC]=mt[VC]=mt[zC]=mt[WC]=!0,mt[_C]=mt[ub]=mt[NC]=!1;function Us(e,t,n,r,o,i){var s,a=t&EC;if(n&&(s=o?n(e,r,o,i):n(e)),s!==void 0)return s;if(!Qn(e))return e;var c=On(e);if(c)s=WI(e);else{var u=$n(e),l=u==ub||u==IC;if(Si(e))return xp(e,a);if(u==fb||u==cb||l&&!o)s={};else{if(!mt[u])return o?e:{};s=gC(e,u,a)}}i||(i=new Xn);var f=i.get(e);if(f)return f;i.set(e,s),SC(e)?e.forEach(function(w){s.add(Us(w,t,n,w,e,i))}):bC(e)&&e.forEach(function(w,v){s.set(v,Us(w,t,n,v,e,i))});var d=ib,m=c?void 0:d(e);return jI(m||e,function(w,v){m&&(v=w,w=e[v]),Wp(s,v,Us(w,t,n,v,e,i))}),s}function HC(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 GC(e,t){return t.length<2?e:dh(e,HC(t,0,-1))}function KC(e,t){return t=Rl(t,e),e=GC(e,t),e==null||delete e[fh(td(t))]}function QC(e){return ul(e)?void 0:e}var db=Fn?Fn.isConcatSpreadable:void 0;function XC(e){return On(e)||io(e)||!!(db&&e&&e[db])}function YC(e,t,n,r,o){var i=-1,s=e.length;for(n||(n=XC),o||(o=[]);++i<s;){var a=e[i];n(a)?cf(o,a):o[o.length]=a}return o}function JC(e){var t=e==null?0:e.length;return t?YC(e):[]}function ZC(e){return Zp(Jp(e,void 0,JC),e+"")}var eP=1,tP=2,nP=4,ki=ZC(function(e,t){var n={};if(e==null)return n;var r=!1;t=ah(t,function(i){return i=Rl(i,e),r||(r=i.length>1),i}),Hp(e,ib(e),n),r&&(n=Us(n,eP|tP|nP,QC));for(var o=t.length;o--;)KC(n,t[o]);return n});const rP=(e,t)=>{const n=(i="")=>i.split("/").filter(Boolean),r=n(e.path),o=n(t);return o.map((i,s)=>({id:Yt.v4(),allowContextActions:!0,text:i,to:{path:"/"+[...r].splice(0,r.length-o.length+s+1).join("/"),query:ki(e.query,"fileId","page")},isStaticNav:!1}))},iP=(...e)=>{const t=e.pop();return[...e,{id:Yt.v4(),allowContextActions:t.allowContextActions,text:t.text,onClick:()=>Xe.publish("app.files.list.load"),isTruncationPlaceholder:t.isTruncationPlaceholder,isStaticNav:t.isStaticNav}]};class ei{}Ee(ei,"Cut","cut"),Ee(ei,"Copy","copy");const df=e=>e.clientY===0,wo=(e,t,n)=>{var i;const r=n.$el.getBoundingClientRect(),o=df(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"&&!df(t)?t.clientX:r.x,right:t.type==="contextmenu"&&!df(t)?t.clientX:r.x})}),e.show()},qs=e=>(e||"").split("_")[0],ti=(e,t,n=Dt.DateTime.DATETIME_MED)=>e.setLocale(qs(t)).toLocaleString(n),pb=(e,t,n=Dt.DateTime.DATETIME_MED)=>ti(Dt.DateTime.fromJSDate(e),t,n),oP=(e,t,n=Dt.DateTime.DATETIME_MED)=>ti(Dt.DateTime.fromHTTP(e),t,n),hb=(e,t,n=Dt.DateTime.DATETIME_MED)=>ti(Dt.DateTime.fromISO(e),t,n),sP=(e,t,n=Dt.DateTime.DATETIME_MED)=>ti(Dt.DateTime.fromRFC2822(e),t,n),So=(e,t)=>e.setLocale(qs(t)).toRelative(),gb=(e,t)=>So(Dt.DateTime.fromJSDate(e),t),aP=(e,t)=>So(Dt.DateTime.fromHTTP(e),t),lP=(e,t)=>So(Dt.DateTime.fromISO(e),t),cP=(e,t)=>So(Dt.DateTime.fromRFC2822(e),t),uP=1048576,En=(e,t)=>{const n=typeof e=="string"?parseInt(e):e;return n<0?"--":isNaN(n)?"?":R0.filesize(n,{round:n<uP?0:1,locale:qs(t),base:10,output:"string"})};function mb(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 yt=(e=>(e.open="sidebar.open",e.close="sidebar.close",e.toggle="sidebar.toggle",e.openWithPanel="sidebar.openWithPanel",e.setActivePanel="sidebar.setActivePanel",e))(yt||{});const pf=(e,t=void 0)=>{const n=window.localStorage.getItem(e),r=oe(t);if(n)try{r.value=JSON.parse(n)}catch{r.value=n}return Tt(()=>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},ni=()=>{const e=st(),t=U(()=>{var d;return(d=e.options.embed)==null?void 0:d.enabled}),n=U(()=>{var d;return((d=e.options.embed)==null?void 0:d.target)==="location"}),r=U(()=>{var d;return(d=e.options.embed)==null?void 0:d.chooseFileName}),o=U(()=>{var d;return(d=e.options.embed)==null?void 0:d.chooseFileNameSuggestion}),i=U(()=>{var d;return((d=e.options.embed)==null?void 0:d.target)==="file"}),s=U(()=>{var d;return(d=e.options.embed)==null?void 0:d.fileTypes}),a=U(()=>{var d;return(d=e.options.embed)==null?void 0:d.messagesOrigin}),c=U(()=>{var d;return p(t)&&((d=e.options.embed)==null?void 0:d.delegateAuthentication)}),u=U(()=>{var d;return(d=e.options.embed)==null?void 0:d.delegateAuthenticationOrigin});return{isEnabled:t,isLocationPicker:n,chooseFileName:r,chooseFileNameSuggestion:o,isFilePicker:i,messagesTargetOrigin:a,isDelegatingAuthentication:c,fileTypes:s,postMessage:(d,m)=>{const w={};p(a)&&(w.targetOrigin=p(a)),window.parent.postMessage({name:d,data:m},w)},verifyDelegatedAuthenticationOrigin:d=>p(u)?p(u)===d:!0}},yb=e=>{const{isEnabled:t}=ni(),n=(e==null?void 0:e.bus)||Xe,r=pf("oc_sideBarOpen",!1),o=oe(!1),i=U({get(){return p(t)?p(o):p(r)},set(w){if(p(t)){o.value=w;return}r.value=w}}),s=async()=>{await Gn();const w=document.getElementById("app-sidebar");w&&w.focus()},a=oe(null),c=n.subscribe(yt.toggle,()=>{i.value=!p(i),p(i)&&s()}),u=n.subscribe(yt.close,()=>{i.value=!1,a.value=null}),l=n.subscribe(yt.open,()=>{i.value=!0,a.value=null,s()}),f=n.subscribe(yt.openWithPanel,w=>{i.value=!0,a.value=w,s()}),d=n.subscribe(yt.setActivePanel,w=>{a.value=w});jn(()=>{n.unsubscribe(yt.toggle,c),n.unsubscribe(yt.close,u),n.unsubscribe(yt.open,l),n.unsubscribe(yt.openWithPanel,f),n.unsubscribe(yt.setActivePanel,d)});const m=(w,v)=>{n.subscribe(yt.setActivePanel,T=>{w===T&&setTimeout(()=>{v(T)},100)})};return{isSideBarOpen:lr(i),sideBarActivePanel:lr(a),onPanelActive:m}},tr=e=>e,bb=e=>ee.ShareTypes.containsAnyValue(ee.ShareTypes.authenticated,e??[]),vb=e=>ee.ShareTypes.containsAnyValue(ee.ShareTypes.unauthenticated,e??[]),fP=({isDirect:e})=>tr(e?"This item is directly shared with others.":"This item is shared with others through one of the parent folders."),dP=({isDirect:e})=>tr(e?"This item is directly shared via links.":"This item is shared via links through one of the parent folders."),pP=({resource:e,isDirect:t})=>({id:`files-sharing-${e.getDomSelector()}`,accessibleDescription:fP({isDirect:t}),label:tr("Show invited people"),icon:"group",category:"sharing",type:t?"user-direct":"user-indirect",fillType:"line",handler:()=>{Xe.publish(yt.openWithPanel,"sharing#peopleShares")}}),hP=({resource:e,isDirect:t})=>({id:`file-link-${e.getDomSelector()}`,accessibleDescription:dP({isDirect:t}),label:tr("Show links"),icon:"link",category:"sharing",type:t?"link-direct":"link-indirect",fillType:"line",handler:()=>{Xe.publish(yt.openWithPanel,"sharing#linkShares")}}),gP=({resource:e})=>({id:`resource-locked-${e.getDomSelector()}`,accessibleDescription:tr("Item locked"),label:tr("This item is locked"),icon:"lock",category:"system",type:"resource-locked",fillType:"line"}),mP=({resource:e})=>({id:`resource-processing-${e.getDomSelector()}`,accessibleDescription:tr("Item in processing"),label:tr("This item is in processing"),icon:"loop-right",category:"system",type:"resource-processing",fillType:"line"}),Eo=({space:e,resource:t,ancestorMetaData:n,user:r})=>{const o=[];if(t.locked&&o.push(gP({resource:t})),t.processing&&o.push(mP({resource:t})),ee.isProjectSpaceResource(e)&&e.isMember(r)||ee.isPersonalSpaceResource(e)&&e.isOwner(r)){const s=Object.values(n).reduce((u,l)=>(u.push(...l.shareTypes||[]),u),[]),a=bb(t.shareTypes);(a||bb(s))&&o.push(pP({resource:t,isDirect:a}));const c=vb(t.shareTypes);(c||vb(s))&&o.push(hP({resource:t,isDirect:c}))}return o},wb=e=>new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=o=>n(o),r.readAsArrayBuffer(e)}),Sb=e=>new Promise(t=>e.toBlob(t)),rt=He.defineStore("messages",()=>{const e=oe([]),t=i=>{const s={...i,id:Yt.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(a=>a!==null).map(a=>`X-Request-Id: ${a}`).join(`\r
51
- `)};return{messages:e,showMessage:t,showErrorMessage:i=>{const s={id:Yt.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)}}}),To=He.defineStore("clipboard",()=>{const{$gettext:e}=Ne.useGettext(),{showMessage:t}=rt(),n=oe(),r=oe([]);return{action:n,resources:r,copyResources:a=>{a[0].canDownload()&&(n.value=ei.Copy,r.value=a,t({title:e("Copied to clipboard!"),status:"success"}))},cutResources:a=>{a[0].canDownload()&&(n.value=ei.Cut,r.value=a,t({title:e("Cut to clipboard!"),status:"success"}))},clearClipboard:()=>{n.value=void 0,r.value=[]}}}),Eb={cernFeatures:!1,concurrentRequests:{resourceBatchActions:4,shares:{create:4,list:2},sse: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=He.defineStore("config",()=>{const e=Zn(),t=oe(""),n=oe(""),r=oe({...Eb}),o=oe([]),i=oe([]),s=oe([]),a=oe(),c=oe(),u=oe(),l=oe([]),f=oe([]),d=U(()=>ee.urlJoin(p(t)||window.location.origin,{trailingSlash:!0})),m=U(()=>!!p(a)),w=U(()=>!!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:f,serverUrl:d,loadConfig:T=>{var b;T.server&&(t.value=(b=T.server)!=null&&b.endsWith("/")?T.server:T.server+"/"),o.value=T.apps||[],s.value=T.customTranslations||[],a.value=T.auth,c.value=T.openIdConnect,u.value=T.sentry,l.value=T.scripts||[],f.value=T.styles||[],n.value=T.theme,T.options&&(r.value=ao({...Eb},T.options),p(r).ocm.openRemotely=p(r).cernFeatures,p(r).routing.idBased=!p(r).cernFeatures,p(r).routing.fullShareOwnerPaths=p(r).cernFeatures),T.external_apps&&(i.value=T.external_apps,T.external_apps.filter(Boolean).forEach(g=>{e.loadExternalAppConfig({appId:g.id,config:g.config})}))}}}),yP=me.z.object({url:me.z.string()}),bP=me.z.object({apiUrl:me.z.string().optional(),authUrl:me.z.string().optional(),clientId:me.z.string().optional(),clientSecret:me.z.string().optional(),logoutUrl:me.z.string().optional(),metaDataUrl:me.z.string().optional(),url:me.z.string().optional()}),vP=me.z.object({authority:me.z.string().optional(),client_id:me.z.string().optional(),client_secret:me.z.string().optional(),dynamic:me.z.string().optional(),metadata_url:me.z.string().optional(),post_logout_redirect_uri:me.z.string().optional(),response_type:me.z.string().optional(),scope:me.z.string().optional()}).passthrough(),wP=me.z.record(me.z.any()),SP=me.z.object({href:me.z.string().optional()}),EP=me.z.object({async:me.z.boolean().optional(),src:me.z.string().optional()}),TP=me.z.object({cernFeatures:me.z.boolean().optional(),concurrentRequests:me.z.object({resourceBatchActions:me.z.number().optional(),sse:me.z.number().optional(),shares:me.z.object({create:me.z.number().optional(),list:me.z.number().optional()}).optional()}).optional(),contextHelpers:me.z.boolean().optional(),contextHelpersReadMore:me.z.boolean().optional(),defaultExtension:me.z.string().optional(),disabledExtensions:me.z.array(me.z.string()).optional(),disableFeedbackLink:me.z.boolean().optional(),accountEditLink:me.z.object({href:me.z.string().optional()}).optional(),editor:me.z.object({autosaveEnabled:me.z.boolean().optional(),autosaveInterval:me.z.number().optional(),openAsPreview:me.z.union([me.z.boolean(),me.z.array(me.z.string())]).optional()}).optional(),embed:me.z.object({enabled:me.z.boolean().optional(),target:me.z.string().optional(),messagesOrigin:me.z.string().optional(),delegateAuthentication:me.z.boolean().optional(),delegateAuthenticationOrigin:me.z.string().optional(),fileTypes:me.z.array(me.z.string()).optional(),chooseFileName:me.z.boolean().optional(),chooseFileNameSuggestion:me.z.string().optional()}).optional(),feedbackLink:me.z.object({ariaLabel:me.z.string().optional(),description:me.z.string().optional(),href:me.z.string().optional()}).optional(),isRunningOnEos:me.z.boolean().optional(),loginUrl:me.z.string().optional(),logoutUrl:me.z.string().optional(),ocm:me.z.object({openRemotely:me.z.boolean().optional()}).optional(),routing:me.z.object({fullShareOwnerPaths:me.z.boolean().optional(),idBased:me.z.boolean().optional()}).optional(),runningOnEos:me.z.boolean().optional(),tokenStorageLocal:me.z.boolean().optional(),upload:me.z.object({companionUrl:me.z.string().optional()}).optional(),userListRequiresFilter:me.z.boolean().optional(),hideLogo:me.z.boolean().optional()}),AP=me.z.object({id:me.z.string(),path:me.z.string(),config:me.z.record(me.z.unknown()).optional()}),RP=me.z.object({server:me.z.string(),theme:me.z.string(),options:TP,apps:me.z.array(me.z.string()).optional(),external_apps:me.z.array(AP).optional(),customTranslations:me.z.array(yP).optional(),auth:bP.optional(),openIdConnect:vP.optional(),sentry:wP.optional(),scripts:me.z.array(EP).optional(),styles:me.z.array(SP).optional()}),Tb=He.defineStore("extensionPreferences",()=>{const e=Mr.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}}}),Ni=He.defineStore("extensionRegistry",()=>{const e=st(),t=oe([]),n=u=>{t.value.push(u)},r=u=>{t.value=p(t).map(l=>oe(p(l).filter(({id:f})=>!u.includes(f)))).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(f=>{var d;return f.type===u.extensionType&&!e.options.disabledExtensions.includes(f.id)&&(!f.extensionPointIds||((d=f.extensionPointIds)==null?void 0:d.includes(u.id)))}))},i=oe([]);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=>oe(p(l).filter(({id:f})=>!u.includes(f)))).filter(l=>p(l).length)},getExtensionPoints:(u={})=>p(i).flatMap(l=>p(l).filter(f=>!(Object.hasOwn(u,"extensionType")&&f.extensionType!==u.extensionType)))}}),bt=He.defineStore("modals",()=>{const e=oe([]),t=U(()=>p(e).at(-1)),n=c=>p(e).find(u=>u.id===c);return{modals:e,activeModal:t,dispatchModal:c=>{const u={...c,id:Yt.v4()};return e.value.push(u),u},updateModal:(c,u,l)=>{const f=n(c);f[u]=l},removeModal:c=>{e.value=p(e).filter(u=>u.id!==c)},removeAllModals:()=>{e.value=[]},setModalActive:c=>{const u=p(e).findIndex(f=>f.id===c);if(u<0)return;const l=n(c);p(e).splice(u,1),e.value.push(l)}}}),vt=He.defineStore("user",()=>{const e=oe();return{user:e,setUser:r=>{e.value=r,k0.setUser({username:r.onPremisesSamAccountName})},reset:()=>{e.value=null}}}),Vs=(e,t)=>{t!==void 0&&document.querySelector(":root").style.setProperty("--oc-"+e,t)},_P="thead-clicked",IP="highlight",CP="rowMounted",PP="contextmenuClicked",Ab="itemDropped",FP="itemDragged",OP=["xsmall","small","medium","large","xlarge","xxlarge","xxxlarge"],xP={xxxsmall:"xxxs",xxsmall:"xxs",xsmall:"xs",small:"s",medium:"m",large:"l",xlarge:"xl",xxlarge:"xxl",xxxlarge:"xxxl",remove:"rm"};function ri(e){return xP[e]}function kP(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 NP(e){return function(t){return e==null?void 0:e[t]}}var $P={À:"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"},DP=NP($P),LP=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,MP="\\u0300-\\u036f",BP="\\ufe20-\\ufe2f",jP="\\u20d0-\\u20ff",UP=MP+BP+jP,qP="["+UP+"]",VP=RegExp(qP,"g");function zP(e){return e=Al(e),e&&e.replace(LP,DP).replace(VP,"")}var WP=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function HP(e){return e.match(WP)||[]}var GP=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function KP(e){return GP.test(e)}var Rb="\\ud800-\\udfff",QP="\\u0300-\\u036f",XP="\\ufe20-\\ufe2f",YP="\\u20d0-\\u20ff",JP=QP+XP+YP,_b="\\u2700-\\u27bf",Ib="a-z\\xdf-\\xf6\\xf8-\\xff",ZP="\\xac\\xb1\\xd7\\xf7",eF="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",tF="\\u2000-\\u206f",nF=" \\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",Cb="A-Z\\xc0-\\xd6\\xd8-\\xde",rF="\\ufe0e\\ufe0f",Pb=ZP+eF+tF+nF,Fb="['’]",Ob="["+Pb+"]",iF="["+JP+"]",xb="\\d+",oF="["+_b+"]",kb="["+Ib+"]",Nb="[^"+Rb+Pb+xb+_b+Ib+Cb+"]",sF="\\ud83c[\\udffb-\\udfff]",aF="(?:"+iF+"|"+sF+")",lF="[^"+Rb+"]",$b="(?:\\ud83c[\\udde6-\\uddff]){2}",Db="[\\ud800-\\udbff][\\udc00-\\udfff]",$i="["+Cb+"]",cF="\\u200d",Lb="(?:"+kb+"|"+Nb+")",uF="(?:"+$i+"|"+Nb+")",Mb="(?:"+Fb+"(?:d|ll|m|re|s|t|ve))?",Bb="(?:"+Fb+"(?:D|LL|M|RE|S|T|VE))?",jb=aF+"?",Ub="["+rF+"]?",fF="(?:"+cF+"(?:"+[lF,$b,Db].join("|")+")"+Ub+jb+")*",dF="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pF="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",hF=Ub+jb+fF,gF="(?:"+[oF,$b,Db].join("|")+")"+hF,mF=RegExp([$i+"?"+kb+"+"+Mb+"(?="+[Ob,$i,"$"].join("|")+")",uF+"+"+Bb+"(?="+[Ob,$i+Lb,"$"].join("|")+")",$i+"?"+Lb+"+"+Mb,$i+"+"+Bb,pF,dF,xb,gF].join("|"),"g");function yF(e){return e.match(mF)||[]}function bF(e,t,n){return e=Al(e),t=t,t===void 0?KP(e)?yF(e):HP(e):e.match(t)||[]}var vF="['’]",wF=RegExp(vF,"g");function SF(e){return function(t){return kP(bF(zP(t).replace(wF,"")),e,"")}}var qb=SF(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Vb=me.z.object({name:me.z.string().optional(),slogan:me.z.string().optional(),logo:me.z.string().optional(),urls:me.z.object({accessDeniedHelp:me.z.string(),imprint:me.z.string(),privacy:me.z.string()}).optional(),shareRoles:me.z.record(me.z.string(),me.z.object({iconName:me.z.string()})).optional()}),EF=me.z.object({breakpoints:me.z.record(me.z.string()).optional(),roles:me.z.record(me.z.string()).optional(),colorPalette:me.z.record(me.z.string()).optional(),fontFamily:me.z.string().optional(),fontSizes:me.z.record(me.z.string()).optional(),sizes:me.z.record(me.z.string()).optional(),spacing:me.z.record(me.z.string()).optional()}),zb=Vb.extend({designTokens:EF.optional(),favicon:me.z.string().optional(),background:me.z.string().optional()}),TF=zb.extend({isDark:me.z.boolean(),label:me.z.string()}),Wb=me.z.object({defaults:zb,themes:me.z.array(TF)}),AF=me.z.object({common:Vb.optional(),clients:me.z.object({web:Wb})}),RF="oc_currentThemeName",ii=He.defineStore("theme",()=>{const e=Mr.useLocalStorage(RF,null),t=Mr.usePreferredDark(),n=oe(),r=oe([]),o=l=>{const f=ed(l.common,l.clients.web.defaults);r.value=l.clients.web.themes.map(d=>ed(f,d)),i()},i=()=>{const l=p(r).find(d=>!d.isDark),f=p(r).find(d=>d.isDark);c(p(r).find(d=>d.label===p(e))||(p(t)?f:l)||p(r)[0],!1)},s=()=>{e.value=null,i()},a=U(()=>e.value===null),c=(l,f=!0)=>{var m,w,v,T,b,g;n.value=l,f&&(e.value=p(n).label);const d=[{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"}];Vs("font-family",p(n).designTokens.fontFamily),d.forEach(h=>{for(const y in p(n).designTokens[h.name])Vs(`${h.prefix}-${qb(y)}`,p(n).designTokens[h.name][y])}),(w=(m=p(n).designTokens)==null?void 0:m.roles)!=null&&w.chrome||(Vs("role-chrome",(T=(v=p(n).designTokens)==null?void 0:v.roles)==null?void 0:T.surfaceContainer),Vs("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 f;return((f=p(n).shareRoles[l.id])==null?void 0:f.iconName)||"user"}}}),jt=He.defineStore("shares",()=>{const e=Ke(),{getRoleIcon:t}=ii(),n=oe(!1),r=oe([]),o=oe([]),i=oe({}),s=I=>{i.value=I.reduce((A,$)=>(A[$.id]={...$,icon:t($)},A),{})},a=I=>{const A=p(r).find(({id:$})=>$===I.id);if(A){Object.assign(A,I);return}p(r).push(I)},c=I=>{r.value=I},u=I=>{p(r).push(...I)},l=I=>{r.value=p(r).filter(({id:A})=>A!==I.id)},f=()=>{r.value=[],o.value=[],n.value=void 0},d=()=>{const I=Object.values(e.ancestorMetaData).map(({id:A})=>A);if(!I.length){r.value=[],o.value=[];return}p(r).forEach(A=>{I.includes(A.resourceId)||l(A)}),p(o).forEach(A=>{I.includes(A.resourceId)||v(A)})},m=I=>{o.value=I},w=I=>{const A=p(o).find(({id:$})=>$===I.id);if(A){Object.assign(A,I);return}p(o).push(I)},v=I=>{o.value=p(o).filter(({id:A})=>A!==I.id)},T=I=>{n.value=I},b=I=>{const A=N=>{const j=new Set;return N.forEach(W=>{j.add(W.shareType)}),Array.from(j)},$=[...e.resources,e.currentFolder].find(N=>(N==null?void 0:N.id)===I);if(!$||ee.isProjectSpaceResource($))return;const D=[...p(r),...p(o)];e.updateResourceField({id:$.id,field:"shareTypes",value:A(D.filter(N=>!N.indirect))});const k=e.getAncestorById(I);k&&e.updateAncestorField({path:k.path,field:"shareTypes",value:A(D.filter(N=>!N.indirect))})};return{loading:n,collaboratorShares:r,linkShares:o,graphRoles:i,setGraphRoles:s,setLoading:T,setCollaboratorShares:c,setLinkShares:m,removeOrphanedShares:d,pruneShares:f,addShare:async({clientService:I,space:A,resource:$,options:D})=>{const N=await I.graphAuthenticated.permissions.createInvite(A.id,$.id,D,p(i));return u([N]),b($.id),e.loadIndicators(A,$.id),N},updateShare:async({clientService:I,space:A,resource:$,collaboratorShare:D,options:k})=>{const N=I.graphAuthenticated.permissions,j={roles:k.roles,expirationDateTime:k.expirationDateTime},W=await N.updatePermission(A.id,$.id,D.id,j,p(i));return a(W),W},deleteShare:async({clientService:I,space:A,resource:$,collaboratorShare:D,loadIndicators:k=!1})=>{await I.graphAuthenticated.permissions.deletePermission(A.id,$.id,D.id),l(D),b($.id),k&&e.loadIndicators(A,$.id)},addLink:async({clientService:I,space:A,resource:$,options:D})=>{const N=await I.graphAuthenticated.permissions.createLink(A.id,$.id,D),j=e.selectedResources,W=j.some(({fileId:X})=>X===$.fileId)||j.length===0&&e.currentFolder.fileId===$.fileId;if(w(N),b($.id),!W){const X=e.ancestorMetaData[$.path]??null;if(X){const{shareTypes:ie}=X;ie.includes(ee.ShareTypes.link.value)||e.updateAncestorField({path:X.path,field:"shareTypes",value:[...ie,ee.ShareTypes.link.value]})}}return e.loadIndicators(A,$.id),N},updateLink:async({clientService:I,space:A,resource:$,linkShare:D,options:k})=>{const N=I.graphAuthenticated.permissions;let j;if(Object.hasOwn(k,"password"))j=await N.setPermissionPassword(A.id,$.id,D.id,{password:k.password}),D.hasPassword=!!k.password;else{const W={link:{...k.type&&{type:k.type},...k.displayName&&{"@libre.graph.displayName":k.displayName}},...Object.hasOwn(k,"expirationDateTime")&&{expirationDateTime:k.expirationDateTime}};j=await N.updatePermission(A.id,$.id,D.id,W)}return w(j),j},deleteLink:async({clientService:I,space:A,resource:$,linkShare:D,loadIndicators:k=!1})=>{await I.graphAuthenticated.permissions.deletePermission(A.id,$.id,D.id),v(D),b($.id),k&&e.loadIndicators(A,$.id)}}}),Hb=e=>e.sort((t,n)=>n.permissions.length-t.permissions.length),Ao=async({graphClient:e,driveType:t,configStore:n,graphRoles:r,signal:o})=>{var c;const i=await e.drives.listMyDrives(r,{orderBy:"name asc",filter:`driveType eq ${t}`},{signal:o});if(!i.length)return[];if(t!=="mountpoint"||!((c=n.options.routing)!=null&&c.fullShareOwnerPaths))return i;const s={};i.forEach(u=>{const{rootId:l,driveAlias:f}=u.root.remoteItem;s[l]=f});const a=Object.entries(s).map(([u,l])=>ee.buildSpace({id:ee.extractStorageId(u),name:l,driveType:l.split("/")[0],driveAlias:l,path:"/",serverUrl:n.serverUrl},r));return[...i,...a]},lt=He.defineStore("spaces",()=>{const e=vt(),t=st(),n=jt(),r=oe([]),o=oe(),i=oe(!1),s=oe(!1),a=oe(!1),c=oe(null),u=oe([]),l=U(()=>p(r).find(j=>ee.isPersonalSpaceResource(j)&&j.isOwner(e.user))),f=j=>{i.value=j},d=j=>{s.value=j},m=j=>{a.value=j},w=j=>{o.value=j},v=j=>{c.value=j},T=j=>{if(!ee.isProjectSpaceResource(j))return[];const W=n.collaboratorShares.filter(X=>X.resourceId===j.id);return Hb(W)},b=j=>{p(r).push(...j)},g=j=>{r.value=p(r).filter(({id:W})=>W!==j.id)},h=j=>p(r).find(W=>j==W.id),y=async({graphClient:j,space:W,signal:X})=>(await A({graphClient:j,signal:X}),p(r).find(ie=>{var de,se;return ee.isMountPointSpaceResource(ie)&&((se=(de=ie.root)==null?void 0:de.remoteItem)==null?void 0:se.id)===W.id})),S=({driveAliasPrefix:j,id:W,shareName:X})=>{const ie=ee.buildShareSpaceResource({driveAliasPrefix:j,id:W,shareName:X,serverUrl:t.serverUrl});return b([ie]),ie},E=j=>{const W=p(r).find(({id:X})=>X===j.id);if(W){Object.assign(W,j);return}b([j])},R=({id:j,field:W,value:X})=>{const ie=p(r).find(de=>j===de.id);ie&&(ie[W]=X)},I=async({graphClient:j})=>{a.value=!0;try{const[W,X]=await Promise.all([Ao({graphClient:j,driveType:"personal",configStore:t,graphRoles:n.graphRoles}),Ao({graphClient:j,driveType:"project",configStore:t,graphRoles:n.graphRoles})]);b([...W,...X]),i.value=!0}finally{a.value=!1}},A=async({graphClient:j,signal:W})=>{if(!p(s))try{const X=await Ao({graphClient:j,driveType:"mountpoint",configStore:t,graphRoles:n.graphRoles,signal:W});b(X)}finally{s.value=!0}};return{spaces:r,spacesInitialized:i,mountPointsInitialized:s,spacesLoading:a,currentSpace:o,personalSpace:l,defaultSpaceImageBlobURL:c,imagesLoading:u,getSpace:h,createShareSpace:S,setSpacesInitialized:f,setMountPointsInitialized:d,setSpacesLoading:m,setCurrentSpace:w,setDefaultSpaceImageBlobURL:v,getSpaceMembers:T,getMountPointForSpace:y,addSpaces:b,removeSpace:g,upsertSpace:E,updateSpaceField:R,loadSpaces:I,loadMountPoints:A,reloadProjectSpaces:async({graphClient:j,signal:W})=>{const X=await Ao({graphClient:j,driveType:"project",configStore:t,graphRoles:n.graphRoles,signal:W});r.value=p(r).filter(ie=>!ee.isProjectSpaceResource(ie)),b(X)},addToImagesLoading:j=>{p(u).includes(j)||p(u).push(j)},removeFromImagesLoading:j=>{u.value=p(u).filter(W=>W!==j)},purgeImagesLoading:()=>{u.value=[]}}}),Ke=He.defineStore("resources",()=>{const e=st(),t=lt(),n=vt(),r=oe([]),o=oe(),i=oe({}),s=oe([]),a=U(()=>{let _=p(r);return p(k)||(_=_.filter(F=>!F.name.startsWith("."))),_}),c=U(()=>{const _=p(r).filter(({type:V})=>V==="file").length,F=p(r).filter(({type:V,name:ce})=>V==="file"&&ce.startsWith(".")).length,K=p(r).filter(({type:V})=>V==="folder").length,z=p(r).filter(({type:V,name:ce})=>V==="folder"&&ce.startsWith(".")).length,B=p(r).filter(ee.isProjectSpaceResource).length;return{files:_,hiddenFiles:F,folders:K,hiddenFolders:z,spaces:B}}),u=_=>{r.value=_},l=_=>{r.value=p(r).filter(F=>!_.find(({id:K})=>K===F.id))},f=()=>{r.value=[]},d=_=>{const F=p(r).find(({id:K})=>K===_.id);if(F){Object.assign(F,_);return}p(r).push(_)},m=_=>{const F=p(r).filter(K=>!_.some(z=>z.path===K.path));r.value=[...F,..._]},w=({id:_,field:F,value:K})=>{const z=p(r).find(B=>_===B.id);z&&(z[F]=K)},v=_=>{o.value=_},T=()=>{o.value=void 0},b=_=>{r.value=_.resources,o.value=_.currentFolder},g=()=>{r.value=[],o.value=void 0,h.value=[]},h=oe([]),y=oe(null),S=U(()=>p(r).filter(_=>p(h).includes(_.id))),E=_=>{const F=_.find(K=>!p(h).includes(K));F&&(y.value=F),h.value=_},R=_=>{y.value=_,p(h).includes(_)||p(h).push(_)},I=_=>{y.value=_,p(h).includes(_)&&(h.value=p(h).filter(F=>F!==_))},A=_=>{p(h).includes(_)?I(_):R(_)},$=()=>{h.value=[]},D=_=>{y.value=_},k=oe(!0),N=oe(!0),j=oe(!1),W=oe(!0),X=_=>{k.value=_,window.localStorage.setItem("oc_hiddenFilesShown",_.toString())},ie=_=>{N.value=_,window.localStorage.setItem("oc_fileExtensionsShown",_.toString())},de=_=>{j.value=_,window.localStorage.setItem("oc_webDavDetailsShown",_.toString())},se=_=>{W.value=_,window.localStorage.setItem("oc_disabledSpacesShown",_.toString())},we=(_,F)=>{const K=p(r).filter(z=>[z.id,z.parentFolderId].includes(F));for(const z of K){const B=Eo({space:_,resource:z,ancestorMetaData:p(i),user:n.user});!B.length&&!z.indicators.length||w({id:z.id,field:"indicators",value:B})}},Se=_=>{i.value=_};return{resources:r,currentFolder:o,activeResources:a,totalResourcesCount:c,setResources:u,removeResources:l,clearResources:f,upsertResource:d,upsertResources:m,updateResourceField:w,setCurrentFolder:v,clearCurrentFolder:T,initResourceList:b,clearResourceList:g,selectedIds:h,latestSelectedId:y,selectedResources:S,setSelection:E,addSelection:R,removeSelection:I,toggleSelection:A,resetSelection:$,setLastSelectedId:D,areHiddenFilesShown:k,areFileExtensionsShown:N,areWebDavDetailsShown:j,areDisabledSpacesShown:W,setAreHiddenFilesShown:X,setAreFileExtensionsShown:ie,setAreWebDavDetailsShown:de,setAreDisabledSpacesShown:se,loadIndicators:we,ancestorMetaData:i,setAncestorMetaData:Se,updateAncestorField:({path:_,field:F,value:K})=>{const z=p(i)[_]??null;z&&(z[F]=K)},loadAncestorMetaData:({folder:_,space:F,client:K,signal:z})=>{const B={[_.path]:{id:_.fileId,shareTypes:_.shareTypes,parentFolderId:_.parentFolderId,spaceId:F.id,path:_.path}},V=[],ce=[qe.FileId,qe.ShareTypes,qe.FileParent],Re=mb(_.path),Le=t.spaces,ke=()=>Le.filter(Be=>ee.isMountPointSpaceResource(Be)&&ee.extractStorageId(Be.root.remoteItem.rootId)===F.id);let Pe=!0;if(e.options.routing.fullShareOwnerPaths){const Be=Le.find(he=>ee.isProjectSpaceResource(he)&&he.id===F.id);Pe=F.isOwner(n.user)||(Be==null?void 0:Be.isMember(n.user))}for(const Be of Re){const he=p(i)[Be]??null;if((he==null?void 0:he.spaceId)===F.id){B[Be]=he;continue}if(!Pe&&!ke().find(ae=>Be.startsWith(ae.root.remoteItem.path)))break;V.push(K.listFiles(F,{path:Be},{depth:0,davProperties:ce,signal:z}).then(({resource:ae})=>{B[Be]={id:ae.fileId,shareTypes:ae.shareTypes,parentFolderId:ae.parentFolderId,spaceId:F.id,path:Be}}))}return Promise.all(V).then(()=>{if(!Object.keys(B).includes("/")){const Be=p(i)["/"];if((Be==null?void 0:Be.spaceId)===F.id)B["/"]=Be;else{const{parentFolderId:he}=Object.values(B)[0],ae=t.spaces.find(({id:$e})=>he.startsWith($e));ae&&(B["/"]={id:ae.id,shareTypes:ae.shareTypes,parentFolderId:ae.id,spaceId:ae.id,path:"/"})}}Se(B)})},getAncestorById:_=>Object.values(p(i)).find(F=>_===F.id),deleteQueue:s,addResourcesIntoDeleteQueue:_=>{s.value=s.value.concat(_.filter(F=>!p(s).includes(F)))},removeResourcesFromDeleteQueue:_=>{s.value=s.value.filter(F=>!_.includes(F))}}}),Ro=He.defineStore("webWorkers",()=>{const e=oe([]);return{createWorker:(i,{needsTokenRenewal:s=!1}={})=>{const a=Yt.v4(),c=Mr.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}`}}))})}}}),zs=(e={})=>{const t=e.router||ze(),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=Jn(o,i,{configStore:n});return t.replace(c),!0}}},Ws=()=>{const e=en();return U(()=>p(e).name)},Gb=(e,t)=>{const n=en();return U(()=>p(n).meta[e]||t)},Hs=(e,t)=>{const n=ze();return U({get(){return St(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 Kb=Promise.resolve();const on=(e,t)=>{const n=ze();return U({get(){return p(n.currentRoute).query[e]||t},set(r){if(p(n.currentRoute).query[e]===r)return;Kb=Kb.then(async()=>{try{await n.replace({path:p(n.currentRoute).path,query:{...p(n.currentRoute).query,[e]:r}})}catch{}})}})},wr=e=>{const t=on(e.name),n=pf(_F(e));return Tt(()=>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:St(r.value)),["storage","default"].includes(r.source)&&(t.value=r.value)},{immediate:!0}),t},_F=e=>["oc-options",e.storagePrefix,e.name].filter(Boolean).join("_"),Sr=(e,...t)=>{const n=oe(!1),r=ze(),o=en();return Tt(o,()=>{n.value=e(r,...t)},{immediate:!0}),n},Gs="contextRouteName",hf="contextRouteParams",gf="contextRouteQuery",Ks=e=>{var i;const{params:t,query:n}=e,r={},o=["fileId","shareId","q_share-visibility"].concat(((i=e.meta)==null?void 0:i.contextQueryItems)||[]);for(const s of o)r[s]=n[s];return{[Gs]:e.name,[hf]:t,[gf]:r}},Qb=e=>({routeName:St(e[Gs]),routeParams:e[hf],routeQuery:e[gf]}),St=e=>Array.isArray(e)?e[0].toString():e==null?void 0:e.toString();function Xb({router:e,currentFileContext:t}){const n=a=>{const{fileName:c,routeName:u,routeParams:l,routeQuery:f}=p(a);return p(u)?e.push({name:p(u),params:p(l),query:{...p(f),scrollTo:p(c)}}):e.push({path:"/"})},{replaceInvalidFileRoute:r}=zs({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=oe(!1);return{replaceInvalidFileRoute:o,closeApp:()=>(i.value=!0,n(t)),closed:i}}const Ye=()=>mr("$clientService");function mf({clientService:e}){e=e||Ye();const t=rn(),n=vt();return{getUrlForResource:(c,u,l)=>{var f;return e.webdav.getFileUrl(c,u,{isUrlSigningEnabled:t.supportUrlSigning,username:(f=n.user)==null?void 0:f.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 yf=()=>mr("$authService");class Er{}Ee(Er,"allFiles","all-files"),Ee(Er,"currentFolder","current-folder");const bf=()=>{const e=st(),t=Ye(),n=lt(),r=Ke(),o=rn(),i=U(()=>{var d;return(d=o.searchContent)==null?void 0:d.enabled}),s=U(()=>r.areHiddenFilesShown),a=U(()=>n.spaces.filter(ee.isProjectSpaceResource)),c=d=>p(a).find(m=>m.id===d),u=un.useTask(function*(d,m,w=null){if(e.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:t.graphAuthenticated,signal:d})),!m)return{totalResults:null,values:[]};const{resources:v,totalResults:T}=yield*ee.call(t.webdav.search(m,{searchLimit:w,davProperties:vs.Default,signal:d}));return{totalResults:T,values:v.map(b=>{const g=c(b.parentFolderId),h=g||b;return e.options.routing.fullShareOwnerPaths&&h.remoteItemPath&&(h.path=ee.urlJoin(h.remoteItemPath,h.path)),{id:h.id,data:h}}).filter(({data:b})=>!b.name.startsWith(".")||p(s))}}).restartable();return{search:async(d,m=null)=>await u.perform(d,m),buildSearchTerm:({term:d,isTitleOnlySearch:m,tags:w,lastModified:v,mediaType:T,scope:b,useScope:g})=>{const h=[],y=d,S=p(i)&&!m;if(y){let E=`name:"*${y}*"`;S&&(E=`(name:"*${y}*" OR content:"${y}")`),h.push(E)}if(g&&b&&h.push(`scope:${b}`),w){const E=w.split("+").map(R=>`"${R}"`);h.push(`tag:(${E.join(" OR ")})`)}if(v&&h.push(`mtime:${v}`),T){const E=T.split("+").map(R=>`"${R}"`);h.push(`mediatype:(${E.join(" OR ")})`)}return h.sort((E,R)=>Number(E.startsWith("scope:"))-Number(R.startsWith("scope:"))).join(" AND ")}}};function Yb({currentRoute:e,clientService:t}){const n=oe(!1),{webdav:r}=t,{replaceInvalidFileRoute:o}=zs(),{getFileInfo:i}=mf({clientService:t}),s=yf(),a=lt(),{buildSearchTerm:c,search:u}=bf(),l=on("contextRouteQuery"),f=Ke(),{activeResources:d}=He.storeToRefs(f);return{isFolderLoading:n,loadFolderForFileContext:async w=>{var v,T;n.value=!0;try{if(w=p(w),(v=p(l))!=null&&v.term){const I=c({term:(T=p(l))==null?void 0:T.term}),{values:A}=await u(I,200),$=A.filter(({data:D})=>ee.isSearchResource(D)).map(D=>D.data);f.initResourceList({currentFolder:null,resources:$}),n.value=!1;return}if(["files-shares-with-me","files-shares-with-others","files-shares-via-link","files-common-favorites"].includes(p(w.routeName))){await qy.getTask().perform(),n.value=!1;return}f.clearResourceList();const g=p(w.space),h=await i(w,{davProperties:[qe.FileId]});if(o({space:g,resource:h,path:p(w.item),fileId:p(w.itemId)}),a.spaces.some(I=>{var A;return ee.isMountPointSpaceResource(I)&&((A=I.root.remoteItem)==null?void 0:A.id)===h.id})){const I=await i(w);f.initResourceList({currentFolder:I,resources:[I]}),n.value=!1;return}const S=gt.dirname(h.path),{resource:E,children:R}=await r.listFiles(g,{path:S});E.type==="file"?f.initResourceList({currentFolder:E,resources:[E]}):f.initResourceList({currentFolder:E,resources:R})}catch(b){if(b.statusCode===401)return s.handleAuthError(p(e));f.setCurrentFolder(null),console.error(b)}n.value=!1},activeFiles:d}}function vf({appsStore:e,applicationId:t}){return{applicationMeta:U(()=>{const r=e.apps[t];if(!r)throw new Error(`useAppConfig: could not find config for applicationId: ${t}`);return r||{}})}}const _o=()=>Xe;function Jb({titleSegments:e,eventBus:t}){const n=ii(),{currentTheme:r}=He.storeToRefs(n);t=t||_o(),Tt(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 IF({appsStore:e,applicationId:t,applicationName:n,currentFileContext:r,currentRoute:o}){const i=vf({applicationId:t,appsStore:e}),{$gettext:s}=Ne.useGettext(),a=U(()=>{var l,f,d;const c=gt.basename(p((l=p(r))==null?void 0:l.fileName))||s(((d=(f=p(o))==null?void 0:f.meta)==null?void 0:d.title)||""),u=p(p(i).applicationMeta);return[c,p(n)||u.name||u.id].filter(Boolean)});Jb({titleSegments:a})}function Zb(e={}){const t=e.clientService??Ye(),n=e.authStore??Xr();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 "+yr.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 ev=()=>{const e=lt();return{areSpacesLoading:U(()=>!e.spacesInitialized||e.spacesLoading)}},tv=(e={})=>{const t=lt(),{areSpacesLoading:n}=ev(),r=on("shareId"),o=on("fileId"),i=U(()=>St(p(o))),s=st(),a=Ye(),c=U(()=>t.spaces),u=oe(null),l=oe(null),f=oe(!1),d=m=>{const w=m.split("/");return p(c).find(v=>{if(!m.startsWith(v.driveAlias))return!1;const T=v.driveAlias.split("/");return w.length<T.length||w.slice(0,T.length).join("/")!==v.driveAlias?!1:v})};return ja(()=>{const m=p(e.driveAliasAndItem);!(m!=null&&m.startsWith("personal/"))&&!(m!=null&&m.startsWith("project/"))&&t.setCurrentSpace(null)}),Tt([e.driveAliasAndItem,n],async([m,w],[v,T])=>{if(m===v&&w===T)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,h=null;if(m.startsWith("public/")||m.startsWith("ocm/")){const[y,...S]=m.split("/").slice(1);g=p(c).find(E=>E.id===y),h=S.join("/")}else if(m.startsWith("share/")||m.startsWith("ocm-share/")){const[y,...S]=m.split("/").slice(1),E=m.startsWith("ocm-share/")?"ocm-share":"share";let R=St(p(r));R!=null&&R.includes(":")&&(R=[ee.SHARE_JAIL_ID,R].join("!")),g=t.getSpace(R)||t.createShareSpace({driveAliasPrefix:E,id:R,shareName:p(y)}),h=S.join("/")}else p(i)?g=p(c).find(y=>p(i).startsWith(`${y.fileId}`)):g=d(m),g||(!t.mountPointsInitialized&&s.options.routing.fullShareOwnerPaths&&(f.value=!0,await t.loadMountPoints({graphClient:a.graphAuthenticated})),g=d(m)),g&&(h=m.slice(g.driveAlias.length));u.value=g,l.value=ee.urlJoin(h,{leadingSlash:!0}),f.value=!1},{immediate:!0,deep:!0}),Tt(u,m=>{t.setCurrentSpace(m)},{immediate:!0}),{space:u,item:l,itemId:i,loading:f}};function nv(e){const t=ze(),n=Zn(),r=en(),o=e.clientService??Ye(),i=e.applicationId,s=Xr(),{publicLinkContextReady:a}=He.storeToRefs(s),c=Hs("driveAliasAndItem"),{space:u,item:l,itemId:f,loading:d}=tv({driveAliasAndItem:c}),m=U(()=>{if(p(d))return null;let w;return p(u)?w=ee.urlJoin(p(u).webDavPath,p(l)):w=ee.urlJoin(St(p(r).params.filePath)),{path:w,driveAliasAndItem:p(c),space:p(u),item:p(l),itemId:p(f),fileName:gt.basename(w),routeName:St(p(r).query[Gs]),...Qb(p(r).query)}});return IF({appsStore:n,applicationId:i,applicationName:e.applicationName,currentFileContext:m,currentRoute:r}),{isPublicLinkContext:a,currentFileContext:m,...oh({appsStore:n,...e}),...Xb({router:t,currentFileContext:m}),...mf({clientService:o}),...Yb({clientService:o,currentRoute:r}),...Zb({clientService:o,currentRoute:p(r)})}}const CF=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}}),PF=()=>[{path:"/list",redirect:e=>xn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:"personal/home"}})},{path:"/list/all/:item(.*)",redirect:e=>xn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:ee.urlJoin("personal/home",St(e.params.item),{leadingSlash:!1})}})},{path:"/list/favorites",redirect:e=>Ti("files-common-favorites",e)},{path:"/list/shared-with-me",redirect:e=>kn("files-shares-with-me",e)},{path:"/list/shared-with-others",redirect:e=>kn("files-shares-with-others",e)},{path:"/list/shared-via-link",redirect:e=>kn("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(CF),FF=(e,...t)=>{const[n,...r]=t.map(o=>{const i={"files-personal":xn("files-spaces-generic").name,"files-favorites":Ti("files-common-favorites").name,"files-shared-with-others":kn("files-shares-with-others").name,"files-shared-with-me":kn("files-shares-with-me").name,"files-trashbin ":Ri("files-trash-generic").name,"files-public-list":Ai("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 gl(e,n,...r)},OF={name:"root",path:"/",redirect:e=>xn("files-spaces-generic",e)},xF=e=>[OF,...rT(e),...sT(e),...aT(e),...iT(e),...lT(e),...PF()],oi=()=>{const{$gettext:e}=Ne.useGettext(),t=Ye();return{checkSpaceNameModalInput:(o,i)=>o.trim()===""?i(e("Space name cannot be empty")):o.length>255?i(e("Space name cannot exceed 255 characters")):/[/\\.:?*"><|]/.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")}}},ln=e=>{const t=vt(),n=lt(),r=st(),o=U(()=>n.spaces),i=Hs("driveAliasAndItem"),s=f=>p(e==null?void 0:e.space)||p(o).find(d=>d.id===f),a=f=>{var T,b,g,h,y;let d=f.storageId;((T=p(i))!=null&&T.startsWith("public/")||(b=p(i))!=null&&b.startsWith("ocm/"))&&(d=p(i).split("/")[1]);const m=s(d);if(m&&!ee.isMountPointSpaceResource(m))return m;const w=ee.isShareResource(f)&&f.shareTypes.includes(ee.ShareTypes.remote.value)||(g=f==null?void 0:f.id)!=null&&g.toString().startsWith(ee.OCM_PROVIDER_ID)?"ocm-share":"share";let v;return f.remoteItemPath?v=gt.basename(f.remoteItemPath):(h=p(i))!=null&&h.startsWith("share/")||(y=p(i))!=null&&y.startsWith("ocm-share/")?v=p(i).split("/")[1]:v=f.name,n.getSpace(f.remoteItemId)||n.createShareSpace({driveAliasPrefix:w,id:f.remoteItemId,shareName:v})},c=f=>p(o).filter(d=>ee.isMountPointSpaceResource(d)&&ee.extractStorageId(d.root.remoteItem.rootId)===f.id);return{getInternalSpace:s,getMatchingSpace:a,isPersonalSpaceRoot:f=>{var d;return(f==null?void 0:f.storageId)&&(f==null?void 0:f.storageId)===((d=n.personalSpace)==null?void 0:d.storageId)&&(f==null?void 0:f.path)==="/"},isResourceAccessible:({space:f,path:d})=>{if(!r.options.routing.fullShareOwnerPaths)return!0;const m=p(o).find(v=>ee.isProjectSpaceResource(v)&&v.id===f.id);return f.isOwner(t.user)||(m==null?void 0:m.isMember(t.user))||c(f).some(v=>d.startsWith(v.root.remoteItem.path))}}},Di=()=>{const e=Ye(),t=Ke(),n=jt();return{createSpace:i=>{const{graphAuthenticated:s}=e;return s.drives.createDrive({name:i},n.graphRoles,{params:{template:"default"}})},createDefaultMetaFolder:async i=>{var a;const s=await e.webdav.createFolder(i,{path:".space"});return ee.extractStorageId(s.parentFolderId)===((a=t.currentFolder)==null?void 0:a.id)&&t.upsertResource(s),s}}},cn=()=>mr("$loadingService"),Qs=()=>{const e=Xr(),t=Ye(),n=Ne.useGettext();return{headers:U(()=>{const o=new kh({accessToken:e.accessToken,publicLinkToken:e.publicLinkToken,publicLinkPassword:e.publicLinkPassword});return{"Accept-Language":n.current,"Initiator-ID":t.initiatorId,"X-Request-ID":Yt.v4(),...o.getHeaders()}})}};function kF(e){return new Worker("/assets/worker-CjeEygd_.js",{name:e==null?void 0:e.name})}const rv=({concurrentRequests:e=4}={})=>{const t=st(),n=cn(),{headers:r}=Qs(),{createWorker:o,terminateWorker:i}=Ro(),s=({topic:c,space:u,resources:l},f)=>{const d=o(kF,{needsTokenRenewal:!0});let m;p(d.worker).onmessage=w=>{i(d.id),m==null||m(!0);const{successful:v,failed:T}=JSON.parse(w.data),b=T.map(({resource:g,...h})=>({resource:g,error:ee.createHttpError(h)}));f({successful:v,failed:b})},n.addTask(()=>new Promise(w=>{m=w})),d.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 NF(e){return new Worker("/assets/worker-C-4Lcir3.js",{name:e==null?void 0:e.name})}const iv=()=>{const e=st(),t=cn(),{headers:n}=Qs(),{createWorker:r,terminateWorker:o}=Ro(),i=(a,c)=>{const u=r(NF,{needsTokenRenewal:!0});let l;p(u.worker).onmessage=f=>{o(u.id),l==null||l(!0);const{successful:d,failed:m}=JSON.parse(f.data),w=m.map(({resourceName:v,...T})=>({resourceName:v,error:ee.createHttpError(T)}));c({successful:d,failed:w})},t.addTask(()=>new Promise(f=>{l=f})),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 $F(e){return new Worker("/assets/worker-CHXv5Q0i.js",{name:e==null?void 0:e.name})}const ov=()=>{const e=st(),t=cn(),{headers:n}=Qs(),{createWorker:r,terminateWorker:o}=Ro(),i=({space:a,resources:c,missingFolderPaths:u},l)=>{const f=r($F,{needsTokenRenewal:!0});let d;p(f.worker).onmessage=m=>{o(f.id),d==null||d(!0);const{successful:w,failed:v}=JSON.parse(m.data),T=v.map(({resource:b,...g})=>({resource:b,error:ee.createHttpError(g)}));l({successful:w,failed:T})},t.addTask(()=>new Promise(m=>{d=m})),f.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 DF(e){return new Worker("/assets/worker-BBQqm_-D.js",{name:e==null?void 0:e.name})}const LF=({authService:e})=>{const{createWorker:t}=Ro(),n=oe();return{startWorker:()=>{n.value=t(DF),p(p(n).worker).onmessage=()=>{e.signinSilent().catch(async s=>{if(s instanceof x0.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"}))}}},sv=()=>{const e=st(),t=rt(),n=ze(),r=Ne.useGettext(),{getMatchingSpace:o}=ln(),{$gettext:i,$ngettext:s}=r,a=Ye(),{dispatchModal:c}=bt(),u=lt(),l=jt(),{startWorker:f}=rv({concurrentRequests:e.options.concurrentRequests.resourceBatchActions}),d=Ke(),{currentFolder:m}=He.storeToRefs(d),w=oe([]),v=on("page","1"),T=U(()=>parseInt(St(p(v)))),b=on("items-per-page","1"),g=U(()=>parseInt(St(p(b)))),h=U(()=>mp(p(w))),y=U(()=>{const A=p(h),$=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=U(()=>{const A=p(h),$=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.")}),E=A=>{const $=p(n.currentRoute);f({topic:"trashBinDelete",space:A,resources:p(h)},({successful:D,failed:k})=>{var N,j;if(D.length){const W=D.length===1&&p(h).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:W})}k.forEach(({resource:W})=>{const X=i('Failed to delete "%{item}"',{item:W.name});t.showErrorMessage({title:X,errors:[new Error]})}),$.name===p(n.currentRoute).name&&((N=$.query)==null?void 0:N.fileId)===((j=p(n.currentRoute).query)==null?void 0:j.fileId)&&(d.removeResources(D),d.resetSelection())})};return{displayDialog:(A,$)=>{w.value=[...$],c({title:p(y),message:p(S),confirmText:i("Delete"),onConfirm:()=>E(A)})},filesList_delete:A=>{var k;w.value=[...A],d.addResourcesIntoDeleteQueue(p(w).map(({id:N})=>N)),p(w).forEach(({id:N})=>d.removeSelection(N));const $=p(A).reduce((N,j)=>{if(j.storageId in N)return N[j.storageId].resources.push(j),N;const W=o(j);return W.id in N||(N[W.id]={space:W,resources:[]}),N[W.id].resources.push(j),N},{}),D=(k=p(m))==null?void 0:k.id;return Object.values($).map(({space:N,resources:j})=>{f({topic:"fileListDelete",space:N,resources:j},async({successful:W,failed:X})=>{var ie;if(W.length){const de=W.length===1&&A.length===1?i('"%{item}" was moved to trash bin',{item:W[0].name}):s("%{itemCount} item was moved to trash bin","%{itemCount} items were moved to trash bin",W.length,{itemCount:W.length.toString()},!0);t.showMessage({title:de})}if(d.removeResourcesFromDeleteQueue(X.map(({resource:de})=>de.id)),d.removeResourcesFromDeleteQueue(W.map(({id:de})=>de)),X.forEach(({error:de,resource:se})=>{let we=i('Failed to delete "%{resource}"',{resource:se.name});de.statusCode===423&&(we=i('Failed to delete "%{resource}" - the file is locked',{resource:se.name})),t.showErrorMessage({title:we,errors:[de]})}),D===((ie=p(m))==null?void 0:ie.id)){d.removeResources(W);const de=d.activeResources.length,se=Math.ceil(p(de)/p(g));p(T)>1&&p(T)>se&&(v.value=se.toString())}if(at(n,"files-spaces-generic")&&!["public","share"].includes(N==null?void 0:N.driveType)){const se=await a.graphAuthenticated.drives.getDrive(p(A)[0].storageId,l.graphRoles);u.updateSpaceField({id:se.id,field:"spaceQuota",value:se.spaceQuota})}if(p(w).length&&Zi(p(w)[0],p(m)))return n.push(Jn(N,{path:gt.dirname(p(w)[0].path),fileId:p(w)[0].parentFolderId}))})})}}},MF=e=>e==="files",Or=()=>{const e=en();return U(()=>MF(Sl(p(e))))};function BF(e){return e==null}const jF="edit",UF="create",Vn=()=>{const e=Zn(),t=ze(),{$gettext:n}=Ne.useGettext(),r=os(),{isEnabled:o}=ni(),{requestExtensions:i}=Ni(),{openUrl:s}=Nv(),a=st(),{options:c}=He.storeToRefs(a),{actions:u}=Xs(),{actions:l}=Ys(),{actions:f}=Js(),{actions:d}=ea(),{actions:m}=Zs(),{actions:w}=ta(),{actions:v}=Io(),{actions:T}=Tf(),{actions:b}=na(),{actions:g}=Af(),{actions:h}=ra(),{actions:y}=ia(),{actions:S}=Cf(),E=U(()=>[...p(w),...p(v),...p(d),...p(b),...p(f),...p(h),...p(S),...p(y),...p(u),...p(l),...p(m),...p(T),...p(g)]),R=U(()=>i({id:"global.files.default-actions",extensionType:"action"}).map(ie=>ie.action)),I=U(()=>i({id:"global.files.context-actions",extensionType:"action"}).map(X=>X.action)),A=U(()=>p(o)?[]:e.fileExtensions.map(X=>{const ie=e.apps[X.app];return{name:`editor-${X.app}`,label:()=>X.label?typeof X.label=="function"?X.label():X.label:n("Open in %{app}",{app:ie.name},!0),showOpenInNewTabHint:!0,icon:X.icon||ie.icon,...ie.iconFillType&&{iconFillType:ie.iconFillType},img:ie.img,route:({space:de,resources:se})=>$({appFileExtension:X,space:de,resource:se[0]}),handler:de=>k(X,de.space,de.resources[0]),isVisible:({resources:de})=>de.length!==1||!de[0].canDownload()&&!X.secureView||!p(r)&&In(t,"files-trash-generic")?!1:de[0].extension&&X.extension?de[0].extension.toLowerCase()===X.extension.toLowerCase():de[0].mimeType&&X.mimeType?de[0].mimeType.toLowerCase()===X.mimeType.toLowerCase()||de[0].mimeType.split("/")[0].toLowerCase()===X.mimeType.toLowerCase():!1,hasPriority:X.hasPriority,class:`oc-files-actions-${qb(ie.name).toLowerCase()}-trigger`}}).sort((X,ie)=>ie.hasPriority!==X.hasPriority&&ie.hasPriority?1:0)),$=({appFileExtension:X,space:ie,resource:de})=>{const se=ee.isShareSpaceResource(ie)?ie.id:void 0,we=X.routeName||X.app,Se=D(we,ie,de,se);return t.resolve(Se)},D=(X,ie,de,se,we)=>({name:X,params:{driveAliasAndItem:ie==null?void 0:ie.getDriveAliasAndItem(de)},query:{...se&&{shareId:se},...de.fileId&&p(c).routing.idBased&&{fileId:de.fileId},...we&&{templateId:we},...Ks(p(t.currentRoute))}}),k=(X,ie,de)=>{const se=ee.isShareSpaceResource(ie)?ie.id:void 0,we=X.routeName||X.app,Se=D(we,ie,de,se);if(p(c).cernFeatures){const Z=t.resolve(Se).href,ne=`${X.routeName}-${de.path}`;s(Z,ne,!0);return}t.push(Se)},N=X=>{j(X).handler({...X})},j=X=>{const ie=W(X);if(ie.length)return ie[0]},W=X=>{const ie=we=>we.isVisible(X),de=[...p(R),...p(A)].filter(ie).sort((we,Se)=>Number(Se.hasPriority)-Number(we.hasPriority)),se=X.omitSystemActions?[]:p(E).filter(ie);return[...de,...se,...p(I).filter(we=>we.isVisible(X)&&(we.category==="actions"||BF(we.category)))]};return{editorActions:A,systemActions:E,getDefaultAction:j,getAllAvailableActions:W,getEditorRouteOpts:D,openEditor:k,triggerDefaultAction:N}},Xs=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=ze(),{$gettext:r,$ngettext:o}=Ne.useGettext(),i=Ye(),s=cn(),a=st(),c=Ke(),{updateResourceField:u}=c,l=async({resources:d})=>{const m=[],w=[],v=new Lr({concurrency:a.options.concurrentRequests.resourceBatchActions});if(d.forEach(T=>{w.push(v.add(async()=>{try{const{graphAuthenticated:b}=i;await b.driveItems.createDriveItem(T.driveId,{name:T.name,remoteItem:{id:T.fileId}}),u({id:T.id,field:"syncEnabled",value:!0})}catch(b){console.error(b),m.push(b)}}))}),await Promise.all(w),m.length===0){c.resetSelection(),at(n,"files-spaces-generic")&&e({title:o("Sync for the selected share was enabled successfully","Sync for the selected shares was enabled successfully",d.length)});return}t({title:o("Failed to enable sync for the the selected share","Failed to enable sync for the selected shares",d.length),errors:m})};return{actions:U(()=>[{name:"enable-sync",icon:"check",handler:d=>s.addTask(()=>l(d)),label:()=>r("Enable sync"),isVisible:({space:d,resources:m})=>{var w;return!Nt(n,"files-shares-with-me")&&!at(n,"files-spaces-generic")||m.length===0||at(n,"files-spaces-generic")&&(((w=p(d))==null?void 0:w.driveType)!=="share"||m.length>1||m[0].path!=="/")?!1:m.some(v=>!v.syncEnabled)},class:"oc-files-actions-enable-sync-trigger"}])}},Ys=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=ze(),{$gettext:r}=Ne.useGettext(),o=Ye(),i=cn(),s=st(),{updateResourceField:a,resetSelection:c}=Ke(),u=async({resources:f})=>{const d=[],m=[],w=new Lr({concurrency:s.options.concurrentRequests.resourceBatchActions}),v=!f[0].hidden;if(f.forEach(T=>{m.push(w.add(async()=>{try{await o.graphAuthenticated.driveItems.updateDriveItem(T.driveId,T.id,{"@UI.Hidden":v}),a({id:T.id,field:"hidden",value:v})}catch(b){console.error(b),d.push(b)}}))}),await Promise.all(m),d.length===0){c(),e({title:r(v?"The share was hidden successfully":"The share was unhidden successfully")});return}t({title:r(v?"Failed to hide the share":"Failed to unhide share share"),errors:d})};return{actions:U(()=>[{name:"toggle-hide-share",icon:"eye-off",handler:f=>i.addTask(()=>u(f)),label:({resources:f})=>f[0].hidden?r("Unhide"):r("Hide"),isVisible:({resources:f})=>f.length===0?!1:Nt(n,"files-shares-with-me"),class:"oc-files-actions-hide-share-trigger"}])}},Js=()=>{const e=st(),t=ze(),{copyResources:n}=To(),r=Ne.useGettext(),{$gettext:o}=r,i=Ke(),{currentFolder:s}=He.storeToRefs(i),a=U(()=>window.navigator.platform.match("Mac")),c=U(()=>p(a)?o("⌘ + C"):o("Ctrl + C")),u=({resources:f})=>{At(t,"files-common-search")&&(f=f.filter(d=>!ee.isProjectSpaceResource(d))),n(f)};return{actions:U(()=>[{name:"copy",icon:"file-copy-2",handler:u,shortcut:p(c),label:()=>o("Copy"),isVisible:({resources:f})=>{var d,m;if(!at(t,"files-spaces-generic")&&!_n(t,"files-public-link")&&!At(t,"files-common-favorites")&&!At(t,"files-common-search")||at(t,"files-spaces-projects")||f.length===0)return!1;if(_n(t,"files-public-link"))return(d=p(s))==null?void 0:d.canCreate();if(At(t,"files-common-search")&&f.every(w=>ee.isProjectSpaceResource(w)))return!1;if(p(e.options.runningOnEos)){const w=((m=f[0].path)==null?void 0:m.split("/").filter(Boolean))||[];if(at(t,"files-spaces-generic")&&w.length<5)return!1}return!!p(f)[0].canDownload()},class:"oc-files-actions-copy-trigger"}])}},wf=()=>({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}=Mr.useClipboard({legacy:!0});return r(t)}}}),Sf=()=>{const{showMessage:e,showErrorMessage:t}=rt(),{$gettext:n}=Ne.useGettext(),{copyToClipboard:r}=wf(),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:U(()=>[{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})=>ee.isPublicSpaceResource(s)?!1:a.length===1,class:"oc-files-actions-copy-permanent-link-trigger"}])}},Zs=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=ze(),{$gettext:r,$ngettext:o}=Ne.useGettext(),i=Ye(),s=cn(),a=st(),{updateResourceField:c}=Ke(),u=async({resources:f})=>{const d=[],m=[],w=new Lr({concurrency:a.options.concurrentRequests.resourceBatchActions});if(f.forEach(v=>{m.push(w.add(async()=>{try{const{graphAuthenticated:T}=i;await T.driveItems.deleteDriveItem(v.driveId,v.id),c({id:v.id,field:"syncEnabled",value:!1})}catch(T){console.error(T),d.push(T)}}))}),await Promise.all(m),d.length===0){at(n,"files-spaces-generic")&&(e({title:o("Sync for the selected share was disabled successfully","Sync for the selected shares was disabled successfully",f.length)}),n.push(kn("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",f.length),errors:d})};return{actions:U(()=>[{name:"disable-sync",icon:"spam-3",handler:f=>s.addTask(()=>u(f)),label:()=>r("Disable sync"),isVisible:({space:f,resources:d})=>!Nt(n,"files-shares-with-me")&&!at(n,"files-spaces-generic")||d.length===0||at(n,"files-spaces-generic")&&((f==null?void 0:f.driveType)!=="share"||d.length>1||d[0].path!=="/")?!1:d.some(m=>m.syncEnabled),class:"oc-files-actions-disable-sync-trigger"}])}},ea=()=>{const e=vt(),t=rn(),n=ze(),{displayDialog:r,filesList_delete:o}=sv(),{$gettext:i}=Ne.useGettext(),s=({space:c,resources:u,deletePermanent:l})=>{if(At(n,"files-common-search")&&(u=u.filter(f=>f.canBeDeleted()&&!f.isShareRoot()&&!ee.isProjectSpaceResource(f))),l){r(c,u);return}o(u)};return{actions:U(()=>[{name:"delete",icon:"delete-bin-5",label:()=>i("Delete"),handler:({space:c,resources:u})=>s({space:c,resources:u,deletePermanent:!1}),isVisible:({space:c,resources:u})=>!at(n,"files-spaces-generic")&&!_n(n,"files-public-link")&&!At(n,"files-common-search")||u.length===0||at(n,"files-spaces-generic")&&(c==null?void 0:c.driveType)==="share"&&u[0].path==="/"||u.length===1&&u[0].locked?!1:At(n,"files-common-search")?u.some(f=>f.canBeDeleted()&&!f.isShareRoot()&&!ee.isProjectSpaceResource(f)):!u.some(f=>!f.canBeDeleted()),class:"oc-files-actions-delete-trigger"},{name:"delete-permanent",icon:"delete-bin-5",label:()=>i("Delete"),handler:({space:c,resources:u})=>s({space:c,resources:u,deletePermanent:!0}),isVisible:({space:c,resources:u})=>!In(n,"files-trash-generic")||!t.filesPermanentDeletion||ee.isProjectSpaceResource(c)&&!c.canDeleteFromTrashBin({user:e.user})?!1:u.length>0,class:"oc-files-actions-delete-permanent-trigger"}])}};function qF(e){return e&&e.length?e[0]:void 0}const av=()=>mr("$archiverService"),ta=()=>{const{showErrorMessage:e}=rt(),t=ze(),n=cn(),r=av(),{$ngettext:o,$gettext:i,current:s}=Ne.useGettext(),a=Xr(),c=Or(),u=({space:d,resources:m})=>{m.length>1&&(m=m.filter(v=>v.canDownload()&&!ee.isProjectSpaceResource(v)));const w=p(r.fileIdsSupported)?{fileIds:m.map(v=>v.fileId)}:{dir:ss.dirname(qF(m).path)||"/",files:m.map(v=>v.name)};return r.triggerDownload({...w,...d&&ee.isPublicSpaceResource(d)&&{publicToken:d.id,publicLinkPassword:a.publicLinkPassword}}).catch(v=>{console.error(v),e({title:o("Failed to download the selected folder.","Failed to download the selected files.",m.length),errors:[v]})})},l=d=>{const m=p(r.capability);return m?d.reduce((v,T)=>v+parseInt(`${T.size}`),0)>parseInt(m.max_size):void 0};return{actions:U(()=>[{name:"download-archive",icon:"inbox-archive",handler:async d=>{await n.addTask(()=>u(d))},label:()=>i("Download"),disabledTooltip:({resources:d})=>l(d)?i("The selection exceeds the allowed archive size (max. %{maxSize})",{maxSize:En(p(r.capability).max_size,s)}):"",isDisabled:({resources:d})=>l(d),isVisible:({resources:d})=>p(c)&&!at(t,"files-spaces-generic")&&!_n(t,"files-public-link")&&!At(t,"files-common-favorites")&&!At(t,"files-common-search")&&!Nt(t,"files-shares-with-me")&&!Nt(t,"files-shares-with-others")&&!Nt(t,"files-shares-via-link")&&!At(t,"files-common-search")||!p(r.available)||d.length===0||d.length===1&&!d[0].isFolder||d.length>1&&d.every(w=>ee.isProjectSpaceResource(w))||ee.isProjectSpaceResource(d[0])&&d[0].disabled||!p(r.fileIdsSupported)&&At(t,"files-common-favorites")?!1:!d.some(w=>!w.canDownload()),class:"oc-files-actions-download-archive-trigger"}])}},lv=e=>{const{showErrorMessage:t}=rt(),n=(e==null?void 0:e.clientService)||Ye(),{$gettext:r}=Ne.useGettext(),o=rn(),i=vt();return{downloadFile:async(a,c,u=null)=>{var l;try{const f=await n.webdav.getFileUrl(a,c,{version:u,doHeadRequest:!0,isUrlSigningEnabled:o.supportUrlSigning,username:(l=i.user)==null?void 0:l.onPremisesSamAccountName});Bl(f,c.name)}catch(f){console.error(f),t({title:r("Download failed"),desc:r("File could not be located"),errors:[f]})}}}},Io=()=>{const e=ze(),{$gettext:t}=Ne.useGettext(),n=Or(),r=os(),{downloadFile:o}=lv(),i=({space:a,resources:c})=>{o(a,c[0])};return{actions:U(()=>[{name:"download-file",icon:"file-download",handler:i,label:()=>t("Download"),isVisible:({resources:a})=>p(n)&&!p(r)&&!at(e,"files-spaces-generic")&&!_n(e,"files-public-link")&&!At(e,"files-common-favorites")&&!At(e,"files-common-search")&&!Nt(e,"files-shares-with-me")&&!Nt(e,"files-shares-with-others")&&!Nt(e,"files-shares-via-link")||a.length!==1||a[0].isFolder?!1:a[0].canDownload(),class:"oc-files-actions-download-file-trigger"}])}},Ef=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=vt(),r=rn(),o=ze(),{$gettext:i}=Ne.useGettext(),s=Ye(),{dispatchModal:a}=bt(),c=Ke(),u=cn(),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]})}),f=({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:U(()=>[{name:"empty-trash-bin",icon:"delete-bin-5",label:()=>i("Empty trash bin"),handler:f,isVisible:({space:m})=>!(!In(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}},Tf=()=>{const{showErrorMessage:e}=rt(),t=rn(),n=ze(),{$gettext:r}=Ne.useGettext(),o=Ye(),i=Or(),s=hn(),a=Ke(),c=_o(),u=async({space:f,resources:d})=>{try{const m=!d[0].starred;await o.webdav.setFavorite(f,d[0],m),a.updateResourceField({id:d[0].id,field:"starred",value:m}),m||c.publish("app.files.list.removeFromFavorites",d[0].id)}catch(m){const w=r('Failed to change favorite state of "%{file}"',{file:d[0].name},!0);e({title:w,errors:[m]})}};return{actions:U(()=>[{name:"favorite",icon:"star",handler:u,label:({resources:f})=>f[0].starred?r("Remove from favorites"):r("Add to favorites"),isVisible:({resources:f})=>p(i)&&!at(n,"files-spaces-generic")&&!At(n,"files-common-favorites")||f.length!==1?!1:t.filesFavorites&&s.can("create","Favorite"),class:"oc-files-actions-favorite-trigger"}])}};function VF(e,t){const n=e.isReceivedShare()||e.isMounted(),r=t===""&&n;return e.canBeDeleted()&&!r}const na=()=>{const e=ze(),{cutResources:t}=To(),n=Ne.useGettext(),{$gettext:r}=n,o=Ke(),{currentFolder:i}=He.storeToRefs(o),s=U(()=>window.navigator.platform.match("Mac")),a=U(()=>p(s)?r("⌘ + X"):r("Ctrl + X")),c=({resources:l})=>{t(l)};return{actions:U(()=>[{name:"cut",icon:"scissors",handler:c,shortcut:p(a),label:()=>r("Cut"),isVisible:({resources:l})=>!at(e,"files-spaces-generic")&&!_n(e,"files-public-link")&&!At(e,"files-common-favorites")||l.length===0||!p(i)||l.length===1&&l[0].locked?!1:!l.some(d=>VF(d,p(i).path)===!1),class:"oc-files-actions-move-trigger"}])}},Af=()=>{const e=ze(),{$gettext:t}=Ne.useGettext(),{getMatchingSpace:n}=ln(),r=Ke(),{currentFolder:o}=He.storeToRefs(r),i=c=>c||n(c),s=U(()=>_n(e,"files-public-link")?Ai("files-public-link"):xn("files-spaces-generic"));return{actions:U(()=>[{name:"navigate",icon:"folder-open",showOpenInNewTabHint:!0,label:()=>t("Open folder"),isVisible:({resources:c})=>!(In(e,"files-trash-generic")||c.length!==1||p(o)!==null&&Zi(c[0],p(o))||!c[0].isFolder||c[0].type==="space"),route:({space:c,resources:u})=>ao({},p(s),Jn(i(c),{path:u[0].path,fileId:u[0].fileId})),class:"oc-files-actions-navigate-trigger"}])}},cv=()=>{const e=ze(),t=Ye(),{getMatchingSpace:n}=ln(),{$gettext:r,$ngettext:o}=Ne.useGettext(),i=To(),{startWorker:s}=iv(),a=Ke(),{currentFolder:c}=He.storeToRefs(a),u=U(()=>window.navigator.platform.match("Mac")),l=U(()=>p(u)?r("⌘ + V"):r("Ctrl + V")),f=U(()=>i.action===ei.Cut?pr.MOVE:pr.COPY),d=async({targetSpace:v,sourceSpace:T,resources:b})=>{var S;const g=new Sp(T,b,v,p(c),c,t,r,o),h=await g.getTransferData(p(f));if(!h.length)return;const y=(S=p(c))==null?void 0:S.id;s(h,async({successful:E,failed:R})=>{if(g.showResultMessage(R,E,p(f)),!E.length||p(c)&&y!==p(c).id)return;const I=[],A=[];for(const $ of E)I.push((async()=>{const D=await t.webdav.getFileInfo(v,$);A.push(D)})());await Promise.allSettled(I),ee.isShareSpaceResource(v)&&A.forEach($=>{$.remoteItemId=v.id}),a.upsertResources(A),a.loadIndicators(v,p(c).id)})},m=async({space:v})=>{const T=i.resources.reduce((g,h)=>{if(h.storageId in g)return g[h.storageId].resources.push(h),g;const y=n(h);return y.id in g||(g[y.id]={space:y,resources:[]}),g[y.id].resources.push(h),g},{}),b=Object.values(T).map(({space:g,resources:h})=>d({targetSpace:v,sourceSpace:g,resources:h}));await Promise.all(b),i.clearClipboard()};return{actions:U(()=>[{name:"paste",icon:"clipboard",handler:m,label:()=>r("Paste"),shortcut:p(l),isVisible:({resources:v})=>{var T;return i.resources.length===0||!at(e,"files-spaces-generic")&&!_n(e,"files-public-link")&&!At(e,"files-common-favorites")||v.length===0?!1:_n(e,"files-public-link")&&p(c)?(T=p(c))==null?void 0:T.canCreate():!0},class:"oc-files-actions-copy-trigger"}])}},ra=()=>{const{showErrorMessage:e}=rt(),t=rn(),n=ze(),{$gettext:r}=Ne.useGettext(),o=Ye(),i=st(),{dispatchModal:s}=bt(),a=vt(),c=hn(),u=Ke(),{setCurrentFolder:l,upsertResource:f}=u,d=(T,b,g=void 0)=>{const h=T.path.substring(0,T.path.length-T.name.length)+b;if(!b)return r("The name cannot be empty");if(/[/]/.test(b))return r('The name cannot contain "/"');if(b===".")return r('The name cannot be equal to "."');if(b==="..")return r('The name cannot be equal to ".."');if(/\s+$/.test(b))return r("The name cannot end with whitespace");if(u.resources.find(S=>S.path===h&&T.name!==b)){const S=r('The name "%{name}" is already taken');return r(S,{name:b},!0)}if(g&&g.find(E=>E.path===h&&T.name!==b)){const E=r('The name "%{name}" is already taken');return r(E,{name:b},!0)}return null},m=async(T,b,g)=>{let h=u.currentFolder;try{const y=gt.join(gt.dirname(b.path),g);await o.webdav.moveFiles(T,b,T,{path:y});const S=Zi(b,h);if(ee.isShareSpaceResource(T)&&b.isReceivedShare()){if(T.rename(g),S)return h={...h},h.name=g,l(h),n.push(Jn(T,{path:"",fileId:b.fileId}));const R={...b};R.name=g,f(R);return}if(S)return h={...h},rl(T,h,y),l(h),n.push(Jn(T,{path:y,fileId:b.fileId}));const E={...b};rl(T,E,y),f(E)}catch(y){console.error(y);let S=r('Failed to rename "%{file}" to "%{newName}"',{file:b.name,newName:g},!0);y.statusCode===423&&(S=r('Failed to rename "%{file}" to "%{newName}" - the file is locked',{file:b.name,newName:g},!0)),e({title:S,errors:[y]})}},w=async({space:T,resources:b})=>{const g=u.currentFolder;let h;if(Zi(b[0],g)){const k=gt.dirname(g.path);h=(await o.webdav.listFiles(T,{path:k})).children}const y=u.areFileExtensionsShown,S=async k=>{y||(k=`${k}.${b[0].extension}`),await m(T,b[0],k)},E=(k,N)=>{y||(k=`${k}.${b[0].extension}`);const j=d(b[0],k,h);N(j)},R=ee.extractNameWithoutExtension(b[0]),I=!b[0].isFolder&&!y?R:b[0].name,A=b[0].isFolder?r("Rename folder %{name}",{name:I}):r("Rename file %{name}",{name:I}),$=!b[0].isFolder&&!y?R:b[0].name,D=b[0].isFolder||!y?null:[0,R.length];s({title:A,confirmText:r("Rename"),hasInput:!0,inputValue:$,inputSelectionRange:D,inputLabel:b[0].isFolder?r("Folder name"):r("File name"),onConfirm:S,onInput:E})};return{actions:U(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:w,isVisible:({resources:T})=>In(n,"files-trash-generic")||Nt(n,"files-shares-with-me")&&!t.sharingCanRename||T.length!==1||(i.options.routing.fullShareOwnerPaths?T.some(h=>h.remoteItemPath&&h.path):T.some(h=>h.remoteItemId&&h.path==="/"))||T.length===1&&T[0].locked?!1:!T.some(h=>!h.canRename({user:a.user,ability:c})||h.processing),class:"oc-files-actions-rename-trigger"}]),getNameErrorMsg:d,renameResource:m}},ia=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=vt(),r=ze(),{$gettext:o,$ngettext:i}=Ne.useGettext(),s=Ye(),a=lt(),c=jt(),u=Ke(),{startWorker:l}=ov(),f=async(T,b)=>{const g={},h=[],y=[],S=[];for(const E of b){const R=gt.dirname(E.path);let I=[];if(R in g)I=g[R];else{try{I=(await s.webdav.listFiles(T,{path:R})).children}catch{S.push(R)}g[R]=I}I.some($=>$.name===E.name)||y.filter($=>$.id!==E.id).some($=>$.path===E.path)?h.push(E):y.push(E)}return{existingResourcesByPath:g,conflicts:h,resolvedResources:y,missingFolderPaths:S.filter(E=>{var R;return!((R=g[E])!=null&&R.length)})}},d=async T=>{let b=0;const g=[],h=T.length;let y=!1,S;for(const E of T){const R=E.type==="folder";if(y){g.push({resource:E,strategy:S});continue}const I=h-b,$=await new tl(o,i).resolveFileExists({name:E.name,isFolder:R},I,!1);b++,$.doForAllConflicts&&(y=!0,S=$.strategy),g.push({resource:E,strategy:$.strategy})}return g},m=(T,b,g)=>{const h=p(r.currentRoute);l({space:T,resources:b,missingFolderPaths:g},async({successful:y,failed:S})=>{var E,R;if(y.length){let I;y.length===1?I=o("%{resource} was restored successfully",{resource:y[0].name}):I=o("%{resourceCount} files restored successfully",{resourceCount:y.length.toString()}),e({title:I}),h.name===p(r.currentRoute).name&&((E=h.query)==null?void 0:E.fileId)===((R=p(r.currentRoute).query)==null?void 0:R.fileId)&&(u.removeResources(y),u.resetSelection());const $=await s.graphAuthenticated.drives.getDrive(T.id,c.graphRoles);a.updateSpaceField({id:$.id,field:"spaceQuota",value:$.spaceQuota})}if(S.length){let I;const A={};S.length===1?(A.resource=S[0].resource.name,I=o('Failed to restore "%{resource}"',A,!0)):(A.resourceCount=S.length.toString(),I=o("Failed to restore %{resourceCount} files",A,!0)),t({title:I,errors:S.map(({error:$})=>$)})}})},w=async({space:T,resources:b})=>{const g=b.sort(($,D)=>$.path.length-D.path.length),{existingResourcesByPath:h,conflicts:y,resolvedResources:S,missingFolderPaths:E}=await f(T,g),R=await d(y),I=R.filter($=>$.strategy===qn.REPLACE).map($=>$.resource);S.push(...I);const A=R.filter($=>$.strategy===qn.KEEP_BOTH).map($=>$.resource);for(let $ of A){$={...$};const D=gt.dirname($.path),k=h[D]||[],N=ee.extractExtensionFromFile($),j=Un($.name,N,[...k,...R.map(W=>W.resource),...S]);$.name=j,$.path=ee.urlJoin(D,j),S.push($)}return m(T,S,E)};return{actions:U(()=>[{name:"restore",icon:"arrow-go-back",label:()=>o("Restore"),handler:w,isVisible:({space:T,resources:b})=>!In(r,"files-trash-generic")||!b.every(g=>ee.isTrashResource(g)&&g.canBeRestored())||ee.isProjectSpaceResource(T)&&!T.canRestoreFromTrashbin({user:n.user})?!1:b.length>0,class:"oc-files-actions-restore-trigger"}]),restoreResources:m,collectConflicts:f}},Rf=()=>mr("$previewService"),uv=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=vt(),r=ze(),{$gettext:o}=Ne.useGettext(),i=Ye(),s=cn(),a=Rf(),c=lt(),u=jt(),{createDefaultMetaFolder:l}=Di(),{getDefaultMetaFolder:f}=oi(),d=async({space:w,resources:v})=>{var y;const T=i.graphAuthenticated,b=w==null?void 0:w.id,{copyFiles:g,getFileInfo:h}=i.webdav;try{let S=await f(w);S||(S=await l(w)),v[0].id!==((y=w.spaceImageData)==null?void 0:y.id)&&await g(w,{fileId:v[0].id},w,{parentFolderId:S.id,name:v[0].name},{overwrite:!0});const{fileId:E}=await h(w,{fileId:v[0].id}),R=await T.drives.updateDrive(b,{name:w.name,special:[{specialFolder:{name:"image"},id:E}]},u.graphRoles);c.updateSpaceField({id:b,field:"spaceImageData",value:R.spaceImageData}),e({title:o("Space image was set successfully")})}catch(S){console.error(S),t({title:o("Failed to set space image"),errors:[S]})}};return{actions:U(()=>[{name:"set-space-image",icon:"image-edit",handler:w=>s.addTask(()=>d(w)),label:()=>o("Set as space image"),isVisible:({space:w,resources:v})=>v.length!==1||!v[0].mimeType||!a.isMimetypeSupported(v[0].mimeType,!0)||!at(r,"files-spaces-generic")||!w?!1:w.canEditImage({user:n.user}),class:"oc-files-actions-set-space-image-trigger"}])}},zF=()=>{const e=ze(),{$gettext:t}=Ne.useGettext(),n=Or(),r=()=>{const i=In(e,"files-trash-generic")?null:"actions";Xe.publish(yt.openWithPanel,i)};return{actions:U(()=>[{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"}])}},_f=()=>{const e=ze(),t=Ke(),{$gettext:n}=Ne.useGettext();return{actions:U(()=>[{name:"show-details",icon:"information",class:"oc-files-actions-show-details-trigger",label:()=>n("Details"),isVisible:({resources:o})=>In(e,"files-trash-generic")?!1:o.length>0,handler({resources:o}){t.setSelection(o.map(({id:i})=>i)),Xe.publish(yt.open)}}])}},fv=()=>{const e=rn(),{isPersonalSpaceRoot:t}=ln(),n=vt();return{canListShares:({space:o,resource:i})=>!e.sharingApiEnabled||ee.isPublicSpaceResource(o)||t(i)||ee.isTrashResource(i)?!1:ee.isIncomingShareResource(i)?i.sharePermissions.includes(ee.GraphSharePermission.readPermissions):ee.isShareSpaceResource(o)?ee.getPermissionsForSpaceMember(o,n.user).includes(ee.GraphSharePermission.readPermissions):!0}},dv=()=>{const e=rn(),t=hn(),n=vt();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})}},If=()=>{const e=ze(),{$gettext:t}=Ne.useGettext(),{canShare:n}=dv(),r=Ke(),o=({resources:s})=>{r.setSelection(s.map(({id:a})=>a)),Xe.publish(yt.openWithPanel,"sharing#peopleShares")};return{actions:U(()=>[{name:"show-shares",icon:"user-add",label:()=>t("Share"),handler:o,isVisible:({space:s,resources:a})=>In(e,"files-trash-generic")||a.length!==1?!1:n({space:s,resource:a[0]}),class:"oc-files-actions-show-shares-trigger"}])}},Cf=()=>{const{showMessage:e,showErrorMessage:t}=rt(),{can:n}=hn(),{$gettext:r,$ngettext:o}=Ne.useGettext(),{createSpace:i}=Di(),{checkSpaceNameModalInput:s}=oi(),a=Ye(),c=ze(),u=U(()=>n("create-all","Drive")),{dispatchModal:l}=bt(),f=st(),d=lt(),m=Ke(),w=async({spaceName:b,resources:g,space:h})=>{const{webdav:y}=a,S=new Lr({concurrency:f.options.concurrentRequests.resourceBatchActions}),E=[];try{const R=await i(b);d.upsertSpace(R),g.length===1&&g[0].isFolder&&(g=(await y.listFiles(h,{path:g[0].path})).children);for(const I of g)E.push(S.add(()=>y.copyFiles(h,I,R,{path:I.name})));await Promise.all(E),m.resetSelection(),e({title:r("Space was created successfully")})}catch(R){console.error(R),t({title:r("Creating space failed…"),errors:[R]})}},v=({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"),onInput:s,onConfirm:h=>w({spaceName:h,space:g,resources:b})})};return{actions:U(()=>[{name:"create-space-from-resource",icon:"function",handler:v,label:()=>r("Create Space from selection"),isVisible:({resources:b,space:g})=>!(!b.length||!p(u)||!at(c,"files-spaces-generic")||!ee.isPersonalSpaceResource(g)),class:"oc-files-actions-create-space-from-resource-trigger"}])}},pv=()=>{const e=on("scrollTo"),t=on("details"),n=Ke(),r=U(()=>St(p(e))),o=U(()=>St(p(t))),i=(a,c={forceScroll:!1,topbarElement:null})=>{const u=document.querySelectorAll(`[data-item-id='${a}']`)[0];if(!u){Xe.publish("app.files.navigate.page",{resourceId:a,forceScroll:c.forceScroll,topbarElement:c.topbarElement});return}const l=document.getElementById(c.topbarElement),f=(l==null?void 0:l.offsetHeight)||0+u.offsetHeight*2;(u.getBoundingClientRect().bottom>window.innerHeight||u.getBoundingClientRect().top<f||c.forceScroll)&&u.scrollIntoView({behavior:"smooth",block:"center"})};return Xe.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)&&Xe.publish(yt.openWithPanel,p(o)))}}},WF=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=rt(),r=ze(),{dispatchModal:o}=bt(),{$gettext:i}=Ne.useGettext(),{scrollToResource:s}=pv(),a=vt(),c=Ke(),{resources:u,currentFolder:l,ancestorMetaData:f}=He.storeToRefs(c),d=Ye(),m=(g,h)=>g.trim()===""?h(i("Folder name cannot be empty")):/[/]/.test(g)?h(i('Folder name cannot contain "/"')):g==="."?h(i('Folder name cannot be equal to "."')):g===".."?h(i('Folder name cannot be equal to ".."')):p(u).find(S=>S.name===g)?h(i("%{name} already exists",{name:g},!0)):h(null),w=U(()=>at(r,"files-spaces-generic")&&p(e).driveType!=="share"),v=async g=>{g=g.trimEnd();try{const h=gt.join(p(l).path,g),y=await d.webdav.createFolder(p(e),{path:h});p(w)&&(y.indicators=Eo({space:p(e),resource:y,ancestorMetaData:p(f),user:a.user})),ee.isShareSpaceResource(p(e))&&(y.remoteItemId=p(e).id),c.upsertResource(y),t({title:i('"%{folderName}" was created successfully',{folderName:g})}),await Gn(),s(y.id,{forceScroll:!0,topbarElement:"files-app-bar"})}catch(h){console.error(h),n({title:i("Failed to create folder"),errors:[h]})}},T=()=>{let g=i("New folder");p(u).some(h=>h.name===g)&&(g=Un(g,"",p(u))),o({title:i("Create a new folder"),confirmText:i("Create"),hasInput:!0,inputValue:g,inputLabel:i("Folder name"),onConfirm:v,onInput:m})};return{actions:U(()=>[{name:"create-folder",icon:"folder",handler:T,label:()=>i("New Folder"),isVisible:()=>{var g;return(g=p(l))==null?void 0:g.canCreate()},class:"oc-files-actions-create-new-folder"}]),checkNewFolderName:m,addNewFolder:v}},HF=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=rt(),r=vt(),o=ze(),{$gettext:i}=Ne.useGettext(),{dispatchModal:s}=bt(),a=Zn(),{isEnabled:c}=ni(),{openEditor:u}=Vn(),l=Ye(),f=Ke(),{resources:d,currentFolder:m,ancestorMetaData:w,areFileExtensionsShown:v}=He.storeToRefs(f),T=U(()=>a.fileExtensions.filter(({newFileMenu:E})=>!!E)),b=E=>E===""?i("File name cannot be empty"):/[/]/.test(E)?i('File name cannot contain "/"'):E==="."?i('File name cannot be equal to "."'):E===".."?i('File name cannot be equal to ".."'):/\s+$/.test(E)?i("File name cannot end with whitespace"):p(d).find(I=>I.name===E)?i("%{name} already exists",{name:E},!0):null,g=U(()=>at(o,"files-spaces-generic")&&p(e).driveType!=="share"),h=(E,R)=>(g.value&&(E.indicators=Eo({space:p(e),resource:E,ancestorMetaData:p(w),user:r.user})),f.upsertResource(E),u(R,p(e),E)),y=(E,R,I)=>{let A=i("New file")+`.${R}`;p(d).some(D=>D.name===A)&&(A=Un(A,R,p(d))),v.value||(A=ee.extractNameWithoutExtension({name:A,extension:R}));const $=v.value?[0,A.length-(R.length+1)]:null;s({title:i("Create a new file"),confirmText:i("Create"),hasInput:!0,inputValue:A,inputLabel:i("File name"),inputSelectionRange:$,onConfirm:async D=>{v.value||(D=`${D}.${R}`);try{let k;if(I.createFileHandler)k=await I.createFileHandler({fileName:D,space:p(e),currentFolder:p(m)});else{const N=gt.join(p(m).path,D);k=await l.webdav.putFileContents(p(e),{path:N})}return f.upsertResource(k),t({title:i('"%{fileName}" was created successfully',{fileName:k.name})}),p(c)?void 0:h(k,I)}catch(k){console.error(k),n({title:i("Failed to create file"),errors:[k]})}},onInput:(D,k)=>k(b(v.value?D:`${D}.${R}`))})};return{actions:U(()=>{var I;const E=[],R={};for(const A of p(T)||[])A.hasPriority?R[A.extension]=A:R[A.extension]=R[A.extension]||A;for(const[,A]of Object.entries(R))E.push({name:"create-new-file",icon:"add",handler:$=>y($,A.extension,A),label:()=>i(A.newFileMenu.menuTitle()),isVisible:()=>{var $;return($=p(m))==null?void 0:$.canUpload({user:r.user})},class:"oc-files-actions-create-new-file",ext:A.extension,isExternal:(I=A.app)==null?void 0:I.startsWith("external-")});return E}),getNameErrorMsg:b,openFile:h}},hv="rowMounted",Pf="fileDropped",GF="contextmenuClicked";class zn{}Ee(zn,"Thumbnail",[36,36]),Ee(zn,"Tile",[1e3,1e3]),Ee(zn,"Preview",[1200,1200]),Ee(zn,"Avatar",64);class oa{}Ee(oa,"Thumbnail","thumbnail"),Ee(oa,"Preview","preview"),Ee(oa,"Avatar","avatar");class KF{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 gv{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 KF(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 QF={name:"resource-type-folder",color:"var(--oc-color-icon-folder)"},XF={name:"layout-grid",color:"var(--oc-role-secondary)"},YF={name:"resource-type-file",color:"var(--oc-role-on-surface)"},JF=Tp(),ZF=Me({name:"ResourceIcon",props:{resource:{type:Object,required:!0},size:{type:String,default:"large",validator:e=>OP.some(t=>t===e)}},setup(e){const t=dr(Ep),n=U(()=>e.resource.type==="folder"||e.resource.isFolder),r=U(()=>e.resource.type==="space"),o=U(()=>{var c;return(c=e.resource.extension)==null?void 0:c.toLowerCase()}),i=U(()=>{var c;return(c=e.resource.mimeType)==null?void 0:c.toLowerCase()}),s=U(()=>{if(p(r))return XF;if(p(n))return QF;const c=JF[p(o)]||(t==null?void 0:t.mimeType[p(i)])||(t==null?void 0:t.extension[p(o)]);return{...YF,...c}}),a=U(()=>p(r)?"oc-resource-icon-space":p(n)?"oc-resource-icon-folder":"oc-resource-icon-file");return{icon:s,iconTypeClass:a}}});function eO(e,t,n,r,o,i){const s=pe("oc-icon");return J(),Ce(s,{key:`resource-icon-${e.icon.name}`,name:e.icon.name,color:e.icon.color,size:e.size,class:H.normalizeClass(["oc-resource-icon",e.iconTypeClass])},null,8,["name","color","size","class"])}const Co=Ve(ZF,[["render",eO]]),tO={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}=He.storeToRefs(t);return{linkTarget:U(()=>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")}}},nO={key:1};function rO(e,t,n,r,o,i){return n.isResourceClickable?(J(),Ce(Wr(i.componentType),Zt({key:0},i.componentProps,{target:e.linkTarget,draggable:!1,class:"oc-resource-link","no-hover":"",onDragstart:t[0]||(t[0]=Rn(()=>{},["prevent","stop"])),onClick:i.emitClick}),{default:Te(()=>[Ge(e.$slots,"default")]),_:3},16,["target","onClick"])):(J(),ve("span",nO,[Ge(e.$slots,"default")]))}const Ff=Ve(tO,[["render",rO]]),iO=Me({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?ss.join(this.pathPrefix,this.fullPath):this.fullPath},htmlTitle(){if(!this.tooltip)return this.isExtensionDisplayed?`${this.displayName}${this.displayExtension}`:this.displayName}}}),oO=["data-test-resource-path","data-test-resource-name","data-test-resource-type","title"],sO={key:0,class:"oc-text-truncate"},aO=["textContent"],lO=["textContent"],cO=["textContent"];function uO(e,t,n,r,o,i){const s=dn("oc-tooltip");return ot((J(),ve("span",{class:H.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?(J(),ve("span",sO,[fe("span",{class:"oc-resource-basename",textContent:H.toDisplayString(e.displayName)},null,8,aO)])):(J(),ve("span",{key:1,class:"oc-resource-basename oc-text-break",textContent:H.toDisplayString(e.displayName)},null,8,lO)),e.extension&&e.isExtensionDisplayed?(J(),ve("span",{key:2,class:"oc-resource-extension",textContent:H.toDisplayString(e.displayExtension)},null,8,cO)):Oe("",!0)],10,oO)),[[s,e.tooltip]])}const Of=Ve(iO,[["render",uO]]),fO=Me({name:"ResourceListItem",components:{ResourceIcon:Co,ResourceLink:Ff,ResourceName:Of},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")}}}),dO={class:"oc-resource-indicators"},pO=["textContent"];function hO(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"),f=dn("oc-tooltip");return J(),ve("div",{class:H.normalizeClass(["oc-resource oc-text-overflow",{"oc-resource-no-interaction":!e.isResourceClickable}])},[e.isIconDisplayed?(J(),Ce(c,{key:0,resource:e.resource,link:e.link,"is-resource-clickable":e.isResourceClickable,class:"oc-resource-icon-link",onClick:e.emitClick},{default:Te(()=>[e.hasThumbnail?ot((J(),Ce(s,{key:e.thumbnail,src:e.thumbnail,class:"oc-resource-thumbnail",width:"40",height:"40","aria-label":e.tooltipLabelIcon},null,8,["src","aria-label"])),[[f,e.tooltipLabelIcon]]):ot((J(),Ce(a,{key:1,"aria-label":e.tooltipLabelIcon,resource:e.resource},null,8,["aria-label","resource"])),[[f,e.tooltipLabelIcon]])]),_:1},8,["resource","link","is-resource-clickable","onClick"])):Oe("",!0),fe("div",{class:H.normalizeClass(["oc-resource-details oc-text-overflow",{"oc-pl-s":e.isIconDisplayed}])},[be(c,{resource:e.resource,"is-resource-clickable":e.isResourceClickable,link:e.link,class:"oc-text-overflow",onClick:e.emitClick},{default:Te(()=>[(J(),Ce(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",dO,[e.isPathDisplayed?(J(),Ce(Wr(e.parentFolderComponentType),{key:0,to:e.parentFolderLink,style:H.normalizeStyle(e.parentFolderStyle),class:"parent-folder oc-text-truncate"},{default:Te(()=>[be(l,H.normalizeProps(Ha(e.parentFolderLinkIconAttrs)),null,16),fe("span",{class:"text oc-text-truncate",textContent:H.toDisplayString(e.parentFolderName)},null,8,pO)]),_:1},8,["to","style"])):Oe("",!0)])],2)],2)}const Po=Ve(fO,[["render",hO]]),mv=Me({__name:"ResourcePreview",props:{searchResult:{default:()=>({data:{}})},isClickable:{type:Boolean,default:!0},term:{default:""}},setup(e){const t=new gv,{triggerDefaultAction:n}=Vn(),{getMatchingSpace:r}=ln(),{getDefaultAction:o}=Vn(),{loadPreview:i}=Mf(),s=Ud("resourceListItem"),{getPathPrefix:a,getParentFolderName:c,getParentFolderLink:u,getParentFolderLinkIconAdditionalAttributes:l,getFolderLink:f}=si(),d=Ke(),m=oe(),w=U(()=>d.areFileExtensionsShown),v=U(()=>({...e.searchResult.data,...p(m)&&{thumbnail:p(m)}})),T=U(()=>r(p(v))),b=U(()=>{const I=p(v);return ee.isSpaceResource(I)&&I.disabled===!0}),g=()=>{n({space:p(T),resources:[p(v)]})},h=U(()=>e.isClickable?{parentFolderLink:u(p(v)),onClick:g}:{isResourceClickable:!1}),y=U(()=>{var $;if(p(v).isFolder)return f(p(v));const I=o({resources:[p(v)],space:p(T)});if(!(I!=null&&I.route))return null;const A=I.route({space:p(T),resources:[p(v)]});return A.query={...A.query,contextRouteQuery:{...(($=A.query)==null?void 0:$.contextRouteQuery)||{},term:e.term}},A}),S=a(p(v)),E=c(p(v)),R=l(p(v));return Mt(()=>{p(b)&&p(s).parentElement.classList.add("disabled");const I=async()=>{const $=await i({space:p(T),resource:p(v),dimensions:zn.Thumbnail,cancelRunning:!0,updateStore:!1});$&&(m.value=$)},A=Et.debounce(({unobserve:$})=>{$(),I()},250);t.observe(p(s).$el,{onEnter:A,onExit:A.cancel})}),jn(()=>{t.disconnect()}),(I,A)=>(J(),Ce(Po,Zt({ref_key:"resourceListItem",ref:s,resource:v.value,"path-prefix":p(S),"is-path-displayed":!0,link:y.value,"is-extension-displayed":w.value,"parent-folder-link-icon-additional-attributes":p(R),"parent-folder-name":p(E),"is-thumbnail-displayed":!!m.value},h.value),null,16,["resource","path-prefix","link","is-extension-displayed","parent-folder-link-icon-additional-attributes","parent-folder-name","is-thumbnail-displayed"]))}}),gO=7,mO=200,yO=Me({name:"CreateShortcutModal",components:{ResourcePreview:mv},props:{modal:{type:Object,required:!0},space:{type:Object,required:!0}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:n}){const r=Ye(),{$gettext:o}=Ne.useGettext(),{showMessage:i,showErrorMessage:s}=rt(),a=ze(),{search:c}=bf(),{getPathPrefix:u,getParentFolderName:l,getParentFolderLink:f,getParentFolderLinkIconAdditionalAttributes:d,getFolderLink:m}=si(),w=Ke(),{resources:v,currentFolder:T}=He.storeToRefs(w),b=oe(null),g=oe(""),h=oe(""),y=oe(null),S=oe(null),E=oe(!1);let R=null;const I=K=>{const z=K.trim();return W(z)?z:`https://${z}`},A=U(()=>I(p(g))),$=U(()=>!!p(v).find(K=>K.name===`${p(h)}.url`)),D=U(()=>p($)||!p(h)||!p(g));Tt(D,()=>{t("update:confirmDisabled",p(D))},{immediate:!0});const k=U(()=>p($)?o("%{name} already exists",{name:`${p(h)}.url`}):/[/]/.test(p(h))?o('Shortcut name cannot contain "/"'):""),N=un.useTask(function*(K,z){y.value=null,z=`name:"*${z}*" NOT name:"*.url"`;try{y.value=yield c(z,gO)}catch{}}),j=Et.debounce(()=>{N.perform(p(g))},mO),W=K=>["http://","https://"].some(B=>B.startsWith(K)||K.startsWith(B)),X=()=>{y.value=null,g.value=p(A);try{let K=new URL(p(A)).host;p(v).some(z=>z.name===`${K}.url`)&&(K=Un(`${K}.url`,"url",p(v)).slice(0,-4)),h.value=K}catch{}},ie=K=>{y.value=null;const z=new URL(window.location.href);let B=K.data.name;g.value=`${z.origin}/f/${K.id}`,p(v).some(V=>V.name===`${B}.url`)&&(B=Un(`${B}.url`,"url",p(v)).slice(0,-4)),h.value=B},de=K=>p(S)===K,se=(K=!1)=>{const z=Array.from(document.querySelectorAll("li.selectable-item"));let B=p(S)!==null?p(S):K?z.length:-1;const V=K?-1:1;do if(B+=V,B<0||B>z.length-1)return null;while(z[B].classList.contains("disabled"));return B},we=()=>{S.value=se(!0)},Se=()=>{S.value=se(!1)},Z=K=>{p(E)&&(K.stopPropagation(),p(b).hide())},ne=K=>{var z,B;p(E)&&(K.stopPropagation(),p(S)!==null&&(p(S)===0?X():ie((B=(z=p(y))==null?void 0:z.values)==null?void 0:B[p(S)-1]),p(b).hide()))},le=()=>{E.value=!1,S.value=null},Ie=()=>{E.value=!0,S.value=0},Y=()=>{g.value.trim().length&&p(b).show()},_=async()=>{if(await Gn(),h.value=g.value.trim(),!g.value.trim().length){p(b).hide();return}p(b).show(),_n(a,"files-public-link")||j()},F=async()=>{try{const z=`[InternetShortcut]
52
- URL=${Jf.sanitize(I(p(g)),{USE_PROFILES:{html:!0}})}`,B=ee.urlJoin(p(T).path,`${p(h)}.url`),V=await r.webdav.putFileContents(e.space,{path:B,content:z});w.upsertResource(V),i({title:o("Shortcut was created successfully")})}catch(K){console.error(K),s({title:o("Failed to create shortcut"),errors:[K]})}};return Mt(async()=>{var K,z;await Gn(),R=new Zf((z=(K=p(b))==null?void 0:K.$refs)==null?void 0:z.drop)}),Tt(y,async()=>{await Gn(),!(!p(E)||!R)&&(R.unmark(),R.mark(p(g),{element:"span",className:"mark-highlight",exclude:[".selectable-item-url *",".create-shortcut-modal-search-separator *"]}))},{deep:!0}),Tt(S,()=>{var z,B;if(!p(E)||typeof((B=(z=p(b))==null?void 0:z.$el)==null?void 0:B.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:h,dropRef:b,dropItemUrl:A,searchResult:y,confirmButtonDisabled:D,inputFileNameErrorMessage:k,searchTask:N,dropItemUrlClicked:X,dropItemResourceClicked:ie,getPathPrefix:u,getFolderLink:m,getParentFolderLink:f,getParentFolderName:l,getParentFolderLinkIconAdditionalAttributes:d,onKeyEnterDrop:ne,onKeyDownDrop:Se,onKeyUpDrop:we,onKeyEscDrop:Z,onHideDrop:le,onShowDrop:Ie,onInputUrlInput:_,onClickUrlInput:Y,isDropItemActive:de,onConfirm:F}}}),bO={class:"oc-flex oc-flex-middle create-shortcut-modal-label"},vO=["textContent"],wO=["textContent"],SO={key:0,class:"oc-p-xs oc-flex oc-flex-center"},EO={class:"create-shortcut-modal-search-separator oc-text-muted oc-text-small oc-pl-xs"},TO=["textContent"],AO={key:0,class:"oc-flex oc-width-1-1 oc-mt-m"},RO={class:"oc-flex oc-flex-middle create-shortcut-modal-label"},_O=["textContent"];function IO(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"),f=pe("resource-preview"),d=pe("oc-list"),m=pe("oc-drop");return J(),ve(Qe,null,[be(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:[Ji(e.onKeyUpDrop,["up"]),Ji(e.onKeyDownDrop,["down"]),Ji(e.onKeyEscDrop,["esc"]),Ji(e.onKeyEnterDrop,["enter"])],onClick:e.onClickUrlInput},{label:Te(()=>[fe("div",bO,[fe("label",{for:"create-shortcut-modal-url-input",textContent:H.toDisplayString(e.$gettext("Webpage or file"))},null,8,vO),be(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"]),be(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:Te(()=>[be(d,null,{default:Te(()=>{var w,v;return[fe("li",{class:H.normalizeClass(["oc-p-xs selectable-item selectable-item-url",{active:e.isDropItemActive(0)}])},[be(u,{class:"oc-width-1-1",appearance:"raw","justify-content":"left",onClick:e.dropItemUrlClicked},{default:Te(()=>[be(c,{name:"external-link"}),fe("span",{textContent:H.toDisplayString(e.dropItemUrl)},null,8,wO)]),_:1},8,["onClick"])],2),e.searchTask.isRunning?(J(),ve("li",SO,[be(l)])):Oe("",!0),(v=(w=e.searchResult)==null?void 0:w.values)!=null&&v.length?(J(),ve(Qe,{key:1},[fe("li",EO,[fe("span",{textContent:H.toDisplayString(e.$gettext("Link to a file"))},null,8,TO)]),(J(!0),ve(Qe,null,kt(e.searchResult.values,(T,b)=>(J(),ve("li",{key:b,class:H.normalizeClass(["oc-p-xs selectable-item",{active:e.isDropItemActive(b+1)}])},[be(u,{class:"oc-width-1-1",appearance:"raw","justify-content":"left",onClick:g=>e.dropItemResourceClicked(T)},{default:Te(()=>[be(f,{"search-result":T,"is-clickable":!1},null,8,["search-result"])]),_:2},1032,["onClick"])],2))),128))],64)):Oe("",!0)]}),_:1})]),_:1},8,["onHideDrop","onShowDrop"]),e.inputFilename?(J(),ve("div",AO,[be(a,{id:"create-shortcut-modal-filename-input",modelValue:e.inputFilename,"onUpdate:modelValue":t[1]||(t[1]=w=>e.inputFilename=w),class:"oc-width-1-1","error-message":e.inputFileNameErrorMessage,"fix-message-line":!0},{label:Te(()=>[fe("div",RO,[fe("label",{for:"create-shortcut-modal-filename-input",textContent:H.toDisplayString(e.$gettext("Shortcut name"))},null,8,_O),be(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","error-message"])])):Oe("",!0)],64)}const yv=Ve(yO,[["render",IO]]),CO=({space:e})=>{const{dispatchModal:t}=bt(),{$gettext:n}=Ne.useGettext(),r=Ke(),{currentFolder:o}=He.storeToRefs(r);return{actions:U(()=>[{name:"create-shortcut",icon:"external-link",handler:()=>{t({title:n("Create a Shortcut"),confirmText:n("Create"),customComponent:yv,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"}])}},PO=()=>{const{showErrorMessage:e}=rt(),t=ze(),{$gettext:n}=Ne.useGettext(),r=Or(),o=os(),i=Ye(),s=u=>{const l=/URL=(.+)/,f=u.match(l);if(f&&f[1])return f[1];throw new Error("unable to extract url")},a=async({resources:u,space:l})=>{try{const f=new URL(window.location.href),d=(await i.webdav.getFileContents(l,u[0])).body;let m=s(d);if(m=m.match(/^http[s]?:\/\//)?m:`https://${m}`,m=Jf.sanitize(m,{USE_PROFILES:{html:!0}}),m.startsWith(f.origin)){window.location.href=m;return}window.open(m)}catch(f){console.error(f),e({title:n("Failed to open shortcut"),errors:[f]})}};return{actions:U(()=>[{name:"open-shortcut",icon:"external-link",category:"context",handler:a,label:()=>n("Open shortcut"),isVisible:({resources:u})=>p(r)&&!p(o)&&!at(t,"files-spaces-generic")&&!_n(t,"files-public-link")&&!At(t,"files-common-favorites")&&!At(t,"files-common-search")&&!Nt(t,"files-shares-with-me")&&!Nt(t,"files-shares-with-others")&&!Nt(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}},FO=Me({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}=Ne.useGettext(),{getLinkRoleByType:r}=sa(),o=c=>e.modelValue===c,i=c=>{t("update:modelValue",c)},s=U(()=>{var c;return n((c=r(e.modelValue))==null?void 0:c.displayName)}),a=Yt.v4();return{isSelectedType:o,updateSelectedType:i,currentLinkRoleLabel:s,dropUuid:a,getLinkRoleByType:r}}}),OO=["textContent"],xO=["textContent"],kO={class:"oc-flex oc-flex-middle"},NO=["textContent"],$O={class:"oc-text-small"},DO={class:"oc-flex"};function LO(e,t,n,r,o,i){var f;const s=pe("oc-icon"),a=pe("oc-button"),c=pe("oc-list"),u=pe("oc-drop"),l=dn("oc-tooltip");return J(),ve(Qe,null,[e.availableLinkTypeOptions.length>1?(J(),Ce(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:Te(()=>[fe("span",{class:"link-current-role",textContent:H.toDisplayString(e.currentLinkRoleLabel||e.$gettext("Select a role"))},null,8,OO),be(s,{name:"arrow-down-s"})]),_:1},8,["id"])):ot((J(),ve("span",{key:1,class:"link-current-role oc-mr-m",textContent:H.toDisplayString(e.currentLinkRoleLabel)},null,8,xO)),[[l,(f=e.getLinkRoleByType(e.modelValue))==null?void 0:f.description]]),e.availableLinkTypeOptions.length>1?(J(),Ce(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:Te(()=>[be(c,{class:"role-dropdown-list"},{default:Te(()=>[(J(!0),ve(Qe,null,kt(e.availableLinkTypeOptions,(d,m)=>(J(),ve("li",{key:`role-dropdown-${m}`},[be(a,{id:`files-role-${e.getLinkRoleByType(d).id}`,class:H.normalizeClass([{selected:e.isSelectedType(d),"oc-secondary-container":e.isSelectedType(d)},"oc-p-s"]),appearance:"raw","justify-content":"space-between",onClick:w=>e.updateSelectedType(d)},{default:Te(()=>[fe("span",kO,[be(s,{name:e.getLinkRoleByType(d).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:H.toDisplayString(e.$gettext(e.getLinkRoleByType(d).displayName))},null,8,NO),fe("span",$O,H.toDisplayString(e.$gettext(e.getLinkRoleByType(d).description)),1)])]),fe("span",DO,[e.isSelectedType(d)?(J(),Ce(s,{key:0,name:"check"})):Oe("",!0)])]),_:2},1032,["id","class","onClick"])]))),128))]),_:1})]),_:1},8,["drop-id","toggle","offset"])):Oe("",!0)],64)}const bv=Ve(FO,[["render",LO],["__scopeId","data-v-0eaa2216"]]),MO=Me({name:"CreateLinkModal",components:{LinkRoleDropdown:bv},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=Ye(),r=Ne.useGettext(),{$gettext:o}=r,i=Dv(),{isEnabled:s,postMessage:a}=ni(),{defaultLinkType:c,getAvailableLinkTypes:u,getLinkRoleByType:l,isPasswordEnforcedForLinkType:f}=sa(),{addLink:d}=jt(),m=oe(!1),w=oe(!1),v=U(()=>e.resources.every(({isFolder:Se})=>Se)),T=U(()=>p(s)?o("Share link(s)"):o("Copy link")),b=oe(Yt.v4()),g=oe({}),h=oe(),y=Ca({value:"",error:void 0}),S=oe(p(c)),E=U(()=>o(l(p(S)).description)),R=U(()=>o(l(p(S)).displayName)),I=U(()=>l(p(S)).icon),A=U(()=>u({isFolder:p(v)})),$=U(()=>f(p(S))),D=i.getPolicy({enforcePassword:p($)}),k=()=>{m.value=!0},N=({date:Se,error:Z})=>{h.value=Se,w.value=Z},j=()=>Promise.allSettled(e.resources.map(Se=>{var Z;return d({clientService:n,space:e.space,resource:Se,options:{type:p(S),"@libre.graph.quickLink":!1,password:p(y).value,expirationDateTime:(Z=p(h))==null?void 0:Z.toISO(),displayName:o("Unnamed link")}})})),W=U(()=>!!D.check(p(y).value)),X=U(()=>!(p(W)&&!p(w))),ie=async(Se={})=>{const Z=await j(),ne=Z.filter(({status:Y})=>Y==="fulfilled");ne.length&&p(s)&&a("opencloud-embed:share",ne.map(({value:Y})=>Y.webUrl));const le=[],Ie=Z.filter(({status:Y})=>Y==="rejected");if(Ie.length&&Ie.map(({reason:Y})=>Y).forEach(Y=>{var _;if(console.error(Y),((_=Y.response)==null?void 0:_.status)===400){const F=Y.response.data.error;F.message=Et.upperFirst(F.message),le.push(F)}}),le.length)return y.error=o(le[0].message),Promise.reject();e.callbackFn&&e.callbackFn({result:Z,password:y.value,options:Se})};t({onConfirm:ie});const de=Se=>p(S)===Se,se=Se=>{y.value=Se,y.error=void 0},we=Se=>{S.value=Se};return Mt(()=>{const Se=p(g)[p(S)];Se&&Se.$el.focus(),p($)&&(y.value=i.generatePassword())}),{roleRefs:g,password:y,passwordEnforced:$,passwordPolicy:D,generatePasswordMethod:()=>i.generatePassword(),passwordInputKey:b,selectedExpiry:h,availableLinkTypes:A,selectedType:S,selectedTypeIcon:I,selectedTypeDisplayName:R,selectedTypeDescription:E,isSelectedLinkType:de,updateSelectedLinkType:we,updatePassword:se,getLinkRoleByType:l,confirmButtonText:T,isAdvancedMode:m,setAdvancedMode:k,onExpiryDateChanged:N,confirmButtonDisabled:X,DateTime:Dt.DateTime,onConfirm:ie}}}),BO={class:"oc-flex oc-button-justify-content-space-between oc-pb-s"},jO={key:0,class:"oc-flex oc-flex-middle"},UO={key:1,class:"oc-flex oc-flex-middle"},qO={class:"oc-flex oc-flex-column"},VO=["textContent"],zO=["textContent"],WO=["textContent"],HO={class:"link-modal-password oc-mb-m"},GO={key:1,class:"link-modal-password-text oc-text-small oc-text-muted"},KO=["textContent"],QO=["textContent"],XO={class:"link-modal-actions oc-flex oc-flex-right oc-flex-middle oc-mt-s"},YO={class:"oc-rounded oc-menu-item-hover"};function JO(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"),f=pe("oc-list"),d=pe("oc-drop");return J(),ve(Qe,null,[fe("div",BO,[e.isAdvancedMode?(J(),ve("div",jO,[be(s,{class:"oc-mr-s",name:e.selectedTypeIcon,"fill-type":"line"},null,8,["name"]),be(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"])])):(J(),ve("div",UO,[be(s,{class:"oc-mr-s",name:e.selectedTypeIcon,"fill-type":"line"},null,8,["name"]),fe("div",qO,[fe("span",{class:"oc-text-bold",textContent:H.toDisplayString(e.selectedTypeDisplayName)},null,8,VO),fe("span",{class:"oc-text-small",textContent:H.toDisplayString(e.selectedTypeDescription)},null,8,zO)])])),e.isAdvancedMode?Oe("",!0):(J(),Ce(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:Te(()=>[be(s,{name:"settings-3",size:"small","fill-type":"fill"}),fe("span",{textContent:H.toDisplayString(e.$gettext("Options"))},null,8,WO)]),_:1}))]),fe("div",HO,[e.isAdvancedMode?(J(),Ce(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.passwordEnforced?`${e.$gettext("Password")}*`:e.$gettext("Password"),class:"link-modal-password-input","onUpdate:modelValue":e.updatePassword},null,8,["model-value","password-policy","generate-password-method","error-message","label","onUpdate:modelValue"])):e.password.value?(J(),ve("div",GO,[fe("span",{textContent:H.toDisplayString(e.$gettext("Password:"))},null,8,KO),fe("span",{textContent:H.toDisplayString(e.password.value)},null,8,QO)])):Oe("",!0),e.isAdvancedMode?(J(),Ce(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"])):Oe("",!0)]),fe("div",XO,[be(c,{class:"link-modal-cancel oc-modal-body-actions-cancel oc-ml-s",onClick:t[1]||(t[1]=m=>e.$emit("cancel"))},{default:Te(()=>[Vt(H.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),fe("div",{class:H.normalizeClass(["link-modal-confirm-button-group oc-ml-s",{"oc-button-group":e.password.value}])},[be(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:Te(()=>[Vt(H.toDisplayString(e.confirmButtonText),1)]),_:1},8,["disabled"]),e.password.value?(J(),Ce(c,{key:0,class:"link-modal-confirm oc-modal-body-actions-confirm-secondary-trigger",appearance:"filled",disabled:e.confirmButtonDisabled},{default:Te(()=>[be(s,{size:"small",name:"arrow-down-s"})]),_:1},8,["disabled"])):Oe("",!0),e.password.value?(J(),Ce(d,{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:Te(()=>[be(f,{class:"oc-modal-body-actions-confirm-secondary-menu"},{default:Te(()=>[fe("li",YO,[be(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:Te(()=>[Vt(H.toDisplayString(e.$gettext("Copy link and password")),1)]),_:1})])]),_:1})]),_:1})):Oe("",!0)],2)])],64)}const vv=Ve(MO,[["render",JO],["__scopeId","data-v-0f5a06c6"]]),bn={Internal:"internal",View:"view",Upload:"upload",Edit:"edit",CreateOnly:"createOnly"},ZO={LibreGraphPermissionsRolesAllowedValues:"@libre.graph.permissions.roles.allowedValues"},sa=()=>{const{$gettext:e}=Ne.useGettext(),t=rn(),n=hn(),r=U(()=>n.can("create-all","PublicLink")),o=U(()=>bn.View),i=u=>u===bn.View?t.sharingPublicPasswordEnforcedFor.read_only:u===bn.Upload?t.sharingPublicPasswordEnforcedFor.upload_only:u===bn.CreateOnly?t.sharingPublicPasswordEnforcedFor.read_write:u===bn.Edit?t.sharingPublicPasswordEnforcedFor.read_write_delete:!1,s=({isFolder:u})=>p(r)?u?[bn.View,bn.Edit,bn.CreateOnly]:[bn.View,bn.Edit]:[],a=[{id:bn.Internal,displayName:e("Invited people"),description:e("Link works only for invited people. Login is required."),icon:"user"},{id:bn.View,displayName:e("Can view"),description:e("View, download"),icon:"eye"},{id:bn.Upload,displayName:e("Can upload"),description:e("View, upload, download"),icon:"upload"},{id:bn.Edit,displayName:e("Can edit"),description:e("View, upload, edit, download, delete"),icon:"pencil"},{id:bn.CreateOnly,displayName:e("Secret File Drop"),description:e("Upload only, existing content is not revealed"),icon:"inbox-unarchive"}];return{defaultLinkType:o,isPasswordEnforcedForLinkType:i,getAvailableLinkTypes:s,linkShareRoles:a,getLinkRoleByType:u=>a.find(({id:l})=>l===u)}},ex=({enforceModal:e=!1}={})=>{const t=Ye(),n=vt(),{showMessage:r,showErrorMessage:o}=rt(),{$gettext:i,$ngettext:s}=Ne.useGettext(),a=rn(),c=hn(),u=cn(),{defaultLinkType:l}=sa(),{addLink:f}=jt(),{dispatchModal:d}=bt(),{copyToClipboard:m}=wf(),w=async({result:g,password:h,options:y={}})=>{const S=g.filter(R=>R.status==="fulfilled");if(S.length){let R=i("Link has been created successfully");if(g.length===1)try{const I=y.copyPassword?i("%{link} Password:%{password}",{link:S[0].value.webUrl,password:h},!0):S[0].value.webUrl;await m(I),R=i("The link has been copied to your clipboard.")}catch(I){console.warn("Unable to copy link to clipboard",I)}r({title:s(R,"Links have been created successfully.",S.length)})}const E=g.filter(({status:R})=>R==="rejected");E.length&&o({errors:E.map(({reason:R})=>R),title:s("Failed to create link","Failed to create links",E.length)})},v=async({space:g,resources:h})=>{const y=a.sharingPublicPasswordEnforcedFor.read_only===!0;if(e||y){d({title:s('Copy link for "%{resourceName}"',"Copy links for the selected items",h.length,{resourceName:h[0].name}),customComponent:vv,customComponentAttrs:()=>({space:g,resources:h,callbackFn:w}),hideActions:!0});return}const S=h.map(R=>f({clientService:t,space:g,resource:R,options:{"@libre.graph.quickLink":!1,displayName:i("Unnamed link"),type:p(l)}})),E=await u.addTask(()=>Promise.allSettled(S));w({result:E})},T=({resources:g})=>{if(!g.length)return!1;for(const h of g)if(!h.canShare({user:n.user,ability:c})||ee.isProjectSpaceResource(h)&&h.disabled)return!1;return!0};return{actions:U(()=>[{name:"create-links",icon:"link",handler:v,label:()=>i("Create links"),isVisible:T,class:"oc-files-actions-create-links"}])}},tx=Me({name:"AppLoadingSpinner"}),nx={class:"oc-flex oc-flex-middle oc-flex-center oc-height-1-1 oc-width-1-1"};function rx(e,t,n,r,o,i){const s=pe("oc-spinner");return J(),ve("div",nx,[be(s,{id:"app-loading-spinner",size:"large","aria-hidden":!0,"aria-label":""})])}const xf=Ve(tx,[["render",rx]]),ix=Me({name:"FilePickerModal",components:{AppLoadingSpinner:xf},props:{modal:{type:Object,required:!0},app:{type:Object,required:!0},parentFolderLink:{type:Object,required:!0}},setup(e){const t=oe(),n=oe(!0),r=ze(),{removeModal:o}=bt(),{getMatchingSpace:i}=ln(),s=ii(),{getEditorRouteOpts:a}=Vn(),c=r.resolve(e.parentFolderLink),u=e.app.extensions.map(v=>v.extension?v.extension:v.mimeType),l=s.currentTheme.name,f=new URL(c.href,window.location.origin);f.searchParams.append("hide-logo","true"),f.searchParams.append("embed","true"),f.searchParams.append("embed-target","file"),f.searchParams.append("embed-delegate-authentication","false"),f.searchParams.append("embed-file-types",u.join(","));const d=()=>{n.value=!1,p(t).contentWindow.focus()},m=({data:v})=>{if(v.name!=="opencloud-embed:file-pick")return;const{resource:T,locationQuery:b}=v.data,g=i(T),h=ee.isShareSpaceResource(g)?g.id:void 0,y=a(p(r.currentRoute).name,g,T,h);y.query={...y.query,...b};const S=r.resolve(y),E=new URL(S.href,window.location.origin);o(e.modal.id),window.open(E.href,"_blank")},w=({data:v})=>{v.name==="opencloud-embed:cancel"&&o(e.modal.id)};return Mt(()=>{window.addEventListener("message",m),window.addEventListener("message",w)}),jn(()=>{window.removeEventListener("message",m),window.removeEventListener("message",w)}),{isLoading:n,onLoad:d,iframeTitle:l,iframeSrc:f.href,iframeRef:t,onFilePick:m}}}),ox={class:"oc-height-1-1",tabindex:"0"},sx=["title","src"];function ax(e,t,n,r,o,i){const s=pe("app-loading-spinner");return J(),ve("div",ox,[e.isLoading?(J(),Ce(s,{key:0})):Oe("",!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,sx),[[Ya,!e.isLoading]])])}const wv=Ve(ix,[["render",ax]]),aa=(e={},t)=>{const n=e.targetRouteCallback,{getMatchingSpace:r}=ln(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?xn("files-spaces-generic",Jn(l,{path:a,fileId:c})):{}}}},si=(e={})=>{const t=rn(),{$gettext:n}=Ne.useGettext(),{getInternalSpace:r,getMatchingSpace:o,isResourceAccessible:i}=ln(),{createFolderLink:s}=aa(e);return{getPathPrefix:d=>{const m=p(e.space)||o(d);return ee.isProjectSpaceResource(m)?ss.join(n("Spaces"),m.name):ee.isShareSpaceResource(m)?ss.join(n("Shares"),m.name):m.name},getFolderLink:d=>s({path:d.path,fileId:d.fileId,resource:d}),getParentFolderLink:d=>{const m=p(e.space)||o(d),w=i({space:m,path:gt.dirname(d.path)});return d.remoteItemId&&d.path==="/"||!w?kn("files-shares-with-me"):ee.isProjectSpaceResource(d)?xn("files-spaces-projects"):s({path:gt.dirname(d.path),...d.parentFolderId&&{fileId:d.parentFolderId},resource:d})},getParentFolderName:d=>{const m=p(e.space)||o(d),w=i({space:m,path:gt.dirname(d.path)});if(ee.isShareRoot(d)||d.id===m.id&&ee.isShareSpaceResource(m)||!w)return n("Shared with me");const T=ee.extractParentFolderName(d);if(T)return T;if(ee.isShareSpaceResource(m))return m.name;if(t.spacesProjects){if(ee.isProjectSpaceResource(d))return n("Spaces");if((m==null?void 0:m.driveType)==="project")return m.name}return n("Personal")},getParentFolderLinkIconAdditionalAttributes:d=>ee.isProjectSpaceResource(d)||ee.isProjectSpaceResource(r(d.storageId)||{})&&d.path.split("/").length===2?{name:"layout-grid","fill-type":"fill"}:{}}},Sv=({appId:e})=>{const{$gettext:t}=Ne.useGettext(),n=Or(),{dispatchModal:r}=bt(),o=Zn(),{apps:i}=He.storeToRefs(o),{getParentFolderLink:s}=si(),a=({resources:u})=>{const l=p(i)[e],f=s(u[0]);r({elementClass:"open-with-app-modal",title:t("Open file in %{app}",{app:l.name}),customComponent:wv,hideActions:!0,customComponentAttrs:()=>({app:l,parentFolderLink:f}),focusTrapInitial:!1})};return{actions:U(()=>[{name:"open-with-app",icon:"folder-open",handler:a,label:()=>t("Open"),isVisible:()=>!p(n),class:"oc-files-actions-open-with-app-trigger"}])}},lx=Me({name:"SaveAsModal",components:{AppLoadingSpinner:xf},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=oe(),n=oe(!0),r=ii(),{$gettext:o}=Ne.useGettext(),i=ze(),s=Ye(),{removeModal:a}=bt(),{showMessage:c,showErrorMessage:u}=rt(),{getMatchingSpace:l}=ln(),{getEditorRouteOpts:f}=Vn(),d=i.resolve(e.parentFolderLink),m=r.currentTheme.name,w=new URL(d.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=()=>{n.value=!1,p(t).contentWindow.focus()},T=async({data:y})=>{if(y.name!=="opencloud-embed:select")return;const{resources:S,fileName:E,locationQuery:R}=y.data,I=S[0],A=l(I);try{const $=await b({destinationFolder:I,fileName:E,space:A});c({title:o('"%{fileName}" was saved successfully',{fileName:$.name})}),g({resource:$,space:A,locationQuery:R})}catch($){console.error($),u({title:o('Unable to save "%{fileName}"',{fileName:E}),errors:[$]}),console.error($)}a(e.modal.id)},b=async({destinationFolder:y,fileName:S,space:E})=>{const{children:R}=await s.webdav.listFiles(E,{fileId:y.fileId},{davProperties:[qe.Name]});return R.find(A=>A.name===S)&&(S=Un(S,e.originalResource.extension,R)),s.webdav.putFileContents(E,{fileName:S,parentFolderId:y.id,content:e.content,path:ee.urlJoin(y.path,S)})},g=({locationQuery:y,resource:S,space:E})=>{const R=ee.isShareSpaceResource(E)?E.id:void 0,I=f(p(i.currentRoute).name,E,S,R);I.query={...I.query,...y};const A=i.resolve(I),$=new URL(A.href,window.location.origin);window.open($.href,"_blank")},h=({data:y})=>{y.name==="opencloud-embed:cancel"&&a(e.modal.id)};return Mt(()=>{window.addEventListener("message",T),window.addEventListener("message",h)}),jn(()=>{window.removeEventListener("message",T),window.removeEventListener("message",h)}),{isLoading:n,onLoad:v,iframeTitle:m,iframeSrc:w.href,iframeRef:t,onLocationPick:T}}}),cx={class:"oc-height-1-1",tabindex:"0"},ux=["title","src"];function fx(e,t,n,r,o,i){const s=pe("app-loading-spinner");return J(),ve("div",cx,[e.isLoading?(J(),Ce(s,{key:0})):Oe("",!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,ux),[[Ya,!e.isLoading]])])}const Ev=Ve(lx,[["render",fx]]),Tv=({content:e})=>{const{$gettext:t}=Ne.useGettext(),n=Or(),{dispatchModal:r}=bt(),{getParentFolderLink:o}=si(),i=({resources:a})=>{const c=o(a[0]);r({elementClass:"save-as-modal",title:t("Save as"),customComponent:Ev,hideActions:!0,customComponentAttrs:()=>({content:p(e),parentFolderLink:c,originalResource:a[0]}),focusTrapInitial:!1})};return{actions:U(()=>[{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"}])}},Av=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=vt(),{$gettext:r,$ngettext:o}=Ne.useGettext(),i=hn(),s=Ye(),a=en(),{dispatchModal:c}=bt(),u=lt(),{removeResources:l}=Ke(),f=v=>v.filter(T=>ee.isProjectSpaceResource(T)&&T.canBeDeleted({user:n.user,ability:i})),d=async v=>{const T=s.graphAuthenticated,b=v.map(S=>T.drives.deleteDrive(S.id).then(()=>(l([S]),u.removeSpace(S),!0))),g=await Promise.allSettled(b),h=g.filter(S=>S.status==="fulfilled");if(h.length){const S=h.length===1&&v.length===1?r('Space "%{space}" was deleted successfully',{space:v[0].name}):o("%{spaceCount} space was deleted successfully","%{spaceCount} spaces were deleted successfully",h.length,{spaceCount:h.length.toString()},!0);e({title:S})}const y=g.filter(S=>S.status==="rejected");if(y.length){y.forEach(console.error);const S=y.length===1&&v.length===1?r('Failed to delete space "%{space}"',{space:v[0].name}):o("Failed to delete %{spaceCount} space","Failed to delete %{spaceCount} spaces",y.length,{spaceCount:y.length.toString()},!0);t({title:S,errors:y.map(E=>E.reason)})}p(a).name==="admin-settings-spaces"&&Xe.publish("app.admin-settings.list.load")},m=({resources:v})=>{const T=f(v);if(!T.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?",T.length,{count:T.length.toString()});c({title:o('Delete Space "%{space}"?',"Delete %{spaceCount} Spaces?",T.length,{space:T[0].name,spaceCount:T.length.toString()}),confirmText:r("Delete"),message:b,hasInput:!1,onConfirm:()=>d(T)})};return{actions:U(()=>[{name:"delete",icon:"delete-bin",label:()=>r("Delete"),handler:m,isVisible:({resources:v})=>!!f(v).length,class:"oc-files-actions-delete-trigger"}]),deleteSpaces:d}},Rv=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=vt(),{$gettext:r,$ngettext:o}=Ne.useGettext(),i=hn(),s=Ye(),a=en(),c=ze(),{dispatchModal:u}=bt(),l=lt(),f=v=>v.filter(T=>ee.isProjectSpaceResource(T)&&T.canDisable({user:n.user,ability:i})),d=async v=>{const T=p(a),b=s.graphAuthenticated,g=v.map(E=>b.drives.disableDrive(E.id).then(()=>(T.name==="files-spaces-generic"&&c.push({name:"files-spaces-projects"}),T.name==="admin-settings-spaces"&&(E.disabled=!0,E.spaceQuota={total:E.spaceQuota.total}),l.updateSpaceField({id:E.id,field:"disabled",value:!0}),!0))),h=await Promise.allSettled(g),y=h.filter(E=>E.status==="fulfilled");if(y.length){const E=y.length===1&&v.length===1?r('Space "%{space}" was disabled successfully',{space:v[0].name}):o("%{spaceCount} space was disabled successfully","%{spaceCount} spaces were disabled successfully",y.length,{spaceCount:y.length.toString()},!0);e({title:E})}const S=h.filter(E=>E.status==="rejected");if(S.length){S.forEach(console.error);const E=S.length===1&&v.length===1?r('Failed to disable space "%{space}"',{space:v[0].name}):o("Failed to disable %{spaceCount} space","Failed to disable %{spaceCount} spaces",S.length,{spaceCount:S.length.toString()},!0);t({title:E,errors:S.map(R=>R.reason)})}},m=({resources:v})=>{const T=f(v);if(!T.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.",T.length,{count:T.length.toString()}),g=r("Disable");u({title:o('Disable Space "%{space}"?',"Disable %{spaceCount} Spaces?",T.length,{space:T[0].name,spaceCount:T.length.toString()}),confirmText:g,message:b,hasInput:!1,onConfirm:()=>d(T)})};return{actions:U(()=>[{name:"disable",icon:"stop-circle",label:()=>r("Disable"),handler:m,isVisible:({resources:v})=>!!f(v).length,class:"oc-files-actions-disable-trigger"}]),disableSpaces:d}},_v=()=>{const e=st(),t=lt(),n=jt(),{showMessage:r,showErrorMessage:o}=rt(),i=ze(),{$gettext:s}=Ne.useGettext(),a=hn(),c=Ye(),u=cn(),{upsertResource:l}=Ke(),f=at(i,"files-spaces-projects"),d=async v=>{const T=t.spaces.filter(ee.isProjectSpaceResource),b=Un(v.name,"",T);try{let g=await c.graphAuthenticated.drives.createDrive({name:b,description:v.description,quota:{total:v.spaceQuota.total}},n.graphRoles);const h=await c.webdav.listFiles(v);if(h.children.length){const y=new Lr({concurrency:e.options.concurrentRequests.resourceBatchActions}),S=[];for(const E of h.children)S.push(y.add(()=>c.webdav.copyFiles(v,E,g,{path:E.name})));await Promise.all(S)}if(v.spaceReadmeData||v.spaceImageData){const y={special:[]};if(v.spaceReadmeData){const S=await c.webdav.getFileInfo(g,{path:`.space/${v.spaceReadmeData.name}`});y.special.push({specialFolder:{name:"readme"},id:S.id})}if(v.spaceImageData){const S=await c.webdav.getFileInfo(g,{path:`.space/${v.spaceImageData.name}`});y.special.push({specialFolder:{name:"image"},id:S.id})}g=await c.graphAuthenticated.drives.updateDrive(g.id,y,n.graphRoles)}t.upsertSpace(g),f&&l(g),r({title:s('Space "%{space}" was duplicated successfully',{space:v.name})})}catch(g){console.error(g),o({title:s('Failed to duplicate space "%{space}"',{space:v.name}),errors:[g]})}},m=async({resources:v})=>{for(const T of v)T.disabled||!ee.isProjectSpaceResource(T)||await d(T)};return{actions:U(()=>[{name:"duplicate",icon:"folders",label:()=>s("Duplicate"),handler:v=>u.addTask(()=>m(v)),isVisible:({resources:v})=>!(v!=null&&v.length)||v.every(T=>T.disabled)||v.every(T=>!ee.isProjectSpaceResource(T))?!1:a.can("create-all","Drive"),class:"oc-files-actions-duplicate-trigger"}]),duplicateSpace:d}},dx=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=vt(),{$gettext:r}=Ne.useGettext(),o=hn(),i=Ye(),s=en(),{dispatchModal:a}=bt(),c=lt(),u=jt(),l=(m,w)=>i.graphAuthenticated.drives.updateDrive(m.id,{name:m.name,description:w},u.graphRoles).then(()=>{c.updateSpaceField({id:m.id,field:"description",value:w}),p(s).name==="admin-settings-spaces"&&(m.description=w),e({title:r("Space subtitle was changed successfully")})}).catch(T=>{console.error(T),t({title:r("Failed to change space subtitle"),errors:[T]})}),f=({resources:m})=>{m.length===1&&a({title:r("Change subtitle for space")+" "+m[0].name,confirmText:r("Confirm"),hasInput:!0,inputLabel:r("Space subtitle"),inputValue:m[0].description,onConfirm:w=>l(m[0],w)})};return{actions:U(()=>[{name:"editDescription",icon:"h-2",iconFillType:"none",label:()=>r("Edit subtitle"),handler:f,isVisible:({resources:m})=>m.length!==1?!1:m[0].canEditDescription({user:n.user,ability:o}),class:"oc-files-actions-edit-description-trigger"}]),editDescriptionSpace:l}},px={name:"QuotaSelect",props:{totalQuota:{type:Number,default:0},maxQuota:{type:Number,default:0}},emits:["selectedOptionChange"],setup(){const e=oe(void 0),t=oe([]);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 Et.isNumber(e)?e>0:/^[0-9]\d*(([.,])\d+)?$/g.test(e)},createOption(e){if(e=e.replace(",","."),!this.isValueValidNumber(e))return{displayValue:e,value:e,error:this.$gettext("Please enter only numbers"),selectable:!1};const t=parseFloat(e)*Math.pow(10,9);return t>this.quotaLimit?{value:t,displayValue:this.getFormattedFileSize(t),error:this.$gettext("Please enter a value equal to or less than %{ quotaLimit }",{quotaLimit:this.getFormattedFileSize(this.quotaLimit).toString()}),selectable:!1}:{value:t,displayValue:this.getFormattedFileSize(t)}},setOptions(){let e=[...this.DEFAULT_OPTIONS];this.maxQuota&&(e=e.filter(n=>this.totalQuota===0&&n.value===0?(n.selectable=!1,!0):n.value!==0&&n.value<=this.maxQuota)),e.find(n=>n.value===this.totalQuota)||e.push({displayValue:this.getFormattedFileSize(this.totalQuota),value:this.totalQuota,selectable:this.totalQuota<=this.quotaLimit}),e=[...e.filter(n=>n.value).sort((n,r)=>n.value-r.value),...e.filter(n=>!n.value)],this.options=e},getFormattedFileSize(e){const t=En(e,this.$language.current);return this.isValueValidNumber(e)?t:e.toString()}}},hx={class:"quota-select-batch-action-form"},gx=["textContent"],mx={class:"oc-flex oc-flex-between"},yx=["textContent"],bx={key:0,class:"oc-text-input-danger"};function vx(e,t,n,r,o,i){const s=pe("oc-icon"),a=pe("oc-select");return J(),ve("div",hx,[be(a,Zt({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":Te(({displayValue:c})=>[e.$attrs["read-only"]?(J(),Ce(s,{key:0,name:"lock",class:"oc-mr-xs",size:"small"})):Oe("",!0),fe("span",{textContent:H.toDisplayString(c)},null,8,gx)]),search:Te(({attributes:c,events:u})=>[fe("input",Zt({class:"vs__search"},c,qa(u,!0)),null,16)]),option:Te(({displayValue:c,error:u})=>[fe("div",mx,[fe("span",{textContent:H.toDisplayString(c)},null,8,yx)]),u?(J(),ve("div",bx,H.toDisplayString(u),1)):Oe("",!0)]),_:1},16,["model-value","selectable","options","create-option","label","onUpdate:modelValue"])])}const Iv=Ve(px,[["render",vx]]),wx=Me({name:"SpaceQuotaModal",components:{QuotaSelect:Iv},props:{modal:{type:Object,required:!0},spaces:{type:Array,required:!0},warningMessage:{type:String,default:""},warningMessageContextualHelperData:{type:Object,default:()=>{}},resourceType:{type:String,required:!1,default:"space",validator:e=>["space","user"].includes(e)}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:n}){const{showMessage:r,showErrorMessage:o}=rt(),i=rn(),s=He.storeToRefs(i),{$gettext:a,$ngettext:c}=Ne.useGettext(),u=Ye(),l=ze(),f=lt(),d=jt(),{updateResourceField:m}=Ke(),w=oe(0),v=y=>e.resourceType==="space"?c("Space quota was changed successfully","Quota of %{count} spaces was changed successfully",y,{count:y.toString()}):e.resourceType==="user"?c("User quota was changed successfully","Quota of %{count} users was changed successfully",y,{count:y.toString()}):a("Quota was changed successfully"),T=y=>e.resourceType==="space"?c("Failed to change space quota","Failed to change quota for %{count} spaces",y,{count:y.toString()}):e.resourceType==="user"?c("Failed to change user quota","Failed to change quota for %{count} users",y,{count:y.toString()}):a("Failed to change quota"),b=U(()=>!e.spaces.some(y=>y.spaceQuota.total!==p(w)));Tt(b,()=>{t("update:confirmDisabled",p(b))},{immediate:!0});const g=y=>{w.value=y.value},h=async()=>{const y=u.graphAuthenticated,S=e.spaces.map(async A=>{const $=await y.drives.updateDrive(A.id,{name:A.name,quota:{total:p(w)}},d.graphRoles);p(l.currentRoute).name==="admin-settings-spaces"&&Xe.publish("app.admin-settings.spaces.space.quota.updated",{spaceId:A.id,quota:$.spaceQuota}),p(l.currentRoute).name==="admin-settings-users"&&Xe.publish("app.admin-settings.users.user.quota.updated",{spaceId:A.id,quota:$.spaceQuota}),f.updateSpaceField({id:A.id,field:"spaceQuota",value:$.spaceQuota}),m({id:A.id,field:"spaceQuota",value:$.spaceQuota})}),E=await Promise.allSettled(S),R=E.filter(A=>A.status==="fulfilled");R.length&&r({title:v(R.length)});const I=E.filter(A=>A.status==="rejected");I.length&&(console.error(I),I.forEach(console.error),o({title:T(I.length),errors:I.map(A=>A.reason)}))};return n({onConfirm:h}),Mt(()=>{var y,S;w.value=((S=(y=e.spaces[0])==null?void 0:y.spaceQuota)==null?void 0:S.total)||0}),{selectedOption:w,confirmButtonDisabled:b,changeSelectedQuotaOption:g,maxQuota:s.spacesMaxQuota,onConfirm:h}}}),Sx={key:0,class:"oc-mt-s"},Ex=["textContent"];function Tx(e,t,n,r,o,i){const s=pe("quota-select"),a=pe("oc-contextual-helper");return J(),ve(Qe,null,[be(s,{"total-quota":e.selectedOption,"max-quota":e.maxQuota,"position-fixed":!0,onSelectedOptionChange:e.changeSelectedQuotaOption},null,8,["total-quota","max-quota","onSelectedOptionChange"]),e.warningMessage?(J(),ve("div",Sx,[fe("span",{class:"oc-text-input-warning",textContent:H.toDisplayString(e.warningMessage)},null,8,Ex),e.warningMessageContextualHelperData?(J(),Ce(a,Zt({key:0,class:"oc-pl-xs"},e.warningMessageContextualHelperData),null,16)):Oe("",!0)])):Oe("",!0)],64)}const Cv=Ve(wx,[["render",Tx]]),Pv=()=>{const{dispatchModal:e}=bt(),{$gettext:t}=Ne.useGettext(),n=hn(),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:Cv,customComponentAttrs:()=>({spaces:s,resourceType:"space"})})};return{actions:U(()=>[{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 Fv(){const{getDefaultAction:e}=Vn();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 Ax=()=>{const e=Ye(),{openWithDefaultApp:t}=Fv(),{createDefaultMetaFolder:n}=Di(),r=vt(),o=lt(),i=jt(),{$gettext:s}=Ne.useGettext(),{getDefaultMetaFolder:a}=oi(),c=async(f,d)=>{const m=await e.webdav.putFileContents(f,{path:".space/readme.md",parentFolderId:d.id,fileName:"readme.md"}),w=await e.graphAuthenticated.drives.updateDrive(f.id,{name:f.name,special:[{specialFolder:{name:"readme"},id:m.id}]},i.graphRoles);return o.updateSpaceField({id:f.id,field:"spaceReadmeData",value:w.spaceReadmeData}),m},u=async({resources:f})=>{let d=null,m=await a(f[0]);if(m||(m=await n(f[0]),d=await c(f[0],m)),!d){const w=ee.getRelativeSpecialFolderSpacePath(f[0],"readme");w?d=await e.webdav.getFileInfo(f[0],{path:w}):d=await c(f[0],m)}t({space:f[0],resource:d})};return{actions:U(()=>[{name:"editReadmeContent",icon:"article",label:()=>s("Edit description"),handler:u,isVisible:({resources:f})=>f.length!==1?!1:f[0].canEditReadme({user:r.user}),class:"oc-files-actions-edit-readme-content-trigger"}])}},Ov=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=vt(),{$gettext:r}=Ne.useGettext(),o=hn(),i=Ye(),s=en(),{checkSpaceNameModalInput:a}=oi(),{dispatchModal:c}=bt(),u=lt(),l=jt(),f=(w,v)=>i.graphAuthenticated.drives.updateDrive(w.id,{name:v},l.graphRoles).then(()=>{p(s).name==="admin-settings-spaces"&&(w.name=v),u.updateSpaceField({id:w.id,field:"name",value:v}),e({title:r("Space name was changed successfully")})}).catch(b=>{console.error(b),t({title:r("Failed to rename space"),errors:[b]})}),d=({resources:w})=>{w.length===1&&c({title:r("Rename space")+" "+w[0].name,confirmText:r("Rename"),hasInput:!0,inputLabel:r("Space name"),inputValue:w[0].name,onConfirm:v=>f(w[0],v),onInput:a})};return{actions:U(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:d,isVisible:({resources:w})=>w.length!==1?!1:w[0].canRename({user:n.user,ability:o}),class:"oc-files-actions-rename-trigger"}]),renameSpace:f}},xv=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=vt(),{$gettext:r,$ngettext:o}=Ne.useGettext(),i=hn(),s=Ye(),a=cn(),c=en(),{dispatchModal:u}=bt(),l=lt(),f=jt(),d=T=>T.filter(b=>ee.isProjectSpaceResource(b)&&b.canRestore({user:n.user,ability:i})),m=async T=>{const b=s.graphAuthenticated,g=T.map(E=>b.drives.updateDrive(E.id,{name:E.name},f.graphRoles,{headers:{Restore:"true"}}).then(R=>(p(c).name==="admin-settings-spaces"&&(E.disabled=!1,E.spaceQuota=R.spaceQuota),l.updateSpaceField({id:E.id,field:"disabled",value:!1}),!0))),h=await a.addTask(()=>Promise.allSettled(g)),y=h.filter(E=>E.status==="fulfilled");if(y.length){const E=y.length===1&&T.length===1?r('Space "%{space}" was enabled successfully',{space:T[0].name}):o("%{spaceCount} space was enabled successfully","%{spaceCount} spaces were enabled successfully",y.length,{spaceCount:y.length.toString()},!0);e({title:E})}const S=h.filter(E=>E.status==="rejected");if(S.length){S.forEach(console.error);const E=S.length===1&&T.length===1?r('Failed to enabled space "%{space}"',{space:T[0].name}):o("Failed to enable %{spaceCount} space","Failed to enable %{spaceCount} spaces",S.length,{spaceCount:S.length.toString()},!0);t({title:E,errors:S.map(R=>R.reason)})}},w=({resources:T})=>{const b=d(T);if(!b.length)return;const g=o("If you enable the selected space, it can be accessed again.","If you enable the %{count} selected spaces, they can be accessed again.",b.length,{count:b.length.toString()}),h=r("Enable");u({title:o('Enable Space "%{space}"?',"Enable %{spaceCount} Spaces?",b.length,{space:b[0].name,spaceCount:b.length.toString()}),confirmText:h,message:g,hasInput:!1,onConfirm:()=>m(b)})};return{actions:U(()=>[{name:"restore",icon:"play-circle",label:()=>r("Enable"),handler:w,isVisible:({resources:T})=>!!d(T).length,class:"oc-files-actions-restore-trigger"}]),restoreSpaces:m}},Rx=()=>{const{$gettext:e}=Ne.useGettext(),t=Ke(),n=({resources:o})=>{t.setSelection(o.map(({id:i})=>i)),Xe.publish(yt.openWithPanel,"space-share")};return{actions:U(()=>[{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"}])}},_x=()=>{const e=ze(),{$gettext:t}=Ne.useGettext(),n=o=>Ri("files-trash-generic",{...Jn(o,{fileId:o.fileId})});return{actions:U(()=>[{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"}])}},Ix=Me({name:"EmojiPickerModal",components:{},props:{modal:{type:Object,required:!0}},emits:["confirm"],setup(e,{emit:t}){const n=ii(),{currentTheme:r}=He.storeToRefs(n),o=U(()=>p(r).isDark?"dark":"light");return{onEmojiSelect:s=>{t("confirm",s)},theme:o}}});function Cx(e,t,n,r,o,i){const s=pe("oc-emoji-picker");return J(),Ce(s,{theme:e.theme,onEmojiSelect:e.onEmojiSelect},null,8,["theme","onEmojiSelect"])}const kv=Ve(Ix,[["render",Cx]]),Px=()=>{const e=vt(),{showMessage:t,showErrorMessage:n}=rt(),{$gettext:r}=Ne.useGettext(),o=Ye(),i=cn(),s=lt(),{createDefaultMetaFolder:a}=Di(),{dispatchModal:c}=bt(),{getDefaultMetaFolder:u}=oi(),l=jt(),f=({resources:v})=>{v.length===1&&c({elementClass:"oc-width-auto",title:r("Set icon for %{space}",{space:v[0].name}),hideConfirmButton:!0,customComponent:kv,focusTrapInitial:!1,onConfirm:T=>m(v[0],T)})},d=async v=>{const T=document.createElement("canvas"),b=T.getContext("2d"),g=16/9,h=720,y=h/g;T.width=h,T.height=y;const S=.4*h;b.font=`${S}px sans-serif`,b.textBaseline="middle",b.textAlign="center",b.fillText(v,T.width/2,T.height/2+15);const R=await Sb(T);return wb(R)},m=async(v,T)=>{const b=o.graphAuthenticated,g=await d(T);let h=await u(v);return h||(h=await a(v)),i.addTask(async()=>{const y={"Content-Type":"application/offset+octet-stream"};try{const{fileId:S}=await o.webdav.putFileContents(v,{parentFolderId:h.id,fileName:"emoji.png",content:g,headers:y,overwrite:!0}),E=await b.drives.updateDrive(v.id,{name:v.name,special:[{specialFolder:{name:"image"},id:S}]},l.graphRoles);s.updateSpaceField({id:v.id,field:"spaceImageData",value:E.spaceImageData}),t({title:r("Space icon was set successfully")}),Xe.publish("app.files.spaces.uploaded-image",E)}catch(S){console.error(S),n({title:r("Failed to set space icon"),errors:[S]})}})};return{actions:U(()=>[{name:"set-space-icon",icon:"emoji-sticker",handler:f,label:()=>r("Set icon"),isVisible:({resources:v})=>v.length!==1?!1:v[0].canEditImage({user:e.user}),class:"oc-files-actions-set-space-icon-trigger"}]),setIconSpace:m}},Fx=()=>{const{$gettext:e}=Ne.useGettext();return{actions:U(()=>[{name:"show-details",icon:"information",label:()=>e("Details"),handler:()=>Xe.publish(yt.open),isVisible:({resources:n})=>n.length>0,class:"oc-admin-settings-show-details-trigger"}])}},Ox=()=>{const{getMatchingSpace:e}=ln(),t=lt(),n=Zn(),r=Ke(),o=Ye(),{$gettext:i}=Ne.useGettext(),{openEditor:s}=Vn(),{resources:a,currentFolder:c}=He.storeToRefs(r);return{openEmptyEditor:async(l,f)=>{var h;let d=p(c)?e(p(c)):null,m=p(a),w=(h=p(c))==null?void 0:h.path;(!d||!p(c).canCreate())&&(d=t.personalSpace,m=(await o.webdav.listFiles(d)).children,w="");let v=i("New file")+`.${f}`;m.some(y=>y.name===v)&&(v=Un(v,f,m));const T=await o.webdav.putFileContents(d,{path:ee.urlJoin(w,v)}),b=e(T),g=n.fileExtensions.find(({app:y,extension:S})=>y===l&&S===f);s(g,b,T)}}},Nv=()=>{const{$gettext:e}=Ne.useGettext(),{showMessage:t}=rt();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.")})}}},xx=()=>mr("$appProviderService"),kx=()=>{const{isResourceAccessible:e}=ln();return{breadcrumbsFromPath:({route:r,space:o,resourcePath:i,ancestorMetaData:s=oe({})})=>{const a=(l="")=>l.split("/").filter(Boolean),c=a(r.path),u=a(i);return u.map((l,f)=>{const d=ee.urlJoin(...u.slice(0,f+1),{leadingSlash:!0}),m=e({space:p(o),path:d});let w;return m&&(w=p(s)[d]),{id:Yt.v4(),allowContextActions:!0,text:l,...m&&{to:{path:"/"+[...c].splice(0,c.length-u.length+f+1).join("/"),query:{...ki(r.query,"page","fileId"),...w&&{fileId:w.id}}}},isStaticNav:!1}})},concatBreadcrumbs:(...r)=>{const o=r.pop();return[...r,{id:Yt.v4(),allowContextActions:o.allowContextActions,text:o.text,onClick:()=>Xe.publish("app.files.list.load"),isTruncationPlaceholder:o.isTruncationPlaceholder,isStaticNav:o.isStaticNav}]}}},Nx=(e="")=>{const t=oe(0),n=async()=>{await Gn();const r=document.querySelector(e||"#files-app-bar"),o=r?r.getBoundingClientRect().height:0;t.value!==o&&(t.value=o)};return window.onresize=n,Mt(n),{y:t,refresh:n}},kf=()=>{const e=oe(!0),t=()=>{e.value=window.innerHeight>500};return Mt(()=>{t(),window.addEventListener("resize",t)}),jn(()=>{window.removeEventListener("resize",t)}),{isSticky:e}};var Nf=(e=>(e.C="c",e.V="v",e.X="x",e.A="a",e.S="s",e.Space=" ",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.Esc="Escape",e))(Nf||{}),$f=(e=>(e.Ctrl="Control",e.Shift="Shift",e))($f||{});const $x=()=>{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"},$v=e=>{const t=oe([]),n=oe(0),r=a=>{if(!(e!=null&&e.skipDisabledKeyBindingsCheck)&&$x())return;const{key:c,ctrlKey:u,metaKey:l,shiftKey:f}=a;let d=null;const m=[];l||u?(d="Control",m.push("altKey","shiftKey")):f&&(d="Shift",m.push("altKey","ctrlKey","metaKey")),!((v,T)=>T.some(b=>v[b]))(a,m)&&p(t).filter(v=>v.primary===c&&v.modifier===d).forEach(v=>{a.preventDefault(),v.callback(a)})},o=(a,c)=>{const u=Yt.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 Mr.useEventListener(document,"keydown",r),{actions:t,bindKeyAction:o,removeKeyAction:i,selectionCursor:n,resetSelectionCursor:s}};class Tr{}Ee(Tr,"perPageDefault","100"),Ee(Tr,"perPageQueryName","items-per-page"),Ee(Tr,"options",["20","50","100","250","500"]);function Dx(e){const t=No.useRouter(),n=No.useRoute(),r=Lx(e),o=Mx(e),i=U(()=>Math.ceil(p(e.items).length/p(o))||1),s=U(()=>{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 Xe.subscribe("app.files.navigate.page",({resourceId:a,forceScroll:c,topbarElement:u})=>{const l=Et.findIndex(p(e.items),f=>f.id===a);if(l>=0){const f=Math.ceil((l+1)/Number(p(o)));t.push({...p(n),query:{...p(n).query,page:f}}).then(()=>{Xe.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 U(()=>p(e.page));const t=on("page","1");return U(()=>parseInt(St(p(t))))}function Mx(e){if(e.perPage)return U(()=>p(e.perPage));const t=wr({name:e.perPageQueryName||Tr.perPageQueryName,defaultValue:e.perPageDefault||Tr.perPageDefault,storagePrefix:e.perPageStoragePrefix});return U(()=>parseInt(St(p(t))))}const Dv=()=>mr("$passwordPolicyService");var la=(e=>(e.mounted="portal-target.mounted",e))(la||{});const Bx=()=>{const e=_o(),t=ga.useWormhole();return{registerPortal:r=>{e.subscribe(la.mounted,()=>{t.open(r)})}}},Df=()=>{const e=Zn();return{canBeOpenedWithSecureView:n=>e.fileExtensions.filter(({secureView:o})=>o).some(({mimeType:o})=>o===n.mimeType)}},Lv=()=>{const e=vt();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})}},Mv=()=>{const e=Ye(),t=lt(),n=jt(),r=U(()=>t.spaces),o=c=>p(r).find(u=>c.toString().startsWith(u.id.toString())),i=c=>p(r).find(u=>{var l,f;return ee.isMountPointSpaceResource(u)&&((f=(l=u.root)==null?void 0:l.remoteItem)==null?void 0:f.id)===c}),s=c=>{const u=[qe.FileId,qe.FileParent,qe.Name,qe.ResourceType],l=ee.buildSpace({id:c,name:""},n.graphRoles);return e.webdav.getFileInfo(l,{fileId:c},{davProperties:u})};return{getResourceContext:async c=>{var v,T,b,g,h;let u,l,f=o(c);if(f)return u=await e.webdav.getPathForFileId(c),l=await e.webdav.getFileInfo(f,{path:u}),{space:f,resource:l,path:u};await t.loadMountPoints({graphClient:e.graphAuthenticated});let d=i(c);l=await s(c);const m=d?[]:[p(l).name];let w=p(l);for(;!d;)w=await s(w.parentFolderId),d=i(w.id),d||m.unshift(w.name);return f=t.getSpace((T=(v=d.root)==null?void 0:v.remoteItem)==null?void 0:T.id)||t.createShareSpace({driveAliasPrefix:(b=l.storageId)!=null&&b.startsWith(ee.OCM_PROVIDER_ID)?"ocm-share":"share",id:(h=(g=d.root)==null?void 0:g.remoteItem)==null?void 0:h.id,shareName:d.name}),u=ee.urlJoin(...m),{space:f,resource:l,path:u}}}},Gt={name:{table:"resource-table",condensedTable:"resource-table-condensed",tiles:"resource-tiles"},defaultModeName:"resource-table",queryName:"view-mode",tilesSizeDefault:2,tilesSizeMax:6,tilesSizeQueryName:"tiles-size"},Bv=()=>{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=oe(0),n=oe(0);Mt(()=>{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 jx(e){if(e)return U(()=>p(e));const t=wr({name:Gt.queryName,defaultValue:Gt.defaultModeName});return U(()=>St(p(t)))}function Ux(e){if(e)return U(()=>parseInt(p(e)));const t=wr({name:Gt.tilesSizeQueryName,defaultValue:Gt.tilesSizeDefault.toString()});return U(()=>parseInt(St(p(t))))}const qx=oe(Gt.tilesSizeMax);function Lf(){return qx}const Mf=e=>{const t=Rf(),{updateResourceField:n}=Ke(),{httpAuthenticated:r}=Ye(),o=lt(),{defaultSpaceImageBlobURL:i}=He.storeToRefs(o),s=st(),{serverUrl:a}=He.storeToRefs(s),c=new Lr({concurrency:4}),u=U(()=>p(e)===Gt.name.tiles),l=U(()=>p(u)?Bs.enum.fit:Bs.enum.thumbnail),f=U(()=>p(u)?zn.Tile:zn.Thumbnail),d=un.useTask(function*(T,{space:b,resource:g,dimensions:h,processor:y,updateStore:S=!0}){var A;const E=ee.isProjectSpaceResource(g)?ee.buildSpaceImageResource(g):g,R=E.id===((A=b.spaceImageData)==null?void 0:A.id);R&&o.addToImagesLoading(b.id);const I=yield c.add(()=>t.loadPreview({space:b,resource:E,processor:y||p(l),dimensions:h||p(f)},!0,!0,T));return I&&S&&n({id:g.id,field:"thumbnail",value:I}),R&&o.removeFromImagesLoading(b.id),I}),m=async T=>{const{resource:b,cancelRunning:g}=T;if(g&&v(),ee.isProjectSpaceResource(b)&&(!b.spaceImageData||b.disabled)){if(p(i))return b.thumbnail=p(i),p(i);try{const h=await r.get(`${p(a)}images/default-space-icon.png`,{responseType:"blob"});return o.setDefaultSpaceImageBlobURL(URL.createObjectURL(h.data)),b.thumbnail=p(i),p(i)}catch{return null}}try{return await d.perform(T)}catch(h){h!=="cancel"&&console.error(h)}},w=U(()=>d.isRunning),v=()=>{d.cancelAll(),c.clear(),o.purgeImagesLoading()};return ja(v),{loadPreview:m,previewsLoading:w}},jv=({showSizeInformation:e=!0}={})=>{const t=Ke(),{current:n,$gettext:r,$ngettext:o}=Ne.useGettext(),i=ze(),{resources:s,totalResourcesCount:a,areHiddenFilesShown:c,currentFolder:u}=He.storeToRefs(t),l=U(()=>{var d,m;if(!((d=p(u))!=null&&d.size)||((m=p(u))==null?void 0:m.size)==="0"){const w=p(s).map(v=>v.size?parseInt(v.size.toString()):0).reduce((v,T)=>v+T,0);return En(w,n)}return En(p(u).size,n)});return{resourceContentsText:U(()=>{let d=o("%{ filesCount } file","%{ filesCount } files",p(a).files,{filesCount:p(a).files.toString()});!p(c)&&p(a).hiddenFiles&&(d=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()}),v=p(a).files+p(a).folders+p(a).spaces,T=e&&parseFloat(p(l))>0,b=Nt(i,"files-shares-via-link"),g=r(T?"%{ itemsCount } item with %{ itemSize } in total":"%{ itemsCount } item in total"),h=r(T?"%{ itemsCount } items with %{ itemSize } in total":"%{ itemsCount } items in total"),y=b?"(%{ filesStr}, %{ foldersStr}, %{ spacesStr})":"(%{ filesStr}, %{ foldersStr})",S=`${g} ${y}`,E=`${h} ${y}`;return o(S,E,v,{itemsCount:v.toString(),itemSize:p(l),filesStr:d,foldersStr:m,spacesStr:w})})}},Bf=()=>{const{getMatchingSpace:e}=ln(),t=Ke(),n=U({get(){return t.selectedResources},set(s){t.setSelection(s.map(({id:a})=>a))}}),r=U({get(){return t.selectedIds},set(s){t.setSelection(s)}}),o=s=>p(r).includes(s.id),i=U(()=>{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 Vx(e){const t=rn(),n=Xr(),r=Ye(),o=Ne.useGettext(),i=U(()=>t.tusMaxChunkSize>0),s=()=>{const u={};return n.publicLinkPassword?u.Authorization="Basic "+yr.from(["public",n.publicLinkPassword].join(":")).toString("base64"):n.accessToken&&!n.publicLinkPassword&&(u.Authorization="Bearer "+n.accessToken),u["X-Request-ID"]=Yt.v4(),u["Accept-Language"]=o.current,u["Initiator-ID"]=r.initiatorId,u},a=U(()=>{const u={onBeforeRequest:(l,f)=>new Promise(d=>{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"]),f!=null&&f.isRemote&&l.setHeader("x-oc-mtime",(((w=f==null?void 0:f.data)==null?void 0:w.lastModified)/1e3).toFixed(0)),d()}),chunkSize:t.tusMaxChunkSize||1/0,overridePatchMethod:t.tusHttpMethodOverride,uploadDataDuringCreation:t.tusExtension.includes("creation-with-upload")};return u.headers=l=>{var f;if(l.xhrUpload||l!=null&&l.isRemote)return{"x-oc-mtime":(((f=l==null?void 0:l.data)==null?void 0:f.lastModified)/1e3).toFixed(0),...s()}},u}),c=U(()=>({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()}}}));Tt([a,c],()=>{if(p(i)){e.uppyService.useTus(p(a));return}e.uppyService.useXhr(p(c))},{immediate:!0})}const zx=Me({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{$gettext:t}=Ne.useGettext(),n=st(),{options:r}=He.storeToRefs(n),o=U(()=>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=U(()=>({...{appearance:e.action.appearance||e.appearance,...e.action.isDisabled&&{disabled:e.action.isDisabled(e.actionOptions)},...e.action.id&&{id:e.action.id}},...p(o)==="router-link"&&{to:e.action.route(e.actionOptions)},...p(o)==="a"&&{href:e.action.href(e.actionOptions)},...["router-link","a"].includes(p(o))&&{target:r.value.cernFeatures?"_blank":"_self"}})),s=U(()=>window.navigator.platform.match("Mac")),a=U(()=>t("Hold %{key} and click to open in new tab",{key:p(s)?"⌘":t("ctrl")},!0));return{componentType:o,componentProps:i,openInNewTabHint:a}},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}}}}),Wx={key:3,class:"oc-files-context-action-label oc-flex","data-testid":"action-label"},Hx=["textContent"],Gx=["textContent"],Kx=["textContent"];function Qx(e,t,n,r,o,i){var l,f,d,m;const s=pe("oc-image"),a=pe("oc-icon"),c=pe("oc-button"),u=dn("oc-tooltip");return ot((J(),ve("li",null,[ot((J(),Ce(c,Zt({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?(f=(l=e.action).disabledTooltip)==null?void 0:f.call(l,e.actionOptions):"","data-testid":"action-handler",size:e.size,"justify-content":"left"},qa(e.componentListeners)),{default:Te(()=>[e.action.img?(J(),Ce(s,{key:0,"data-testid":"action-img",src:e.action.img,alt:"",class:"oc-icon oc-icon-m"},null,8,["src"])):e.hasExternalImageIcon?(J(),Ce(s,{key:1,"data-testid":"action-img",src:e.action.icon,alt:"",class:"oc-icon oc-icon-m"},null,8,["src"])):e.action.icon?(J(),Ce(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"])):Oe("",!0),e.action.hideLabel?Oe("",!0):(J(),ve("span",Wx,[fe("span",{textContent:H.toDisplayString(e.action.label(e.actionOptions))},null,8,Hx),e.action.showOpenInNewTabHint?(J(),ve("span",{key:0,class:"oc-text-muted oc-text-xsmall",textContent:H.toDisplayString(e.openInNewTabHint)},null,8,Gx)):Oe("",!0)])),e.action.shortcut&&e.shortcutHint?(J(),ve("span",{key:4,class:"oc-files-context-action-shortcut",textContent:H.toDisplayString(e.action.shortcut)},null,8,Kx)):Oe("",!0)]),_:1},16,["type","class","aria-label","size"])),[[u,e.showTooltip||e.action.hideLabel?e.action.label(e.actionOptions):""]])])),[[u,e.componentProps.disabled?(m=(d=e.action).disabledTooltip)==null?void 0:m.call(d,e.actionOptions):""]])}const jf=Ve(zx,[["render",Qx]]),Xx=Me({name:"BatchActions",components:{ActionMenuItem:jf},props:{actions:{type:Array,required:!0},actionOptions:{type:Object,required:!0},limitedScreenSpace:{type:Boolean,default:!1,required:!1}}});function Yx(e,t,n,r,o,i){const s=pe("action-menu-item"),a=pe("oc-list");return J(),ve("div",null,[be(a,{id:"oc-appbar-batch-actions",class:H.normalizeClass({"oc-appbar-batch-actions-squashed":e.limitedScreenSpace})},{default:Te(()=>[(J(!0),ve(Qe,null,kt(e.actions,(c,u)=>(J(),Ce(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 Uv=Ve(Xx,[["render",Yx]]),Jx=Me({name:"ContextActionMenu",components:{ActionMenuItem:jf},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}}}),Zx={id:"oc-files-context-menu"};function ek(e,t,n,r,o,i){const s=pe("action-menu-item"),a=pe("oc-list");return J(),ve("div",Zx,[(J(!0),ve(Qe,null,kt(e.menuSections,(c,u)=>(J(),Ce(a,{id:`oc-files-context-actions-${c.name}`,key:`section-${c.name}-list`,class:H.normalizeClass(["oc-files-context-actions",e.getSectionClasses(u)])},{default:Te(()=>[(J(!0),ve(Qe,null,kt(c.items,(l,f)=>(J(),Ce(s,{key:`section-${c.name}-action-${f}`,action:l,appearance:e.appearance,"action-options":e.actionOptions,class:"context-menu oc-files-context-action oc-px-s oc-rounded oc-menu-item-hover"},null,8,["action","appearance","action-options"]))),128))]),_:2},1032,["id","class"]))),128))])}const Uf=Ve(Jx,[["render",ek]]),tk=Me({name:"ContextActions",components:{ContextActionMenu:Uf},props:{actionOptions:{type:Object,required:!0}},setup(e){const{editorActions:t}=Vn(),{actions:n}=Xs(),{actions:r}=Ys(),{actions:o}=Js(),{actions:i}=Sf(),{actions:s}=Zs(),{actions:a}=ea(),{actions:c}=ta(),{actions:u}=Io(),{actions:l}=Tf(),{actions:f}=Ef(),{actions:d}=na(),{actions:m}=Af(),{actions:w}=cv(),{actions:v}=ra(),{actions:T}=ia(),{actions:b}=uv(),{actions:g}=_f(),{actions:h}=Cf(),{actions:y}=If(),S=Ni(),E=U(()=>S.requestExtensions({id:"global.files.context-actions",extensionType:"action"}).map(X=>X.action)),R=U(()=>S.requestExtensions({id:"global.files.batch-actions",extensionType:"action"}).map(X=>X.action)),I=gw(e,"actionOptions"),A=U(()=>[...p(n),...p(s),...p(c),...p(d),...p(o),...p(f),...p(a),...p(T),...p(h),...p(R).filter(X=>X.category==="actions"||Et.isNil(X.category))].filter(X=>X.isVisible(p(I)))),$=U(()=>[...p(g),...p(R).filter(X=>X.category==="sidebar")].filter(X=>X.isVisible(p(I)))),D=U(()=>[...p(t),...p(E).filter(X=>X.category==="context")].filter(X=>X.isVisible(p(I))).sort((X,ie)=>Number(ie.hasPriority)-Number(X.hasPriority))),k=U(()=>[...p(y),...p(i),...p(E).filter(X=>X.category==="share")].filter(X=>X.isVisible(p(I)))),N=U(()=>[...p(c),...p(u),...p(a),...p(d),...p(o),...p(w),...p(v),...p(h),...p(T),...p(n),...p(s),...p(r),...p(b),...p(E).filter(X=>X.category==="actions"||Et.isNil(X.category))].filter(X=>X.isVisible(p(I)))),j=U(()=>[...p(l).map(X=>(X.keepOpen=!0,X)),...p(m),...p(g),...p(E).filter(X=>X.category==="sidebar")].filter(X=>X.isVisible(p(I))));return{menuSections:U(()=>{const X=[];return p(I).resources.length>1?(p(A).length&&X.push({name:"batch-actions",items:[...p(A)]}),X.push({name:"batch-details",items:[...p($)]}),X):(p(D).length&&X.push({name:"context",items:p(D)}),p(k).length&&X.push({name:"share",items:p(k)}),p(N).length&&X.push({name:"actions",items:p(N)}),p(j).length&&X.push({name:"sidebar",items:p(j)}),X)})}}});function nk(e,t,n,r,o,i){const s=pe("context-action-menu");return J(),Ce(s,{"menu-sections":e.menuSections,"action-options":e.actionOptions},null,8,["menu-sections","action-options"])}const qv=Ve(tk,[["render",nk]]),rk=Me({props:{hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},paginationOptions:{type:Array,default:()=>Tr.options},perPageQueryName:{type:String,default:()=>Tr.perPageQueryName},perPageDefault:{type:String,default:()=>Tr.perPageDefault},perPageStoragePrefix:{type:String,required:!0},viewModeDefault:{type:String,required:!1,default:()=>Gt.defaultModeName},viewModes:{type:Array,default:()=>[]}},setup(e){const t=ze(),n=en(),{$gettext:r}=Ne.useGettext(),o=Ke(),{setAreHiddenFilesShown:i,setAreFileExtensionsShown:s,setAreDisabledSpacesShown:a}=o,{areHiddenFilesShown:c,areFileExtensionsShown:u,areDisabledSpacesShown:l}=He.storeToRefs(o),f=oe(!1),d=on("page"),m=U(()=>p(d)?parseInt(St(p(d))):1),w=wr({name:e.perPageQueryName,defaultValue:e.perPageDefault,storagePrefix:e.perPageStoragePrefix}),v=Ws(),T=wr({name:`${p(v)}-${Gt.queryName}`,defaultValue:e.viewModeDefault}),b=wr({name:Gt.tilesSizeQueryName,defaultValue:Gt.tilesSizeDefault.toString()}),g=S=>t.replace({query:{...p(n).query,[e.perPageQueryName]:S,...p(m)>1&&{page:"1"}}}),h=S=>{T.value=S.name};Tt([w,T,b],S=>{f.value=S.some(E=>!E)},{immediate:!0,deep:!0});const y=Lf();return{FolderViewModeConstants:Gt,viewModeCurrent:T,viewSizeCurrent:b,viewSizeMax:y,itemsPerPageCurrent:w,queryParamsLoading:f,queryItemAsString:St,setItemsPerPage:g,setViewMode:h,areHiddenFilesShown:c,areFileExtensionsShown:u,areDisabledSpacesShown:l,setAreHiddenFilesShown:i,setAreFileExtensionsShown:s,setAreDisabledSpacesShown:a,viewOptionsButtonLabel:r("Display customization options of the files list"),isProjectsLocation:Sr(at,"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}}}),ik={class:"oc-flex oc-flex-middle"},ok={key:0,class:"viewmode-switch-buttons oc-button-group oc-visible@s oc-mr-s"},sk={key:0,class:"files-view-options-list-item"},ak={key:1,class:"files-view-options-list-item"},lk={key:2,class:"files-view-options-list-item"},ck={key:3,class:"files-view-options-list-item"},uk={key:4,class:"files-view-options-list-item oc-flex oc-flex-between oc-flex-middle"},fk=["textContent"],dk=["max"];function pk(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"),f=pe("oc-drop"),d=dn("oc-tooltip");return J(),ve("div",ik,[e.viewModes.length>1?(J(),ve("div",ok,[(J(!0),ve(Qe,null,kt(e.viewModes,m=>ot((J(),Ce(a,{key:m.name,"no-hover":e.viewModeCurrent===m.name,class:H.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:Te(()=>[be(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"])),[[d,e.$gettext(m.label)]])),128))])):Oe("",!0),ot((J(),Ce(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:Te(()=>[be(s,{name:"settings-3","fill-type":"line"})]),_:1},8,["aria-label"])),[[d,e.viewOptionsButtonLabel]]),be(f,{"drop-id":"files-view-options-drop",toggle:"#files-view-options-btn",mode:"click",class:"oc-width-auto","padding-size":"medium"},{default:Te(()=>[be(l,null,{default:Te(()=>[e.hasHiddenFiles?(J(),ve("li",sk,[be(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"])])):Oe("",!0),e.hasFileExtensions?(J(),ve("li",ak,[be(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"])])):Oe("",!0),e.hasPagination?(J(),ve("li",lk,[e.queryParamsLoading?Oe("",!0):(J(),Ce(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"]))])):Oe("",!0),e.isProjectsLocation?(J(),ve("li",ck,[be(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"])])):Oe("",!0),e.viewModeCurrent===e.FolderViewModeConstants.name.tiles?(J(),ve("li",uk,[fe("label",{for:"tiles-size-slider",textContent:H.toDisplayString(e.$gettext("Tile size"))},null,8,fk),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,dk),[[TS,e.viewSizeCurrent]])])):Oe("",!0)]),_:1})]),_:1})])}const Vv=Ve(rk,[["render",pk],["__scopeId","data-v-cc70f12f"]]),hk=Me({name:"AppBar",components:{BatchActions:Uv,ContextActions:qv,ViewOptions:Vv},props:{viewModeDefault:{type:String,required:!1,default:()=>Gt.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},space:{type:Object,required:!1,default:null}},setup(e,{emit:t}){const n=lt(),{$gettext:r}=Ne.useGettext(),{can:o}=hn(),i=ze(),{requestExtensions:s}=Ni(),{isSticky:a}=kf(),c=Ke(),{selectedResources:u}=He.storeToRefs(c),l=U(()=>e.space),{actions:f}=Xs(),{actions:d}=Ys(),{actions:m}=Js(),{actions:w}=_v(),{actions:v}=Zs(),{actions:T}=ea(),{actions:b}=ta(),{actions:g}=Io(),{actions:h}=Ef(),{actions:y}=na(),{actions:S}=ia(),{actions:E}=Av(),{actions:R}=Rv(),{actions:I}=Pv(),{actions:A}=xv(),$=oe(0),D=Sr(At,"files-common-search"),k=U(()=>Object.hasOwn(Xw(),"navigation")&&o("create-all","Share")),N=U(()=>{let ne=[...p(d),...p(f),...p(v),...p(b),...p(g),...p(y),...p(m),...p(h),...p(T),...p(S)];D.value||(ne=[...ne,...p(w),...p(I),...p(A),...p(E),...p(R)]);const le=s({id:"global.files.batch-actions",extensionType:"action"});return le.length&&(ne=[...ne,...le.map(Ie=>Ie.action)]),ne.filter(Ie=>Ie.isVisible({space:p(l),resources:c.selectedResources}))}),j=U(()=>n.spaces.filter(ne=>ee.isPersonalSpaceResource(ne)||ee.isProjectSpaceResource(ne))),W=dr("isMobileWidth"),X=Sr(In,"files-trash-generic"),ie=U(()=>!p(W)&&e.breadcrumbs.length?!0:p(X)&&p(j).length===1?!1:e.breadcrumbs.length>1),de=U(()=>p(X)&&p(j).length===1?e.breadcrumbs.length<=2:e.breadcrumbs.length<=1),se=U(()=>p(l)&&(ee.isProjectSpaceResource(p(l))||ee.isShareSpaceResource(p(l)))?3:2),we=ne=>{t(Ab,ne)},Se=Gb("title"),Z=U(()=>{var ne;return p(Se)?r(p(Se)):((ne=p(l))==null?void 0:ne.name)||""});return{router:i,hasSharesNavigation:k,batchActions:N,showBreadcrumb:ie,showMobileNav:de,breadcrumbMaxWidth:$,breadcrumbTruncationOffset:se,fileDroppedBreadcrumb:we,pageTitle:Z,selectedResources:u,isSticky:a}},data:function(){return{resizeObserver:new ResizeObserver(this.onResize),limitedScreenSpace:!1}},computed:{showContextActions(){return td(this.breadcrumbs).allowContextActions},showBatchActions(){return this.hasBulkActions&&(this.selectedResources.length>=1||In(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}}}),gk={class:"files-topbar oc-py-s"},mk=["textContent"],yk={key:3,id:"files-app-bar-controls-right",class:"oc-flex"},bk={class:"files-app-bar-actions oc-mt-xs"},vk={class:"oc-flex-1 oc-flex oc-flex-start oc-flex-middle"};function wk(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"),f=pe("batch-actions");return J(),ve("div",{id:"files-app-bar",ref:"filesAppBar",class:H.normalizeClass({"files-app-bar-squashed":e.isSideBarOpen,"files-app-bar-sticky":e.isSticky})},[fe("div",gk,[fe("h1",{class:"oc-invisible-sr",textContent:H.toDisplayString(e.pageTitle)},null,8,mk),be(s,{announcement:e.selectedResourcesAnnouncement,level:"polite"},null,8,["announcement"]),fe("div",{class:H.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?(J(),Ce(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:Te(()=>[be(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"])):Oe("",!0),e.showMobileNav?(J(),Ce(u,{key:1,name:"app.runtime.mobile.nav"})):Oe("",!0),e.hasSharesNavigation?Ge(e.$slots,"navigation",{key:2},void 0,!0):Oe("",!0),e.hasViewOptions?(J(),ve("div",yk,[be(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"])])):Oe("",!0)],2),fe("div",bk,[fe("div",vk,[Ge(e.$slots,"actions",{limitedScreenSpace:e.limitedScreenSpace},void 0,!0),e.showBatchActions?(J(),Ce(f,{key:0,actions:e.batchActions,"action-options":{space:e.space,resources:e.selectedResources},"limited-screen-space":e.limitedScreenSpace},null,8,["actions","action-options","limited-screen-space"])):Oe("",!0)])]),Ge(e.$slots,"content",{},void 0,!0)])],2)}const Sk=Ve(hk,[["render",wk],["__scopeId","data-v-d27aef7c"]]),Ek=Me({name:"CreateSpace",props:{showLabel:{type:Boolean,default:!0}},emits:["spaceCreated"],setup(e,{emit:t}){const{showMessage:n,showErrorMessage:r}=rt(),{$gettext:o}=Ne.useGettext(),{createSpace:i}=Di(),{checkSpaceNameModalInput:s}=oi(),{dispatchModal:a}=bt(),c=lt(),{upsertResource:u}=Ke(),l=async d=>{try{const m=await i(d);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"),onConfirm:d=>l(d),onInput:s})}}}}),Tk=["textContent"];function Ak(e,t,n,r,o,i){const s=pe("oc-icon"),a=pe("oc-button"),c=dn("oc-tooltip");return ot((J(),Ce(a,{id:"new-space-menu-btn","aria-label":e.showLabel?void 0:e.$gettext("New space"),appearance:"filled",onClick:e.showCreateSpaceModal},{default:Te(()=>[be(s,{name:"add"}),e.showLabel?(J(),ve("span",{key:0,textContent:H.toDisplayString(e.$gettext("New Space"))},null,8,Tk)):Oe("",!0)]),_:1},8,["aria-label","onClick"])),[[c,e.showLabel?void 0:e.$gettext("New space")]])}const Rk=Ve(Ek,[["render",Ak]]),_k=Me({name:"AppTopBar",components:{ContextActionMenu:Uf,ResourceListItem:Po},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}=Ne.useGettext(),r=Ke(),o=st(),{getMatchingSpace:i}=ln(),s=U(()=>r.areFileExtensionsShown),a=U(()=>t("Show context menu")),c=U(()=>e.isEditor&&e.hasAutoSave&&o.options.editor.autosaveEnabled),u=U(()=>{const d=Dt.Duration.fromObject({seconds:o.options.editor.autosaveInterval},{locale:n});return t("Autosave (every %{ duration })",{duration:d.toHuman()})}),l=U(()=>i(e.resource)),f=U(()=>!ee.isPublicSpaceResource(p(l)));return{contextMenuLabel:a,areFileExtensionsShown:s,hasAutosave:c,autoSaveTooltipText:u,isPathDisplayed:f,...si()}}}),Ik={class:"oc-app-top-bar oc-flex"},Ck={class:"oc-app-top-bar-inner oc-pl-m oc-pr-xs oc-flex oc-flex-middle oc-flex-between"},Pk={class:"open-file-bar oc-flex"},Fk={class:"oc-flex main-actions"},Ok={key:1,class:"oc-flex oc-flex-middle"};function xk(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"),f=pe("portal"),d=dn("oc-tooltip");return J(),Ce(f,{to:"app.runtime.header.left"},{default:Te(()=>[fe("div",Ik,[fe("span",Ck,[fe("div",Pk,[e.resource?(J(),Ce(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"])):Oe("",!0)]),fe("div",Fk,[e.dropDownMenuSections.length?(J(),ve(Qe,{key:0},[ot((J(),Ce(c,{id:"oc-openfile-contextmenu-trigger","aria-label":e.contextMenuLabel,appearance:"raw-inverse","color-role":"chrome",class:"oc-p-xs"},{default:Te(()=>[be(a,{name:"more-2"})]),_:1},8,["aria-label"])),[[d,e.contextMenuLabel]]),be(l,{"drop-id":"oc-openfile-contextmenu",mode:"click","padding-size":"small",toggle:"#oc-openfile-contextmenu-trigger","close-on-click":"",onClick:t[0]||(t[0]=Rn(()=>{},["stop","prevent"]))},{default:Te(()=>[be(u,{"menu-sections":e.dropDownMenuSections,"action-options":e.dropDownActionOptions},null,8,["menu-sections","action-options"])]),_:1})],64)):Oe("",!0),e.hasAutosave?(J(),ve("span",Ok,[ot(be(a,{"accessible-label":e.autoSaveTooltipText,name:"refresh",color:"white",class:"ox-p-xs oc-mx-xs"},null,8,["accessible-label"]),[[d,e.autoSaveTooltipText]])])):Oe("",!0),e.mainActions.length&&e.resource?(J(),Ce(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"])):Oe("",!0),be(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:Te(()=>[be(a,{name:"close"})]),_:1},8,["aria-label"])])])])]),_:1})}const zv=Ve(_k,[["render",xk]]),kk=Me({name:"ErrorScreen",props:{message:{default:"",type:String,required:!1}}}),Nk={class:"oc-text-center oc-flex oc-flex-center oc-flex-middle oc-height-1-1"},$k={key:0,class:"oc-text-xlarge"};function Dk(e,t,n,r,o,i){const s=pe("oc-icon");return J(),ve("div",Nk,[be(s,{size:"xxlarge",name:"error-warning","fill-type":"line"}),e.message?(J(),ve("p",$k,H.toDisplayString(e.message),1)):Oe("",!0)])}const Lk=Ve(kk,[["render",Dk]]),Mk=Me({name:"LoadingScreen"}),Bk={class:"oc-text-center oc-flex oc-flex-center oc-flex-middle oc-height-1-1"},jk={class:"oc-invisible"};function Uk(e,t,n,r,o,i){const s=pe("oc-spinner"),a=dn("translate");return J(),ve("div",Bk,[be(s,{size:"xlarge"}),ot((J(),ve("p",jk,t[0]||(t[0]=[Vt("Loading app")]))),[[a]])])}const qk=Ve(Mk,[["render",Uk]]),Vk=["id","data-testid","tabindex","inert"],zk={key:0,class:"sidebar-panel__header header"},Wk={class:"header__title oc-my-rm"},Hk={key:0,class:"sidebar-panel__navigation oc-mt-m"},Wv=Me({__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}=Ne.useGettext(),o=Ud("appSideBar"),i=U(()=>e.availablePanels.filter(A=>{var $;return A.isVisible(e.panelContext)&&(($=A.isRoot)==null?void 0:$.call(A,e.panelContext))})),s=U(()=>e.availablePanels.filter(A=>{var $;return A.isVisible(e.panelContext)&&!(($=A.isRoot)!=null&&$.call(A,e.panelContext))})),a=U(()=>p(i).length?[p(i)[0],...p(s)]:p(s)),c=U(()=>{var $;const A=($=e.activePanel)==null?void 0:$.split("#")[0];return!A||!p(s).map(D=>D.name).includes(A)?null:A}),u=U(()=>p(c)!==null),l=U(()=>p(c)===null),f=oe(null),d=A=>{f.value=A},m=U(()=>p(u)?p(c):p(i)[0].name),w=U(()=>p(i).length===1?r("Back to %{panel} panel",{panel:p(i)[0].title(e.panelContext)}):r("Back to main panels")),v=oe(window.innerWidth),T=U(()=>p(v)<=580),b=U(()=>{var A,$;return($=(A=p(o))==null?void 0:A.parentElement)==null?void 0:$.querySelector("div")}),g=()=>{if(!p(b))return;const A=p(T)?"hidden":"visible";p(b).style.visibility=A},h=()=>{e.isOpen&&(v.value=window.innerWidth,g())};Tt(()=>e.isOpen,async A=>{A&&(await Gn(),g())},{immediate:!0});const y=A=>{n("selectPanel",A)},S=()=>{n("selectPanel",null)},E=()=>{n("close")},R=A=>{d(p(m)),y(A)},I=()=>{d(p(m)),S(),p(o).focus()};return Mt(()=>{window.addEventListener("resize",h)}),jn(()=>{window.removeEventListener("resize",h),p(b)&&(p(b).style.visibility="visible")}),(A,$)=>{const D=pe("oc-spinner"),k=pe("oc-icon"),N=pe("oc-button"),j=dn("oc-tooltip");return J(),ve("div",{id:"app-sidebar",ref_key:"appSideBar",ref:o,"data-testid":"app-sidebar",tabindex:"-1",class:H.normalizeClass({"has-active-sub-panel":u.value,"oc-flex oc-flex-center oc-flex-middle":A.loading,"app-sidebar-full-width":T.value})},[A.loading?(J(),Ce(D,{key:0})):(J(!0),ve(Qe,{key:1},kt(a.value,W=>{var X,ie,de,se,we,Se;return J(),ve("div",{id:`sidebar-panel-${W.name}`,key:`panel-${W.name}`,"data-testid":`sidebar-panel-${W.name}`,tabindex:m.value===W.name?-1:null,class:H.normalizeClass(["sidebar-panel",{"is-root-panel":(X=W.isRoot)==null?void 0:X.call(W,A.panelContext),"is-active-sub-panel":u.value&&c.value===W.name,"is-active-root-panel":l.value&&((ie=W.isRoot)==null?void 0:ie.call(W,A.panelContext))}]),inert:m.value!==W.name},[[m.value,f.value].includes(W.name)?(J(),ve("div",zk,[(de=W.isRoot)!=null&&de.call(W,A.panelContext)?Oe("",!0):ot((J(),Ce(N,{key:0,class:"header__back oc-p-xs",appearance:"raw","aria-label":w.value,onClick:I},{default:Te(()=>[be(k,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"])),[[j,w.value]]),fe("h2",Wk,H.toDisplayString(W.title(A.panelContext)),1),be(N,{appearance:"raw",class:"header__close oc-p-xs","aria-label":p(r)("Close file sidebar"),onClick:E},{default:Te(()=>[be(k,{name:"close"})]),_:1},8,["aria-label"])])):Oe("",!0),fe("div",null,[(se=W.isRoot)!=null&&se.call(W,A.panelContext)?Ge(A.$slots,"rootHeader",{key:0}):Ge(A.$slots,"subHeader",{key:1})]),fe("div",{class:H.normalizeClass(["sidebar-panel__body",[`sidebar-panel__body-${W.name}`]])},[fe("div",{class:H.normalizeClass(["sidebar-panel__body-content",{"sidebar-panel__body-content-stretch":!((we=W.isRoot)!=null&&we.call(W,A.panelContext))}])},[Ge(A.$slots,"body",{},()=>{var Z;return[(J(!0),ve(Qe,null,kt((Z=W.isRoot)!=null&&Z.call(W,A.panelContext)?i.value:[W],(ne,le)=>{var Ie;return J(),Ce(Wr(ne.component),Zt({key:`sidebar-panel-${ne.name}`,class:{"multi-root-panel-separator oc-mt oc-pt-s":le>0},ref_for:!0},((Ie=ne.componentAttrs)==null?void 0:Ie.call(ne,A.panelContext))||{}),null,16,["class"])}),128))]})],2),(Se=W.isRoot)!=null&&Se.call(W,A.panelContext)&&s.value.length>0?(J(),ve("div",Hk,[(J(!0),ve(Qe,null,kt(s.value,Z=>(J(),Ce(N,{id:`sidebar-panel-${Z.name}-select`,key:`panel-select-${Z.name}`,"data-testid":`sidebar-panel-${Z.name}-select`,appearance:"raw-inverse","color-role":"surface",onClick:ne=>R(Z.name)},{default:Te(()=>[be(k,{name:Z.icon,"fill-type":Z.iconFillType},null,8,["name","fill-type"]),Vt(" "+H.toDisplayString(Z.title(A.panelContext))+" ",1),be(k,{name:"arrow-right-s","fill-type":"line"})]),_:2},1032,["id","data-testid","onClick"]))),128))])):Oe("",!0)],2)],10,Vk)}),128))],2)}}}),Gk=Me({name:"SpaceInfo",setup(){return{resource:dr("resource")}}}),Kk={class:"space_info oc-p-s"},Qk={class:"space_info__body oc-text-overflow oc-flex oc-flex-middle"},Xk={class:"oc-mr-s"},Yk=["textContent"],Jk=["textContent"];function Zk(e,t,n,r,o,i){const s=pe("oc-icon");return J(),ve("div",Kk,[fe("div",Qk,[fe("div",Xk,[be(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:H.toDisplayString(e.resource.name)},null,8,Yk),fe("span",{"data-testid":"space-info-subtitle",textContent:H.toDisplayString(e.resource.description)},null,8,Jk)])])])}const Hv=Ve(Gk,[["render",Zk]]),eN=Me({name:"FileInfo",components:{ResourceIcon:Co,ResourceName:Of},props:{isSubPanelActive:{type:Boolean,default:!0}},setup(){const e=Ke(),t=dr("resource"),n=dr("space"),r=U(()=>e.areFileExtensionsShown),o=U(()=>ee.isPersonalSpaceResource(p(n))&&p(t).path==="/"?p(n).name:p(t).name);return{resource:t,resourceName:o,areFileExtensionsShown:r}}}),tN={class:"file_info oc-flex oc-flex-between oc-p-s"},nN={class:"oc-flex oc-flex-middle"},rN={class:"file_info__body oc-text-overflow"},iN={"data-testid":"files-info-name",class:"oc-font-semibold"};function oN(e,t,n,r,o,i){const s=pe("resource-icon"),a=pe("resource-name");return J(),ve("div",tN,[fe("div",nN,[e.isSubPanelActive?(J(),Ce(s,{key:0,resource:e.resource,size:"large",class:"file_info__icon oc-mr-s oc-position-relative"},null,8,["resource"])):Oe("",!0),fe("div",rN,[fe("h3",iN,[be(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 Gv=Ve(eN,[["render",oN]]),sN=Me({name:"FileSideBar",components:{FileInfo:Gv,SpaceInfo:Hv,InnerSideBar:Wv},props:{isOpen:{type:Boolean,required:!0},activePanel:{type:String,required:!1,default:null},space:{type:Object,required:!1,default:null}},setup(e){const t=ze(),n=Ye(),r=Ni(),o=_o(),i=lt(),s=jt(),a=st(),c=Zn(),{canListShares:u}=fv(),{canListVersions:l}=Lv(),f=Ke(),{currentFolder:d}=He.storeToRefs(f),m=oe(),w=oe([]),v=oe([]),T=oe([]),{selectedResources:b}=Bf(),g=oe(!1),h=U(()=>p(g)||de.isRunning),y=U(()=>{var we;return p(b).length===0?{root:e.space,parent:null,items:(we=p(d))!=null&&we.id?[p(d)]:[]}:{root:e.space,parent:p(d),items:p(b)}}),S=Sr(Nt,"files-shares-with-me"),E=Sr(Nt,"files-shares-with-others"),R=Sr(Nt,"files-shares-via-link"),I=at(t,"files-spaces-projects"),A=Sr(At,"files-common-favorites"),$=Sr(At,"files-common-search"),D=()=>{o.publish(yt.close)},k=we=>{o.publish(yt.setActivePanel,we)},N=U(()=>{var we;return((we=p(y).items)==null?void 0:we.length)===1&&!ee.isProjectSpaceResource(p(y).items[0])}),j=U(()=>{var we;return((we=p(y).items)==null?void 0:we.length)===1&&ee.isProjectSpaceResource(p(y).items[0])}),W=U(()=>p(S)||p(E)||p(R)),X=U(()=>p(W)||p($)||p(A)),ie=U(()=>r.requestExtensions({id:"global.files.sidebar",extensionType:"sidebarPanel"}).map(we=>we.panel)),de=un.useTask(function*(we,Se){w.value=yield n.webdav.listFileVersions(Se.id,{signal:we})}),se=un.useTask(function*(we,Se){var ke;s.setLoading(!0),s.removeOrphanedShares();const{collaboratorShares:Z,linkShares:ne}=s,le=n.graphAuthenticated.permissions;let Ie=(ke=e.space)==null?void 0:ke.id;if(ee.isShareSpaceResource(e==null?void 0:e.space)){const Pe=yield i.getMountPointForSpace({graphClient:n.graphAuthenticated,space:e.space,signal:we});Pe&&(Ie=Pe.root.remoteItem.rootId)}const{shares:Y,allowedRoles:_}=yield*ee.call(le.listPermissions(Ie,Se.fileId,s.graphRoles,{},{signal:we})),F=Y.filter(ee.isCollaboratorShare),K=Y.filter(ee.isLinkShare),z=Object.values(s.graphRoles);if(v.value=(_==null?void 0:_.map(Pe=>{var Be;return{...Pe,icon:(Be=z.find(he=>he.id===Pe.id))==null?void 0:Be.icon}}))||[],c.isAppEnabled("open-cloud-mesh")){const{allowedRoles:Pe}=yield*ee.call(le.listPermissions(Ie,Se.fileId,s.graphRoles,{filter:`@libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition, '@Subject.UserType=="Federated"'))`,select:[ZO.LibreGraphPermissionsRolesAllowedValues]},{signal:we}));T.value=(Pe==null?void 0:Pe.map(Be=>{var he;return{...Be,icon:(he=z.find(ae=>ae.id===Be.id))==null?void 0:he.icon}}))||[]}!p(X)&&!p(I)&&(Z.forEach(Pe=>{F.some(Be=>Be.id===Pe.id)||F.push({...Pe,indirect:!0})}),ne.forEach(Pe=>{K.some(Be=>Be.id===Pe.id)||K.push({...Pe,indirect:!0})})),At(t,"files-common-search")&&(yield f.loadAncestorMetaData({folder:p(Se),space:p(e.space),client:n.webdav,signal:we}));const V=[...Z,...ne].map(({resourceId:Pe})=>Pe),ce=Object.values(f.ancestorMetaData).filter(({id:Pe,path:Be})=>Pe===Se.id||V.includes(Pe)||ee.isIncomingShareResource(Se)?!1:ee.isPersonalSpaceResource(e.space)?Be!=="/":!0).map(({id:Pe})=>Pe);p(X)&&ee.isProjectSpaceResource(e.space)&&!ee.isProjectSpaceResource(Se)&&ce.push(e.space.id);const Re=new Lr({concurrency:a.options.concurrentRequests.shares.list}),Le=[...new Set(ce)].map(Pe=>Re.add(()=>n.graphAuthenticated.permissions.listPermissions(Ie,Pe,s.graphRoles,{},{signal:we}).then(Be=>{const he=Be.shares.map(ae=>({...ae,indirect:!0}));F.push(...he.filter(ee.isCollaboratorShare)),K.push(...he.filter(ee.isLinkShare))})));yield Promise.allSettled(Le),s.setCollaboratorShares(F),s.setLinkShares(K),s.setLoading(!1)}).restartable();return Tt(()=>[...p(y).items,e.isOpen],async()=>{var Se;if(((Se=p(y).items)==null?void 0:Se.length)!==1)return;if(!e.isOpen){w.value=[];return}const we=p(y).items[0];if(de.isRunning&&de.cancelAll(),!!l({space:e.space,resource:we}))try{await de.perform(we)}catch(Z){console.error(Z)}},{immediate:!0,deep:!0}),Tt(()=>[...p(y).items,e.isOpen],async()=>{var Se;if(!e.isOpen){s.pruneShares(),m.value=null;return}if(((Se=p(y).items)==null?void 0:Se.length)!==1)return;const we=p(y).items[0];if(g.value=!0,u({space:e.space,resource:we}))try{se.isRunning&&se.cancelAll(),se.perform(we)}catch(Z){console.error(Z)}if(!p(W)){m.value=we,g.value=!1;return}try{const Z=await n.webdav.getFileInfo(e.space,{path:we.path}),ne={...Z,...we,tags:Z.tags};m.value=ne}catch(Z){m.value=we,console.error(Z)}g.value=!1},{deep:!0,immediate:!0}),yi("resource",lr(m)),yi("versions",lr(w)),yi("space",U(()=>e.space)),yi("activePanel",U(()=>e.activePanel)),yi("availableInternalShareRoles",lr(v)),yi("availableExternalShareRoles",lr(T)),{loadedResource:m,setActiveSideBarPanel:k,closeSideBar:D,panelContext:y,availablePanels:ie,isFileHeaderVisible:N,isSpaceHeaderVisible:j,isLoading:h,loadSharesTask:se}}});function aN(e,t,n,r,o,i){const s=pe("file-info"),a=pe("space-info"),c=pe("InnerSideBar");return e.isOpen?(J(),Ce(c,Zt({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:Te(()=>[e.isFileHeaderVisible?(J(),Ce(s,{key:0,class:"sidebar-panel__file_info","is-sub-panel-active":!1})):e.isSpaceHeaderVisible?(J(),Ce(a,{key:1,class:"sidebar-panel__space_info"})):Oe("",!0)]),subHeader:Te(()=>[e.isFileHeaderVisible?(J(),Ce(s,{key:0,class:"sidebar-panel__file_info","is-sub-panel-active":!0})):e.isSpaceHeaderVisible?(J(),Ce(a,{key:1,class:"sidebar-panel__space_info"})):Oe("",!0)]),_:1},16,["is-open","active-panel","available-panels","panel-context","loading","onSelectPanel","onClose"])):Oe("",!0)}const Kv=Ve(sN,[["render",aN]]),lN=Me({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=oe(),t=oe(!0);return{confirmDisabled:t,onDateChanged:({date:r,error:o})=>{t.value=o||!r,e.value=r},dateTime:e}}}),cN={class:"link-modal-actions oc-flex oc-flex-right oc-flex-middle oc-mt-s"};function uN(e,t,n,r,o,i){const s=pe("oc-datepicker"),a=pe("oc-button");return J(),ve(Qe,null,[be(s,{label:e.$gettext("Expiration date"),type:"date","min-date":e.minDate,"current-date":e.currentDate,"is-clearable":e.isClearable,onDateChanged:e.onDateChanged},null,8,["label","min-date","current-date","is-clearable","onDateChanged"]),fe("div",cN,[be(a,{class:"oc-modal-body-actions-cancel oc-ml-s",onClick:t[0]||(t[0]=c=>e.$emit("cancel"))},{default:Te(()=>[Vt(H.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),be(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:Te(()=>[Vt(H.toDisplayString(e.$gettext("Confirm")),1)]),_:1},8,["disabled"])])],64)}const fN=Ve(lN,[["render",uN]]),dN=Me({name:"UnsavedChangesModal",props:{modal:{type:Object,required:!0},closeCallback:{type:Function,required:!0}},emits:["cancel","confirm"],setup(e){const{removeModal:t}=bt();return{onClose:()=>{t(e.modal.id),e.closeCallback()}}}}),pN=["textContent"],hN={class:"oc-flex oc-flex-right oc-flex-middle oc-mt-m"},gN={class:"oc-modal-body-actions-grid"};function mN(e,t,n,r,o,i){const s=pe("oc-button");return J(),ve(Qe,null,[fe("span",{class:"oc-display-inline-block oc-mb-m",textContent:H.toDisplayString(e.$gettext("Your changes were not saved. Do you want to save them?"))},null,8,pN),t[2]||(t[2]=fe("div",{class:"oc-my-m"},null,-1)),fe("div",hN,[fe("div",gN,[be(s,{class:"oc-modal-body-actions-cancel oc-ml-s",onClick:t[0]||(t[0]=a=>e.$emit("cancel"))},{default:Te(()=>[Vt(H.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),be(s,{class:"oc-modal-body-actions-secondary oc-ml-s",onClick:e.onClose},{default:Te(()=>[Vt(H.toDisplayString(e.$gettext("Don't Save")),1)]),_:1},8,["onClick"]),be(s,{class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",onClick:t[1]||(t[1]=a=>e.$emit("confirm"))},{default:Te(()=>[Vt(H.toDisplayString(e.$gettext("Save")),1)]),_:1})])])],64)}const Qv=Ve(dN,[["render",mN]]);var yN=/\s/;function bN(e){for(var t=e.length;t--&&yN.test(e.charAt(t)););return t}var vN=/^\s+/;function wN(e){return e&&e.slice(0,bN(e)+1).replace(vN,"")}var Xv=NaN,SN=/^[-+]0x[0-9a-f]+$/i,EN=/^0b[01]+$/i,TN=/^0o[0-7]+$/i,AN=parseInt;function RN(e){if(typeof e=="number")return e;if(gs(e))return Xv;if(Qn(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Qn(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=wN(e);var n=EN.test(e);return n||TN.test(e)?AN(e.slice(2),n?2:8):SN.test(e)?Xv:+e}const _N=Me({name:"AppWrapper",components:{AppTopBar:zv,FileSideBar:Kv,ErrorScreen:Lk,LoadingScreen:qk},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}=Ne.useGettext(),r=Zn(),{showMessage:o,showErrorMessage:i}=rt(),s=No.useRouter(),a=en(),c=Ye(),u=cn(),{getResourceContext:l}=Mv(),{selectedResources:f}=Bf(),{dispatchModal:d}=bt(),m=lt(),w=st(),v=Ke(),T=jt(),{actions:b}=Sv({appId:e.applicationId}),{actions:g}=Sf(),{actions:h}=Io(),{actions:y}=_f(),{actions:S}=If(),E=U(()=>{var Fe;return!!((Fe=e.wrappedComponent.emits)!=null&&Fe.includes("update:resource"))}),R=oe(),I=oe(),A=oe(""),$=oe(""),D=oe(!p(E)),k=oe(),N=oe(!1),j=oe(),W=oe(),{actions:X}=Tv({content:W}),ie=U(()=>{var Fe;return!!((Fe=e.wrappedComponent.emits)!=null&&Fe.includes("update:currentContent"))}),de=Fe=>!!Object.keys(e.wrappedComponent.props).includes(Fe),se=U(()=>p(W)!==p(j)),we=Fe=>{Fe.preventDefault()};Tt(se,Fe=>{Fe?window.addEventListener("beforeunload",we):window.removeEventListener("beforeunload",we)});const{applicationConfig:Se,closeApp:Z,currentFileContext:ne,getFileContents:le,getFileInfo:Ie,getUrlForResource:Y,putFileContents:_,replaceInvalidFileRoute:F,revokeUrl:K,activeFiles:z,loadFolderForFileContext:B,isFolderLoading:V}=nv({applicationId:e.applicationId}),{applicationMeta:ce}=vf({applicationId:e.applicationId,appsStore:r}),Re=U(()=>{var Fe;return(Fe=p(ce).meta)==null?void 0:Fe.fileSizeLimit}),Le=U(()=>{const{name:Fe}=p(ce);return t("%{appName} for %{fileName}",{appName:t(Fe),fileName:p(p(ne).fileName)})}),ke=Hs("driveAliasAndItem"),Pe=on("fileId"),Be=U(()=>St(p(Pe))),he=async()=>{const Fe=p(Be),{space:je,path:We}=await l(Fe),wn=je.getDriveAliasAndItem({path:We});return ee.isPersonalSpaceResource(je)?s.push({params:{...p(a).params,driveAliasAndItem:wn},query:{...p(a).query,fileId:Fe,contextRouteName:"files-spaces-generic",contextRouteParams:{driveAliasAndItem:gt.dirname(wn)}}}):s.push({params:{...p(a).params,driveAliasAndItem:wn},query:{...p(a).query,fileId:Fe,contextRouteName:We==="/"?"files-shares-with-me":"files-spaces-generic",...ee.isShareSpaceResource(je)&&{shareId:je.id},contextRouteParams:{driveAliasAndItem:gt.dirname(wn)},contextRouteQuery:{...ee.isShareSpaceResource(je)&&{shareId:je.id}}}})},ae=un.useTask(function*(Fe){try{p(ke)||(yield he()),I.value=p(p(ne).space);const je=yield Ie(p(ne),{signal:Fe});if(R.value=je,ee.isShareSpaceResource(p(I))&&(p(R).remoteItemId=p(I).id,p(R).id===p(R).remoteItemId)){const We=yield*ee.call(hs({graphClient:c.graphAuthenticated,spacesStore:m,space:p(I)}));We&&(R.value={...je,...ee.buildIncomingShareResource({graphRoles:T.graphRoles,driveItem:We,serverUrl:w.serverUrl}),tags:je.tags})}v.initResourceList({currentFolder:null,resources:[p(R)]}),f.value=[p(R)]}catch(je){console.error(je),k.value=je,D.value=!1}}).restartable(),$e=un.useTask(function*(Fe){try{const je=e.importResourceWithExtension(p(R));if(je){const We=Dt.DateTime.local().toFormat("yyyyMMddHHmmss"),wn=`${p(R).name}_${We}.${je}`;if(!(yield c.webdav.copyFiles(p(I),p(R),p(I),{path:wn},{signal:Fe})))throw new Error(t("Importing failed"));R.value={path:wn}}if(F(ne,p(R)))return;if(N.value=![Cn.Updateable,Cn.FileUpdateable].some(We=>(p(R).permissions||"").indexOf(We)>-1),p(de("currentContent"))){const We=yield*ee.call(le(ne,{...e.fileContentOptions,signal:Fe}));j.value=W.value=We.body,A.value=We.headers["OC-ETag"]}p(de("url"))&&($.value=yield Y(p(I),p(R),{...e.urlForResourceOptions,signal:Fe}))}catch(je){console.error(je),k.value=je}finally{D.value=!1}}).restartable();Tt(ne,async()=>{p(E)||(await ae.perform(),p(Re)&&RN(p(R).size)>p(Re)?d({title:t("File exceeds %{threshold}",{threshold:En(p(Re),n)}),message:t("%{resource} exceeds the recommended size of %{threshold} for editing, and may cause performance issues.",{resource:p(R).name,threshold:En(p(Re),n)}),confirmText:t("Continue"),onCancel:()=>{Z()},onConfirm:()=>{$e.perform()}}):$e.perform())},{immediate:!0});const De=Fe=>{console.error(Fe),i({title:t("An error occurred"),desc:Fe.message,errors:[Fe]})},Je=()=>{o({title:t("File autosaved")})},ut=un.useTask(function*(){const Fe=p(W);try{const je=yield _(ne,{content:Fe,previousEntityTag:p(A)});j.value=Fe,A.value=je.etag,v.upsertResource(je)}catch(je){switch(je.statusCode){case 401:case 403:De(new ee.HttpError(t("You're not authorized to save this file"),je.response));break;case 409:case 412:De(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 We=m.spaces.find(wn=>wn.id===p(R).storageId&&ee.isProjectSpaceResource(wn));if(We){De(new ee.HttpError(t('Insufficient quota on "%{spaceName}" to save this file',{spaceName:We.name}),je.response));break}De(new ee.HttpError(t("Insufficient quota for saving this file"),je.response));break;default:De(new ee.HttpError("",je.response))}}}).drop(),ct=async()=>{await ut.perform()},Qt=U(()=>!e.disableAutoSave);let Xt=null;Mt(()=>{var je;if((je=v.ancestorMetaData)!=null&&je["/"]&&p(I)&&v.ancestorMetaData["/"].spaceId!==p(I).id&&v.setAncestorMetaData({}),!p(ie))return;const Fe=w.options.editor;Fe.autosaveEnabled&&!e.disableAutoSave&&(Xt=setInterval(async()=>{se.value&&(await ct(),Je())},(Fe.autosaveInterval||120)*1e3))}),jn(()=>{u.isLoading||window.removeEventListener("beforeunload",we),p(de("url"))&&K($.value),p(ie)&&(clearInterval(Xt),Xt=null)});const{bindKeyAction:Pt}=$v({skipDisabledKeyBindingsCheck:!0});Pt({modifier:$f.Ctrl,primary:Nf.S},()=>{p(se)&&ct()});const Ue=U(()=>[{name:"save-file",disabledTooltip:()=>"",isVisible:()=>p(ie),isDisabled:()=>N.value||!se.value,icon:"save",id:"app-save-action",label:()=>t("Save"),handler:ct}]),M=U(()=>({space:p(I),resources:[p(R)]})),C=async(Fe,je)=>{p(se)&&(await ct(),Je()),je(Fe)},O=U(()=>[...p(b),...p(Ue),...p(X).map(Fe=>({...Fe,isVisible:je=>ie.value&&Fe.isVisible(je)}))].filter(Fe=>Fe.isVisible(p(M)))),G=U(()=>[...p(S),...p(g)].filter(Fe=>Fe.isVisible(p(M)))),te=U(()=>[...p(h).map(Fe=>({...Fe,handler:je=>C(je,Fe.handler)}))].filter(Fe=>Fe.isVisible(p(M)))),ue=U(()=>[...p(y)].filter(Fe=>Fe.isVisible(p(M)))),Ae=U(()=>{const Fe=[];return p(O).length&&Fe.push({name:"context",items:p(O)}),p(G).length&&Fe.push({name:"share",items:p(G)}),p(te).length&&Fe.push({name:"actions",items:p(te)}),p(ue).length&&Fe.push({name:"sidebar",items:p(ue)}),Fe}),Ze=U(()=>[...p(Ue)]);No.onBeforeRouteLeave((Fe,je,We)=>{p(se)?d({title:t("Unsaved changes"),customComponent:Qv,focusTrapInitial:".oc-modal-body-actions-confirm",hideActions:!0,customComponentAttrs:()=>({closeCallback:()=>{We()}}),async onConfirm(){await ct(),We()}}):We()});const ft=U(()=>({url:p($),space:p(p(ne).space),resource:p(R),activeFiles:p(z),isDirty:p(se),isReadOnly:p(N),applicationConfig:p(Se),currentFileContext:p(ne),currentContent:p(W),isFolderLoading:p(V),"onUpdate:resource":Fe=>{R.value=Fe,I.value=p(p(ne).space),f.value=[Fe]},"onUpdate:currentContent":Fe=>{W.value=Fe},onSave:ct,onClose:Z,loadFolderForFileContext:B,revokeUrl:K,getUrlForResource:Y}));return{...yb(),dropDownMenuSections:Ae,dropDownActionOptions:M,hasAutoSave:Qt,isEditor:ie,closeApp:Z,fileActions:Ze,loading:D,loadingError:k,pageTitle:Le,resource:R,space:I,slotAttrs:ft}}}),IN=["id"],CN=["textContent"];function PN(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 J(),ve("main",{id:e.applicationId,class:"app-wrapper oc-height-1-1",onKeydown:t[0]||(t[0]=Ji((...l)=>e.closeApp&&e.closeApp(...l),["esc"]))},[fe("h1",{class:"oc-invisible-sr",textContent:H.toDisplayString(e.pageTitle)},null,8,CN),!e.loading&&!e.loadingError&&e.resource?(J(),Ce(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"])):Oe("",!0),e.loading?(J(),Ce(a,{key:1})):e.loadingError?(J(),Ce(c,{key:2,message:e.loadingError.message},null,8,["message"])):(J(),ve("div",{key:3,class:H.normalizeClass(["oc-flex oc-width-1-1 oc-height-1-1",{"app-sidebar-open":e.isSideBarOpen}])},[Ge(e.$slots,"default",Zt({class:"app-wrapper-content oc-height-1-1"},e.slotAttrs)),be(u,{"is-open":e.isSideBarOpen,"active-panel":e.sideBarActivePanel,space:e.space},null,8,["is-open","active-panel","space"])],2))],40,IN)}const Yv=Ve(_N,[["render",PN]]);function FN(e,t){return Me({render(){return fp(Yv,{wrappedComponent:e,...t},{default:n=>fp(e,n)})}})}const ON=Me({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}=Ne.useGettext();return{contextMenuLabel:U(()=>e("Show context menu"))}}});function xN(e,t,n,r,o,i){const s=pe("oc-icon"),a=pe("oc-drop"),c=pe("oc-button"),u=dn("oc-tooltip");return ot((J(),Ce(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[0]||(t[0]=Rn(l=>e.$emit("quickActionClicked",{event:l,dropdown:e.$refs[`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`]}),["stop","prevent"]))},{default:Te(()=>[be(s,{name:"more-2"}),be(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)}`,class:"oc-overflow-hidden",position:"bottom-end",mode:"click","close-on-click":"","padding-size":"small"},{default:Te(()=>[Ge(e.$slots,"contextMenu",{item:e.item})]),_:3},8,["drop-id","toggle"])]),_:3},8,["id","aria-label"])),[[u,e.contextMenuLabel]])}const qf=Ve(ON,[["render",xN]]),kN=Me({name:"ResourceGhostElement",components:{ResourceIcon:Co},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}}}),NN={id:"ghost-element",class:"ghost-element"},$N={class:"ghost-element-layer1 oc-rounded"},DN={key:0,class:"ghost-element-layer2 oc-rounded"},LN={key:1,class:"ghost-element-layer3 oc-rounded"},MN={class:"badge"};function BN(e,t,n,r,o,i){const s=pe("resource-icon");return J(),ve("div",NN,[fe("div",$N,[be(s,{class:"oc-p-xs",resource:e.previewItems[0]},null,8,["resource"]),e.showSecondLayer?(J(),ve("div",DN)):Oe("",!0),e.showThirdLayer?(J(),ve("div",LN)):Oe("",!0)]),fe("span",MN,H.toDisplayString(e.itemCount),1)])}const Vf=Ve(kN,[["render",BN]]),jN=Me({name:"ResourceSize",props:{size:{type:[String,Number],required:!0}},setup:e=>{const{current:t}=Ne.useGettext();return{formattedSize:U(()=>En(e.size,t))}}}),UN=["textContent"];function qN(e,t,n,r,o,i){return J(),ve("span",{class:"oc-resource-size",textContent:H.toDisplayString(e.formattedSize)},null,8,UN)}const Jv=Ve(jN,[["render",qN]]),VN=Me({__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=U(()=>{const a=["oc-button","oc-rounded",`oc-button-${ri(e.size)}`,`oc-button-justify-content-${e.justifyContent}`,`oc-button-gap-${ri(e.gapSize)}`,`oc-button-${Et.kebabCase(e.colorRole)}`,`oc-button-${e.appearance}`,`oc-button-${Et.kebabCase(e.colorRole)}-${e.appearance}`];return e.noHover&&a.push("no-hover"),a}),o=U(()=>({...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=U(()=>({...e.type==="button"&&{click:s}})),s=a=>{n("click",a)};return(a,c)=>{const u=pe("oc-spinner");return J(),Ce(Wr(a.type),Zt(o.value,{"aria-label":a.ariaLabel,class:r.value},qa(i.value)),{default:Te(()=>[a.showSpinner?(J(),Ce(u,{key:0,size:"small",class:"spinner"})):Oe("",!0),Ge(a.$slots,"default")]),_:3},16,["aria-label","class"])}}});/*!
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="",f="";const d=u.join(".");for(let m in a)if(Object.prototype.hasOwnProperty.call(a,m))if(typeof a[m]>"u")this.isAttribute(m)&&(f+="");else if(a[m]===null)this.isAttribute(m)||m===this.options.cdataPropName?f+="":m[0]==="?"?f+=this.indentate(c)+"<"+m+"?"+this.tagEndChar:f+=this.indentate(c)+"<"+m+"/"+this.tagEndChar;else if(a[m]instanceof Date)f+=this.buildTextValNode(a[m],m,"",c);else if(typeof a[m]!="object"){const w=this.isAttribute(m);if(w&&!this.ignoreAttributesFn(w,d))l+=this.buildAttrPairStr(w,""+a[m]);else if(!w)if(m===this.options.textNodeName){let b=this.options.tagValueProcessor(m,""+a[m]);f+=this.replaceEntitiesValue(b)}else f+=this.buildTextValNode(a[m],m,"",c)}else if(Array.isArray(a[m])){const w=a[m].length;let b="",T="";for(let v=0;v<w;v++){const g=a[m][v];if(!(typeof g>"u"))if(g===null)m[0]==="?"?f+=this.indentate(c)+"<"+m+"?"+this.tagEndChar:f+=this.indentate(c)+"<"+m+"/"+this.tagEndChar;else if(typeof g=="object")if(this.options.oneListGroup){const h=this.j2x(g,c+1,u.concat(m));b+=h.val,this.options.attributesGroupName&&g.hasOwnProperty(this.options.attributesGroupName)&&(T+=h.attrStr)}else b+=this.processTextOrObjNode(g,m,c,u);else if(this.options.oneListGroup){let h=this.options.tagValueProcessor(m,g);h=this.replaceEntitiesValue(h),b+=h}else b+=this.buildTextValNode(g,m,"",c)}this.options.oneListGroup&&(b=this.buildObjectNode(b,m,T,c)),f+=b}else if(this.options.attributesGroupName&&m===this.options.attributesGroupName){const w=Object.keys(a[m]),b=w.length;for(let T=0;T<b;T++)l+=this.buildAttrPairStr(w[T],""+a[m][w[T]])}else f+=this.processTextOrObjNode(a[m],m,c,u);return{attrStr:l,val:f}},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 f=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,f.attrStr,u):this.buildObjectNode(f.val,c,f.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 f="</"+c+this.tagEndChar,d="";return c[0]==="?"&&(d="?",f=""),(u||u==="")&&a.indexOf("<")===-1?this.indentate(l)+"<"+c+u+d+">"+a+f:this.options.commentPropName!==!1&&c===this.options.commentPropName&&d.length===0?this.indentate(l)+`<!--${a}-->`+this.newLine:this.indentate(l)+"<"+c+u+d+this.tagEndChar+a+this.indentate(l)+f}},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 f=this.options.tagValueProcessor(c,a);return f=this.replaceEntitiesValue(f),f===""?this.indentate(l)+"<"+c+u+this.closeTag(c)+this.tagEndChar:this.indentate(l)+"<"+c+u+">"+f+"</"+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 sf=r,sf}var af,jy;function W_(){if(jy)return af;jy=1;const e=Cy(),t=q_(),n=z_();return af={XMLParser:t,XMLValidator:e,XMLBuilder:n},af}W_();class Uy{isEnabled(){return!0}isActive(t){return In(t,"files-trash-generic")}getTask(t){const{resourcesStore:n,clientService:{webdav:r}}=t;return un.useTask(function*(o,i,s){n.clearResourceList(),n.setAncestorMetaData({});const{resource:a,children:c}=yield r.listFiles(s,{},{depth:1,davProperties:vs.Trashbin,isTrash:!0,signal:o});n.initResourceList({currentFolder:a,resources:c})})}}class qy{constructor(){Ee(this,"loaders");this.loaders=[new qh,new Vh,new zh,new Wh,new Hh,new Uy]}getTask(){const t=vt(),n=lt(),r=rn(),o=ze(),i=Ye(),s=st(),a=Ke(),c=jt(),u=yf(),l=this.loaders.find(f=>f.isEnabled()&&f.isActive(p(o)));if(!l){console.debug("No folder loader found for route");return}return un.useTask(function*(...f){const d={clientService:i,configStore:s,userStore:t,spacesStore:n,capabilityStore:r,resourcesStore:a,sharesStore:c,router:o,authService:u};try{yield l.getTask(d).perform(...f)}catch(m){console.error(m)}})}}const Vy=new qy;var Pr=(e=>(e.add="loading-service.add",e.remove="loading-service.remove",e.setProgress="loading-service.set-progress",e))(Pr||{});const H_=200;class G_{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=H_,indeterminate:r=!0}={}){const o={id:Yt.v4(),active:!1,...!r&&{state:{total:0,current:0}}};return this.tasks.length||window.addEventListener("beforeunload",this.onBeforeUnload),this.tasks.push(o),Et.debounce(()=>{o.active=!0,Xe.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),Xe.publish("loading-service.remove")}setProgress({task:t,total:n,current:r}){t.state||(t.state={total:0,current:0}),t.state.total=n,t.state.current=r,Xe.publish("loading-service.set-progress")}onBeforeUnload(t){t.preventDefault()}}var K_="__lodash_hash_undefined__";function Q_(e){return this.__data__.set(e,K_),this}function X_(e){return this.__data__.has(e)}function Ls(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new gr;++t<n;)this.add(e[t])}Ls.prototype.add=Ls.prototype.push=Q_,Ls.prototype.has=X_;function Y_(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 J_(e,t){return e.has(t)}var Z_=1,eI=2;function zy(e,t,n,r,o,i){var s=n&Z_,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 f=-1,d=!0,m=n&eI?new Ls:void 0;for(i.set(e,t),i.set(t,e);++f<a;){var w=e[f],b=t[f];if(r)var T=s?r(b,w,f,t,e,i):r(w,b,f,e,t,i);if(T!==void 0){if(T)continue;d=!1;break}if(m){if(!Y_(t,function(v,g){if(!J_(m,g)&&(w===v||o(w,v,n,r,i)))return m.push(g)})){d=!1;break}}else if(!(w===b||o(w,b,n,r,i))){d=!1;break}}return i.delete(e),i.delete(t),d}function tI(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}function nI(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var rI=1,iI=2,oI="[object Boolean]",sI="[object Date]",aI="[object Error]",lI="[object Map]",cI="[object Number]",uI="[object RegExp]",fI="[object Set]",dI="[object String]",pI="[object Symbol]",hI="[object ArrayBuffer]",gI="[object DataView]",Wy=Pn?Pn.prototype:void 0,lf=Wy?Wy.valueOf:void 0;function mI(e,t,n,r,o,i,s){switch(n){case gI:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case hI:return!(e.byteLength!=t.byteLength||!i(new us(e),new us(t)));case oI:case sI:case cI:return eo(+e,+t);case aI:return e.name==t.name&&e.message==t.message;case uI:case dI:return e==t+"";case lI:var a=tI;case fI:var c=r&rI;if(a||(a=nI),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;r|=iI,s.set(e,t);var l=zy(a(e),a(t),r,o,i,s);return s.delete(e),l;case pI:if(lf)return lf.call(e)==lf.call(t)}return!1}function cf(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function Hy(e,t,n){var r=t(e);return On(e)?r:cf(r,n(e))}function yI(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 Gy(){return[]}var bI=Object.prototype,vI=bI.propertyIsEnumerable,Ky=Object.getOwnPropertySymbols,Qy=Ky?function(e){return e==null?[]:(e=Object(e),yI(Ky(e),function(t){return vI.call(e,t)}))}:Gy;function wI(e){return oo(e)?Kp(e):Dh(e)}function Xy(e){return Hy(e,wI,Qy)}var SI=1,EI=Object.prototype,TI=EI.hasOwnProperty;function AI(e,t,n,r,o,i){var s=n&SI,a=Xy(e),c=a.length,u=Xy(t),l=u.length;if(c!=l&&!s)return!1;for(var f=c;f--;){var d=a[f];if(!(s?d in t:TI.call(t,d)))return!1}var m=i.get(e),w=i.get(t);if(m&&w)return m==t&&w==e;var b=!0;i.set(e,t),i.set(t,e);for(var T=s;++f<c;){d=a[f];var v=e[d],g=t[d];if(r)var h=s?r(g,v,d,t,e,i):r(v,g,d,e,t,i);if(!(h===void 0?v===g||o(v,g,n,r,i):h)){b=!1;break}T||(T=d=="constructor")}if(b&&!T){var y=e.constructor,S=t.constructor;y!=S&&"constructor"in e&&"constructor"in t&&!(typeof y=="function"&&y instanceof y&&typeof S=="function"&&S instanceof S)&&(b=!1)}return i.delete(e),i.delete(t),b}var RI=1,Yy="[object Arguments]",Jy="[object Array]",Ms="[object Object]",_I=Object.prototype,Zy=_I.hasOwnProperty;function II(e,t,n,r,o,i){var s=On(e),a=On(t),c=s?Jy:$n(e),u=a?Jy:$n(t);c=c==Yy?Ms:c,u=u==Yy?Ms:u;var l=c==Ms,f=u==Ms,d=c==u;if(d&&Si(e)){if(!Si(t))return!1;s=!0,l=!1}if(d&&!l)return i||(i=new Xn),s||ds(e)?zy(e,t,n,r,o,i):mI(e,t,c,n,r,o,i);if(!(n&RI)){var m=l&&Zy.call(e,"__wrapped__"),w=f&&Zy.call(t,"__wrapped__");if(m||w){var b=m?e.value():e,T=w?t.value():t;return i||(i=new Xn),o(b,T,n,r,i)}}return d?(i||(i=new Xn),AI(e,t,n,r,o,i)):!1}function eb(e,t,n,r,o){return e===t?!0:e==null||t==null||!Yn(e)&&!Yn(t)?e!==e&&t!==t:II(e,t,n,r,eb,o)}function tb(e,t){return eb(e,t)}const uf=(e="")=>e.split("/").map(encodeURIComponent).join("/"),CI=e=>{const t=[],n=(r,o="")=>Object.keys(r).forEach(i=>{ul(r[i])?n(r[i],`${o}${i}.`):t.push(`${o}${i}`)});return n(e),t};class FI{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","text/plain","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=jl.filePreview.get(o.id.toString());if(s&&s.etag===o.etag&&tb(i,s.dimensions))return s.src;try{const a=await this.privatePreviewBlob(t,!1,!0,r);return jl.filePreview.set(o.id.toString(),{src:a,etag:o.etag,dimensions:i},0).src}catch(a){if(n)return;throw a}}buildQueryString(t){return I0.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",uf(i.webDavPath),"?",this.buildQueryString({etag:i.etag,dimensions:s,processor:a})].join("");try{const{data:f}=await this.clientService.httpAuthenticated.get(c,{responseType:"blob",signal:o});return window.URL.createObjectURL(f)}catch(f){if([425,429].includes(f.status)){const d=((l=(u=f.response)==null?void 0:u.headers)==null?void 0:l["retry-after"])||5;return await new Promise(m=>setTimeout(m,d*1e3)),this.privatePreviewBlob(t,n,r,o)}throw f}}async publicPreviewUrl(t,n){var l,f;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:d}=await this.clientService.httpUnAuthenticated.head(u,{signal:n});if(d!==404)return u}catch(d){if([425,429].includes(d.status)){const m=((f=(l=d.response)==null?void 0:l.headers)==null?void 0:f["retry-after"])||5;return await new Promise(w=>setTimeout(w,m*1e3)),this.publicPreviewUrl(t,n)}throw d}}}const Bs=ye.z.enum(["fit","resize","fill","thumbnail"]);class PI{constructor({$gettext:t}){Ee(this,"$gettext");this.$gettext=t}explain(t,n){return{code:"mustNotBeEmpty",message:this.$gettext("Must not be empty"),format:[],...Et.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>0}validate(){return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class OI{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],...Et.isBoolean(n)&&{verified:n}}}assert(t,n){return Array.from(n).filter(o=>t.characters.includes(o)).length>=t.minLength}validate(t){if(!Et.isObject(t))throw new Error("options should be an object");if(!Et.isNumber(t.minLength)||Et.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");if(!Et.isString(t.characters))throw new Error("characters should be a character sequence");return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class js{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(!Et.isObject(t))throw new Error("options should be an object");if(!Et.isNumber(t.minLength)||Et.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class xI extends js{constructor(t){super(t)}explain(t,n){return{code:"atLeastCharacters",message:this.$gettext("%{param1}+ letters"),format:[t.minLength],...Et.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>=t.minLength}}class kI extends js{constructor(t){super(t)}explain(t,n){return{code:"atLeastUppercaseCharacters",message:this.$gettext("%{param1}+ uppercase letters"),format:[t.minLength],...Et.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/[A-Z\xC0-\xD6\xD8-\xDE]/g))==null?void 0:o.length)>=t.minLength}}class NI extends js{constructor(t){super(t)}explain(t,n){return{code:"atLeastLowercaseCharacters",message:this.$gettext("%{param1}+ lowercase letters"),format:[t.minLength],...Et.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/[a-z\xDF-\xF6\xF8-\xFF]/g))==null?void 0:o.length)>=t.minLength}}class $I extends js{constructor(t){super(t)}explain(t,n){return{code:"atLeastDigits",message:this.$gettext("%{param1}+ numbers"),format:[t.minLength],...Et.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/\d/g))==null?void 0:o.length)>=t.minLength}}var ff={},nb;function DI(){if(nb)return ff;nb=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,f=i.numbers,d=i.symbols,m=i.minLengthLowercase,w=i.minLengthUppercase,b=i.minLengthNumbers,T=i.minLengthSymbols,v=i.exclude,g="abcdefghijklmnopqrstuvwxyz";g=n(g,v);var h="ABCDEFGHIJKLMNOPQRSTUVWXYZ";h=n(h,v);var y="0123456789";y=n(y,v);var S="!#$%&'()*+,-./:;<=>?@[]^_{|}~";S=n(S,v);for(var E=g.length,R=0;R<m;R++)a+=g.charAt(e(E));for(E=h.length,R=0;R<w;R++)a+=h.charAt(e(E));for(E=y.length,R=0;R<b;R++)a+=y.charAt(e(E));for(E=S.length,R=0;R<T;R++)a+=S.charAt(e(E));s+=function($){for(var D=$.split(""),k=D.length-1;k>0;k--){var N=Math.floor(Math.random()*(k+1)),z=D[k];D[k]=D[N],D[N]=z}return D.join("")}(a);var I="";I=u?I+g:I,I=l?I+h:I,I=f?I+y:I,I=d?I+S:I;var A=c-s.length;for(E=I.length,R=0;R<A;R++)s+=I.charAt(e(E));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 ff.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))},ff}var LI=DI();class MI{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 xI({...this.language}),mustNotBeEmpty:new PI({...this.language}),atLeastUppercaseCharacters:new kI({...this.language}),atLeastLowercaseCharacters:new NI({...this.language}),atLeastDigits:new $I({...this.language}),mustContain:new OI({...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 C0.PasswordPolicy(r,n)}getPolicy({enforcePassword:t=!1}={}){return this.buildPolicy({enforcePassword:t}),this.policy}generatePassword(){return LI.GeneratePassword({symbols:!0,length:this.generatePasswordRules.length,minLengthLowercase:this.generatePasswordRules.minLowercaseCharacters,minLengthUppercase:this.generatePasswordRules.minUppercaseCharacters,minLengthNumbers:this.generatePasswordRules.minDigits,minLengthSymbols:this.generatePasswordRules.minSpecialCharacters})}}function BI(e){return e.charCodeAt(0).toString(32)}function rb(e){let t="";return e.replace(/[^A-Z0-9]/gi,n=>(t+=`-${BI(n)}`,"/"))+t}function ib(e,t){let n=t||"uppy";return typeof e.name=="string"&&(n+=`-${rb(e.name.toLowerCase())}`),e.type!==void 0&&(n+=`-${e.type}`),e.meta&&typeof e.meta.relativePath=="string"&&(n+=`-${rb(e.meta.relativePath.toLowerCase())}`),e.data.size!==void 0&&(n+=`-${e.data.size}`),e.data.lastModified!==void 0&&(n+=`-${e.data.lastModified}`),n}class jI{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 F0({autoProceed:!1,onBeforeFileAdded:(r,o)=>(r.id in o&&(r.meta.retry=!0),r.meta.relativePath=this.getRelativeFilePath(r),r.id=ib(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,f,d)=>{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:d(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(P0,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(O0,o)}tusActive(){return!!this.uppy.getPlugin("Tus")}useDropTarget({targetSelector:t}){this.uppy.getPlugin("DropTarget")||this.uppy.use(x0,{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 Xe.subscribe(t,n)}unsubscribe(t,n){Xe.unsubscribe(t,n)}publish(t,n){Xe.publish(t,n)}setUpEvents(){this.uppy.on("progress",t=>{this.publish("progress",t)}),this.uppy.on("upload-progress",(t,n)=>{this.publish("upload-progress",{file:t,progress:n})}),this.uppy.on("cancel-all",()=>{this.publish("uploadCancelled"),this.clearInputs()}),this.uppy.on("complete",t=>{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 ib(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 UI(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var qI=Object.getOwnPropertySymbols,VI=qI?function(e){for(var t=[];e;)cf(t,Qy(e)),e=cl(e);return t}:Gy;function ob(e){return Hy(e,hl,VI)}var zI=Object.prototype,WI=zI.hasOwnProperty;function HI(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&WI.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function GI(e,t){var n=ll(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var KI=/\w*$/;function QI(e){var t=new e.constructor(e.source,KI.exec(e));return t.lastIndex=e.lastIndex,t}var sb=Pn?Pn.prototype:void 0,ab=sb?sb.valueOf:void 0;function XI(e){return ab?Object(ab.call(e)):{}}var YI="[object Boolean]",JI="[object Date]",ZI="[object Map]",eC="[object Number]",tC="[object RegExp]",nC="[object Set]",rC="[object String]",iC="[object Symbol]",oC="[object ArrayBuffer]",sC="[object DataView]",aC="[object Float32Array]",lC="[object Float64Array]",cC="[object Int8Array]",uC="[object Int16Array]",fC="[object Int32Array]",dC="[object Uint8Array]",pC="[object Uint8ClampedArray]",hC="[object Uint16Array]",gC="[object Uint32Array]";function mC(e,t,n){var r=e.constructor;switch(t){case oC:return ll(e);case YI:case JI:return new r(+e);case sC:return GI(e);case aC:case lC:case cC:case uC:case fC:case dC:case pC:case hC:case gC:return kp(e,n);case ZI:return new r;case eC:case rC:return new r(e);case tC:return QI(e);case nC:return new r;case iC:return XI(e)}}var yC="[object Map]";function bC(e){return Yn(e)&&$n(e)==yC}var lb=Ei&&Ei.isMap,vC=lb?fl(lb):bC,wC="[object Set]";function SC(e){return Yn(e)&&$n(e)==wC}var cb=Ei&&Ei.isSet,EC=cb?fl(cb):SC,TC=1,ub="[object Arguments]",AC="[object Array]",RC="[object Boolean]",_C="[object Date]",IC="[object Error]",fb="[object Function]",CC="[object GeneratorFunction]",FC="[object Map]",PC="[object Number]",db="[object Object]",OC="[object RegExp]",xC="[object Set]",kC="[object String]",NC="[object Symbol]",$C="[object WeakMap]",DC="[object ArrayBuffer]",LC="[object DataView]",MC="[object Float32Array]",BC="[object Float64Array]",jC="[object Int8Array]",UC="[object Int16Array]",qC="[object Int32Array]",VC="[object Uint8Array]",zC="[object Uint8ClampedArray]",WC="[object Uint16Array]",HC="[object Uint32Array]",mt={};mt[ub]=mt[AC]=mt[DC]=mt[LC]=mt[RC]=mt[_C]=mt[MC]=mt[BC]=mt[jC]=mt[UC]=mt[qC]=mt[FC]=mt[PC]=mt[db]=mt[OC]=mt[xC]=mt[kC]=mt[NC]=mt[VC]=mt[zC]=mt[WC]=mt[HC]=!0,mt[IC]=mt[fb]=mt[$C]=!1;function Us(e,t,n,r,o,i){var s,a=t&TC;if(n&&(s=o?n(e,r,o,i):n(e)),s!==void 0)return s;if(!Qn(e))return e;var c=On(e);if(c)s=HI(e);else{var u=$n(e),l=u==fb||u==CC;if(Si(e))return xp(e,a);if(u==db||u==ub||l&&!o)s={};else{if(!mt[u])return o?e:{};s=mC(e,u,a)}}i||(i=new Xn);var f=i.get(e);if(f)return f;i.set(e,s),EC(e)?e.forEach(function(w){s.add(Us(w,t,n,w,e,i))}):vC(e)&&e.forEach(function(w,b){s.set(b,Us(w,t,n,b,e,i))});var d=ob,m=c?void 0:d(e);return UI(m||e,function(w,b){m&&(b=w,w=e[b]),Wp(s,b,Us(w,t,n,b,e,i))}),s}function GC(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 KC(e,t){return t.length<2?e:ph(e,GC(t,0,-1))}function QC(e,t){return t=Rl(t,e),e=KC(e,t),e==null||delete e[dh(td(t))]}function XC(e){return ul(e)?void 0:e}var pb=Pn?Pn.isConcatSpreadable:void 0;function YC(e){return On(e)||io(e)||!!(pb&&e&&e[pb])}function JC(e,t,n,r,o){var i=-1,s=e.length;for(n||(n=YC),o||(o=[]);++i<s;){var a=e[i];n(a)?cf(o,a):o[o.length]=a}return o}function ZC(e){var t=e==null?0:e.length;return t?JC(e):[]}function eF(e){return Zp(Jp(e,void 0,ZC),e+"")}var tF=1,nF=2,rF=4,ki=eF(function(e,t){var n={};if(e==null)return n;var r=!1;t=lh(t,function(i){return i=Rl(i,e),r||(r=i.length>1),i}),Hp(e,ob(e),n),r&&(n=Us(n,tF|nF|rF,XC));for(var o=t.length;o--;)QC(n,t[o]);return n});const iF=(e,t)=>{const n=(i="")=>i.split("/").filter(Boolean),r=n(e.path),o=n(t);return o.map((i,s)=>({id:Yt.v4(),allowContextActions:!0,text:i,to:{path:"/"+[...r].splice(0,r.length-o.length+s+1).join("/"),query:ki(e.query,"fileId","page")},isStaticNav:!1}))},oF=(...e)=>{const t=e.pop();return[...e,{id:Yt.v4(),allowContextActions:t.allowContextActions,text:t.text,onClick:()=>Xe.publish("app.files.list.load"),isTruncationPlaceholder:t.isTruncationPlaceholder,isStaticNav:t.isStaticNav}]};class ei{}Ee(ei,"Cut","cut"),Ee(ei,"Copy","copy");const df=e=>e.clientY===0,wo=(e,t,n)=>{var i;const r=n.$el.getBoundingClientRect(),o=df(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"&&!df(t)?t.clientX:r.x,right:t.type==="contextmenu"&&!df(t)?t.clientX:r.x})}),e.show()},qs=e=>(e||"").split("_")[0],ti=(e,t,n=Dt.DateTime.DATETIME_MED)=>e.setLocale(qs(t)).toLocaleString(n),hb=(e,t,n=Dt.DateTime.DATETIME_MED)=>ti(Dt.DateTime.fromJSDate(e),t,n),sF=(e,t,n=Dt.DateTime.DATETIME_MED)=>ti(Dt.DateTime.fromHTTP(e),t,n),gb=(e,t,n=Dt.DateTime.DATETIME_MED)=>ti(Dt.DateTime.fromISO(e),t,n),aF=(e,t,n=Dt.DateTime.DATETIME_MED)=>ti(Dt.DateTime.fromRFC2822(e),t,n),So=(e,t)=>e.setLocale(qs(t)).toRelative(),mb=(e,t)=>So(Dt.DateTime.fromJSDate(e),t),lF=(e,t)=>So(Dt.DateTime.fromHTTP(e),t),cF=(e,t)=>So(Dt.DateTime.fromISO(e),t),uF=(e,t)=>So(Dt.DateTime.fromRFC2822(e),t),fF=1048576,En=(e,t)=>{const n=typeof e=="string"?parseInt(e):e;return n<0?"--":isNaN(n)?"?":_0.filesize(n,{round:n<fF?0:1,locale:qs(t),base:10,output:"string"})};function yb(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 yt=(e=>(e.open="sidebar.open",e.close="sidebar.close",e.toggle="sidebar.toggle",e.openWithPanel="sidebar.openWithPanel",e.setActivePanel="sidebar.setActivePanel",e))(yt||{});const pf=(e,t=void 0)=>{const n=window.localStorage.getItem(e),r=ae(t);if(n)try{r.value=JSON.parse(n)}catch{r.value=n}return Tt(()=>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},ni=()=>{const e=st(),t=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.enabled}),n=j(()=>{var d;return((d=e.options.embed)==null?void 0:d.target)==="location"}),r=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.chooseFileName}),o=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.chooseFileNameSuggestion}),i=j(()=>{var d;return((d=e.options.embed)==null?void 0:d.target)==="file"}),s=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.fileTypes}),a=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.messagesOrigin}),c=j(()=>{var d;return p(t)&&((d=e.options.embed)==null?void 0:d.delegateAuthentication)}),u=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.delegateAuthenticationOrigin});return{isEnabled:t,isLocationPicker:n,chooseFileName:r,chooseFileNameSuggestion:o,isFilePicker:i,messagesTargetOrigin:a,isDelegatingAuthentication:c,fileTypes:s,postMessage:(d,m)=>{const w={};p(a)&&(w.targetOrigin=p(a)),window.parent.postMessage({name:d,data:m},w)},verifyDelegatedAuthenticationOrigin:d=>p(u)?p(u)===d:!0}},bb=e=>{const{isEnabled:t}=ni(),n=(e==null?void 0:e.bus)||Xe,r=pf("oc_sideBarOpen",!1),o=ae(!1),i=j({get(){return p(t)?p(o):p(r)},set(w){if(p(t)){o.value=w;return}r.value=w}}),s=async()=>{await Gn();const w=document.getElementById("app-sidebar");w&&w.focus()},a=ae(null),c=n.subscribe(yt.toggle,()=>{i.value=!p(i),p(i)&&s()}),u=n.subscribe(yt.close,()=>{i.value=!1,a.value=null}),l=n.subscribe(yt.open,()=>{i.value=!0,a.value=null,s()}),f=n.subscribe(yt.openWithPanel,w=>{i.value=!0,a.value=w,s()}),d=n.subscribe(yt.setActivePanel,w=>{a.value=w});jn(()=>{n.unsubscribe(yt.toggle,c),n.unsubscribe(yt.close,u),n.unsubscribe(yt.open,l),n.unsubscribe(yt.openWithPanel,f),n.unsubscribe(yt.setActivePanel,d)});const m=(w,b)=>{n.subscribe(yt.setActivePanel,T=>{w===T&&setTimeout(()=>{b(T)},100)})};return{isSideBarOpen:lr(i),sideBarActivePanel:lr(a),onPanelActive:m}},tr=e=>e,vb=e=>ee.ShareTypes.containsAnyValue(ee.ShareTypes.authenticated,e??[]),wb=e=>ee.ShareTypes.containsAnyValue(ee.ShareTypes.unauthenticated,e??[]),dF=({isDirect:e})=>tr(e?"This item is directly shared with others.":"This item is shared with others through one of the parent folders."),pF=({isDirect:e})=>tr(e?"This item is directly shared via links.":"This item is shared via links through one of the parent folders."),hF=({resource:e,isDirect:t})=>({id:`files-sharing-${e.getDomSelector()}`,accessibleDescription:dF({isDirect:t}),label:tr("Show invited people"),icon:"group",category:"sharing",type:t?"user-direct":"user-indirect",fillType:"line",handler:()=>{Xe.publish(yt.openWithPanel,"sharing#peopleShares")}}),gF=({resource:e,isDirect:t})=>({id:`file-link-${e.getDomSelector()}`,accessibleDescription:pF({isDirect:t}),label:tr("Show links"),icon:"link",category:"sharing",type:t?"link-direct":"link-indirect",fillType:"line",handler:()=>{Xe.publish(yt.openWithPanel,"sharing#linkShares")}}),mF=({resource:e})=>({id:`resource-locked-${e.getDomSelector()}`,accessibleDescription:tr("Item locked"),label:tr("This item is locked"),icon:"lock",category:"system",type:"resource-locked",fillType:"line"}),yF=({resource:e})=>({id:`resource-processing-${e.getDomSelector()}`,accessibleDescription:tr("Item in processing"),label:tr("This item is in processing"),icon:"loop-right",category:"system",type:"resource-processing",fillType:"line"}),Eo=({space:e,resource:t,ancestorMetaData:n,user:r})=>{const o=[];if(t.locked&&o.push(mF({resource:t})),t.processing&&o.push(yF({resource:t})),ee.isProjectSpaceResource(e)&&e.isMember(r)||ee.isPersonalSpaceResource(e)&&e.isOwner(r)){const s=Object.values(n).reduce((u,l)=>(u.push(...l.shareTypes||[]),u),[]),a=vb(t.shareTypes);(a||vb(s))&&o.push(hF({resource:t,isDirect:a}));const c=wb(t.shareTypes);(c||wb(s))&&o.push(gF({resource:t,isDirect:c}))}return o},Sb=e=>new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=o=>n(o),r.readAsArrayBuffer(e)}),Eb=e=>new Promise(t=>e.toBlob(t)),rt=He.defineStore("messages",()=>{const e=ae([]),t=i=>{const s={...i,id:Yt.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(a=>a!==null).map(a=>`X-Request-Id: ${a}`).join(`\r
51
+ `)};return{messages:e,showMessage:t,showErrorMessage:i=>{const s={id:Yt.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)}}}),To=He.defineStore("clipboard",()=>{const{$gettext:e}=Ne.useGettext(),{showMessage:t}=rt(),n=ae(),r=ae([]);return{action:n,resources:r,copyResources:a=>{a[0].canDownload()&&(n.value=ei.Copy,r.value=a,t({title:e("Copied to clipboard!"),status:"success"}))},cutResources:a=>{a[0].canDownload()&&(n.value=ei.Cut,r.value=a,t({title:e("Cut to clipboard!"),status:"success"}))},clearClipboard:()=>{n.value=void 0,r.value=[]}}}),Tb={cernFeatures:!1,concurrentRequests:{resourceBatchActions:4,shares:{create:4,list:2},sse: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=He.defineStore("config",()=>{const e=Zn(),t=ae(""),n=ae(""),r=ae({...Tb}),o=ae([]),i=ae([]),s=ae([]),a=ae(),c=ae(),u=ae(),l=ae([]),f=ae([]),d=j(()=>ee.urlJoin(p(t)||window.location.origin,{trailingSlash:!0})),m=j(()=>!!p(a)),w=j(()=>!!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:f,serverUrl:d,loadConfig:T=>{var v;T.server&&(t.value=(v=T.server)!=null&&v.endsWith("/")?T.server:T.server+"/"),o.value=T.apps||[],s.value=T.customTranslations||[],a.value=T.auth,c.value=T.openIdConnect,u.value=T.sentry,l.value=T.scripts||[],f.value=T.styles||[],n.value=T.theme,T.options&&(r.value=ao({...Tb},T.options),p(r).ocm.openRemotely=p(r).cernFeatures,p(r).routing.idBased=!p(r).cernFeatures,p(r).routing.fullShareOwnerPaths=p(r).cernFeatures),T.external_apps&&(i.value=T.external_apps,T.external_apps.filter(Boolean).forEach(g=>{e.loadExternalAppConfig({appId:g.id,config:g.config})}))}}}),bF=ye.z.object({url:ye.z.string()}),vF=ye.z.object({apiUrl:ye.z.string().optional(),authUrl:ye.z.string().optional(),clientId:ye.z.string().optional(),clientSecret:ye.z.string().optional(),logoutUrl:ye.z.string().optional(),metaDataUrl:ye.z.string().optional(),url:ye.z.string().optional()}),wF=ye.z.object({authority:ye.z.string().optional(),client_id:ye.z.string().optional(),client_secret:ye.z.string().optional(),dynamic:ye.z.string().optional(),metadata_url:ye.z.string().optional(),post_logout_redirect_uri:ye.z.string().optional(),response_type:ye.z.string().optional(),scope:ye.z.string().optional()}).passthrough(),SF=ye.z.record(ye.z.any()),EF=ye.z.object({href:ye.z.string().optional()}),TF=ye.z.object({async:ye.z.boolean().optional(),src:ye.z.string().optional()}),AF=ye.z.object({cernFeatures:ye.z.boolean().optional(),concurrentRequests:ye.z.object({resourceBatchActions:ye.z.number().optional(),sse:ye.z.number().optional(),shares:ye.z.object({create:ye.z.number().optional(),list:ye.z.number().optional()}).optional()}).optional(),contextHelpers:ye.z.boolean().optional(),contextHelpersReadMore:ye.z.boolean().optional(),defaultExtension:ye.z.string().optional(),disabledExtensions:ye.z.array(ye.z.string()).optional(),disableFeedbackLink:ye.z.boolean().optional(),accountEditLink:ye.z.object({href:ye.z.string().optional()}).optional(),editor:ye.z.object({autosaveEnabled:ye.z.boolean().optional(),autosaveInterval:ye.z.number().optional(),openAsPreview:ye.z.union([ye.z.boolean(),ye.z.array(ye.z.string())]).optional()}).optional(),embed:ye.z.object({enabled:ye.z.boolean().optional(),target:ye.z.string().optional(),messagesOrigin:ye.z.string().optional(),delegateAuthentication:ye.z.boolean().optional(),delegateAuthenticationOrigin:ye.z.string().optional(),fileTypes:ye.z.array(ye.z.string()).optional(),chooseFileName:ye.z.boolean().optional(),chooseFileNameSuggestion:ye.z.string().optional()}).optional(),feedbackLink:ye.z.object({ariaLabel:ye.z.string().optional(),description:ye.z.string().optional(),href:ye.z.string().optional()}).optional(),isRunningOnEos:ye.z.boolean().optional(),loginUrl:ye.z.string().optional(),logoutUrl:ye.z.string().optional(),ocm:ye.z.object({openRemotely:ye.z.boolean().optional()}).optional(),routing:ye.z.object({fullShareOwnerPaths:ye.z.boolean().optional(),idBased:ye.z.boolean().optional()}).optional(),runningOnEos:ye.z.boolean().optional(),tokenStorageLocal:ye.z.boolean().optional(),upload:ye.z.object({companionUrl:ye.z.string().optional()}).optional(),userListRequiresFilter:ye.z.boolean().optional(),hideLogo:ye.z.boolean().optional()}),RF=ye.z.object({id:ye.z.string(),path:ye.z.string(),config:ye.z.record(ye.z.unknown()).optional()}),_F=ye.z.object({server:ye.z.string(),theme:ye.z.string(),options:AF,apps:ye.z.array(ye.z.string()).optional(),external_apps:ye.z.array(RF).optional(),customTranslations:ye.z.array(bF).optional(),auth:vF.optional(),openIdConnect:wF.optional(),sentry:SF.optional(),scripts:ye.z.array(TF).optional(),styles:ye.z.array(EF).optional()}),Ab=He.defineStore("extensionPreferences",()=>{const e=Mr.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}}}),Ni=He.defineStore("extensionRegistry",()=>{const e=st(),t=ae([]),n=u=>{t.value.push(u)},r=u=>{t.value=p(t).map(l=>ae(p(l).filter(({id:f})=>!u.includes(f)))).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(f=>{var d;return f.type===u.extensionType&&!e.options.disabledExtensions.includes(f.id)&&(!f.extensionPointIds||((d=f.extensionPointIds)==null?void 0:d.includes(u.id)))}))},i=ae([]);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=>ae(p(l).filter(({id:f})=>!u.includes(f)))).filter(l=>p(l).length)},getExtensionPoints:(u={})=>p(i).flatMap(l=>p(l).filter(f=>!(Object.hasOwn(u,"extensionType")&&f.extensionType!==u.extensionType)))}}),bt=He.defineStore("modals",()=>{const e=ae([]),t=j(()=>p(e).at(-1)),n=c=>p(e).find(u=>u.id===c);return{modals:e,activeModal:t,dispatchModal:c=>{const u={...c,id:Yt.v4()};return e.value.push(u),u},updateModal:(c,u,l)=>{const f=n(c);f[u]=l},removeModal:c=>{e.value=p(e).filter(u=>u.id!==c)},removeAllModals:()=>{e.value=[]},setModalActive:c=>{const u=p(e).findIndex(f=>f.id===c);if(u<0)return;const l=n(c);p(e).splice(u,1),e.value.push(l)}}}),vt=He.defineStore("user",()=>{const e=ae();return{user:e,setUser:r=>{e.value=r,N0.setUser({username:r.onPremisesSamAccountName})},reset:()=>{e.value=null}}}),Vs=(e,t)=>{t!==void 0&&document.querySelector(":root").style.setProperty("--oc-"+e,t)},IF="thead-clicked",CF="highlight",FF="rowMounted",PF="contextmenuClicked",Rb="itemDropped",OF="itemDragged",xF=["xsmall","small","medium","large","xlarge","xxlarge","xxxlarge"],kF={xxxsmall:"xxxs",xxsmall:"xxs",xsmall:"xs",small:"s",medium:"m",large:"l",xlarge:"xl",xxlarge:"xxl",xxxlarge:"xxxl",remove:"rm"};function ri(e){return kF[e]}function NF(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 $F(e){return function(t){return e==null?void 0:e[t]}}var DF={À:"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"},LF=$F(DF),MF=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,BF="\\u0300-\\u036f",jF="\\ufe20-\\ufe2f",UF="\\u20d0-\\u20ff",qF=BF+jF+UF,VF="["+qF+"]",zF=RegExp(VF,"g");function WF(e){return e=Al(e),e&&e.replace(MF,LF).replace(zF,"")}var HF=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function GF(e){return e.match(HF)||[]}var KF=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function QF(e){return KF.test(e)}var _b="\\ud800-\\udfff",XF="\\u0300-\\u036f",YF="\\ufe20-\\ufe2f",JF="\\u20d0-\\u20ff",ZF=XF+YF+JF,Ib="\\u2700-\\u27bf",Cb="a-z\\xdf-\\xf6\\xf8-\\xff",eP="\\xac\\xb1\\xd7\\xf7",tP="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",nP="\\u2000-\\u206f",rP=" \\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",Fb="A-Z\\xc0-\\xd6\\xd8-\\xde",iP="\\ufe0e\\ufe0f",Pb=eP+tP+nP+rP,Ob="['’]",xb="["+Pb+"]",oP="["+ZF+"]",kb="\\d+",sP="["+Ib+"]",Nb="["+Cb+"]",$b="[^"+_b+Pb+kb+Ib+Cb+Fb+"]",aP="\\ud83c[\\udffb-\\udfff]",lP="(?:"+oP+"|"+aP+")",cP="[^"+_b+"]",Db="(?:\\ud83c[\\udde6-\\uddff]){2}",Lb="[\\ud800-\\udbff][\\udc00-\\udfff]",$i="["+Fb+"]",uP="\\u200d",Mb="(?:"+Nb+"|"+$b+")",fP="(?:"+$i+"|"+$b+")",Bb="(?:"+Ob+"(?:d|ll|m|re|s|t|ve))?",jb="(?:"+Ob+"(?:D|LL|M|RE|S|T|VE))?",Ub=lP+"?",qb="["+iP+"]?",dP="(?:"+uP+"(?:"+[cP,Db,Lb].join("|")+")"+qb+Ub+")*",pP="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",hP="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",gP=qb+Ub+dP,mP="(?:"+[sP,Db,Lb].join("|")+")"+gP,yP=RegExp([$i+"?"+Nb+"+"+Bb+"(?="+[xb,$i,"$"].join("|")+")",fP+"+"+jb+"(?="+[xb,$i+Mb,"$"].join("|")+")",$i+"?"+Mb+"+"+Bb,$i+"+"+jb,hP,pP,kb,mP].join("|"),"g");function bP(e){return e.match(yP)||[]}function vP(e,t,n){return e=Al(e),t=t,t===void 0?QF(e)?bP(e):GF(e):e.match(t)||[]}var wP="['’]",SP=RegExp(wP,"g");function EP(e){return function(t){return NF(vP(WF(t).replace(SP,"")),e,"")}}var Vb=EP(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const zb=ye.z.object({name:ye.z.string().optional(),slogan:ye.z.string().optional(),logo:ye.z.string().optional(),urls:ye.z.object({accessDeniedHelp:ye.z.string(),imprint:ye.z.string(),privacy:ye.z.string()}).optional(),shareRoles:ye.z.record(ye.z.string(),ye.z.object({iconName:ye.z.string()})).optional()}),TP=ye.z.object({breakpoints:ye.z.record(ye.z.string()).optional(),roles:ye.z.record(ye.z.string()).optional(),colorPalette:ye.z.record(ye.z.string()).optional(),fontFamily:ye.z.string().optional(),fontSizes:ye.z.record(ye.z.string()).optional(),sizes:ye.z.record(ye.z.string()).optional(),spacing:ye.z.record(ye.z.string()).optional()}),Wb=zb.extend({designTokens:TP.optional(),favicon:ye.z.string().optional(),background:ye.z.string().optional()}),AP=Wb.extend({isDark:ye.z.boolean(),label:ye.z.string()}),Hb=ye.z.object({defaults:Wb,themes:ye.z.array(AP)}),RP=ye.z.object({common:zb.optional(),clients:ye.z.object({web:Hb})}),_P="oc_currentThemeName",ii=He.defineStore("theme",()=>{const e=Mr.useLocalStorage(_P,null),t=Mr.usePreferredDark(),n=ae(),r=ae([]),o=l=>{const f=ed(l.common,l.clients.web.defaults);r.value=l.clients.web.themes.map(d=>ed(f,d)),i()},i=()=>{const l=p(r).find(d=>!d.isDark),f=p(r).find(d=>d.isDark);c(p(r).find(d=>d.label===p(e))||(p(t)?f:l)||p(r)[0],!1)},s=()=>{e.value=null,i()},a=j(()=>e.value===null),c=(l,f=!0)=>{var m,w,b,T,v,g;n.value=l,f&&(e.value=p(n).label);const d=[{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"}];Vs("font-family",p(n).designTokens.fontFamily),d.forEach(h=>{for(const y in p(n).designTokens[h.name])Vs(`${h.prefix}-${Vb(y)}`,p(n).designTokens[h.name][y])}),(w=(m=p(n).designTokens)==null?void 0:m.roles)!=null&&w.chrome||(Vs("role-chrome",(T=(b=p(n).designTokens)==null?void 0:b.roles)==null?void 0:T.surfaceContainer),Vs("role-on-chrome",(g=(v=p(n).designTokens)==null?void 0:v.roles)==null?void 0:g.onSurface))};return{availableThemes:r,currentTheme:n,initializeThemes:o,setAndApplyTheme:c,setAutoSystemTheme:s,isCurrentThemeAutoSystem:a,getRoleIcon:l=>{var f;return((f=p(n).shareRoles[l.id])==null?void 0:f.iconName)||"user"}}}),jt=He.defineStore("shares",()=>{const e=Ke(),{getRoleIcon:t}=ii(),n=ae(!1),r=ae([]),o=ae([]),i=ae({}),s=I=>{i.value=I.reduce((A,$)=>(A[$.id]={...$,icon:t($)},A),{})},a=I=>{const A=p(r).find(({id:$})=>$===I.id);if(A){Object.assign(A,I);return}p(r).push(I)},c=I=>{r.value=I},u=I=>{p(r).push(...I)},l=I=>{r.value=p(r).filter(({id:A})=>A!==I.id)},f=()=>{r.value=[],o.value=[],n.value=void 0},d=()=>{const I=Object.values(e.ancestorMetaData).map(({id:A})=>A);if(!I.length){r.value=[],o.value=[];return}p(r).forEach(A=>{I.includes(A.resourceId)||l(A)}),p(o).forEach(A=>{I.includes(A.resourceId)||b(A)})},m=I=>{o.value=I},w=I=>{const A=p(o).find(({id:$})=>$===I.id);if(A){Object.assign(A,I);return}p(o).push(I)},b=I=>{o.value=p(o).filter(({id:A})=>A!==I.id)},T=I=>{n.value=I},v=I=>{const A=N=>{const z=new Set;return N.forEach(G=>{z.add(G.shareType)}),Array.from(z)},$=[...e.resources,e.currentFolder].find(N=>(N==null?void 0:N.id)===I);if(!$||ee.isProjectSpaceResource($))return;const D=[...p(r),...p(o)];e.updateResourceField({id:$.id,field:"shareTypes",value:A(D.filter(N=>!N.indirect))});const k=e.getAncestorById(I);k&&e.updateAncestorField({path:k.path,field:"shareTypes",value:A(D.filter(N=>!N.indirect))})};return{loading:n,collaboratorShares:r,linkShares:o,graphRoles:i,setGraphRoles:s,setLoading:T,setCollaboratorShares:c,setLinkShares:m,removeOrphanedShares:d,pruneShares:f,addShare:async({clientService:I,space:A,resource:$,options:D})=>{const N=await I.graphAuthenticated.permissions.createInvite(A.id,$.id,D,p(i));return u([N]),v($.id),e.loadIndicators(A,$.id),N},updateShare:async({clientService:I,space:A,resource:$,collaboratorShare:D,options:k})=>{const N=I.graphAuthenticated.permissions,z={roles:k.roles,expirationDateTime:k.expirationDateTime},G=await N.updatePermission(A.id,$.id,D.id,z,p(i));return a(G),G},deleteShare:async({clientService:I,space:A,resource:$,collaboratorShare:D,loadIndicators:k=!1})=>{await I.graphAuthenticated.permissions.deletePermission(A.id,$.id,D.id),l(D),v($.id),k&&e.loadIndicators(A,$.id)},addLink:async({clientService:I,space:A,resource:$,options:D})=>{const N=await I.graphAuthenticated.permissions.createLink(A.id,$.id,D),z=e.selectedResources,G=z.some(({fileId:X})=>X===$.fileId)||z.length===0&&e.currentFolder.fileId===$.fileId;if(w(N),v($.id),!G){const X=e.ancestorMetaData[$.path]??null;if(X){const{shareTypes:se}=X;se.includes(ee.ShareTypes.link.value)||e.updateAncestorField({path:X.path,field:"shareTypes",value:[...se,ee.ShareTypes.link.value]})}}return e.loadIndicators(A,$.id),N},updateLink:async({clientService:I,space:A,resource:$,linkShare:D,options:k})=>{const N=I.graphAuthenticated.permissions;let z;if(Object.hasOwn(k,"password"))z=await N.setPermissionPassword(A.id,$.id,D.id,{password:k.password}),D.hasPassword=!!k.password;else{const G={link:{...k.type&&{type:k.type},...k.displayName&&{"@libre.graph.displayName":k.displayName}},...Object.hasOwn(k,"expirationDateTime")&&{expirationDateTime:k.expirationDateTime}};z=await N.updatePermission(A.id,$.id,D.id,G)}return w(z),z},deleteLink:async({clientService:I,space:A,resource:$,linkShare:D,loadIndicators:k=!1})=>{await I.graphAuthenticated.permissions.deletePermission(A.id,$.id,D.id),b(D),v($.id),k&&e.loadIndicators(A,$.id)}}}),Gb=e=>e.sort((t,n)=>n.permissions.length-t.permissions.length),Ao=async({graphClient:e,driveType:t,configStore:n,graphRoles:r,signal:o})=>{var c;const i=await e.drives.listMyDrives(r,{orderBy:"name asc",filter:`driveType eq ${t}`},{signal:o});if(!i.length)return[];if(t!=="mountpoint"||!((c=n.options.routing)!=null&&c.fullShareOwnerPaths))return i;const s={};i.forEach(u=>{const{rootId:l,driveAlias:f}=u.root.remoteItem;s[l]=f});const a=Object.entries(s).map(([u,l])=>ee.buildSpace({id:ee.extractStorageId(u),name:l,driveType:l.split("/")[0],driveAlias:l,path:"/",serverUrl:n.serverUrl},r));return[...i,...a]},lt=He.defineStore("spaces",()=>{const e=vt(),t=st(),n=jt(),r=ae([]),o=ae(),i=ae(!1),s=ae(!1),a=ae(!1),c=ae(null),u=ae([]),l=ae([]),f=j(()=>p(r).find(ne=>ee.isPersonalSpaceResource(ne)&&ne.isOwner(e.user))),d=ne=>{i.value=ne},m=ne=>{s.value=ne},w=ne=>{a.value=ne},b=ne=>{o.value=ne},T=ne=>{c.value=ne},v=ne=>{if(!ee.isProjectSpaceResource(ne))return[];const oe=n.collaboratorShares.filter(fe=>fe.resourceId===ne.id);return Gb(oe)},g=ne=>{p(r).push(...ne)},h=ne=>{r.value=p(r).filter(({id:oe})=>oe!==ne.id)},y=ne=>p(r).find(oe=>ne==oe.id),S=async({graphClient:ne,space:oe,signal:fe})=>(await $({graphClient:ne,signal:fe}),p(r).find(we=>{var Z,re;return ee.isMountPointSpaceResource(we)&&((re=(Z=we.root)==null?void 0:Z.remoteItem)==null?void 0:re.id)===oe.id})),E=({driveAliasPrefix:ne,id:oe,shareName:fe})=>{const we=ee.buildShareSpaceResource({driveAliasPrefix:ne,id:oe,shareName:fe,serverUrl:t.serverUrl});return g([we]),we},R=ne=>{const oe=p(r).find(({id:fe})=>fe===ne.id);if(oe){Object.assign(oe,ne);return}g([ne])},I=({id:ne,field:oe,value:fe})=>{const we=p(r).find(Z=>ne===Z.id);we&&(we[oe]=fe)},A=async({graphClient:ne})=>{a.value=!0;try{const[oe,fe]=await Promise.all([Ao({graphClient:ne,driveType:"personal",configStore:t,graphRoles:n.graphRoles}),Ao({graphClient:ne,driveType:"project",configStore:t,graphRoles:n.graphRoles})]);g([...oe,...fe]),i.value=!0}finally{a.value=!1}},$=async({graphClient:ne,signal:oe})=>{if(!p(s))try{const fe=await Ao({graphClient:ne,driveType:"mountpoint",configStore:t,graphRoles:n.graphRoles,signal:oe});g(fe)}finally{s.value=!0}};return{spaces:r,spacesInitialized:i,mountPointsInitialized:s,spacesLoading:a,currentSpace:o,personalSpace:f,defaultSpaceImageBlobURL:c,imagesLoading:u,readmesLoading:l,getSpace:y,createShareSpace:E,setSpacesInitialized:d,setMountPointsInitialized:m,setSpacesLoading:w,setCurrentSpace:b,setDefaultSpaceImageBlobURL:T,getSpaceMembers:v,getMountPointForSpace:S,addSpaces:g,removeSpace:h,upsertSpace:R,updateSpaceField:I,loadSpaces:A,loadMountPoints:$,reloadProjectSpaces:async({graphClient:ne,signal:oe})=>{const fe=await Ao({graphClient:ne,driveType:"project",configStore:t,graphRoles:n.graphRoles,signal:oe});r.value=p(r).filter(we=>!ee.isProjectSpaceResource(we)),g(fe)},addToImagesLoading:ne=>{p(u).includes(ne)||p(u).push(ne)},removeFromImagesLoading:ne=>{u.value=p(u).filter(oe=>oe!==ne)},purgeImagesLoading:()=>{u.value=[]},addToReadmesLoading:ne=>{p(l).includes(ne)||p(l).push(ne)},removeFromReadmesLoading:ne=>{l.value=p(l).filter(oe=>oe!==ne)},purgeReadmesLoading:()=>{l.value=[]}}}),Ke=He.defineStore("resources",()=>{const e=st(),t=lt(),n=vt(),r=ae([]),o=ae(),i=ae({}),s=ae([]),a=j(()=>{let _=p(r);return p(k)||(_=_.filter(P=>!P.name.startsWith("."))),_}),c=j(()=>{const _=p(r).filter(({type:q})=>q==="file").length,P=p(r).filter(({type:q,name:ue})=>q==="file"&&ue.startsWith(".")).length,K=p(r).filter(({type:q})=>q==="folder").length,V=p(r).filter(({type:q,name:ue})=>q==="folder"&&ue.startsWith(".")).length,B=p(r).filter(ee.isProjectSpaceResource).length;return{files:_,hiddenFiles:P,folders:K,hiddenFolders:V,spaces:B}}),u=_=>{r.value=_},l=_=>{r.value=p(r).filter(P=>!_.find(({id:K})=>K===P.id))},f=()=>{r.value=[]},d=_=>{const P=p(r).find(({id:K})=>K===_.id);if(P){Object.assign(P,_);return}p(r).push(_)},m=_=>{const P=p(r).filter(K=>!_.some(V=>V.path===K.path));r.value=[...P,..._]},w=({id:_,field:P,value:K})=>{const V=p(r).find(B=>_===B.id);V&&(V[P]=K)},b=_=>{o.value=_},T=()=>{o.value=void 0},v=_=>{r.value=_.resources,o.value=_.currentFolder},g=()=>{r.value=[],o.value=void 0,h.value=[]},h=ae([]),y=ae(null),S=j(()=>p(r).filter(_=>p(h).includes(_.id))),E=_=>{const P=_.find(K=>!p(h).includes(K));P&&(y.value=P),h.value=_},R=_=>{y.value=_,p(h).includes(_)||p(h).push(_)},I=_=>{y.value=_,p(h).includes(_)&&(h.value=p(h).filter(P=>P!==_))},A=_=>{p(h).includes(_)?I(_):R(_)},$=()=>{h.value=[]},D=_=>{y.value=_},k=ae(!0),N=ae(!0),z=ae(!1),G=ae(!0),X=_=>{k.value=_,window.localStorage.setItem("oc_hiddenFilesShown",_.toString())},se=_=>{N.value=_,window.localStorage.setItem("oc_fileExtensionsShown",_.toString())},ne=_=>{z.value=_,window.localStorage.setItem("oc_webDavDetailsShown",_.toString())},oe=_=>{G.value=_,window.localStorage.setItem("oc_disabledSpacesShown",_.toString())},fe=(_,P)=>{const K=p(r).filter(V=>[V.id,V.parentFolderId].includes(P));for(const V of K){const B=Eo({space:_,resource:V,ancestorMetaData:p(i),user:n.user});!B.length&&!V.indicators.length||w({id:V.id,field:"indicators",value:B})}},we=_=>{i.value=_};return{resources:r,currentFolder:o,activeResources:a,totalResourcesCount:c,setResources:u,removeResources:l,clearResources:f,upsertResource:d,upsertResources:m,updateResourceField:w,setCurrentFolder:b,clearCurrentFolder:T,initResourceList:v,clearResourceList:g,selectedIds:h,latestSelectedId:y,selectedResources:S,setSelection:E,addSelection:R,removeSelection:I,toggleSelection:A,resetSelection:$,setLastSelectedId:D,areHiddenFilesShown:k,areFileExtensionsShown:N,areWebDavDetailsShown:z,areDisabledSpacesShown:G,setAreHiddenFilesShown:X,setAreFileExtensionsShown:se,setAreWebDavDetailsShown:ne,setAreDisabledSpacesShown:oe,loadIndicators:fe,ancestorMetaData:i,setAncestorMetaData:we,updateAncestorField:({path:_,field:P,value:K})=>{const V=p(i)[_]??null;V&&(V[P]=K)},loadAncestorMetaData:({folder:_,space:P,client:K,signal:V})=>{const B={[_.path]:{id:_.fileId,shareTypes:_.shareTypes,parentFolderId:_.parentFolderId,spaceId:P.id,path:_.path}},q=[],ue=[qe.FileId,qe.ShareTypes,qe.FileParent],Re=yb(_.path),Le=t.spaces,ke=()=>Le.filter(Be=>ee.isMountPointSpaceResource(Be)&&ee.extractStorageId(Be.root.remoteItem.rootId)===P.id);let Fe=!0;if(e.options.routing.fullShareOwnerPaths){const Be=Le.find(ge=>ee.isProjectSpaceResource(ge)&&ge.id===P.id);Fe=P.isOwner(n.user)||(Be==null?void 0:Be.isMember(n.user))}for(const Be of Re){const ge=p(i)[Be]??null;if((ge==null?void 0:ge.spaceId)===P.id){B[Be]=ge;continue}if(!Fe&&!ke().find(le=>Be.startsWith(le.root.remoteItem.path)))break;q.push(K.listFiles(P,{path:Be},{depth:0,davProperties:ue,signal:V}).then(({resource:le})=>{B[Be]={id:le.fileId,shareTypes:le.shareTypes,parentFolderId:le.parentFolderId,spaceId:P.id,path:Be}}))}return Promise.all(q).then(()=>{if(!Object.keys(B).includes("/")){const Be=p(i)["/"];if((Be==null?void 0:Be.spaceId)===P.id)B["/"]=Be;else{const{parentFolderId:ge}=Object.values(B)[0],le=t.spaces.find(({id:$e})=>ge.startsWith($e));le&&(B["/"]={id:le.id,shareTypes:le.shareTypes,parentFolderId:le.id,spaceId:le.id,path:"/"})}}we(B)})},getAncestorById:_=>Object.values(p(i)).find(P=>_===P.id),deleteQueue:s,addResourcesIntoDeleteQueue:_=>{s.value=s.value.concat(_.filter(P=>!p(s).includes(P)))},removeResourcesFromDeleteQueue:_=>{s.value=s.value.filter(P=>!_.includes(P))}}}),Ro=He.defineStore("webWorkers",()=>{const e=ae([]);return{createWorker:(i,{needsTokenRenewal:s=!1}={})=>{const a=Yt.v4(),c=Mr.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}`}}))})}}}),zs=(e={})=>{const t=e.router||ze(),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=Jn(o,i,{configStore:n});return t.replace(c),!0}}},Ws=()=>{const e=en();return j(()=>p(e).name)},Kb=(e,t)=>{const n=en();return j(()=>p(n).meta[e]||t)},Hs=(e,t)=>{const n=ze();return j({get(){return St(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 Qb=Promise.resolve();const on=(e,t)=>{const n=ze();return j({get(){return p(n.currentRoute).query[e]||t},set(r){if(p(n.currentRoute).query[e]===r)return;Qb=Qb.then(async()=>{try{await n.replace({path:p(n.currentRoute).path,query:{...p(n.currentRoute).query,[e]:r}})}catch{}})}})},wr=e=>{const t=on(e.name),n=pf(IP(e));return Tt(()=>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:St(r.value)),["storage","default"].includes(r.source)&&(t.value=r.value)},{immediate:!0}),t},IP=e=>["oc-options",e.storagePrefix,e.name].filter(Boolean).join("_"),Sr=(e,...t)=>{const n=ae(!1),r=ze(),o=en();return Tt(o,()=>{n.value=e(r,...t)},{immediate:!0}),n},Gs="contextRouteName",hf="contextRouteParams",gf="contextRouteQuery",Ks=e=>{var i;const{params:t,query:n}=e,r={},o=["fileId","shareId","q_share-visibility"].concat(((i=e.meta)==null?void 0:i.contextQueryItems)||[]);for(const s of o)r[s]=n[s];return{[Gs]:e.name,[hf]:t,[gf]:r}},Xb=e=>({routeName:St(e[Gs]),routeParams:e[hf],routeQuery:e[gf]}),St=e=>Array.isArray(e)?e[0].toString():e==null?void 0:e.toString();function Yb({router:e,currentFileContext:t}){const n=a=>{const{fileName:c,routeName:u,routeParams:l,routeQuery:f}=p(a);return p(u)?e.push({name:p(u),params:p(l),query:{...p(f),scrollTo:p(c)}}):e.push({path:"/"})},{replaceInvalidFileRoute:r}=zs({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=ae(!1);return{replaceInvalidFileRoute:o,closeApp:()=>(i.value=!0,n(t)),closed:i}}const Ye=()=>mr("$clientService");function mf({clientService:e}){e=e||Ye();const t=rn(),n=vt();return{getUrlForResource:(c,u,l)=>{var f;return e.webdav.getFileUrl(c,u,{isUrlSigningEnabled:t.supportUrlSigning,username:(f=n.user)==null?void 0:f.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 yf=()=>mr("$authService");class Er{}Ee(Er,"allFiles","all-files"),Ee(Er,"currentFolder","current-folder");const bf=()=>{const e=st(),t=Ye(),n=lt(),r=Ke(),o=rn(),i=j(()=>{var d;return(d=o.searchContent)==null?void 0:d.enabled}),s=j(()=>r.areHiddenFilesShown),a=j(()=>n.spaces.filter(ee.isProjectSpaceResource)),c=d=>p(a).find(m=>m.id===d),u=un.useTask(function*(d,m,w=null){if(e.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:t.graphAuthenticated,signal:d})),!m)return{totalResults:null,values:[]};const{resources:b,totalResults:T}=yield*ee.call(t.webdav.search(m,{searchLimit:w,davProperties:vs.Default,signal:d}));return{totalResults:T,values:b.map(v=>{const g=c(v.parentFolderId),h=g||v;return e.options.routing.fullShareOwnerPaths&&h.remoteItemPath&&(h.path=ee.urlJoin(h.remoteItemPath,h.path)),{id:h.id,data:h}}).filter(({data:v})=>!v.name.startsWith(".")||p(s))}}).restartable();return{search:async(d,m=null)=>await u.perform(d,m),buildSearchTerm:({term:d,isTitleOnlySearch:m,tags:w,lastModified:b,mediaType:T,scope:v,useScope:g})=>{const h=[],y=d,S=p(i)&&!m;if(y){let E=`name:"*${y}*"`;S&&(E=`(name:"*${y}*" OR content:"${y}")`),h.push(E)}if(g&&v&&h.push(`scope:${v}`),w){const E=w.split("+").map(R=>`"${R}"`);h.push(`tag:(${E.join(" OR ")})`)}if(b&&h.push(`mtime:${b}`),T){const E=T.split("+").map(R=>`"${R}"`);h.push(`mediatype:(${E.join(" OR ")})`)}return h.sort((E,R)=>Number(E.startsWith("scope:"))-Number(R.startsWith("scope:"))).join(" AND ")}}};function Jb({currentRoute:e,clientService:t}){const n=ae(!1),{webdav:r}=t,{replaceInvalidFileRoute:o}=zs(),{getFileInfo:i}=mf({clientService:t}),s=yf(),a=lt(),{buildSearchTerm:c,search:u}=bf(),l=on("contextRouteQuery"),f=Ke(),{activeResources:d}=He.storeToRefs(f);return{isFolderLoading:n,loadFolderForFileContext:async w=>{var b,T;n.value=!0;try{if(w=p(w),(b=p(l))!=null&&b.term){const I=c({term:(T=p(l))==null?void 0:T.term}),{values:A}=await u(I,200),$=A.filter(({data:D})=>ee.isSearchResource(D)).map(D=>D.data);f.initResourceList({currentFolder:null,resources:$}),n.value=!1;return}if(["files-shares-with-me","files-shares-with-others","files-shares-via-link","files-common-favorites"].includes(p(w.routeName))){await Vy.getTask().perform(),n.value=!1;return}f.clearResourceList();const g=p(w.space),h=await i(w,{davProperties:[qe.FileId]});if(o({space:g,resource:h,path:p(w.item),fileId:p(w.itemId)}),a.spaces.some(I=>{var A;return ee.isMountPointSpaceResource(I)&&((A=I.root.remoteItem)==null?void 0:A.id)===h.id})){const I=await i(w);f.initResourceList({currentFolder:I,resources:[I]}),n.value=!1;return}const S=gt.dirname(h.path),{resource:E,children:R}=await r.listFiles(g,{path:S});E.type==="file"?f.initResourceList({currentFolder:E,resources:[E]}):f.initResourceList({currentFolder:E,resources:R})}catch(v){if(v.statusCode===401)return s.handleAuthError(p(e));f.setCurrentFolder(null),console.error(v)}n.value=!1},activeFiles:d}}function vf({appsStore:e,applicationId:t}){return{applicationMeta:j(()=>{const r=e.apps[t];if(!r)throw new Error(`useAppConfig: could not find config for applicationId: ${t}`);return r||{}})}}const _o=()=>Xe;function Zb({titleSegments:e,eventBus:t}){const n=ii(),{currentTheme:r}=He.storeToRefs(n);t=t||_o(),Tt(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 CP({appsStore:e,applicationId:t,applicationName:n,currentFileContext:r,currentRoute:o}){const i=vf({applicationId:t,appsStore:e}),{$gettext:s}=Ne.useGettext(),a=j(()=>{var l,f,d;const c=gt.basename(p((l=p(r))==null?void 0:l.fileName))||s(((d=(f=p(o))==null?void 0:f.meta)==null?void 0:d.title)||""),u=p(p(i).applicationMeta);return[c,p(n)||u.name||u.id].filter(Boolean)});Zb({titleSegments:a})}function ev(e={}){const t=e.clientService??Ye(),n=e.authStore??Xr();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 "+yr.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 tv=()=>{const e=lt();return{areSpacesLoading:j(()=>!e.spacesInitialized||e.spacesLoading)}},nv=(e={})=>{const t=lt(),{areSpacesLoading:n}=tv(),r=on("shareId"),o=on("fileId"),i=j(()=>St(p(o))),s=st(),a=Ye(),c=j(()=>t.spaces),u=ae(null),l=ae(null),f=ae(!1),d=m=>{const w=m.split("/");return p(c).find(b=>{if(!m.startsWith(b.driveAlias))return!1;const T=b.driveAlias.split("/");return w.length<T.length||w.slice(0,T.length).join("/")!==b.driveAlias?!1:b})};return ja(()=>{const m=p(e.driveAliasAndItem);!(m!=null&&m.startsWith("personal/"))&&!(m!=null&&m.startsWith("project/"))&&t.setCurrentSpace(null)}),Tt([e.driveAliasAndItem,n],async([m,w],[b,T])=>{if(m===b&&w===T)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,h=null;if(m.startsWith("public/")||m.startsWith("ocm/")){const[y,...S]=m.split("/").slice(1);g=p(c).find(E=>E.id===y),h=S.join("/")}else if(m.startsWith("share/")||m.startsWith("ocm-share/")){const[y,...S]=m.split("/").slice(1),E=m.startsWith("ocm-share/")?"ocm-share":"share";let R=St(p(r));R!=null&&R.includes(":")&&(R=[ee.SHARE_JAIL_ID,R].join("!")),g=t.getSpace(R)||t.createShareSpace({driveAliasPrefix:E,id:R,shareName:p(y)}),h=S.join("/")}else p(i)?g=p(c).find(y=>p(i).startsWith(`${y.fileId}`)):g=d(m),g||(!t.mountPointsInitialized&&s.options.routing.fullShareOwnerPaths&&(f.value=!0,await t.loadMountPoints({graphClient:a.graphAuthenticated})),g=d(m)),g&&(h=m.slice(g.driveAlias.length));u.value=g,l.value=ee.urlJoin(h,{leadingSlash:!0}),f.value=!1},{immediate:!0,deep:!0}),Tt(u,m=>{t.setCurrentSpace(m)},{immediate:!0}),{space:u,item:l,itemId:i,loading:f}};function rv(e){const t=ze(),n=Zn(),r=en(),o=e.clientService??Ye(),i=e.applicationId,s=Xr(),{publicLinkContextReady:a}=He.storeToRefs(s),c=Hs("driveAliasAndItem"),{space:u,item:l,itemId:f,loading:d}=nv({driveAliasAndItem:c}),m=j(()=>{if(p(d))return null;let w;return p(u)?w=ee.urlJoin(p(u).webDavPath,p(l)):w=ee.urlJoin(St(p(r).params.filePath)),{path:w,driveAliasAndItem:p(c),space:p(u),item:p(l),itemId:p(f),fileName:gt.basename(w),routeName:St(p(r).query[Gs]),...Xb(p(r).query)}});return CP({appsStore:n,applicationId:i,applicationName:e.applicationName,currentFileContext:m,currentRoute:r}),{isPublicLinkContext:a,currentFileContext:m,...oh({appsStore:n,...e}),...Yb({router:t,currentFileContext:m}),...mf({clientService:o}),...Jb({clientService:o,currentRoute:r}),...ev({clientService:o,currentRoute:p(r)})}}const FP=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}}),PP=()=>[{path:"/list",redirect:e=>xn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:"personal/home"}})},{path:"/list/all/:item(.*)",redirect:e=>xn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:ee.urlJoin("personal/home",St(e.params.item),{leadingSlash:!1})}})},{path:"/list/favorites",redirect:e=>Ti("files-common-favorites",e)},{path:"/list/shared-with-me",redirect:e=>kn("files-shares-with-me",e)},{path:"/list/shared-with-others",redirect:e=>kn("files-shares-with-others",e)},{path:"/list/shared-via-link",redirect:e=>kn("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(FP),OP=(e,...t)=>{const[n,...r]=t.map(o=>{const i={"files-personal":xn("files-spaces-generic").name,"files-favorites":Ti("files-common-favorites").name,"files-shared-with-others":kn("files-shares-with-others").name,"files-shared-with-me":kn("files-shares-with-me").name,"files-trashbin ":Ri("files-trash-generic").name,"files-public-list":Ai("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 gl(e,n,...r)},xP={name:"root",path:"/",redirect:e=>xn("files-spaces-generic",e)},kP=e=>[xP,...iT(e),...aT(e),...lT(e),...oT(e),...cT(e),...PP()],oi=()=>{const{$gettext:e}=Ne.useGettext(),t=Ye();return{checkSpaceNameModalInput:(o,i)=>o.trim()===""?i(e("Space name cannot be empty")):o.length>255?i(e("Space name cannot exceed 255 characters")):/[/\\.:?*"><|]/.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")}}},ln=e=>{const t=vt(),n=lt(),r=st(),o=j(()=>n.spaces),i=Hs("driveAliasAndItem"),s=f=>p(e==null?void 0:e.space)||p(o).find(d=>d.id===f),a=f=>{var T,v,g,h,y;let d=f.storageId;((T=p(i))!=null&&T.startsWith("public/")||(v=p(i))!=null&&v.startsWith("ocm/"))&&(d=p(i).split("/")[1]);const m=s(d);if(m&&!ee.isMountPointSpaceResource(m))return m;const w=ee.isShareResource(f)&&f.shareTypes.includes(ee.ShareTypes.remote.value)||(g=f==null?void 0:f.id)!=null&&g.toString().startsWith(ee.OCM_PROVIDER_ID)?"ocm-share":"share";let b;return f.remoteItemPath?b=gt.basename(f.remoteItemPath):(h=p(i))!=null&&h.startsWith("share/")||(y=p(i))!=null&&y.startsWith("ocm-share/")?b=p(i).split("/")[1]:b=f.name,n.getSpace(f.remoteItemId)||n.createShareSpace({driveAliasPrefix:w,id:f.remoteItemId,shareName:b})},c=f=>p(o).filter(d=>ee.isMountPointSpaceResource(d)&&ee.extractStorageId(d.root.remoteItem.rootId)===f.id);return{getInternalSpace:s,getMatchingSpace:a,isPersonalSpaceRoot:f=>{var d;return(f==null?void 0:f.storageId)&&(f==null?void 0:f.storageId)===((d=n.personalSpace)==null?void 0:d.storageId)&&(f==null?void 0:f.path)==="/"},isResourceAccessible:({space:f,path:d})=>{if(!r.options.routing.fullShareOwnerPaths)return!0;const m=p(o).find(b=>ee.isProjectSpaceResource(b)&&b.id===f.id);return f.isOwner(t.user)||(m==null?void 0:m.isMember(t.user))||c(f).some(b=>d.startsWith(b.root.remoteItem.path))}}},Di=()=>{const e=Ye(),t=Ke(),n=jt();return{createSpace:i=>{const{graphAuthenticated:s}=e;return s.drives.createDrive({name:i},n.graphRoles,{params:{template:"default"}})},createDefaultMetaFolder:async i=>{var a;const s=await e.webdav.createFolder(i,{path:".space"});return ee.extractStorageId(s.parentFolderId)===((a=t.currentFolder)==null?void 0:a.id)&&t.upsertResource(s),s}}},cn=()=>mr("$loadingService"),Qs=()=>{const e=Xr(),t=Ye(),n=Ne.useGettext();return{headers:j(()=>{const o=new Nh({accessToken:e.accessToken,publicLinkToken:e.publicLinkToken,publicLinkPassword:e.publicLinkPassword});return{"Accept-Language":n.current,"Initiator-ID":t.initiatorId,"X-Request-ID":Yt.v4(),...o.getHeaders()}})}};function NP(e){return new Worker("/assets/worker-CjeEygd_.js",{name:e==null?void 0:e.name})}const iv=({concurrentRequests:e=4}={})=>{const t=st(),n=cn(),{headers:r}=Qs(),{createWorker:o,terminateWorker:i}=Ro(),s=({topic:c,space:u,resources:l},f)=>{const d=o(NP,{needsTokenRenewal:!0});let m;p(d.worker).onmessage=w=>{i(d.id),m==null||m(!0);const{successful:b,failed:T}=JSON.parse(w.data),v=T.map(({resource:g,...h})=>({resource:g,error:ee.createHttpError(h)}));f({successful:b,failed:v})},n.addTask(()=>new Promise(w=>{m=w})),d.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 $P(e){return new Worker("/assets/worker-C-4Lcir3.js",{name:e==null?void 0:e.name})}const ov=()=>{const e=st(),t=cn(),{headers:n}=Qs(),{createWorker:r,terminateWorker:o}=Ro(),i=(a,c)=>{const u=r($P,{needsTokenRenewal:!0});let l;p(u.worker).onmessage=f=>{o(u.id),l==null||l(!0);const{successful:d,failed:m}=JSON.parse(f.data),w=m.map(({resourceName:b,...T})=>({resourceName:b,error:ee.createHttpError(T)}));c({successful:d,failed:w})},t.addTask(()=>new Promise(f=>{l=f})),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 DP(e){return new Worker("/assets/worker-CHXv5Q0i.js",{name:e==null?void 0:e.name})}const sv=()=>{const e=st(),t=cn(),{headers:n}=Qs(),{createWorker:r,terminateWorker:o}=Ro(),i=({space:a,resources:c,missingFolderPaths:u},l)=>{const f=r(DP,{needsTokenRenewal:!0});let d;p(f.worker).onmessage=m=>{o(f.id),d==null||d(!0);const{successful:w,failed:b}=JSON.parse(m.data),T=b.map(({resource:v,...g})=>({resource:v,error:ee.createHttpError(g)}));l({successful:w,failed:T})},t.addTask(()=>new Promise(m=>{d=m})),f.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 LP(e){return new Worker("/assets/worker-BBQqm_-D.js",{name:e==null?void 0:e.name})}const MP=({authService:e})=>{const{createWorker:t}=Ro(),n=ae();return{startWorker:()=>{n.value=t(LP),p(p(n).worker).onmessage=()=>{e.signinSilent().catch(async s=>{if(s instanceof k0.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"}))}}},av=()=>{const e=st(),t=rt(),n=ze(),r=Ne.useGettext(),{getMatchingSpace:o}=ln(),{$gettext:i,$ngettext:s}=r,a=Ye(),{dispatchModal:c}=bt(),u=lt(),l=jt(),{startWorker:f}=iv({concurrentRequests:e.options.concurrentRequests.resourceBatchActions}),d=Ke(),{currentFolder:m}=He.storeToRefs(d),w=ae([]),b=on("page","1"),T=j(()=>parseInt(St(p(b)))),v=on("items-per-page","1"),g=j(()=>parseInt(St(p(v)))),h=j(()=>mp(p(w))),y=j(()=>{const A=p(h),$=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=j(()=>{const A=p(h),$=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.")}),E=A=>{const $=p(n.currentRoute);f({topic:"trashBinDelete",space:A,resources:p(h)},({successful:D,failed:k})=>{var N,z;if(D.length){const G=D.length===1&&p(h).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})}k.forEach(({resource:G})=>{const X=i('Failed to delete "%{item}"',{item:G.name});t.showErrorMessage({title:X,errors:[new Error]})}),$.name===p(n.currentRoute).name&&((N=$.query)==null?void 0:N.fileId)===((z=p(n.currentRoute).query)==null?void 0:z.fileId)&&(d.removeResources(D),d.resetSelection())})};return{displayDialog:(A,$)=>{w.value=[...$],c({title:p(y),message:p(S),confirmText:i("Delete"),onConfirm:()=>E(A)})},filesList_delete:A=>{var k;w.value=[...A],d.addResourcesIntoDeleteQueue(p(w).map(({id:N})=>N)),p(w).forEach(({id:N})=>d.removeSelection(N));const $=p(A).reduce((N,z)=>{if(z.storageId in N)return N[z.storageId].resources.push(z),N;const G=o(z);return G.id in N||(N[G.id]={space:G,resources:[]}),N[G.id].resources.push(z),N},{}),D=(k=p(m))==null?void 0:k.id;return Object.values($).map(({space:N,resources:z})=>{f({topic:"fileListDelete",space:N,resources:z},async({successful:G,failed:X})=>{var se;if(G.length){const ne=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:ne})}if(d.removeResourcesFromDeleteQueue(X.map(({resource:ne})=>ne.id)),d.removeResourcesFromDeleteQueue(G.map(({id:ne})=>ne)),X.forEach(({error:ne,resource:oe})=>{let fe=i('Failed to delete "%{resource}"',{resource:oe.name});ne.statusCode===423&&(fe=i('Failed to delete "%{resource}" - the file is locked',{resource:oe.name})),t.showErrorMessage({title:fe,errors:[ne]})}),D===((se=p(m))==null?void 0:se.id)){d.removeResources(G);const ne=d.activeResources.length,oe=Math.ceil(p(ne)/p(g));p(T)>1&&p(T)>oe&&(b.value=oe.toString())}if(at(n,"files-spaces-generic")&&!["public","share"].includes(N==null?void 0:N.driveType)){const oe=await a.graphAuthenticated.drives.getDrive(p(A)[0].storageId,l.graphRoles);u.updateSpaceField({id:oe.id,field:"spaceQuota",value:oe.spaceQuota})}if(p(w).length&&Zi(p(w)[0],p(m)))return n.push(Jn(N,{path:gt.dirname(p(w)[0].path),fileId:p(w)[0].parentFolderId}))})})}}},BP=e=>e==="files",Or=()=>{const e=en();return j(()=>BP(Sl(p(e))))};function jP(e){return e==null}const UP="edit",qP="create",Vn=()=>{const e=Zn(),t=ze(),{$gettext:n}=Ne.useGettext(),r=os(),{isEnabled:o}=ni(),{requestExtensions:i}=Ni(),{openUrl:s}=$v(),a=st(),{options:c}=He.storeToRefs(a),{actions:u}=Xs(),{actions:l}=Ys(),{actions:f}=Js(),{actions:d}=ea(),{actions:m}=Zs(),{actions:w}=ta(),{actions:b}=Io(),{actions:T}=Tf(),{actions:v}=na(),{actions:g}=Af(),{actions:h}=ra(),{actions:y}=ia(),{actions:S}=Cf(),E=j(()=>[...p(w),...p(b),...p(d),...p(v),...p(f),...p(h),...p(S),...p(y),...p(u),...p(l),...p(m),...p(T),...p(g)]),R=j(()=>i({id:"global.files.default-actions",extensionType:"action"}).map(se=>se.action)),I=j(()=>i({id:"global.files.context-actions",extensionType:"action"}).map(X=>X.action)),A=j(()=>p(o)?[]:e.fileExtensions.map(X=>{const se=e.apps[X.app];return{name:`editor-${X.app}`,label:()=>X.label?typeof X.label=="function"?X.label():X.label:n("Open in %{app}",{app:se.name},!0),showOpenInNewTabHint:!0,icon:X.icon||se.icon,...se.iconFillType&&{iconFillType:se.iconFillType},img:se.img,route:({space:ne,resources:oe})=>$({appFileExtension:X,space:ne,resource:oe[0]}),handler:ne=>k(X,ne.space,ne.resources[0]),isVisible:({resources:ne})=>ne.length!==1||!ne[0].canDownload()&&!X.secureView||!p(r)&&In(t,"files-trash-generic")?!1:ne[0].extension&&X.extension?ne[0].extension.toLowerCase()===X.extension.toLowerCase():ne[0].mimeType&&X.mimeType?ne[0].mimeType.toLowerCase()===X.mimeType.toLowerCase()||ne[0].mimeType.split("/")[0].toLowerCase()===X.mimeType.toLowerCase():!1,hasPriority:X.hasPriority,class:`oc-files-actions-${Vb(se.name).toLowerCase()}-trigger`}}).sort((X,se)=>se.hasPriority!==X.hasPriority&&se.hasPriority?1:0)),$=({appFileExtension:X,space:se,resource:ne})=>{const oe=ee.isShareSpaceResource(se)?se.id:void 0,fe=X.routeName||X.app,we=D(fe,se,ne,oe);return t.resolve(we)},D=(X,se,ne,oe,fe)=>({name:X,params:{driveAliasAndItem:se==null?void 0:se.getDriveAliasAndItem(ne)},query:{...oe&&{shareId:oe},...ne.fileId&&p(c).routing.idBased&&{fileId:ne.fileId},...fe&&{templateId:fe},...Ks(p(t.currentRoute))}}),k=(X,se,ne)=>{const oe=ee.isShareSpaceResource(se)?se.id:void 0,fe=X.routeName||X.app,we=D(fe,se,ne,oe);if(p(c).cernFeatures){const Z=t.resolve(we).href,re=`${X.routeName}-${ne.path}`;s(Z,re,!0);return}t.push(we)},N=X=>{z(X).handler({...X})},z=X=>{const se=G(X);if(se.length)return se[0]},G=X=>{const se=fe=>fe.isVisible(X),ne=[...p(R),...p(A)].filter(se).sort((fe,we)=>Number(we.hasPriority)-Number(fe.hasPriority)),oe=X.omitSystemActions?[]:p(E).filter(se);return[...ne,...oe,...p(I).filter(fe=>fe.isVisible(X)&&(fe.category==="actions"||jP(fe.category)))]};return{editorActions:A,systemActions:E,getDefaultAction:z,getAllAvailableActions:G,getEditorRouteOpts:D,openEditor:k,triggerDefaultAction:N}},Xs=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=ze(),{$gettext:r,$ngettext:o}=Ne.useGettext(),i=Ye(),s=cn(),a=st(),c=Ke(),{updateResourceField:u}=c,l=async({resources:d})=>{const m=[],w=[],b=new Lr({concurrency:a.options.concurrentRequests.resourceBatchActions});if(d.forEach(T=>{w.push(b.add(async()=>{try{const{graphAuthenticated:v}=i;await v.driveItems.createDriveItem(T.driveId,{name:T.name,remoteItem:{id:T.fileId}}),u({id:T.id,field:"syncEnabled",value:!0})}catch(v){console.error(v),m.push(v)}}))}),await Promise.all(w),m.length===0){c.resetSelection(),at(n,"files-spaces-generic")&&e({title:o("Sync for the selected share was enabled successfully","Sync for the selected shares was enabled successfully",d.length)});return}t({title:o("Failed to enable sync for the the selected share","Failed to enable sync for the selected shares",d.length),errors:m})};return{actions:j(()=>[{name:"enable-sync",icon:"check",handler:d=>s.addTask(()=>l(d)),label:()=>r("Enable sync"),isVisible:({space:d,resources:m})=>{var w;return!Nt(n,"files-shares-with-me")&&!at(n,"files-spaces-generic")||m.length===0||at(n,"files-spaces-generic")&&(((w=p(d))==null?void 0:w.driveType)!=="share"||m.length>1||m[0].path!=="/")?!1:m.some(b=>!b.syncEnabled)},class:"oc-files-actions-enable-sync-trigger"}])}},Ys=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=ze(),{$gettext:r}=Ne.useGettext(),o=Ye(),i=cn(),s=st(),{updateResourceField:a,resetSelection:c}=Ke(),u=async({resources:f})=>{const d=[],m=[],w=new Lr({concurrency:s.options.concurrentRequests.resourceBatchActions}),b=!f[0].hidden;if(f.forEach(T=>{m.push(w.add(async()=>{try{await o.graphAuthenticated.driveItems.updateDriveItem(T.driveId,T.id,{"@UI.Hidden":b}),a({id:T.id,field:"hidden",value:b})}catch(v){console.error(v),d.push(v)}}))}),await Promise.all(m),d.length===0){c(),e({title:r(b?"The share was hidden successfully":"The share was unhidden successfully")});return}t({title:r(b?"Failed to hide the share":"Failed to unhide share share"),errors:d})};return{actions:j(()=>[{name:"toggle-hide-share",icon:"eye-off",handler:f=>i.addTask(()=>u(f)),label:({resources:f})=>f[0].hidden?r("Unhide"):r("Hide"),isVisible:({resources:f})=>f.length===0?!1:Nt(n,"files-shares-with-me"),class:"oc-files-actions-hide-share-trigger"}])}},Js=()=>{const e=st(),t=ze(),{copyResources:n}=To(),r=Ne.useGettext(),{$gettext:o}=r,i=Ke(),{currentFolder:s}=He.storeToRefs(i),a=j(()=>window.navigator.platform.match("Mac")),c=j(()=>p(a)?o("⌘ + C"):o("Ctrl + C")),u=({resources:f})=>{At(t,"files-common-search")&&(f=f.filter(d=>!ee.isProjectSpaceResource(d))),n(f)};return{actions:j(()=>[{name:"copy",icon:"file-copy-2",handler:u,shortcut:p(c),label:()=>o("Copy"),isVisible:({resources:f})=>{var d,m;if(!at(t,"files-spaces-generic")&&!_n(t,"files-public-link")&&!At(t,"files-common-favorites")&&!At(t,"files-common-search")||at(t,"files-spaces-projects")||f.length===0)return!1;if(_n(t,"files-public-link"))return(d=p(s))==null?void 0:d.canCreate();if(At(t,"files-common-search")&&f.every(w=>ee.isProjectSpaceResource(w)))return!1;if(p(e.options.runningOnEos)){const w=((m=f[0].path)==null?void 0:m.split("/").filter(Boolean))||[];if(at(t,"files-spaces-generic")&&w.length<5)return!1}return!!p(f)[0].canDownload()},class:"oc-files-actions-copy-trigger"}])}},wf=()=>({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}=Mr.useClipboard({legacy:!0});return r(t)}}}),Sf=()=>{const{showMessage:e,showErrorMessage:t}=rt(),{$gettext:n}=Ne.useGettext(),{copyToClipboard:r}=wf(),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:j(()=>[{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})=>ee.isPublicSpaceResource(s)?!1:a.length===1,class:"oc-files-actions-copy-permanent-link-trigger"}])}},Zs=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=ze(),{$gettext:r,$ngettext:o}=Ne.useGettext(),i=Ye(),s=cn(),a=st(),{updateResourceField:c}=Ke(),u=async({resources:f})=>{const d=[],m=[],w=new Lr({concurrency:a.options.concurrentRequests.resourceBatchActions});if(f.forEach(b=>{m.push(w.add(async()=>{try{const{graphAuthenticated:T}=i;await T.driveItems.deleteDriveItem(b.driveId,b.id),c({id:b.id,field:"syncEnabled",value:!1})}catch(T){console.error(T),d.push(T)}}))}),await Promise.all(m),d.length===0){at(n,"files-spaces-generic")&&(e({title:o("Sync for the selected share was disabled successfully","Sync for the selected shares was disabled successfully",f.length)}),n.push(kn("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",f.length),errors:d})};return{actions:j(()=>[{name:"disable-sync",icon:"spam-3",handler:f=>s.addTask(()=>u(f)),label:()=>r("Disable sync"),isVisible:({space:f,resources:d})=>!Nt(n,"files-shares-with-me")&&!at(n,"files-spaces-generic")||d.length===0||at(n,"files-spaces-generic")&&((f==null?void 0:f.driveType)!=="share"||d.length>1||d[0].path!=="/")?!1:d.some(m=>m.syncEnabled),class:"oc-files-actions-disable-sync-trigger"}])}},ea=()=>{const e=vt(),t=rn(),n=ze(),{displayDialog:r,filesList_delete:o}=av(),{$gettext:i}=Ne.useGettext(),s=({space:c,resources:u,deletePermanent:l})=>{if(At(n,"files-common-search")&&(u=u.filter(f=>f.canBeDeleted()&&!f.isShareRoot()&&!ee.isProjectSpaceResource(f))),l){r(c,u);return}o(u)};return{actions:j(()=>[{name:"delete",icon:"delete-bin-5",label:()=>i("Delete"),handler:({space:c,resources:u})=>s({space:c,resources:u,deletePermanent:!1}),isVisible:({space:c,resources:u})=>!at(n,"files-spaces-generic")&&!_n(n,"files-public-link")&&!At(n,"files-common-search")||u.length===0||at(n,"files-spaces-generic")&&(c==null?void 0:c.driveType)==="share"&&u[0].path==="/"||u.length===1&&u[0].locked?!1:At(n,"files-common-search")?u.some(f=>f.canBeDeleted()&&!f.isShareRoot()&&!ee.isProjectSpaceResource(f)):!u.some(f=>!f.canBeDeleted()),class:"oc-files-actions-delete-trigger"},{name:"delete-permanent",icon:"delete-bin-5",label:()=>i("Delete"),handler:({space:c,resources:u})=>s({space:c,resources:u,deletePermanent:!0}),isVisible:({space:c,resources:u})=>!In(n,"files-trash-generic")||!t.filesPermanentDeletion||ee.isProjectSpaceResource(c)&&!c.canDeleteFromTrashBin({user:e.user})?!1:u.length>0,class:"oc-files-actions-delete-permanent-trigger"}])}};function VP(e){return e&&e.length?e[0]:void 0}const lv=()=>mr("$archiverService"),ta=()=>{const{showErrorMessage:e}=rt(),t=ze(),n=cn(),r=lv(),{$ngettext:o,$gettext:i,current:s}=Ne.useGettext(),a=Xr(),c=Or(),u=({space:d,resources:m})=>{m.length>1&&(m=m.filter(b=>b.canDownload()&&!ee.isProjectSpaceResource(b)));const w=p(r.fileIdsSupported)?{fileIds:m.map(b=>b.fileId)}:{dir:ss.dirname(VP(m).path)||"/",files:m.map(b=>b.name)};return r.triggerDownload({...w,...d&&ee.isPublicSpaceResource(d)&&{publicToken:d.id,publicLinkPassword:a.publicLinkPassword}}).catch(b=>{console.error(b),e({title:o("Failed to download the selected folder.","Failed to download the selected files.",m.length),errors:[b]})})},l=d=>{const m=p(r.capability);return m?d.reduce((b,T)=>b+parseInt(`${T.size}`),0)>parseInt(m.max_size):void 0};return{actions:j(()=>[{name:"download-archive",icon:"inbox-archive",handler:async d=>{await n.addTask(()=>u(d))},label:()=>i("Download"),disabledTooltip:({resources:d})=>l(d)?i("The selection exceeds the allowed archive size (max. %{maxSize})",{maxSize:En(p(r.capability).max_size,s)}):"",isDisabled:({resources:d})=>l(d),isVisible:({resources:d})=>p(c)&&!at(t,"files-spaces-generic")&&!_n(t,"files-public-link")&&!At(t,"files-common-favorites")&&!At(t,"files-common-search")&&!Nt(t,"files-shares-with-me")&&!Nt(t,"files-shares-with-others")&&!Nt(t,"files-shares-via-link")&&!At(t,"files-common-search")||!p(r.available)||d.length===0||d.length===1&&!d[0].isFolder||d.length>1&&d.every(w=>ee.isProjectSpaceResource(w))||ee.isProjectSpaceResource(d[0])&&d[0].disabled||!p(r.fileIdsSupported)&&At(t,"files-common-favorites")?!1:!d.some(w=>!w.canDownload()),class:"oc-files-actions-download-archive-trigger"}])}},cv=e=>{const{showErrorMessage:t}=rt(),n=(e==null?void 0:e.clientService)||Ye(),{$gettext:r}=Ne.useGettext(),o=rn(),i=vt();return{downloadFile:async(a,c,u=null)=>{var l;try{const f=await n.webdav.getFileUrl(a,c,{version:u,doHeadRequest:!0,isUrlSigningEnabled:o.supportUrlSigning,username:(l=i.user)==null?void 0:l.onPremisesSamAccountName});Bl(f,c.name)}catch(f){console.error(f),t({title:r("Download failed"),desc:r("File could not be located"),errors:[f]})}}}},Io=()=>{const e=ze(),{$gettext:t}=Ne.useGettext(),n=Or(),r=os(),{downloadFile:o}=cv(),i=({space:a,resources:c})=>{o(a,c[0])};return{actions:j(()=>[{name:"download-file",icon:"file-download",handler:i,label:()=>t("Download"),isVisible:({resources:a})=>p(n)&&!p(r)&&!at(e,"files-spaces-generic")&&!_n(e,"files-public-link")&&!At(e,"files-common-favorites")&&!At(e,"files-common-search")&&!Nt(e,"files-shares-with-me")&&!Nt(e,"files-shares-with-others")&&!Nt(e,"files-shares-via-link")||a.length!==1||a[0].isFolder?!1:a[0].canDownload(),class:"oc-files-actions-download-file-trigger"}])}},Ef=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=vt(),r=rn(),o=ze(),{$gettext:i}=Ne.useGettext(),s=Ye(),{dispatchModal:a}=bt(),c=Ke(),u=cn(),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]})}),f=({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:j(()=>[{name:"empty-trash-bin",icon:"delete-bin-5",label:()=>i("Empty trash bin"),handler:f,isVisible:({space:m})=>!(!In(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}},Tf=()=>{const{showErrorMessage:e}=rt(),t=rn(),n=ze(),{$gettext:r}=Ne.useGettext(),o=Ye(),i=Or(),s=hn(),a=Ke(),c=_o(),u=async({space:f,resources:d})=>{try{const m=!d[0].starred;await o.webdav.setFavorite(f,d[0],m),a.updateResourceField({id:d[0].id,field:"starred",value:m}),m||c.publish("app.files.list.removeFromFavorites",d[0].id)}catch(m){const w=r('Failed to change favorite state of "%{file}"',{file:d[0].name},!0);e({title:w,errors:[m]})}};return{actions:j(()=>[{name:"favorite",icon:"star",handler:u,label:({resources:f})=>f[0].starred?r("Remove from favorites"):r("Add to favorites"),isVisible:({resources:f})=>p(i)&&!at(n,"files-spaces-generic")&&!At(n,"files-common-favorites")||f.length!==1?!1:t.filesFavorites&&s.can("create","Favorite"),class:"oc-files-actions-favorite-trigger"}])}};function zP(e,t){const n=e.isReceivedShare()||e.isMounted(),r=t===""&&n;return e.canBeDeleted()&&!r}const na=()=>{const e=ze(),{cutResources:t}=To(),n=Ne.useGettext(),{$gettext:r}=n,o=Ke(),{currentFolder:i}=He.storeToRefs(o),s=j(()=>window.navigator.platform.match("Mac")),a=j(()=>p(s)?r("⌘ + X"):r("Ctrl + X")),c=({resources:l})=>{t(l)};return{actions:j(()=>[{name:"cut",icon:"scissors",handler:c,shortcut:p(a),label:()=>r("Cut"),isVisible:({resources:l})=>!at(e,"files-spaces-generic")&&!_n(e,"files-public-link")&&!At(e,"files-common-favorites")||l.length===0||!p(i)||l.length===1&&l[0].locked?!1:!l.some(d=>zP(d,p(i).path)===!1),class:"oc-files-actions-move-trigger"}])}},Af=()=>{const e=ze(),{$gettext:t}=Ne.useGettext(),{getMatchingSpace:n}=ln(),r=Ke(),{currentFolder:o}=He.storeToRefs(r),i=c=>c||n(c),s=j(()=>_n(e,"files-public-link")?Ai("files-public-link"):xn("files-spaces-generic"));return{actions:j(()=>[{name:"navigate",icon:"folder-open",showOpenInNewTabHint:!0,label:()=>t("Open folder"),isVisible:({resources:c})=>!(In(e,"files-trash-generic")||c.length!==1||p(o)!==null&&Zi(c[0],p(o))||!c[0].isFolder||c[0].type==="space"),route:({space:c,resources:u})=>ao({},p(s),Jn(i(c),{path:u[0].path,fileId:u[0].fileId})),class:"oc-files-actions-navigate-trigger"}])}},uv=()=>{const e=ze(),t=Ye(),{getMatchingSpace:n}=ln(),{$gettext:r,$ngettext:o}=Ne.useGettext(),i=To(),{startWorker:s}=ov(),a=Ke(),{currentFolder:c}=He.storeToRefs(a),u=j(()=>window.navigator.platform.match("Mac")),l=j(()=>p(u)?r("⌘ + V"):r("Ctrl + V")),f=j(()=>i.action===ei.Cut?pr.MOVE:pr.COPY),d=async({targetSpace:b,sourceSpace:T,resources:v})=>{var S;const g=new Sp(T,v,b,p(c),c,t,r,o),h=await g.getTransferData(p(f));if(!h.length)return;const y=(S=p(c))==null?void 0:S.id;s(h,async({successful:E,failed:R})=>{if(g.showResultMessage(R,E,p(f)),!E.length||p(c)&&y!==p(c).id)return;const I=[],A=[];for(const $ of E)I.push((async()=>{const D=await t.webdav.getFileInfo(b,$);A.push(D)})());await Promise.allSettled(I),ee.isShareSpaceResource(b)&&A.forEach($=>{$.remoteItemId=b.id}),a.upsertResources(A),a.loadIndicators(b,p(c).id)})},m=async({space:b})=>{const T=i.resources.reduce((g,h)=>{if(h.storageId in g)return g[h.storageId].resources.push(h),g;const y=n(h);return y.id in g||(g[y.id]={space:y,resources:[]}),g[y.id].resources.push(h),g},{}),v=Object.values(T).map(({space:g,resources:h})=>d({targetSpace:b,sourceSpace:g,resources:h}));await Promise.all(v),i.clearClipboard()};return{actions:j(()=>[{name:"paste",icon:"clipboard",handler:m,label:()=>r("Paste"),shortcut:p(l),isVisible:({resources:b})=>{var T;return i.resources.length===0||!at(e,"files-spaces-generic")&&!_n(e,"files-public-link")&&!At(e,"files-common-favorites")||b.length===0?!1:_n(e,"files-public-link")&&p(c)?(T=p(c))==null?void 0:T.canCreate():!0},class:"oc-files-actions-copy-trigger"}])}},ra=()=>{const{showErrorMessage:e}=rt(),t=rn(),n=ze(),{$gettext:r}=Ne.useGettext(),o=Ye(),i=st(),{dispatchModal:s}=bt(),a=vt(),c=hn(),u=Ke(),{setCurrentFolder:l,upsertResource:f}=u,d=(T,v,g=void 0)=>{const h=T.path.substring(0,T.path.length-T.name.length)+v;if(!v)return r("The name cannot be empty");if(/[/]/.test(v))return r('The name cannot contain "/"');if(v===".")return r('The name cannot be equal to "."');if(v==="..")return r('The name cannot be equal to ".."');if(/\s+$/.test(v))return r("The name cannot end with whitespace");if(u.resources.find(S=>S.path===h&&T.name!==v)){const S=r('The name "%{name}" is already taken');return r(S,{name:v},!0)}if(g&&g.find(E=>E.path===h&&T.name!==v)){const E=r('The name "%{name}" is already taken');return r(E,{name:v},!0)}return null},m=async(T,v,g)=>{let h=u.currentFolder;try{const y=gt.join(gt.dirname(v.path),g);await o.webdav.moveFiles(T,v,T,{path:y});const S=Zi(v,h);if(ee.isShareSpaceResource(T)&&v.isReceivedShare()){if(T.rename(g),S)return h={...h},h.name=g,l(h),n.push(Jn(T,{path:"",fileId:v.fileId}));const R={...v};R.name=g,f(R);return}if(S)return h={...h},rl(T,h,y),l(h),n.push(Jn(T,{path:y,fileId:v.fileId}));const E={...v};rl(T,E,y),f(E)}catch(y){console.error(y);let S=r('Failed to rename "%{file}" to "%{newName}"',{file:v.name,newName:g},!0);y.statusCode===423&&(S=r('Failed to rename "%{file}" to "%{newName}" - the file is locked',{file:v.name,newName:g},!0)),e({title:S,errors:[y]})}},w=async({space:T,resources:v})=>{const g=u.currentFolder;let h;if(Zi(v[0],g)){const k=gt.dirname(g.path);h=(await o.webdav.listFiles(T,{path:k})).children}const y=u.areFileExtensionsShown,S=async k=>{y||(k=`${k}.${v[0].extension}`),await m(T,v[0],k)},E=(k,N)=>{y||(k=`${k}.${v[0].extension}`);const z=d(v[0],k,h);N(z)},R=ee.extractNameWithoutExtension(v[0]),I=!v[0].isFolder&&!y?R:v[0].name,A=v[0].isFolder?r("Rename folder %{name}",{name:I}):r("Rename file %{name}",{name:I}),$=!v[0].isFolder&&!y?R:v[0].name,D=v[0].isFolder||!y?null:[0,R.length];s({title:A,confirmText:r("Rename"),hasInput:!0,inputValue:$,inputSelectionRange:D,inputLabel:v[0].isFolder?r("Folder name"):r("File name"),onConfirm:S,onInput:E})};return{actions:j(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:w,isVisible:({resources:T})=>In(n,"files-trash-generic")||Nt(n,"files-shares-with-me")&&!t.sharingCanRename||T.length!==1||(i.options.routing.fullShareOwnerPaths?T.some(h=>h.remoteItemPath&&h.path):T.some(h=>h.remoteItemId&&h.path==="/"))||T.length===1&&T[0].locked?!1:!T.some(h=>!h.canRename({user:a.user,ability:c})||h.processing),class:"oc-files-actions-rename-trigger"}]),getNameErrorMsg:d,renameResource:m}},ia=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=vt(),r=ze(),{$gettext:o,$ngettext:i}=Ne.useGettext(),s=Ye(),a=lt(),c=jt(),u=Ke(),{startWorker:l}=sv(),f=async(T,v)=>{const g={},h=[],y=[],S=[];for(const E of v){const R=gt.dirname(E.path);let I=[];if(R in g)I=g[R];else{try{I=(await s.webdav.listFiles(T,{path:R})).children}catch{S.push(R)}g[R]=I}I.some($=>$.name===E.name)||y.filter($=>$.id!==E.id).some($=>$.path===E.path)?h.push(E):y.push(E)}return{existingResourcesByPath:g,conflicts:h,resolvedResources:y,missingFolderPaths:S.filter(E=>{var R;return!((R=g[E])!=null&&R.length)})}},d=async T=>{let v=0;const g=[],h=T.length;let y=!1,S;for(const E of T){const R=E.type==="folder";if(y){g.push({resource:E,strategy:S});continue}const I=h-v,$=await new tl(o,i).resolveFileExists({name:E.name,isFolder:R},I,!1);v++,$.doForAllConflicts&&(y=!0,S=$.strategy),g.push({resource:E,strategy:$.strategy})}return g},m=(T,v,g)=>{const h=p(r.currentRoute);l({space:T,resources:v,missingFolderPaths:g},async({successful:y,failed:S})=>{var E,R;if(y.length){let I;y.length===1?I=o("%{resource} was restored successfully",{resource:y[0].name}):I=o("%{resourceCount} files restored successfully",{resourceCount:y.length.toString()}),e({title:I}),h.name===p(r.currentRoute).name&&((E=h.query)==null?void 0:E.fileId)===((R=p(r.currentRoute).query)==null?void 0:R.fileId)&&(u.removeResources(y),u.resetSelection());const $=await s.graphAuthenticated.drives.getDrive(T.id,c.graphRoles);a.updateSpaceField({id:$.id,field:"spaceQuota",value:$.spaceQuota})}if(S.length){let I;const A={};S.length===1?(A.resource=S[0].resource.name,I=o('Failed to restore "%{resource}"',A,!0)):(A.resourceCount=S.length.toString(),I=o("Failed to restore %{resourceCount} files",A,!0)),t({title:I,errors:S.map(({error:$})=>$)})}})},w=async({space:T,resources:v})=>{const g=v.sort(($,D)=>$.path.length-D.path.length),{existingResourcesByPath:h,conflicts:y,resolvedResources:S,missingFolderPaths:E}=await f(T,g),R=await d(y),I=R.filter($=>$.strategy===qn.REPLACE).map($=>$.resource);S.push(...I);const A=R.filter($=>$.strategy===qn.KEEP_BOTH).map($=>$.resource);for(let $ of A){$={...$};const D=gt.dirname($.path),k=h[D]||[],N=ee.extractExtensionFromFile($),z=Un($.name,N,[...k,...R.map(G=>G.resource),...S]);$.name=z,$.path=ee.urlJoin(D,z),S.push($)}return m(T,S,E)};return{actions:j(()=>[{name:"restore",icon:"arrow-go-back",label:()=>o("Restore"),handler:w,isVisible:({space:T,resources:v})=>!In(r,"files-trash-generic")||!v.every(g=>ee.isTrashResource(g)&&g.canBeRestored())||ee.isProjectSpaceResource(T)&&!T.canRestoreFromTrashbin({user:n.user})?!1:v.length>0,class:"oc-files-actions-restore-trigger"}]),restoreResources:m,collectConflicts:f}},Rf=()=>mr("$previewService"),fv=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=vt(),r=ze(),{$gettext:o}=Ne.useGettext(),i=Ye(),s=cn(),a=Rf(),c=lt(),u=jt(),{createDefaultMetaFolder:l}=Di(),{getDefaultMetaFolder:f}=oi(),d=async({space:w,resources:b})=>{var y;const T=i.graphAuthenticated,v=w==null?void 0:w.id,{copyFiles:g,getFileInfo:h}=i.webdav;try{let S=await f(w);S||(S=await l(w)),b[0].id!==((y=w.spaceImageData)==null?void 0:y.id)&&await g(w,{fileId:b[0].id},w,{parentFolderId:S.id,name:b[0].name},{overwrite:!0});const{fileId:E}=await h(w,{fileId:b[0].id}),R=await T.drives.updateDrive(v,{name:w.name,special:[{specialFolder:{name:"image"},id:E}]},u.graphRoles);c.updateSpaceField({id:v,field:"spaceImageData",value:R.spaceImageData}),e({title:o("Space image was set successfully")})}catch(S){console.error(S),t({title:o("Failed to set space image"),errors:[S]})}};return{actions:j(()=>[{name:"set-space-image",icon:"image-edit",handler:w=>s.addTask(()=>d(w)),label:()=>o("Set as space image"),isVisible:({space:w,resources:b})=>b.length!==1||!b[0].mimeType||!a.isMimetypeSupported(b[0].mimeType,!0)||!at(r,"files-spaces-generic")||!w?!1:w.canEditImage({user:n.user}),class:"oc-files-actions-set-space-image-trigger"}])}},WP=()=>{const e=ze(),{$gettext:t}=Ne.useGettext(),n=Or(),r=()=>{const i=In(e,"files-trash-generic")?null:"actions";Xe.publish(yt.openWithPanel,i)};return{actions:j(()=>[{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"}])}},_f=()=>{const e=ze(),t=Ke(),{$gettext:n}=Ne.useGettext();return{actions:j(()=>[{name:"show-details",icon:"information",class:"oc-files-actions-show-details-trigger",label:()=>n("Details"),isVisible:({resources:o})=>In(e,"files-trash-generic")?!1:o.length>0,handler({resources:o}){t.setSelection(o.map(({id:i})=>i)),Xe.publish(yt.open)}}])}},dv=()=>{const e=rn(),{isPersonalSpaceRoot:t}=ln(),n=vt();return{canListShares:({space:o,resource:i})=>!e.sharingApiEnabled||ee.isPublicSpaceResource(o)||t(i)||ee.isTrashResource(i)?!1:ee.isIncomingShareResource(i)?i.sharePermissions.includes(ee.GraphSharePermission.readPermissions):ee.isShareSpaceResource(o)?ee.getPermissionsForSpaceMember(o,n.user).includes(ee.GraphSharePermission.readPermissions):!0}},pv=()=>{const e=rn(),t=hn(),n=vt();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})}},If=()=>{const e=ze(),{$gettext:t}=Ne.useGettext(),{canShare:n}=pv(),r=Ke(),o=({resources:s})=>{r.setSelection(s.map(({id:a})=>a)),Xe.publish(yt.openWithPanel,"sharing#peopleShares")};return{actions:j(()=>[{name:"show-shares",icon:"user-add",label:()=>t("Share"),handler:o,isVisible:({space:s,resources:a})=>In(e,"files-trash-generic")||a.length!==1?!1:n({space:s,resource:a[0]}),class:"oc-files-actions-show-shares-trigger"}])}},Cf=()=>{const{showMessage:e,showErrorMessage:t}=rt(),{can:n}=hn(),{$gettext:r,$ngettext:o}=Ne.useGettext(),{createSpace:i}=Di(),{checkSpaceNameModalInput:s}=oi(),a=Ye(),c=ze(),u=j(()=>n("create-all","Drive")),{dispatchModal:l}=bt(),f=st(),d=lt(),m=Ke(),w=async({spaceName:v,resources:g,space:h})=>{const{webdav:y}=a,S=new Lr({concurrency:f.options.concurrentRequests.resourceBatchActions}),E=[];try{const R=await i(v);d.upsertSpace(R),g.length===1&&g[0].isFolder&&(g=(await y.listFiles(h,{path:g[0].path})).children);for(const I of g)E.push(S.add(()=>y.copyFiles(h,I,R,{path:I.name})));await Promise.all(E),m.resetSelection(),e({title:r("Space was created successfully")})}catch(R){console.error(R),t({title:r("Creating space failed…"),errors:[R]})}},b=({resources:v,space:g})=>{l({title:o('Create Space from "%{resourceName}"',"Create Space from selection",v.length,{resourceName:v[0].name}),message:o('Create Space with the content of "%{resourceName}".',"Create Space with the selected files.",v.length,{resourceName:v[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"),onInput:s,onConfirm:h=>w({spaceName:h,space:g,resources:v})})};return{actions:j(()=>[{name:"create-space-from-resource",icon:"function",handler:b,label:()=>r("Create Space from selection"),isVisible:({resources:v,space:g})=>!(!v.length||!p(u)||!at(c,"files-spaces-generic")||!ee.isPersonalSpaceResource(g)),class:"oc-files-actions-create-space-from-resource-trigger"}])}},hv=()=>{const e=on("scrollTo"),t=on("details"),n=Ke(),r=j(()=>St(p(e))),o=j(()=>St(p(t))),i=(a,c={forceScroll:!1,topbarElement:null})=>{const u=document.querySelectorAll(`[data-item-id='${a}']`)[0];if(!u){Xe.publish("app.files.navigate.page",{resourceId:a,forceScroll:c.forceScroll,topbarElement:c.topbarElement});return}const l=document.getElementById(c.topbarElement),f=(l==null?void 0:l.offsetHeight)||0+u.offsetHeight*2;(u.getBoundingClientRect().bottom>window.innerHeight||u.getBoundingClientRect().top<f||c.forceScroll)&&u.scrollIntoView({behavior:"smooth",block:"center"})};return Xe.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)&&Xe.publish(yt.openWithPanel,p(o)))}}},HP=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=rt(),r=ze(),{dispatchModal:o}=bt(),{$gettext:i}=Ne.useGettext(),{scrollToResource:s}=hv(),a=vt(),c=Ke(),{resources:u,currentFolder:l,ancestorMetaData:f}=He.storeToRefs(c),d=Ye(),m=(g,h)=>g.trim()===""?h(i("Folder name cannot be empty")):/[/]/.test(g)?h(i('Folder name cannot contain "/"')):g==="."?h(i('Folder name cannot be equal to "."')):g===".."?h(i('Folder name cannot be equal to ".."')):p(u).find(S=>S.name===g)?h(i("%{name} already exists",{name:g},!0)):h(null),w=j(()=>at(r,"files-spaces-generic")&&p(e).driveType!=="share"),b=async g=>{g=g.trimEnd();try{const h=gt.join(p(l).path,g),y=await d.webdav.createFolder(p(e),{path:h});p(w)&&(y.indicators=Eo({space:p(e),resource:y,ancestorMetaData:p(f),user:a.user})),ee.isShareSpaceResource(p(e))&&(y.remoteItemId=p(e).id),c.upsertResource(y),t({title:i('"%{folderName}" was created successfully',{folderName:g})}),await Gn(),s(y.id,{forceScroll:!0,topbarElement:"files-app-bar"})}catch(h){console.error(h),n({title:i("Failed to create folder"),errors:[h]})}},T=()=>{let g=i("New folder");p(u).some(h=>h.name===g)&&(g=Un(g,"",p(u))),o({title:i("Create a new folder"),confirmText:i("Create"),hasInput:!0,inputValue:g,inputLabel:i("Folder name"),onConfirm:b,onInput:m})};return{actions:j(()=>[{name:"create-folder",icon:"folder",handler:T,label:()=>i("New Folder"),isVisible:()=>{var g;return(g=p(l))==null?void 0:g.canCreate()},class:"oc-files-actions-create-new-folder"}]),checkNewFolderName:m,addNewFolder:b}},GP=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=rt(),r=vt(),o=ze(),{$gettext:i}=Ne.useGettext(),{dispatchModal:s}=bt(),a=Zn(),{isEnabled:c}=ni(),{openEditor:u}=Vn(),l=Ye(),f=Ke(),{resources:d,currentFolder:m,ancestorMetaData:w,areFileExtensionsShown:b}=He.storeToRefs(f),T=j(()=>a.fileExtensions.filter(({newFileMenu:E})=>!!E)),v=E=>E===""?i("File name cannot be empty"):/[/]/.test(E)?i('File name cannot contain "/"'):E==="."?i('File name cannot be equal to "."'):E===".."?i('File name cannot be equal to ".."'):/\s+$/.test(E)?i("File name cannot end with whitespace"):p(d).find(I=>I.name===E)?i("%{name} already exists",{name:E},!0):null,g=j(()=>at(o,"files-spaces-generic")&&p(e).driveType!=="share"),h=(E,R)=>(g.value&&(E.indicators=Eo({space:p(e),resource:E,ancestorMetaData:p(w),user:r.user})),f.upsertResource(E),u(R,p(e),E)),y=(E,R,I)=>{let A=i("New file")+`.${R}`;p(d).some(D=>D.name===A)&&(A=Un(A,R,p(d))),b.value||(A=ee.extractNameWithoutExtension({name:A,extension:R}));const $=b.value?[0,A.length-(R.length+1)]:null;s({title:i("Create a new file"),confirmText:i("Create"),hasInput:!0,inputValue:A,inputLabel:i("File name"),inputSelectionRange:$,onConfirm:async D=>{b.value||(D=`${D}.${R}`);try{let k;if(I.createFileHandler)k=await I.createFileHandler({fileName:D,space:p(e),currentFolder:p(m)});else{const N=gt.join(p(m).path,D);k=await l.webdav.putFileContents(p(e),{path:N})}return f.upsertResource(k),t({title:i('"%{fileName}" was created successfully',{fileName:k.name})}),p(c)?void 0:h(k,I)}catch(k){console.error(k),n({title:i("Failed to create file"),errors:[k]})}},onInput:(D,k)=>k(v(b.value?D:`${D}.${R}`))})};return{actions:j(()=>{var I;const E=[],R={};for(const A of p(T)||[])A.hasPriority?R[A.extension]=A:R[A.extension]=R[A.extension]||A;for(const[,A]of Object.entries(R))E.push({name:"create-new-file",icon:"add",handler:$=>y($,A.extension,A),label:()=>i(A.newFileMenu.menuTitle()),isVisible:()=>{var $;return($=p(m))==null?void 0:$.canUpload({user:r.user})},class:"oc-files-actions-create-new-file",ext:A.extension,isExternal:(I=A.app)==null?void 0:I.startsWith("external-")});return E}),getNameErrorMsg:v,openFile:h}},gv="rowMounted",Ff="fileDropped",KP="contextmenuClicked";class zn{}Ee(zn,"Thumbnail",[36,36]),Ee(zn,"Tile",[1e3,1e3]),Ee(zn,"Preview",[1200,1200]),Ee(zn,"Avatar",64);class oa{}Ee(oa,"Thumbnail","thumbnail"),Ee(oa,"Preview","preview"),Ee(oa,"Avatar","avatar");class QP{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 mv{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 QP(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 XP={name:"resource-type-folder",color:"var(--oc-color-icon-folder)"},YP={name:"layout-grid",color:"var(--oc-role-secondary)"},JP={name:"resource-type-file",color:"var(--oc-role-on-surface)"},ZP=Tp(),eO=Me({name:"ResourceIcon",props:{resource:{type:Object,required:!0},size:{type:String,default:"large",validator:e=>xF.some(t=>t===e)}},setup(e){const t=dr(Ep),n=j(()=>e.resource.type==="folder"||e.resource.isFolder),r=j(()=>e.resource.type==="space"),o=j(()=>{var c;return(c=e.resource.extension)==null?void 0:c.toLowerCase()}),i=j(()=>{var c;return(c=e.resource.mimeType)==null?void 0:c.toLowerCase()}),s=j(()=>{if(p(r))return YP;if(p(n))return XP;const c=ZP[p(o)]||(t==null?void 0:t.mimeType[p(i)])||(t==null?void 0:t.extension[p(o)]);return{...JP,...c}}),a=j(()=>p(r)?"oc-resource-icon-space":p(n)?"oc-resource-icon-folder":"oc-resource-icon-file");return{icon:s,iconTypeClass:a}}});function tO(e,t,n,r,o,i){const s=he("oc-icon");return J(),Ce(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 Co=Ve(eO,[["render",tO]]),nO={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}=He.storeToRefs(t);return{linkTarget:j(()=>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")}}},rO={key:1};function iO(e,t,n,r,o,i){return n.isResourceClickable?(J(),Ce(Wr(i.componentType),Zt({key:0},i.componentProps,{target:e.linkTarget,draggable:!1,class:"oc-resource-link","no-hover":"",onDragstart:t[0]||(t[0]=Rn(()=>{},["prevent","stop"])),onClick:i.emitClick}),{default:Te(()=>[Ge(e.$slots,"default")]),_:3},16,["target","onClick"])):(J(),Se("span",rO,[Ge(e.$slots,"default")]))}const Pf=Ve(nO,[["render",iO]]),oO=Me({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?ss.join(this.pathPrefix,this.fullPath):this.fullPath},htmlTitle(){if(!this.tooltip)return this.isExtensionDisplayed?`${this.displayName}${this.displayExtension}`:this.displayName}}}),sO=["data-test-resource-path","data-test-resource-name","data-test-resource-type","title"],aO={key:0,class:"oc-text-truncate"},lO=["textContent"],cO=["textContent"],uO=["textContent"];function fO(e,t,n,r,o,i){const s=dn("oc-tooltip");return ot((J(),Se("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?(J(),Se("span",aO,[pe("span",{class:"oc-resource-basename",textContent:W.toDisplayString(e.displayName)},null,8,lO)])):(J(),Se("span",{key:1,class:"oc-resource-basename oc-text-break",textContent:W.toDisplayString(e.displayName)},null,8,cO)),e.extension&&e.isExtensionDisplayed?(J(),Se("span",{key:2,class:"oc-resource-extension",textContent:W.toDisplayString(e.displayExtension)},null,8,uO)):Oe("",!0)],10,sO)),[[s,e.tooltip]])}const Of=Ve(oO,[["render",fO]]),dO=Me({name:"ResourceListItem",components:{ResourceIcon:Co,ResourceLink:Pf,ResourceName:Of},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")}}}),pO={class:"oc-resource-indicators"},hO=["textContent"];function gO(e,t,n,r,o,i){const s=he("oc-image"),a=he("resource-icon"),c=he("resource-link"),u=he("resource-name"),l=he("oc-icon"),f=dn("oc-tooltip");return J(),Se("div",{class:W.normalizeClass(["oc-resource oc-text-overflow",{"oc-resource-no-interaction":!e.isResourceClickable}])},[e.isIconDisplayed?(J(),Ce(c,{key:0,resource:e.resource,link:e.link,"is-resource-clickable":e.isResourceClickable,class:"oc-resource-icon-link",onClick:e.emitClick},{default:Te(()=>[e.hasThumbnail?ot((J(),Ce(s,{key:e.thumbnail,src:e.thumbnail,class:"oc-resource-thumbnail",width:"40",height:"40","aria-label":e.tooltipLabelIcon},null,8,["src","aria-label"])),[[f,e.tooltipLabelIcon]]):ot((J(),Ce(a,{key:1,"aria-label":e.tooltipLabelIcon,resource:e.resource},null,8,["aria-label","resource"])),[[f,e.tooltipLabelIcon]])]),_:1},8,["resource","link","is-resource-clickable","onClick"])):Oe("",!0),pe("div",{class:W.normalizeClass(["oc-resource-details oc-text-overflow",{"oc-pl-s":e.isIconDisplayed}])},[ve(c,{resource:e.resource,"is-resource-clickable":e.isResourceClickable,link:e.link,class:"oc-text-overflow",onClick:e.emitClick},{default:Te(()=>[(J(),Ce(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"]),pe("div",pO,[e.isPathDisplayed?(J(),Ce(Wr(e.parentFolderComponentType),{key:0,to:e.parentFolderLink,style:W.normalizeStyle(e.parentFolderStyle),class:"parent-folder oc-text-truncate"},{default:Te(()=>[ve(l,W.normalizeProps(Ha(e.parentFolderLinkIconAttrs)),null,16),pe("span",{class:"text oc-text-truncate",textContent:W.toDisplayString(e.parentFolderName)},null,8,hO)]),_:1},8,["to","style"])):Oe("",!0)])],2)],2)}const Fo=Ve(dO,[["render",gO]]),yv=Me({__name:"ResourcePreview",props:{searchResult:{default:()=>({data:{}})},isClickable:{type:Boolean,default:!0},term:{default:""}},setup(e){const t=new mv,{triggerDefaultAction:n}=Vn(),{getMatchingSpace:r}=ln(),{getDefaultAction:o}=Vn(),{loadPreview:i}=Mf(),s=Ud("resourceListItem"),{getPathPrefix:a,getParentFolderName:c,getParentFolderLink:u,getParentFolderLinkIconAdditionalAttributes:l,getFolderLink:f}=si(),d=Ke(),m=ae(),w=j(()=>d.areFileExtensionsShown),b=j(()=>({...e.searchResult.data,...p(m)&&{thumbnail:p(m)}})),T=j(()=>r(p(b))),v=j(()=>{const I=p(b);return ee.isSpaceResource(I)&&I.disabled===!0}),g=()=>{n({space:p(T),resources:[p(b)]})},h=j(()=>e.isClickable?{parentFolderLink:u(p(b)),onClick:g}:{isResourceClickable:!1}),y=j(()=>{var $;if(p(b).isFolder)return f(p(b));const I=o({resources:[p(b)],space:p(T)});if(!(I!=null&&I.route))return null;const A=I.route({space:p(T),resources:[p(b)]});return A.query={...A.query,contextRouteQuery:{...(($=A.query)==null?void 0:$.contextRouteQuery)||{},term:e.term}},A}),S=a(p(b)),E=c(p(b)),R=l(p(b));return Mt(()=>{p(v)&&p(s).parentElement.classList.add("disabled");const I=async()=>{const $=await i({space:p(T),resource:p(b),dimensions:zn.Thumbnail,cancelRunning:!0,updateStore:!1});$&&(m.value=$)},A=Et.debounce(({unobserve:$})=>{$(),I()},250);t.observe(p(s).$el,{onEnter:A,onExit:A.cancel})}),jn(()=>{t.disconnect()}),(I,A)=>(J(),Ce(Fo,Zt({ref_key:"resourceListItem",ref:s,resource:b.value,"path-prefix":p(S),"is-path-displayed":!0,link:y.value,"is-extension-displayed":w.value,"parent-folder-link-icon-additional-attributes":p(R),"parent-folder-name":p(E),"is-thumbnail-displayed":!!m.value},h.value),null,16,["resource","path-prefix","link","is-extension-displayed","parent-folder-link-icon-additional-attributes","parent-folder-name","is-thumbnail-displayed"]))}}),mO=7,yO=200,bO=Me({name:"CreateShortcutModal",components:{ResourcePreview:yv},props:{modal:{type:Object,required:!0},space:{type:Object,required:!0}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:n}){const r=Ye(),{$gettext:o}=Ne.useGettext(),{showMessage:i,showErrorMessage:s}=rt(),a=ze(),{search:c}=bf(),{getPathPrefix:u,getParentFolderName:l,getParentFolderLink:f,getParentFolderLinkIconAdditionalAttributes:d,getFolderLink:m}=si(),w=Ke(),{resources:b,currentFolder:T}=He.storeToRefs(w),v=ae(null),g=ae(""),h=ae(""),y=ae(null),S=ae(null),E=ae(!1);let R=null;const I=K=>{const V=K.trim();return G(V)?V:`https://${V}`},A=j(()=>I(p(g))),$=j(()=>!!p(b).find(K=>K.name===`${p(h)}.url`)),D=j(()=>p($)||!p(h)||!p(g));Tt(D,()=>{t("update:confirmDisabled",p(D))},{immediate:!0});const k=j(()=>p($)?o("%{name} already exists",{name:`${p(h)}.url`}):/[/]/.test(p(h))?o('Shortcut name cannot contain "/"'):""),N=un.useTask(function*(K,V){y.value=null,V=`name:"*${V}*" NOT name:"*.url"`;try{y.value=yield c(V,mO)}catch{}}),z=Et.debounce(()=>{N.perform(p(g))},yO),G=K=>["http://","https://"].some(B=>B.startsWith(K)||K.startsWith(B)),X=()=>{y.value=null,g.value=p(A);try{let K=new URL(p(A)).host;p(b).some(V=>V.name===`${K}.url`)&&(K=Un(`${K}.url`,"url",p(b)).slice(0,-4)),h.value=K}catch{}},se=K=>{y.value=null;const V=new URL(window.location.href);let B=K.data.name;g.value=`${V.origin}/f/${K.id}`,p(b).some(q=>q.name===`${B}.url`)&&(B=Un(`${B}.url`,"url",p(b)).slice(0,-4)),h.value=B},ne=K=>p(S)===K,oe=(K=!1)=>{const V=Array.from(document.querySelectorAll("li.selectable-item"));let B=p(S)!==null?p(S):K?V.length:-1;const q=K?-1:1;do if(B+=q,B<0||B>V.length-1)return null;while(V[B].classList.contains("disabled"));return B},fe=()=>{S.value=oe(!0)},we=()=>{S.value=oe(!1)},Z=K=>{p(E)&&(K.stopPropagation(),p(v).hide())},re=K=>{var V,B;p(E)&&(K.stopPropagation(),p(S)!==null&&(p(S)===0?X():se((B=(V=p(y))==null?void 0:V.values)==null?void 0:B[p(S)-1]),p(v).hide()))},ce=()=>{E.value=!1,S.value=null},Ie=()=>{E.value=!0,S.value=0},Y=()=>{g.value.trim().length&&p(v).show()},_=async()=>{if(await Gn(),h.value=g.value.trim(),!g.value.trim().length){p(v).hide();return}p(v).show(),_n(a,"files-public-link")||z()},P=async()=>{try{const V=`[InternetShortcut]
52
+ URL=${Jf.sanitize(I(p(g)),{USE_PROFILES:{html:!0}})}`,B=ee.urlJoin(p(T).path,`${p(h)}.url`),q=await r.webdav.putFileContents(e.space,{path:B,content:V});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 Mt(async()=>{var K,V;await Gn(),R=new Zf((V=(K=p(v))==null?void 0:K.$refs)==null?void 0:V.drop)}),Tt(y,async()=>{await Gn(),!(!p(E)||!R)&&(R.unmark(),R.mark(p(g),{element:"span",className:"mark-highlight",exclude:[".selectable-item-url *",".create-shortcut-modal-search-separator *"]}))},{deep:!0}),Tt(S,()=>{var V,B;if(!p(E)||typeof((B=(V=p(v))==null?void 0:V.$el)==null?void 0:B.scrollTo)!="function")return;const K=p(v).$el.querySelectorAll(".selectable-item");p(v).$el.scrollTo(0,p(S)===null?0:K[p(S)].getBoundingClientRect().y-K[p(S)].getBoundingClientRect().height)}),n({onConfirm:P}),{inputUrl:g,inputFilename:h,dropRef:v,dropItemUrl:A,searchResult:y,confirmButtonDisabled:D,inputFileNameErrorMessage:k,searchTask:N,dropItemUrlClicked:X,dropItemResourceClicked:se,getPathPrefix:u,getFolderLink:m,getParentFolderLink:f,getParentFolderName:l,getParentFolderLinkIconAdditionalAttributes:d,onKeyEnterDrop:re,onKeyDownDrop:we,onKeyUpDrop:fe,onKeyEscDrop:Z,onHideDrop:ce,onShowDrop:Ie,onInputUrlInput:_,onClickUrlInput:Y,isDropItemActive:ne,onConfirm:P}}}),vO={class:"oc-flex oc-flex-middle create-shortcut-modal-label"},wO=["textContent"],SO=["textContent"],EO={key:0,class:"oc-p-xs oc-flex oc-flex-center"},TO={class:"create-shortcut-modal-search-separator oc-text-muted oc-text-small oc-pl-xs"},AO=["textContent"],RO={key:0,class:"oc-flex oc-width-1-1 oc-mt-m"},_O={class:"oc-flex oc-flex-middle create-shortcut-modal-label"},IO=["textContent"];function CO(e,t,n,r,o,i){const s=he("oc-contextual-helper"),a=he("oc-text-input"),c=he("oc-icon"),u=he("oc-button"),l=he("oc-spinner"),f=he("resource-preview"),d=he("oc-list"),m=he("oc-drop");return J(),Se(Qe,null,[ve(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:[Ji(e.onKeyUpDrop,["up"]),Ji(e.onKeyDownDrop,["down"]),Ji(e.onKeyEscDrop,["esc"]),Ji(e.onKeyEnterDrop,["enter"])],onClick:e.onClickUrlInput},{label:Te(()=>[pe("div",vO,[pe("label",{for:"create-shortcut-modal-url-input",textContent:W.toDisplayString(e.$gettext("Webpage or file"))},null,8,wO),ve(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"]),ve(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:Te(()=>[ve(d,null,{default:Te(()=>{var w,b;return[pe("li",{class:W.normalizeClass(["oc-p-xs selectable-item selectable-item-url",{active:e.isDropItemActive(0)}])},[ve(u,{class:"oc-width-1-1",appearance:"raw","justify-content":"left",onClick:e.dropItemUrlClicked},{default:Te(()=>[ve(c,{name:"external-link"}),pe("span",{textContent:W.toDisplayString(e.dropItemUrl)},null,8,SO)]),_:1},8,["onClick"])],2),e.searchTask.isRunning?(J(),Se("li",EO,[ve(l)])):Oe("",!0),(b=(w=e.searchResult)==null?void 0:w.values)!=null&&b.length?(J(),Se(Qe,{key:1},[pe("li",TO,[pe("span",{textContent:W.toDisplayString(e.$gettext("Link to a file"))},null,8,AO)]),(J(!0),Se(Qe,null,kt(e.searchResult.values,(T,v)=>(J(),Se("li",{key:v,class:W.normalizeClass(["oc-p-xs selectable-item",{active:e.isDropItemActive(v+1)}])},[ve(u,{class:"oc-width-1-1",appearance:"raw","justify-content":"left",onClick:g=>e.dropItemResourceClicked(T)},{default:Te(()=>[ve(f,{"search-result":T,"is-clickable":!1},null,8,["search-result"])]),_:2},1032,["onClick"])],2))),128))],64)):Oe("",!0)]}),_:1})]),_:1},8,["onHideDrop","onShowDrop"]),e.inputFilename?(J(),Se("div",RO,[ve(a,{id:"create-shortcut-modal-filename-input",modelValue:e.inputFilename,"onUpdate:modelValue":t[1]||(t[1]=w=>e.inputFilename=w),class:"oc-width-1-1","error-message":e.inputFileNameErrorMessage,"fix-message-line":!0},{label:Te(()=>[pe("div",_O,[pe("label",{for:"create-shortcut-modal-filename-input",textContent:W.toDisplayString(e.$gettext("Shortcut name"))},null,8,IO),ve(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","error-message"])])):Oe("",!0)],64)}const bv=Ve(bO,[["render",CO]]),FO=({space:e})=>{const{dispatchModal:t}=bt(),{$gettext:n}=Ne.useGettext(),r=Ke(),{currentFolder:o}=He.storeToRefs(r);return{actions:j(()=>[{name:"create-shortcut",icon:"external-link",handler:()=>{t({title:n("Create a Shortcut"),confirmText:n("Create"),customComponent:bv,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"}])}},PO=()=>{const{showErrorMessage:e}=rt(),t=ze(),{$gettext:n}=Ne.useGettext(),r=Or(),o=os(),i=Ye(),s=u=>{const l=/URL=(.+)/,f=u.match(l);if(f&&f[1])return f[1];throw new Error("unable to extract url")},a=async({resources:u,space:l})=>{try{const f=new URL(window.location.href),d=(await i.webdav.getFileContents(l,u[0])).body;let m=s(d);if(m=m.match(/^http[s]?:\/\//)?m:`https://${m}`,m=Jf.sanitize(m,{USE_PROFILES:{html:!0}}),m.startsWith(f.origin)){window.location.href=m;return}window.open(m)}catch(f){console.error(f),e({title:n("Failed to open shortcut"),errors:[f]})}};return{actions:j(()=>[{name:"open-shortcut",icon:"external-link",category:"context",handler:a,label:()=>n("Open shortcut"),isVisible:({resources:u})=>p(r)&&!p(o)&&!at(t,"files-spaces-generic")&&!_n(t,"files-public-link")&&!At(t,"files-common-favorites")&&!At(t,"files-common-search")&&!Nt(t,"files-shares-with-me")&&!Nt(t,"files-shares-with-others")&&!Nt(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}},OO=Me({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}=Ne.useGettext(),{getLinkRoleByType:r}=sa(),o=c=>e.modelValue===c,i=c=>{t("update:modelValue",c)},s=j(()=>{var c;return n((c=r(e.modelValue))==null?void 0:c.displayName)}),a=Yt.v4();return{isSelectedType:o,updateSelectedType:i,currentLinkRoleLabel:s,dropUuid:a,getLinkRoleByType:r}}}),xO=["textContent"],kO=["textContent"],NO={class:"oc-flex oc-flex-middle"},$O=["textContent"],DO={class:"oc-text-small"},LO={class:"oc-flex"};function MO(e,t,n,r,o,i){var f;const s=he("oc-icon"),a=he("oc-button"),c=he("oc-list"),u=he("oc-drop"),l=dn("oc-tooltip");return J(),Se(Qe,null,[e.availableLinkTypeOptions.length>1?(J(),Ce(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:Te(()=>[pe("span",{class:"link-current-role",textContent:W.toDisplayString(e.currentLinkRoleLabel||e.$gettext("Select a role"))},null,8,xO),ve(s,{name:"arrow-down-s"})]),_:1},8,["id"])):ot((J(),Se("span",{key:1,class:"link-current-role oc-mr-m",textContent:W.toDisplayString(e.currentLinkRoleLabel)},null,8,kO)),[[l,(f=e.getLinkRoleByType(e.modelValue))==null?void 0:f.description]]),e.availableLinkTypeOptions.length>1?(J(),Ce(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:Te(()=>[ve(c,{class:"role-dropdown-list"},{default:Te(()=>[(J(!0),Se(Qe,null,kt(e.availableLinkTypeOptions,(d,m)=>(J(),Se("li",{key:`role-dropdown-${m}`},[ve(a,{id:`files-role-${e.getLinkRoleByType(d).id}`,class:W.normalizeClass([{selected:e.isSelectedType(d),"oc-secondary-container":e.isSelectedType(d)},"oc-p-s"]),appearance:"raw","justify-content":"space-between",onClick:w=>e.updateSelectedType(d)},{default:Te(()=>[pe("span",NO,[ve(s,{name:e.getLinkRoleByType(d).icon,class:"oc-pl-s oc-pr-m"},null,8,["name"]),pe("span",null,[pe("span",{class:"role-dropdown-list-option-label oc-text-bold oc-display-block oc-width-1-1",textContent:W.toDisplayString(e.$gettext(e.getLinkRoleByType(d).displayName))},null,8,$O),pe("span",DO,W.toDisplayString(e.$gettext(e.getLinkRoleByType(d).description)),1)])]),pe("span",LO,[e.isSelectedType(d)?(J(),Ce(s,{key:0,name:"check"})):Oe("",!0)])]),_:2},1032,["id","class","onClick"])]))),128))]),_:1})]),_:1},8,["drop-id","toggle","offset"])):Oe("",!0)],64)}const vv=Ve(OO,[["render",MO],["__scopeId","data-v-0eaa2216"]]),BO=Me({name:"CreateLinkModal",components:{LinkRoleDropdown:vv},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=Ye(),r=Ne.useGettext(),{$gettext:o}=r,i=Lv(),{isEnabled:s,postMessage:a}=ni(),{defaultLinkType:c,getAvailableLinkTypes:u,getLinkRoleByType:l,isPasswordEnforcedForLinkType:f}=sa(),{addLink:d}=jt(),m=ae(!1),w=ae(!1),b=j(()=>e.resources.every(({isFolder:we})=>we)),T=j(()=>p(s)?o("Share link(s)"):o("Copy link")),v=ae(Yt.v4()),g=ae({}),h=ae(),y=Ca({value:"",error:void 0}),S=ae(p(c)),E=j(()=>o(l(p(S)).description)),R=j(()=>o(l(p(S)).displayName)),I=j(()=>l(p(S)).icon),A=j(()=>u({isFolder:p(b)})),$=j(()=>f(p(S))),D=i.getPolicy({enforcePassword:p($)}),k=()=>{m.value=!0},N=({date:we,error:Z})=>{h.value=we,w.value=Z},z=()=>Promise.allSettled(e.resources.map(we=>{var Z;return d({clientService:n,space:e.space,resource:we,options:{type:p(S),"@libre.graph.quickLink":!1,password:p(y).value,expirationDateTime:(Z=p(h))==null?void 0:Z.toISO(),displayName:o("Unnamed link")}})})),G=j(()=>!!D.check(p(y).value)),X=j(()=>!(p(G)&&!p(w))),se=async(we={})=>{const Z=await z(),re=Z.filter(({status:Y})=>Y==="fulfilled");re.length&&p(s)&&a("opencloud-embed:share",re.map(({value:Y})=>Y.webUrl));const ce=[],Ie=Z.filter(({status:Y})=>Y==="rejected");if(Ie.length&&Ie.map(({reason:Y})=>Y).forEach(Y=>{var _;if(console.error(Y),((_=Y.response)==null?void 0:_.status)===400){const P=Y.response.data.error;P.message=Et.upperFirst(P.message),ce.push(P)}}),ce.length)return y.error=o(ce[0].message),Promise.reject();e.callbackFn&&e.callbackFn({result:Z,password:y.value,options:we})};t({onConfirm:se});const ne=we=>p(S)===we,oe=we=>{y.value=we,y.error=void 0},fe=we=>{S.value=we};return Mt(()=>{const we=p(g)[p(S)];we&&we.$el.focus(),p($)&&(y.value=i.generatePassword())}),{roleRefs:g,password:y,passwordEnforced:$,passwordPolicy:D,generatePasswordMethod:()=>i.generatePassword(),passwordInputKey:v,selectedExpiry:h,availableLinkTypes:A,selectedType:S,selectedTypeIcon:I,selectedTypeDisplayName:R,selectedTypeDescription:E,isSelectedLinkType:ne,updateSelectedLinkType:fe,updatePassword:oe,getLinkRoleByType:l,confirmButtonText:T,isAdvancedMode:m,setAdvancedMode:k,onExpiryDateChanged:N,confirmButtonDisabled:X,DateTime:Dt.DateTime,onConfirm:se}}}),jO={class:"oc-flex oc-button-justify-content-space-between oc-pb-s"},UO={key:0,class:"oc-flex oc-flex-middle"},qO={key:1,class:"oc-flex oc-flex-middle"},VO={class:"oc-flex oc-flex-column"},zO=["textContent"],WO=["textContent"],HO=["textContent"],GO={class:"link-modal-password oc-mb-m"},KO={key:1,class:"link-modal-password-text oc-text-small oc-text-muted"},QO=["textContent"],XO=["textContent"],YO={class:"link-modal-actions oc-flex oc-flex-right oc-flex-middle oc-mt-s"},JO={class:"oc-rounded oc-menu-item-hover"};function ZO(e,t,n,r,o,i){const s=he("oc-icon"),a=he("link-role-dropdown"),c=he("oc-button"),u=he("oc-text-input"),l=he("oc-datepicker"),f=he("oc-list"),d=he("oc-drop");return J(),Se(Qe,null,[pe("div",jO,[e.isAdvancedMode?(J(),Se("div",UO,[ve(s,{class:"oc-mr-s",name:e.selectedTypeIcon,"fill-type":"line"},null,8,["name"]),ve(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"])])):(J(),Se("div",qO,[ve(s,{class:"oc-mr-s",name:e.selectedTypeIcon,"fill-type":"line"},null,8,["name"]),pe("div",VO,[pe("span",{class:"oc-text-bold",textContent:W.toDisplayString(e.selectedTypeDisplayName)},null,8,zO),pe("span",{class:"oc-text-small",textContent:W.toDisplayString(e.selectedTypeDescription)},null,8,WO)])])),e.isAdvancedMode?Oe("",!0):(J(),Ce(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:Te(()=>[ve(s,{name:"settings-3",size:"small","fill-type":"fill"}),pe("span",{textContent:W.toDisplayString(e.$gettext("Options"))},null,8,HO)]),_:1}))]),pe("div",GO,[e.isAdvancedMode?(J(),Ce(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.passwordEnforced?`${e.$gettext("Password")}*`:e.$gettext("Password"),class:"link-modal-password-input","onUpdate:modelValue":e.updatePassword},null,8,["model-value","password-policy","generate-password-method","error-message","label","onUpdate:modelValue"])):e.password.value?(J(),Se("div",KO,[pe("span",{textContent:W.toDisplayString(e.$gettext("Password:"))},null,8,QO),pe("span",{textContent:W.toDisplayString(e.password.value)},null,8,XO)])):Oe("",!0),e.isAdvancedMode?(J(),Ce(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"])):Oe("",!0)]),pe("div",YO,[ve(c,{class:"link-modal-cancel oc-modal-body-actions-cancel oc-ml-s",onClick:t[1]||(t[1]=m=>e.$emit("cancel"))},{default:Te(()=>[Vt(W.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),pe("div",{class:W.normalizeClass(["link-modal-confirm-button-group oc-ml-s",{"oc-button-group":e.password.value}])},[ve(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:Te(()=>[Vt(W.toDisplayString(e.confirmButtonText),1)]),_:1},8,["disabled"]),e.password.value?(J(),Ce(c,{key:0,class:"link-modal-confirm oc-modal-body-actions-confirm-secondary-trigger",appearance:"filled",disabled:e.confirmButtonDisabled},{default:Te(()=>[ve(s,{size:"small",name:"arrow-down-s"})]),_:1},8,["disabled"])):Oe("",!0),e.password.value?(J(),Ce(d,{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:Te(()=>[ve(f,{class:"oc-modal-body-actions-confirm-secondary-menu"},{default:Te(()=>[pe("li",JO,[ve(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:Te(()=>[Vt(W.toDisplayString(e.$gettext("Copy link and password")),1)]),_:1})])]),_:1})]),_:1})):Oe("",!0)],2)])],64)}const wv=Ve(BO,[["render",ZO],["__scopeId","data-v-0f5a06c6"]]),bn={Internal:"internal",View:"view",Upload:"upload",Edit:"edit",CreateOnly:"createOnly"},ex={LibreGraphPermissionsRolesAllowedValues:"@libre.graph.permissions.roles.allowedValues"},sa=()=>{const{$gettext:e}=Ne.useGettext(),t=rn(),n=hn(),r=j(()=>n.can("create-all","PublicLink")),o=j(()=>bn.View),i=u=>u===bn.View?t.sharingPublicPasswordEnforcedFor.read_only:u===bn.Upload?t.sharingPublicPasswordEnforcedFor.upload_only:u===bn.CreateOnly?t.sharingPublicPasswordEnforcedFor.read_write:u===bn.Edit?t.sharingPublicPasswordEnforcedFor.read_write_delete:!1,s=({isFolder:u})=>p(r)?u?[bn.View,bn.Edit,bn.CreateOnly]:[bn.View,bn.Edit]:[],a=[{id:bn.Internal,displayName:e("Invited people"),description:e("Link works only for invited people. Login is required."),icon:"user"},{id:bn.View,displayName:e("Can view"),description:e("View, download"),icon:"eye"},{id:bn.Upload,displayName:e("Can upload"),description:e("View, upload, download"),icon:"upload"},{id:bn.Edit,displayName:e("Can edit"),description:e("View, upload, edit, download, delete"),icon:"pencil"},{id:bn.CreateOnly,displayName:e("Secret File Drop"),description:e("Upload only, existing content is not revealed"),icon:"inbox-unarchive"}];return{defaultLinkType:o,isPasswordEnforcedForLinkType:i,getAvailableLinkTypes:s,linkShareRoles:a,getLinkRoleByType:u=>a.find(({id:l})=>l===u)}},tx=({enforceModal:e=!1}={})=>{const t=Ye(),n=vt(),{showMessage:r,showErrorMessage:o}=rt(),{$gettext:i,$ngettext:s}=Ne.useGettext(),a=rn(),c=hn(),u=cn(),{defaultLinkType:l}=sa(),{addLink:f}=jt(),{dispatchModal:d}=bt(),{copyToClipboard:m}=wf(),w=async({result:g,password:h,options:y={}})=>{const S=g.filter(R=>R.status==="fulfilled");if(S.length){let R=i("Link has been created successfully");if(g.length===1)try{const I=y.copyPassword?i("%{link} Password:%{password}",{link:S[0].value.webUrl,password:h},!0):S[0].value.webUrl;await m(I),R=i("The link has been copied to your clipboard.")}catch(I){console.warn("Unable to copy link to clipboard",I)}r({title:s(R,"Links have been created successfully.",S.length)})}const E=g.filter(({status:R})=>R==="rejected");E.length&&o({errors:E.map(({reason:R})=>R),title:s("Failed to create link","Failed to create links",E.length)})},b=async({space:g,resources:h})=>{const y=a.sharingPublicPasswordEnforcedFor.read_only===!0;if(e||y){d({title:s('Copy link for "%{resourceName}"',"Copy links for the selected items",h.length,{resourceName:h[0].name}),customComponent:wv,customComponentAttrs:()=>({space:g,resources:h,callbackFn:w}),hideActions:!0});return}const S=h.map(R=>f({clientService:t,space:g,resource:R,options:{"@libre.graph.quickLink":!1,displayName:i("Unnamed link"),type:p(l)}})),E=await u.addTask(()=>Promise.allSettled(S));w({result:E})},T=({resources:g})=>{if(!g.length)return!1;for(const h of g)if(!h.canShare({user:n.user,ability:c})||ee.isProjectSpaceResource(h)&&h.disabled)return!1;return!0};return{actions:j(()=>[{name:"create-links",icon:"link",handler:b,label:()=>i("Create links"),isVisible:T,class:"oc-files-actions-create-links"}])}},nx=Me({name:"AppLoadingSpinner"}),rx={class:"oc-flex oc-flex-middle oc-flex-center oc-height-1-1 oc-width-1-1"};function ix(e,t,n,r,o,i){const s=he("oc-spinner");return J(),Se("div",rx,[ve(s,{id:"app-loading-spinner",size:"large","aria-hidden":!0,"aria-label":""})])}const xf=Ve(nx,[["render",ix]]),ox=Me({name:"FilePickerModal",components:{AppLoadingSpinner:xf},props:{modal:{type:Object,required:!0},app:{type:Object,required:!0},parentFolderLink:{type:Object,required:!0}},setup(e){const t=ae(),n=ae(!0),r=ze(),{removeModal:o}=bt(),{getMatchingSpace:i}=ln(),s=ii(),{getEditorRouteOpts:a}=Vn(),c=r.resolve(e.parentFolderLink),u=e.app.extensions.map(b=>b.extension?b.extension:b.mimeType),l=s.currentTheme.name,f=new URL(c.href,window.location.origin);f.searchParams.append("hide-logo","true"),f.searchParams.append("embed","true"),f.searchParams.append("embed-target","file"),f.searchParams.append("embed-delegate-authentication","false"),f.searchParams.append("embed-file-types",u.join(","));const d=()=>{n.value=!1,p(t).contentWindow.focus()},m=({data:b})=>{if(b.name!=="opencloud-embed:file-pick")return;const{resource:T,locationQuery:v}=b.data,g=i(T),h=ee.isShareSpaceResource(g)?g.id:void 0,y=a(p(r.currentRoute).name,g,T,h);y.query={...y.query,...v};const S=r.resolve(y),E=new URL(S.href,window.location.origin);o(e.modal.id),window.open(E.href,"_blank")},w=({data:b})=>{b.name==="opencloud-embed:cancel"&&o(e.modal.id)};return Mt(()=>{window.addEventListener("message",m),window.addEventListener("message",w)}),jn(()=>{window.removeEventListener("message",m),window.removeEventListener("message",w)}),{isLoading:n,onLoad:d,iframeTitle:l,iframeSrc:f.href,iframeRef:t,onFilePick:m}}}),sx={class:"oc-height-1-1",tabindex:"0"},ax=["title","src"];function lx(e,t,n,r,o,i){const s=he("app-loading-spinner");return J(),Se("div",sx,[e.isLoading?(J(),Ce(s,{key:0})):Oe("",!0),ot(pe("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,ax),[[Ya,!e.isLoading]])])}const Sv=Ve(ox,[["render",lx]]),aa=(e={},t)=>{const n=e.targetRouteCallback,{getMatchingSpace:r}=ln(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?xn("files-spaces-generic",Jn(l,{path:a,fileId:c})):{}}}},si=(e={})=>{const t=rn(),{$gettext:n}=Ne.useGettext(),{getInternalSpace:r,getMatchingSpace:o,isResourceAccessible:i}=ln(),{createFolderLink:s}=aa(e);return{getPathPrefix:d=>{const m=p(e.space)||o(d);return ee.isProjectSpaceResource(m)?ss.join(n("Spaces"),m.name):ee.isShareSpaceResource(m)?ss.join(n("Shares"),m.name):m.name},getFolderLink:d=>s({path:d.path,fileId:d.fileId,resource:d}),getParentFolderLink:d=>{const m=p(e.space)||o(d),w=i({space:m,path:gt.dirname(d.path)});return d.remoteItemId&&d.path==="/"||!w?kn("files-shares-with-me"):ee.isProjectSpaceResource(d)?xn("files-spaces-projects"):s({path:gt.dirname(d.path),...d.parentFolderId&&{fileId:d.parentFolderId},resource:d})},getParentFolderName:d=>{const m=p(e.space)||o(d),w=i({space:m,path:gt.dirname(d.path)});if(ee.isShareRoot(d)||d.id===m.id&&ee.isShareSpaceResource(m)||!w)return n("Shared with me");const T=ee.extractParentFolderName(d);if(T)return T;if(ee.isShareSpaceResource(m))return m.name;if(t.spacesProjects){if(ee.isProjectSpaceResource(d))return n("Spaces");if((m==null?void 0:m.driveType)==="project")return m.name}return n("Personal")},getParentFolderLinkIconAdditionalAttributes:d=>ee.isProjectSpaceResource(d)||ee.isProjectSpaceResource(r(d.storageId)||{})&&d.path.split("/").length===2?{name:"layout-grid","fill-type":"fill"}:{}}},Ev=({appId:e})=>{const{$gettext:t}=Ne.useGettext(),n=Or(),{dispatchModal:r}=bt(),o=Zn(),{apps:i}=He.storeToRefs(o),{getParentFolderLink:s}=si(),a=({resources:u})=>{const l=p(i)[e],f=s(u[0]);r({elementClass:"open-with-app-modal",title:t("Open file in %{app}",{app:l.name}),customComponent:Sv,hideActions:!0,customComponentAttrs:()=>({app:l,parentFolderLink:f}),focusTrapInitial:!1})};return{actions:j(()=>[{name:"open-with-app",icon:"folder-open",handler:a,label:()=>t("Open"),isVisible:()=>!p(n),class:"oc-files-actions-open-with-app-trigger"}])}},cx=Me({name:"SaveAsModal",components:{AppLoadingSpinner:xf},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=ae(),n=ae(!0),r=ii(),{$gettext:o}=Ne.useGettext(),i=ze(),s=Ye(),{removeModal:a}=bt(),{showMessage:c,showErrorMessage:u}=rt(),{getMatchingSpace:l}=ln(),{getEditorRouteOpts:f}=Vn(),d=i.resolve(e.parentFolderLink),m=r.currentTheme.name,w=new URL(d.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 b=()=>{n.value=!1,p(t).contentWindow.focus()},T=async({data:y})=>{if(y.name!=="opencloud-embed:select")return;const{resources:S,fileName:E,locationQuery:R}=y.data,I=S[0],A=l(I);try{const $=await v({destinationFolder:I,fileName:E,space:A});c({title:o('"%{fileName}" was saved successfully',{fileName:$.name})}),g({resource:$,space:A,locationQuery:R})}catch($){console.error($),u({title:o('Unable to save "%{fileName}"',{fileName:E}),errors:[$]}),console.error($)}a(e.modal.id)},v=async({destinationFolder:y,fileName:S,space:E})=>{const{children:R}=await s.webdav.listFiles(E,{fileId:y.fileId},{davProperties:[qe.Name]});return R.find(A=>A.name===S)&&(S=Un(S,e.originalResource.extension,R)),s.webdav.putFileContents(E,{fileName:S,parentFolderId:y.id,content:e.content,path:ee.urlJoin(y.path,S)})},g=({locationQuery:y,resource:S,space:E})=>{const R=ee.isShareSpaceResource(E)?E.id:void 0,I=f(p(i.currentRoute).name,E,S,R);I.query={...I.query,...y};const A=i.resolve(I),$=new URL(A.href,window.location.origin);window.open($.href,"_blank")},h=({data:y})=>{y.name==="opencloud-embed:cancel"&&a(e.modal.id)};return Mt(()=>{window.addEventListener("message",T),window.addEventListener("message",h)}),jn(()=>{window.removeEventListener("message",T),window.removeEventListener("message",h)}),{isLoading:n,onLoad:b,iframeTitle:m,iframeSrc:w.href,iframeRef:t,onLocationPick:T}}}),ux={class:"oc-height-1-1",tabindex:"0"},fx=["title","src"];function dx(e,t,n,r,o,i){const s=he("app-loading-spinner");return J(),Se("div",ux,[e.isLoading?(J(),Ce(s,{key:0})):Oe("",!0),ot(pe("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,fx),[[Ya,!e.isLoading]])])}const Tv=Ve(cx,[["render",dx]]),Av=({content:e})=>{const{$gettext:t}=Ne.useGettext(),n=Or(),{dispatchModal:r}=bt(),{getParentFolderLink:o}=si(),i=({resources:a})=>{const c=o(a[0]);r({elementClass:"save-as-modal",title:t("Save as"),customComponent:Tv,hideActions:!0,customComponentAttrs:()=>({content:p(e),parentFolderLink:c,originalResource:a[0]}),focusTrapInitial:!1})};return{actions:j(()=>[{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"}])}},Rv=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=vt(),{$gettext:r,$ngettext:o}=Ne.useGettext(),i=hn(),s=Ye(),a=en(),{dispatchModal:c}=bt(),u=lt(),{removeResources:l}=Ke(),f=b=>b.filter(T=>ee.isProjectSpaceResource(T)&&T.canBeDeleted({user:n.user,ability:i})),d=async b=>{const T=s.graphAuthenticated,v=b.map(S=>T.drives.deleteDrive(S.id).then(()=>(l([S]),u.removeSpace(S),!0))),g=await Promise.allSettled(v),h=g.filter(S=>S.status==="fulfilled");if(h.length){const S=h.length===1&&b.length===1?r('Space "%{space}" was deleted successfully',{space:b[0].name}):o("%{spaceCount} space was deleted successfully","%{spaceCount} spaces were deleted successfully",h.length,{spaceCount:h.length.toString()},!0);e({title:S})}const y=g.filter(S=>S.status==="rejected");if(y.length){y.forEach(console.error);const S=y.length===1&&b.length===1?r('Failed to delete space "%{space}"',{space:b[0].name}):o("Failed to delete %{spaceCount} space","Failed to delete %{spaceCount} spaces",y.length,{spaceCount:y.length.toString()},!0);t({title:S,errors:y.map(E=>E.reason)})}p(a).name==="admin-settings-spaces"&&Xe.publish("app.admin-settings.list.load")},m=({resources:b})=>{const T=f(b);if(!T.length)return;const v=o("Are you sure you want to delete the selected space?","Are you sure you want to delete %{count} selected spaces?",T.length,{count:T.length.toString()});c({title:o('Delete Space "%{space}"?',"Delete %{spaceCount} Spaces?",T.length,{space:T[0].name,spaceCount:T.length.toString()}),confirmText:r("Delete"),message:v,hasInput:!1,onConfirm:()=>d(T)})};return{actions:j(()=>[{name:"delete",icon:"delete-bin",label:()=>r("Delete"),handler:m,isVisible:({resources:b})=>!!f(b).length,class:"oc-files-actions-delete-trigger"}]),deleteSpaces:d}},_v=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=vt(),{$gettext:r,$ngettext:o}=Ne.useGettext(),i=hn(),s=Ye(),a=en(),c=ze(),{dispatchModal:u}=bt(),l=lt(),f=b=>b.filter(T=>ee.isProjectSpaceResource(T)&&T.canDisable({user:n.user,ability:i})),d=async b=>{const T=p(a),v=s.graphAuthenticated,g=b.map(E=>v.drives.disableDrive(E.id).then(()=>(T.name==="files-spaces-generic"&&c.push({name:"files-spaces-projects"}),T.name==="admin-settings-spaces"&&(E.disabled=!0,E.spaceQuota={total:E.spaceQuota.total}),l.updateSpaceField({id:E.id,field:"disabled",value:!0}),!0))),h=await Promise.allSettled(g),y=h.filter(E=>E.status==="fulfilled");if(y.length){const E=y.length===1&&b.length===1?r('Space "%{space}" was disabled successfully',{space:b[0].name}):o("%{spaceCount} space was disabled successfully","%{spaceCount} spaces were disabled successfully",y.length,{spaceCount:y.length.toString()},!0);e({title:E})}const S=h.filter(E=>E.status==="rejected");if(S.length){S.forEach(console.error);const E=S.length===1&&b.length===1?r('Failed to disable space "%{space}"',{space:b[0].name}):o("Failed to disable %{spaceCount} space","Failed to disable %{spaceCount} spaces",S.length,{spaceCount:S.length.toString()},!0);t({title:E,errors:S.map(R=>R.reason)})}},m=({resources:b})=>{const T=f(b);if(!T.length)return;const v=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.",T.length,{count:T.length.toString()}),g=r("Disable");u({title:o('Disable Space "%{space}"?',"Disable %{spaceCount} Spaces?",T.length,{space:T[0].name,spaceCount:T.length.toString()}),confirmText:g,message:v,hasInput:!1,onConfirm:()=>d(T)})};return{actions:j(()=>[{name:"disable",icon:"stop-circle",label:()=>r("Disable"),handler:m,isVisible:({resources:b})=>!!f(b).length,class:"oc-files-actions-disable-trigger"}]),disableSpaces:d}},Iv=()=>{const e=st(),t=lt(),n=jt(),{showMessage:r,showErrorMessage:o}=rt(),i=ze(),{$gettext:s}=Ne.useGettext(),a=hn(),c=Ye(),u=cn(),{upsertResource:l}=Ke(),f=at(i,"files-spaces-projects"),d=async b=>{const T=t.spaces.filter(ee.isProjectSpaceResource),v=Un(b.name,"",T);try{let g=await c.graphAuthenticated.drives.createDrive({name:v,description:b.description,quota:{total:b.spaceQuota.total}},n.graphRoles);const h=await c.webdav.listFiles(b);if(h.children.length){const y=new Lr({concurrency:e.options.concurrentRequests.resourceBatchActions}),S=[];for(const E of h.children)S.push(y.add(()=>c.webdav.copyFiles(b,E,g,{path:E.name})));await Promise.all(S)}if(b.spaceReadmeData||b.spaceImageData){const y={special:[]};if(b.spaceReadmeData){const S=await c.webdav.getFileInfo(g,{path:`.space/${b.spaceReadmeData.name}`});y.special.push({specialFolder:{name:"readme"},id:S.id})}if(b.spaceImageData){const S=await c.webdav.getFileInfo(g,{path:`.space/${b.spaceImageData.name}`});y.special.push({specialFolder:{name:"image"},id:S.id})}g=await c.graphAuthenticated.drives.updateDrive(g.id,y,n.graphRoles)}t.upsertSpace(g),f&&l(g),r({title:s('Space "%{space}" was duplicated successfully',{space:b.name})})}catch(g){console.error(g),o({title:s('Failed to duplicate space "%{space}"',{space:b.name}),errors:[g]})}},m=async({resources:b})=>{for(const T of b)T.disabled||!ee.isProjectSpaceResource(T)||await d(T)};return{actions:j(()=>[{name:"duplicate",icon:"folders",label:()=>s("Duplicate"),handler:b=>u.addTask(()=>m(b)),isVisible:({resources:b})=>!(b!=null&&b.length)||b.every(T=>T.disabled)||b.every(T=>!ee.isProjectSpaceResource(T))?!1:a.can("create-all","Drive"),class:"oc-files-actions-duplicate-trigger"}]),duplicateSpace:d}},px=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=vt(),{$gettext:r}=Ne.useGettext(),o=hn(),i=Ye(),s=en(),{dispatchModal:a}=bt(),c=lt(),u=jt(),l=(m,w)=>i.graphAuthenticated.drives.updateDrive(m.id,{name:m.name,description:w},u.graphRoles).then(()=>{c.updateSpaceField({id:m.id,field:"description",value:w}),p(s).name==="admin-settings-spaces"&&(m.description=w),e({title:r("Space subtitle was changed successfully")})}).catch(T=>{console.error(T),t({title:r("Failed to change space subtitle"),errors:[T]})}),f=({resources:m})=>{m.length===1&&a({title:r("Change subtitle for space")+" "+m[0].name,confirmText:r("Confirm"),hasInput:!0,inputLabel:r("Space subtitle"),inputValue:m[0].description,onConfirm:w=>l(m[0],w)})};return{actions:j(()=>[{name:"editDescription",icon:"h-2",iconFillType:"none",label:()=>r("Edit subtitle"),handler:f,isVisible:({resources:m})=>m.length!==1?!1:m[0].canEditDescription({user:n.user,ability:o}),class:"oc-files-actions-edit-description-trigger"}]),editDescriptionSpace:l}},hx={name:"QuotaSelect",props:{totalQuota:{type:Number,default:0},maxQuota:{type:Number,default:0}},emits:["selectedOptionChange"],setup(){const e=ae(void 0),t=ae([]);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 Et.isNumber(e)?e>0:/^[0-9]\d*(([.,])\d+)?$/g.test(e)},createOption(e){if(e=e.replace(",","."),!this.isValueValidNumber(e))return{displayValue:e,value:e,error:this.$gettext("Please enter only numbers"),selectable:!1};const t=parseFloat(e)*Math.pow(10,9);return t>this.quotaLimit?{value:t,displayValue:this.getFormattedFileSize(t),error:this.$gettext("Please enter a value equal to or less than %{ quotaLimit }",{quotaLimit:this.getFormattedFileSize(this.quotaLimit).toString()}),selectable:!1}:{value:t,displayValue:this.getFormattedFileSize(t)}},setOptions(){let e=[...this.DEFAULT_OPTIONS];this.maxQuota&&(e=e.filter(n=>this.totalQuota===0&&n.value===0?(n.selectable=!1,!0):n.value!==0&&n.value<=this.maxQuota)),e.find(n=>n.value===this.totalQuota)||e.push({displayValue:this.getFormattedFileSize(this.totalQuota),value:this.totalQuota,selectable:this.totalQuota<=this.quotaLimit}),e=[...e.filter(n=>n.value).sort((n,r)=>n.value-r.value),...e.filter(n=>!n.value)],this.options=e},getFormattedFileSize(e){const t=En(e,this.$language.current);return this.isValueValidNumber(e)?t:e.toString()}}},gx={class:"quota-select-batch-action-form"},mx=["textContent"],yx={class:"oc-flex oc-flex-between"},bx=["textContent"],vx={key:0,class:"oc-text-input-danger"};function wx(e,t,n,r,o,i){const s=he("oc-icon"),a=he("oc-select");return J(),Se("div",gx,[ve(a,Zt({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":Te(({displayValue:c})=>[e.$attrs["read-only"]?(J(),Ce(s,{key:0,name:"lock",class:"oc-mr-xs",size:"small"})):Oe("",!0),pe("span",{textContent:W.toDisplayString(c)},null,8,mx)]),search:Te(({attributes:c,events:u})=>[pe("input",Zt({class:"vs__search"},c,qa(u,!0)),null,16)]),option:Te(({displayValue:c,error:u})=>[pe("div",yx,[pe("span",{textContent:W.toDisplayString(c)},null,8,bx)]),u?(J(),Se("div",vx,W.toDisplayString(u),1)):Oe("",!0)]),_:1},16,["model-value","selectable","options","create-option","label","onUpdate:modelValue"])])}const Cv=Ve(hx,[["render",wx]]),Sx=Me({name:"SpaceQuotaModal",components:{QuotaSelect:Cv},props:{modal:{type:Object,required:!0},spaces:{type:Array,required:!0},warningMessage:{type:String,default:""},warningMessageContextualHelperData:{type:Object,default:()=>{}},resourceType:{type:String,required:!1,default:"space",validator:e=>["space","user"].includes(e)}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:n}){const{showMessage:r,showErrorMessage:o}=rt(),i=rn(),s=He.storeToRefs(i),{$gettext:a,$ngettext:c}=Ne.useGettext(),u=Ye(),l=ze(),f=lt(),d=jt(),{updateResourceField:m}=Ke(),w=ae(0),b=y=>e.resourceType==="space"?c("Space quota was changed successfully","Quota of %{count} spaces was changed successfully",y,{count:y.toString()}):e.resourceType==="user"?c("User quota was changed successfully","Quota of %{count} users was changed successfully",y,{count:y.toString()}):a("Quota was changed successfully"),T=y=>e.resourceType==="space"?c("Failed to change space quota","Failed to change quota for %{count} spaces",y,{count:y.toString()}):e.resourceType==="user"?c("Failed to change user quota","Failed to change quota for %{count} users",y,{count:y.toString()}):a("Failed to change quota"),v=j(()=>!e.spaces.some(y=>y.spaceQuota.total!==p(w)));Tt(v,()=>{t("update:confirmDisabled",p(v))},{immediate:!0});const g=y=>{w.value=y.value},h=async()=>{const y=u.graphAuthenticated,S=e.spaces.map(async A=>{const $=await y.drives.updateDrive(A.id,{name:A.name,quota:{total:p(w)}},d.graphRoles);p(l.currentRoute).name==="admin-settings-spaces"&&Xe.publish("app.admin-settings.spaces.space.quota.updated",{spaceId:A.id,quota:$.spaceQuota}),p(l.currentRoute).name==="admin-settings-users"&&Xe.publish("app.admin-settings.users.user.quota.updated",{spaceId:A.id,quota:$.spaceQuota}),f.updateSpaceField({id:A.id,field:"spaceQuota",value:$.spaceQuota}),m({id:A.id,field:"spaceQuota",value:$.spaceQuota})}),E=await Promise.allSettled(S),R=E.filter(A=>A.status==="fulfilled");R.length&&r({title:b(R.length)});const I=E.filter(A=>A.status==="rejected");I.length&&(console.error(I),I.forEach(console.error),o({title:T(I.length),errors:I.map(A=>A.reason)}))};return n({onConfirm:h}),Mt(()=>{var y,S;w.value=((S=(y=e.spaces[0])==null?void 0:y.spaceQuota)==null?void 0:S.total)||0}),{selectedOption:w,confirmButtonDisabled:v,changeSelectedQuotaOption:g,maxQuota:s.spacesMaxQuota,onConfirm:h}}}),Ex={key:0,class:"oc-mt-s"},Tx=["textContent"];function Ax(e,t,n,r,o,i){const s=he("quota-select"),a=he("oc-contextual-helper");return J(),Se(Qe,null,[ve(s,{"total-quota":e.selectedOption,"max-quota":e.maxQuota,"position-fixed":!0,onSelectedOptionChange:e.changeSelectedQuotaOption},null,8,["total-quota","max-quota","onSelectedOptionChange"]),e.warningMessage?(J(),Se("div",Ex,[pe("span",{class:"oc-text-input-warning",textContent:W.toDisplayString(e.warningMessage)},null,8,Tx),e.warningMessageContextualHelperData?(J(),Ce(a,Zt({key:0,class:"oc-pl-xs"},e.warningMessageContextualHelperData),null,16)):Oe("",!0)])):Oe("",!0)],64)}const Fv=Ve(Sx,[["render",Ax]]),Pv=()=>{const{dispatchModal:e}=bt(),{$gettext:t}=Ne.useGettext(),n=hn(),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:Fv,customComponentAttrs:()=>({spaces:s,resourceType:"space"})})};return{actions:j(()=>[{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 Ov(){const{getDefaultAction:e}=Vn();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 Rx=()=>{const e=Ye(),{openWithDefaultApp:t}=Ov(),{createDefaultMetaFolder:n}=Di(),r=vt(),o=lt(),i=jt(),{$gettext:s}=Ne.useGettext(),{getDefaultMetaFolder:a}=oi(),c=async(f,d)=>{const m=await e.webdav.putFileContents(f,{path:".space/readme.md",parentFolderId:d.id,fileName:"readme.md"}),w=await e.graphAuthenticated.drives.updateDrive(f.id,{name:f.name,special:[{specialFolder:{name:"readme"},id:m.id}]},i.graphRoles);return o.updateSpaceField({id:f.id,field:"spaceReadmeData",value:w.spaceReadmeData}),m},u=async({resources:f})=>{let d=null,m=await a(f[0]);if(m||(m=await n(f[0]),d=await c(f[0],m)),!d){const w=ee.getRelativeSpecialFolderSpacePath(f[0],"readme");w?d=await e.webdav.getFileInfo(f[0],{path:w}):d=await c(f[0],m)}t({space:f[0],resource:d})};return{actions:j(()=>[{name:"editReadmeContent",icon:"article",label:()=>s("Edit description"),handler:u,isVisible:({resources:f})=>f.length!==1?!1:f[0].canEditReadme({user:r.user}),class:"oc-files-actions-edit-readme-content-trigger"}])}},xv=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=vt(),{$gettext:r}=Ne.useGettext(),o=hn(),i=Ye(),s=en(),{checkSpaceNameModalInput:a}=oi(),{dispatchModal:c}=bt(),u=lt(),l=jt(),f=(w,b)=>i.graphAuthenticated.drives.updateDrive(w.id,{name:b},l.graphRoles).then(()=>{p(s).name==="admin-settings-spaces"&&(w.name=b),u.updateSpaceField({id:w.id,field:"name",value:b}),e({title:r("Space name was changed successfully")})}).catch(v=>{console.error(v),t({title:r("Failed to rename space"),errors:[v]})}),d=({resources:w})=>{w.length===1&&c({title:r("Rename space")+" "+w[0].name,confirmText:r("Rename"),hasInput:!0,inputLabel:r("Space name"),inputValue:w[0].name,onConfirm:b=>f(w[0],b),onInput:a})};return{actions:j(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:d,isVisible:({resources:w})=>w.length!==1?!1:w[0].canRename({user:n.user,ability:o}),class:"oc-files-actions-rename-trigger"}]),renameSpace:f}},kv=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=vt(),{$gettext:r,$ngettext:o}=Ne.useGettext(),i=hn(),s=Ye(),a=cn(),c=en(),{dispatchModal:u}=bt(),l=lt(),f=jt(),d=T=>T.filter(v=>ee.isProjectSpaceResource(v)&&v.canRestore({user:n.user,ability:i})),m=async T=>{const v=s.graphAuthenticated,g=T.map(E=>v.drives.updateDrive(E.id,{name:E.name},f.graphRoles,{headers:{Restore:"true"}}).then(R=>(p(c).name==="admin-settings-spaces"&&(E.disabled=!1,E.spaceQuota=R.spaceQuota),l.updateSpaceField({id:E.id,field:"disabled",value:!1}),!0))),h=await a.addTask(()=>Promise.allSettled(g)),y=h.filter(E=>E.status==="fulfilled");if(y.length){const E=y.length===1&&T.length===1?r('Space "%{space}" was enabled successfully',{space:T[0].name}):o("%{spaceCount} space was enabled successfully","%{spaceCount} spaces were enabled successfully",y.length,{spaceCount:y.length.toString()},!0);e({title:E})}const S=h.filter(E=>E.status==="rejected");if(S.length){S.forEach(console.error);const E=S.length===1&&T.length===1?r('Failed to enabled space "%{space}"',{space:T[0].name}):o("Failed to enable %{spaceCount} space","Failed to enable %{spaceCount} spaces",S.length,{spaceCount:S.length.toString()},!0);t({title:E,errors:S.map(R=>R.reason)})}},w=({resources:T})=>{const v=d(T);if(!v.length)return;const g=o("If you enable the selected space, it can be accessed again.","If you enable the %{count} selected spaces, they can be accessed again.",v.length,{count:v.length.toString()}),h=r("Enable");u({title:o('Enable Space "%{space}"?',"Enable %{spaceCount} Spaces?",v.length,{space:v[0].name,spaceCount:v.length.toString()}),confirmText:h,message:g,hasInput:!1,onConfirm:()=>m(v)})};return{actions:j(()=>[{name:"restore",icon:"play-circle",label:()=>r("Enable"),handler:w,isVisible:({resources:T})=>!!d(T).length,class:"oc-files-actions-restore-trigger"}]),restoreSpaces:m}},_x=()=>{const{$gettext:e}=Ne.useGettext(),t=Ke(),n=({resources:o})=>{t.setSelection(o.map(({id:i})=>i)),Xe.publish(yt.openWithPanel,"space-share")};return{actions:j(()=>[{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"}])}},Ix=()=>{const e=ze(),{$gettext:t}=Ne.useGettext(),n=o=>Ri("files-trash-generic",{...Jn(o,{fileId:o.fileId})});return{actions:j(()=>[{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"}])}},Cx=Me({name:"EmojiPickerModal",components:{},props:{modal:{type:Object,required:!0}},emits:["confirm"],setup(e,{emit:t}){const n=ii(),{currentTheme:r}=He.storeToRefs(n),o=j(()=>p(r).isDark?"dark":"light");return{onEmojiSelect:s=>{t("confirm",s)},theme:o}}});function Fx(e,t,n,r,o,i){const s=he("oc-emoji-picker");return J(),Ce(s,{theme:e.theme,onEmojiSelect:e.onEmojiSelect},null,8,["theme","onEmojiSelect"])}const Nv=Ve(Cx,[["render",Fx]]),Px=()=>{const e=vt(),{showMessage:t,showErrorMessage:n}=rt(),{$gettext:r}=Ne.useGettext(),o=Ye(),i=cn(),s=lt(),{createDefaultMetaFolder:a}=Di(),{dispatchModal:c}=bt(),{getDefaultMetaFolder:u}=oi(),l=jt(),f=({resources:b})=>{b.length===1&&c({elementClass:"oc-width-auto",title:r("Set icon for %{space}",{space:b[0].name}),hideConfirmButton:!0,customComponent:Nv,focusTrapInitial:!1,onConfirm:T=>m(b[0],T)})},d=async b=>{const T=document.createElement("canvas"),v=T.getContext("2d"),g=16/9,h=720,y=h/g;T.width=h,T.height=y;const S=.4*h;v.font=`${S}px sans-serif`,v.textBaseline="middle",v.textAlign="center",v.fillText(b,T.width/2,T.height/2+15);const R=await Eb(T);return Sb(R)},m=async(b,T)=>{const v=o.graphAuthenticated,g=await d(T);let h=await u(b);return h||(h=await a(b)),i.addTask(async()=>{const y={"Content-Type":"application/offset+octet-stream"};try{const{fileId:S}=await o.webdav.putFileContents(b,{parentFolderId:h.id,fileName:"emoji.png",content:g,headers:y,overwrite:!0}),E=await v.drives.updateDrive(b.id,{name:b.name,special:[{specialFolder:{name:"image"},id:S}]},l.graphRoles);s.updateSpaceField({id:b.id,field:"spaceImageData",value:E.spaceImageData}),t({title:r("Space icon was set successfully")}),Xe.publish("app.files.spaces.uploaded-image",E)}catch(S){console.error(S),n({title:r("Failed to set space icon"),errors:[S]})}})};return{actions:j(()=>[{name:"set-space-icon",icon:"emoji-sticker",handler:f,label:()=>r("Set icon"),isVisible:({resources:b})=>b.length!==1?!1:b[0].canEditImage({user:e.user}),class:"oc-files-actions-set-space-icon-trigger"}]),setIconSpace:m}},Ox=()=>{const{$gettext:e}=Ne.useGettext();return{actions:j(()=>[{name:"show-details",icon:"information",label:()=>e("Details"),handler:()=>Xe.publish(yt.open),isVisible:({resources:n})=>n.length>0,class:"oc-admin-settings-show-details-trigger"}])}},xx=()=>{const{getMatchingSpace:e}=ln(),t=lt(),n=Zn(),r=Ke(),o=Ye(),{$gettext:i}=Ne.useGettext(),{openEditor:s}=Vn(),{resources:a,currentFolder:c}=He.storeToRefs(r);return{openEmptyEditor:async(l,f)=>{var h;let d=p(c)?e(p(c)):null,m=p(a),w=(h=p(c))==null?void 0:h.path;(!d||!p(c).canCreate())&&(d=t.personalSpace,m=(await o.webdav.listFiles(d)).children,w="");let b=i("New file")+`.${f}`;m.some(y=>y.name===b)&&(b=Un(b,f,m));const T=await o.webdav.putFileContents(d,{path:ee.urlJoin(w,b)}),v=e(T),g=n.fileExtensions.find(({app:y,extension:S})=>y===l&&S===f);s(g,v,T)}}},$v=()=>{const{$gettext:e}=Ne.useGettext(),{showMessage:t}=rt();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.")})}}},kx=()=>mr("$appProviderService"),Nx=()=>{const{isResourceAccessible:e}=ln();return{breadcrumbsFromPath:({route:r,space:o,resourcePath:i,ancestorMetaData:s=ae({})})=>{const a=(l="")=>l.split("/").filter(Boolean),c=a(r.path),u=a(i);return u.map((l,f)=>{const d=ee.urlJoin(...u.slice(0,f+1),{leadingSlash:!0}),m=e({space:p(o),path:d});let w;return m&&(w=p(s)[d]),{id:Yt.v4(),allowContextActions:!0,text:l,...m&&{to:{path:"/"+[...c].splice(0,c.length-u.length+f+1).join("/"),query:{...ki(r.query,"page","fileId"),...w&&{fileId:w.id}}}},isStaticNav:!1}})},concatBreadcrumbs:(...r)=>{const o=r.pop();return[...r,{id:Yt.v4(),allowContextActions:o.allowContextActions,text:o.text,onClick:()=>Xe.publish("app.files.list.load"),isTruncationPlaceholder:o.isTruncationPlaceholder,isStaticNav:o.isStaticNav}]}}},$x=(e="")=>{const t=ae(0),n=async()=>{await Gn();const r=document.querySelector(e||"#files-app-bar"),o=r?r.getBoundingClientRect().height:0;t.value!==o&&(t.value=o)};return window.onresize=n,Mt(n),{y:t,refresh:n}},kf=()=>{const e=ae(!0),t=()=>{e.value=window.innerHeight>500};return Mt(()=>{t(),window.addEventListener("resize",t)}),jn(()=>{window.removeEventListener("resize",t)}),{isSticky:e}};var Nf=(e=>(e.C="c",e.V="v",e.X="x",e.A="a",e.S="s",e.Space=" ",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.Esc="Escape",e))(Nf||{}),$f=(e=>(e.Ctrl="Control",e.Shift="Shift",e))($f||{});const Dx=()=>{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"},Dv=e=>{const t=ae([]),n=ae(0),r=a=>{if(!(e!=null&&e.skipDisabledKeyBindingsCheck)&&Dx())return;const{key:c,ctrlKey:u,metaKey:l,shiftKey:f}=a;let d=null;const m=[];l||u?(d="Control",m.push("altKey","shiftKey")):f&&(d="Shift",m.push("altKey","ctrlKey","metaKey")),!((b,T)=>T.some(v=>b[v]))(a,m)&&p(t).filter(b=>b.primary===c&&b.modifier===d).forEach(b=>{a.preventDefault(),b.callback(a)})},o=(a,c)=>{const u=Yt.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 Mr.useEventListener(document,"keydown",r),{actions:t,bindKeyAction:o,removeKeyAction:i,selectionCursor:n,resetSelectionCursor:s}};class Tr{}Ee(Tr,"perPageDefault","100"),Ee(Tr,"perPageQueryName","items-per-page"),Ee(Tr,"options",["20","50","100","250","500"]);function Lx(e){const t=No.useRouter(),n=No.useRoute(),r=Mx(e),o=Bx(e),i=j(()=>Math.ceil(p(e.items).length/p(o))||1),s=j(()=>{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 Xe.subscribe("app.files.navigate.page",({resourceId:a,forceScroll:c,topbarElement:u})=>{const l=Et.findIndex(p(e.items),f=>f.id===a);if(l>=0){const f=Math.ceil((l+1)/Number(p(o)));t.push({...p(n),query:{...p(n).query,page:f}}).then(()=>{Xe.publish("app.files.navigate.scrollTo",{resourceId:a,forceScroll:c,topbarElement:u})})}}),{items:s,total:i,page:r,perPage:o}}function Mx(e){if(e.page)return j(()=>p(e.page));const t=on("page","1");return j(()=>parseInt(St(p(t))))}function Bx(e){if(e.perPage)return j(()=>p(e.perPage));const t=wr({name:e.perPageQueryName||Tr.perPageQueryName,defaultValue:e.perPageDefault||Tr.perPageDefault,storagePrefix:e.perPageStoragePrefix});return j(()=>parseInt(St(p(t))))}const Lv=()=>mr("$passwordPolicyService");var la=(e=>(e.mounted="portal-target.mounted",e))(la||{});const jx=()=>{const e=_o(),t=ga.useWormhole();return{registerPortal:r=>{e.subscribe(la.mounted,()=>{t.open(r)})}}},Df=()=>{const e=Zn();return{canBeOpenedWithSecureView:n=>e.fileExtensions.filter(({secureView:o})=>o).some(({mimeType:o})=>o===n.mimeType)}},Mv=()=>{const e=vt();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})}},Bv=()=>{const e=Ye(),t=lt(),n=jt(),r=j(()=>t.spaces),o=c=>p(r).find(u=>c.toString().startsWith(u.id.toString())),i=c=>p(r).find(u=>{var l,f;return ee.isMountPointSpaceResource(u)&&((f=(l=u.root)==null?void 0:l.remoteItem)==null?void 0:f.id)===c}),s=c=>{const u=[qe.FileId,qe.FileParent,qe.Name,qe.ResourceType],l=ee.buildSpace({id:c,name:""},n.graphRoles);return e.webdav.getFileInfo(l,{fileId:c},{davProperties:u})};return{getResourceContext:async c=>{var b,T,v,g,h;let u,l,f=o(c);if(f)return u=await e.webdav.getPathForFileId(c),l=await e.webdav.getFileInfo(f,{path:u}),{space:f,resource:l,path:u};await t.loadMountPoints({graphClient:e.graphAuthenticated});let d=i(c);l=await s(c);const m=d?[]:[p(l).name];let w=p(l);for(;!d;)w=await s(w.parentFolderId),d=i(w.id),d||m.unshift(w.name);return f=t.getSpace((T=(b=d.root)==null?void 0:b.remoteItem)==null?void 0:T.id)||t.createShareSpace({driveAliasPrefix:(v=l.storageId)!=null&&v.startsWith(ee.OCM_PROVIDER_ID)?"ocm-share":"share",id:(h=(g=d.root)==null?void 0:g.remoteItem)==null?void 0:h.id,shareName:d.name}),u=ee.urlJoin(...m),{space:f,resource:l,path:u}}}},Gt={name:{table:"resource-table",condensedTable:"resource-table-condensed",tiles:"resource-tiles"},defaultModeName:"resource-table",queryName:"view-mode",tilesSizeDefault:2,tilesSizeMax:6,tilesSizeQueryName:"tiles-size"},jv=()=>{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=ae(0),n=ae(0);Mt(()=>{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 Ux(e){if(e)return j(()=>p(e));const t=wr({name:Gt.queryName,defaultValue:Gt.defaultModeName});return j(()=>St(p(t)))}function qx(e){if(e)return j(()=>parseInt(p(e)));const t=wr({name:Gt.tilesSizeQueryName,defaultValue:Gt.tilesSizeDefault.toString()});return j(()=>parseInt(St(p(t))))}const Vx=ae(Gt.tilesSizeMax);function Lf(){return Vx}const Mf=e=>{const t=Rf(),{updateResourceField:n}=Ke(),{httpAuthenticated:r}=Ye(),o=lt(),{defaultSpaceImageBlobURL:i}=He.storeToRefs(o),s=st(),{serverUrl:a}=He.storeToRefs(s),c=new Lr({concurrency:4}),u=j(()=>p(e)===Gt.name.tiles),l=j(()=>p(u)?Bs.enum.fit:Bs.enum.thumbnail),f=j(()=>p(u)?zn.Tile:zn.Thumbnail),d=un.useTask(function*(T,{space:v,resource:g,dimensions:h,processor:y,updateStore:S=!0}){var A;const E=ee.isProjectSpaceResource(g)?ee.buildSpaceImageResource(g):g,R=E.id===((A=v.spaceImageData)==null?void 0:A.id);R&&o.addToImagesLoading(v.id);const I=yield c.add(()=>t.loadPreview({space:v,resource:E,processor:y||p(l),dimensions:h||p(f)},!0,!0,T));return I&&S&&n({id:g.id,field:"thumbnail",value:I}),R&&o.removeFromImagesLoading(v.id),I}),m=async T=>{const{resource:v,cancelRunning:g}=T;if(g&&b(),ee.isProjectSpaceResource(v)&&(!v.spaceImageData||v.disabled)){if(p(i))return v.thumbnail=p(i),p(i);try{const h=await r.get(`${p(a)}images/default-space-icon.png`,{responseType:"blob"});return o.setDefaultSpaceImageBlobURL(URL.createObjectURL(h.data)),v.thumbnail=p(i),p(i)}catch{return null}}try{return await d.perform(T)}catch(h){h!=="cancel"&&console.error(h)}},w=j(()=>d.isRunning),b=()=>{d.cancelAll(),c.clear(),o.purgeImagesLoading()};return ja(b),{loadPreview:m,previewsLoading:w}},Uv=({showSizeInformation:e=!0}={})=>{const t=Ke(),{current:n,$gettext:r,$ngettext:o}=Ne.useGettext(),i=ze(),{resources:s,totalResourcesCount:a,areHiddenFilesShown:c,currentFolder:u}=He.storeToRefs(t),l=j(()=>{var d,m;if(!((d=p(u))!=null&&d.size)||((m=p(u))==null?void 0:m.size)==="0"){const w=p(s).map(b=>b.size?parseInt(b.size.toString()):0).reduce((b,T)=>b+T,0);return En(w,n)}return En(p(u).size,n)});return{resourceContentsText:j(()=>{let d=o("%{ filesCount } file","%{ filesCount } files",p(a).files,{filesCount:p(a).files.toString()});!p(c)&&p(a).hiddenFiles&&(d=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()}),b=p(a).files+p(a).folders+p(a).spaces,T=e&&parseFloat(p(l))>0,v=Nt(i,"files-shares-via-link"),g=r(T?"%{ itemsCount } item with %{ itemSize } in total":"%{ itemsCount } item in total"),h=r(T?"%{ itemsCount } items with %{ itemSize } in total":"%{ itemsCount } items in total"),y=v?"(%{ filesStr}, %{ foldersStr}, %{ spacesStr})":"(%{ filesStr}, %{ foldersStr})",S=`${g} ${y}`,E=`${h} ${y}`;return o(S,E,b,{itemsCount:b.toString(),itemSize:p(l),filesStr:d,foldersStr:m,spacesStr:w})})}},Bf=()=>{const{getMatchingSpace:e}=ln(),t=Ke(),n=j({get(){return t.selectedResources},set(s){t.setSelection(s.map(({id:a})=>a))}}),r=j({get(){return t.selectedIds},set(s){t.setSelection(s)}}),o=s=>p(r).includes(s.id),i=j(()=>{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 zx(e){const t=rn(),n=Xr(),r=Ye(),o=Ne.useGettext(),i=j(()=>t.tusMaxChunkSize>0),s=()=>{const u={};return n.publicLinkPassword?u.Authorization="Basic "+yr.from(["public",n.publicLinkPassword].join(":")).toString("base64"):n.accessToken&&!n.publicLinkPassword&&(u.Authorization="Bearer "+n.accessToken),u["X-Request-ID"]=Yt.v4(),u["Accept-Language"]=o.current,u["Initiator-ID"]=r.initiatorId,u},a=j(()=>{const u={onBeforeRequest:(l,f)=>new Promise(d=>{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"]),f!=null&&f.isRemote&&l.setHeader("x-oc-mtime",(((w=f==null?void 0:f.data)==null?void 0:w.lastModified)/1e3).toFixed(0)),d()}),chunkSize:t.tusMaxChunkSize||1/0,overridePatchMethod:t.tusHttpMethodOverride,uploadDataDuringCreation:t.tusExtension.includes("creation-with-upload")};return u.headers=l=>{var f;if(l.xhrUpload||l!=null&&l.isRemote)return{"x-oc-mtime":(((f=l==null?void 0:l.data)==null?void 0:f.lastModified)/1e3).toFixed(0),...s()}},u}),c=j(()=>({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()}}}));Tt([a,c],()=>{if(p(i)){e.uppyService.useTus(p(a));return}e.uppyService.useXhr(p(c))},{immediate:!0})}const Wx=Me({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{$gettext:t}=Ne.useGettext(),n=st(),{options:r}=He.storeToRefs(n),o=j(()=>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=j(()=>({...{appearance:e.action.appearance||e.appearance,...e.action.isDisabled&&{disabled:e.action.isDisabled(e.actionOptions)},...e.action.id&&{id:e.action.id}},...p(o)==="router-link"&&{to:e.action.route(e.actionOptions)},...p(o)==="a"&&{href:e.action.href(e.actionOptions)},...["router-link","a"].includes(p(o))&&{target:r.value.cernFeatures?"_blank":"_self"}})),s=j(()=>window.navigator.platform.match("Mac")),a=j(()=>t("Hold %{key} and click to open in new tab",{key:p(s)?"⌘":t("ctrl")},!0));return{componentType:o,componentProps:i,openInNewTabHint:a}},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}}}}),Hx={key:3,class:"oc-files-context-action-label oc-flex","data-testid":"action-label"},Gx=["textContent"],Kx=["textContent"],Qx=["textContent"];function Xx(e,t,n,r,o,i){var l,f,d,m;const s=he("oc-image"),a=he("oc-icon"),c=he("oc-button"),u=dn("oc-tooltip");return ot((J(),Se("li",null,[ot((J(),Ce(c,Zt({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?(f=(l=e.action).disabledTooltip)==null?void 0:f.call(l,e.actionOptions):"","data-testid":"action-handler",size:e.size,"justify-content":"left"},qa(e.componentListeners)),{default:Te(()=>[e.action.img?(J(),Ce(s,{key:0,"data-testid":"action-img",src:e.action.img,alt:"",class:"oc-icon oc-icon-m"},null,8,["src"])):e.hasExternalImageIcon?(J(),Ce(s,{key:1,"data-testid":"action-img",src:e.action.icon,alt:"",class:"oc-icon oc-icon-m"},null,8,["src"])):e.action.icon?(J(),Ce(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"])):Oe("",!0),e.action.hideLabel?Oe("",!0):(J(),Se("span",Hx,[pe("span",{textContent:W.toDisplayString(e.action.label(e.actionOptions))},null,8,Gx),e.action.showOpenInNewTabHint?(J(),Se("span",{key:0,class:"oc-text-muted oc-text-xsmall",textContent:W.toDisplayString(e.openInNewTabHint)},null,8,Kx)):Oe("",!0)])),e.action.shortcut&&e.shortcutHint?(J(),Se("span",{key:4,class:"oc-files-context-action-shortcut",textContent:W.toDisplayString(e.action.shortcut)},null,8,Qx)):Oe("",!0)]),_:1},16,["type","class","aria-label","size"])),[[u,e.showTooltip||e.action.hideLabel?e.action.label(e.actionOptions):""]])])),[[u,e.componentProps.disabled?(m=(d=e.action).disabledTooltip)==null?void 0:m.call(d,e.actionOptions):""]])}const jf=Ve(Wx,[["render",Xx]]),Yx=Me({name:"BatchActions",components:{ActionMenuItem:jf},props:{actions:{type:Array,required:!0},actionOptions:{type:Object,required:!0},limitedScreenSpace:{type:Boolean,default:!1,required:!1}}});function Jx(e,t,n,r,o,i){const s=he("action-menu-item"),a=he("oc-list");return J(),Se("div",null,[ve(a,{id:"oc-appbar-batch-actions",class:W.normalizeClass({"oc-appbar-batch-actions-squashed":e.limitedScreenSpace})},{default:Te(()=>[(J(!0),Se(Qe,null,kt(e.actions,(c,u)=>(J(),Ce(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 qv=Ve(Yx,[["render",Jx]]),Zx=Me({name:"ContextActionMenu",components:{ActionMenuItem:jf},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}}}),ek={id:"oc-files-context-menu"};function tk(e,t,n,r,o,i){const s=he("action-menu-item"),a=he("oc-list");return J(),Se("div",ek,[(J(!0),Se(Qe,null,kt(e.menuSections,(c,u)=>(J(),Ce(a,{id:`oc-files-context-actions-${c.name}`,key:`section-${c.name}-list`,class:W.normalizeClass(["oc-files-context-actions",e.getSectionClasses(u)])},{default:Te(()=>[(J(!0),Se(Qe,null,kt(c.items,(l,f)=>(J(),Ce(s,{key:`section-${c.name}-action-${f}`,action:l,appearance:e.appearance,"action-options":e.actionOptions,class:"context-menu oc-files-context-action oc-px-s oc-rounded oc-menu-item-hover"},null,8,["action","appearance","action-options"]))),128))]),_:2},1032,["id","class"]))),128))])}const Uf=Ve(Zx,[["render",tk]]),nk=Me({name:"ContextActions",components:{ContextActionMenu:Uf},props:{actionOptions:{type:Object,required:!0}},setup(e){const{editorActions:t}=Vn(),{actions:n}=Xs(),{actions:r}=Ys(),{actions:o}=Js(),{actions:i}=Sf(),{actions:s}=Zs(),{actions:a}=ea(),{actions:c}=ta(),{actions:u}=Io(),{actions:l}=Tf(),{actions:f}=Ef(),{actions:d}=na(),{actions:m}=Af(),{actions:w}=uv(),{actions:b}=ra(),{actions:T}=ia(),{actions:v}=fv(),{actions:g}=_f(),{actions:h}=Cf(),{actions:y}=If(),S=Ni(),E=j(()=>S.requestExtensions({id:"global.files.context-actions",extensionType:"action"}).map(X=>X.action)),R=j(()=>S.requestExtensions({id:"global.files.batch-actions",extensionType:"action"}).map(X=>X.action)),I=mw(e,"actionOptions"),A=j(()=>[...p(n),...p(s),...p(c),...p(d),...p(o),...p(f),...p(a),...p(T),...p(h),...p(R).filter(X=>X.category==="actions"||Et.isNil(X.category))].filter(X=>X.isVisible(p(I)))),$=j(()=>[...p(g),...p(R).filter(X=>X.category==="sidebar")].filter(X=>X.isVisible(p(I)))),D=j(()=>[...p(t),...p(E).filter(X=>X.category==="context")].filter(X=>X.isVisible(p(I))).sort((X,se)=>Number(se.hasPriority)-Number(X.hasPriority))),k=j(()=>[...p(y),...p(i),...p(E).filter(X=>X.category==="share")].filter(X=>X.isVisible(p(I)))),N=j(()=>[...p(c),...p(u),...p(a),...p(d),...p(o),...p(w),...p(b),...p(h),...p(T),...p(n),...p(s),...p(r),...p(v),...p(E).filter(X=>X.category==="actions"||Et.isNil(X.category))].filter(X=>X.isVisible(p(I)))),z=j(()=>[...p(l).map(X=>(X.keepOpen=!0,X)),...p(m),...p(g),...p(E).filter(X=>X.category==="sidebar")].filter(X=>X.isVisible(p(I))));return{menuSections:j(()=>{const X=[];return p(I).resources.length>1?(p(A).length&&X.push({name:"batch-actions",items:[...p(A)]}),X.push({name:"batch-details",items:[...p($)]}),X):(p(D).length&&X.push({name:"context",items:p(D)}),p(k).length&&X.push({name:"share",items:p(k)}),p(N).length&&X.push({name:"actions",items:p(N)}),p(z).length&&X.push({name:"sidebar",items:p(z)}),X)})}}});function rk(e,t,n,r,o,i){const s=he("context-action-menu");return J(),Ce(s,{"menu-sections":e.menuSections,"action-options":e.actionOptions},null,8,["menu-sections","action-options"])}const Vv=Ve(nk,[["render",rk]]),ik=Me({props:{hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},paginationOptions:{type:Array,default:()=>Tr.options},perPageQueryName:{type:String,default:()=>Tr.perPageQueryName},perPageDefault:{type:String,default:()=>Tr.perPageDefault},perPageStoragePrefix:{type:String,required:!0},viewModeDefault:{type:String,required:!1,default:()=>Gt.defaultModeName},viewModes:{type:Array,default:()=>[]}},setup(e){const t=ze(),n=en(),{$gettext:r}=Ne.useGettext(),o=Ke(),{setAreHiddenFilesShown:i,setAreFileExtensionsShown:s,setAreDisabledSpacesShown:a}=o,{areHiddenFilesShown:c,areFileExtensionsShown:u,areDisabledSpacesShown:l}=He.storeToRefs(o),f=ae(!1),d=on("page"),m=j(()=>p(d)?parseInt(St(p(d))):1),w=wr({name:e.perPageQueryName,defaultValue:e.perPageDefault,storagePrefix:e.perPageStoragePrefix}),b=Ws(),T=wr({name:`${p(b)}-${Gt.queryName}`,defaultValue:e.viewModeDefault}),v=wr({name:Gt.tilesSizeQueryName,defaultValue:Gt.tilesSizeDefault.toString()}),g=S=>t.replace({query:{...p(n).query,[e.perPageQueryName]:S,...p(m)>1&&{page:"1"}}}),h=S=>{T.value=S.name};Tt([w,T,v],S=>{f.value=S.some(E=>!E)},{immediate:!0,deep:!0});const y=Lf();return{FolderViewModeConstants:Gt,viewModeCurrent:T,viewSizeCurrent:v,viewSizeMax:y,itemsPerPageCurrent:w,queryParamsLoading:f,queryItemAsString:St,setItemsPerPage:g,setViewMode:h,areHiddenFilesShown:c,areFileExtensionsShown:u,areDisabledSpacesShown:l,setAreHiddenFilesShown:i,setAreFileExtensionsShown:s,setAreDisabledSpacesShown:a,viewOptionsButtonLabel:r("Display customization options of the files list"),isProjectsLocation:Sr(at,"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}}}),ok={class:"oc-flex oc-flex-middle"},sk={key:0,class:"viewmode-switch-buttons oc-button-group oc-visible@s oc-mr-s"},ak={key:0,class:"files-view-options-list-item"},lk={key:1,class:"files-view-options-list-item"},ck={key:2,class:"files-view-options-list-item"},uk={key:3,class:"files-view-options-list-item"},fk={key:4,class:"files-view-options-list-item oc-flex oc-flex-between oc-flex-middle"},dk=["textContent"],pk=["max"];function hk(e,t,n,r,o,i){const s=he("oc-icon"),a=he("oc-button"),c=he("oc-switch"),u=he("oc-page-size"),l=he("oc-list"),f=he("oc-drop"),d=dn("oc-tooltip");return J(),Se("div",ok,[e.viewModes.length>1?(J(),Se("div",sk,[(J(!0),Se(Qe,null,kt(e.viewModes,m=>ot((J(),Ce(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:Te(()=>[ve(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"])),[[d,e.$gettext(m.label)]])),128))])):Oe("",!0),ot((J(),Ce(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:Te(()=>[ve(s,{name:"settings-3","fill-type":"line"})]),_:1},8,["aria-label"])),[[d,e.viewOptionsButtonLabel]]),ve(f,{"drop-id":"files-view-options-drop",toggle:"#files-view-options-btn",mode:"click",class:"oc-width-auto","padding-size":"medium"},{default:Te(()=>[ve(l,null,{default:Te(()=>[e.hasHiddenFiles?(J(),Se("li",ak,[ve(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"])])):Oe("",!0),e.hasFileExtensions?(J(),Se("li",lk,[ve(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"])])):Oe("",!0),e.hasPagination?(J(),Se("li",ck,[e.queryParamsLoading?Oe("",!0):(J(),Ce(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"]))])):Oe("",!0),e.isProjectsLocation?(J(),Se("li",uk,[ve(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"])])):Oe("",!0),e.viewModeCurrent===e.FolderViewModeConstants.name.tiles?(J(),Se("li",fk,[pe("label",{for:"tiles-size-slider",textContent:W.toDisplayString(e.$gettext("Tile size"))},null,8,dk),ot(pe("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,pk),[[AS,e.viewSizeCurrent]])])):Oe("",!0)]),_:1})]),_:1})])}const zv=Ve(ik,[["render",hk],["__scopeId","data-v-cc70f12f"]]),gk=Me({name:"AppBar",components:{BatchActions:qv,ContextActions:Vv,ViewOptions:zv},props:{viewModeDefault:{type:String,required:!1,default:()=>Gt.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},space:{type:Object,required:!1,default:null}},setup(e,{emit:t}){const n=lt(),{$gettext:r}=Ne.useGettext(),{can:o}=hn(),i=ze(),{requestExtensions:s}=Ni(),{isSticky:a}=kf(),c=Ke(),{selectedResources:u}=He.storeToRefs(c),l=j(()=>e.space),{actions:f}=Xs(),{actions:d}=Ys(),{actions:m}=Js(),{actions:w}=Iv(),{actions:b}=Zs(),{actions:T}=ea(),{actions:v}=ta(),{actions:g}=Io(),{actions:h}=Ef(),{actions:y}=na(),{actions:S}=ia(),{actions:E}=Rv(),{actions:R}=_v(),{actions:I}=Pv(),{actions:A}=kv(),$=ae(0),D=Sr(At,"files-common-search"),k=j(()=>Object.hasOwn(Yw(),"navigation")&&o("create-all","Share")),N=j(()=>{let re=[...p(d),...p(f),...p(b),...p(v),...p(g),...p(y),...p(m),...p(h),...p(T),...p(S)];D.value||(re=[...re,...p(w),...p(I),...p(A),...p(E),...p(R)]);const ce=s({id:"global.files.batch-actions",extensionType:"action"});return ce.length&&(re=[...re,...ce.map(Ie=>Ie.action)]),re.filter(Ie=>Ie.isVisible({space:p(l),resources:c.selectedResources}))}),z=j(()=>n.spaces.filter(re=>ee.isPersonalSpaceResource(re)||ee.isProjectSpaceResource(re))),G=dr("isMobileWidth"),X=Sr(In,"files-trash-generic"),se=j(()=>!p(G)&&e.breadcrumbs.length?!0:p(X)&&p(z).length===1?!1:e.breadcrumbs.length>1),ne=j(()=>p(X)&&p(z).length===1?e.breadcrumbs.length<=2:e.breadcrumbs.length<=1),oe=j(()=>p(l)&&(ee.isProjectSpaceResource(p(l))||ee.isShareSpaceResource(p(l)))?3:2),fe=re=>{t(Rb,re)},we=Kb("title"),Z=j(()=>{var re;return p(we)?r(p(we)):((re=p(l))==null?void 0:re.name)||""});return{router:i,hasSharesNavigation:k,batchActions:N,showBreadcrumb:se,showMobileNav:ne,breadcrumbMaxWidth:$,breadcrumbTruncationOffset:oe,fileDroppedBreadcrumb:fe,pageTitle:Z,selectedResources:u,isSticky:a}},data:function(){return{resizeObserver:new ResizeObserver(this.onResize),limitedScreenSpace:!1}},computed:{showContextActions(){return td(this.breadcrumbs).allowContextActions},showBatchActions(){return this.hasBulkActions&&(this.selectedResources.length>=1||In(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}}}),mk={class:"files-topbar oc-py-s"},yk=["textContent"],bk={key:3,id:"files-app-bar-controls-right",class:"oc-flex"},vk={class:"files-app-bar-actions oc-mt-xs"},wk={class:"oc-flex-1 oc-flex oc-flex-start oc-flex-middle"};function Sk(e,t,n,r,o,i){const s=he("oc-hidden-announcer"),a=he("context-actions"),c=he("oc-breadcrumb"),u=he("portal-target"),l=he("view-options"),f=he("batch-actions");return J(),Se("div",{id:"files-app-bar",ref:"filesAppBar",class:W.normalizeClass({"files-app-bar-squashed":e.isSideBarOpen,"files-app-bar-sticky":e.isSticky})},[pe("div",mk,[pe("h1",{class:"oc-invisible-sr",textContent:W.toDisplayString(e.pageTitle)},null,8,yk),ve(s,{announcement:e.selectedResourcesAnnouncement,level:"polite"},null,8,["announcement"]),pe("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?(J(),Ce(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:Te(()=>[ve(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"])):Oe("",!0),e.showMobileNav?(J(),Ce(u,{key:1,name:"app.runtime.mobile.nav"})):Oe("",!0),e.hasSharesNavigation?Ge(e.$slots,"navigation",{key:2},void 0,!0):Oe("",!0),e.hasViewOptions?(J(),Se("div",bk,[ve(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"])])):Oe("",!0)],2),pe("div",vk,[pe("div",wk,[Ge(e.$slots,"actions",{limitedScreenSpace:e.limitedScreenSpace},void 0,!0),e.showBatchActions?(J(),Ce(f,{key:0,actions:e.batchActions,"action-options":{space:e.space,resources:e.selectedResources},"limited-screen-space":e.limitedScreenSpace},null,8,["actions","action-options","limited-screen-space"])):Oe("",!0)])]),Ge(e.$slots,"content",{},void 0,!0)])],2)}const Ek=Ve(gk,[["render",Sk],["__scopeId","data-v-d27aef7c"]]),Tk=Me({name:"CreateSpace",props:{showLabel:{type:Boolean,default:!0}},emits:["spaceCreated"],setup(e,{emit:t}){const{showMessage:n,showErrorMessage:r}=rt(),{$gettext:o}=Ne.useGettext(),{createSpace:i}=Di(),{checkSpaceNameModalInput:s}=oi(),{dispatchModal:a}=bt(),c=lt(),{upsertResource:u}=Ke(),l=async d=>{try{const m=await i(d);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"),onConfirm:d=>l(d),onInput:s})}}}}),Ak=["textContent"];function Rk(e,t,n,r,o,i){const s=he("oc-icon"),a=he("oc-button"),c=dn("oc-tooltip");return ot((J(),Ce(a,{id:"new-space-menu-btn","aria-label":e.showLabel?void 0:e.$gettext("New space"),appearance:"filled",onClick:e.showCreateSpaceModal},{default:Te(()=>[ve(s,{name:"add"}),e.showLabel?(J(),Se("span",{key:0,textContent:W.toDisplayString(e.$gettext("New Space"))},null,8,Ak)):Oe("",!0)]),_:1},8,["aria-label","onClick"])),[[c,e.showLabel?void 0:e.$gettext("New space")]])}const _k=Ve(Tk,[["render",Rk]]),Ik=Me({name:"AppTopBar",components:{ContextActionMenu:Uf,ResourceListItem:Fo},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}=Ne.useGettext(),r=Ke(),o=st(),{getMatchingSpace:i}=ln(),s=j(()=>r.areFileExtensionsShown),a=j(()=>t("Show context menu")),c=j(()=>e.isEditor&&e.hasAutoSave&&o.options.editor.autosaveEnabled),u=j(()=>{const d=Dt.Duration.fromObject({seconds:o.options.editor.autosaveInterval},{locale:n});return t("Autosave (every %{ duration })",{duration:d.toHuman()})}),l=j(()=>i(e.resource)),f=j(()=>!ee.isPublicSpaceResource(p(l)));return{contextMenuLabel:a,areFileExtensionsShown:s,hasAutosave:c,autoSaveTooltipText:u,isPathDisplayed:f,...si()}}}),Ck={class:"oc-app-top-bar oc-flex"},Fk={class:"oc-app-top-bar-inner oc-pl-m oc-pr-xs oc-flex oc-flex-middle oc-flex-between"},Pk={class:"open-file-bar oc-flex"},Ok={class:"oc-flex main-actions"},xk={key:1,class:"oc-flex oc-flex-middle"};function kk(e,t,n,r,o,i){const s=he("resource-list-item"),a=he("oc-icon"),c=he("oc-button"),u=he("context-action-menu"),l=he("oc-drop"),f=he("portal"),d=dn("oc-tooltip");return J(),Ce(f,{to:"app.runtime.header.left"},{default:Te(()=>[pe("div",Ck,[pe("span",Fk,[pe("div",Pk,[e.resource?(J(),Ce(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"])):Oe("",!0)]),pe("div",Ok,[e.dropDownMenuSections.length?(J(),Se(Qe,{key:0},[ot((J(),Ce(c,{id:"oc-openfile-contextmenu-trigger","aria-label":e.contextMenuLabel,appearance:"raw-inverse","color-role":"chrome",class:"oc-p-xs"},{default:Te(()=>[ve(a,{name:"more-2"})]),_:1},8,["aria-label"])),[[d,e.contextMenuLabel]]),ve(l,{"drop-id":"oc-openfile-contextmenu",mode:"click","padding-size":"small",toggle:"#oc-openfile-contextmenu-trigger","close-on-click":"",onClick:t[0]||(t[0]=Rn(()=>{},["stop","prevent"]))},{default:Te(()=>[ve(u,{"menu-sections":e.dropDownMenuSections,"action-options":e.dropDownActionOptions},null,8,["menu-sections","action-options"])]),_:1})],64)):Oe("",!0),e.hasAutosave?(J(),Se("span",xk,[ot(ve(a,{"accessible-label":e.autoSaveTooltipText,name:"refresh",color:"white",class:"ox-p-xs oc-mx-xs"},null,8,["accessible-label"]),[[d,e.autoSaveTooltipText]])])):Oe("",!0),e.mainActions.length&&e.resource?(J(),Ce(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"])):Oe("",!0),ve(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:Te(()=>[ve(a,{name:"close"})]),_:1},8,["aria-label"])])])])]),_:1})}const Wv=Ve(Ik,[["render",kk]]),Nk=Me({name:"ErrorScreen",props:{message:{default:"",type:String,required:!1}}}),$k={class:"oc-text-center oc-flex oc-flex-center oc-flex-middle oc-height-1-1"},Dk={key:0,class:"oc-text-xlarge"};function Lk(e,t,n,r,o,i){const s=he("oc-icon");return J(),Se("div",$k,[ve(s,{size:"xxlarge",name:"error-warning","fill-type":"line"}),e.message?(J(),Se("p",Dk,W.toDisplayString(e.message),1)):Oe("",!0)])}const Mk=Ve(Nk,[["render",Lk]]),Bk=Me({name:"LoadingScreen"}),jk={class:"oc-text-center oc-flex oc-flex-center oc-flex-middle oc-height-1-1"},Uk={class:"oc-invisible"};function qk(e,t,n,r,o,i){const s=he("oc-spinner"),a=dn("translate");return J(),Se("div",jk,[ve(s,{size:"xlarge"}),ot((J(),Se("p",Uk,t[0]||(t[0]=[Vt("Loading app")]))),[[a]])])}const Vk=Ve(Bk,[["render",qk]]),zk=["id","data-testid","tabindex","inert"],Wk={key:0,class:"sidebar-panel__header header"},Hk={class:"header__title oc-my-rm"},Gk={key:0,class:"sidebar-panel__navigation oc-mt-m"},Hv=Me({__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}=Ne.useGettext(),o=Ud("appSideBar"),i=j(()=>e.availablePanels.filter(A=>{var $;return A.isVisible(e.panelContext)&&(($=A.isRoot)==null?void 0:$.call(A,e.panelContext))})),s=j(()=>e.availablePanels.filter(A=>{var $;return A.isVisible(e.panelContext)&&!(($=A.isRoot)!=null&&$.call(A,e.panelContext))})),a=j(()=>p(i).length?[p(i)[0],...p(s)]:p(s)),c=j(()=>{var $;const A=($=e.activePanel)==null?void 0:$.split("#")[0];return!A||!p(s).map(D=>D.name).includes(A)?null:A}),u=j(()=>p(c)!==null),l=j(()=>p(c)===null),f=ae(null),d=A=>{f.value=A},m=j(()=>p(u)?p(c):p(i)[0].name),w=j(()=>p(i).length===1?r("Back to %{panel} panel",{panel:p(i)[0].title(e.panelContext)}):r("Back to main panels")),b=ae(window.innerWidth),T=j(()=>p(b)<=580),v=j(()=>{var A,$;return($=(A=p(o))==null?void 0:A.parentElement)==null?void 0:$.querySelector("div")}),g=()=>{if(!p(v))return;const A=p(T)?"hidden":"visible";p(v).style.visibility=A},h=()=>{e.isOpen&&(b.value=window.innerWidth,g())};Tt(()=>e.isOpen,async A=>{A&&(await Gn(),g())},{immediate:!0});const y=A=>{n("selectPanel",A)},S=()=>{n("selectPanel",null)},E=()=>{n("close")},R=A=>{d(p(m)),y(A)},I=()=>{d(p(m)),S(),p(o).focus()};return Mt(()=>{window.addEventListener("resize",h)}),jn(()=>{window.removeEventListener("resize",h),p(v)&&(p(v).style.visibility="visible")}),(A,$)=>{const D=he("oc-spinner"),k=he("oc-icon"),N=he("oc-button"),z=dn("oc-tooltip");return J(),Se("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":T.value})},[A.loading?(J(),Ce(D,{key:0})):(J(!0),Se(Qe,{key:1},kt(a.value,G=>{var X,se,ne,oe,fe,we;return J(),Se("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":(X=G.isRoot)==null?void 0:X.call(G,A.panelContext),"is-active-sub-panel":u.value&&c.value===G.name,"is-active-root-panel":l.value&&((se=G.isRoot)==null?void 0:se.call(G,A.panelContext))}]),inert:m.value!==G.name},[[m.value,f.value].includes(G.name)?(J(),Se("div",Wk,[(ne=G.isRoot)!=null&&ne.call(G,A.panelContext)?Oe("",!0):ot((J(),Ce(N,{key:0,class:"header__back oc-p-xs",appearance:"raw","aria-label":w.value,onClick:I},{default:Te(()=>[ve(k,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"])),[[z,w.value]]),pe("h2",Hk,W.toDisplayString(G.title(A.panelContext)),1),ve(N,{appearance:"raw",class:"header__close oc-p-xs","aria-label":p(r)("Close file sidebar"),onClick:E},{default:Te(()=>[ve(k,{name:"close"})]),_:1},8,["aria-label"])])):Oe("",!0),pe("div",null,[(oe=G.isRoot)!=null&&oe.call(G,A.panelContext)?Ge(A.$slots,"rootHeader",{key:0}):Ge(A.$slots,"subHeader",{key:1})]),pe("div",{class:W.normalizeClass(["sidebar-panel__body",[`sidebar-panel__body-${G.name}`]])},[pe("div",{class:W.normalizeClass(["sidebar-panel__body-content",{"sidebar-panel__body-content-stretch":!((fe=G.isRoot)!=null&&fe.call(G,A.panelContext))}])},[Ge(A.$slots,"body",{},()=>{var Z;return[(J(!0),Se(Qe,null,kt((Z=G.isRoot)!=null&&Z.call(G,A.panelContext)?i.value:[G],(re,ce)=>{var Ie;return J(),Ce(Wr(re.component),Zt({key:`sidebar-panel-${re.name}`,class:{"multi-root-panel-separator oc-mt oc-pt-s":ce>0},ref_for:!0},((Ie=re.componentAttrs)==null?void 0:Ie.call(re,A.panelContext))||{}),null,16,["class"])}),128))]})],2),(we=G.isRoot)!=null&&we.call(G,A.panelContext)&&s.value.length>0?(J(),Se("div",Gk,[(J(!0),Se(Qe,null,kt(s.value,Z=>(J(),Ce(N,{id:`sidebar-panel-${Z.name}-select`,key:`panel-select-${Z.name}`,"data-testid":`sidebar-panel-${Z.name}-select`,appearance:"raw-inverse","color-role":"surface",onClick:re=>R(Z.name)},{default:Te(()=>[ve(k,{name:Z.icon,"fill-type":Z.iconFillType},null,8,["name","fill-type"]),Vt(" "+W.toDisplayString(Z.title(A.panelContext))+" ",1),ve(k,{name:"arrow-right-s","fill-type":"line"})]),_:2},1032,["id","data-testid","onClick"]))),128))])):Oe("",!0)],2)],10,zk)}),128))],2)}}}),Kk=Me({name:"SpaceInfo",setup(){return{resource:dr("resource")}}}),Qk={class:"space_info oc-p-s"},Xk={class:"space_info__body oc-text-overflow oc-flex oc-flex-middle"},Yk={class:"oc-mr-s"},Jk=["textContent"],Zk=["textContent"];function eN(e,t,n,r,o,i){const s=he("oc-icon");return J(),Se("div",Qk,[pe("div",Xk,[pe("div",Yk,[ve(s,{name:"layout-grid",size:e.resource.description?"large":"medium",class:"oc-display-block"},null,8,["size"])]),pe("div",null,[pe("h3",{"data-testid":"space-info-name",class:"oc-font-semibold oc-m-rm",textContent:W.toDisplayString(e.resource.name)},null,8,Jk),pe("span",{"data-testid":"space-info-subtitle",textContent:W.toDisplayString(e.resource.description)},null,8,Zk)])])])}const Gv=Ve(Kk,[["render",eN]]),tN=Me({name:"FileInfo",components:{ResourceIcon:Co,ResourceName:Of},props:{isSubPanelActive:{type:Boolean,default:!0}},setup(){const e=Ke(),t=dr("resource"),n=dr("space"),r=j(()=>e.areFileExtensionsShown),o=j(()=>ee.isPersonalSpaceResource(p(n))&&p(t).path==="/"?p(n).name:p(t).name);return{resource:t,resourceName:o,areFileExtensionsShown:r}}}),nN={class:"file_info oc-flex oc-flex-between oc-p-s"},rN={class:"oc-flex oc-flex-middle"},iN={class:"file_info__body oc-text-overflow"},oN={"data-testid":"files-info-name",class:"oc-font-semibold"};function sN(e,t,n,r,o,i){const s=he("resource-icon"),a=he("resource-name");return J(),Se("div",nN,[pe("div",rN,[e.isSubPanelActive?(J(),Ce(s,{key:0,resource:e.resource,size:"large",class:"file_info__icon oc-mr-s oc-position-relative"},null,8,["resource"])):Oe("",!0),pe("div",iN,[pe("h3",oN,[ve(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 Kv=Ve(tN,[["render",sN]]),aN=Me({name:"FileSideBar",components:{FileInfo:Kv,SpaceInfo:Gv,InnerSideBar:Hv},props:{isOpen:{type:Boolean,required:!0},activePanel:{type:String,required:!1,default:null},space:{type:Object,required:!1,default:null}},setup(e){const t=ze(),n=Ye(),r=Ni(),o=_o(),i=lt(),s=jt(),a=st(),c=Zn(),{canListShares:u}=dv(),{canListVersions:l}=Mv(),f=Ke(),{currentFolder:d}=He.storeToRefs(f),m=ae(),w=ae([]),b=ae([]),T=ae([]),{selectedResources:v}=Bf(),g=ae(!1),h=j(()=>p(g)||ne.isRunning),y=j(()=>{var fe;return p(v).length===0?{root:e.space,parent:null,items:(fe=p(d))!=null&&fe.id?[p(d)]:[]}:{root:e.space,parent:p(d),items:p(v)}}),S=Sr(Nt,"files-shares-with-me"),E=Sr(Nt,"files-shares-with-others"),R=Sr(Nt,"files-shares-via-link"),I=at(t,"files-spaces-projects"),A=Sr(At,"files-common-favorites"),$=Sr(At,"files-common-search"),D=()=>{o.publish(yt.close)},k=fe=>{o.publish(yt.setActivePanel,fe)},N=j(()=>{var fe;return((fe=p(y).items)==null?void 0:fe.length)===1&&!ee.isProjectSpaceResource(p(y).items[0])}),z=j(()=>{var fe;return((fe=p(y).items)==null?void 0:fe.length)===1&&ee.isProjectSpaceResource(p(y).items[0])}),G=j(()=>p(S)||p(E)||p(R)),X=j(()=>p(G)||p($)||p(A)),se=j(()=>r.requestExtensions({id:"global.files.sidebar",extensionType:"sidebarPanel"}).map(fe=>fe.panel)),ne=un.useTask(function*(fe,we){w.value=yield n.webdav.listFileVersions(we.id,{signal:fe})}),oe=un.useTask(function*(fe,we){var ke;s.setLoading(!0),s.removeOrphanedShares();const{collaboratorShares:Z,linkShares:re}=s,ce=n.graphAuthenticated.permissions;let Ie=(ke=e.space)==null?void 0:ke.id;if(ee.isShareSpaceResource(e==null?void 0:e.space)){const Fe=yield i.getMountPointForSpace({graphClient:n.graphAuthenticated,space:e.space,signal:fe});Fe&&(Ie=Fe.root.remoteItem.rootId)}const{shares:Y,allowedRoles:_}=yield*ee.call(ce.listPermissions(Ie,we.fileId,s.graphRoles,{},{signal:fe})),P=Y.filter(ee.isCollaboratorShare),K=Y.filter(ee.isLinkShare),V=Object.values(s.graphRoles);if(b.value=(_==null?void 0:_.map(Fe=>{var Be;return{...Fe,icon:(Be=V.find(ge=>ge.id===Fe.id))==null?void 0:Be.icon}}))||[],c.isAppEnabled("open-cloud-mesh")){const{allowedRoles:Fe}=yield*ee.call(ce.listPermissions(Ie,we.fileId,s.graphRoles,{filter:`@libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition, '@Subject.UserType=="Federated"'))`,select:[ex.LibreGraphPermissionsRolesAllowedValues]},{signal:fe}));T.value=(Fe==null?void 0:Fe.map(Be=>{var ge;return{...Be,icon:(ge=V.find(le=>le.id===Be.id))==null?void 0:ge.icon}}))||[]}!p(X)&&!p(I)&&(Z.forEach(Fe=>{P.some(Be=>Be.id===Fe.id)||P.push({...Fe,indirect:!0})}),re.forEach(Fe=>{K.some(Be=>Be.id===Fe.id)||K.push({...Fe,indirect:!0})})),At(t,"files-common-search")&&(yield f.loadAncestorMetaData({folder:p(we),space:p(e.space),client:n.webdav,signal:fe}));const q=[...Z,...re].map(({resourceId:Fe})=>Fe),ue=Object.values(f.ancestorMetaData).filter(({id:Fe,path:Be})=>Fe===we.id||q.includes(Fe)||ee.isIncomingShareResource(we)?!1:ee.isPersonalSpaceResource(e.space)?Be!=="/":!0).map(({id:Fe})=>Fe);p(X)&&ee.isProjectSpaceResource(e.space)&&!ee.isProjectSpaceResource(we)&&ue.push(e.space.id);const Re=new Lr({concurrency:a.options.concurrentRequests.shares.list}),Le=[...new Set(ue)].map(Fe=>Re.add(()=>n.graphAuthenticated.permissions.listPermissions(Ie,Fe,s.graphRoles,{},{signal:fe}).then(Be=>{const ge=Be.shares.map(le=>({...le,indirect:!0}));P.push(...ge.filter(ee.isCollaboratorShare)),K.push(...ge.filter(ee.isLinkShare))})));yield Promise.allSettled(Le),s.setCollaboratorShares(P),s.setLinkShares(K),s.setLoading(!1)}).restartable();return Tt(()=>[...p(y).items,e.isOpen],async()=>{var we;if(((we=p(y).items)==null?void 0:we.length)!==1)return;if(!e.isOpen){w.value=[];return}const fe=p(y).items[0];if(ne.isRunning&&ne.cancelAll(),!!l({space:e.space,resource:fe}))try{await ne.perform(fe)}catch(Z){console.error(Z)}},{immediate:!0,deep:!0}),Tt(()=>[...p(y).items,e.isOpen],async()=>{var we;if(!e.isOpen){s.pruneShares(),m.value=null;return}if(((we=p(y).items)==null?void 0:we.length)!==1)return;const fe=p(y).items[0];if(g.value=!0,u({space:e.space,resource:fe}))try{oe.isRunning&&oe.cancelAll(),oe.perform(fe)}catch(Z){console.error(Z)}if(!p(G)){m.value=fe,g.value=!1;return}try{const Z=await n.webdav.getFileInfo(e.space,{path:fe.path}),re={...Z,...fe,tags:Z.tags};m.value=re}catch(Z){m.value=fe,console.error(Z)}g.value=!1},{deep:!0,immediate:!0}),yi("resource",lr(m)),yi("versions",lr(w)),yi("space",j(()=>e.space)),yi("activePanel",j(()=>e.activePanel)),yi("availableInternalShareRoles",lr(b)),yi("availableExternalShareRoles",lr(T)),{loadedResource:m,setActiveSideBarPanel:k,closeSideBar:D,panelContext:y,availablePanels:se,isFileHeaderVisible:N,isSpaceHeaderVisible:z,isLoading:h,loadSharesTask:oe}}});function lN(e,t,n,r,o,i){const s=he("file-info"),a=he("space-info"),c=he("InnerSideBar");return e.isOpen?(J(),Ce(c,Zt({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:Te(()=>[e.isFileHeaderVisible?(J(),Ce(s,{key:0,class:"sidebar-panel__file_info","is-sub-panel-active":!1})):e.isSpaceHeaderVisible?(J(),Ce(a,{key:1,class:"sidebar-panel__space_info"})):Oe("",!0)]),subHeader:Te(()=>[e.isFileHeaderVisible?(J(),Ce(s,{key:0,class:"sidebar-panel__file_info","is-sub-panel-active":!0})):e.isSpaceHeaderVisible?(J(),Ce(a,{key:1,class:"sidebar-panel__space_info"})):Oe("",!0)]),_:1},16,["is-open","active-panel","available-panels","panel-context","loading","onSelectPanel","onClose"])):Oe("",!0)}const Qv=Ve(aN,[["render",lN]]),cN=Me({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=ae(),t=ae(!0);return{confirmDisabled:t,onDateChanged:({date:r,error:o})=>{t.value=o||!r,e.value=r},dateTime:e}}}),uN={class:"link-modal-actions oc-flex oc-flex-right oc-flex-middle oc-mt-s"};function fN(e,t,n,r,o,i){const s=he("oc-datepicker"),a=he("oc-button");return J(),Se(Qe,null,[ve(s,{label:e.$gettext("Expiration date"),type:"date","min-date":e.minDate,"current-date":e.currentDate,"is-clearable":e.isClearable,onDateChanged:e.onDateChanged},null,8,["label","min-date","current-date","is-clearable","onDateChanged"]),pe("div",uN,[ve(a,{class:"oc-modal-body-actions-cancel oc-ml-s",onClick:t[0]||(t[0]=c=>e.$emit("cancel"))},{default:Te(()=>[Vt(W.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),ve(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:Te(()=>[Vt(W.toDisplayString(e.$gettext("Confirm")),1)]),_:1},8,["disabled"])])],64)}const dN=Ve(cN,[["render",fN]]),pN=Me({name:"UnsavedChangesModal",props:{modal:{type:Object,required:!0},closeCallback:{type:Function,required:!0}},emits:["cancel","confirm"],setup(e){const{removeModal:t}=bt();return{onClose:()=>{t(e.modal.id),e.closeCallback()}}}}),hN=["textContent"],gN={class:"oc-flex oc-flex-right oc-flex-middle oc-mt-m"},mN={class:"oc-modal-body-actions-grid"};function yN(e,t,n,r,o,i){const s=he("oc-button");return J(),Se(Qe,null,[pe("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,hN),t[2]||(t[2]=pe("div",{class:"oc-my-m"},null,-1)),pe("div",gN,[pe("div",mN,[ve(s,{class:"oc-modal-body-actions-cancel oc-ml-s",onClick:t[0]||(t[0]=a=>e.$emit("cancel"))},{default:Te(()=>[Vt(W.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),ve(s,{class:"oc-modal-body-actions-secondary oc-ml-s",onClick:e.onClose},{default:Te(()=>[Vt(W.toDisplayString(e.$gettext("Don't Save")),1)]),_:1},8,["onClick"]),ve(s,{class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",onClick:t[1]||(t[1]=a=>e.$emit("confirm"))},{default:Te(()=>[Vt(W.toDisplayString(e.$gettext("Save")),1)]),_:1})])])],64)}const Xv=Ve(pN,[["render",yN]]);var bN=/\s/;function vN(e){for(var t=e.length;t--&&bN.test(e.charAt(t)););return t}var wN=/^\s+/;function SN(e){return e&&e.slice(0,vN(e)+1).replace(wN,"")}var Yv=NaN,EN=/^[-+]0x[0-9a-f]+$/i,TN=/^0b[01]+$/i,AN=/^0o[0-7]+$/i,RN=parseInt;function _N(e){if(typeof e=="number")return e;if(gs(e))return Yv;if(Qn(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Qn(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=SN(e);var n=TN.test(e);return n||AN.test(e)?RN(e.slice(2),n?2:8):EN.test(e)?Yv:+e}const IN=Me({name:"AppWrapper",components:{AppTopBar:Wv,FileSideBar:Qv,ErrorScreen:Mk,LoadingScreen:Vk},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}=Ne.useGettext(),r=Zn(),{showMessage:o,showErrorMessage:i}=rt(),s=No.useRouter(),a=en(),c=Ye(),u=cn(),{getResourceContext:l}=Bv(),{selectedResources:f}=Bf(),{dispatchModal:d}=bt(),m=lt(),w=st(),b=Ke(),T=jt(),{actions:v}=Ev({appId:e.applicationId}),{actions:g}=Sf(),{actions:h}=Io(),{actions:y}=_f(),{actions:S}=If(),E=j(()=>{var Pe;return!!((Pe=e.wrappedComponent.emits)!=null&&Pe.includes("update:resource"))}),R=ae(),I=ae(),A=ae(""),$=ae(""),D=ae(!p(E)),k=ae(),N=ae(!1),z=ae(),G=ae(),{actions:X}=Av({content:G}),se=j(()=>{var Pe;return!!((Pe=e.wrappedComponent.emits)!=null&&Pe.includes("update:currentContent"))}),ne=Pe=>!!Object.keys(e.wrappedComponent.props).includes(Pe),oe=j(()=>p(G)!==p(z)),fe=Pe=>{Pe.preventDefault()};Tt(oe,Pe=>{Pe?window.addEventListener("beforeunload",fe):window.removeEventListener("beforeunload",fe)});const{applicationConfig:we,closeApp:Z,currentFileContext:re,getFileContents:ce,getFileInfo:Ie,getUrlForResource:Y,putFileContents:_,replaceInvalidFileRoute:P,revokeUrl:K,activeFiles:V,loadFolderForFileContext:B,isFolderLoading:q}=rv({applicationId:e.applicationId}),{applicationMeta:ue}=vf({applicationId:e.applicationId,appsStore:r}),Re=j(()=>{var Pe;return(Pe=p(ue).meta)==null?void 0:Pe.fileSizeLimit}),Le=j(()=>{const{name:Pe}=p(ue);return t("%{appName} for %{fileName}",{appName:t(Pe),fileName:p(p(re).fileName)})}),ke=Hs("driveAliasAndItem"),Fe=on("fileId"),Be=j(()=>St(p(Fe))),ge=async()=>{const Pe=p(Be),{space:je,path:We}=await l(Pe),wn=je.getDriveAliasAndItem({path:We});return ee.isPersonalSpaceResource(je)?s.push({params:{...p(a).params,driveAliasAndItem:wn},query:{...p(a).query,fileId:Pe,contextRouteName:"files-spaces-generic",contextRouteParams:{driveAliasAndItem:gt.dirname(wn)}}}):s.push({params:{...p(a).params,driveAliasAndItem:wn},query:{...p(a).query,fileId:Pe,contextRouteName:We==="/"?"files-shares-with-me":"files-spaces-generic",...ee.isShareSpaceResource(je)&&{shareId:je.id},contextRouteParams:{driveAliasAndItem:gt.dirname(wn)},contextRouteQuery:{...ee.isShareSpaceResource(je)&&{shareId:je.id}}}})},le=un.useTask(function*(Pe){try{p(ke)||(yield ge()),I.value=p(p(re).space);const je=yield Ie(p(re),{signal:Pe});if(R.value=je,ee.isShareSpaceResource(p(I))&&(p(R).remoteItemId=p(I).id,p(R).id===p(R).remoteItemId)){const We=yield*ee.call(hs({graphClient:c.graphAuthenticated,spacesStore:m,space:p(I)}));We&&(R.value={...je,...ee.buildIncomingShareResource({graphRoles:T.graphRoles,driveItem:We,serverUrl:w.serverUrl}),tags:je.tags})}b.initResourceList({currentFolder:null,resources:[p(R)]}),f.value=[p(R)]}catch(je){console.error(je),k.value=je,D.value=!1}}).restartable(),$e=un.useTask(function*(Pe){try{const je=e.importResourceWithExtension(p(R));if(je){const We=Dt.DateTime.local().toFormat("yyyyMMddHHmmss"),wn=`${p(R).name}_${We}.${je}`;if(!(yield c.webdav.copyFiles(p(I),p(R),p(I),{path:wn},{signal:Pe})))throw new Error(t("Importing failed"));R.value={path:wn}}if(P(re,p(R)))return;if(N.value=![Cn.Updateable,Cn.FileUpdateable].some(We=>(p(R).permissions||"").indexOf(We)>-1),p(ne("currentContent"))){const We=yield*ee.call(ce(re,{...e.fileContentOptions,signal:Pe}));z.value=G.value=We.body,A.value=We.headers["OC-ETag"]}p(ne("url"))&&($.value=yield Y(p(I),p(R),{...e.urlForResourceOptions,signal:Pe}))}catch(je){console.error(je),k.value=je}finally{D.value=!1}}).restartable();Tt(re,async()=>{p(E)||(await le.perform(),p(Re)&&_N(p(R).size)>p(Re)?d({title:t("File exceeds %{threshold}",{threshold:En(p(Re),n)}),message:t("%{resource} exceeds the recommended size of %{threshold} for editing, and may cause performance issues.",{resource:p(R).name,threshold:En(p(Re),n)}),confirmText:t("Continue"),onCancel:()=>{Z()},onConfirm:()=>{$e.perform()}}):$e.perform())},{immediate:!0});const De=Pe=>{console.error(Pe),i({title:t("An error occurred"),desc:Pe.message,errors:[Pe]})},Je=()=>{o({title:t("File autosaved")})},ut=un.useTask(function*(){const Pe=p(G);try{const je=yield _(re,{content:Pe,previousEntityTag:p(A)});z.value=Pe,A.value=je.etag,b.upsertResource(je)}catch(je){switch(je.statusCode){case 401:case 403:De(new ee.HttpError(t("You're not authorized to save this file"),je.response));break;case 409:case 412:De(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 We=m.spaces.find(wn=>wn.id===p(R).storageId&&ee.isProjectSpaceResource(wn));if(We){De(new ee.HttpError(t('Insufficient quota on "%{spaceName}" to save this file',{spaceName:We.name}),je.response));break}De(new ee.HttpError(t("Insufficient quota for saving this file"),je.response));break;default:De(new ee.HttpError("",je.response))}}}).drop(),ct=async()=>{await ut.perform()},Qt=j(()=>!e.disableAutoSave);let Xt=null;Mt(()=>{var je;if((je=b.ancestorMetaData)!=null&&je["/"]&&p(I)&&b.ancestorMetaData["/"].spaceId!==p(I).id&&b.setAncestorMetaData({}),!p(se))return;const Pe=w.options.editor;Pe.autosaveEnabled&&!e.disableAutoSave&&(Xt=setInterval(async()=>{oe.value&&(await ct(),Je())},(Pe.autosaveInterval||120)*1e3))}),jn(()=>{u.isLoading||window.removeEventListener("beforeunload",fe),p(ne("url"))&&K($.value),p(se)&&(clearInterval(Xt),Xt=null)});const{bindKeyAction:Ft}=Dv({skipDisabledKeyBindingsCheck:!0});Ft({modifier:$f.Ctrl,primary:Nf.S},()=>{p(oe)&&ct()});const Ue=j(()=>[{name:"save-file",disabledTooltip:()=>"",isVisible:()=>p(se),isDisabled:()=>N.value||!oe.value,icon:"save",id:"app-save-action",label:()=>t("Save"),handler:ct}]),M=j(()=>({space:p(I),resources:[p(R)]})),C=async(Pe,je)=>{p(oe)&&(await ct(),Je()),je(Pe)},O=j(()=>[...p(v),...p(Ue),...p(X).map(Pe=>({...Pe,isVisible:je=>se.value&&Pe.isVisible(je)}))].filter(Pe=>Pe.isVisible(p(M)))),H=j(()=>[...p(S),...p(g)].filter(Pe=>Pe.isVisible(p(M)))),te=j(()=>[...p(h).map(Pe=>({...Pe,handler:je=>C(je,Pe.handler)}))].filter(Pe=>Pe.isVisible(p(M)))),de=j(()=>[...p(y)].filter(Pe=>Pe.isVisible(p(M)))),Ae=j(()=>{const Pe=[];return p(O).length&&Pe.push({name:"context",items:p(O)}),p(H).length&&Pe.push({name:"share",items:p(H)}),p(te).length&&Pe.push({name:"actions",items:p(te)}),p(de).length&&Pe.push({name:"sidebar",items:p(de)}),Pe}),Ze=j(()=>[...p(Ue)]);No.onBeforeRouteLeave((Pe,je,We)=>{p(oe)?d({title:t("Unsaved changes"),customComponent:Xv,focusTrapInitial:".oc-modal-body-actions-confirm",hideActions:!0,customComponentAttrs:()=>({closeCallback:()=>{We()}}),async onConfirm(){await ct(),We()}}):We()});const ft=j(()=>({url:p($),space:p(p(re).space),resource:p(R),activeFiles:p(V),isDirty:p(oe),isReadOnly:p(N),applicationConfig:p(we),currentFileContext:p(re),currentContent:p(G),isFolderLoading:p(q),"onUpdate:resource":Pe=>{R.value=Pe,I.value=p(p(re).space),f.value=[Pe]},"onUpdate:currentContent":Pe=>{G.value=Pe},onSave:ct,onClose:Z,loadFolderForFileContext:B,revokeUrl:K,getUrlForResource:Y}));return{...bb(),dropDownMenuSections:Ae,dropDownActionOptions:M,hasAutoSave:Qt,isEditor:se,closeApp:Z,fileActions:Ze,loading:D,loadingError:k,pageTitle:Le,resource:R,space:I,slotAttrs:ft}}}),CN=["id"],FN=["textContent"];function PN(e,t,n,r,o,i){const s=he("app-top-bar"),a=he("loading-screen"),c=he("error-screen"),u=he("file-side-bar");return J(),Se("main",{id:e.applicationId,class:"app-wrapper oc-height-1-1",onKeydown:t[0]||(t[0]=Ji((...l)=>e.closeApp&&e.closeApp(...l),["esc"]))},[pe("h1",{class:"oc-invisible-sr",textContent:W.toDisplayString(e.pageTitle)},null,8,FN),!e.loading&&!e.loadingError&&e.resource?(J(),Ce(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"])):Oe("",!0),e.loading?(J(),Ce(a,{key:1})):e.loadingError?(J(),Ce(c,{key:2,message:e.loadingError.message},null,8,["message"])):(J(),Se("div",{key:3,class:W.normalizeClass(["oc-flex oc-width-1-1 oc-height-1-1",{"app-sidebar-open":e.isSideBarOpen}])},[Ge(e.$slots,"default",Zt({class:"app-wrapper-content oc-height-1-1"},e.slotAttrs)),ve(u,{"is-open":e.isSideBarOpen,"active-panel":e.sideBarActivePanel,space:e.space},null,8,["is-open","active-panel","space"])],2))],40,CN)}const Jv=Ve(IN,[["render",PN]]);function ON(e,t){return Me({render(){return fp(Jv,{wrappedComponent:e,...t},{default:n=>fp(e,n)})}})}const xN=Me({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}=Ne.useGettext();return{contextMenuLabel:j(()=>e("Show context menu"))}}});function kN(e,t,n,r,o,i){const s=he("oc-icon"),a=he("oc-drop"),c=he("oc-button"),u=dn("oc-tooltip");return ot((J(),Ce(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[0]||(t[0]=Rn(l=>e.$emit("quickActionClicked",{event:l,dropdown:e.$refs[`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`]}),["stop","prevent"]))},{default:Te(()=>[ve(s,{name:"more-2"}),ve(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)}`,class:"oc-overflow-hidden",position:"bottom-end",mode:"click","close-on-click":"","padding-size":"small"},{default:Te(()=>[Ge(e.$slots,"contextMenu",{item:e.item})]),_:3},8,["drop-id","toggle"])]),_:3},8,["id","aria-label"])),[[u,e.contextMenuLabel]])}const qf=Ve(xN,[["render",kN]]),NN=Me({name:"ResourceGhostElement",components:{ResourceIcon:Co},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}}}),$N={id:"ghost-element",class:"ghost-element"},DN={class:"ghost-element-layer1 oc-rounded"},LN={key:0,class:"ghost-element-layer2 oc-rounded"},MN={key:1,class:"ghost-element-layer3 oc-rounded"},BN={class:"badge"};function jN(e,t,n,r,o,i){const s=he("resource-icon");return J(),Se("div",$N,[pe("div",DN,[ve(s,{class:"oc-p-xs",resource:e.previewItems[0]},null,8,["resource"]),e.showSecondLayer?(J(),Se("div",LN)):Oe("",!0),e.showThirdLayer?(J(),Se("div",MN)):Oe("",!0)]),pe("span",BN,W.toDisplayString(e.itemCount),1)])}const Vf=Ve(NN,[["render",jN]]),UN=Me({name:"ResourceSize",props:{size:{type:[String,Number],required:!0}},setup:e=>{const{current:t}=Ne.useGettext();return{formattedSize:j(()=>En(e.size,t))}}}),qN=["textContent"];function VN(e,t,n,r,o,i){return J(),Se("span",{class:"oc-resource-size",textContent:W.toDisplayString(e.formattedSize)},null,8,qN)}const Zv=Ve(UN,[["render",VN]]),zN=Me({__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=j(()=>{const a=["oc-button","oc-rounded",`oc-button-${ri(e.size)}`,`oc-button-justify-content-${e.justifyContent}`,`oc-button-gap-${ri(e.gapSize)}`,`oc-button-${Et.kebabCase(e.colorRole)}`,`oc-button-${e.appearance}`,`oc-button-${Et.kebabCase(e.colorRole)}-${e.appearance}`];return e.noHover&&a.push("no-hover"),a}),o=j(()=>({...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=j(()=>({...e.type==="button"&&{click:s}})),s=a=>{n("click",a)};return(a,c)=>{const u=he("oc-spinner");return J(),Ce(Wr(a.type),Zt(o.value,{"aria-label":a.ariaLabel,class:r.value},qa(i.value)),{default:Te(()=>[a.showSpinner?(J(),Ce(u,{key:0,size:"small",class:"spinner"})):Oe("",!0),Ge(a.$slots,"default")]),_:3},16,["aria-label","class"])}}});/*!
53
53
  * tabbable 6.2.0
54
54
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
55
- */var Zv=["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])"],ca=Zv.join(","),e0=typeof Element>"u",ai=e0?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ua=!e0&&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},fa=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},zN=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},t0=function(t,n,r){if(fa(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(ca));return n&&ai.call(t,ca)&&o.unshift(t),o=o.filter(r),o},n0=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!fa(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=ai.call(s,ca);l&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var f=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),d=!fa(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(f&&d){var m=e(f===!0?s.children:f.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},r0=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)||zN(t))&&!r0(t)?0:t.tabIndex},WN=function(t,n){var r=li(t);return r<0&&n&&!r0(t)?0:r},HN=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},i0=function(t){return t.tagName==="INPUT"},GN=function(t){return i0(t)&&t.type==="hidden"},KN=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},QN=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},XN=function(t){if(!t.name)return!0;var n=t.form||ua(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=QN(o,t.form);return!i||i===t},YN=function(t){return i0(t)&&t.type==="radio"},JN=function(t){return YN(t)&&!XN(t)},ZN=function(t){var n,r=t&&ua(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,f;r=ua(o),o=(u=r)===null||u===void 0?void 0:u.host,i=!!((l=o)!==null&&l!==void 0&&(f=l.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return i},o0=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},e$=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=ai.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(ai.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=ua(t);if(c&&!c.shadowRoot&&o(c)===!0)return o0(t);t.assignedSlot?t=t.assignedSlot:!c&&u!==t.ownerDocument?t=u.host:t=c}t=a}if(ZN(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return o0(t);return!1},t$=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 ai.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},da=function(t,n){return!(n.disabled||fa(n)||GN(n)||e$(n,t)||KN(n)||t$(n))},zf=function(t,n){return!(JN(n)||li(n)<0||!da(t,n))},n$=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},r$=function e(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,a=s?o.scopeParent:o,c=WN(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(HN).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},i$=function(t,n){n=n||{};var r;return n.getShadowRoot?r=n0([t],n.includeContainer,{filter:zf.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:n$}):r=t0(t,n.includeContainer,zf.bind(null,n)),r$(r)},o$=function(t,n){n=n||{};var r;return n.getShadowRoot?r=n0([t],n.includeContainer,{filter:da.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=t0(t,n.includeContainer,da.bind(null,n)),r},Li=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ai.call(t,ca)===!1?!1:zf(n,t)},s$=Zv.concat("iframe").join(","),Wf=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ai.call(t,s$)===!1?!1:da(n,t)};/*!
55
+ */var e0=["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])"],ca=e0.join(","),t0=typeof Element>"u",ai=t0?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ua=!t0&&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},fa=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},WN=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},n0=function(t,n,r){if(fa(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(ca));return n&&ai.call(t,ca)&&o.unshift(t),o=o.filter(r),o},r0=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!fa(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=ai.call(s,ca);l&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var f=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),d=!fa(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(f&&d){var m=e(f===!0?s.children:f.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))},li=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||WN(t))&&!i0(t)?0:t.tabIndex},HN=function(t,n){var r=li(t);return r<0&&n&&!i0(t)?0:r},GN=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},o0=function(t){return t.tagName==="INPUT"},KN=function(t){return o0(t)&&t.type==="hidden"},QN=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},XN=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},YN=function(t){if(!t.name)return!0;var n=t.form||ua(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=XN(o,t.form);return!i||i===t},JN=function(t){return o0(t)&&t.type==="radio"},ZN=function(t){return JN(t)&&!YN(t)},e$=function(t){var n,r=t&&ua(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,f;r=ua(o),o=(u=r)===null||u===void 0?void 0:u.host,i=!!((l=o)!==null&&l!==void 0&&(f=l.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return i},s0=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},t$=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=ai.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(ai.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=ua(t);if(c&&!c.shadowRoot&&o(c)===!0)return s0(t);t.assignedSlot?t=t.assignedSlot:!c&&u!==t.ownerDocument?t=u.host:t=c}t=a}if(e$(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return s0(t);return!1},n$=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 ai.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},da=function(t,n){return!(n.disabled||fa(n)||KN(n)||t$(n,t)||QN(n)||n$(n))},zf=function(t,n){return!(ZN(n)||li(n)<0||!da(t,n))},r$=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},i$=function e(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,a=s?o.scopeParent:o,c=HN(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(GN).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},o$=function(t,n){n=n||{};var r;return n.getShadowRoot?r=r0([t],n.includeContainer,{filter:zf.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:r$}):r=n0(t,n.includeContainer,zf.bind(null,n)),i$(r)},s$=function(t,n){n=n||{};var r;return n.getShadowRoot?r=r0([t],n.includeContainer,{filter:da.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=n0(t,n.includeContainer,da.bind(null,n)),r},Li=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ai.call(t,ca)===!1?!1:zf(n,t)},a$=e0.concat("iframe").join(","),Wf=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ai.call(t,a$)===!1?!1:da(n,t)};/*!
56
56
  * focus-trap 7.6.4
57
57
  * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
58
- */function Hf(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 a$(e){if(Array.isArray(e))return Hf(e)}function l$(e,t,n){return(t=p$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function u$(){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 s0(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 a0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s0(Object(n),!0).forEach(function(r){l$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function f$(e){return a$(e)||c$(e)||h$(e)||u$()}function d$(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 p$(e){var t=d$(e,"string");return typeof t=="symbol"?t:t+""}function h$(e,t){if(e){if(typeof e=="string")return Hf(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)?Hf(e,t):void 0}}var l0={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"},m$=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},Fo=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},y$=function(t){return Fo(t)&&!t.shiftKey},b$=function(t){return Fo(t)&&t.shiftKey},c0=function(t){return setTimeout(t,0)},Oo=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},pa=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},v$=[],w$=function(t,n){var r=(n==null?void 0:n.document)||document,o=(n==null?void 0:n.trapStack)||v$,i=a0({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:y$,isKeyBackward:b$},n),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a,c=function(N,j,W){return N&&N[j]!==void 0?N[j]:i[W||j]},u=function(N,j){var W=typeof(j==null?void 0:j.composedPath)=="function"?j.composedPath():void 0;return s.containerGroups.findIndex(function(X){var ie=X.container,de=X.tabbableNodes;return ie.contains(N)||(W==null?void 0:W.includes(ie))||de.find(function(se){return se===N})})},l=function(N){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=j.hasFallback,X=W===void 0?!1:W,ie=j.params,de=ie===void 0?[]:ie,se=i[N];if(typeof se=="function"&&(se=se.apply(void 0,f$(de))),se===!0&&(se=void 0),!se){if(se===void 0||se===!1)return se;throw new Error("`".concat(N,"` was specified but was not a node, or did not return a node"))}var we=se;if(typeof se=="string"){try{we=r.querySelector(se)}catch(Se){throw new Error("`".concat(N,'` appears to be an invalid selector; error="').concat(Se.message,'"'))}if(!we&&!X)throw new Error("`".concat(N,"` as selector refers to no known node"))}return we},f=function(){var N=l("initialFocus",{hasFallback:!0});if(N===!1)return!1;if(N===void 0||N&&!Wf(N,i.tabbableOptions))if(u(r.activeElement)>=0)N=r.activeElement;else{var j=s.tabbableGroups[0],W=j&&j.firstTabbableNode;N=W||l("fallbackFocus")}else N===null&&(N=l("fallbackFocus"));if(!N)throw new Error("Your focus-trap needs to have at least one focusable element");return N},d=function(){if(s.containerGroups=s.containers.map(function(N){var j=i$(N,i.tabbableOptions),W=o$(N,i.tabbableOptions),X=j.length>0?j[0]:void 0,ie=j.length>0?j[j.length-1]:void 0,de=W.find(function(Se){return Li(Se)}),se=W.slice().reverse().find(function(Se){return Li(Se)}),we=!!j.find(function(Se){return li(Se)>0});return{container:N,tabbableNodes:j,focusableNodes:W,posTabIndexesFound:we,firstTabbableNode:X,lastTabbableNode:ie,firstDomTabbableNode:de,lastDomTabbableNode:se,nextTabbableNode:function(Z){var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,le=j.indexOf(Z);return le<0?ne?W.slice(W.indexOf(Z)+1).find(function(Ie){return Li(Ie)}):W.slice(0,W.indexOf(Z)).reverse().find(function(Ie){return Li(Ie)}):j[le+(ne?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(N){return N.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(N){return N.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(N){var j=N.activeElement;if(j)return j.shadowRoot&&j.shadowRoot.activeElement!==null?m(j.shadowRoot):j},w=function(N){if(N!==!1&&N!==m(document)){if(!N||!N.focus){w(f());return}N.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=N,g$(N)&&N.select()}},v=function(N){var j=l("setReturnFocus",{params:[N]});return j||(j===!1?!1:N)},T=function(N){var j=N.target,W=N.event,X=N.isBackward,ie=X===void 0?!1:X;j=j||pa(W),d();var de=null;if(s.tabbableGroups.length>0){var se=u(j,W),we=se>=0?s.containerGroups[se]:void 0;if(se<0)ie?de=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:de=s.tabbableGroups[0].firstTabbableNode;else if(ie){var Se=s.tabbableGroups.findIndex(function(_){var F=_.firstTabbableNode;return j===F});if(Se<0&&(we.container===j||Wf(j,i.tabbableOptions)&&!Li(j,i.tabbableOptions)&&!we.nextTabbableNode(j,!1))&&(Se=se),Se>=0){var Z=Se===0?s.tabbableGroups.length-1:Se-1,ne=s.tabbableGroups[Z];de=li(j)>=0?ne.lastTabbableNode:ne.lastDomTabbableNode}else Fo(W)||(de=we.nextTabbableNode(j,!1))}else{var le=s.tabbableGroups.findIndex(function(_){var F=_.lastTabbableNode;return j===F});if(le<0&&(we.container===j||Wf(j,i.tabbableOptions)&&!Li(j,i.tabbableOptions)&&!we.nextTabbableNode(j))&&(le=se),le>=0){var Ie=le===s.tabbableGroups.length-1?0:le+1,Y=s.tabbableGroups[Ie];de=li(j)>=0?Y.firstTabbableNode:Y.firstDomTabbableNode}else Fo(W)||(de=we.nextTabbableNode(j))}}else de=l("fallbackFocus");return de},b=function(N){var j=pa(N);if(!(u(j,N)>=0)){if(Oo(i.clickOutsideDeactivates,N)){a.deactivate({returnFocus:i.returnFocusOnDeactivate});return}Oo(i.allowOutsideClick,N)||N.preventDefault()}},g=function(N){var j=pa(N),W=u(j,N)>=0;if(W||j instanceof Document)W&&(s.mostRecentlyFocusedNode=j);else{N.stopImmediatePropagation();var X,ie=!0;if(s.mostRecentlyFocusedNode)if(li(s.mostRecentlyFocusedNode)>0){var de=u(s.mostRecentlyFocusedNode),se=s.containerGroups[de].tabbableNodes;if(se.length>0){var we=se.findIndex(function(Se){return Se===s.mostRecentlyFocusedNode});we>=0&&(i.isKeyForward(s.recentNavEvent)?we+1<se.length&&(X=se[we+1],ie=!1):we-1>=0&&(X=se[we-1],ie=!1))}}else s.containerGroups.some(function(Se){return Se.tabbableNodes.some(function(Z){return li(Z)>0})})||(ie=!1);else ie=!1;ie&&(X=T({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),w(X||s.mostRecentlyFocusedNode||f())}s.recentNavEvent=void 0},h=function(N){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=N;var W=T({event:N,isBackward:j});W&&(Fo(N)&&N.preventDefault(),w(W))},y=function(N){(i.isKeyForward(N)||i.isKeyBackward(N))&&h(N,i.isKeyBackward(N))},S=function(N){m$(N)&&Oo(i.escapeDeactivates,N)!==!1&&(N.preventDefault(),a.deactivate())},E=function(N){var j=pa(N);u(j,N)>=0||Oo(i.clickOutsideDeactivates,N)||Oo(i.allowOutsideClick,N)||(N.preventDefault(),N.stopImmediatePropagation())},R=function(){if(s.active)return l0.activateTrap(o,a),s.delayInitialFocusTimer=i.delayInitialFocus?c0(function(){w(f())}):w(f()),r.addEventListener("focusin",g,!0),r.addEventListener("mousedown",b,{capture:!0,passive:!1}),r.addEventListener("touchstart",b,{capture:!0,passive:!1}),r.addEventListener("click",E,{capture:!0,passive:!1}),r.addEventListener("keydown",y,{capture:!0,passive:!1}),r.addEventListener("keydown",S),a},I=function(){if(s.active)return r.removeEventListener("focusin",g,!0),r.removeEventListener("mousedown",b,!0),r.removeEventListener("touchstart",b,!0),r.removeEventListener("click",E,!0),r.removeEventListener("keydown",y,!0),r.removeEventListener("keydown",S),a},A=function(N){var j=N.some(function(W){var X=Array.from(W.removedNodes);return X.some(function(ie){return ie===s.mostRecentlyFocusedNode})});j&&w(f())},$=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(A):void 0,D=function(){$&&($.disconnect(),s.active&&!s.paused&&s.containers.map(function(N){$.observe(N,{subtree:!0,childList:!0})}))};return a={get active(){return s.active},get paused(){return s.paused},activate:function(N){if(s.active)return this;var j=c(N,"onActivate"),W=c(N,"onPostActivate"),X=c(N,"checkCanFocusTrap");X||d(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=r.activeElement,j==null||j();var ie=function(){X&&d(),R(),D(),W==null||W()};return X?(X(s.containers.concat()).then(ie,ie),this):(ie(),this)},deactivate:function(N){if(!s.active)return this;var j=a0({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},N);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,I(),s.active=!1,s.paused=!1,D(),l0.deactivateTrap(o,a);var W=c(j,"onDeactivate"),X=c(j,"onPostDeactivate"),ie=c(j,"checkCanReturnFocus"),de=c(j,"returnFocus","returnFocusOnDeactivate");W==null||W();var se=function(){c0(function(){de&&w(v(s.nodeFocusedBeforeActivation)),X==null||X()})};return de&&ie?(ie(v(s.nodeFocusedBeforeActivation)).then(se,se),this):(se(),this)},pause:function(N){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,N)):this},unpause:function(N){return s.active?(s.manuallyPaused=!1,o[o.length-1]!==this?this:this._setPausedState(!1,N)):this},updateContainerElements:function(N){var j=[].concat(N).filter(Boolean);return s.containers=j.map(function(W){return typeof W=="string"?r.querySelector(W):W}),s.active&&d(),D(),this}},Object.defineProperties(a,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function(N,j){if(s.paused===N)return this;if(s.paused=N,N){var W=c(j,"onPause"),X=c(j,"onPostPause");W==null||W(),I(),D(),X==null||X()}else{var ie=c(j,"onUnpause"),de=c(j,"onPostUnpause");ie==null||ie(),d(),R(),D(),de==null||de()}return this}}}),a.updateContainerElements(t),a};/*!
58
+ */function Hf(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 l$(e){if(Array.isArray(e))return Hf(e)}function c$(e,t,n){return(t=h$(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 f$(){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 a0(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 l0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?a0(Object(n),!0).forEach(function(r){c$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function d$(e){return l$(e)||u$(e)||g$(e)||f$()}function p$(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 h$(e){var t=p$(e,"string");return typeof t=="symbol"?t:t+""}function g$(e,t){if(e){if(typeof e=="string")return Hf(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)?Hf(e,t):void 0}}var c0={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)}},m$=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},y$=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},Po=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},b$=function(t){return Po(t)&&!t.shiftKey},v$=function(t){return Po(t)&&t.shiftKey},u0=function(t){return setTimeout(t,0)},Oo=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},pa=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},w$=[],S$=function(t,n){var r=(n==null?void 0:n.document)||document,o=(n==null?void 0:n.trapStack)||w$,i=l0({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:b$,isKeyBackward:v$},n),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a,c=function(N,z,G){return N&&N[z]!==void 0?N[z]:i[G||z]},u=function(N,z){var G=typeof(z==null?void 0:z.composedPath)=="function"?z.composedPath():void 0;return s.containerGroups.findIndex(function(X){var se=X.container,ne=X.tabbableNodes;return se.contains(N)||(G==null?void 0:G.includes(se))||ne.find(function(oe){return oe===N})})},l=function(N){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},G=z.hasFallback,X=G===void 0?!1:G,se=z.params,ne=se===void 0?[]:se,oe=i[N];if(typeof oe=="function"&&(oe=oe.apply(void 0,d$(ne))),oe===!0&&(oe=void 0),!oe){if(oe===void 0||oe===!1)return oe;throw new Error("`".concat(N,"` was specified but was not a node, or did not return a node"))}var fe=oe;if(typeof oe=="string"){try{fe=r.querySelector(oe)}catch(we){throw new Error("`".concat(N,'` appears to be an invalid selector; error="').concat(we.message,'"'))}if(!fe&&!X)throw new Error("`".concat(N,"` as selector refers to no known node"))}return fe},f=function(){var N=l("initialFocus",{hasFallback:!0});if(N===!1)return!1;if(N===void 0||N&&!Wf(N,i.tabbableOptions))if(u(r.activeElement)>=0)N=r.activeElement;else{var z=s.tabbableGroups[0],G=z&&z.firstTabbableNode;N=G||l("fallbackFocus")}else N===null&&(N=l("fallbackFocus"));if(!N)throw new Error("Your focus-trap needs to have at least one focusable element");return N},d=function(){if(s.containerGroups=s.containers.map(function(N){var z=o$(N,i.tabbableOptions),G=s$(N,i.tabbableOptions),X=z.length>0?z[0]:void 0,se=z.length>0?z[z.length-1]:void 0,ne=G.find(function(we){return Li(we)}),oe=G.slice().reverse().find(function(we){return Li(we)}),fe=!!z.find(function(we){return li(we)>0});return{container:N,tabbableNodes:z,focusableNodes:G,posTabIndexesFound:fe,firstTabbableNode:X,lastTabbableNode:se,firstDomTabbableNode:ne,lastDomTabbableNode:oe,nextTabbableNode:function(Z){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ce=z.indexOf(Z);return ce<0?re?G.slice(G.indexOf(Z)+1).find(function(Ie){return Li(Ie)}):G.slice(0,G.indexOf(Z)).reverse().find(function(Ie){return Li(Ie)}):z[ce+(re?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(N){return N.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(N){return N.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(N){var z=N.activeElement;if(z)return z.shadowRoot&&z.shadowRoot.activeElement!==null?m(z.shadowRoot):z},w=function(N){if(N!==!1&&N!==m(document)){if(!N||!N.focus){w(f());return}N.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=N,m$(N)&&N.select()}},b=function(N){var z=l("setReturnFocus",{params:[N]});return z||(z===!1?!1:N)},T=function(N){var z=N.target,G=N.event,X=N.isBackward,se=X===void 0?!1:X;z=z||pa(G),d();var ne=null;if(s.tabbableGroups.length>0){var oe=u(z,G),fe=oe>=0?s.containerGroups[oe]:void 0;if(oe<0)se?ne=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:ne=s.tabbableGroups[0].firstTabbableNode;else if(se){var we=s.tabbableGroups.findIndex(function(_){var P=_.firstTabbableNode;return z===P});if(we<0&&(fe.container===z||Wf(z,i.tabbableOptions)&&!Li(z,i.tabbableOptions)&&!fe.nextTabbableNode(z,!1))&&(we=oe),we>=0){var Z=we===0?s.tabbableGroups.length-1:we-1,re=s.tabbableGroups[Z];ne=li(z)>=0?re.lastTabbableNode:re.lastDomTabbableNode}else Po(G)||(ne=fe.nextTabbableNode(z,!1))}else{var ce=s.tabbableGroups.findIndex(function(_){var P=_.lastTabbableNode;return z===P});if(ce<0&&(fe.container===z||Wf(z,i.tabbableOptions)&&!Li(z,i.tabbableOptions)&&!fe.nextTabbableNode(z))&&(ce=oe),ce>=0){var Ie=ce===s.tabbableGroups.length-1?0:ce+1,Y=s.tabbableGroups[Ie];ne=li(z)>=0?Y.firstTabbableNode:Y.firstDomTabbableNode}else Po(G)||(ne=fe.nextTabbableNode(z))}}else ne=l("fallbackFocus");return ne},v=function(N){var z=pa(N);if(!(u(z,N)>=0)){if(Oo(i.clickOutsideDeactivates,N)){a.deactivate({returnFocus:i.returnFocusOnDeactivate});return}Oo(i.allowOutsideClick,N)||N.preventDefault()}},g=function(N){var z=pa(N),G=u(z,N)>=0;if(G||z instanceof Document)G&&(s.mostRecentlyFocusedNode=z);else{N.stopImmediatePropagation();var X,se=!0;if(s.mostRecentlyFocusedNode)if(li(s.mostRecentlyFocusedNode)>0){var ne=u(s.mostRecentlyFocusedNode),oe=s.containerGroups[ne].tabbableNodes;if(oe.length>0){var fe=oe.findIndex(function(we){return we===s.mostRecentlyFocusedNode});fe>=0&&(i.isKeyForward(s.recentNavEvent)?fe+1<oe.length&&(X=oe[fe+1],se=!1):fe-1>=0&&(X=oe[fe-1],se=!1))}}else s.containerGroups.some(function(we){return we.tabbableNodes.some(function(Z){return li(Z)>0})})||(se=!1);else se=!1;se&&(X=T({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),w(X||s.mostRecentlyFocusedNode||f())}s.recentNavEvent=void 0},h=function(N){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=N;var G=T({event:N,isBackward:z});G&&(Po(N)&&N.preventDefault(),w(G))},y=function(N){(i.isKeyForward(N)||i.isKeyBackward(N))&&h(N,i.isKeyBackward(N))},S=function(N){y$(N)&&Oo(i.escapeDeactivates,N)!==!1&&(N.preventDefault(),a.deactivate())},E=function(N){var z=pa(N);u(z,N)>=0||Oo(i.clickOutsideDeactivates,N)||Oo(i.allowOutsideClick,N)||(N.preventDefault(),N.stopImmediatePropagation())},R=function(){if(s.active)return c0.activateTrap(o,a),s.delayInitialFocusTimer=i.delayInitialFocus?u0(function(){w(f())}):w(f()),r.addEventListener("focusin",g,!0),r.addEventListener("mousedown",v,{capture:!0,passive:!1}),r.addEventListener("touchstart",v,{capture:!0,passive:!1}),r.addEventListener("click",E,{capture:!0,passive:!1}),r.addEventListener("keydown",y,{capture:!0,passive:!1}),r.addEventListener("keydown",S),a},I=function(){if(s.active)return r.removeEventListener("focusin",g,!0),r.removeEventListener("mousedown",v,!0),r.removeEventListener("touchstart",v,!0),r.removeEventListener("click",E,!0),r.removeEventListener("keydown",y,!0),r.removeEventListener("keydown",S),a},A=function(N){var z=N.some(function(G){var X=Array.from(G.removedNodes);return X.some(function(se){return se===s.mostRecentlyFocusedNode})});z&&w(f())},$=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(A):void 0,D=function(){$&&($.disconnect(),s.active&&!s.paused&&s.containers.map(function(N){$.observe(N,{subtree:!0,childList:!0})}))};return a={get active(){return s.active},get paused(){return s.paused},activate:function(N){if(s.active)return this;var z=c(N,"onActivate"),G=c(N,"onPostActivate"),X=c(N,"checkCanFocusTrap");X||d(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=r.activeElement,z==null||z();var se=function(){X&&d(),R(),D(),G==null||G()};return X?(X(s.containers.concat()).then(se,se),this):(se(),this)},deactivate:function(N){if(!s.active)return this;var z=l0({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},N);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,I(),s.active=!1,s.paused=!1,D(),c0.deactivateTrap(o,a);var G=c(z,"onDeactivate"),X=c(z,"onPostDeactivate"),se=c(z,"checkCanReturnFocus"),ne=c(z,"returnFocus","returnFocusOnDeactivate");G==null||G();var oe=function(){u0(function(){ne&&w(b(s.nodeFocusedBeforeActivation)),X==null||X()})};return ne&&se?(se(b(s.nodeFocusedBeforeActivation)).then(oe,oe),this):(oe(),this)},pause:function(N){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,N)):this},unpause:function(N){return s.active?(s.manuallyPaused=!1,o[o.length-1]!==this?this:this._setPausedState(!1,N)):this},updateContainerElements:function(N){var z=[].concat(N).filter(Boolean);return s.containers=z.map(function(G){return typeof G=="string"?r.querySelector(G):G}),s.active&&d(),D(),this}},Object.defineProperties(a,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function(N,z){if(s.paused===N)return this;if(s.paused=N,N){var G=c(z,"onPause"),X=c(z,"onPostPause");G==null||G(),I(),D(),X==null||X()}else{var se=c(z,"onUnpause"),ne=c(z,"onPostUnpause");se==null||se(),d(),R(),D(),ne==null||ne()}return this}}}),a.updateContainerElements(t),a};/*!
60
60
  * focus-trap-vue v4.0.2
61
61
  * (c) 2023 Eduardo San Martin Morote
62
62
  * @license MIT
63
- */function P2(e){return e}const S$={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}},S$);var E$=Object.defineProperty,u0=Object.getOwnPropertySymbols,T$=Object.prototype.hasOwnProperty,A$=Object.prototype.propertyIsEnumerable,f0=(e,t,n)=>t in e?E$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,R$=(e,t)=>{for(var n in t||(t={}))T$.call(t,n)&&f0(e,n,t[n]);if(u0)for(var n of u0(t))A$.call(t,n)&&f0(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},_$={},I$={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},C$=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),P$=[C$];function F$(e,t){return J(),ve("svg",I$,P$)}const O$=d0(_$,[["render",F$]]),x$={},k$={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"},N$=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),$$=[N$];function D$(e,t){return J(),ve("svg",k$,$$)}R$({},{Deselect:O$,OpenIndicator:d0(x$,[["render",D$]])});const L$=["aria-label"],M$=Me({__name:"OcSpinner",props:{ariaLabel:{default:""},size:{default:"medium"}},setup(e){const t=U(()=>["oc-spinner",`oc-spinner-${ri(e.size||"medium")}`]);return(n,r)=>(J(),ve("span",{class:H.normalizeClass(t.value),"aria-label":n.ariaLabel,tabindex:"-1",role:"img"},null,10,L$))}}),B$={class:"oc-thead"},j$=Me({name:"OcTableHead",__name:"OcTableHead",setup(e){return(t,n)=>(J(),ve("thead",B$,[Ge(t.$slots,"default")]))}}),U$=Me({name:"OcTableBody",__name:"OcTableBody",setup(e){return(t,n)=>(J(),ve("tbody",null,[Ge(t.$slots,"default")]))}}),p0=({target:e,mode:t="show",rootMargin:n="100px",onVisibleCallback:r})=>{if(!(window&&"IntersectionObserver"in window))return{isVisible:oe(!0)};const i=oe(!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 Tt(e,()=>{s.observe(e.value)}),jn(()=>s.disconnect()),{isVisible:i}},h0=Me({__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=U(()=>{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)=>(J(),Ce(Wr(o.type),{class:H.normalizeClass(r.value),onClick:i[0]||(i[0]=s=>n("click",s))},{default:Te(()=>[Ge(o.$slots,"default")]),_:3},8,["class"]))}}),g0=Me({__name:"OcTableTd",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},setup(e){return(t,n)=>(J(),Ce(h0,{type:"td","align-h":t.alignH,"align-v":t.alignV,width:t.width,wrap:t.wrap,class:"oc-td"},{default:Te(()=>[Ge(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),m0=Me({__name:"OcTableTr",props:{lazy:{}},emits:["contextmenu","click","dragstart","drop","dragenter","dragleave","dragover","mouseleave","itemVisible"],setup(e,{emit:t}){const n=t,r=Td((a,c)=>{let u;return{get(){return a(),u},set(l){u=l,c()}}}),o=U(()=>e.lazy?e.lazy.colspan:1),{isVisible:i}=e.lazy?p0({...e.lazy,target:r,onVisibleCallback:()=>n("itemVisible")}):{isVisible:oe(!0)},s=U(()=>!p(i));return e.lazy||n("itemVisible"),(a,c)=>(J(),ve("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?(J(),Ce(g0,{key:0,colspan:o.value},{default:Te(()=>c[8]||(c[8]=[fe("span",{class:"shimmer"},null,-1)])),_:1},8,["colspan"])):Ge(a.$slots,"default",{key:1})],544))}}),q$=Me({__name:"OcTableTh",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e){return(t,n)=>(J(),Ce(h0,{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:Te(()=>[Ge(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),V$={key:0,class:"oc-table-thead-content"},z$=["textContent"],W$={key:1},H$={key:0,class:"oc-table-thead-content"},G$=["textContent"],K$={key:1,class:"oc-table-footer"},Q$={class:"oc-table-footer-row"},X$=["colspan"],y0="asc",Gf="desc",Y$=Me({__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:_P,EVENT_TROW_CLICKED:IP,EVENT_TROW_MOUNTED:CP,EVENT_TROW_CONTEXTMENU:PP},{$gettext:o}=Ne.useGettext(),i=D=>e.itemDomSelector?e.itemDomSelector(D):D[e.idKey],s=U(()=>{const D=["oc-table"];return e.hover&&D.push("oc-table-hover"),e.sticky&&D.push("oc-table-sticky"),D}),a=U(()=>e.fields.length),c=D=>{D.preventDefault()},u=(D,k)=>{n(FP,D,k)},l=(D,k)=>{n(Ab,D,k)},f=(D,k,N)=>{n("dropRowStyling",D,k,N)},d=D=>D.type==="slot",m=D=>["callback","function"].indexOf(D.type)>=0,w=D=>Object.prototype.hasOwnProperty.call(D,"title")?D.title:D.name,v=()=>({class:s.value}),T=(D,k)=>{const N=h(D);return N.class=`oc-table-header-cell oc-table-header-cell-${D.name}`,Object.prototype.hasOwnProperty.call(D,"thClass")&&(N.class+=` ${D.thClass}`),e.sticky&&(N.style=`top: ${e.headerPosition}px;`),k===0&&(N.class+=` oc-pl-${ri(e.paddingX)} `),k===e.fields.length-1&&(N.class+=` oc-pr-${ri(e.paddingX)}`),I(N,D),N},b=(D,k)=>({...e.lazy&&{lazy:{colspan:a.value}},class:["oc-tbody-tr",`oc-tbody-tr-${i(D)||k}`,y(D)?"oc-table-highlighted":void 0,S(D)?"oc-table-disabled":void 0].filter(Boolean)}),g=(D,k,N)=>{const j=h(D);return j.class=`oc-table-data-cell oc-table-data-cell-${D.name}`,Object.prototype.hasOwnProperty.call(D,"tdClass")&&(j.class+=` ${D.tdClass}`),Object.prototype.hasOwnProperty.call(D,"wrap")&&(j.wrap=D.wrap),k===0&&(j.class+=` oc-pl-${ri(e.paddingX)} `),k===e.fields.length-1&&(j.class+=` oc-pr-${ri(e.paddingX)}`),Object.prototype.hasOwnProperty.call(D,"accessibleLabelCallback")&&(j["aria-label"]=D.accessibleLabelCallback(N)),j},h=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}),y=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,E=(D,k,N)=>{const j=[N[e.idKey],k+1].filter(Boolean);return d(D)?[...j,D.name].join("-"):m(D)?[...j,D.callback(N[D.name])].join("-"):[...j,N[D.name]].join("-")},R=D=>o("Sort by %{ name }",{name:D}),I=(D,k)=>{if(!A(k))return;let N="none";e.sortBy===k.name&&(N=e.sortDir===y0?"ascending":"descending"),D["aria-sort"]=N},A=({sortable:D})=>!!D,$=D=>{if(!A(D))return;let k=e.sortDir;e.sortBy===D.name&&e.sortDir!==void 0&&(k=e.sortDir===Gf?y0:Gf),(e.sortBy!==D.name||e.sortDir===void 0)&&(k=D.sortDir||Gf),n("sort",{sortBy:D.name,sortDir:k})};return(D,k)=>{const N=pe("oc-icon");return J(),ve("table",Zt(v(),{class:"has-item-context-menu"}),[D.hasHeader?(J(),Ce(j$,{key:0},{default:Te(()=>[be(m0,{class:"oc-table-header-row"},{default:Te(()=>[(J(!0),ve(Qe,null,kt(D.fields,(j,W)=>(J(),Ce(q$,Zt({key:`oc-thead-${j.name}`,ref_for:!0},T(j,W)),{default:Te(()=>[j.sortable?(J(),Ce(VN,{key:0,"aria-label":R(j.name),appearance:"raw",class:"oc-button-sort oc-width-1-1","gap-size":"small","no-hover":"",onClick:X=>$(j)},{default:Te(()=>[j.headerType==="slot"?(J(),ve("span",V$,[Ge(D.$slots,j.name+"Header")])):(J(),ve("span",{key:1,class:"oc-table-thead-content header-text",textContent:H.toDisplayString(w(j))},null,8,z$)),be(N,{name:D.sortDir==="asc"?"arrow-down":"arrow-up","fill-type":"line",class:H.normalizeClass([{"oc-invisible-sr":D.sortBy!==j.name},"oc-p-xs oc-rounded"]),size:"small"},null,8,["name","class"])]),_:2},1032,["aria-label","onClick"])):(J(),ve("div",W$,[j.headerType==="slot"?(J(),ve("span",H$,[Ge(D.$slots,j.name+"Header")])):(J(),ve("span",{key:1,class:"oc-table-thead-content header-text",textContent:H.toDisplayString(w(j))},null,8,G$))]))]),_:2},1040))),128))]),_:3})]),_:3})):Oe("",!0),be(U$,{class:"has-item-context-menu"},{default:Te(()=>[(J(!0),ve(Qe,null,kt(D.data,(j,W)=>(J(),Ce(m0,Zt({key:`oc-tbody-tr-${i(j)||W}`,ref_for:!0,ref:`row-${W}`},b(j,W),{"data-item-id":j[D.idKey],draggable:D.dragDrop,onClick:X=>D.$emit(r.EVENT_TROW_CLICKED,[j,X]),onContextmenu:X=>D.$emit(r.EVENT_TROW_CONTEXTMENU,D.$refs[`row-${W}`][0],X,j),onVnodeMounted:X=>D.$emit(r.EVENT_TROW_MOUNTED,j,D.$refs[`row-${W}`][0]),onDragstart:X=>u(j,X),onDrop:X=>l(i(j),X),onDragenter:Rn(X=>f(i(j),!1,X),["prevent"]),onDragleave:Rn(X=>f(i(j),!0,X),["prevent"]),onMouseleave:X=>f(i(j),!0,X),onDragover:k[0]||(k[0]=X=>c(X)),onItemVisible:X=>D.$emit("itemVisible",j)}),{default:Te(()=>[(J(!0),ve(Qe,null,kt(D.fields,(X,ie)=>(J(),Ce(g0,Zt({key:"oc-tbody-td-"+E(X,ie,j),ref_for:!0},g(X,ie,j)),{default:Te(()=>[d(X)?Ge(D.$slots,X.name,{key:0,item:j}):m(X)?(J(),ve(Qe,{key:1},[Vt(H.toDisplayString(X.callback(j[X.name])),1)],64)):(J(),ve(Qe,{key:2},[Vt(H.toDisplayString(j[X.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?(J(),ve("tfoot",K$,[fe("tr",Q$,[fe("td",{colspan:a.value,class:"oc-table-footer-cell"},[Ge(D.$slots,"footer")],8,X$)])])):Oe("",!0)],16)}}}),J$=850,Z$=Me({components:{ContextMenuQuickAction:qf,ResourceGhostElement:Vf,ResourceListItem:Po,ResourceSize:Jv,OcTable:Y$,OcSpinner:M$},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:()=>Gt.defaultModeName,validator:e=>[Gt.name.condensedTable,Gt.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||[Bt.Asc.toString(),Bt.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",Pf,"update:selectedIds","update:modelValue"],setup(e,t){const n=ze(),r=rn(),{getMatchingSpace:o}=ln(),{canBeOpenedWithSecureView:i}=Df(),s=si({space:oe(e.space),targetRouteCallback:U(()=>e.targetRouteCallback)}),{isSticky:a}=kf(),{isLocationPicker:c,isFilePicker:u,postMessage:l,isEnabled:f,fileTypes:d}=ni(),{getDefaultAction:m}=Vn(),w=st(),{options:v}=He.storeToRefs(w),T=To(),{resources:b,action:g}=He.storeToRefs(T),h=Xr(),{userContextReady:y}=He.storeToRefs(h),S=Ke(),{areFileExtensionsShown:E,latestSelectedId:R,deleteQueue:I}=He.storeToRefs(S),A=oe(),$=oe(),D=oe(),{width:k}=Mr.useWindowSize(),N=U(()=>r.filesTags&&k.value>=J$),{actions:j}=ra(),{actions:W}=Ov(),X=U(()=>p(j)[0].handler),ie=U(()=>p(W)[0].handler),de=Y=>Y.length>7?Y:"",se=Y=>{var _;return p(f)&&((_=p(d))!=null&&_.length)?!p(d).includes(Y.extension)&&!p(d).includes(Y.mimeType)&&!Y.isFolder:Y.processing===!0||Ie(Y.id)},we=U(()=>{var Y,_;return((_=(Y=e.resources)==null?void 0:Y.filter(F=>se(F)===!0))==null?void 0:_.map(F=>F.id))||[]}),Se=Y=>!e.areResourcesClickable||ee.isProjectSpaceResource(Y)&&Y.disabled||!Y.isFolder&&(!Y.canDownload()&&!i(Y)||p(f)&&!p(u))?!1:!p(we).includes(Y.id),Z=Y=>{Xe.publish("app.files.list.clicked"),t.emit("update:selectedIds",Y)},ne=Y=>{S.toggleSelection(Y),Z(S.selectedIds)},le=Y=>{if(Y.isFolder)return s.getFolderLink(Y);let _=e.space;_||(_=o(Y));const F=m({resources:[Y],space:_});if(F!=null&&F.route)return F.route({space:_,resources:[Y]})},Ie=Y=>p(I).includes(Y);return{router:n,configOptions:v,dragItem:A,ghostElement:$,contextMenuButton:D,getTagToolTip:de,renameActions:j,renameActionsSpace:W,renameHandler:X,renameHandlerSpace:ie,FolderViewModeConstants:Gt,hasTags:N,disabledResources:we,isResourceDisabled:se,userContextReady:y,getMatchingSpace:o,clipboardResources:b,clipboardAction:g,...aa({space:oe(e.space),targetRouteCallback:U(()=>e.targetRouteCallback)},t),...s,postMessage:l,isFilePicker:u,isLocationPicker:c,isEmbedModeEnabled:f,emitSelect:Z,toggleSelection:ne,areFileExtensionsShown:E,latestSelectedId:R,isResourceClickable:Se,getResourceLink:le,isSticky:a,isResourceInDeleteQueue:Ie}},data(){return{constants:{ImageDimension:zn,EVENT_TROW_MOUNTED:hv}}},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=gh(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;let o;return r.prop?o=_l(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!==ei.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 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 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(){Xe.publish(yt.open)},openSharingSidebar(e){let t;e.type==="space"?t="space-share":t="sharing",Xe.publish(yt.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(Pf,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]),wo(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]),wo(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(Ks(p(this.router.currentRoute))))});const n=e[1],r=e[2]??!1,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 Xe.publish("app.files.list.clicked.meta",t);if(n&&n.shiftKey)return Xe.publish("app.files.list.clicked.shift",{resource:t,skipTargetSelection:r});if(!o&&!this.isResourceSelected(t))return this.emitSelect([t.id])}},formatDate(e){return pb(new Date(e),this.$language.current)},formatDateRelative(e){return gb(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,shareType:ee.ShareTypes.user.value,username: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,shareType:t.shareType,username:t.id})):[]}}}),eD={class:"resource-table-select-all"},tD={class:"oc-text-truncate"},nD=["textContent"],rD=["textContent"],iD=["textContent"],oD={key:0,class:"resource-table-actions"};function sD(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"),f=pe("resource-size"),d=pe("oc-tag"),m=pe("oc-status-indicators"),w=pe("oc-avatars"),v=pe("context-menu-quick-action"),T=pe("oc-table"),b=pe("resource-ghost-element"),g=dn("oc-tooltip");return J(),ve(Qe,null,[be(T,Zt(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))}),Wd({name:Te(({item:h})=>[fe("div",{class:H.normalizeClass(["resource-table-resource-wrapper",[{"resource-table-resource-wrapper-limit-max-width":e.hasRenameAction(h)}]])},[Ge(e.$slots,"image",{resource:h}),(J(),Ce(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:H.normalizeClass({"resource-table-resource-cut":e.isResourceCut(h)}),onClick:y=>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)?(J(),Ce(l,{key:0,class:"resource-table-edit-name raw-hover-surface oc-p-xs",appearance:"raw",onClick:y=>e.openRenameDialog(h)},{default:Te(()=>[be(u,{name:"edit-2","fill-type":"line",size:"small"})]),_:2},1032,["onClick"])):Oe("",!0)],2),Ge(e.$slots,"additionalResourceContent",{resource:h})]),syncEnabled:Te(({item:h})=>[Ge(e.$slots,"syncEnabled",{resource:h})]),size:Te(({item:h})=>[be(f,{size:h.size||Number.NaN},null,8,["size"])]),tags:Te(({item:h})=>[(J(!0),ve(Qe,null,kt(h.tags.slice(0,2),y=>(J(),Ce(Wr(e.userContextReady?"router-link":"span"),Zt({key:y,ref_for:!0},e.getTagComponentAttrs(y),{class:"resource-table-tag-wrapper"}),{default:Te(()=>[ot((J(),Ce(d,{class:"resource-table-tag oc-ml-xs",rounded:!0,size:"small"},{default:Te(()=>[be(u,{name:"price-tag-3",size:"small"}),fe("span",tD,H.toDisplayString(y),1)]),_:2},1024)),[[g,e.getTagToolTip(y)]])]),_:2},1040))),128)),h.tags.length>2?(J(),Ce(d,{key:0,size:"small",class:"resource-table-tag-more",onClick:e.openTagsSidebar},{default:Te(()=>[Vt(" + "+H.toDisplayString(h.tags.length-2),1)]),_:2},1032,["onClick"])):Oe("",!0)]),manager:Te(({item:h})=>[Ge(e.$slots,"manager",{resource:h})]),members:Te(({item:h})=>[Ge(e.$slots,"members",{resource:h})]),totalQuota:Te(({item:h})=>[Ge(e.$slots,"totalQuota",{resource:h})]),usedQuota:Te(({item:h})=>[Ge(e.$slots,"usedQuota",{resource:h})]),remainingQuota:Te(({item:h})=>[Ge(e.$slots,"remainingQuota",{resource:h})]),mdate:Te(({item:h})=>[ot(fe("span",{tabindex:"0",textContent:H.toDisplayString(e.formatDateRelative(h.mdate))},null,8,nD),[[g,e.formatDate(h.mdate)]])]),indicators:Te(({item:h})=>[h.indicators.length?(J(),Ce(m,{key:0,resource:h,indicators:h.indicators,"disable-handler":e.isResourceDisabled(h)},null,8,["resource","indicators","disable-handler"])):Oe("",!0)]),status:Te(({item:h})=>[ot(be(u,{name:h.disabled?"stop-circle":"play-circle",size:"small","fill-type":"line"},null,8,["name"]),[[g,h.disabled?e.$gettext("Disabled"):e.$gettext("Enabled")]])]),sdate:Te(({item:h})=>[ot(fe("span",{tabindex:"0",textContent:H.toDisplayString(e.formatDateRelative(h.sdate))},null,8,rD),[[g,e.formatDate(h.sdate)]])]),ddate:Te(({item:h})=>[ot(fe("p",{tabindex:"0",class:"oc-m-rm",textContent:H.toDisplayString(e.formatDateRelative(h.ddate))},null,8,iD),[[g,e.formatDate(h.ddate)]])]),sharedBy:Te(({item:h})=>[be(l,{appearance:"raw-inverse",class:"resource-table-shared-by","no-hover":"",onClick:y=>e.openSharingSidebar(h)},{default:Te(()=>[be(w,{class:"resource-table-people",items:e.getSharedByAvatarItems(h),"is-tooltip-displayed":!0,"accessible-description":e.getSharedByAvatarDescription(h)},null,8,["items","accessible-description"])]),_:2},1032,["onClick"])]),sharedWith:Te(({item:h})=>[be(l,{appearance:"raw-inverse",class:"resource-table-shared-with","no-hover":"",onClick:y=>e.openSharingSidebar(h)},{default:Te(()=>[be(w,{class:"resource-table-people",items:e.getSharedWithAvatarItems(h),stacked:!0,"max-displayed":3,"is-tooltip-displayed":!0,"accessible-description":e.getSharedWithAvatarDescription(h)},null,8,["items","accessible-description"])]),_:2},1032,["onClick"])]),actions:Te(({item:h})=>[e.isResourceDisabled(h)?Oe("",!0):(J(),ve("div",oD,[Ge(e.$slots,"quickActions",{resource:h}),be(v,{ref:"contextMenuButton",item:h,"resource-dom-selector":e.resourceDomSelector,class:"resource-table-btn-action-dropdown",onQuickActionClicked:y=>e.showContextMenuOnBtnClick(y,h)},{contextMenu:Te(()=>[Ge(e.$slots,"contextMenu",{resource:h})]),_:2},1032,["item","resource-dom-selector","onQuickActionClicked"])]))]),_:2},[!e.isLocationPicker&&!e.isFilePicker?{name:"selectHeader",fn:Te(()=>[fe("div",eD,[ot(be(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:Rn(e.toggleSelectionAll,["stop"])},null,8,["label","disabled","model-value","onClick"]),[[g,{content:e.selectAllCheckboxLabel,placement:"bottom"}]])])]),key:"0"}:void 0,!e.isLocationPicker&&!e.isFilePicker?{name:"select",fn:Te(({item:h})=>[e.isResourceInDeleteQueue(h.id)?(J(),Ce(a,{key:0,class:"resource-table-activity-indicator",size:"medium","aria-label":e.$gettext("File is being processed")},null,8,["aria-label"])):(J(),Ce(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:Rn(y=>e.toggleSelection(h.id),["stop"])},null,8,["id","label","disabled","model-value","outline","onClick"]))]),key:"1"}:void 0,e.$slots.footer?{name:"footer",fn:Te(()=>[Ge(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?(J(),Ce(Md,{key:0,to:"body"},[be(b,{ref:"ghostElement","preview-items":[e.dragItem,...e.dragSelection]},null,8,["preview-items"])])):Oe("",!0)],64)}const aD=Ve(Z$,[["render",sD]]),lD=["data-item-id"],cD={key:0,class:"oc-tile-card-lazy-shimmer"},uD={class:"oc-tile-card-selection"},fD={key:0,class:"oc-tile-card-loading-spinner oc-m-s"},dD=["textContent"],pD=["aria-label"],hD={class:"oc-card-body oc-p-s"},gD={class:"oc-flex oc-flex-between oc-flex-middle"},mD={class:"oc-flex oc-flex-middle oc-text-truncate resource-name-wrapper"},yD={class:"oc-flex oc-flex-middle"},bD={key:0,class:"oc-text-left oc-my-rm oc-text-truncate"},vD=["textContent"],b0=Me({__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}=Ne.useGettext(),o=Td((f,d)=>{let m;return{get(){return f(),m},set(w){m=w,d()}}}),i=U(()=>e.resource.locked||e.resource.processing),s=U(()=>e.resource.locked?{name:"lock",fillType:"fill"}:e.resource.processing?{name:"loop-right",fillType:"line"}:{}),a=U(()=>e.resource.locked?r("This item is locked"):null),c=U(()=>ee.isSpaceResource(e.resource)?e.resource.description:""),{isVisible:u}=e.lazy?p0({target:o,onVisibleCallback:()=>n("itemVisible")}):{isVisible:oe(!0)},l=U(()=>!p(u));return e.lazy||n("itemVisible"),(f,d)=>{const m=pe("oc-spinner"),w=pe("oc-tag"),v=pe("oc-image"),T=pe("oc-icon"),b=dn("oc-tooltip");return J(),ve("div",{ref_key:"observerTarget",ref:o,class:H.normalizeClass(["oc-tile-card oc-card oc-card-default",{"oc-tile-card-selected":f.isResourceSelected,"oc-tile-card-disabled":f.isResourceDisabled&&!p(ee.isProjectSpaceResource)(f.resource),"state-trashed":f.isResourceDisabled&&p(ee.isProjectSpaceResource)(f.resource)}]),"data-item-id":f.resource.id,onContextmenu:d[2]||(d[2]=g=>f.$emit("contextmenu",g))},[l.value?(J(),ve("div",cD)):(J(),ve(Qe,{key:1},[be(Ff,{class:"oc-card-media-top oc-flex oc-flex-center oc-flex-middle oc-m-rm",resource:f.resource,link:f.resourceRoute,"is-resource-clickable":f.isResourceClickable,tabindex:"-1",onClick:d[0]||(d[0]=g=>f.$emit("click"))},{default:Te(()=>[fe("div",uD,[f.isLoading?(J(),ve("div",fD,[be(m,{"aria-label":p(r)("File is being processed")},null,8,["aria-label"])])):Ge(f.$slots,"selection",{key:1,item:f.resource})]),f.isResourceDisabled&&p(ee.isProjectSpaceResource)(f.resource)?(J(),Ce(w,{key:0,class:"resource-disabled-indicator oc-position-absolute",type:"span"},{default:Te(()=>[fe("span",{textContent:H.toDisplayString(p(r)("Disabled"))},null,8,dD)]),_:1})):Oe("",!0),ot((J(),ve("div",{class:"oc-tile-card-preview oc-flex oc-flex-middle oc-flex-center","aria-label":a.value},[Ge(f.$slots,"imageField",{item:f.resource},()=>[f.resource.thumbnail?(J(),Ce(v,{key:0,class:"tile-preview",src:f.resource.thumbnail},null,8,["src"])):(J(),Ce(Co,{key:1,resource:f.resource,size:f.resourceIconSize,class:"tile-default-image oc-pt-xs"},Wd({_:2},[i.value?{name:"status",fn:Te(()=>[be(T,Zt(s.value,{size:"xsmall"}),null,16)]),key:"0"}:void 0]),1032,["resource","size"]))])],8,pD)),[[b,a.value]])]),_:3},8,["resource","link","is-resource-clickable"]),fe("div",hD,[fe("div",gD,[fe("div",mD,[be(Po,{resource:f.resource,"is-icon-displayed":!1,"is-extension-displayed":f.isExtensionDisplayed,"is-resource-clickable":f.isResourceClickable,link:f.resourceRoute,onClick:d[1]||(d[1]=g=>f.$emit("click"))},null,8,["resource","is-extension-displayed","is-resource-clickable","link"])]),fe("div",yD,[Ge(f.$slots,"indicators",{item:f.resource,class:"resource-indicators"}),Ge(f.$slots,"actions",{item:f.resource}),Ge(f.$slots,"contextMenu",{item:f.resource})])]),c.value?(J(),ve("p",bD,[fe("small",{textContent:H.toDisplayString(c.value)},null,8,vD)])):Oe("",!0)])],64))],42,lD)}}}),wD={id:"tiles-view",class:"oc-px-m oc-pt-l"},SD={class:"oc-flex oc-flex-middle oc-mb-s oc-pb-s oc-tiles-controls"},ED={key:0,class:"oc-tiles-sort"},TD={key:0,class:"oc-flex"},AD={class:"oc-tiles-footer"},RD=Me({__name:"ResourceTiles",props:{resources:{default:()=>[]},selectedIds:{default:()=>[]},targetRouteCallback:{type:Function},space:{},sortFields:{default:()=>[]},sortBy:{},sortDir:{},viewSize:{default:()=>Gt.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}=Ne.useGettext(),o=ze(),i=Ke(),{getDefaultAction:s}=Vn(),{getMatchingSpace:a}=ln(),{canBeOpenedWithSecureView:c}=Df(),{isEnabled:u,fileTypes:l,isLocationPicker:f,isFilePicker:d,postMessage:m}=ni(),w=Lf(),v=U(()=>Math.min(p(w),e.viewSize)),T=U(()=>i.areFileExtensionsShown),b=U(()=>p(Be)?r("Clear selection"):r("Select all")),g=oe(),h=oe(),y=oe({tiles:{},dropBtns:{}}),S=aa({space:oe(e.space),targetRouteCallback:U(()=>e.targetRouteCallback)},{emit:n}),E=ae=>{if(ee.isSpaceResource(ae))return ae.disabled?null:xn("files-spaces-generic",Jn(ae,{path:"",fileId:ae.fileId}));if(ae.isFolder)return S.createFolderLink({path:ae.path,fileId:ae.fileId,resource:ae});let $e=e.space;$e||($e=a(ae));const De=s({resources:[ae],space:$e});return De!=null&&De.route?De.route({space:$e,resources:[ae]}):null},R=ae=>{if(p(u)&&p(d))return m("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(ae)),locationQuery:JSON.parse(JSON.stringify(Ks(p(o.currentRoute))))});ae.type!=="space"&&ae.type!=="folder"&&S.createFileAction(ae)},I=(ae,$e,De)=>{const{dropdown:Je,event:ut}=ae;(Je==null?void 0:Je.tippy)!==void 0&&(i.setSelection([$e.id]),wo(Je.tippy,ut,p(y).dropBtns[De]))},A=ae=>e.selectedIds.includes(ae.id),$=U(()=>e.resources.filter(ae=>e.selectedIds.includes(ae.id))),D=ae=>k(ae)||N(ae)?!1:ae.isFolder?!0:!(!ae.canDownload()&&!c(ae)||p(u)&&!p(d)),k=ae=>{var $e;return p(u)&&(($e=p(l))!=null&&$e.length)?!p(l).includes(ae.extension)&&!p(l).includes(ae.mimeType)&&!ae.isFolder:he(ae.id)?!0:ae.processing===!0},N=ae=>k(ae)?!0:ee.isSpaceResource(ae)&&ae.disabled,j=U(()=>{var ae,$e;return(($e=(ae=e.resources)==null?void 0:ae.filter(De=>k(De)===!0))==null?void 0:$e.map(De=>De.id))||[]}),W=ae=>{n("update:selectedIds",ae)},X=()=>{if(p(Be))return n("update:selectedIds",[]);n("update:selectedIds",e.resources.filter(ae=>!p(j).includes(ae.id)).map(ae=>ae.id))},ie=(ae,$e,De)=>{var ut;ae.preventDefault();const Je=(ut=p(y).tiles[$e.id])==null?void 0:ut.$el.getElementsByClassName("resource-tiles-btn-action-dropdown")[0];Je!==void 0&&(A($e)||W([$e.id]),wo(Je._tippy,ae,De))},de=ae=>{const $e=ae[0],De=ae[1];if(De&&De.metaKey)return Xe.publish("app.files.list.clicked.meta",$e);if(De&&De.shiftKey)return Xe.publish("app.files.list.clicked.shift",{resource:$e,skipTargetSelection:!1});se($e)},se=ae=>{const $e=A(ae)?e.selectedIds.filter(De=>De!==ae.id):[...e.selectedIds,ae.id];n("update:selectedIds",$e)},we=ae=>{switch(ae.type){case"folder":return r("Select folder");case"space":return r("Select space");default:return r("Select file")}},Se=U(()=>e.sortFields.find(ae=>ae.name===e.sortBy&&ae.sortDir===e.sortDir)||e.sortFields[0]),Z=ae=>{n("sort",{sortBy:ae.name,sortDir:ae.sortDir})},ne=U(()=>{const ae={1:"xlarge",2:"xlarge",3:"xxlarge",4:"xxlarge",5:"xxxlarge",6:"xxxlarge"},$e=p(v);return ae[$e]??"xxlarge"});Gw(()=>{y.value={tiles:{},dropBtns:{}}});const le=(ae,$e,De)=>{var ct,Qt;if((((ct=De.dataTransfer)==null?void 0:ct.types)||[]).some(Xt=>Xt==="Files")||(Qt=De.currentTarget)!=null&&Qt.contains(De.relatedTarget)||e.selectedIds.includes(ae.id)||ae.type!=="folder")return;const ut=p(y).tiles[ae.id];if($e){ut.$el.classList.remove("oc-tiles-item-drop-highlight");return}ut.$el.classList.add("oc-tiles-item-drop-highlight")},Ie=U(()=>e.selectedIds.filter(ae=>ae!==p(g).id)),Y=async(ae,$e)=>{g.value=ae,await Gn(),p(h).$el.ariaHidden="true",p(h).$el.style.left="-99999px",p(h).$el.style.top="-99999px",$e.dataTransfer.setDragImage(p(h).$el,0,0),$e.dataTransfer.dropEffect="move",$e.dataTransfer.effectAllowed="move"},_=async(ae,$e)=>{A(ae)||se(ae),await Y(ae,$e)},F=(ae,$e)=>{($e.dataTransfer.types||[]).some(Je=>Je==="Files")||(g.value=null,le(ae,!0,$e),n("fileDropped",ae.id))},K=ae=>ae.indicators.filter($e=>$e.category==="system"),z=oe(0),B=()=>{const ae=document.getElementById("tiles-view"),$e=getComputedStyle(ae),De=parseInt($e.getPropertyValue("padding-left"),10)|0,Je=parseInt($e.getPropertyValue("padding-right"),10)|0;z.value=ae.clientWidth-De-Je},V=U(()=>parseFloat(getComputedStyle(document.documentElement).fontSize)),{calculateTileSizePixels:ce}=Bv(),Re=U(()=>{const ae=[...Array(Gt.tilesSizeMax).keys()].map($e=>$e+1);return[...new Set(ae.map($e=>{const De=ce($e);return De?Math.round(p(z)/(De+p(V))):0}))]}),Le=U(()=>{const ae=p(Re);return ae.length<p(v)?ae[ae.length-1]:ae[p(v)-1]}),ke=U(()=>{const ae=p(Le)?e.resources.length%p(Le):0;return ae?p(Le)-ae:0}),Pe=U(()=>p(z)/p(Le)-p(V)),Be=U(()=>{const ae=p(j).length===e.resources.length,$e=p($).length===e.resources.length-p(j).length;return!ae&&$e}),he=ae=>i.deleteQueue.includes(ae);return Tt(Pe,ae=>{document.documentElement.style.setProperty("--oc-size-tiles-actual",`${ae}px`)},{immediate:!0}),Tt(Re,ae=>{w.value=Math.max(ae.length,1)}),Mt(()=>{window.addEventListener("resize",B),B()}),jn(()=>{window.removeEventListener("resize",B)}),(ae,$e)=>{const De=pe("oc-checkbox"),Je=pe("oc-icon"),ut=pe("oc-button"),ct=pe("oc-filter-chip"),Qt=pe("oc-status-indicators"),Xt=pe("oc-list"),Pt=dn("oc-tooltip");return J(),ve("div",wD,[fe("div",SD,[ot(be(De,{id:"tiles-view-select-all",class:"oc-ml-s",size:"large",label:b.value,"label-hidden":!0,disabled:ae.resources.length===j.value.length,"model-value":Be.value,onClick:Rn(X,["stop"])},null,8,["label","disabled","model-value"]),[[Pt,b.value]]),ae.sortFields.length?(J(),ve("div",ED,[be(ct,{class:"oc-tiles-sort-filter-chip","filter-label":Se.value.label,"selected-item-names":[],"close-on-click":"",raw:""},{default:Te(()=>[(J(!0),ve(Qe,null,kt(ae.sortFields,(Ue,M)=>(J(),Ce(ut,{key:M,appearance:"raw",size:"medium","justify-content":"space-between",class:H.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":Se.value===Ue,"oc-mt-xs":M>0}]),onClick:C=>Z(Ue)},{default:Te(()=>[fe("span",null,H.toDisplayString(Ue.label),1),Ue===Se.value?(J(),ve("div",TD,[be(Je,{name:"check"})])):Oe("",!0)]),_:2},1032,["class","onClick"]))),128))]),_:1},8,["filter-label"])])):Oe("",!0)]),be(Xt,{class:"oc-tiles"},{default:Te(()=>[(J(!0),ve(Qe,null,kt(ae.resources,Ue=>(J(),ve("li",{key:Ue.id,class:"oc-tiles-item has-item-context-menu"},[be(b0,{ref_for:!0,ref:M=>y.value.tiles[Ue.id]=M,resource:Ue,"resource-route":E(Ue),"is-resource-selected":A(Ue),"is-resource-clickable":D(Ue),"is-resource-disabled":k(Ue)||N(Ue),"is-extension-displayed":T.value,"resource-icon-size":ne.value,draggable:ae.dragDrop,lazy:ae.lazy,"is-loading":he(Ue.id),onVnodeMounted:M=>ae.$emit("rowMounted",Ue,y.value.tiles[Ue.id],p(zn).Tile),onContextmenu:M=>ie(M,Ue,y.value.tiles[Ue.id]),onClick:M=>R(Ue),onDragstart:M=>_(Ue,M),onDragenter:Rn(M=>le(Ue,!1,M),["prevent"]),onDragleave:Rn(M=>le(Ue,!0,M),["prevent"]),onDrop:M=>F(Ue,M),onDragover:$e[0]||($e[0]=M=>M.preventDefault()),onItemVisible:M=>ae.$emit("itemVisible",Ue)},{selection:Te(()=>[!p(f)&&!p(d)?(J(),Ce(De,{key:0,label:we(Ue),"label-hidden":!0,size:"large",class:"oc-flex-inline oc-p-s",disabled:k(Ue),"model-value":A(Ue),onClick:Rn(M=>de([Ue,M]),["stop","prevent"])},null,8,["label","disabled","model-value","onClick"])):Oe("",!0)]),imageField:Te(()=>[Ge(ae.$slots,"image",{resource:Ue})]),indicators:Te(()=>[K(Ue).length?(J(),Ce(Qt,{key:0,resource:Ue,indicators:K(Ue),"disable-handler":k(Ue)},null,8,["resource","indicators","disable-handler"])):Oe("",!0)]),actions:Te(()=>[Ge(ae.$slots,"actions",{resource:Ue})]),contextMenu:Te(()=>[p(ee.isSpaceResource)(Ue)||!k(Ue)?(J(),Ce(p(qf),{key:0,ref_for:!0,ref:M=>y.value.dropBtns[Ue.id]=M,item:Ue,class:"resource-tiles-btn-action-dropdown",onQuickActionClicked:M=>I(M,Ue,Ue.id)},{contextMenu:Te(()=>[Ge(ae.$slots,"contextMenu",{resource:Ue})]),_:2},1032,["item","onQuickActionClicked"])):Oe("",!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)),(J(!0),ve(Qe,null,kt(ke.value,Ue=>(J(),ve("li",{key:`ghost-tile-${Ue}`,class:"ghost-tile","aria-hidden":!0}))),128))]),_:3}),g.value?(J(),Ce(Md,{key:0,to:"body"},[be(Vf,{ref_key:"ghostElementRef",ref:h,"preview-items":[g.value,...Ie.value]},null,8,["preview-items"])])):Oe("",!0),fe("div",AD,[Ge(ae.$slots,"footer")])])}}}),_D=Me({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=ze(),{current:o}=Ne.useGettext(),i=en(),s=oe(),a=oe(e.items),c=oe(),u=oe(),l=oe(!1),f=oe(),d=`q_${e.filterName}`,m=on(d),w=k=>k[e.idAttribute],v=()=>r.push({query:{...ki(p(i).query,[d]),...p(s)&&{[d]:w(p(s))}}}),T=k=>p(s)&&w(p(s))===w(k),b=()=>{c.value=void 0,u.value=void 0},g=async k=>{b(),T(k)?s.value=void 0:(s.value=k,p(f).hideDrop()),await v(),t("selectionChange",p(s))},h=()=>{s.value=void 0,l.value=!1,b(),t("selectionChange",p(s)),v()},y=()=>{a.value=e.items},S=()=>{l.value=!1},E=()=>{const k=St(p(m));if(!k)return;const N=e.items.find(j=>w(j)===k);if(N){s.value=N;return}if(p(R)){const j=k.replace("range:",""),W=Number(j.split(" - ")[0]),X=Number(j.split(" - ")[1]);c.value=Dt.DateTime.fromMillis(W),u.value=Dt.DateTime.fromMillis(X),s.value=p(A)}},R=U(()=>{var k;return(k=St(p(m)))==null?void 0:k.startsWith("range:")}),I=U(()=>!p(c)||!p(u)?!1:p(c)<=p(u)),A=U(()=>{if(!p(c)||!p(u))return null;const k=ti(p(c),o,Dt.DateTime.DATE_SHORT),N=ti(p(u),o,Dt.DateTime.DATE_SHORT),j=p(c).toMillis(),W=p(u).toMillis();return{[e.idAttribute]:`range:${j} - ${W}`,[e.displayNameAttribute]:`${k} - ${N}`}}),$=async()=>{s.value=p(A),await v(),p(f).hideDrop(),t("selectionChange",p(s))},D=({date:k,error:N},j)=>{if(N){console.error(N);return}const W=j==="from"?c:u;if(!k){W.value=void 0;return}const X=j==="from"?k.startOf("day"):k.endOf("day");W.value=X};return n({setSelectedItemsBasedOnQuery:E}),Mt(()=>{E()}),{clearFilter:h,displayedItems:a,isItemSelected:T,selectedItem:s,onShowDrop:y,onHideDrop:S,filterChip:f,toggleItemSelection:g,setSelectedItemsBasedOnQuery:E,fromDate:c,toDate:u,dateRangeValid:I,applyDateRangeFilter:$,dateRangeApplied:R,setDateRangeDate:D,dateRangeClicked:l,queryParam:d}}}),ID={class:"oc-flex oc-flex-middle oc-text-truncate"},CD={class:"oc-text-truncate oc-ml-s"},PD={class:"oc-flex"},FD={class:"oc-my-xs"},OD={class:"oc-flex oc-flex-middle oc-text-truncate"},xD={class:"oc-text-truncate oc-ml-s"},kD=["textContent"],ND={class:"oc-flex"},$D={class:"oc-flex oc-flex-middle oc-flex-between oc-mb-m"},DD=["textContent"],LD={class:"oc-mt-s"},MD={class:"date-filter-apply-btn"};function BD(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 J(),ve("div",{class:H.normalizeClass(["date-filter oc-flex",`date-filter-${e.filterName}`])},[be(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:Te(()=>[be(c,{class:H.normalizeClass(["date-filter-list",{"date-filter-list-hidden":e.dateRangeClicked}])},{default:Te(()=>[(J(!0),ve(Qe,null,kt(e.displayedItems,(f,d)=>(J(),ve("li",{key:d,class:"oc-my-xs"},[be(a,{class:H.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(f)}]),"justify-content":"space-between",appearance:"raw","data-testid":f[e.displayNameAttribute],onClick:m=>e.toggleItemSelection(f)},{default:Te(()=>[fe("div",ID,[fe("div",CD,[Ge(e.$slots,"item",{item:f})])]),fe("div",PD,[e.isItemSelected(f)?(J(),Ce(s,{key:0,name:"check"})):Oe("",!0)])]),_:2},1032,["class","data-testid","onClick"])]))),128)),fe("li",FD,[be(a,{class:H.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]=f=>e.dateRangeClicked=!0)},{default:Te(()=>[fe("div",OD,[fe("div",xD,[fe("span",{textContent:H.toDisplayString(e.$gettext("Custom date range"))},null,8,kD)])]),fe("div",ND,[e.dateRangeApplied?(J(),Ce(s,{key:0,name:"check"})):Oe("",!0)])]),_:1},8,["class"])])]),_:3},8,["class"]),fe("div",{class:H.normalizeClass(["date-filter-range-panel oc-py-s",{"date-filter-range-panel-active":e.dateRangeClicked}])},[fe("div",$D,[be(a,{appearance:"raw",class:"date-filter-range-panel-back","aria-label":e.$gettext("Go back to filter options"),onClick:t[1]||(t[1]=f=>e.dateRangeClicked=!1)},{default:Te(()=>[be(s,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"]),fe("span",{textContent:H.toDisplayString(e.$gettext("Custom date range"))},null,8,DD),be(a,{appearance:"raw",class:"date-filter-range-panel-close","aria-label":e.$gettext("Close filter"),onClick:t[2]||(t[2]=f=>e.filterChip.hideDrop())},{default:Te(()=>[be(s,{name:"close"})]),_:1},8,["aria-label"])]),fe("div",LD,[be(u,{label:e.$gettext("From"),type:"date","is-clearable":!0,"current-date":e.fromDate,onDateChanged:t[3]||(t[3]=f=>e.setDateRangeDate(f,"from"))},null,8,["label","current-date"]),be(u,{label:e.$gettext("To"),type:"date","is-clearable":!0,"current-date":e.toDate,"min-date":e.fromDate?e.fromDate:void 0,onDateChanged:t[4]||(t[4]=f=>e.setDateRangeDate(f,"to"))},null,8,["label","current-date","min-date"])]),fe("div",MD,[be(a,{size:"small",disabled:!e.dateRangeValid,onClick:e.applyDateRangeFilter},{default:Te(()=>[Vt(H.toDisplayString(e.$gettext("Apply")),1)]),_:1},8,["disabled","onClick"])])],2)]),_:3},8,["filter-label","selected-item-names","onClearFilter","onShowDrop","onHideDrop"])],2)}const jD=Ve(_D,[["render",BD]]),UD=Me({name:"ItemFilterInline",props:{filterName:{type:String,required:!0},filterOptions:{type:Array,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=ze(),r=en(),o=oe(e.filterOptions[0].name),i=`q_${e.filterName}`,s=on(i),a=u=>n.push({query:{...ki(p(r).query,[i]),[i]:u}}),c=async u=>{o.value=u.name,await a(u.name),t("toggleFilter",u)};return Mt(()=>{const u=St(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}}}),qD=["textContent"];function VD(e,t,n,r,o,i){const s=pe("oc-button");return J(),ve("div",null,[fe("div",{class:H.normalizeClass(["item-inline-filter oc-flex-inline",`item-inline-filter-${e.filterName}`])},[(J(!0),ve(Qe,null,kt(e.filterOptions,(a,c)=>(J(),Ce(s,{id:a.name,key:c,class:H.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:Te(()=>[fe("span",{class:"oc-text-truncate item-inline-filter-option-label",textContent:H.toDisplayString(a.label)},null,8,qD)]),_:2},1032,["id","class","onClick"]))),128))],2)])}const zD=Ve(UD,[["render",VD]]),WD={class:"space-quota"},HD=["textContent"],v0=Me({__name:"SpaceQuota",props:{spaceQuota:{}},setup(e){const{$gettext:t,current:n}=Ne.useGettext(),r=U(()=>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=U(()=>En(e.spaceQuota.total,n)),i=U(()=>En(e.spaceQuota.used,n)),s=U(()=>parseFloat((e.spaceQuota.used/e.spaceQuota.total*100).toFixed(2))),a=U(()=>{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 J(),ve("div",WD,[fe("p",{class:"oc-mb-s oc-mt-rm",textContent:H.toDisplayString(r.value)},null,8,HD),be(l,{value:s.value,max:100,size:"small",color:a.value,"background-color":"var(--oc-role-surface)"},null,8,["value","color"])])}}}),GD=Me({name:"WebDavDetails",props:{space:{type:Object,required:!0}},setup(e){const t=dr("resource"),n="check",r="file-copy",o=oe(r),i=oe(r),s=U(()=>uf(p(t).webDavPath)),a=U(()=>{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}}}),KD={class:"oc-flex"},QD=["textContent"],XD={class:"oc-flex"},YD=["textContent"];function JD(e,t,n,r,o,i){const s=pe("oc-icon"),a=pe("oc-button"),c=dn("oc-tooltip");return J(),ve(Qe,null,[fe("dt",null,H.toDisplayString(e.$gettext("WebDAV path")),1),fe("dd",KD,[ot(fe("div",{class:"oc-text-truncate",textContent:H.toDisplayString(e.webDavPath)},null,8,QD),[[c,e.webDavPath]]),ot((J(),Ce(a,{class:"oc-ml-s",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV path to clipboard"),"no-hover":"",onClick:e.copyWebDAVPathToClipboard},{default:Te(()=>[be(s,{name:e.copyWebDAVPathIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[c,e.$gettext("Copy WebDAV path")]])]),fe("dt",null,H.toDisplayString(e.$gettext("WebDAV URL")),1),fe("dd",XD,[ot(fe("div",{class:"oc-text-truncate",textContent:H.toDisplayString(e.webDavUrl)},null,8,YD),[[c,e.webDavUrl]]),ot((J(),Ce(a,{class:"oc-ml-s",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV URL to clipboard"),"no-hover":"",onClick:e.copyWebDAVUrlToClipboard},{default:Te(()=>[be(s,{name:e.copyWebDAVUrlIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[c,e.$gettext("Copy WebDAV URL")]])])],64)}const w0=Ve(GD,[["render",JD]]),ZD={id:"oc-space-details-sidebar"},eL={class:"oc-space-details-sidebar-image oc-text-center"},tL={key:1,class:"oc-position-relative"},nL=["src"],rL={key:0,class:"oc-flex oc-flex-middle oc-space-details-sidebar-members oc-mb-s oc-text-small"},iL=["textContent"],oL=["textContent"],sL=["aria-label"],aL=Ve(Me({__name:"SpaceDetails",props:{showShareIndicators:{type:Boolean,default:!0}},setup(e){const t=vt(),n=Ke(),{resourceContentsText:r}=jv({showSizeInformation:!1}),o=ze(),{$gettext:i,$ngettext:s,current:a}=Ne.useGettext(),{loadPreview:c}=Mf(),u=lt(),{imagesLoading:l}=He.storeToRefs(u),f=jt(),d=dr("resource"),m=oe(""),{user:w}=He.storeToRefs(t),v=U(()=>f.linkShares.length),T=U(()=>n.areWebDavDetailsShown),b=U(()=>!at(o,"files-spaces-projects")),g=U(()=>`${En(p(d).size,a)}, ${p(r)}`);Tt(()=>p(d).spaceImageData,async()=>{if(!p(d).spaceImageData){m.value="";return}const X=ee.buildSpaceImageResource(p(d));m.value=await c({space:p(d),resource:X,dimensions:zn.Tile,processor:Bs.enum.fit,cancelRunning:!0,updateStore:!1})},{immediate:!0});const h=U(()=>ee.getSpaceManagers(p(d)).map(ie=>{var se;const de=ie.grantedTo.user||ie.grantedTo.group;return de.id===((se=p(w))==null?void 0:se.id)?i("%{displayName} (me)",{displayName:de.displayName}):de.displayName}).join(", ")),y=U(()=>hb(p(d).mdate,a)),S=U(()=>p($)||p(D)),E=U(()=>{if(p($)&&!p(D))return p(N);if(!p($)&&p(D))return p(j);switch(p(k)){case 1:return s("This space has one member and %{linkShareCount} link.","This space has one member and %{linkShareCount} links.",p(v),{linkShareCount:p(v).toString()});default:return p(v)===1?i("This space has %{memberShareCount} members and one link.",{memberShareCount:p(k).toString()}):i("This space has %{memberShareCount} members and %{linkShareCount} links.",{memberShareCount:p(k).toString(),linkShareCount:p(v).toString()})}}),R=U(()=>i("Open share panel")),I=U(()=>i("Open link list in share panel")),A=U(()=>i("Open member list in share panel")),$=U(()=>p(k)>0),D=U(()=>p(v)>0),k=U(()=>Object.keys(p(d).members).length),N=U(()=>s("This space has %{memberShareCount} member.","This space has %{memberShareCount} members.",p(k),{memberShareCount:p(k).toString()})),j=U(()=>s("%{linkShareCount} link giving access.","%{linkShareCount} links giving access.",p(v),{linkShareCount:p(v).toString()})),W=()=>{Xe.publish(yt.setActivePanel,"space-share")};return(X,ie)=>{const de=pe("oc-spinner"),se=pe("oc-icon"),we=pe("oc-button"),Se=pe("portal-target");return J(),ve("div",ZD,[fe("div",eL,[p(l).includes(p(d).id)?(J(),Ce(de,{key:0,"aria-label":p(i)("Space image is loading")},null,8,["aria-label"])):m.value?(J(),ve("div",tL,[fe("img",{src:m.value,alt:""},null,8,nL)])):(J(),Ce(se,{key:2,name:"layout-grid",size:"xxlarge",class:"space-default-image oc-px-m oc-py-m"}))]),X.showShareIndicators&&S.value&&!p(d).disabled?(J(),ve("div",rL,[$.value?(J(),Ce(we,{key:0,appearance:"raw","aria-label":A.value,"no-hover":"",onClick:W},{default:Te(()=>[be(se,{name:"group",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):Oe("",!0),D.value?(J(),Ce(we,{key:1,appearance:"raw","aria-label":I.value,"no-hover":"",onClick:W},{default:Te(()=>[be(se,{name:"link",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):Oe("",!0),fe("p",{textContent:H.toDisplayString(E.value)},null,8,iL),be(we,{appearance:"raw","aria-label":R.value,size:"small","no-hover":"",onClick:W},{default:Te(()=>[fe("span",{class:"oc-text-small",textContent:H.toDisplayString(p(i)("Show"))},null,8,oL)]),_:1},8,["aria-label"])])):Oe("",!0),fe("dl",{class:"details-list oc-m-rm","aria-label":p(i)("Overview of the information about the selected space")},[fe("dt",null,H.toDisplayString(p(i)("Last activity")),1),fe("dd",null,H.toDisplayString(y.value),1),p(d).description?(J(),ve(Qe,{key:0},[fe("dt",null,H.toDisplayString(p(i)("Subtitle")),1),fe("dd",null,H.toDisplayString(p(d).description),1)],64)):Oe("",!0),fe("dt",null,H.toDisplayString(p(i)("Manager")),1),fe("dd",null,H.toDisplayString(h.value),1),p(d).disabled?Oe("",!0):(J(),ve(Qe,{key:1},[fe("dt",null,H.toDisplayString(p(i)("Quota")),1),fe("dd",null,[be(v0,{"space-quota":p(d).spaceQuota},null,8,["space-quota"])])],64)),b.value?(J(),ve(Qe,{key:2},[fe("dt",null,H.toDisplayString(p(i)("Size")),1),fe("dd",null,H.toDisplayString(g.value),1)],64)):Oe("",!0),T.value?(J(),Ce(w0,{key:3,space:p(d)},null,8,["space"])):Oe("",!0),be(Se,{name:"app.files.sidebar.space.details.table","slot-props":{space:p(d),resource:p(d)},multiple:!0},null,8,["slot-props"])],8,sL)])}}}),[["__scopeId","data-v-6de460b8"]]),lL={id:"oc-spaces-details-multiple-sidebar"},cL={class:"spaces-preview oc-mb-l"},uL={class:"spaces-preview-body"},fL=["textContent"],dL=Ve(Me({__name:"SpaceDetailsMultiple",props:{selectedSpaces:{}},setup(e){const t=Ne.useGettext(),{$gettext:n,$ngettext:r}=t,o=U(()=>{let d=0;return e.selectedSpaces.forEach(m=>{d+=m.spaceQuota.total}),En(d,t.current)}),i=U(()=>{let d=0;return e.selectedSpaces.forEach(m=>{m.disabled||(d+=m.spaceQuota.remaining)}),En(d,t.current)}),s=U(()=>{let d=0;return e.selectedSpaces.forEach(m=>{m.disabled||(d+=m.spaceQuota.used)}),En(d,t.current)}),a=U(()=>e.selectedSpaces.filter(d=>!d.disabled).length),c=U(()=>e.selectedSpaces.filter(d=>d.disabled).length),u=U(()=>n("Overview of the information about the selected spaces")),l=U(()=>r("%{ itemCount } space selected","%{ itemCount } spaces selected",e.selectedSpaces.length,{itemCount:e.selectedSpaces.length.toString()})),f=U(()=>[{term:n("Total quota:"),definition:p(o)},{term:n("Remaining quota:"),definition:p(i)},{term:n("Used quota:"),definition:p(s)},{term:n("Enabled:"),definition:p(a)},{term:n("Disabled:"),definition:p(c)}]);return(d,m)=>{const w=pe("oc-icon"),v=pe("oc-definition-list");return J(),ve("div",lL,[fe("div",cL,[fe("div",uL,[be(w,{class:"preview-icon",size:"xxlarge",name:"layout-grid"}),fe("p",{class:"preview-text",textContent:H.toDisplayString(l.value)},null,8,fL)])]),be(v,{"aria-label":u.value,items:f.value},null,8,["aria-label","items"])])}}}),[["__scopeId","data-v-14c2080b"]]),pL=Me({name:"SpaceNoSelection"}),hL={class:"oc-mt-xl"},gL={class:"oc-flex space-info oc-text-center"};function mL(e,t,n,r,o,i){const s=pe("oc-icon"),a=dn("translate");return J(),ve("div",hL,[fe("div",gL,[be(s,{name:"layout-grid",size:"xxlarge"}),ot((J(),ve("p",null,t[0]||(t[0]=[Vt("Select a space to view details")]))),[[a]])])])}const yL=Ve(pL,[["render",mL]]),bL=Me({name:"CompareSaveDialog",props:{originalObject:{type:Object,required:!0},compareObject:{type:Object,required:!0},confirmButtonDisabled:{type:Boolean,default:()=>!1}},emits:["confirm","revert"],setup(){const e=oe(!1);let t;return Mt(()=>{t=Xe.subscribe("sidebar.entity.saved",()=>{e.value=!0})}),jn(()=>{Xe.unsubscribe("sidebar.entity.saved",t)}),{saved:e}},computed:{unsavedChanges(){return!eb(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}}}),vL={class:"compare-save-dialog oc-width-1-1 oc-flex oc-flex-between oc-flex-middle"},wL={key:0,class:"state-indicator oc-flex oc-flex-middle"},SL=["textContent"],EL={key:1,class:"state-indicator"},TL=["textContent"],AL=["textContent"];function RL(e,t,n,r,o,i){const s=pe("oc-icon"),a=pe("oc-button");return J(),ve("div",vL,[e.saved?(J(),ve("span",wL,[be(s,{name:"checkbox-circle"}),fe("span",{class:"oc-ml-s",textContent:H.toDisplayString(e.$gettext("Changes saved"))},null,8,SL)])):(J(),ve("span",EL,H.toDisplayString(e.unsavedChangesText),1)),fe("div",null,[be(a,{disabled:!e.unsavedChanges,class:"compare-save-dialog-revert-btn",onClick:t[0]||(t[0]=c=>e.$emit("revert"))},{default:Te(()=>[fe("span",{textContent:H.toDisplayString(e.$gettext("Revert"))},null,8,TL)]),_:1},8,["disabled"]),be(a,{appearance:"filled",class:"compare-save-dialog-confirm-btn",disabled:!e.unsavedChanges||e.confirmButtonDisabled,onClick:t[1]||(t[1]=c=>e.$emit("confirm"))},{default:Te(()=>[fe("span",{textContent:H.toDisplayString(e.$gettext("Save"))},null,8,AL)]),_:1},8,["disabled"])])])}const _L=Ve(bL,[["render",RL],["__scopeId","data-v-471483fe"]]),IL=zw(async()=>(await Promise.resolve().then(()=>E2)).default),CL=Me({name:"CustomComponentTarget",props:{extensionPoint:{type:Object,required:!0}},setup(e){const t=Ni(),n=Tb(),r=U(()=>t.requestExtensions(e.extensionPoint)),o=n.extractDefaultExtensionIds(e.extensionPoint,p(r));return{extensions:U(()=>{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 PL(e,t,n,r,o,i){return J(!0),ve(Qe,null,kt(e.extensions,s=>(J(),Ce(Wr(s.content),{key:`custom-component-${s.id}`}))),128)}const FL=Ve(CL,[["render",PL]]),OL=Me({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=ze(),o=en(),i=oe(),s=oe([]),a=oe(e.items),c=oe(null),u=oe(null),l=`q_${e.filterName}`,f=on(l),d=E=>E[e.idAttribute],m=()=>r.push({query:{...ki(p(o).query,[l]),...!!p(s).length&&{[l]:p(s).reduce((E,R)=>(E+=`${d(R)}+`,E),"").slice(0,-1)}}}),w=E=>!!p(s).find(R=>d(R)===d(E)),v=async E=>{w(E)?s.value=p(s).filter(R=>d(R)!==d(E)):(e.allowMultiple||(s.value=[]),s.value.push(E)),await m(),t("selectionChange",p(s))},T=oe(),b=(E,R)=>{if(!(R||"").trim())return E;const A=new Yf(E,{...nl,keys:e.filterableAttributes}).search(R).map($=>$.item);return E.filter($=>A.includes($))},g=()=>{s.value=[],t("selectionChange",p(s)),m()},h=E=>{a.value=E},y=async()=>{var E;h(e.items),await Gn(),(E=p(i))==null||E.focus()};Tt(T,()=>{h(b(e.items,p(T))),p(u)&&(c.value=new Zf(p(u)),p(c).unmark(),p(c).mark(p(T),{element:"span",className:"mark-highlight"}))});const S=()=>{const E=St(p(f));if(E){const R=E.split("+");s.value=e.items.filter(I=>R.includes(d(I)))}};return n({setSelectedItemsBasedOnQuery:S}),Mt(()=>{S()}),{clearFilter:g,displayedItems:a,filterInputRef:i,filterTerm:T,isItemSelected:w,itemFilterListRef:u,queryParam:l,selectedItems:s,setDisplayedItems:h,showDrop:y,toggleItemSelection:v,setSelectedItemsBasedOnQuery:S}}}),xL={ref:"itemFilterListRef"},kL={class:"oc-flex oc-flex-middle oc-text-truncate"},NL={class:"oc-text-truncate oc-ml-s"},$L={class:"oc-flex"};function DL(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"),f=pe("oc-filter-chip");return J(),ve("div",{class:H.normalizeClass(["item-filter oc-flex",`item-filter-${e.filterName}`])},[be(f,{"filter-label":e.filterLabel,"selected-item-names":e.selectedItems.map(d=>d[e.displayNameAttribute]),"close-on-click":e.closeOnClick,onClearFilter:e.clearFilter,onShowDrop:e.showDrop},{default:Te(()=>[e.showOptionFilter&&e.filterableAttributes.length?(J(),Ce(s,{key:0,ref:"filterInputRef",modelValue:e.filterTerm,"onUpdate:modelValue":t[0]||(t[0]=d=>e.filterTerm=d),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"])):Oe("",!0),fe("div",xL,[be(l,{class:"item-filter-list"},{default:Te(()=>[(J(!0),ve(Qe,null,kt(e.displayedItems,(d,m)=>(J(),ve("li",{key:m,class:"oc-my-xs"},[be(u,{class:H.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(d),"oc-flex-left":e.allowMultiple,"oc-flex-between":!e.allowMultiple}]),"justify-content":"space-between",appearance:"raw","data-test-value":d[e.displayNameAttribute],onClick:w=>e.toggleItemSelection(d)},{default:Te(()=>[fe("div",kL,[e.allowMultiple?(J(),Ce(a,{key:0,size:"large",class:"item-filter-checkbox oc-mr-s",label:e.$gettext("Toggle selection"),"model-value":e.isItemSelected(d),"label-hidden":!0,"onUpdate:modelValue":w=>e.toggleItemSelection(d),onClick:t[1]||(t[1]=Rn(()=>{},["stop"]))},null,8,["label","model-value","onUpdate:modelValue"])):Oe("",!0),fe("div",null,[Ge(e.$slots,"image",{item:d})]),fe("div",NL,[Ge(e.$slots,"item",{item:d})])]),fe("div",$L,[!e.allowMultiple&&e.isItemSelected(d)?(J(),Ce(c,{key:0,name:"check"})):Oe("",!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 LL=Ve(OL,[["render",DL]]),ML=Me({name:"ItemFilterToggle",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=ze(),r=en(),o=oe(!1),i=`q_${e.filterName}`,s=on(i),a=()=>n.push({query:{...ki(p(r).query,[i]),...p(o)&&{[i]:"true"}}}),c=async()=>{o.value=!p(o),await a(),t("toggleFilter",p(o))};return Mt(()=>{St(p(s))==="true"&&(o.value=!0)}),{queryParam:i,filterActive:o,toggleFilter:c}}});function BL(e,t,n,r,o,i){const s=pe("oc-filter-chip");return J(),ve("div",{class:H.normalizeClass(["item-filter oc-flex",`item-filter-${e.filterName}`])},[be(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 jL=Ve(ML,[["render",BL]]),UL=Me({name:"LoadingIndicator",setup(){const e=cn();let t,n,r;const o=oe(e.isLoading),i=oe(e.currentProgress),s=()=>{i.value=e.currentProgress,o.value=e.isLoading},a=()=>{i.value=e.currentProgress};return Mt(()=>{t=Xe.subscribe(Fr.add,s),n=Xe.subscribe(Fr.remove,s),r=Xe.subscribe(Fr.setProgress,a)}),jn(()=>{Xe.unsubscribe(Fr.add,t),Xe.unsubscribe(Fr.remove,n),Xe.unsubscribe(Fr.setProgress,r)}),{isLoading:o,currentProgress:i}}}),qL={key:0,id:"oc-loading-indicator",class:"oc-width-1-1"};function VL(e,t,n,r,o,i){const s=pe("oc-progress");return e.isLoading?(J(),ve("div",qL,[be(s,{max:100,indeterminate:e.currentProgress===null,value:e.currentProgress,size:"small"},null,8,["indeterminate","value"])])):Oe("",!0)}const zL=Ve(UL,[["render",VL]]),WL=Me({name:"NoContentMessage",props:{icon:{type:String,required:!0},iconFillType:{type:String,default:"fill"}}}),HL={class:"no-content-message oc-flex oc-flex-column oc-flex-center oc-flex-middle oc-text-center"},GL={class:"oc-text-muted oc-text-xlarge"},KL={class:"oc-text-muted"};function QL(e,t,n,r,o,i){const s=pe("oc-icon");return J(),ve("div",HL,[be(s,{name:e.icon,type:"div",size:"xxlarge","fill-type":e.iconFillType,class:"oc-mb-m"},null,8,["name","fill-type"]),fe("div",GL,[Ge(e.$slots,"message")]),fe("div",KL,[Ge(e.$slots,"callToAction")])])}const XL=Ve(WL,[["render",QL]]),YL=Me({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 JL(e,t,n,r,o,i){const s=pe("oc-pagination");return e.pages>1?(J(),Ce(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"])):Oe("",!0)}const ZL=Ve(YL,[["render",JL]]),e2=Me({name:"SearchBarFilter",props:{currentFolderAvailable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=Ne.useGettext(),r=on("useScope"),o=oe(),i=oe(),s=U(()=>{var u;return n((u=o.value)==null?void 0:u.title)}),a=U(()=>[{id:Er.currentFolder,title:n("Current folder"),enabled:e.currentFolderAvailable},{id:Er.allFiles,title:n("All files"),enabled:!0}]);return Tt(()=>e.currentFolderAvailable,()=>{if(p(r)){if(p(r).toString()==="true"){o.value=p(a).find(({id:l})=>l===Er.currentFolder);return}o.value=p(a).find(({id:l})=>l===Er.allFiles);return}if(!e.currentFolderAvailable){o.value=p(a).find(({id:u})=>u===Er.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===Er.allFiles)},{immediate:!0}),{currentSelection:o,currentSelectionTitle:s,onOptionSelected:u=>{i.value=u,o.value=u,t("update:modelValue",{value:u})},locationOptions:a}}}),t2={key:0},n2={key:0,class:"oc-flex"};function r2(e,t,n,r,o,i){const s=pe("oc-icon"),a=pe("oc-button"),c=pe("oc-filter-chip");return J(),ve("div",{class:"oc-location-search oc-position-small oc-position-center-right oc-mt-rm",onClick:t[0]||(t[0]=Rn(()=>{},["stop"]))},[e.currentSelection?(J(),ve("div",t2,[be(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:Te(()=>[(J(!0),ve(Qe,null,kt(e.locationOptions,(u,l)=>(J(),Ce(a,{key:l,appearance:"raw",size:"medium","justify-content":"space-between",class:H.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:f=>e.onOptionSelected(u)},{default:Te(()=>[fe("span",null,H.toDisplayString(u.title),1),u.id===e.currentSelection.id?(J(),ve("div",n2,[be(s,{name:"check"})])):Oe("",!0)]),_:2},1032,["class","disabled","data-test-id","onClick"]))),128))]),_:1},8,["filter-label"])])):Oe("",!0)])}const i2=Ve(e2,[["render",r2]]),o2=Me({name:"PortalTarget",components:{PortalTargetVue:ga.PortalTarget},props:{...ga.PortalTarget.props},setup(e){const t=U(()=>e);return Mt(()=>{Xe.publish(la.mounted,e)}),{properties:t}}});function s2(e,t,n,r,o,i){const s=pe("portal-target-vue");return J(),Ce(s,H.normalizeProps(Ha(e.properties)),null,16)}const a2=Ve(o2,[["render",s2]]),l2=({sortBy:e,sortDir:t})=>({groupingSettings:U(()=>({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}}}))}),c2={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é"}},u2={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"}},f2={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"}},d2={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"}},p2={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"}},h2={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:"Автопрокрутка"}},g2={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:"同期スクロール"}},m2={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"}},y2={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"},b2={"fr-FR":c2,"de-DE":u2,"it-IT":f2,"es-ES":d2,"pl-PL":p2,ru:h2,"jp-JP":g2,"id-ID":m2},v2=Me({name:"TextEditor",components:{MdEditor:$o.MdEditor,MdPreview:$o.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=Ne.useGettext(),{currentTheme:r}=ii(),o=U(()=>{const{showPreviewOnlyMd:c=!0}=e.applicationConfig;return{showPreviewOnlyMd:c}}),i=U(()=>{var c;return e.markdownMode||["md","markdown"].includes((c=e.resource)==null?void 0:c.extension)||!p(o).showPreviewOnlyMd}),s=U(()=>p(r).isDark?"dark":"light");return $o.config({editorConfig:{languageUserDefined:b2},editorExtensions:{screenfull:{instance:N0},cropper:{instance:$0}},markdownItPlugins(c){return[...c,{type:"xss",plugin:$o.XSSPlugin,options:{}}]}}),{isMarkdown:i,theme:s,language:n,languages:y2,onUploadImg:async c=>{const l=(await Promise.all([...c].map(d=>new Promise((m,w)=>{const v=new FileReader;v.onload=()=>m(v.result),v.onerror=w,v.readAsDataURL(d)})))).map(d=>`![image](${d})`),f=`${p(e.currentContent)}
63
+ */function P2(e){return e}const E$={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}},E$);var T$=Object.defineProperty,f0=Object.getOwnPropertySymbols,A$=Object.prototype.hasOwnProperty,R$=Object.prototype.propertyIsEnumerable,d0=(e,t,n)=>t in e?T$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_$=(e,t)=>{for(var n in t||(t={}))A$.call(t,n)&&d0(e,n,t[n]);if(f0)for(var n of f0(t))R$.call(t,n)&&d0(e,n,t[n]);return e};const p0=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},I$={},C$={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},F$=pe("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),P$=[F$];function O$(e,t){return J(),Se("svg",C$,P$)}const x$=p0(I$,[["render",O$]]),k$={},N$={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"},$$=pe("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),D$=[$$];function L$(e,t){return J(),Se("svg",N$,D$)}_$({},{Deselect:x$,OpenIndicator:p0(k$,[["render",L$]])});const M$=["aria-label"],B$=Me({__name:"OcSpinner",props:{ariaLabel:{default:""},size:{default:"medium"}},setup(e){const t=j(()=>["oc-spinner",`oc-spinner-${ri(e.size||"medium")}`]);return(n,r)=>(J(),Se("span",{class:W.normalizeClass(t.value),"aria-label":n.ariaLabel,tabindex:"-1",role:"img"},null,10,M$))}}),j$={class:"oc-thead"},U$=Me({name:"OcTableHead",__name:"OcTableHead",setup(e){return(t,n)=>(J(),Se("thead",j$,[Ge(t.$slots,"default")]))}}),q$=Me({name:"OcTableBody",__name:"OcTableBody",setup(e){return(t,n)=>(J(),Se("tbody",null,[Ge(t.$slots,"default")]))}}),h0=({target:e,mode:t="show",rootMargin:n="100px",onVisibleCallback:r})=>{if(!(window&&"IntersectionObserver"in window))return{isVisible:ae(!0)};const i=ae(!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 Tt(e,()=>{s.observe(e.value)}),jn(()=>s.disconnect()),{isVisible:i}},g0=Me({__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=j(()=>{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)=>(J(),Ce(Wr(o.type),{class:W.normalizeClass(r.value),onClick:i[0]||(i[0]=s=>n("click",s))},{default:Te(()=>[Ge(o.$slots,"default")]),_:3},8,["class"]))}}),m0=Me({__name:"OcTableTd",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},setup(e){return(t,n)=>(J(),Ce(g0,{type:"td","align-h":t.alignH,"align-v":t.alignV,width:t.width,wrap:t.wrap,class:"oc-td"},{default:Te(()=>[Ge(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),y0=Me({__name:"OcTableTr",props:{lazy:{}},emits:["contextmenu","click","dragstart","drop","dragenter","dragleave","dragover","mouseleave","itemVisible"],setup(e,{emit:t}){const n=t,r=Td((a,c)=>{let u;return{get(){return a(),u},set(l){u=l,c()}}}),o=j(()=>e.lazy?e.lazy.colspan:1),{isVisible:i}=e.lazy?h0({...e.lazy,target:r,onVisibleCallback:()=>n("itemVisible")}):{isVisible:ae(!0)},s=j(()=>!p(i));return e.lazy||n("itemVisible"),(a,c)=>(J(),Se("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?(J(),Ce(m0,{key:0,colspan:o.value},{default:Te(()=>c[8]||(c[8]=[pe("span",{class:"shimmer"},null,-1)])),_:1},8,["colspan"])):Ge(a.$slots,"default",{key:1})],544))}}),V$=Me({__name:"OcTableTh",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e){return(t,n)=>(J(),Ce(g0,{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:Te(()=>[Ge(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),z$={key:0,class:"oc-table-thead-content"},W$=["textContent"],H$={key:1},G$={key:0,class:"oc-table-thead-content"},K$=["textContent"],Q$={key:1,class:"oc-table-footer"},X$={class:"oc-table-footer-row"},Y$=["colspan"],b0="asc",Gf="desc",J$=Me({__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:IF,EVENT_TROW_CLICKED:CF,EVENT_TROW_MOUNTED:FF,EVENT_TROW_CONTEXTMENU:PF},{$gettext:o}=Ne.useGettext(),i=D=>e.itemDomSelector?e.itemDomSelector(D):D[e.idKey],s=j(()=>{const D=["oc-table"];return e.hover&&D.push("oc-table-hover"),e.sticky&&D.push("oc-table-sticky"),D}),a=j(()=>e.fields.length),c=D=>{D.preventDefault()},u=(D,k)=>{n(OF,D,k)},l=(D,k)=>{n(Rb,D,k)},f=(D,k,N)=>{n("dropRowStyling",D,k,N)},d=D=>D.type==="slot",m=D=>["callback","function"].indexOf(D.type)>=0,w=D=>Object.prototype.hasOwnProperty.call(D,"title")?D.title:D.name,b=()=>({class:s.value}),T=(D,k)=>{const N=h(D);return N.class=`oc-table-header-cell oc-table-header-cell-${D.name}`,Object.prototype.hasOwnProperty.call(D,"thClass")&&(N.class+=` ${D.thClass}`),e.sticky&&(N.style=`top: ${e.headerPosition}px;`),k===0&&(N.class+=` oc-pl-${ri(e.paddingX)} `),k===e.fields.length-1&&(N.class+=` oc-pr-${ri(e.paddingX)}`),I(N,D),N},v=(D,k)=>({...e.lazy&&{lazy:{colspan:a.value}},class:["oc-tbody-tr",`oc-tbody-tr-${i(D)||k}`,y(D)?"oc-table-highlighted":void 0,S(D)?"oc-table-disabled":void 0].filter(Boolean)}),g=(D,k,N)=>{const z=h(D);return z.class=`oc-table-data-cell oc-table-data-cell-${D.name}`,Object.prototype.hasOwnProperty.call(D,"tdClass")&&(z.class+=` ${D.tdClass}`),Object.prototype.hasOwnProperty.call(D,"wrap")&&(z.wrap=D.wrap),k===0&&(z.class+=` oc-pl-${ri(e.paddingX)} `),k===e.fields.length-1&&(z.class+=` oc-pr-${ri(e.paddingX)}`),Object.prototype.hasOwnProperty.call(D,"accessibleLabelCallback")&&(z["aria-label"]=D.accessibleLabelCallback(N)),z},h=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}),y=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,E=(D,k,N)=>{const z=[N[e.idKey],k+1].filter(Boolean);return d(D)?[...z,D.name].join("-"):m(D)?[...z,D.callback(N[D.name])].join("-"):[...z,N[D.name]].join("-")},R=D=>o("Sort by %{ name }",{name:D}),I=(D,k)=>{if(!A(k))return;let N="none";e.sortBy===k.name&&(N=e.sortDir===b0?"ascending":"descending"),D["aria-sort"]=N},A=({sortable:D})=>!!D,$=D=>{if(!A(D))return;let k=e.sortDir;e.sortBy===D.name&&e.sortDir!==void 0&&(k=e.sortDir===Gf?b0:Gf),(e.sortBy!==D.name||e.sortDir===void 0)&&(k=D.sortDir||Gf),n("sort",{sortBy:D.name,sortDir:k})};return(D,k)=>{const N=he("oc-icon");return J(),Se("table",Zt(b(),{class:"has-item-context-menu"}),[D.hasHeader?(J(),Ce(U$,{key:0},{default:Te(()=>[ve(y0,{class:"oc-table-header-row"},{default:Te(()=>[(J(!0),Se(Qe,null,kt(D.fields,(z,G)=>(J(),Ce(V$,Zt({key:`oc-thead-${z.name}`,ref_for:!0},T(z,G)),{default:Te(()=>[z.sortable?(J(),Ce(zN,{key:0,"aria-label":R(z.name),appearance:"raw",class:"oc-button-sort oc-width-1-1","gap-size":"small","no-hover":"",onClick:X=>$(z)},{default:Te(()=>[z.headerType==="slot"?(J(),Se("span",z$,[Ge(D.$slots,z.name+"Header")])):(J(),Se("span",{key:1,class:"oc-table-thead-content header-text",textContent:W.toDisplayString(w(z))},null,8,W$)),ve(N,{name:D.sortDir==="asc"?"arrow-down":"arrow-up","fill-type":"line",class:W.normalizeClass([{"oc-invisible-sr":D.sortBy!==z.name},"oc-p-xs oc-rounded"]),size:"small"},null,8,["name","class"])]),_:2},1032,["aria-label","onClick"])):(J(),Se("div",H$,[z.headerType==="slot"?(J(),Se("span",G$,[Ge(D.$slots,z.name+"Header")])):(J(),Se("span",{key:1,class:"oc-table-thead-content header-text",textContent:W.toDisplayString(w(z))},null,8,K$))]))]),_:2},1040))),128))]),_:3})]),_:3})):Oe("",!0),ve(q$,{class:"has-item-context-menu"},{default:Te(()=>[(J(!0),Se(Qe,null,kt(D.data,(z,G)=>(J(),Ce(y0,Zt({key:`oc-tbody-tr-${i(z)||G}`,ref_for:!0,ref:`row-${G}`},v(z,G),{"data-item-id":z[D.idKey],draggable:D.dragDrop,onClick:X=>D.$emit(r.EVENT_TROW_CLICKED,[z,X]),onContextmenu:X=>D.$emit(r.EVENT_TROW_CONTEXTMENU,D.$refs[`row-${G}`][0],X,z),onVnodeMounted:X=>D.$emit(r.EVENT_TROW_MOUNTED,z,D.$refs[`row-${G}`][0]),onDragstart:X=>u(z,X),onDrop:X=>l(i(z),X),onDragenter:Rn(X=>f(i(z),!1,X),["prevent"]),onDragleave:Rn(X=>f(i(z),!0,X),["prevent"]),onMouseleave:X=>f(i(z),!0,X),onDragover:k[0]||(k[0]=X=>c(X)),onItemVisible:X=>D.$emit("itemVisible",z)}),{default:Te(()=>[(J(!0),Se(Qe,null,kt(D.fields,(X,se)=>(J(),Ce(m0,Zt({key:"oc-tbody-td-"+E(X,se,z),ref_for:!0},g(X,se,z)),{default:Te(()=>[d(X)?Ge(D.$slots,X.name,{key:0,item:z}):m(X)?(J(),Se(Qe,{key:1},[Vt(W.toDisplayString(X.callback(z[X.name])),1)],64)):(J(),Se(Qe,{key:2},[Vt(W.toDisplayString(z[X.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?(J(),Se("tfoot",Q$,[pe("tr",X$,[pe("td",{colspan:a.value,class:"oc-table-footer-cell"},[Ge(D.$slots,"footer")],8,Y$)])])):Oe("",!0)],16)}}}),Z$=850,eD=Me({components:{ContextMenuQuickAction:qf,ResourceGhostElement:Vf,ResourceListItem:Fo,ResourceSize:Zv,OcTable:J$,OcSpinner:B$},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:()=>Gt.defaultModeName,validator:e=>[Gt.name.condensedTable,Gt.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||[Bt.Asc.toString(),Bt.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",Ff,"update:selectedIds","update:modelValue"],setup(e,t){const n=ze(),r=rn(),{getMatchingSpace:o}=ln(),{canBeOpenedWithSecureView:i}=Df(),s=si({space:ae(e.space),targetRouteCallback:j(()=>e.targetRouteCallback)}),{isSticky:a}=kf(),{isLocationPicker:c,isFilePicker:u,postMessage:l,isEnabled:f,fileTypes:d}=ni(),{getDefaultAction:m}=Vn(),w=st(),{options:b}=He.storeToRefs(w),T=To(),{resources:v,action:g}=He.storeToRefs(T),h=Xr(),{userContextReady:y}=He.storeToRefs(h),S=Ke(),{areFileExtensionsShown:E,latestSelectedId:R,deleteQueue:I}=He.storeToRefs(S),A=ae(),$=ae(),D=ae(),{width:k}=Mr.useWindowSize(),N=j(()=>r.filesTags&&k.value>=Z$),{actions:z}=ra(),{actions:G}=xv(),X=j(()=>p(z)[0].handler),se=j(()=>p(G)[0].handler),ne=Y=>Y.length>7?Y:"",oe=Y=>{var _;return p(f)&&((_=p(d))!=null&&_.length)?!p(d).includes(Y.extension)&&!p(d).includes(Y.mimeType)&&!Y.isFolder:Y.processing===!0||Ie(Y.id)},fe=j(()=>{var Y,_;return((_=(Y=e.resources)==null?void 0:Y.filter(P=>oe(P)===!0))==null?void 0:_.map(P=>P.id))||[]}),we=Y=>!e.areResourcesClickable||ee.isProjectSpaceResource(Y)&&Y.disabled||!Y.isFolder&&(!Y.canDownload()&&!i(Y)||p(f)&&!p(u))?!1:!p(fe).includes(Y.id),Z=Y=>{Xe.publish("app.files.list.clicked"),t.emit("update:selectedIds",Y)},re=Y=>{S.toggleSelection(Y),Z(S.selectedIds)},ce=Y=>{if(Y.isFolder)return s.getFolderLink(Y);let _=e.space;_||(_=o(Y));const P=m({resources:[Y],space:_});if(P!=null&&P.route)return P.route({space:_,resources:[Y]})},Ie=Y=>p(I).includes(Y);return{router:n,configOptions:b,dragItem:A,ghostElement:$,contextMenuButton:D,getTagToolTip:ne,renameActions:z,renameActionsSpace:G,renameHandler:X,renameHandlerSpace:se,FolderViewModeConstants:Gt,hasTags:N,disabledResources:fe,isResourceDisabled:oe,userContextReady:y,getMatchingSpace:o,clipboardResources:v,clipboardAction:g,...aa({space:ae(e.space),targetRouteCallback:j(()=>e.targetRouteCallback)},t),...s,postMessage:l,isFilePicker:u,isLocationPicker:c,isEmbedModeEnabled:f,emitSelect:Z,toggleSelection:re,areFileExtensionsShown:E,latestSelectedId:R,isResourceClickable:we,getResourceLink:ce,isSticky:a,isResourceInDeleteQueue:Ie}},data(){return{constants:{ImageDimension:zn,EVENT_TROW_MOUNTED:gv}}},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=mh(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;let o;return r.prop?o=_l(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!==ei.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 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 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(){Xe.publish(yt.open)},openSharingSidebar(e){let t;e.type==="space"?t="space-share":t="sharing",Xe.publish(yt.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(Ff,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]),wo(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]),wo(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(Ks(p(this.router.currentRoute))))});const n=e[1],r=e[2]??!1,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 Xe.publish("app.files.list.clicked.meta",t);if(n&&n.shiftKey)return Xe.publish("app.files.list.clicked.shift",{resource:t,skipTargetSelection:r});if(!o&&!this.isResourceSelected(t))return this.emitSelect([t.id])}},formatDate(e){return hb(new Date(e),this.$language.current)},formatDateRelative(e){return mb(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,shareType:ee.ShareTypes.user.value,username: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,shareType:t.shareType,username:t.id})):[]}}}),tD={class:"resource-table-select-all"},nD={class:"oc-text-truncate"},rD=["textContent"],iD=["textContent"],oD=["textContent"],sD={key:0,class:"resource-table-actions"};function aD(e,t,n,r,o,i){const s=he("oc-checkbox"),a=he("oc-spinner"),c=he("resource-list-item"),u=he("oc-icon"),l=he("oc-button"),f=he("resource-size"),d=he("oc-tag"),m=he("oc-status-indicators"),w=he("oc-avatars"),b=he("context-menu-quick-action"),T=he("oc-table"),v=he("resource-ghost-element"),g=dn("oc-tooltip");return J(),Se(Qe,null,[ve(T,Zt(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))}),Wd({name:Te(({item:h})=>[pe("div",{class:W.normalizeClass(["resource-table-resource-wrapper",[{"resource-table-resource-wrapper-limit-max-width":e.hasRenameAction(h)}]])},[Ge(e.$slots,"image",{resource:h}),(J(),Ce(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:y=>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)?(J(),Ce(l,{key:0,class:"resource-table-edit-name raw-hover-surface oc-p-xs",appearance:"raw",onClick:y=>e.openRenameDialog(h)},{default:Te(()=>[ve(u,{name:"edit-2","fill-type":"line",size:"small"})]),_:2},1032,["onClick"])):Oe("",!0)],2),Ge(e.$slots,"additionalResourceContent",{resource:h})]),syncEnabled:Te(({item:h})=>[Ge(e.$slots,"syncEnabled",{resource:h})]),size:Te(({item:h})=>[ve(f,{size:h.size||Number.NaN},null,8,["size"])]),tags:Te(({item:h})=>[(J(!0),Se(Qe,null,kt(h.tags.slice(0,2),y=>(J(),Ce(Wr(e.userContextReady?"router-link":"span"),Zt({key:y,ref_for:!0},e.getTagComponentAttrs(y),{class:"resource-table-tag-wrapper"}),{default:Te(()=>[ot((J(),Ce(d,{class:"resource-table-tag oc-ml-xs",rounded:!0,size:"small"},{default:Te(()=>[ve(u,{name:"price-tag-3",size:"small"}),pe("span",nD,W.toDisplayString(y),1)]),_:2},1024)),[[g,e.getTagToolTip(y)]])]),_:2},1040))),128)),h.tags.length>2?(J(),Ce(d,{key:0,size:"small",class:"resource-table-tag-more",onClick:e.openTagsSidebar},{default:Te(()=>[Vt(" + "+W.toDisplayString(h.tags.length-2),1)]),_:2},1032,["onClick"])):Oe("",!0)]),manager:Te(({item:h})=>[Ge(e.$slots,"manager",{resource:h})]),members:Te(({item:h})=>[Ge(e.$slots,"members",{resource:h})]),totalQuota:Te(({item:h})=>[Ge(e.$slots,"totalQuota",{resource:h})]),usedQuota:Te(({item:h})=>[Ge(e.$slots,"usedQuota",{resource:h})]),remainingQuota:Te(({item:h})=>[Ge(e.$slots,"remainingQuota",{resource:h})]),mdate:Te(({item:h})=>[ot(pe("span",{tabindex:"0",textContent:W.toDisplayString(e.formatDateRelative(h.mdate))},null,8,rD),[[g,e.formatDate(h.mdate)]])]),indicators:Te(({item:h})=>[h.indicators.length?(J(),Ce(m,{key:0,resource:h,indicators:h.indicators,"disable-handler":e.isResourceDisabled(h)},null,8,["resource","indicators","disable-handler"])):Oe("",!0)]),status:Te(({item:h})=>[ot(ve(u,{name:h.disabled?"stop-circle":"play-circle",size:"small","fill-type":"line"},null,8,["name"]),[[g,h.disabled?e.$gettext("Disabled"):e.$gettext("Enabled")]])]),sdate:Te(({item:h})=>[ot(pe("span",{tabindex:"0",textContent:W.toDisplayString(e.formatDateRelative(h.sdate))},null,8,iD),[[g,e.formatDate(h.sdate)]])]),ddate:Te(({item:h})=>[ot(pe("p",{tabindex:"0",class:"oc-m-rm",textContent:W.toDisplayString(e.formatDateRelative(h.ddate))},null,8,oD),[[g,e.formatDate(h.ddate)]])]),sharedBy:Te(({item:h})=>[ve(l,{appearance:"raw-inverse",class:"resource-table-shared-by","no-hover":"",onClick:y=>e.openSharingSidebar(h)},{default:Te(()=>[ve(w,{class:"resource-table-people",items:e.getSharedByAvatarItems(h),"is-tooltip-displayed":!0,"accessible-description":e.getSharedByAvatarDescription(h)},null,8,["items","accessible-description"])]),_:2},1032,["onClick"])]),sharedWith:Te(({item:h})=>[ve(l,{appearance:"raw-inverse",class:"resource-table-shared-with","no-hover":"",onClick:y=>e.openSharingSidebar(h)},{default:Te(()=>[ve(w,{class:"resource-table-people",items:e.getSharedWithAvatarItems(h),stacked:!0,"max-displayed":3,"is-tooltip-displayed":!0,"accessible-description":e.getSharedWithAvatarDescription(h)},null,8,["items","accessible-description"])]),_:2},1032,["onClick"])]),actions:Te(({item:h})=>[e.isResourceDisabled(h)?Oe("",!0):(J(),Se("div",sD,[Ge(e.$slots,"quickActions",{resource:h}),ve(b,{ref:"contextMenuButton",item:h,"resource-dom-selector":e.resourceDomSelector,class:"resource-table-btn-action-dropdown",onQuickActionClicked:y=>e.showContextMenuOnBtnClick(y,h)},{contextMenu:Te(()=>[Ge(e.$slots,"contextMenu",{resource:h})]),_:2},1032,["item","resource-dom-selector","onQuickActionClicked"])]))]),_:2},[!e.isLocationPicker&&!e.isFilePicker?{name:"selectHeader",fn:Te(()=>[pe("div",tD,[ot(ve(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:Rn(e.toggleSelectionAll,["stop"])},null,8,["label","disabled","model-value","onClick"]),[[g,{content:e.selectAllCheckboxLabel,placement:"bottom"}]])])]),key:"0"}:void 0,!e.isLocationPicker&&!e.isFilePicker?{name:"select",fn:Te(({item:h})=>[e.isResourceInDeleteQueue(h.id)?(J(),Ce(a,{key:0,class:"resource-table-activity-indicator",size:"medium","aria-label":e.$gettext("File is being processed")},null,8,["aria-label"])):(J(),Ce(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:Rn(y=>e.toggleSelection(h.id),["stop"])},null,8,["id","label","disabled","model-value","outline","onClick"]))]),key:"1"}:void 0,e.$slots.footer?{name:"footer",fn:Te(()=>[Ge(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?(J(),Ce(Md,{key:0,to:"body"},[ve(v,{ref:"ghostElement","preview-items":[e.dragItem,...e.dragSelection]},null,8,["preview-items"])])):Oe("",!0)],64)}const lD=Ve(eD,[["render",aD]]),cD=["data-item-id"],uD={key:0,class:"oc-tile-card-lazy-shimmer"},fD={class:"oc-tile-card-selection"},dD={key:0,class:"oc-tile-card-loading-spinner oc-m-s"},pD=["textContent"],hD=["aria-label"],gD={class:"oc-card-body oc-p-s"},mD={class:"oc-flex oc-flex-between oc-flex-middle"},yD={class:"oc-flex oc-flex-middle oc-text-truncate resource-name-wrapper"},bD={class:"oc-flex oc-flex-middle"},vD={key:0,class:"oc-text-left oc-my-rm oc-text-truncate"},wD=["textContent"],v0=Me({__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}=Ne.useGettext(),o=Td((f,d)=>{let m;return{get(){return f(),m},set(w){m=w,d()}}}),i=j(()=>e.resource.locked||e.resource.processing),s=j(()=>e.resource.locked?{name:"lock",fillType:"fill"}:e.resource.processing?{name:"loop-right",fillType:"line"}:{}),a=j(()=>e.resource.locked?r("This item is locked"):null),c=j(()=>ee.isSpaceResource(e.resource)?e.resource.description:""),{isVisible:u}=e.lazy?h0({target:o,onVisibleCallback:()=>n("itemVisible")}):{isVisible:ae(!0)},l=j(()=>!p(u));return e.lazy||n("itemVisible"),(f,d)=>{const m=he("oc-spinner"),w=he("oc-tag"),b=he("oc-image"),T=he("oc-icon"),v=dn("oc-tooltip");return J(),Se("div",{ref_key:"observerTarget",ref:o,class:W.normalizeClass(["oc-tile-card oc-card oc-card-default",{"oc-tile-card-selected":f.isResourceSelected,"oc-tile-card-disabled":f.isResourceDisabled&&!p(ee.isProjectSpaceResource)(f.resource),"state-trashed":f.isResourceDisabled&&p(ee.isProjectSpaceResource)(f.resource)}]),"data-item-id":f.resource.id,onContextmenu:d[2]||(d[2]=g=>f.$emit("contextmenu",g))},[l.value?(J(),Se("div",uD)):(J(),Se(Qe,{key:1},[ve(Pf,{class:"oc-card-media-top oc-flex oc-flex-center oc-flex-middle oc-m-rm",resource:f.resource,link:f.resourceRoute,"is-resource-clickable":f.isResourceClickable,tabindex:"-1",onClick:d[0]||(d[0]=g=>f.$emit("click"))},{default:Te(()=>[pe("div",fD,[f.isLoading?(J(),Se("div",dD,[ve(m,{"aria-label":p(r)("File is being processed")},null,8,["aria-label"])])):Ge(f.$slots,"selection",{key:1,item:f.resource})]),f.isResourceDisabled&&p(ee.isProjectSpaceResource)(f.resource)?(J(),Ce(w,{key:0,class:"resource-disabled-indicator oc-position-absolute",type:"span"},{default:Te(()=>[pe("span",{textContent:W.toDisplayString(p(r)("Disabled"))},null,8,pD)]),_:1})):Oe("",!0),ot((J(),Se("div",{class:"oc-tile-card-preview oc-flex oc-flex-middle oc-flex-center","aria-label":a.value},[Ge(f.$slots,"imageField",{item:f.resource},()=>[f.resource.thumbnail?(J(),Ce(b,{key:0,class:"tile-preview",src:f.resource.thumbnail},null,8,["src"])):(J(),Ce(Co,{key:1,resource:f.resource,size:f.resourceIconSize,class:"tile-default-image oc-pt-xs"},Wd({_:2},[i.value?{name:"status",fn:Te(()=>[ve(T,Zt(s.value,{size:"xsmall"}),null,16)]),key:"0"}:void 0]),1032,["resource","size"]))])],8,hD)),[[v,a.value]])]),_:3},8,["resource","link","is-resource-clickable"]),pe("div",gD,[pe("div",mD,[pe("div",yD,[ve(Fo,{resource:f.resource,"is-icon-displayed":!1,"is-extension-displayed":f.isExtensionDisplayed,"is-resource-clickable":f.isResourceClickable,link:f.resourceRoute,onClick:d[1]||(d[1]=g=>f.$emit("click"))},null,8,["resource","is-extension-displayed","is-resource-clickable","link"])]),pe("div",bD,[Ge(f.$slots,"indicators",{item:f.resource,class:"resource-indicators"}),Ge(f.$slots,"actions",{item:f.resource}),Ge(f.$slots,"contextMenu",{item:f.resource})])]),c.value?(J(),Se("p",vD,[pe("small",{textContent:W.toDisplayString(c.value)},null,8,wD)])):Oe("",!0)])],64))],42,cD)}}}),SD={id:"tiles-view",class:"oc-px-m oc-pt-l"},ED={class:"oc-flex oc-flex-middle oc-mb-s oc-pb-s oc-tiles-controls"},TD={key:0,class:"oc-tiles-sort"},AD={key:0,class:"oc-flex"},RD={class:"oc-tiles-footer"},_D=Me({__name:"ResourceTiles",props:{resources:{default:()=>[]},selectedIds:{default:()=>[]},targetRouteCallback:{type:Function},space:{},sortFields:{default:()=>[]},sortBy:{},sortDir:{},viewSize:{default:()=>Gt.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}=Ne.useGettext(),o=ze(),i=Ke(),{getDefaultAction:s}=Vn(),{getMatchingSpace:a}=ln(),{canBeOpenedWithSecureView:c}=Df(),{isEnabled:u,fileTypes:l,isLocationPicker:f,isFilePicker:d,postMessage:m}=ni(),w=Lf(),b=j(()=>Math.min(p(w),e.viewSize)),T=j(()=>i.areFileExtensionsShown),v=j(()=>p(Be)?r("Clear selection"):r("Select all")),g=ae(),h=ae(),y=ae({tiles:{},dropBtns:{}}),S=aa({space:ae(e.space),targetRouteCallback:j(()=>e.targetRouteCallback)},{emit:n}),E=le=>{if(ee.isSpaceResource(le))return le.disabled?null:xn("files-spaces-generic",Jn(le,{path:"",fileId:le.fileId}));if(le.isFolder)return S.createFolderLink({path:le.path,fileId:le.fileId,resource:le});let $e=e.space;$e||($e=a(le));const De=s({resources:[le],space:$e});return De!=null&&De.route?De.route({space:$e,resources:[le]}):null},R=le=>{if(p(u)&&p(d))return m("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(le)),locationQuery:JSON.parse(JSON.stringify(Ks(p(o.currentRoute))))});le.type!=="space"&&le.type!=="folder"&&S.createFileAction(le)},I=(le,$e,De)=>{const{dropdown:Je,event:ut}=le;(Je==null?void 0:Je.tippy)!==void 0&&(i.setSelection([$e.id]),wo(Je.tippy,ut,p(y).dropBtns[De]))},A=le=>e.selectedIds.includes(le.id),$=j(()=>e.resources.filter(le=>e.selectedIds.includes(le.id))),D=le=>k(le)||N(le)?!1:le.isFolder?!0:!(!le.canDownload()&&!c(le)||p(u)&&!p(d)),k=le=>{var $e;return p(u)&&(($e=p(l))!=null&&$e.length)?!p(l).includes(le.extension)&&!p(l).includes(le.mimeType)&&!le.isFolder:ge(le.id)?!0:le.processing===!0},N=le=>k(le)?!0:ee.isSpaceResource(le)&&le.disabled,z=j(()=>{var le,$e;return(($e=(le=e.resources)==null?void 0:le.filter(De=>k(De)===!0))==null?void 0:$e.map(De=>De.id))||[]}),G=le=>{n("update:selectedIds",le)},X=()=>{if(p(Be))return n("update:selectedIds",[]);n("update:selectedIds",e.resources.filter(le=>!p(z).includes(le.id)).map(le=>le.id))},se=(le,$e,De)=>{var ut;le.preventDefault();const Je=(ut=p(y).tiles[$e.id])==null?void 0:ut.$el.getElementsByClassName("resource-tiles-btn-action-dropdown")[0];Je!==void 0&&(A($e)||G([$e.id]),wo(Je._tippy,le,De))},ne=le=>{const $e=le[0],De=le[1];if(De&&De.metaKey)return Xe.publish("app.files.list.clicked.meta",$e);if(De&&De.shiftKey)return Xe.publish("app.files.list.clicked.shift",{resource:$e,skipTargetSelection:!1});oe($e)},oe=le=>{const $e=A(le)?e.selectedIds.filter(De=>De!==le.id):[...e.selectedIds,le.id];n("update:selectedIds",$e)},fe=le=>{switch(le.type){case"folder":return r("Select folder");case"space":return r("Select space");default:return r("Select file")}},we=j(()=>e.sortFields.find(le=>le.name===e.sortBy&&le.sortDir===e.sortDir)||e.sortFields[0]),Z=le=>{n("sort",{sortBy:le.name,sortDir:le.sortDir})},re=j(()=>{const le={1:"xlarge",2:"xlarge",3:"xxlarge",4:"xxlarge",5:"xxxlarge",6:"xxxlarge"},$e=p(b);return le[$e]??"xxlarge"});Kw(()=>{y.value={tiles:{},dropBtns:{}}});const ce=(le,$e,De)=>{var ct,Qt;if((((ct=De.dataTransfer)==null?void 0:ct.types)||[]).some(Xt=>Xt==="Files")||(Qt=De.currentTarget)!=null&&Qt.contains(De.relatedTarget)||e.selectedIds.includes(le.id)||le.type!=="folder")return;const ut=p(y).tiles[le.id];if($e){ut.$el.classList.remove("oc-tiles-item-drop-highlight");return}ut.$el.classList.add("oc-tiles-item-drop-highlight")},Ie=j(()=>e.selectedIds.filter(le=>le!==p(g).id)),Y=async(le,$e)=>{g.value=le,await Gn(),p(h).$el.ariaHidden="true",p(h).$el.style.left="-99999px",p(h).$el.style.top="-99999px",$e.dataTransfer.setDragImage(p(h).$el,0,0),$e.dataTransfer.dropEffect="move",$e.dataTransfer.effectAllowed="move"},_=async(le,$e)=>{A(le)||oe(le),await Y(le,$e)},P=(le,$e)=>{($e.dataTransfer.types||[]).some(Je=>Je==="Files")||(g.value=null,ce(le,!0,$e),n("fileDropped",le.id))},K=le=>le.indicators.filter($e=>$e.category==="system"),V=ae(0),B=()=>{const le=document.getElementById("tiles-view"),$e=getComputedStyle(le),De=parseInt($e.getPropertyValue("padding-left"),10)|0,Je=parseInt($e.getPropertyValue("padding-right"),10)|0;V.value=le.clientWidth-De-Je},q=j(()=>parseFloat(getComputedStyle(document.documentElement).fontSize)),{calculateTileSizePixels:ue}=jv(),Re=j(()=>{const le=[...Array(Gt.tilesSizeMax).keys()].map($e=>$e+1);return[...new Set(le.map($e=>{const De=ue($e);return De?Math.round(p(V)/(De+p(q))):0}))]}),Le=j(()=>{const le=p(Re);return le.length<p(b)?le[le.length-1]:le[p(b)-1]}),ke=j(()=>{const le=p(Le)?e.resources.length%p(Le):0;return le?p(Le)-le:0}),Fe=j(()=>p(V)/p(Le)-p(q)),Be=j(()=>{const le=p(z).length===e.resources.length,$e=p($).length===e.resources.length-p(z).length;return!le&&$e}),ge=le=>i.deleteQueue.includes(le);return Tt(Fe,le=>{document.documentElement.style.setProperty("--oc-size-tiles-actual",`${le}px`)},{immediate:!0}),Tt(Re,le=>{w.value=Math.max(le.length,1)}),Mt(()=>{window.addEventListener("resize",B),B()}),jn(()=>{window.removeEventListener("resize",B)}),(le,$e)=>{const De=he("oc-checkbox"),Je=he("oc-icon"),ut=he("oc-button"),ct=he("oc-filter-chip"),Qt=he("oc-status-indicators"),Xt=he("oc-list"),Ft=dn("oc-tooltip");return J(),Se("div",SD,[pe("div",ED,[ot(ve(De,{id:"tiles-view-select-all",class:"oc-ml-s",size:"large",label:v.value,"label-hidden":!0,disabled:le.resources.length===z.value.length,"model-value":Be.value,onClick:Rn(X,["stop"])},null,8,["label","disabled","model-value"]),[[Ft,v.value]]),le.sortFields.length?(J(),Se("div",TD,[ve(ct,{class:"oc-tiles-sort-filter-chip","filter-label":we.value.label,"selected-item-names":[],"close-on-click":"",raw:""},{default:Te(()=>[(J(!0),Se(Qe,null,kt(le.sortFields,(Ue,M)=>(J(),Ce(ut,{key:M,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":we.value===Ue,"oc-mt-xs":M>0}]),onClick:C=>Z(Ue)},{default:Te(()=>[pe("span",null,W.toDisplayString(Ue.label),1),Ue===we.value?(J(),Se("div",AD,[ve(Je,{name:"check"})])):Oe("",!0)]),_:2},1032,["class","onClick"]))),128))]),_:1},8,["filter-label"])])):Oe("",!0)]),ve(Xt,{class:"oc-tiles"},{default:Te(()=>[(J(!0),Se(Qe,null,kt(le.resources,Ue=>(J(),Se("li",{key:Ue.id,class:"oc-tiles-item has-item-context-menu"},[ve(v0,{ref_for:!0,ref:M=>y.value.tiles[Ue.id]=M,resource:Ue,"resource-route":E(Ue),"is-resource-selected":A(Ue),"is-resource-clickable":D(Ue),"is-resource-disabled":k(Ue)||N(Ue),"is-extension-displayed":T.value,"resource-icon-size":re.value,draggable:le.dragDrop,lazy:le.lazy,"is-loading":ge(Ue.id),onVnodeMounted:M=>le.$emit("rowMounted",Ue,y.value.tiles[Ue.id],p(zn).Tile),onContextmenu:M=>se(M,Ue,y.value.tiles[Ue.id]),onClick:M=>R(Ue),onDragstart:M=>_(Ue,M),onDragenter:Rn(M=>ce(Ue,!1,M),["prevent"]),onDragleave:Rn(M=>ce(Ue,!0,M),["prevent"]),onDrop:M=>P(Ue,M),onDragover:$e[0]||($e[0]=M=>M.preventDefault()),onItemVisible:M=>le.$emit("itemVisible",Ue)},{selection:Te(()=>[!p(f)&&!p(d)?(J(),Ce(De,{key:0,label:fe(Ue),"label-hidden":!0,size:"large",class:"oc-flex-inline oc-p-s",disabled:k(Ue),"model-value":A(Ue),onClick:Rn(M=>ne([Ue,M]),["stop","prevent"])},null,8,["label","disabled","model-value","onClick"])):Oe("",!0)]),imageField:Te(()=>[Ge(le.$slots,"image",{resource:Ue})]),indicators:Te(()=>[K(Ue).length?(J(),Ce(Qt,{key:0,resource:Ue,indicators:K(Ue),"disable-handler":k(Ue)},null,8,["resource","indicators","disable-handler"])):Oe("",!0)]),actions:Te(()=>[Ge(le.$slots,"actions",{resource:Ue})]),contextMenu:Te(()=>[p(ee.isSpaceResource)(Ue)||!k(Ue)?(J(),Ce(p(qf),{key:0,ref_for:!0,ref:M=>y.value.dropBtns[Ue.id]=M,item:Ue,class:"resource-tiles-btn-action-dropdown",onQuickActionClicked:M=>I(M,Ue,Ue.id)},{contextMenu:Te(()=>[Ge(le.$slots,"contextMenu",{resource:Ue})]),_:2},1032,["item","onQuickActionClicked"])):Oe("",!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)),(J(!0),Se(Qe,null,kt(ke.value,Ue=>(J(),Se("li",{key:`ghost-tile-${Ue}`,class:"ghost-tile","aria-hidden":!0}))),128))]),_:3}),g.value?(J(),Ce(Md,{key:0,to:"body"},[ve(Vf,{ref_key:"ghostElementRef",ref:h,"preview-items":[g.value,...Ie.value]},null,8,["preview-items"])])):Oe("",!0),pe("div",RD,[Ge(le.$slots,"footer")])])}}}),ID=Me({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=ze(),{current:o}=Ne.useGettext(),i=en(),s=ae(),a=ae(e.items),c=ae(),u=ae(),l=ae(!1),f=ae(),d=`q_${e.filterName}`,m=on(d),w=k=>k[e.idAttribute],b=()=>r.push({query:{...ki(p(i).query,[d]),...p(s)&&{[d]:w(p(s))}}}),T=k=>p(s)&&w(p(s))===w(k),v=()=>{c.value=void 0,u.value=void 0},g=async k=>{v(),T(k)?s.value=void 0:(s.value=k,p(f).hideDrop()),await b(),t("selectionChange",p(s))},h=()=>{s.value=void 0,l.value=!1,v(),t("selectionChange",p(s)),b()},y=()=>{a.value=e.items},S=()=>{l.value=!1},E=()=>{const k=St(p(m));if(!k)return;const N=e.items.find(z=>w(z)===k);if(N){s.value=N;return}if(p(R)){const z=k.replace("range:",""),G=Number(z.split(" - ")[0]),X=Number(z.split(" - ")[1]);c.value=Dt.DateTime.fromMillis(G),u.value=Dt.DateTime.fromMillis(X),s.value=p(A)}},R=j(()=>{var k;return(k=St(p(m)))==null?void 0:k.startsWith("range:")}),I=j(()=>!p(c)||!p(u)?!1:p(c)<=p(u)),A=j(()=>{if(!p(c)||!p(u))return null;const k=ti(p(c),o,Dt.DateTime.DATE_SHORT),N=ti(p(u),o,Dt.DateTime.DATE_SHORT),z=p(c).toMillis(),G=p(u).toMillis();return{[e.idAttribute]:`range:${z} - ${G}`,[e.displayNameAttribute]:`${k} - ${N}`}}),$=async()=>{s.value=p(A),await b(),p(f).hideDrop(),t("selectionChange",p(s))},D=({date:k,error:N},z)=>{if(N){console.error(N);return}const G=z==="from"?c:u;if(!k){G.value=void 0;return}const X=z==="from"?k.startOf("day"):k.endOf("day");G.value=X};return n({setSelectedItemsBasedOnQuery:E}),Mt(()=>{E()}),{clearFilter:h,displayedItems:a,isItemSelected:T,selectedItem:s,onShowDrop:y,onHideDrop:S,filterChip:f,toggleItemSelection:g,setSelectedItemsBasedOnQuery:E,fromDate:c,toDate:u,dateRangeValid:I,applyDateRangeFilter:$,dateRangeApplied:R,setDateRangeDate:D,dateRangeClicked:l,queryParam:d}}}),CD={class:"oc-flex oc-flex-middle oc-text-truncate"},FD={class:"oc-text-truncate oc-ml-s"},PD={class:"oc-flex"},OD={class:"oc-my-xs"},xD={class:"oc-flex oc-flex-middle oc-text-truncate"},kD={class:"oc-text-truncate oc-ml-s"},ND=["textContent"],$D={class:"oc-flex"},DD={class:"oc-flex oc-flex-middle oc-flex-between oc-mb-m"},LD=["textContent"],MD={class:"oc-mt-s"},BD={class:"date-filter-apply-btn"};function jD(e,t,n,r,o,i){const s=he("oc-icon"),a=he("oc-button"),c=he("oc-list"),u=he("oc-datepicker"),l=he("oc-filter-chip");return J(),Se("div",{class:W.normalizeClass(["date-filter oc-flex",`date-filter-${e.filterName}`])},[ve(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:Te(()=>[ve(c,{class:W.normalizeClass(["date-filter-list",{"date-filter-list-hidden":e.dateRangeClicked}])},{default:Te(()=>[(J(!0),Se(Qe,null,kt(e.displayedItems,(f,d)=>(J(),Se("li",{key:d,class:"oc-my-xs"},[ve(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(f)}]),"justify-content":"space-between",appearance:"raw","data-testid":f[e.displayNameAttribute],onClick:m=>e.toggleItemSelection(f)},{default:Te(()=>[pe("div",CD,[pe("div",FD,[Ge(e.$slots,"item",{item:f})])]),pe("div",PD,[e.isItemSelected(f)?(J(),Ce(s,{key:0,name:"check"})):Oe("",!0)])]),_:2},1032,["class","data-testid","onClick"])]))),128)),pe("li",OD,[ve(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]=f=>e.dateRangeClicked=!0)},{default:Te(()=>[pe("div",xD,[pe("div",kD,[pe("span",{textContent:W.toDisplayString(e.$gettext("Custom date range"))},null,8,ND)])]),pe("div",$D,[e.dateRangeApplied?(J(),Ce(s,{key:0,name:"check"})):Oe("",!0)])]),_:1},8,["class"])])]),_:3},8,["class"]),pe("div",{class:W.normalizeClass(["date-filter-range-panel oc-py-s",{"date-filter-range-panel-active":e.dateRangeClicked}])},[pe("div",DD,[ve(a,{appearance:"raw",class:"date-filter-range-panel-back","aria-label":e.$gettext("Go back to filter options"),onClick:t[1]||(t[1]=f=>e.dateRangeClicked=!1)},{default:Te(()=>[ve(s,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"]),pe("span",{textContent:W.toDisplayString(e.$gettext("Custom date range"))},null,8,LD),ve(a,{appearance:"raw",class:"date-filter-range-panel-close","aria-label":e.$gettext("Close filter"),onClick:t[2]||(t[2]=f=>e.filterChip.hideDrop())},{default:Te(()=>[ve(s,{name:"close"})]),_:1},8,["aria-label"])]),pe("div",MD,[ve(u,{label:e.$gettext("From"),type:"date","is-clearable":!0,"current-date":e.fromDate,onDateChanged:t[3]||(t[3]=f=>e.setDateRangeDate(f,"from"))},null,8,["label","current-date"]),ve(u,{label:e.$gettext("To"),type:"date","is-clearable":!0,"current-date":e.toDate,"min-date":e.fromDate?e.fromDate:void 0,onDateChanged:t[4]||(t[4]=f=>e.setDateRangeDate(f,"to"))},null,8,["label","current-date","min-date"])]),pe("div",BD,[ve(a,{size:"small",disabled:!e.dateRangeValid,onClick:e.applyDateRangeFilter},{default:Te(()=>[Vt(W.toDisplayString(e.$gettext("Apply")),1)]),_:1},8,["disabled","onClick"])])],2)]),_:3},8,["filter-label","selected-item-names","onClearFilter","onShowDrop","onHideDrop"])],2)}const UD=Ve(ID,[["render",jD]]),qD=Me({name:"ItemFilterInline",props:{filterName:{type:String,required:!0},filterOptions:{type:Array,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=ze(),r=en(),o=ae(e.filterOptions[0].name),i=`q_${e.filterName}`,s=on(i),a=u=>n.push({query:{...ki(p(r).query,[i]),[i]:u}}),c=async u=>{o.value=u.name,await a(u.name),t("toggleFilter",u)};return Mt(()=>{const u=St(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}}}),VD=["textContent"];function zD(e,t,n,r,o,i){const s=he("oc-button");return J(),Se("div",null,[pe("div",{class:W.normalizeClass(["item-inline-filter oc-flex-inline",`item-inline-filter-${e.filterName}`])},[(J(!0),Se(Qe,null,kt(e.filterOptions,(a,c)=>(J(),Ce(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:Te(()=>[pe("span",{class:"oc-text-truncate item-inline-filter-option-label",textContent:W.toDisplayString(a.label)},null,8,VD)]),_:2},1032,["id","class","onClick"]))),128))],2)])}const WD=Ve(qD,[["render",zD]]),HD={class:"space-quota"},GD=["textContent"],w0=Me({__name:"SpaceQuota",props:{spaceQuota:{}},setup(e){const{$gettext:t,current:n}=Ne.useGettext(),r=j(()=>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=j(()=>En(e.spaceQuota.total,n)),i=j(()=>En(e.spaceQuota.used,n)),s=j(()=>parseFloat((e.spaceQuota.used/e.spaceQuota.total*100).toFixed(2))),a=j(()=>{switch(e.spaceQuota.state){case"normal":return"var(--oc-role-secondary)";default:return"var(--oc-role-error)"}});return(c,u)=>{const l=he("oc-progress");return J(),Se("div",HD,[pe("p",{class:"oc-mb-s oc-mt-rm",textContent:W.toDisplayString(r.value)},null,8,GD),ve(l,{value:s.value,max:100,size:"small",color:a.value,"background-color":"var(--oc-role-surface)"},null,8,["value","color"])])}}}),KD=Me({name:"WebDavDetails",props:{space:{type:Object,required:!0}},setup(e){const t=dr("resource"),n="check",r="file-copy",o=ae(r),i=ae(r),s=j(()=>uf(p(t).webDavPath)),a=j(()=>{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}}}),QD={class:"oc-flex"},XD=["textContent"],YD={class:"oc-flex"},JD=["textContent"];function ZD(e,t,n,r,o,i){const s=he("oc-icon"),a=he("oc-button"),c=dn("oc-tooltip");return J(),Se(Qe,null,[pe("dt",null,W.toDisplayString(e.$gettext("WebDAV path")),1),pe("dd",QD,[ot(pe("div",{class:"oc-text-truncate",textContent:W.toDisplayString(e.webDavPath)},null,8,XD),[[c,e.webDavPath]]),ot((J(),Ce(a,{class:"oc-ml-s",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV path to clipboard"),"no-hover":"",onClick:e.copyWebDAVPathToClipboard},{default:Te(()=>[ve(s,{name:e.copyWebDAVPathIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[c,e.$gettext("Copy WebDAV path")]])]),pe("dt",null,W.toDisplayString(e.$gettext("WebDAV URL")),1),pe("dd",YD,[ot(pe("div",{class:"oc-text-truncate",textContent:W.toDisplayString(e.webDavUrl)},null,8,JD),[[c,e.webDavUrl]]),ot((J(),Ce(a,{class:"oc-ml-s",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV URL to clipboard"),"no-hover":"",onClick:e.copyWebDAVUrlToClipboard},{default:Te(()=>[ve(s,{name:e.copyWebDAVUrlIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[c,e.$gettext("Copy WebDAV URL")]])])],64)}const S0=Ve(KD,[["render",ZD]]),eL={id:"oc-space-details-sidebar"},tL={class:"oc-space-details-sidebar-image oc-text-center"},nL={key:1,class:"oc-position-relative"},rL=["src"],iL={key:0,class:"oc-flex oc-flex-middle oc-space-details-sidebar-members oc-mb-s oc-text-small"},oL=["textContent"],sL=["textContent"],aL=["aria-label"],lL=Ve(Me({__name:"SpaceDetails",props:{showShareIndicators:{type:Boolean,default:!0}},setup(e){const t=vt(),n=Ke(),{resourceContentsText:r}=Uv({showSizeInformation:!1}),o=ze(),{$gettext:i,$ngettext:s,current:a}=Ne.useGettext(),{loadPreview:c}=Mf(),u=lt(),{imagesLoading:l}=He.storeToRefs(u),f=jt(),d=dr("resource"),m=ae(""),{user:w}=He.storeToRefs(t),b=j(()=>f.linkShares.length),T=j(()=>n.areWebDavDetailsShown),v=j(()=>!at(o,"files-spaces-projects")),g=j(()=>`${En(p(d).size,a)}, ${p(r)}`);Tt(()=>p(d).spaceImageData,async()=>{if(!p(d).spaceImageData){m.value="";return}const X=ee.buildSpaceImageResource(p(d));m.value=await c({space:p(d),resource:X,dimensions:zn.Tile,processor:Bs.enum.fit,cancelRunning:!0,updateStore:!1})},{immediate:!0});const h=j(()=>ee.getSpaceManagers(p(d)).map(se=>{var oe;const ne=se.grantedTo.user||se.grantedTo.group;return ne.id===((oe=p(w))==null?void 0:oe.id)?i("%{displayName} (me)",{displayName:ne.displayName}):ne.displayName}).join(", ")),y=j(()=>gb(p(d).mdate,a)),S=j(()=>p($)||p(D)),E=j(()=>{if(p($)&&!p(D))return p(N);if(!p($)&&p(D))return p(z);switch(p(k)){case 1:return s("This space has one member and %{linkShareCount} link.","This space has one member and %{linkShareCount} links.",p(b),{linkShareCount:p(b).toString()});default:return p(b)===1?i("This space has %{memberShareCount} members and one link.",{memberShareCount:p(k).toString()}):i("This space has %{memberShareCount} members and %{linkShareCount} links.",{memberShareCount:p(k).toString(),linkShareCount:p(b).toString()})}}),R=j(()=>i("Open share panel")),I=j(()=>i("Open link list in share panel")),A=j(()=>i("Open member list in share panel")),$=j(()=>p(k)>0),D=j(()=>p(b)>0),k=j(()=>Object.keys(p(d).members).length),N=j(()=>s("This space has %{memberShareCount} member.","This space has %{memberShareCount} members.",p(k),{memberShareCount:p(k).toString()})),z=j(()=>s("%{linkShareCount} link giving access.","%{linkShareCount} links giving access.",p(b),{linkShareCount:p(b).toString()})),G=()=>{Xe.publish(yt.setActivePanel,"space-share")};return(X,se)=>{const ne=he("oc-spinner"),oe=he("oc-icon"),fe=he("oc-button"),we=he("portal-target");return J(),Se("div",eL,[pe("div",tL,[p(l).includes(p(d).id)?(J(),Ce(ne,{key:0,"aria-label":p(i)("Space image is loading")},null,8,["aria-label"])):m.value?(J(),Se("div",nL,[pe("img",{src:m.value,alt:""},null,8,rL)])):(J(),Ce(oe,{key:2,name:"layout-grid",size:"xxlarge",class:"space-default-image oc-px-m oc-py-m"}))]),X.showShareIndicators&&S.value&&!p(d).disabled?(J(),Se("div",iL,[$.value?(J(),Ce(fe,{key:0,appearance:"raw","aria-label":A.value,"no-hover":"",onClick:G},{default:Te(()=>[ve(oe,{name:"group",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):Oe("",!0),D.value?(J(),Ce(fe,{key:1,appearance:"raw","aria-label":I.value,"no-hover":"",onClick:G},{default:Te(()=>[ve(oe,{name:"link",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):Oe("",!0),pe("p",{textContent:W.toDisplayString(E.value)},null,8,oL),ve(fe,{appearance:"raw","aria-label":R.value,size:"small","no-hover":"",onClick:G},{default:Te(()=>[pe("span",{class:"oc-text-small",textContent:W.toDisplayString(p(i)("Show"))},null,8,sL)]),_:1},8,["aria-label"])])):Oe("",!0),pe("dl",{class:"details-list oc-m-rm","aria-label":p(i)("Overview of the information about the selected space")},[pe("dt",null,W.toDisplayString(p(i)("Last activity")),1),pe("dd",null,W.toDisplayString(y.value),1),p(d).description?(J(),Se(Qe,{key:0},[pe("dt",null,W.toDisplayString(p(i)("Subtitle")),1),pe("dd",null,W.toDisplayString(p(d).description),1)],64)):Oe("",!0),pe("dt",null,W.toDisplayString(p(i)("Manager")),1),pe("dd",null,W.toDisplayString(h.value),1),p(d).disabled?Oe("",!0):(J(),Se(Qe,{key:1},[pe("dt",null,W.toDisplayString(p(i)("Quota")),1),pe("dd",null,[ve(w0,{"space-quota":p(d).spaceQuota},null,8,["space-quota"])])],64)),v.value?(J(),Se(Qe,{key:2},[pe("dt",null,W.toDisplayString(p(i)("Size")),1),pe("dd",null,W.toDisplayString(g.value),1)],64)):Oe("",!0),T.value?(J(),Ce(S0,{key:3,space:p(d)},null,8,["space"])):Oe("",!0),ve(we,{name:"app.files.sidebar.space.details.table","slot-props":{space:p(d),resource:p(d)},multiple:!0},null,8,["slot-props"])],8,aL)])}}}),[["__scopeId","data-v-6de460b8"]]),cL={id:"oc-spaces-details-multiple-sidebar"},uL={class:"spaces-preview oc-mb-l"},fL={class:"spaces-preview-body"},dL=["textContent"],pL=Ve(Me({__name:"SpaceDetailsMultiple",props:{selectedSpaces:{}},setup(e){const t=Ne.useGettext(),{$gettext:n,$ngettext:r}=t,o=j(()=>{let d=0;return e.selectedSpaces.forEach(m=>{d+=m.spaceQuota.total}),En(d,t.current)}),i=j(()=>{let d=0;return e.selectedSpaces.forEach(m=>{m.disabled||(d+=m.spaceQuota.remaining)}),En(d,t.current)}),s=j(()=>{let d=0;return e.selectedSpaces.forEach(m=>{m.disabled||(d+=m.spaceQuota.used)}),En(d,t.current)}),a=j(()=>e.selectedSpaces.filter(d=>!d.disabled).length),c=j(()=>e.selectedSpaces.filter(d=>d.disabled).length),u=j(()=>n("Overview of the information about the selected spaces")),l=j(()=>r("%{ itemCount } space selected","%{ itemCount } spaces selected",e.selectedSpaces.length,{itemCount:e.selectedSpaces.length.toString()})),f=j(()=>[{term:n("Total quota:"),definition:p(o)},{term:n("Remaining quota:"),definition:p(i)},{term:n("Used quota:"),definition:p(s)},{term:n("Enabled:"),definition:p(a)},{term:n("Disabled:"),definition:p(c)}]);return(d,m)=>{const w=he("oc-icon"),b=he("oc-definition-list");return J(),Se("div",cL,[pe("div",uL,[pe("div",fL,[ve(w,{class:"preview-icon",size:"xxlarge",name:"layout-grid"}),pe("p",{class:"preview-text",textContent:W.toDisplayString(l.value)},null,8,dL)])]),ve(b,{"aria-label":u.value,items:f.value},null,8,["aria-label","items"])])}}}),[["__scopeId","data-v-14c2080b"]]),hL=Me({name:"SpaceNoSelection"}),gL={class:"oc-mt-xl"},mL={class:"oc-flex space-info oc-text-center"};function yL(e,t,n,r,o,i){const s=he("oc-icon"),a=dn("translate");return J(),Se("div",gL,[pe("div",mL,[ve(s,{name:"layout-grid",size:"xxlarge"}),ot((J(),Se("p",null,t[0]||(t[0]=[Vt("Select a space to view details")]))),[[a]])])])}const bL=Ve(hL,[["render",yL]]),vL=Me({name:"CompareSaveDialog",props:{originalObject:{type:Object,required:!0},compareObject:{type:Object,required:!0},confirmButtonDisabled:{type:Boolean,default:()=>!1}},emits:["confirm","revert"],setup(){const e=ae(!1);let t;return Mt(()=>{t=Xe.subscribe("sidebar.entity.saved",()=>{e.value=!0})}),jn(()=>{Xe.unsubscribe("sidebar.entity.saved",t)}),{saved:e}},computed:{unsavedChanges(){return!tb(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}}}),wL={class:"compare-save-dialog oc-width-1-1 oc-flex oc-flex-between oc-flex-middle"},SL={key:0,class:"state-indicator oc-flex oc-flex-middle"},EL=["textContent"],TL={key:1,class:"state-indicator"},AL=["textContent"],RL=["textContent"];function _L(e,t,n,r,o,i){const s=he("oc-icon"),a=he("oc-button");return J(),Se("div",wL,[e.saved?(J(),Se("span",SL,[ve(s,{name:"checkbox-circle"}),pe("span",{class:"oc-ml-s",textContent:W.toDisplayString(e.$gettext("Changes saved"))},null,8,EL)])):(J(),Se("span",TL,W.toDisplayString(e.unsavedChangesText),1)),pe("div",null,[ve(a,{disabled:!e.unsavedChanges,class:"compare-save-dialog-revert-btn",onClick:t[0]||(t[0]=c=>e.$emit("revert"))},{default:Te(()=>[pe("span",{textContent:W.toDisplayString(e.$gettext("Revert"))},null,8,AL)]),_:1},8,["disabled"]),ve(a,{appearance:"filled",class:"compare-save-dialog-confirm-btn",disabled:!e.unsavedChanges||e.confirmButtonDisabled,onClick:t[1]||(t[1]=c=>e.$emit("confirm"))},{default:Te(()=>[pe("span",{textContent:W.toDisplayString(e.$gettext("Save"))},null,8,RL)]),_:1},8,["disabled"])])])}const IL=Ve(vL,[["render",_L],["__scopeId","data-v-471483fe"]]),CL=Ww(async()=>(await Promise.resolve().then(()=>T2)).default),FL=Me({name:"CustomComponentTarget",props:{extensionPoint:{type:Object,required:!0}},setup(e){const t=Ni(),n=Ab(),r=j(()=>t.requestExtensions(e.extensionPoint)),o=n.extractDefaultExtensionIds(e.extensionPoint,p(r));return{extensions:j(()=>{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 PL(e,t,n,r,o,i){return J(!0),Se(Qe,null,kt(e.extensions,s=>(J(),Ce(Wr(s.content),{key:`custom-component-${s.id}`}))),128)}const OL=Ve(FL,[["render",PL]]),xL=Me({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=ze(),o=en(),i=ae(),s=ae([]),a=ae(e.items),c=ae(null),u=ae(null),l=`q_${e.filterName}`,f=on(l),d=E=>E[e.idAttribute],m=()=>r.push({query:{...ki(p(o).query,[l]),...!!p(s).length&&{[l]:p(s).reduce((E,R)=>(E+=`${d(R)}+`,E),"").slice(0,-1)}}}),w=E=>!!p(s).find(R=>d(R)===d(E)),b=async E=>{w(E)?s.value=p(s).filter(R=>d(R)!==d(E)):(e.allowMultiple||(s.value=[]),s.value.push(E)),await m(),t("selectionChange",p(s))},T=ae(),v=(E,R)=>{if(!(R||"").trim())return E;const A=new Yf(E,{...nl,keys:e.filterableAttributes}).search(R).map($=>$.item);return E.filter($=>A.includes($))},g=()=>{s.value=[],t("selectionChange",p(s)),m()},h=E=>{a.value=E},y=async()=>{var E;h(e.items),await Gn(),(E=p(i))==null||E.focus()};Tt(T,()=>{h(v(e.items,p(T))),p(u)&&(c.value=new Zf(p(u)),p(c).unmark(),p(c).mark(p(T),{element:"span",className:"mark-highlight"}))});const S=()=>{const E=St(p(f));if(E){const R=E.split("+");s.value=e.items.filter(I=>R.includes(d(I)))}};return n({setSelectedItemsBasedOnQuery:S}),Mt(()=>{S()}),{clearFilter:g,displayedItems:a,filterInputRef:i,filterTerm:T,isItemSelected:w,itemFilterListRef:u,queryParam:l,selectedItems:s,setDisplayedItems:h,showDrop:y,toggleItemSelection:b,setSelectedItemsBasedOnQuery:S}}}),kL={ref:"itemFilterListRef"},NL={class:"oc-flex oc-flex-middle oc-text-truncate"},$L={class:"oc-text-truncate oc-ml-s"},DL={class:"oc-flex"};function LL(e,t,n,r,o,i){const s=he("oc-text-input"),a=he("oc-checkbox"),c=he("oc-icon"),u=he("oc-button"),l=he("oc-list"),f=he("oc-filter-chip");return J(),Se("div",{class:W.normalizeClass(["item-filter oc-flex",`item-filter-${e.filterName}`])},[ve(f,{"filter-label":e.filterLabel,"selected-item-names":e.selectedItems.map(d=>d[e.displayNameAttribute]),"close-on-click":e.closeOnClick,onClearFilter:e.clearFilter,onShowDrop:e.showDrop},{default:Te(()=>[e.showOptionFilter&&e.filterableAttributes.length?(J(),Ce(s,{key:0,ref:"filterInputRef",modelValue:e.filterTerm,"onUpdate:modelValue":t[0]||(t[0]=d=>e.filterTerm=d),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"])):Oe("",!0),pe("div",kL,[ve(l,{class:"item-filter-list"},{default:Te(()=>[(J(!0),Se(Qe,null,kt(e.displayedItems,(d,m)=>(J(),Se("li",{key:m,class:"oc-my-xs"},[ve(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(d),"oc-flex-left":e.allowMultiple,"oc-flex-between":!e.allowMultiple}]),"justify-content":"space-between",appearance:"raw","data-test-value":d[e.displayNameAttribute],onClick:w=>e.toggleItemSelection(d)},{default:Te(()=>[pe("div",NL,[e.allowMultiple?(J(),Ce(a,{key:0,size:"large",class:"item-filter-checkbox oc-mr-s",label:e.$gettext("Toggle selection"),"model-value":e.isItemSelected(d),"label-hidden":!0,"onUpdate:modelValue":w=>e.toggleItemSelection(d),onClick:t[1]||(t[1]=Rn(()=>{},["stop"]))},null,8,["label","model-value","onUpdate:modelValue"])):Oe("",!0),pe("div",null,[Ge(e.$slots,"image",{item:d})]),pe("div",$L,[Ge(e.$slots,"item",{item:d})])]),pe("div",DL,[!e.allowMultiple&&e.isItemSelected(d)?(J(),Ce(c,{key:0,name:"check"})):Oe("",!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 ML=Ve(xL,[["render",LL]]),BL=Me({name:"ItemFilterToggle",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=ze(),r=en(),o=ae(!1),i=`q_${e.filterName}`,s=on(i),a=()=>n.push({query:{...ki(p(r).query,[i]),...p(o)&&{[i]:"true"}}}),c=async()=>{o.value=!p(o),await a(),t("toggleFilter",p(o))};return Mt(()=>{St(p(s))==="true"&&(o.value=!0)}),{queryParam:i,filterActive:o,toggleFilter:c}}});function jL(e,t,n,r,o,i){const s=he("oc-filter-chip");return J(),Se("div",{class:W.normalizeClass(["item-filter oc-flex",`item-filter-${e.filterName}`])},[ve(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 UL=Ve(BL,[["render",jL]]),qL=Me({name:"LoadingIndicator",setup(){const e=cn();let t,n,r;const o=ae(e.isLoading),i=ae(e.currentProgress),s=()=>{i.value=e.currentProgress,o.value=e.isLoading},a=()=>{i.value=e.currentProgress};return Mt(()=>{t=Xe.subscribe(Pr.add,s),n=Xe.subscribe(Pr.remove,s),r=Xe.subscribe(Pr.setProgress,a)}),jn(()=>{Xe.unsubscribe(Pr.add,t),Xe.unsubscribe(Pr.remove,n),Xe.unsubscribe(Pr.setProgress,r)}),{isLoading:o,currentProgress:i}}}),VL={key:0,id:"oc-loading-indicator",class:"oc-width-1-1"};function zL(e,t,n,r,o,i){const s=he("oc-progress");return e.isLoading?(J(),Se("div",VL,[ve(s,{max:100,indeterminate:e.currentProgress===null,value:e.currentProgress,size:"small"},null,8,["indeterminate","value"])])):Oe("",!0)}const WL=Ve(qL,[["render",zL]]),HL=Me({name:"NoContentMessage",props:{icon:{type:String,required:!0},iconFillType:{type:String,default:"fill"}}}),GL={class:"no-content-message oc-flex oc-flex-column oc-flex-center oc-flex-middle oc-text-center"},KL={class:"oc-text-muted oc-text-xlarge"},QL={class:"oc-text-muted"};function XL(e,t,n,r,o,i){const s=he("oc-icon");return J(),Se("div",GL,[ve(s,{name:e.icon,type:"div",size:"xxlarge","fill-type":e.iconFillType,class:"oc-mb-m"},null,8,["name","fill-type"]),pe("div",KL,[Ge(e.$slots,"message")]),pe("div",QL,[Ge(e.$slots,"callToAction")])])}const YL=Ve(HL,[["render",XL]]),JL=Me({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 ZL(e,t,n,r,o,i){const s=he("oc-pagination");return e.pages>1?(J(),Ce(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"])):Oe("",!0)}const e2=Ve(JL,[["render",ZL]]),t2=Me({name:"SearchBarFilter",props:{currentFolderAvailable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=Ne.useGettext(),r=on("useScope"),o=ae(),i=ae(),s=j(()=>{var u;return n((u=o.value)==null?void 0:u.title)}),a=j(()=>[{id:Er.currentFolder,title:n("Current folder"),enabled:e.currentFolderAvailable},{id:Er.allFiles,title:n("All files"),enabled:!0}]);return Tt(()=>e.currentFolderAvailable,()=>{if(p(r)){if(p(r).toString()==="true"){o.value=p(a).find(({id:l})=>l===Er.currentFolder);return}o.value=p(a).find(({id:l})=>l===Er.allFiles);return}if(!e.currentFolderAvailable){o.value=p(a).find(({id:u})=>u===Er.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===Er.allFiles)},{immediate:!0}),{currentSelection:o,currentSelectionTitle:s,onOptionSelected:u=>{i.value=u,o.value=u,t("update:modelValue",{value:u})},locationOptions:a}}}),n2={key:0},r2={key:0,class:"oc-flex"};function i2(e,t,n,r,o,i){const s=he("oc-icon"),a=he("oc-button"),c=he("oc-filter-chip");return J(),Se("div",{class:"oc-location-search oc-position-small oc-position-center-right oc-mt-rm",onClick:t[0]||(t[0]=Rn(()=>{},["stop"]))},[e.currentSelection?(J(),Se("div",n2,[ve(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:Te(()=>[(J(!0),Se(Qe,null,kt(e.locationOptions,(u,l)=>(J(),Ce(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:f=>e.onOptionSelected(u)},{default:Te(()=>[pe("span",null,W.toDisplayString(u.title),1),u.id===e.currentSelection.id?(J(),Se("div",r2,[ve(s,{name:"check"})])):Oe("",!0)]),_:2},1032,["class","disabled","data-test-id","onClick"]))),128))]),_:1},8,["filter-label"])])):Oe("",!0)])}const o2=Ve(t2,[["render",i2]]),s2=Me({name:"PortalTarget",components:{PortalTargetVue:ga.PortalTarget},props:{...ga.PortalTarget.props},setup(e){const t=j(()=>e);return Mt(()=>{Xe.publish(la.mounted,e)}),{properties:t}}});function a2(e,t,n,r,o,i){const s=he("portal-target-vue");return J(),Ce(s,W.normalizeProps(Ha(e.properties)),null,16)}const l2=Ve(s2,[["render",a2]]),c2=({sortBy:e,sortDir:t})=>({groupingSettings:j(()=>({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}}}))}),u2={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é"}},f2={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"}},d2={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"}},p2={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"}},h2={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"}},g2={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:"Автопрокрутка"}},m2={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:"同期スクロール"}},y2={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"}},b2={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"},v2={"fr-FR":u2,"de-DE":f2,"it-IT":d2,"es-ES":p2,"pl-PL":h2,ru:g2,"jp-JP":m2,"id-ID":y2},w2=Me({name:"TextEditor",components:{MdEditor:$o.MdEditor,MdPreview:$o.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=Ne.useGettext(),{currentTheme:r}=ii(),o=j(()=>{const{showPreviewOnlyMd:c=!0}=e.applicationConfig;return{showPreviewOnlyMd:c}}),i=j(()=>{var c;return e.markdownMode||["md","markdown"].includes((c=e.resource)==null?void 0:c.extension)||!p(o).showPreviewOnlyMd}),s=j(()=>p(r).isDark?"dark":"light");return $o.config({editorConfig:{languageUserDefined:v2},editorExtensions:{screenfull:{instance:$0},cropper:{instance:D0}},markdownItPlugins(c){return[...c,{type:"xss",plugin:$o.XSSPlugin,options:{}}]}}),{isMarkdown:i,theme:s,language:n,languages:b2,onUploadImg:async c=>{const l=(await Promise.all([...c].map(d=>new Promise((m,w)=>{const b=new FileReader;b.onload=()=>m(b.result),b.onerror=w,b.readAsDataURL(d)})))).map(d=>`![image](${d})`),f=`${p(e.currentContent)}
64
64
  ${l.join(`
65
65
 
66
66
  `)}
67
- `;t("update:currentContent",f)}}}}),w2={id:"text-editor-container",class:"oc-height-1-1"};function S2(e,t,n,r,o,i){const s=pe("md-preview"),a=pe("md-editor");return J(),ve("div",w2,[e.isReadOnly?(J(),Ce(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"])):(J(),Ce(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 E2=Object.freeze(Object.defineProperty({__proto__:null,default:Ve(v2,[["render",S2]])},Symbol.toStringTag,{value:"Module"}));L.ActionMenuItem=jf,L.ApiError=JT,L.AppBar=Sk,L.AppLoadingSpinner=xf,L.AppProviderService=NT,L.AppTopBar=zv,L.AppWrapper=Yv,L.AppWrapperRoute=FN,L.ArchiverService=ZT,L.Auth=kh,L.BatchActions=Uv,L.Cache=El,L.ClientService=lA,L.ClipboardActions=ei,L.CompareSaveDialog=_L,L.ConflictDialog=tl,L.ContextActionMenu=Uf,L.ContextActions=qv,L.ContextMenuQuickAction=qf,L.CreateLinkModal=vv,L.CreateShortcutModal=yv,L.CreateSpace=Rk,L.CustomComponentTarget=FL,L.DateFilter=jD,L.DatePickerModal=fN,L.EDITOR_MODE_CREATE=UF,L.EDITOR_MODE_EDIT=jF,L.EVENT_FILE_DROPPED=Pf,L.EVENT_TROW_CONTEXTMENU=GF,L.EVENT_TROW_MOUNTED=hv,L.EmojiPickerModal=kv,L.EventBus=Nh,L.FileInfo=Gv,L.FilePickerModal=wv,L.FileSideBar=Kv,L.FolderLoaderFavorites=qh,L.FolderLoaderSharedViaLink=Vh,L.FolderLoaderSharedWithMe=zh,L.FolderLoaderSharedWithOthers=Wh,L.FolderLoaderSpace=Uh,L.FolderLoaderTrashbin=jy,L.FolderService=Uy,L.FolderViewModeConstants=Gt,L.HttpClient=Ul,L.ImageDimension=zn,L.ImageType=oa,L.ItemFilter=LL,L.ItemFilterInline=zD,L.ItemFilterToggle=jL,L.Key=Nf,L.LinkRoleDropdown=bv,L.LoadingEventTopics=Fr,L.LoadingIndicator=zL,L.LoadingService=H_,L.MimeTypesToAppsSchema=yh,L.Modifier=$f,L.NoContentMessage=XL,L.Pagination=ZL,L.PaginationConstants=Tr,L.PasswordPolicyService=LI,L.PortalTarget=a2,L.PortalTargetEventTopics=la,L.PreviewService=CI,L.ProcessorType=Bs,L.QuotaModal=Cv,L.QuotaSelect=Iv,L.RawConfigSchema=RP,L.ResolveStrategy=qn,L.ResourceConflictModal=vp,L.ResourceGhostElement=Vf,L.ResourceIcon=Co,L.ResourceLink=Ff,L.ResourceListItem=Po,L.ResourceName=Of,L.ResourcePreview=mv,L.ResourceSize=Jv,L.ResourceTable=aD,L.ResourceTile=b0,L.ResourceTiles=RD,L.ResourceTransfer=Sp,L.RuntimeError=Ii,L.SaveAsModal=Ev,L.SearchBarFilter=i2,L.SearchLocationFilterConstants=Er,L.SideBar=Wv,L.SideBarEventTopics=yt,L.SortConstants=Yr,L.SortDir=Bt,L.SpaceDetails=aL,L.SpaceDetailsMultiple=dL,L.SpaceInfo=Hv,L.SpaceMoveInfoModal=bp,L.SpaceNoSelection=yL,L.SpaceQuota=v0,L.TextEditor=IL,L.ThemeConfig=AF,L.TransferType=pr,L.UnsavedChangesModal=Qv,L.UppyService=BI,L.ViewOptions=Vv,L.VisibilityObserver=gv,L.WebDavDetails=w0,L.WebThemeConfig=Wb,L.activeApp=Sl,L.authContextValues=cT,L.blobToArrayBuffer=wb,L.breadcrumbsFromPath=rP,L.buildRoutes=xF,L.buildUrl=fT,L.cacheService=jl,L.canvasToBlob=Sb,L.cloneStateObject=mp,L.concatBreadcrumbs=iP,L.contextQueryToFileContextProps=Qb,L.contextRouteNameKey=Gs,L.contextRouteParamsKey=hf,L.contextRouteQueryKey=gf,L.createDefaultFileIconMapping=Tp,L.createFileRouteOptions=Jn,L.createLocationCommon=Ti,L.createLocationPublic=Ai,L.createLocationShares=kn,L.createLocationSpaces=xn,L.createLocationTrash=Ri,L.defaultFuseOptions=nl,L.defineWebApplication=D0,L.determineResourceTableSortFields=gh,L.determineResourceTilesSortFields=FT,L.dirname=gt.dirname,L.displayPositionedDropdown=wo,L.encodePath=uf,L.eventBus=Xe,L.filterResources=BS,L.focusCheckbox=hT,L.folderService=qy,L.formatDateFromDateTime=ti,L.formatDateFromHTTP=oP,L.formatDateFromISO=hb,L.formatDateFromJSDate=pb,L.formatDateFromRFC=sP,L.formatFileSize=En,L.formatRelativeDateFromDateTime=So,L.formatRelativeDateFromHTTP=aP,L.formatRelativeDateFromISO=lP,L.formatRelativeDateFromJSDate=gb,L.formatRelativeDateFromRFC=cP,L.getIndicators=Eo,L.getLocaleFromLanguage=qs,L.getParentPaths=mb,L.getSharedAncestorRoute=pT,L.getSharedDriveItem=hs,L.getSpacesByType=Ao,L.isLocationActive=FF,L.isLocationCommonActive=At,L.isLocationPublicActive=_n,L.isLocationSharesActive=Nt,L.isLocationSpacesActive=at,L.isLocationTrashActive=In,L.isResourceBeeingMovedToSameLocation=wp,L.isSameResource=Zi,L.locationPublicLink=vl,L.locationPublicUpload=wl,L.locationSharesViaLink=bl,L.locationSharesWithMe=ps,L.locationSharesWithOthers=yl,L.locationSpacesGeneric=ml,L.objectKeys=II,L.queryItemAsString=St,L.renameResource=rl,L.resolveFileNameDuplicate=Un,L.resourceIconMappingInjectionKey=Ep,L.routeToContextQuery=Ks,L.sortFields=mh,L.sortHelper=ph,L.sortSpaceMembers=Hb,L.translateSortFields=OT,L.triggerDownloadWithFilename=Bl,L.useAbility=hn,L.useActionsShowDetails=Fx,L.useActiveApp=uT,L.useActiveLocation=Sr,L.useAppConfig=oh,L.useAppDefaults=nv,L.useAppFileHandling=mf,L.useAppFolderHandling=Yb,L.useAppMeta=vf,L.useAppNavigation=Xb,L.useAppProviderService=xx,L.useAppsStore=Zn,L.useArchiverService=av,L.useAuthService=yf,L.useAuthStore=Xr,L.useBreadcrumbsFromPath=kx,L.useCanBeOpenedWithSecureView=Df,L.useCanListShares=fv,L.useCanListVersions=Lv,L.useCanShare=dv,L.useCapabilityStore=rn,L.useClientService=Ye,L.useClipboard=wf,L.useClipboardStore=To,L.useConfigStore=st,L.useCreateSpace=Di,L.useDeleteWorker=rv,L.useDocumentTitle=Jb,L.useDownloadFile=lv,L.useDriveResolver=tv,L.useEmbedMode=ni,L.useEventBus=_o,L.useExtensionPreferencesStore=Tb,L.useExtensionRegistry=Ni,L.useFileActions=Vn,L.useFileActionsCopy=Js,L.useFileActionsCopyPermanentLink=Sf,L.useFileActionsCreateLink=ex,L.useFileActionsCreateNewFile=HF,L.useFileActionsCreateNewFolder=WF,L.useFileActionsCreateNewShortcut=CO,L.useFileActionsCreateSpaceFromResource=Cf,L.useFileActionsDelete=ea,L.useFileActionsDeleteResources=sv,L.useFileActionsDisableSync=Zs,L.useFileActionsDownloadArchive=ta,L.useFileActionsDownloadFile=Io,L.useFileActionsEmptyTrashBin=Ef,L.useFileActionsEnableSync=Xs,L.useFileActionsFavorite=Tf,L.useFileActionsMove=na,L.useFileActionsNavigate=Af,L.useFileActionsOpenShortcut=PO,L.useFileActionsOpenWithApp=Sv,L.useFileActionsPaste=cv,L.useFileActionsRename=ra,L.useFileActionsRestore=ia,L.useFileActionsSaveAs=Tv,L.useFileActionsSetImage=uv,L.useFileActionsShowActions=zF,L.useFileActionsShowDetails=_f,L.useFileActionsShowShares=If,L.useFileActionsToggleHideShare=Ys,L.useFileListHeaderPosition=Nx,L.useFileRouteReplace=zs,L.useFolderLink=si,L.useGetMatchingSpace=ln,L.useGetResourceContext=Mv,L.useGroupingSettings=l2,L.useIsFilesAppActive=Or,L.useIsSearchActive=os,L.useIsTopBarSticky=kf,L.useKeyboardActions=$v,L.useLinkTypes=sa,L.useLoadPreview=Mf,L.useLoadingService=cn,L.useLocalStorage=pf,L.useMessages=rt,L.useModals=bt,L.useOpenEmptyEditor=Ox,L.useOpenWithDefaultApp=Fv,L.usePagination=Dx,L.usePasswordPolicyService=Dv,L.usePasteWorker=iv,L.usePortalTarget=Bx,L.usePreviewService=Rf,L.useRequest=Zb,L.useRequestHeaders=Qs,L.useResourceContents=jv,L.useResourceRouteResolver=aa,L.useResourcesStore=Ke,L.useRestoreWorker=ov,L.useRoute=en,L.useRouteMeta=Gb,L.useRouteName=Ws,L.useRouteParam=Hs,L.useRouteQuery=on,L.useRouteQueryPersisted=wr,L.useRouter=ze,L.useScrollTo=pv,L.useSearch=bf,L.useSelectedResources=Bf,L.useService=mr,L.useSharesStore=jt,L.useSideBar=yb,L.useSort=RT,L.useSpaceActionsDelete=Av,L.useSpaceActionsDisable=Rv,L.useSpaceActionsDuplicate=_v,L.useSpaceActionsEditDescription=dx,L.useSpaceActionsEditQuota=Pv,L.useSpaceActionsEditReadmeContent=Ax,L.useSpaceActionsNavigateToTrash=_x,L.useSpaceActionsRename=Ov,L.useSpaceActionsRestore=xv,L.useSpaceActionsSetIcon=Px,L.useSpaceActionsShowMembers=Rx,L.useSpaceHelpers=oi,L.useSpacesLoading=ev,L.useSpacesStore=lt,L.useThemeStore=ii,L.useTileSize=Bv,L.useTokenTimerWorker=LF,L.useUpload=Vx,L.useUserStore=vt,L.useViewMode=jx,L.useViewSize=Ux,L.useViewSizeMax=Lf,L.useWebWorkersStore=Ro,L.useWindowOpen=Nv,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
67
+ `;t("update:currentContent",f)}}}}),S2={id:"text-editor-container",class:"oc-height-1-1"};function E2(e,t,n,r,o,i){const s=he("md-preview"),a=he("md-editor");return J(),Se("div",S2,[e.isReadOnly?(J(),Ce(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"])):(J(),Ce(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 T2=Object.freeze(Object.defineProperty({__proto__:null,default:Ve(w2,[["render",E2]])},Symbol.toStringTag,{value:"Module"}));L.ActionMenuItem=jf,L.ApiError=ZT,L.AppBar=Ek,L.AppLoadingSpinner=xf,L.AppProviderService=$T,L.AppTopBar=Wv,L.AppWrapper=Jv,L.AppWrapperRoute=ON,L.ArchiverService=eA,L.Auth=Nh,L.BatchActions=qv,L.Cache=El,L.ClientService=cA,L.ClipboardActions=ei,L.CompareSaveDialog=IL,L.ConflictDialog=tl,L.ContextActionMenu=Uf,L.ContextActions=Vv,L.ContextMenuQuickAction=qf,L.CreateLinkModal=wv,L.CreateShortcutModal=bv,L.CreateSpace=_k,L.CustomComponentTarget=OL,L.DateFilter=UD,L.DatePickerModal=dN,L.EDITOR_MODE_CREATE=qP,L.EDITOR_MODE_EDIT=UP,L.EVENT_FILE_DROPPED=Ff,L.EVENT_TROW_CONTEXTMENU=KP,L.EVENT_TROW_MOUNTED=gv,L.EmojiPickerModal=Nv,L.EventBus=$h,L.FileInfo=Kv,L.FilePickerModal=Sv,L.FileSideBar=Qv,L.FolderLoaderFavorites=Vh,L.FolderLoaderSharedViaLink=zh,L.FolderLoaderSharedWithMe=Wh,L.FolderLoaderSharedWithOthers=Hh,L.FolderLoaderSpace=qh,L.FolderLoaderTrashbin=Uy,L.FolderService=qy,L.FolderViewModeConstants=Gt,L.HttpClient=Ul,L.ImageDimension=zn,L.ImageType=oa,L.ItemFilter=ML,L.ItemFilterInline=WD,L.ItemFilterToggle=UL,L.Key=Nf,L.LinkRoleDropdown=vv,L.LoadingEventTopics=Pr,L.LoadingIndicator=WL,L.LoadingService=G_,L.MimeTypesToAppsSchema=bh,L.Modifier=$f,L.NoContentMessage=YL,L.Pagination=e2,L.PaginationConstants=Tr,L.PasswordPolicyService=MI,L.PortalTarget=l2,L.PortalTargetEventTopics=la,L.PreviewService=FI,L.ProcessorType=Bs,L.QuotaModal=Fv,L.QuotaSelect=Cv,L.RawConfigSchema=_F,L.ResolveStrategy=qn,L.ResourceConflictModal=vp,L.ResourceGhostElement=Vf,L.ResourceIcon=Co,L.ResourceLink=Pf,L.ResourceListItem=Fo,L.ResourceName=Of,L.ResourcePreview=yv,L.ResourceSize=Zv,L.ResourceTable=lD,L.ResourceTile=v0,L.ResourceTiles=_D,L.ResourceTransfer=Sp,L.RuntimeError=Ii,L.SaveAsModal=Tv,L.SearchBarFilter=o2,L.SearchLocationFilterConstants=Er,L.SideBar=Hv,L.SideBarEventTopics=yt,L.SortConstants=Yr,L.SortDir=Bt,L.SpaceDetails=lL,L.SpaceDetailsMultiple=pL,L.SpaceInfo=Gv,L.SpaceMoveInfoModal=bp,L.SpaceNoSelection=bL,L.SpaceQuota=w0,L.TextEditor=CL,L.ThemeConfig=RP,L.TransferType=pr,L.UnsavedChangesModal=Xv,L.UppyService=jI,L.ViewOptions=zv,L.VisibilityObserver=mv,L.WebDavDetails=S0,L.WebThemeConfig=Hb,L.activeApp=Sl,L.authContextValues=uT,L.blobToArrayBuffer=Sb,L.breadcrumbsFromPath=iF,L.buildRoutes=kP,L.buildUrl=dT,L.cacheService=jl,L.canvasToBlob=Eb,L.cloneStateObject=mp,L.concatBreadcrumbs=oF,L.contextQueryToFileContextProps=Xb,L.contextRouteNameKey=Gs,L.contextRouteParamsKey=hf,L.contextRouteQueryKey=gf,L.createDefaultFileIconMapping=Tp,L.createFileRouteOptions=Jn,L.createLocationCommon=Ti,L.createLocationPublic=Ai,L.createLocationShares=kn,L.createLocationSpaces=xn,L.createLocationTrash=Ri,L.defaultFuseOptions=nl,L.defineWebApplication=L0,L.determineResourceTableSortFields=mh,L.determineResourceTilesSortFields=OT,L.dirname=gt.dirname,L.displayPositionedDropdown=wo,L.encodePath=uf,L.eventBus=Xe,L.filterResources=jS,L.focusCheckbox=gT,L.folderService=Vy,L.formatDateFromDateTime=ti,L.formatDateFromHTTP=sF,L.formatDateFromISO=gb,L.formatDateFromJSDate=hb,L.formatDateFromRFC=aF,L.formatFileSize=En,L.formatRelativeDateFromDateTime=So,L.formatRelativeDateFromHTTP=lF,L.formatRelativeDateFromISO=cF,L.formatRelativeDateFromJSDate=mb,L.formatRelativeDateFromRFC=uF,L.getIndicators=Eo,L.getLocaleFromLanguage=qs,L.getParentPaths=yb,L.getSharedAncestorRoute=hT,L.getSharedDriveItem=hs,L.getSpacesByType=Ao,L.isLocationActive=OP,L.isLocationCommonActive=At,L.isLocationPublicActive=_n,L.isLocationSharesActive=Nt,L.isLocationSpacesActive=at,L.isLocationTrashActive=In,L.isResourceBeeingMovedToSameLocation=wp,L.isSameResource=Zi,L.locationPublicLink=vl,L.locationPublicUpload=wl,L.locationSharesViaLink=bl,L.locationSharesWithMe=ps,L.locationSharesWithOthers=yl,L.locationSpacesGeneric=ml,L.objectKeys=CI,L.queryItemAsString=St,L.renameResource=rl,L.resolveFileNameDuplicate=Un,L.resourceIconMappingInjectionKey=Ep,L.routeToContextQuery=Ks,L.setCurrentUserShareSpacePermissions=ah,L.sortFields=yh,L.sortHelper=hh,L.sortSpaceMembers=Gb,L.translateSortFields=xT,L.triggerDownloadWithFilename=Bl,L.useAbility=hn,L.useActionsShowDetails=Ox,L.useActiveApp=fT,L.useActiveLocation=Sr,L.useAppConfig=oh,L.useAppDefaults=rv,L.useAppFileHandling=mf,L.useAppFolderHandling=Jb,L.useAppMeta=vf,L.useAppNavigation=Yb,L.useAppProviderService=kx,L.useAppsStore=Zn,L.useArchiverService=lv,L.useAuthService=yf,L.useAuthStore=Xr,L.useBreadcrumbsFromPath=Nx,L.useCanBeOpenedWithSecureView=Df,L.useCanListShares=dv,L.useCanListVersions=Mv,L.useCanShare=pv,L.useCapabilityStore=rn,L.useClientService=Ye,L.useClipboard=wf,L.useClipboardStore=To,L.useConfigStore=st,L.useCreateSpace=Di,L.useDeleteWorker=iv,L.useDocumentTitle=Zb,L.useDownloadFile=cv,L.useDriveResolver=nv,L.useEmbedMode=ni,L.useEventBus=_o,L.useExtensionPreferencesStore=Ab,L.useExtensionRegistry=Ni,L.useFileActions=Vn,L.useFileActionsCopy=Js,L.useFileActionsCopyPermanentLink=Sf,L.useFileActionsCreateLink=tx,L.useFileActionsCreateNewFile=GP,L.useFileActionsCreateNewFolder=HP,L.useFileActionsCreateNewShortcut=FO,L.useFileActionsCreateSpaceFromResource=Cf,L.useFileActionsDelete=ea,L.useFileActionsDeleteResources=av,L.useFileActionsDisableSync=Zs,L.useFileActionsDownloadArchive=ta,L.useFileActionsDownloadFile=Io,L.useFileActionsEmptyTrashBin=Ef,L.useFileActionsEnableSync=Xs,L.useFileActionsFavorite=Tf,L.useFileActionsMove=na,L.useFileActionsNavigate=Af,L.useFileActionsOpenShortcut=PO,L.useFileActionsOpenWithApp=Ev,L.useFileActionsPaste=uv,L.useFileActionsRename=ra,L.useFileActionsRestore=ia,L.useFileActionsSaveAs=Av,L.useFileActionsSetImage=fv,L.useFileActionsShowActions=WP,L.useFileActionsShowDetails=_f,L.useFileActionsShowShares=If,L.useFileActionsToggleHideShare=Ys,L.useFileListHeaderPosition=$x,L.useFileRouteReplace=zs,L.useFolderLink=si,L.useGetMatchingSpace=ln,L.useGetResourceContext=Bv,L.useGroupingSettings=c2,L.useIsFilesAppActive=Or,L.useIsSearchActive=os,L.useIsTopBarSticky=kf,L.useKeyboardActions=Dv,L.useLinkTypes=sa,L.useLoadPreview=Mf,L.useLoadingService=cn,L.useLocalStorage=pf,L.useMessages=rt,L.useModals=bt,L.useOpenEmptyEditor=xx,L.useOpenWithDefaultApp=Ov,L.usePagination=Lx,L.usePasswordPolicyService=Lv,L.usePasteWorker=ov,L.usePortalTarget=jx,L.usePreviewService=Rf,L.useRequest=ev,L.useRequestHeaders=Qs,L.useResourceContents=Uv,L.useResourceRouteResolver=aa,L.useResourcesStore=Ke,L.useRestoreWorker=sv,L.useRoute=en,L.useRouteMeta=Kb,L.useRouteName=Ws,L.useRouteParam=Hs,L.useRouteQuery=on,L.useRouteQueryPersisted=wr,L.useRouter=ze,L.useScrollTo=hv,L.useSearch=bf,L.useSelectedResources=Bf,L.useService=mr,L.useSharesStore=jt,L.useSideBar=bb,L.useSort=_T,L.useSpaceActionsDelete=Rv,L.useSpaceActionsDisable=_v,L.useSpaceActionsDuplicate=Iv,L.useSpaceActionsEditDescription=px,L.useSpaceActionsEditQuota=Pv,L.useSpaceActionsEditReadmeContent=Rx,L.useSpaceActionsNavigateToTrash=Ix,L.useSpaceActionsRename=xv,L.useSpaceActionsRestore=kv,L.useSpaceActionsSetIcon=Px,L.useSpaceActionsShowMembers=_x,L.useSpaceHelpers=oi,L.useSpacesLoading=tv,L.useSpacesStore=lt,L.useThemeStore=ii,L.useTileSize=jv,L.useTokenTimerWorker=MP,L.useUpload=zx,L.useUserStore=vt,L.useViewMode=Ux,L.useViewSize=qx,L.useViewSizeMax=Lf,L.useWebWorkersStore=Ro,L.useWindowOpen=$v,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});