var Oe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function El(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ku={exports:{}},Xt=ku.exports={},Le,Be;function Mo(){throw new Error("setTimeout has not been defined")}function To(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Le=setTimeout:Le=Mo}catch{Le=Mo}try{typeof clearTimeout=="function"?Be=clearTimeout:Be=To}catch{Be=To}})();function $u(e){if(Le===setTimeout)return setTimeout(e,0);if((Le===Mo||!Le)&&setTimeout)return Le=setTimeout,setTimeout(e,0);try{return Le(e,0)}catch{try{return Le.call(null,e,0)}catch{return Le.call(this,e,0)}}}function _l(e){if(Be===clearTimeout)return clearTimeout(e);if((Be===To||!Be)&&clearTimeout)return Be=clearTimeout,clearTimeout(e);try{return Be(e)}catch{try{return Be.call(null,e)}catch{return Be.call(this,e)}}}var Te=[],un=!1,qe,Hn=-1;function Al(){!un||!qe||(un=!1,qe.length?Te=qe.concat(Te):Hn=-1,Te.length&&Fu())}function Fu(){if(!un){var e=$u(Al);un=!0;for(var t=Te.length;t;){for(qe=Te,Te=[];++Hn1)for(var n=1;nconsole.error("SEMVER",...t):()=>{},fr}var hr,Ds;function Vu(){if(Ds)return hr;Ds=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,o=t-6;return hr={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},hr}var pr={exports:{}},Ms;function Nl(){return Ms||(Ms=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:o}=Vu(),s=Ou();t=e.exports={};const u=t.re=[],i=t.safeRe=[],f=t.src=[],h=t.safeSrc=[],a=t.t={};let p=0;const d="[a-zA-Z0-9-]",I=[["\\s",1],["\\d",o],[d,r]],S=R=>{for(const[v,E]of I)R=R.split(`${v}*`).join(`${v}{0,${E}}`).split(`${v}+`).join(`${v}{1,${E}}`);return R},w=(R,v,E)=>{const x=S(v),N=p++;s(R,N,v),a[R]=N,f[N]=v,h[N]=x,u[N]=new RegExp(v,E?"g":void 0),i[N]=new RegExp(x,E?"g":void 0)};w("NUMERICIDENTIFIER","0|[1-9]\\d*"),w("NUMERICIDENTIFIERLOOSE","\\d+"),w("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),w("MAINVERSION",`(${f[a.NUMERICIDENTIFIER]})\\.(${f[a.NUMERICIDENTIFIER]})\\.(${f[a.NUMERICIDENTIFIER]})`),w("MAINVERSIONLOOSE",`(${f[a.NUMERICIDENTIFIERLOOSE]})\\.(${f[a.NUMERICIDENTIFIERLOOSE]})\\.(${f[a.NUMERICIDENTIFIERLOOSE]})`),w("PRERELEASEIDENTIFIER",`(?:${f[a.NONNUMERICIDENTIFIER]}|${f[a.NUMERICIDENTIFIER]})`),w("PRERELEASEIDENTIFIERLOOSE",`(?:${f[a.NONNUMERICIDENTIFIER]}|${f[a.NUMERICIDENTIFIERLOOSE]})`),w("PRERELEASE",`(?:-(${f[a.PRERELEASEIDENTIFIER]}(?:\\.${f[a.PRERELEASEIDENTIFIER]})*))`),w("PRERELEASELOOSE",`(?:-?(${f[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${f[a.PRERELEASEIDENTIFIERLOOSE]})*))`),w("BUILDIDENTIFIER",`${d}+`),w("BUILD",`(?:\\+(${f[a.BUILDIDENTIFIER]}(?:\\.${f[a.BUILDIDENTIFIER]})*))`),w("FULLPLAIN",`v?${f[a.MAINVERSION]}${f[a.PRERELEASE]}?${f[a.BUILD]}?`),w("FULL",`^${f[a.FULLPLAIN]}$`),w("LOOSEPLAIN",`[v=\\s]*${f[a.MAINVERSIONLOOSE]}${f[a.PRERELEASELOOSE]}?${f[a.BUILD]}?`),w("LOOSE",`^${f[a.LOOSEPLAIN]}$`),w("GTLT","((?:<|>)?=?)"),w("XRANGEIDENTIFIERLOOSE",`${f[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),w("XRANGEIDENTIFIER",`${f[a.NUMERICIDENTIFIER]}|x|X|\\*`),w("XRANGEPLAIN",`[v=\\s]*(${f[a.XRANGEIDENTIFIER]})(?:\\.(${f[a.XRANGEIDENTIFIER]})(?:\\.(${f[a.XRANGEIDENTIFIER]})(?:${f[a.PRERELEASE]})?${f[a.BUILD]}?)?)?`),w("XRANGEPLAINLOOSE",`[v=\\s]*(${f[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[a.XRANGEIDENTIFIERLOOSE]})(?:${f[a.PRERELEASELOOSE]})?${f[a.BUILD]}?)?)?`),w("XRANGE",`^${f[a.GTLT]}\\s*${f[a.XRANGEPLAIN]}$`),w("XRANGELOOSE",`^${f[a.GTLT]}\\s*${f[a.XRANGEPLAINLOOSE]}$`),w("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),w("COERCE",`${f[a.COERCEPLAIN]}(?:$|[^\\d])`),w("COERCEFULL",f[a.COERCEPLAIN]+`(?:${f[a.PRERELEASE]})?(?:${f[a.BUILD]})?(?:$|[^\\d])`),w("COERCERTL",f[a.COERCE],!0),w("COERCERTLFULL",f[a.COERCEFULL],!0),w("LONETILDE","(?:~>?)"),w("TILDETRIM",`(\\s*)${f[a.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",w("TILDE",`^${f[a.LONETILDE]}${f[a.XRANGEPLAIN]}$`),w("TILDELOOSE",`^${f[a.LONETILDE]}${f[a.XRANGEPLAINLOOSE]}$`),w("LONECARET","(?:\\^)"),w("CARETTRIM",`(\\s*)${f[a.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",w("CARET",`^${f[a.LONECARET]}${f[a.XRANGEPLAIN]}$`),w("CARETLOOSE",`^${f[a.LONECARET]}${f[a.XRANGEPLAINLOOSE]}$`),w("COMPARATORLOOSE",`^${f[a.GTLT]}\\s*(${f[a.LOOSEPLAIN]})$|^$`),w("COMPARATOR",`^${f[a.GTLT]}\\s*(${f[a.FULLPLAIN]})$|^$`),w("COMPARATORTRIM",`(\\s*)${f[a.GTLT]}\\s*(${f[a.LOOSEPLAIN]}|${f[a.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",w("HYPHENRANGE",`^\\s*(${f[a.XRANGEPLAIN]})\\s+-\\s+(${f[a.XRANGEPLAIN]})\\s*$`),w("HYPHENRANGELOOSE",`^\\s*(${f[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${f[a.XRANGEPLAINLOOSE]})\\s*$`),w("STAR","(<|>)?=?\\s*\\*"),w("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),w("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(pr,pr.exports)),pr.exports}var dr,Ts;function Il(){if(Ts)return dr;Ts=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return dr=n=>n?typeof n!="object"?e:n:t,dr}var gr,Us;function Rl(){if(Us)return gr;Us=1;const e=/^[0-9]+$/,t=(n,r)=>{if(typeof n=="number"&&typeof r=="number")return n===r?0:nt(r,n)},gr}var mr,ks;function zu(){if(ks)return mr;ks=1;const e=Ou(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=Vu(),{safeRe:r,t:o}=Nl(),s=Il(),{compareIdentifiers:u}=Rl(),i=(h,a)=>{const p=a.split(".");if(p.length>h.length)return!1;for(let d=0;dt)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",a,p),this.options=p,this.loose=!!p.loose,this.includePrerelease=!!p.includePrerelease;const d=a.trim().match(p.loose?r[o.LOOSE]:r[o.FULL]);if(!d)throw new TypeError(`Invalid Version: ${a}`);if(this.raw=a,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(I=>{if(/^[0-9]+$/.test(I)){const S=+I;if(S>=0&&Sa.major?1:this.minora.minor?1:this.patcha.patch?1:0}comparePre(a){if(a instanceof f||(a=new f(a,this.options)),this.prerelease.length&&!a.prerelease.length)return-1;if(!this.prerelease.length&&a.prerelease.length)return 1;if(!this.prerelease.length&&!a.prerelease.length)return 0;let p=0;do{const d=this.prerelease[p],I=a.prerelease[p];if(e("prerelease compare",p,d,I),d===void 0&&I===void 0)return 0;if(I===void 0)return 1;if(d===void 0)return-1;if(d!==I)return u(d,I)}while(++p)}compareBuild(a){a instanceof f||(a=new f(a,this.options));let p=0;do{const d=this.build[p],I=a.build[p];if(e("build compare",p,d,I),d===void 0&&I===void 0)return 0;if(I===void 0)return 1;if(d===void 0)return-1;if(d!==I)return u(d,I)}while(++p)}inc(a,p,d){if(a.startsWith("pre")){if(!p&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(p){const I=`-${p}`.match(this.options.loose?r[o.PRERELEASELOOSE]:r[o.PRERELEASE]);if(!I||I[1]!==p)throw new Error(`invalid identifier: ${p}`)}}switch(a){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",p,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",p,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",p,d),this.inc("pre",p,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",p,d),this.inc("pre",p,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 I=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[I];else{let S=this.prerelease.length;for(;--S>=0;)typeof this.prerelease[S]=="number"&&(this.prerelease[S]++,S=-2);if(S===-1){if(p===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(I)}}if(p){let S=[p,I];if(d===!1&&(S=[p]),i(this.prerelease,p)){const w=this.prerelease[p.split(".").length];isNaN(w)&&(this.prerelease=S)}else this.prerelease=S}break}default:throw new Error(`invalid increment argument: ${a}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return mr=f,mr}var yr,$s;function xl(){if($s)return yr;$s=1;const e=zu();return yr=(t,n)=>new e(t,n).major,yr}var Pl=xl();const Fs=Qo(Pl);var br,Gs;function Cl(){if(Gs)return br;Gs=1;const e=zu();return br=(t,n,r=!1)=>{if(t instanceof e)return t;try{return new e(t,n)}catch(o){if(!r)return null;throw o}},br}var wr,Os;function Ll(){if(Os)return wr;Os=1;const e=Cl();return wr=(t,n)=>{const r=e(t,n);return r?r.version:null},wr}var Bl=Ll();const jl=Qo(Bl);class Dl{bus;constructor(t){typeof t.getVersion!="function"||!jl(t.getVersion())?console.warn("Proxying an event bus with an unknown or invalid version"):Fs(t.getVersion())!==Fs(this.getVersion())&&console.warn("Proxying an event bus of version "+t.getVersion()+" with "+this.getVersion()),this.bus=t}getVersion(){return"3.3.3"}subscribe(t,n){this.bus.subscribe(t,n)}unsubscribe(t,n){this.bus.unsubscribe(t,n)}emit(t,...n){this.bus.emit(t,...n)}}class Ml{handlers=new Map;getVersion(){return"3.3.3"}subscribe(t,n){this.handlers.set(t,(this.handlers.get(t)||[]).concat(n))}unsubscribe(t,n){this.handlers.set(t,(this.handlers.get(t)||[]).filter(r=>r!==n))}emit(t,...n){(this.handlers.get(t)||[]).forEach(r=>{try{r(n[0])}catch(o){console.error("could not invoke event listener",o)}})}}let bn=null;function Zo(){return bn!==null?bn:typeof window>"u"?new Proxy({},{get:()=>()=>console.error("Window not available, EventBus can not be established!")}):(window.OC?._eventBus&&typeof window._nc_event_bus>"u"&&(console.warn("found old event bus instance at OC._eventBus. Update your version!"),window._nc_event_bus=window.OC._eventBus),typeof window?._nc_event_bus<"u"?bn=new Dl(window._nc_event_bus):bn=window._nc_event_bus=new Ml,bn)}function Wu(e,t){Zo().subscribe(e,t)}function Tl(e,t){Zo().unsubscribe(e,t)}function Yu(e,...t){Zo().emit(e,...t)}const Ul=e=>"/remote.php/"+e;function kl(e,t){return Gl(),$l()+Ul(e)}function $l(){return Hu(),window.location.protocol+"//"+window.location.host+Fl()}function Fl(){Hu();let e=window._oc_webroot;if(typeof e>"u"){e=location.pathname;const t=e.indexOf("/index.php/");if(t!==-1)e=e.slice(0,t);else{const n=e.indexOf("/",1);e=e.slice(0,n>0?n:void 0)}}return e}function Hu(){if(typeof window>"u")throw new Error("This function is only available in a DOM environment")}function Gl(e){if(typeof window>"u")throw new Error("This function requires baseURL option to be provided in non-DOM environments")}class Jn{static GLOBAL_SCOPE_VOLATILE="nextcloud_vol";static GLOBAL_SCOPE_PERSISTENT="nextcloud_per";scope;wrapped;constructor(t,n,r){this.scope=`${r?Jn.GLOBAL_SCOPE_PERSISTENT:Jn.GLOBAL_SCOPE_VOLATILE}_${btoa(t)}_`,this.wrapped=n}scopeKey(t){return`${this.scope}${t}`}setItem(t,n){this.wrapped.setItem(this.scopeKey(t),n)}getItem(t){return this.wrapped.getItem(this.scopeKey(t))}removeItem(t){this.wrapped.removeItem(this.scopeKey(t))}clear(){Object.keys(this.wrapped).filter(t=>t.startsWith(this.scope)).map(this.wrapped.removeItem.bind(this.wrapped))}}class Ol{appId;persisted=!1;clearedOnLogout=!1;constructor(t){this.appId=t}persist(t=!0){return this.persisted=t,this}clearOnLogout(t=!0){return this.clearedOnLogout=t,this}build(){return new Jn(this.appId,this.persisted?window.localStorage:window.sessionStorage,!this.clearedOnLogout)}}function Vl(e){return new Ol(e)}Hl();function zl(){return globalThis._nc_auth_requestToken?globalThis._nc_auth_requestToken:globalThis.document?document.head.dataset.requesttoken??null:null}function Wl(e){if(!e||typeof e!="string")throw new Error("Invalid CSRF token given",{cause:{token:e}});globalThis._nc_auth_requestToken!==e&&(globalThis._nc_auth_requestToken=e,globalThis.document&&(document.head.dataset.requesttoken=e),Yu("csrf-token-update",{token:e,_internal:!0}))}function Yl(e){const t=async({token:n})=>{try{e(n)}catch(r){console.error("Error updating CSRF token observer",r)}};return Wu("csrf-token-update",t),()=>Tl("csrf-token-update",t)}function Hl(){Wu("csrf-token-update",({token:e,_internal:t})=>{t||Wl(e)})}Vl("public").persist().build();let en;function Vs(e,t){return e?e.getAttribute(t):null}function Ko(){if(en!==void 0)return en;const e=document?.getElementsByTagName("head")[0];if(!e)return null;const t=Vs(e,"data-user");return t===null?(en=null,en):(en={uid:t,displayName:Vs(e,"data-user-displayname"),isAdmin:!!window._oc_isadmin},en)}var qt=(e=>(e[e.Debug=0]="Debug",e[e.Info=1]="Info",e[e.Warn=2]="Warn",e[e.Error=3]="Error",e[e.Fatal=4]="Fatal",e))(qt||{});class Xl{context;constructor(t){this.context=t||{}}formatMessage(t,n,r){let o="["+qt[n].toUpperCase()+"] ";return r&&r.app&&(o+=r.app+": "),typeof t=="string"?o+t:(o+=`Unexpected ${t.name}`,t.message&&(o+=` "${t.message}"`),n===qt.Debug&&t.stack&&(o+=` Stack trace: ${t.stack}`),o)}log(t,n,r){if(!(typeof this.context?.level=="number"&&t{document.readyState==="complete"||document.readyState==="interactive"?(t.context.level=window._oc_config?.loglevel??qt.Warn,window._oc_debug&&(t.context.level=qt.Debug),document.removeEventListener("readystatechange",n)):document.addEventListener("readystatechange",n)};return n(),this}build(){return this.context.level===void 0&&this.detectLogLevel(),this.factory(this.context)}}function Ql(){return new ql(Jl)}function zs(e){return e&&e.split("/").map(encodeURIComponent).join("/")}function Xu(e,t){return e=e.replace(/\\/g,"/").replace(/\/+$/g,"").replace(/.*\//,""),e}function Ws(e){e=e.replaceAll(/\\/g,"/");const t=e.split("/");return t.length<=1?".":(t.pop(),t.length===1&&t[0]===""?"/":t.join("/"))}function Zl(e){const t=Xu(e),n=t.lastIndexOf(".");return n>0?t.substring(n):""}function Kl(...e){if(arguments.length<1)return"";const t=e.filter(f=>f.length>0);if(t.length<1)return"";const n=t[t.length-1],r=t[0].charAt(0)==="/",o=n.charAt(n.length-1)==="/",s=t.reduce((f,h)=>f.concat(h.split("/")),[]);let u=!r;const i=s.reduce((f,h)=>h===""?f:u?(u=!1,f+h):f+"/"+h,"");return o?i+"/":i}window._nc_files_scope??={},window._nc_files_scope.v4_0??={};const Ot=window._nc_files_scope.v4_0,Ge=Ql().setApp("@nextcloud/files").detectUser().build(),Ju=Object.freeze({Folder:"folder",File:"file"}),Ee=Object.freeze({NONE:0,READ:1,UPDATE:2,CREATE:4,WRITE:4,DELETE:8,SHARE:16,ALL:31}),qu=Object.freeze({NEW:"new",FAILED:"failed",LOADING:"loading",LOCKED:"locked"});function Qu(e,t){return e.match(t)!==null}function ke(e,t){if(e.id&&typeof e.id!="number"&&typeof e.id!="string")throw new Error("Invalid id type of value");if(!e.source)throw new Error("Missing mandatory source");try{new URL(e.source)}catch{throw new Error("Invalid source format, source must be a valid URL")}if(!e.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(!e.root)throw new Error("Missing mandatory root");if(typeof e.root!="string")throw new Error("Invalid root type");if(!e.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(!e.source.includes(e.root))throw new Error("Root must be part of the source");if(Qu(e.source,t)){const n=e.source.match(t)[0];if(!e.source.includes(Kl(n,e.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(e.displayname&&typeof e.displayname!="string")throw new Error("Invalid displayname type");if(e.mtime&&!(e.mtime instanceof Date))throw new Error("Invalid mtime type");if(e.crtime&&!(e.crtime instanceof Date))throw new Error("Invalid crtime type");if(!e.mime||typeof e.mime!="string"||!e.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in e&&typeof e.size!="number"&&e.size!==void 0)throw new Error("Invalid size type");if("permissions"in e&&e.permissions!==void 0&&!(typeof e.permissions=="number"&&e.permissions>=Ee.NONE&&e.permissions<=Ee.ALL))throw new Error("Invalid permissions");if(e.owner&&e.owner!==null&&typeof e.owner!="string")throw new Error("Invalid owner type");if(e.attributes&&typeof e.attributes!="object")throw new Error("Invalid attributes type");if(e.status&&!Object.values(qu).includes(e.status))throw new Error("Status must be a valid NodeStatus")}function tf(e){e.mtime&&typeof e.mtime=="string"&&!isNaN(Date.parse(e.mtime))&&JSON.stringify(new Date(e.mtime))===JSON.stringify(e.mtime)&&(e.mtime=new Date(e.mtime)),e.crtime&&typeof e.crtime=="string"&&!isNaN(Date.parse(e.crtime))&&JSON.stringify(new Date(e.crtime))===JSON.stringify(e.crtime)&&(e.crtime=new Date(e.crtime))}function ef(e){if(e instanceof RegExp)return e;const t=e.match(/(\/?)(.+)\1([a-z]*)/i);if(!t)throw new Error("Invalid regular expression format.");const n=Array.from(new Set(t[3])).filter(r=>"gimsuy".includes(r)).join("");return new RegExp(t[2],n)}class nr{_attributes;_data;_knownDavService=/(remote|public)\.php\/(web)?dav/i;readonlyAttributes=Object.entries(Object.getOwnPropertyDescriptors(nr.prototype)).filter(t=>typeof t[1].get=="function"&&t[0]!=="__proto__").map(t=>t[0]);handler={set:(t,n,r)=>this.readonlyAttributes.includes(n)?!1:Reflect.set(t,n,r),deleteProperty:(t,n)=>this.readonlyAttributes.includes(n)?!1:Reflect.deleteProperty(t,n)};constructor(...[t,n]){t.mime||(t.mime="application/octet-stream"),tf(t),n=ef(n||this._knownDavService),ke(t,n),this._data={...t,attributes:{}},this._attributes=new Proxy(this._data.attributes,this.handler),this.update(t.attributes??{}),n&&(this._knownDavService=n)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:t}=new URL(this.source);return t+zs(this.source.slice(t.length))}get basename(){return Xu(this.source)}get displayname(){return this._data.displayname||this.basename}set displayname(t){ke({...this._data,displayname:t},this._knownDavService),this._data.displayname=t}get extension(){return Zl(this.source)}get dirname(){return Ws(this.path)}get mime(){return this._data.mime||"application/octet-stream"}set mime(t){t??="application/octet-stream",ke({...this._data,mime:t},this._knownDavService),this._data.mime=t}get mtime(){return this._data.mtime}set mtime(t){ke({...this._data,mtime:t},this._knownDavService),this._data.mtime=t}get crtime(){return this._data.crtime}get size(){return this._data.size}set size(t){ke({...this._data,size:t},this._knownDavService),this.updateMtime(),this._data.size=t}get attributes(){return this._attributes}get permissions(){return this.owner===null&&!this.isDavResource?Ee.READ:this._data.permissions!==void 0?this._data.permissions:Ee.NONE}set permissions(t){ke({...this._data,permissions:t},this._knownDavService),this.updateMtime(),this._data.permissions=t}get owner(){return this.isDavResource?this._data.owner:null}get isDavResource(){return Qu(this.source,this._knownDavService)}get root(){return this._data.root.replace(/^(.+)\/$/,"$1")}get path(){const t=this.source.indexOf("://"),n=this.source.slice(0,t),r=this.source.slice(t+3),o=r.indexOf("/"),s=r.slice(0,o),u=r.slice(o),i=`${n}://${s}${zs(u)}`,f=new URL(i);let h=decodeURIComponent(f.pathname);this.isDavResource&&(h=h.split(this._knownDavService).pop());const a=h.indexOf(this.root),p=this.root.replace(/\/$/,"");return h.slice(a+p.length)||"/"}get fileid(){return typeof this._data?.id=="number"?this._data.id:void 0}get id(){if(!(typeof this._data?.id>"u"||typeof this._data.id=="number"&&this._data.id<0))return String(this._data.id)}get status(){return this._data?.status}set status(t){ke({...this._data,status:t},this._knownDavService),this._data.status=t}move(t){ke({...this._data,source:t},this._knownDavService);const n=this.basename;this._data.source=t,this.displayname===n&&this.basename!==n&&(this.displayname=this.basename)}rename(t){if(t.includes("/"))throw new Error("Invalid basename");this.move(Ws(this.source)+"/"+t)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}update(t){for(const[n,r]of Object.entries(t))try{r===void 0?delete this.attributes[n]:this.attributes[n]=r}catch(o){if(o instanceof TypeError)continue;throw o}}clone(){return new this.constructor(structuredClone(this._data),this._knownDavService)}toJSON(){return JSON.stringify([structuredClone(this._data),this._knownDavService.toString()])}}class nf extends nr{constructor(...[t,n]){super(t,n)}get type(){return Ju.File}}class rf extends nr{constructor(...[t,n]){super({...t,mime:"httpd/unix-directory"},n)}get type(){return Ju.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}}var of=class extends EventTarget{dispatchTypedEvent(e,t){return super.dispatchEvent(t)}},Zu={},Xn={};Xn.byteLength=uf,Xn.toByteArray=lf,Xn.fromByteArray=pf;for(var je=[],Ne=[],sf=typeof Uint8Array<"u"?Uint8Array:Array,vr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",nn=0,af=vr.length;nn0)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 uf(e){var t=Ku(e),n=t[0],r=t[1];return(n+r)*3/4-r}function cf(e,t,n){return(t+n)*3/4-n}function lf(e){var t,n=Ku(e),r=n[0],o=n[1],s=new sf(cf(e,r,o)),u=0,i=o>0?r-4:r,f;for(f=0;f>16&255,s[u++]=t>>8&255,s[u++]=t&255;return o===2&&(t=Ne[e.charCodeAt(f)]<<2|Ne[e.charCodeAt(f+1)]>>4,s[u++]=t&255),o===1&&(t=Ne[e.charCodeAt(f)]<<10|Ne[e.charCodeAt(f+1)]<<4|Ne[e.charCodeAt(f+2)]>>2,s[u++]=t>>8&255,s[u++]=t&255),s}function ff(e){return je[e>>18&63]+je[e>>12&63]+je[e>>6&63]+je[e&63]}function hf(e,t,n){for(var r,o=[],s=t;si?i:u+s));return r===1?(t=e[n-1],o.push(je[t>>2]+je[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(je[t>>10]+je[t>>4&63]+je[t<<2&63]+"=")),o.join("")}var Uo={};Uo.read=function(e,t,n,r,o){var s,u,i=o*8-r-1,f=(1<>1,a=-7,p=n?o-1:0,d=n?-1:1,I=e[t+p];for(p+=d,s=I&(1<<-a)-1,I>>=-a,a+=i;a>0;s=s*256+e[t+p],p+=d,a-=8);for(u=s&(1<<-a)-1,s>>=-a,a+=r;a>0;u=u*256+e[t+p],p+=d,a-=8);if(s===0)s=1-h;else{if(s===f)return u?NaN:(I?-1:1)*(1/0);u=u+Math.pow(2,r),s=s-h}return(I?-1:1)*u*Math.pow(2,s-r)},Uo.write=function(e,t,n,r,o,s){var u,i,f,h=s*8-o-1,a=(1<>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=r?0:s-1,S=r?1:-1,w=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,u=a):(u=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-u))<1&&(u--,f*=2),u+p>=1?t+=d/f:t+=d*Math.pow(2,1-p),t*f>=2&&(u++,f/=2),u+p>=a?(i=0,u=a):u+p>=1?(i=(t*f-1)*Math.pow(2,o),u=u+p):(i=t*Math.pow(2,p-1)*Math.pow(2,o),u=0));o>=8;e[n+I]=i&255,I+=S,i/=256,o-=8);for(u=u<0;e[n+I]=u&255,I+=S,u/=256,h-=8);e[n+I-S]|=w*128};(function(e){const t=Xn,n=Uo,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=P,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o;const{Uint8Array:s,ArrayBuffer:u,SharedArrayBuffer:i}=globalThis;a.TYPED_ARRAY_SUPPORT=f(),!a.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 f(){try{const c=new s(1),g={foo:function(){return 42}};return Object.setPrototypeOf(g,s.prototype),Object.setPrototypeOf(c,g),c.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function h(c){if(c>o)throw new RangeError('The value "'+c+'" is invalid for option "size"');const g=new s(c);return Object.setPrototypeOf(g,a.prototype),g}function a(c,g,_){if(typeof c=="number"){if(typeof g=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return S(c)}return p(c,g,_)}a.poolSize=8192;function p(c,g,_){if(typeof c=="string")return w(c,g);if(u.isView(c))return v(c);if(c==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof c);if(Wt(c,u)||c&&Wt(c.buffer,u)||typeof i<"u"&&(Wt(c,i)||c&&Wt(c.buffer,i)))return E(c,g,_);if(typeof c=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const $=c.valueOf&&c.valueOf();if($!=null&&$!==c)return a.from($,g,_);const V=x(c);if(V)return V;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof c[Symbol.toPrimitive]=="function")return a.from(c[Symbol.toPrimitive]("string"),g,_);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof c)}a.from=function(c,g,_){return p(c,g,_)},Object.setPrototypeOf(a.prototype,s.prototype),Object.setPrototypeOf(a,s);function d(c){if(typeof c!="number")throw new TypeError('"size" argument must be of type number');if(c<0)throw new RangeError('The value "'+c+'" is invalid for option "size"')}function I(c,g,_){return d(c),c<=0?h(c):g!==void 0?typeof _=="string"?h(c).fill(g,_):h(c).fill(g):h(c)}a.alloc=function(c,g,_){return I(c,g,_)};function S(c){return d(c),h(c<0?0:N(c)|0)}a.allocUnsafe=function(c){return S(c)},a.allocUnsafeSlow=function(c){return S(c)};function w(c,g){if((typeof g!="string"||g==="")&&(g="utf8"),!a.isEncoding(g))throw new TypeError("Unknown encoding: "+g);const _=M(c,g)|0;let $=h(_);const V=$.write(c,g);return V!==_&&($=$.slice(0,V)),$}function R(c){const g=c.length<0?0:N(c.length)|0,_=h(g);for(let $=0;$=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return c|0}function P(c){return+c!=c&&(c=0),a.alloc(+c)}a.isBuffer=function(c){return c!=null&&c._isBuffer===!0&&c!==a.prototype},a.compare=function(c,g){if(Wt(c,s)&&(c=a.from(c,c.offset,c.byteLength)),Wt(g,s)&&(g=a.from(g,g.offset,g.byteLength)),!a.isBuffer(c)||!a.isBuffer(g))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(c===g)return 0;let _=c.length,$=g.length;for(let V=0,Z=Math.min(_,$);V$.length?(a.isBuffer(Z)||(Z=a.from(Z)),Z.copy($,V)):s.prototype.set.call($,Z,V);else if(a.isBuffer(Z))Z.copy($,V);else throw new TypeError('"list" argument must be an Array of Buffers');V+=Z.length}return $};function M(c,g){if(a.isBuffer(c))return c.length;if(u.isView(c)||Wt(c,u))return c.byteLength;if(typeof c!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof c);const _=c.length,$=arguments.length>2&&arguments[2]===!0;if(!$&&_===0)return 0;let V=!1;for(;;)switch(g){case"ascii":case"latin1":case"binary":return _;case"utf8":case"utf-8":return wt(c).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _*2;case"hex":return _>>>1;case"base64":return gt(c).length;default:if(V)return $?-1:wt(c).length;g=(""+g).toLowerCase(),V=!0}}a.byteLength=M;function F(c,g,_){let $=!1;if((g===void 0||g<0)&&(g=0),g>this.length||((_===void 0||_>this.length)&&(_=this.length),_<=0)||(_>>>=0,g>>>=0,_<=g))return"";for(c||(c="utf8");;)switch(c){case"hex":return ft(this,g,_);case"utf8":case"utf-8":return lt(this,g,_);case"ascii":return yt(this,g,_);case"latin1":case"binary":return Tt(this,g,_);case"base64":return Et(this,g,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,g,_);default:if($)throw new TypeError("Unknown encoding: "+c);c=(c+"").toLowerCase(),$=!0}}a.prototype._isBuffer=!0;function O(c,g,_){const $=c[g];c[g]=c[_],c[_]=$}a.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 g=0;gg&&(c+=" ... "),""},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(c,g,_,$,V){if(Wt(c,s)&&(c=a.from(c,c.offset,c.byteLength)),!a.isBuffer(c))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof c);if(g===void 0&&(g=0),_===void 0&&(_=c?c.length:0),$===void 0&&($=0),V===void 0&&(V=this.length),g<0||_>c.length||$<0||V>this.length)throw new RangeError("out of range index");if($>=V&&g>=_)return 0;if($>=V)return-1;if(g>=_)return 1;if(g>>>=0,_>>>=0,$>>>=0,V>>>=0,this===c)return 0;let Z=V-$,at=_-g;const xt=Math.min(Z,at),Ft=this.slice($,V),Ct=c.slice(g,_);for(let Rt=0;Rt2147483647?_=2147483647:_<-2147483648&&(_=-2147483648),_=+_,ne(_)&&(_=V?0:c.length-1),_<0&&(_=c.length+_),_>=c.length){if(V)return-1;_=c.length-1}else if(_<0)if(V)_=0;else return-1;if(typeof g=="string"&&(g=a.from(g,$)),a.isBuffer(g))return g.length===0?-1:j(c,g,_,$,V);if(typeof g=="number")return g=g&255,typeof s.prototype.indexOf=="function"?V?s.prototype.indexOf.call(c,g,_):s.prototype.lastIndexOf.call(c,g,_):j(c,[g],_,$,V);throw new TypeError("val must be string, number or Buffer")}function j(c,g,_,$,V){let Z=1,at=c.length,xt=g.length;if($!==void 0&&($=String($).toLowerCase(),$==="ucs2"||$==="ucs-2"||$==="utf16le"||$==="utf-16le")){if(c.length<2||g.length<2)return-1;Z=2,at/=2,xt/=2,_/=2}function Ft(Rt,Dt){return Z===1?Rt[Dt]:Rt.readUInt16BE(Dt*Z)}let Ct;if(V){let Rt=-1;for(Ct=_;Ctat&&(_=at-xt),Ct=_;Ct>=0;Ct--){let Rt=!0;for(let Dt=0;DtV&&($=V)):$=V;const Z=g.length;$>Z/2&&($=Z/2);let at;for(at=0;at<$;++at){const xt=parseInt(g.substr(at*2,2),16);if(ne(xt))return at;c[_+at]=xt}return at}function G(c,g,_,$){return Ut(wt(g,c.length-_),c,_,$)}function rt(c,g,_,$){return Ut(Bt(g),c,_,$)}function pt(c,g,_,$){return Ut(gt(g),c,_,$)}function At(c,g,_,$){return Ut(dt(g,c.length-_),c,_,$)}a.prototype.write=function(c,g,_,$){if(g===void 0)$="utf8",_=this.length,g=0;else if(_===void 0&&typeof g=="string")$=g,_=this.length,g=0;else if(isFinite(g))g=g>>>0,isFinite(_)?(_=_>>>0,$===void 0&&($="utf8")):($=_,_=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const V=this.length-g;if((_===void 0||_>V)&&(_=V),c.length>0&&(_<0||g<0)||g>this.length)throw new RangeError("Attempt to write outside buffer bounds");$||($="utf8");let Z=!1;for(;;)switch($){case"hex":return ct(this,c,g,_);case"utf8":case"utf-8":return G(this,c,g,_);case"ascii":case"latin1":case"binary":return rt(this,c,g,_);case"base64":return pt(this,c,g,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return At(this,c,g,_);default:if(Z)throw new TypeError("Unknown encoding: "+$);$=(""+$).toLowerCase(),Z=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Et(c,g,_){return g===0&&_===c.length?t.fromByteArray(c):t.fromByteArray(c.slice(g,_))}function lt(c,g,_){_=Math.min(c.length,_);const $=[];let V=g;for(;V<_;){const Z=c[V];let at=null,xt=Z>239?4:Z>223?3:Z>191?2:1;if(V+xt<=_){let Ft,Ct,Rt,Dt;switch(xt){case 1:Z<128&&(at=Z);break;case 2:Ft=c[V+1],(Ft&192)===128&&(Dt=(Z&31)<<6|Ft&63,Dt>127&&(at=Dt));break;case 3:Ft=c[V+1],Ct=c[V+2],(Ft&192)===128&&(Ct&192)===128&&(Dt=(Z&15)<<12|(Ft&63)<<6|Ct&63,Dt>2047&&(Dt<55296||Dt>57343)&&(at=Dt));break;case 4:Ft=c[V+1],Ct=c[V+2],Rt=c[V+3],(Ft&192)===128&&(Ct&192)===128&&(Rt&192)===128&&(Dt=(Z&15)<<18|(Ft&63)<<12|(Ct&63)<<6|Rt&63,Dt>65535&&Dt<1114112&&(at=Dt))}}at===null?(at=65533,xt=1):at>65535&&(at-=65536,$.push(at>>>10&1023|55296),at=56320|at&1023),$.push(at),V+=xt}return Nt($)}const mt=4096;function Nt(c){const g=c.length;if(g<=mt)return String.fromCharCode.apply(String,c);let _="",$=0;for(;$$)&&(_=$);let V="";for(let Z=g;Z<_;++Z)V+=$t[c[Z]];return V}function z(c,g,_){const $=c.slice(g,_);let V="";for(let Z=0;Z<$.length-1;Z+=2)V+=String.fromCharCode($[Z]+$[Z+1]*256);return V}a.prototype.slice=function(c,g){const _=this.length;c=~~c,g=g===void 0?_:~~g,c<0?(c+=_,c<0&&(c=0)):c>_&&(c=_),g<0?(g+=_,g<0&&(g=0)):g>_&&(g=_),g_)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(c,g,_){c=c>>>0,g=g>>>0,_||H(c,g,this.length);let $=this[c],V=1,Z=0;for(;++Z>>0,g=g>>>0,_||H(c,g,this.length);let $=this[c+--g],V=1;for(;g>0&&(V*=256);)$+=this[c+--g]*V;return $},a.prototype.readUint8=a.prototype.readUInt8=function(c,g){return c=c>>>0,g||H(c,1,this.length),this[c]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(c,g){return c=c>>>0,g||H(c,2,this.length),this[c]|this[c+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(c,g){return c=c>>>0,g||H(c,2,this.length),this[c]<<8|this[c+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(c,g){return c=c>>>0,g||H(c,4,this.length),(this[c]|this[c+1]<<8|this[c+2]<<16)+this[c+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(c,g){return c=c>>>0,g||H(c,4,this.length),this[c]*16777216+(this[c+1]<<16|this[c+2]<<8|this[c+3])},a.prototype.readBigUInt64LE=Pt(function(c){c=c>>>0,D(c,"offset");const g=this[c],_=this[c+7];(g===void 0||_===void 0)&&ot(c,this.length-8);const $=g+this[++c]*2**8+this[++c]*2**16+this[++c]*2**24,V=this[++c]+this[++c]*2**8+this[++c]*2**16+_*2**24;return BigInt($)+(BigInt(V)<>>0,D(c,"offset");const g=this[c],_=this[c+7];(g===void 0||_===void 0)&&ot(c,this.length-8);const $=g*2**24+this[++c]*2**16+this[++c]*2**8+this[++c],V=this[++c]*2**24+this[++c]*2**16+this[++c]*2**8+_;return(BigInt($)<>>0,g=g>>>0,_||H(c,g,this.length);let $=this[c],V=1,Z=0;for(;++Z=V&&($-=Math.pow(2,8*g)),$},a.prototype.readIntBE=function(c,g,_){c=c>>>0,g=g>>>0,_||H(c,g,this.length);let $=g,V=1,Z=this[c+--$];for(;$>0&&(V*=256);)Z+=this[c+--$]*V;return V*=128,Z>=V&&(Z-=Math.pow(2,8*g)),Z},a.prototype.readInt8=function(c,g){return c=c>>>0,g||H(c,1,this.length),this[c]&128?(255-this[c]+1)*-1:this[c]},a.prototype.readInt16LE=function(c,g){c=c>>>0,g||H(c,2,this.length);const _=this[c]|this[c+1]<<8;return _&32768?_|4294901760:_},a.prototype.readInt16BE=function(c,g){c=c>>>0,g||H(c,2,this.length);const _=this[c+1]|this[c]<<8;return _&32768?_|4294901760:_},a.prototype.readInt32LE=function(c,g){return c=c>>>0,g||H(c,4,this.length),this[c]|this[c+1]<<8|this[c+2]<<16|this[c+3]<<24},a.prototype.readInt32BE=function(c,g){return c=c>>>0,g||H(c,4,this.length),this[c]<<24|this[c+1]<<16|this[c+2]<<8|this[c+3]},a.prototype.readBigInt64LE=Pt(function(c){c=c>>>0,D(c,"offset");const g=this[c],_=this[c+7];(g===void 0||_===void 0)&&ot(c,this.length-8);const $=this[c+4]+this[c+5]*2**8+this[c+6]*2**16+(_<<24);return(BigInt($)<>>0,D(c,"offset");const g=this[c],_=this[c+7];(g===void 0||_===void 0)&&ot(c,this.length-8);const $=(g<<24)+this[++c]*2**16+this[++c]*2**8+this[++c];return(BigInt($)<>>0,g||H(c,4,this.length),n.read(this,c,!0,23,4)},a.prototype.readFloatBE=function(c,g){return c=c>>>0,g||H(c,4,this.length),n.read(this,c,!1,23,4)},a.prototype.readDoubleLE=function(c,g){return c=c>>>0,g||H(c,8,this.length),n.read(this,c,!0,52,8)},a.prototype.readDoubleBE=function(c,g){return c=c>>>0,g||H(c,8,this.length),n.read(this,c,!1,52,8)};function Q(c,g,_,$,V,Z){if(!a.isBuffer(c))throw new TypeError('"buffer" argument must be a Buffer instance');if(g>V||gc.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(c,g,_,$){if(c=+c,g=g>>>0,_=_>>>0,!$){const at=Math.pow(2,8*_)-1;Q(this,c,g,_,at,0)}let V=1,Z=0;for(this[g]=c&255;++Z<_&&(V*=256);)this[g+Z]=c/V&255;return g+_},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(c,g,_,$){if(c=+c,g=g>>>0,_=_>>>0,!$){const at=Math.pow(2,8*_)-1;Q(this,c,g,_,at,0)}let V=_-1,Z=1;for(this[g+V]=c&255;--V>=0&&(Z*=256);)this[g+V]=c/Z&255;return g+_},a.prototype.writeUint8=a.prototype.writeUInt8=function(c,g,_){return c=+c,g=g>>>0,_||Q(this,c,g,1,255,0),this[g]=c&255,g+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(c,g,_){return c=+c,g=g>>>0,_||Q(this,c,g,2,65535,0),this[g]=c&255,this[g+1]=c>>>8,g+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(c,g,_){return c=+c,g=g>>>0,_||Q(this,c,g,2,65535,0),this[g]=c>>>8,this[g+1]=c&255,g+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(c,g,_){return c=+c,g=g>>>0,_||Q(this,c,g,4,4294967295,0),this[g+3]=c>>>24,this[g+2]=c>>>16,this[g+1]=c>>>8,this[g]=c&255,g+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(c,g,_){return c=+c,g=g>>>0,_||Q(this,c,g,4,4294967295,0),this[g]=c>>>24,this[g+1]=c>>>16,this[g+2]=c>>>8,this[g+3]=c&255,g+4};function T(c,g,_,$,V){k(g,$,V,c,_,7);let Z=Number(g&BigInt(4294967295));c[_++]=Z,Z=Z>>8,c[_++]=Z,Z=Z>>8,c[_++]=Z,Z=Z>>8,c[_++]=Z;let at=Number(g>>BigInt(32)&BigInt(4294967295));return c[_++]=at,at=at>>8,c[_++]=at,at=at>>8,c[_++]=at,at=at>>8,c[_++]=at,_}function Y(c,g,_,$,V){k(g,$,V,c,_,7);let Z=Number(g&BigInt(4294967295));c[_+7]=Z,Z=Z>>8,c[_+6]=Z,Z=Z>>8,c[_+5]=Z,Z=Z>>8,c[_+4]=Z;let at=Number(g>>BigInt(32)&BigInt(4294967295));return c[_+3]=at,at=at>>8,c[_+2]=at,at=at>>8,c[_+1]=at,at=at>>8,c[_]=at,_+8}a.prototype.writeBigUInt64LE=Pt(function(c,g=0){return T(this,c,g,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Pt(function(c,g=0){return Y(this,c,g,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(c,g,_,$){if(c=+c,g=g>>>0,!$){const xt=Math.pow(2,8*_-1);Q(this,c,g,_,xt-1,-xt)}let V=0,Z=1,at=0;for(this[g]=c&255;++V<_&&(Z*=256);)c<0&&at===0&&this[g+V-1]!==0&&(at=1),this[g+V]=(c/Z>>0)-at&255;return g+_},a.prototype.writeIntBE=function(c,g,_,$){if(c=+c,g=g>>>0,!$){const xt=Math.pow(2,8*_-1);Q(this,c,g,_,xt-1,-xt)}let V=_-1,Z=1,at=0;for(this[g+V]=c&255;--V>=0&&(Z*=256);)c<0&&at===0&&this[g+V+1]!==0&&(at=1),this[g+V]=(c/Z>>0)-at&255;return g+_},a.prototype.writeInt8=function(c,g,_){return c=+c,g=g>>>0,_||Q(this,c,g,1,127,-128),c<0&&(c=255+c+1),this[g]=c&255,g+1},a.prototype.writeInt16LE=function(c,g,_){return c=+c,g=g>>>0,_||Q(this,c,g,2,32767,-32768),this[g]=c&255,this[g+1]=c>>>8,g+2},a.prototype.writeInt16BE=function(c,g,_){return c=+c,g=g>>>0,_||Q(this,c,g,2,32767,-32768),this[g]=c>>>8,this[g+1]=c&255,g+2},a.prototype.writeInt32LE=function(c,g,_){return c=+c,g=g>>>0,_||Q(this,c,g,4,2147483647,-2147483648),this[g]=c&255,this[g+1]=c>>>8,this[g+2]=c>>>16,this[g+3]=c>>>24,g+4},a.prototype.writeInt32BE=function(c,g,_){return c=+c,g=g>>>0,_||Q(this,c,g,4,2147483647,-2147483648),c<0&&(c=4294967295+c+1),this[g]=c>>>24,this[g+1]=c>>>16,this[g+2]=c>>>8,this[g+3]=c&255,g+4},a.prototype.writeBigInt64LE=Pt(function(c,g=0){return T(this,c,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Pt(function(c,g=0){return Y(this,c,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function K(c,g,_,$,V,Z){if(_+$>c.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("Index out of range")}function nt(c,g,_,$,V){return g=+g,_=_>>>0,V||K(c,g,_,4),n.write(c,g,_,$,23,4),_+4}a.prototype.writeFloatLE=function(c,g,_){return nt(this,c,g,!0,_)},a.prototype.writeFloatBE=function(c,g,_){return nt(this,c,g,!1,_)};function st(c,g,_,$,V){return g=+g,_=_>>>0,V||K(c,g,_,8),n.write(c,g,_,$,52,8),_+8}a.prototype.writeDoubleLE=function(c,g,_){return st(this,c,g,!0,_)},a.prototype.writeDoubleBE=function(c,g,_){return st(this,c,g,!1,_)},a.prototype.copy=function(c,g,_,$){if(!a.isBuffer(c))throw new TypeError("argument should be a Buffer");if(_||(_=0),!$&&$!==0&&($=this.length),g>=c.length&&(g=c.length),g||(g=0),$>0&&$<_&&($=_),$===_||c.length===0||this.length===0)return 0;if(g<0)throw new RangeError("targetStart out of bounds");if(_<0||_>=this.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("sourceEnd out of bounds");$>this.length&&($=this.length),c.length-g<$-_&&($=c.length-g+_);const V=$-_;return this===c&&typeof s.prototype.copyWithin=="function"?this.copyWithin(g,_,$):s.prototype.set.call(c,this.subarray(_,$),g),V},a.prototype.fill=function(c,g,_,$){if(typeof c=="string"){if(typeof g=="string"?($=g,g=0,_=this.length):typeof _=="string"&&($=_,_=this.length),$!==void 0&&typeof $!="string")throw new TypeError("encoding must be a string");if(typeof $=="string"&&!a.isEncoding($))throw new TypeError("Unknown encoding: "+$);if(c.length===1){const Z=c.charCodeAt(0);($==="utf8"&&Z<128||$==="latin1")&&(c=Z)}}else typeof c=="number"?c=c&255:typeof c=="boolean"&&(c=Number(c));if(g<0||this.length>>0,_=_===void 0?this.length:_>>>0,c||(c=0);let V;if(typeof c=="number")for(V=g;V<_;++V)this[V]=c;else{const Z=a.isBuffer(c)?c:a.from(c,$),at=Z.length;if(at===0)throw new TypeError('The value "'+c+'" is invalid for argument "value"');for(V=0;V<_-g;++V)this[V+g]=Z[V%at]}return this};const L={};function B(c,g,_){L[c]=class extends _{constructor(){super(),Object.defineProperty(this,"message",{value:g.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${c}]`,this.stack,delete this.name}get code(){return c}set code($){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:$,writable:!0})}toString(){return`${this.name} [${c}]: ${this.message}`}}}B("ERR_BUFFER_OUT_OF_BOUNDS",function(c){return c?`${c} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),B("ERR_INVALID_ARG_TYPE",function(c,g){return`The "${c}" argument must be of type number. Received type ${typeof g}`},TypeError),B("ERR_OUT_OF_RANGE",function(c,g,_){let $=`The value of "${c}" is out of range.`,V=_;return Number.isInteger(_)&&Math.abs(_)>2**32?V=b(String(_)):typeof _=="bigint"&&(V=String(_),(_>BigInt(2)**BigInt(32)||_<-(BigInt(2)**BigInt(32)))&&(V=b(V)),V+="n"),$+=` It must be ${g}. Received ${V}`,$},RangeError);function b(c){let g="",_=c.length;const $=c[0]==="-"?1:0;for(;_>=$+4;_-=3)g=`_${c.slice(_-3,_)}${g}`;return`${c.slice(0,_)}${g}`}function y(c,g,_){D(g,"offset"),(c[g]===void 0||c[g+_]===void 0)&&ot(g,c.length-(_+1))}function k(c,g,_,$,V,Z){if(c>_||c= 0${at} and < 2${at} ** ${(Z+1)*8}${at}`:xt=`>= -(2${at} ** ${(Z+1)*8-1}${at}) and < 2 ** ${(Z+1)*8-1}${at}`,new L.ERR_OUT_OF_RANGE("value",xt,c)}y($,V,Z)}function D(c,g){if(typeof c!="number")throw new L.ERR_INVALID_ARG_TYPE(g,"number",c)}function ot(c,g,_){throw Math.floor(c)!==c?(D(c,_),new L.ERR_OUT_OF_RANGE("offset","an integer",c)):g<0?new L.ERR_BUFFER_OUT_OF_BOUNDS:new L.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${g}`,c)}const _t=/[^+/0-9A-Za-z-_]/g;function X(c){if(c=c.split("=")[0],c=c.trim().replace(_t,""),c.length<2)return"";for(;c.length%4!==0;)c=c+"=";return c}function wt(c,g){g=g||1/0;let _;const $=c.length;let V=null;const Z=[];for(let at=0;at<$;++at){if(_=c.charCodeAt(at),_>55295&&_<57344){if(!V){if(_>56319){(g-=3)>-1&&Z.push(239,191,189);continue}else if(at+1===$){(g-=3)>-1&&Z.push(239,191,189);continue}V=_;continue}if(_<56320){(g-=3)>-1&&Z.push(239,191,189),V=_;continue}_=(V-55296<<10|_-56320)+65536}else V&&(g-=3)>-1&&Z.push(239,191,189);if(V=null,_<128){if((g-=1)<0)break;Z.push(_)}else if(_<2048){if((g-=2)<0)break;Z.push(_>>6|192,_&63|128)}else if(_<65536){if((g-=3)<0)break;Z.push(_>>12|224,_>>6&63|128,_&63|128)}else if(_<1114112){if((g-=4)<0)break;Z.push(_>>18|240,_>>12&63|128,_>>6&63|128,_&63|128)}else throw new Error("Invalid code point")}return Z}function Bt(c){const g=[];for(let _=0;_>8,V=_%256,Z.push(V),Z.push($);return Z}function gt(c){return t.toByteArray(X(c))}function Ut(c,g,_,$){let V;for(V=0;V<$&&!(V+_>=g.length||V>=c.length);++V)g[V+_]=c[V];return V}function Wt(c,g){return c instanceof g||c!=null&&c.constructor!=null&&c.constructor.name!=null&&c.constructor.name===g.name}function ne(c){return c!==c}const $t=(function(){const c="0123456789abcdef",g=new Array(256);for(let _=0;_<16;++_){const $=_*16;for(let V=0;V<16;++V)g[$+V]=c[_]+c[V]}return g})();function Pt(c){return typeof BigInt>"u"?se:c}function se(){throw new Error("BigInt not supported")}})(Zu);const rn=Zu.Buffer;var Ys={},On={exports:{}},Hs;function ts(){if(Hs)return On.exports;Hs=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(N,P,M){return Function.prototype.apply.call(N,P,M)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(N){return Object.getOwnPropertyNames(N).concat(Object.getOwnPropertySymbols(N))}:n=function(N){return Object.getOwnPropertyNames(N)};function r(N){console&&console.warn&&console.warn(N)}var o=Number.isNaN||function(N){return N!==N};function s(){s.init.call(this)}On.exports=s,On.exports.once=v,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function i(N){if(typeof N!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof N)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(N){if(typeof N!="number"||N<0||o(N))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+N+".");u=N}}),s.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},s.prototype.setMaxListeners=function(N){if(typeof N!="number"||N<0||o(N))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+N+".");return this._maxListeners=N,this};function f(N){return N._maxListeners===void 0?s.defaultMaxListeners:N._maxListeners}s.prototype.getMaxListeners=function(){return f(this)},s.prototype.emit=function(N){for(var P=[],M=1;M0&&(q=P[0]),q instanceof Error)throw q;var j=new Error("Unhandled error."+(q?" ("+q.message+")":""));throw j.context=q,j}var ct=O[N];if(ct===void 0)return!1;if(typeof ct=="function")t(ct,this,P);else for(var G=ct.length,rt=S(ct,G),M=0;M0&&j.length>O&&!j.warned){j.warned=!0;var ct=new Error("Possible EventEmitter memory leak detected. "+j.length+" "+String(P)+" listeners added. Use emitter.setMaxListeners() to increase limit");ct.name="MaxListenersExceededWarning",ct.emitter=N,ct.type=P,ct.count=j.length,r(ct)}return N}s.prototype.addListener=function(N,P){return h(this,N,P,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(N,P){return h(this,N,P,!0)};function a(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(N,P,M){var F={fired:!1,wrapFn:void 0,target:N,type:P,listener:M},O=a.bind(F);return O.listener=M,F.wrapFn=O,O}s.prototype.once=function(N,P){return i(P),this.on(N,p(this,N,P)),this},s.prototype.prependOnceListener=function(N,P){return i(P),this.prependListener(N,p(this,N,P)),this},s.prototype.removeListener=function(N,P){var M,F,O,q,j;if(i(P),F=this._events,F===void 0)return this;if(M=F[N],M===void 0)return this;if(M===P||M.listener===P)--this._eventsCount===0?this._events=Object.create(null):(delete F[N],F.removeListener&&this.emit("removeListener",N,M.listener||P));else if(typeof M!="function"){for(O=-1,q=M.length-1;q>=0;q--)if(M[q]===P||M[q].listener===P){j=M[q].listener,O=q;break}if(O<0)return this;O===0?M.shift():w(M,O),M.length===1&&(F[N]=M[0]),F.removeListener!==void 0&&this.emit("removeListener",N,j||P)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(N){var P,M,F;if(M=this._events,M===void 0)return this;if(M.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):M[N]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete M[N]),this;if(arguments.length===0){var O=Object.keys(M),q;for(F=0;F=0;F--)this.removeListener(N,P[F]);return this};function d(N,P,M){var F=N._events;if(F===void 0)return[];var O=F[P];return O===void 0?[]:typeof O=="function"?M?[O.listener||O]:[O]:M?R(O):S(O,O.length)}s.prototype.listeners=function(N){return d(this,N,!0)},s.prototype.rawListeners=function(N){return d(this,N,!1)},s.listenerCount=function(N,P){return typeof N.listenerCount=="function"?N.listenerCount(P):I.call(N,P)},s.prototype.listenerCount=I;function I(N){var P=this._events;if(P!==void 0){var M=P[N];if(typeof M=="function")return 1;if(M!==void 0)return M.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function S(N,P){for(var M=new Array(P),F=0;F0)throw new Error("Invalid string. Length must be a multiple of 4");var N=E.indexOf("=");N===-1&&(N=x);var P=N===x?0:4-N%4;return[N,P]}function a(E){var x=h(E),N=x[0],P=x[1];return(N+P)*3/4-P}function p(E,x,N){return(x+N)*3/4-N}function d(E){var x,N=h(E),P=N[0],M=N[1],F=new s(p(E,P,M)),O=0,q=M>0?P-4:P,j;for(j=0;j>16&255,F[O++]=x>>8&255,F[O++]=x&255;return M===2&&(x=o[E.charCodeAt(j)]<<2|o[E.charCodeAt(j+1)]>>4,F[O++]=x&255),M===1&&(x=o[E.charCodeAt(j)]<<10|o[E.charCodeAt(j+1)]<<4|o[E.charCodeAt(j+2)]>>2,F[O++]=x>>8&255,F[O++]=x&255),F}function I(E){return r[E>>18&63]+r[E>>12&63]+r[E>>6&63]+r[E&63]}function S(E,x,N){for(var P,M=[],F=x;Fq?q:O+F));return P===1?(x=E[N-1],M.push(r[x>>2]+r[x<<4&63]+"==")):P===2&&(x=(E[N-2]<<8)+E[N-1],M.push(r[x>>10]+r[x>>4&63]+r[x<<2&63]+"=")),M.join("")}var R={};R.read=function(E,x,N,P,M){var F,O,q=M*8-P-1,j=(1<>1,G=-7,rt=N?M-1:0,pt=N?-1:1,At=E[x+rt];for(rt+=pt,F=At&(1<<-G)-1,At>>=-G,G+=q;G>0;F=F*256+E[x+rt],rt+=pt,G-=8);for(O=F&(1<<-G)-1,F>>=-G,G+=P;G>0;O=O*256+E[x+rt],rt+=pt,G-=8);if(F===0)F=1-ct;else{if(F===j)return O?NaN:(At?-1:1)*(1/0);O=O+Math.pow(2,P),F=F-ct}return(At?-1:1)*O*Math.pow(2,F-P)},R.write=function(E,x,N,P,M,F){var O,q,j,ct=F*8-M-1,G=(1<>1,pt=M===23?Math.pow(2,-24)-Math.pow(2,-77):0,At=P?0:F-1,Et=P?1:-1,lt=x<0||x===0&&1/x<0?1:0;for(x=Math.abs(x),isNaN(x)||x===1/0?(q=isNaN(x)?1:0,O=G):(O=Math.floor(Math.log(x)/Math.LN2),x*(j=Math.pow(2,-O))<1&&(O--,j*=2),O+rt>=1?x+=pt/j:x+=pt*Math.pow(2,1-rt),x*j>=2&&(O++,j/=2),O+rt>=G?(q=0,O=G):O+rt>=1?(q=(x*j-1)*Math.pow(2,M),O=O+rt):(q=x*Math.pow(2,rt-1)*Math.pow(2,M),O=0));M>=8;E[N+At]=q&255,At+=Et,q/=256,M-=8);for(O=O<0;E[N+At]=O&255,At+=Et,O/=256,ct-=8);E[N+At-Et]|=lt*128},(function(E){const x=n,N=R,P=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;E.Buffer=G,E.SlowBuffer=z,E.INSPECT_MAX_BYTES=50;const M=2147483647;E.kMaxLength=M;const{Uint8Array:F,ArrayBuffer:O,SharedArrayBuffer:q}=globalThis;G.TYPED_ARRAY_SUPPORT=j(),!G.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 j(){try{const l=new F(1),m={foo:function(){return 42}};return Object.setPrototypeOf(m,F.prototype),Object.setPrototypeOf(l,m),l.foo()===42}catch{return!1}}Object.defineProperty(G.prototype,"parent",{enumerable:!0,get:function(){if(G.isBuffer(this))return this.buffer}}),Object.defineProperty(G.prototype,"offset",{enumerable:!0,get:function(){if(G.isBuffer(this))return this.byteOffset}});function ct(l){if(l>M)throw new RangeError('The value "'+l+'" is invalid for option "size"');const m=new F(l);return Object.setPrototypeOf(m,G.prototype),m}function G(l,m,A){if(typeof l=="number"){if(typeof m=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Et(l)}return rt(l,m,A)}G.poolSize=8192;function rt(l,m,A){if(typeof l=="string")return lt(l,m);if(O.isView(l))return Nt(l);if(l==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof l);if(oe(l,O)||l&&oe(l.buffer,O)||typeof q<"u"&&(oe(l,q)||l&&oe(l.buffer,q)))return yt(l,m,A);if(typeof l=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const U=l.valueOf&&l.valueOf();if(U!=null&&U!==l)return G.from(U,m,A);const W=Tt(l);if(W)return W;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof l[Symbol.toPrimitive]=="function")return G.from(l[Symbol.toPrimitive]("string"),m,A);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof l)}G.from=function(l,m,A){return rt(l,m,A)},Object.setPrototypeOf(G.prototype,F.prototype),Object.setPrototypeOf(G,F);function pt(l){if(typeof l!="number")throw new TypeError('"size" argument must be of type number');if(l<0)throw new RangeError('The value "'+l+'" is invalid for option "size"')}function At(l,m,A){return pt(l),l<=0?ct(l):m!==void 0?typeof A=="string"?ct(l).fill(m,A):ct(l).fill(m):ct(l)}G.alloc=function(l,m,A){return At(l,m,A)};function Et(l){return pt(l),ct(l<0?0:ft(l)|0)}G.allocUnsafe=function(l){return Et(l)},G.allocUnsafeSlow=function(l){return Et(l)};function lt(l,m){if((typeof m!="string"||m==="")&&(m="utf8"),!G.isEncoding(m))throw new TypeError("Unknown encoding: "+m);const A=H(l,m)|0;let U=ct(A);const W=U.write(l,m);return W!==A&&(U=U.slice(0,W)),U}function mt(l){const m=l.length<0?0:ft(l.length)|0,A=ct(m);for(let U=0;U=M)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+M.toString(16)+" bytes");return l|0}function z(l){return+l!=l&&(l=0),G.alloc(+l)}G.isBuffer=function(l){return l!=null&&l._isBuffer===!0&&l!==G.prototype},G.compare=function(l,m){if(oe(l,F)&&(l=G.from(l,l.offset,l.byteLength)),oe(m,F)&&(m=G.from(m,m.offset,m.byteLength)),!G.isBuffer(l)||!G.isBuffer(m))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(l===m)return 0;let A=l.length,U=m.length;for(let W=0,tt=Math.min(A,U);WU.length?(G.isBuffer(tt)||(tt=G.from(tt)),tt.copy(U,W)):F.prototype.set.call(U,tt,W);else if(G.isBuffer(tt))tt.copy(U,W);else throw new TypeError('"list" argument must be an Array of Buffers');W+=tt.length}return U};function H(l,m){if(G.isBuffer(l))return l.length;if(O.isView(l)||oe(l,O))return l.byteLength;if(typeof l!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof l);const A=l.length,U=arguments.length>2&&arguments[2]===!0;if(!U&&A===0)return 0;let W=!1;for(;;)switch(m){case"ascii":case"latin1":case"binary":return A;case"utf8":case"utf-8":return Ft(l).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A*2;case"hex":return A>>>1;case"base64":return Dt(l).length;default:if(W)return U?-1:Ft(l).length;m=(""+m).toLowerCase(),W=!0}}G.byteLength=H;function Q(l,m,A){let U=!1;if((m===void 0||m<0)&&(m=0),m>this.length||((A===void 0||A>this.length)&&(A=this.length),A<=0)||(A>>>=0,m>>>=0,A<=m))return"";for(l||(l="utf8");;)switch(l){case"hex":return wt(this,m,A);case"utf8":case"utf-8":return k(this,m,A);case"ascii":return _t(this,m,A);case"latin1":case"binary":return X(this,m,A);case"base64":return y(this,m,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Bt(this,m,A);default:if(U)throw new TypeError("Unknown encoding: "+l);l=(l+"").toLowerCase(),U=!0}}G.prototype._isBuffer=!0;function T(l,m,A){const U=l[m];l[m]=l[A],l[A]=U}G.prototype.swap16=function(){const l=this.length;if(l%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let m=0;mm&&(l+=" ... "),""},P&&(G.prototype[P]=G.prototype.inspect),G.prototype.compare=function(l,m,A,U,W){if(oe(l,F)&&(l=G.from(l,l.offset,l.byteLength)),!G.isBuffer(l))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof l);if(m===void 0&&(m=0),A===void 0&&(A=l?l.length:0),U===void 0&&(U=0),W===void 0&&(W=this.length),m<0||A>l.length||U<0||W>this.length)throw new RangeError("out of range index");if(U>=W&&m>=A)return 0;if(U>=W)return-1;if(m>=A)return 1;if(m>>>=0,A>>>=0,U>>>=0,W>>>=0,this===l)return 0;let tt=W-U,it=A-m;const Mt=Math.min(tt,it),Jt=this.slice(U,W),jt=l.slice(m,A);for(let Lt=0;Lt2147483647?A=2147483647:A<-2147483648&&(A=-2147483648),A=+A,Ze(A)&&(A=W?0:l.length-1),A<0&&(A=l.length+A),A>=l.length){if(W)return-1;A=l.length-1}else if(A<0)if(W)A=0;else return-1;if(typeof m=="string"&&(m=G.from(m,U)),G.isBuffer(m))return m.length===0?-1:K(l,m,A,U,W);if(typeof m=="number")return m=m&255,typeof F.prototype.indexOf=="function"?W?F.prototype.indexOf.call(l,m,A):F.prototype.lastIndexOf.call(l,m,A):K(l,[m],A,U,W);throw new TypeError("val must be string, number or Buffer")}function K(l,m,A,U,W){let tt=1,it=l.length,Mt=m.length;if(U!==void 0&&(U=String(U).toLowerCase(),U==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le")){if(l.length<2||m.length<2)return-1;tt=2,it/=2,Mt/=2,A/=2}function Jt(Lt,Gt){return tt===1?Lt[Gt]:Lt.readUInt16BE(Gt*tt)}let jt;if(W){let Lt=-1;for(jt=A;jtit&&(A=it-Mt),jt=A;jt>=0;jt--){let Lt=!0;for(let Gt=0;GtW&&(U=W)):U=W;const tt=m.length;U>tt/2&&(U=tt/2);let it;for(it=0;it>>0,isFinite(A)?(A=A>>>0,U===void 0&&(U="utf8")):(U=A,A=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const W=this.length-m;if((A===void 0||A>W)&&(A=W),l.length>0&&(A<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");let tt=!1;for(;;)switch(U){case"hex":return nt(this,l,m,A);case"utf8":case"utf-8":return st(this,l,m,A);case"ascii":case"latin1":case"binary":return L(this,l,m,A);case"base64":return B(this,l,m,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,l,m,A);default:if(tt)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),tt=!0}},G.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function y(l,m,A){return m===0&&A===l.length?x.fromByteArray(l):x.fromByteArray(l.slice(m,A))}function k(l,m,A){A=Math.min(l.length,A);const U=[];let W=m;for(;W239?4:tt>223?3:tt>191?2:1;if(W+Mt<=A){let Jt,jt,Lt,Gt;switch(Mt){case 1:tt<128&&(it=tt);break;case 2:Jt=l[W+1],(Jt&192)===128&&(Gt=(tt&31)<<6|Jt&63,Gt>127&&(it=Gt));break;case 3:Jt=l[W+1],jt=l[W+2],(Jt&192)===128&&(jt&192)===128&&(Gt=(tt&15)<<12|(Jt&63)<<6|jt&63,Gt>2047&&(Gt<55296||Gt>57343)&&(it=Gt));break;case 4:Jt=l[W+1],jt=l[W+2],Lt=l[W+3],(Jt&192)===128&&(jt&192)===128&&(Lt&192)===128&&(Gt=(tt&15)<<18|(Jt&63)<<12|(jt&63)<<6|Lt&63,Gt>65535&&Gt<1114112&&(it=Gt))}}it===null?(it=65533,Mt=1):it>65535&&(it-=65536,U.push(it>>>10&1023|55296),it=56320|it&1023),U.push(it),W+=Mt}return ot(U)}const D=4096;function ot(l){const m=l.length;if(m<=D)return String.fromCharCode.apply(String,l);let A="",U=0;for(;UU)&&(A=U);let W="";for(let tt=m;ttA&&(l=A),m<0?(m+=A,m<0&&(m=0)):m>A&&(m=A),mA)throw new RangeError("Trying to access beyond buffer length")}G.prototype.readUintLE=G.prototype.readUIntLE=function(l,m,A){l=l>>>0,m=m>>>0,A||dt(l,m,this.length);let U=this[l],W=1,tt=0;for(;++tt>>0,m=m>>>0,A||dt(l,m,this.length);let U=this[l+--m],W=1;for(;m>0&&(W*=256);)U+=this[l+--m]*W;return U},G.prototype.readUint8=G.prototype.readUInt8=function(l,m){return l=l>>>0,m||dt(l,1,this.length),this[l]},G.prototype.readUint16LE=G.prototype.readUInt16LE=function(l,m){return l=l>>>0,m||dt(l,2,this.length),this[l]|this[l+1]<<8},G.prototype.readUint16BE=G.prototype.readUInt16BE=function(l,m){return l=l>>>0,m||dt(l,2,this.length),this[l]<<8|this[l+1]},G.prototype.readUint32LE=G.prototype.readUInt32LE=function(l,m){return l=l>>>0,m||dt(l,4,this.length),(this[l]|this[l+1]<<8|this[l+2]<<16)+this[l+3]*16777216},G.prototype.readUint32BE=G.prototype.readUInt32BE=function(l,m){return l=l>>>0,m||dt(l,4,this.length),this[l]*16777216+(this[l+1]<<16|this[l+2]<<8|this[l+3])},G.prototype.readBigUInt64LE=Re(function(l){l=l>>>0,V(l,"offset");const m=this[l],A=this[l+7];(m===void 0||A===void 0)&&Z(l,this.length-8);const U=m+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24,W=this[++l]+this[++l]*2**8+this[++l]*2**16+A*2**24;return BigInt(U)+(BigInt(W)<>>0,V(l,"offset");const m=this[l],A=this[l+7];(m===void 0||A===void 0)&&Z(l,this.length-8);const U=m*2**24+this[++l]*2**16+this[++l]*2**8+this[++l],W=this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+A;return(BigInt(U)<>>0,m=m>>>0,A||dt(l,m,this.length);let U=this[l],W=1,tt=0;for(;++tt=W&&(U-=Math.pow(2,8*m)),U},G.prototype.readIntBE=function(l,m,A){l=l>>>0,m=m>>>0,A||dt(l,m,this.length);let U=m,W=1,tt=this[l+--U];for(;U>0&&(W*=256);)tt+=this[l+--U]*W;return W*=128,tt>=W&&(tt-=Math.pow(2,8*m)),tt},G.prototype.readInt8=function(l,m){return l=l>>>0,m||dt(l,1,this.length),this[l]&128?(255-this[l]+1)*-1:this[l]},G.prototype.readInt16LE=function(l,m){l=l>>>0,m||dt(l,2,this.length);const A=this[l]|this[l+1]<<8;return A&32768?A|4294901760:A},G.prototype.readInt16BE=function(l,m){l=l>>>0,m||dt(l,2,this.length);const A=this[l+1]|this[l]<<8;return A&32768?A|4294901760:A},G.prototype.readInt32LE=function(l,m){return l=l>>>0,m||dt(l,4,this.length),this[l]|this[l+1]<<8|this[l+2]<<16|this[l+3]<<24},G.prototype.readInt32BE=function(l,m){return l=l>>>0,m||dt(l,4,this.length),this[l]<<24|this[l+1]<<16|this[l+2]<<8|this[l+3]},G.prototype.readBigInt64LE=Re(function(l){l=l>>>0,V(l,"offset");const m=this[l],A=this[l+7];(m===void 0||A===void 0)&&Z(l,this.length-8);const U=this[l+4]+this[l+5]*2**8+this[l+6]*2**16+(A<<24);return(BigInt(U)<>>0,V(l,"offset");const m=this[l],A=this[l+7];(m===void 0||A===void 0)&&Z(l,this.length-8);const U=(m<<24)+this[++l]*2**16+this[++l]*2**8+this[++l];return(BigInt(U)<>>0,m||dt(l,4,this.length),N.read(this,l,!0,23,4)},G.prototype.readFloatBE=function(l,m){return l=l>>>0,m||dt(l,4,this.length),N.read(this,l,!1,23,4)},G.prototype.readDoubleLE=function(l,m){return l=l>>>0,m||dt(l,8,this.length),N.read(this,l,!0,52,8)},G.prototype.readDoubleBE=function(l,m){return l=l>>>0,m||dt(l,8,this.length),N.read(this,l,!1,52,8)};function gt(l,m,A,U,W,tt){if(!G.isBuffer(l))throw new TypeError('"buffer" argument must be a Buffer instance');if(m>W||ml.length)throw new RangeError("Index out of range")}G.prototype.writeUintLE=G.prototype.writeUIntLE=function(l,m,A,U){if(l=+l,m=m>>>0,A=A>>>0,!U){const it=Math.pow(2,8*A)-1;gt(this,l,m,A,it,0)}let W=1,tt=0;for(this[m]=l&255;++tt>>0,A=A>>>0,!U){const it=Math.pow(2,8*A)-1;gt(this,l,m,A,it,0)}let W=A-1,tt=1;for(this[m+W]=l&255;--W>=0&&(tt*=256);)this[m+W]=l/tt&255;return m+A},G.prototype.writeUint8=G.prototype.writeUInt8=function(l,m,A){return l=+l,m=m>>>0,A||gt(this,l,m,1,255,0),this[m]=l&255,m+1},G.prototype.writeUint16LE=G.prototype.writeUInt16LE=function(l,m,A){return l=+l,m=m>>>0,A||gt(this,l,m,2,65535,0),this[m]=l&255,this[m+1]=l>>>8,m+2},G.prototype.writeUint16BE=G.prototype.writeUInt16BE=function(l,m,A){return l=+l,m=m>>>0,A||gt(this,l,m,2,65535,0),this[m]=l>>>8,this[m+1]=l&255,m+2},G.prototype.writeUint32LE=G.prototype.writeUInt32LE=function(l,m,A){return l=+l,m=m>>>0,A||gt(this,l,m,4,4294967295,0),this[m+3]=l>>>24,this[m+2]=l>>>16,this[m+1]=l>>>8,this[m]=l&255,m+4},G.prototype.writeUint32BE=G.prototype.writeUInt32BE=function(l,m,A){return l=+l,m=m>>>0,A||gt(this,l,m,4,4294967295,0),this[m]=l>>>24,this[m+1]=l>>>16,this[m+2]=l>>>8,this[m+3]=l&255,m+4};function Ut(l,m,A,U,W){$(m,U,W,l,A,7);let tt=Number(m&BigInt(4294967295));l[A++]=tt,tt=tt>>8,l[A++]=tt,tt=tt>>8,l[A++]=tt,tt=tt>>8,l[A++]=tt;let it=Number(m>>BigInt(32)&BigInt(4294967295));return l[A++]=it,it=it>>8,l[A++]=it,it=it>>8,l[A++]=it,it=it>>8,l[A++]=it,A}function Wt(l,m,A,U,W){$(m,U,W,l,A,7);let tt=Number(m&BigInt(4294967295));l[A+7]=tt,tt=tt>>8,l[A+6]=tt,tt=tt>>8,l[A+5]=tt,tt=tt>>8,l[A+4]=tt;let it=Number(m>>BigInt(32)&BigInt(4294967295));return l[A+3]=it,it=it>>8,l[A+2]=it,it=it>>8,l[A+1]=it,it=it>>8,l[A]=it,A+8}G.prototype.writeBigUInt64LE=Re(function(l,m=0){return Ut(this,l,m,BigInt(0),BigInt("0xffffffffffffffff"))}),G.prototype.writeBigUInt64BE=Re(function(l,m=0){return Wt(this,l,m,BigInt(0),BigInt("0xffffffffffffffff"))}),G.prototype.writeIntLE=function(l,m,A,U){if(l=+l,m=m>>>0,!U){const Mt=Math.pow(2,8*A-1);gt(this,l,m,A,Mt-1,-Mt)}let W=0,tt=1,it=0;for(this[m]=l&255;++W>0)-it&255;return m+A},G.prototype.writeIntBE=function(l,m,A,U){if(l=+l,m=m>>>0,!U){const Mt=Math.pow(2,8*A-1);gt(this,l,m,A,Mt-1,-Mt)}let W=A-1,tt=1,it=0;for(this[m+W]=l&255;--W>=0&&(tt*=256);)l<0&&it===0&&this[m+W+1]!==0&&(it=1),this[m+W]=(l/tt>>0)-it&255;return m+A},G.prototype.writeInt8=function(l,m,A){return l=+l,m=m>>>0,A||gt(this,l,m,1,127,-128),l<0&&(l=255+l+1),this[m]=l&255,m+1},G.prototype.writeInt16LE=function(l,m,A){return l=+l,m=m>>>0,A||gt(this,l,m,2,32767,-32768),this[m]=l&255,this[m+1]=l>>>8,m+2},G.prototype.writeInt16BE=function(l,m,A){return l=+l,m=m>>>0,A||gt(this,l,m,2,32767,-32768),this[m]=l>>>8,this[m+1]=l&255,m+2},G.prototype.writeInt32LE=function(l,m,A){return l=+l,m=m>>>0,A||gt(this,l,m,4,2147483647,-2147483648),this[m]=l&255,this[m+1]=l>>>8,this[m+2]=l>>>16,this[m+3]=l>>>24,m+4},G.prototype.writeInt32BE=function(l,m,A){return l=+l,m=m>>>0,A||gt(this,l,m,4,2147483647,-2147483648),l<0&&(l=4294967295+l+1),this[m]=l>>>24,this[m+1]=l>>>16,this[m+2]=l>>>8,this[m+3]=l&255,m+4},G.prototype.writeBigInt64LE=Re(function(l,m=0){return Ut(this,l,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),G.prototype.writeBigInt64BE=Re(function(l,m=0){return Wt(this,l,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ne(l,m,A,U,W,tt){if(A+U>l.length)throw new RangeError("Index out of range");if(A<0)throw new RangeError("Index out of range")}function $t(l,m,A,U,W){return m=+m,A=A>>>0,W||ne(l,m,A,4),N.write(l,m,A,U,23,4),A+4}G.prototype.writeFloatLE=function(l,m,A){return $t(this,l,m,!0,A)},G.prototype.writeFloatBE=function(l,m,A){return $t(this,l,m,!1,A)};function Pt(l,m,A,U,W){return m=+m,A=A>>>0,W||ne(l,m,A,8),N.write(l,m,A,U,52,8),A+8}G.prototype.writeDoubleLE=function(l,m,A){return Pt(this,l,m,!0,A)},G.prototype.writeDoubleBE=function(l,m,A){return Pt(this,l,m,!1,A)},G.prototype.copy=function(l,m,A,U){if(!G.isBuffer(l))throw new TypeError("argument should be a Buffer");if(A||(A=0),!U&&U!==0&&(U=this.length),m>=l.length&&(m=l.length),m||(m=0),U>0&&U=this.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),l.length-m>>0,A=A===void 0?this.length:A>>>0,l||(l=0);let W;if(typeof l=="number")for(W=m;W2**32?W=g(String(A)):typeof A=="bigint"&&(W=String(A),(A>BigInt(2)**BigInt(32)||A<-(BigInt(2)**BigInt(32)))&&(W=g(W)),W+="n"),U+=` It must be ${m}. Received ${W}`,U},RangeError);function g(l){let m="",A=l.length;const U=l[0]==="-"?1:0;for(;A>=U+4;A-=3)m=`_${l.slice(A-3,A)}${m}`;return`${l.slice(0,A)}${m}`}function _(l,m,A){V(m,"offset"),(l[m]===void 0||l[m+A]===void 0)&&Z(m,l.length-(A+1))}function $(l,m,A,U,W,tt){if(l>A||l= 0${it} and < 2${it} ** ${(tt+1)*8}${it}`:Mt=`>= -(2${it} ** ${(tt+1)*8-1}${it}) and < 2 ** ${(tt+1)*8-1}${it}`,new se.ERR_OUT_OF_RANGE("value",Mt,l)}_(U,W,tt)}function V(l,m){if(typeof l!="number")throw new se.ERR_INVALID_ARG_TYPE(m,"number",l)}function Z(l,m,A){throw Math.floor(l)!==l?(V(l,A),new se.ERR_OUT_OF_RANGE("offset","an integer",l)):m<0?new se.ERR_BUFFER_OUT_OF_BOUNDS:new se.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${m}`,l)}const at=/[^+/0-9A-Za-z-_]/g;function xt(l){if(l=l.split("=")[0],l=l.trim().replace(at,""),l.length<2)return"";for(;l.length%4!==0;)l=l+"=";return l}function Ft(l,m){m=m||1/0;let A;const U=l.length;let W=null;const tt=[];for(let it=0;it55295&&A<57344){if(!W){if(A>56319){(m-=3)>-1&&tt.push(239,191,189);continue}else if(it+1===U){(m-=3)>-1&&tt.push(239,191,189);continue}W=A;continue}if(A<56320){(m-=3)>-1&&tt.push(239,191,189),W=A;continue}A=(W-55296<<10|A-56320)+65536}else W&&(m-=3)>-1&&tt.push(239,191,189);if(W=null,A<128){if((m-=1)<0)break;tt.push(A)}else if(A<2048){if((m-=2)<0)break;tt.push(A>>6|192,A&63|128)}else if(A<65536){if((m-=3)<0)break;tt.push(A>>12|224,A>>6&63|128,A&63|128)}else if(A<1114112){if((m-=4)<0)break;tt.push(A>>18|240,A>>12&63|128,A>>6&63|128,A&63|128)}else throw new Error("Invalid code point")}return tt}function Ct(l){const m=[];for(let A=0;A>8,W=A%256,tt.push(W),tt.push(U);return tt}function Dt(l){return x.toByteArray(xt(l))}function Ie(l,m,A,U){let W;for(W=0;W=m.length||W>=l.length);++W)m[W+A]=l[W];return W}function oe(l,m){return l instanceof m||l!=null&&l.constructor!=null&&l.constructor.name!=null&&l.constructor.name===m.name}function Ze(l){return l!==l}const Dn=(function(){const l="0123456789abcdef",m=new Array(256);for(let A=0;A<16;++A){const U=A*16;for(let W=0;W<16;++W)m[U+W]=l[A]+l[W]}return m})();function Re(l){return typeof BigInt>"u"?Mn:l}function Mn(){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})(Qs)),Qs}var Ks={},ta={},ea,na;function ec(){return na||(na=1,ea=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var r=42;e[t]=r;for(var o in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var u=Object.getOwnPropertyDescriptor(e,t);if(u.value!==r||u.enumerable!==!0)return!1}return!0}),ea}var _r,ra;function or(){if(ra)return _r;ra=1;var e=ec();return _r=function(){return e()&&!!Symbol.toStringTag},_r}var oa,sa;function nc(){return sa||(sa=1,oa=Object),oa}var aa,ia;function df(){return ia||(ia=1,aa=Error),aa}var ua,ca;function gf(){return ca||(ca=1,ua=EvalError),ua}var la,fa;function mf(){return fa||(fa=1,la=RangeError),la}var ha,pa;function yf(){return pa||(pa=1,ha=ReferenceError),ha}var da,ga;function rc(){return ga||(ga=1,da=SyntaxError),da}var ma,ya;function Ln(){return ya||(ya=1,ma=TypeError),ma}var ba,wa;function bf(){return wa||(wa=1,ba=URIError),ba}var va,Ea;function wf(){return Ea||(Ea=1,va=Math.abs),va}var _a,Aa;function vf(){return Aa||(Aa=1,_a=Math.floor),_a}var Sa,Na;function Ef(){return Na||(Na=1,Sa=Math.max),Sa}var Ia,Ra;function _f(){return Ra||(Ra=1,Ia=Math.min),Ia}var xa,Pa;function Af(){return Pa||(Pa=1,xa=Math.pow),xa}var Ca,La;function Sf(){return La||(La=1,Ca=Math.round),Ca}var Ba,ja;function Nf(){return ja||(ja=1,Ba=Number.isNaN||function(e){return e!==e}),Ba}var Ar,Da;function If(){if(Da)return Ar;Da=1;var e=Nf();return Ar=function(t){return e(t)||t===0?t:t<0?-1:1},Ar}var Ma,Ta;function Rf(){return Ta||(Ta=1,Ma=Object.getOwnPropertyDescriptor),Ma}var Sr,Ua;function pn(){if(Ua)return Sr;Ua=1;var e=Rf();if(e)try{e([],"length")}catch{e=null}return Sr=e,Sr}var Nr,ka;function sr(){if(ka)return Nr;ka=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Nr=e,Nr}var Ir,$a;function xf(){if($a)return Ir;$a=1;var e=typeof Symbol<"u"&&Symbol,t=ec();return Ir=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Ir}var Fa,Ga;function oc(){return Ga||(Ga=1,Fa=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Fa}var Rr,Oa;function sc(){if(Oa)return Rr;Oa=1;var e=nc();return Rr=e.getPrototypeOf||null,Rr}var xr,Va;function Pf(){if(Va)return xr;Va=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,n=Math.max,r="[object Function]",o=function(i,f){for(var h=[],a=0;a"u"||!F?e:F(Uint8Array),pt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":M&&F?F([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":G,"%AsyncGenerator%":G,"%AsyncGeneratorFunction%":G,"%AsyncIteratorPrototype%":G,"%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%":R,"%GeneratorFunction%":G,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":M&&F?F(F([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!M||!F?e:F(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":E,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!M||!F?e:F(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&F?F(""[Symbol.iterator]()):e,"%Symbol%":M?Symbol:e,"%SyntaxError%":u,"%ThrowTypeError%":P,"%TypedArray%":rt,"%TypeError%":i,"%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%":f,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":ct,"%Function.prototype.apply%":j,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":O,"%Math.abs%":h,"%Math.floor%":a,"%Math.max%":p,"%Math.min%":d,"%Math.pow%":I,"%Math.round%":S,"%Math.sign%":w,"%Reflect.getPrototypeOf%":q};if(F)try{null.error}catch(nt){var At=F(F(nt));pt["%Error.prototype%"]=At}var Et=function nt(st){var L;if(st==="%AsyncFunction%")L=v("async function () {}");else if(st==="%GeneratorFunction%")L=v("function* () {}");else if(st==="%AsyncGeneratorFunction%")L=v("async function* () {}");else if(st==="%AsyncGenerator%"){var B=nt("%AsyncGeneratorFunction%");B&&(L=B.prototype)}else if(st==="%AsyncIteratorPrototype%"){var b=nt("%AsyncGenerator%");b&&F&&(L=F(b.prototype))}return pt[st]=L,L},lt={__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"]},mt=Bn(),Nt=ic(),yt=mt.call(ct,Array.prototype.concat),Tt=mt.call(j,Array.prototype.splice),ft=mt.call(ct,String.prototype.replace),z=mt.call(ct,String.prototype.slice),H=mt.call(ct,RegExp.prototype.exec),Q=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,T=/\\(\\)?/g,Y=function(nt){var st=z(nt,0,1),L=z(nt,-1);if(st==="%"&&L!=="%")throw new u("invalid intrinsic syntax, expected closing `%`");if(L==="%"&&st!=="%")throw new u("invalid intrinsic syntax, expected opening `%`");var B=[];return ft(nt,Q,function(b,y,k,D){B[B.length]=k?ft(D,T,"$1"):y||b}),B},K=function(nt,st){var L=nt,B;if(Nt(lt,L)&&(B=lt[L],L="%"+B[0]+"%"),Nt(pt,L)){var b=pt[L];if(b===G&&(b=Et(L)),typeof b>"u"&&!st)throw new i("intrinsic "+nt+" exists, but is not available. Please file an issue!");return{alias:B,name:L,value:b}}throw new u("intrinsic "+nt+" does not exist!")};return Mr=function(nt,st){if(typeof nt!="string"||nt.length===0)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof st!="boolean")throw new i('"allowMissing" argument must be a boolean');if(H(/^%?[^%]*%?$/,nt)===null)throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var L=Y(nt),B=L.length>0?L[0]:"",b=K("%"+B+"%",st),y=b.name,k=b.value,D=!1,ot=b.alias;ot&&(B=ot[0],Tt(L,yt([0,1],ot)));for(var _t=1,X=!0;_t=L.length){var gt=E(k,wt);X=!!gt,X&&"get"in gt&&!("originalValue"in gt.get)?k=gt.get:k=k[wt]}else X=Nt(k,wt),k=k[wt];X&&!D&&(pt[y]=k)}}return k},Mr}var Tr,ri;function jn(){if(ri)return Tr;ri=1;var e=uc(),t=rs(),n=t([e("%String.prototype.indexOf%")]);return Tr=function(r,o){var s=e(r,!!o);return typeof s=="function"&&n(r,".prototype.")>-1?t([s]):s},Tr}var Ur,oi;function Bf(){if(oi)return Ur;oi=1;var e=or()(),t=jn(),n=t("Object.prototype.toString"),r=function(u){return e&&u&&typeof u=="object"&&Symbol.toStringTag in u?!1:n(u)==="[object Arguments]"},o=function(u){return r(u)?!0:u!==null&&typeof u=="object"&&"length"in u&&typeof u.length=="number"&&u.length>=0&&n(u)!=="[object Array]"&&"callee"in u&&n(u.callee)==="[object Function]"},s=(function(){return r(arguments)})();return r.isLegacyArguments=o,Ur=s?r:o,Ur}var kr,si;function jf(){if(si)return kr;si=1;var e=jn(),t=or()(),n=ic(),r=pn(),o;if(t){var s=e("RegExp.prototype.exec"),u={},i=function(){throw u},f={toString:i,valueOf:i};typeof Symbol.toPrimitive=="symbol"&&(f[Symbol.toPrimitive]=i),o=function(p){if(!p||typeof p!="object")return!1;var d=r(p,"lastIndex"),I=d&&n(d,"value");if(!I)return!1;try{s(p,f)}catch(S){return S===u}}}else{var h=e("Object.prototype.toString"),a="[object RegExp]";o=function(p){return!p||typeof p!="object"&&typeof p!="function"?!1:h(p)===a}}return kr=o,kr}var $r,ai;function Df(){if(ai)return $r;ai=1;var e=jn(),t=jf(),n=e("RegExp.prototype.exec"),r=Ln();return $r=function(o){if(!t(o))throw new r("`regex` must be a RegExp");return function(s){return n(o,s)!==null}},$r}var Fr,ii;function Mf(){if(ii)return Fr;ii=1;const e=function*(){}.constructor;return Fr=()=>e,Fr}var Gr,ui;function Tf(){if(ui)return Gr;ui=1;var e=jn(),t=Df(),n=t(/^\s*(?:function)?\*/),r=or()(),o=os(),s=e("Object.prototype.toString"),u=e("Function.prototype.toString"),i=Mf();return Gr=function(f){if(typeof f!="function")return!1;if(n(u(f)))return!0;if(!r){var h=s(f);return h==="[object GeneratorFunction]"}if(!o)return!1;var a=i();return a&&o(f)===a.prototype},Gr}var Or,ci;function Uf(){if(ci)return Or;ci=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(E){E!==r&&(t=null)}else t=null;var o=/^\s*class\b/,s=function(E){try{var x=e.call(E);return o.test(x)}catch{return!1}},u=function(E){try{return s(E)?!1:(e.call(E),!0)}catch{return!1}},i=Object.prototype.toString,f="[object Object]",h="[object Function]",a="[object GeneratorFunction]",p="[object HTMLAllCollection]",d="[object HTML document.all class]",I="[object HTMLCollection]",S=typeof Symbol=="function"&&!!Symbol.toStringTag,w=!(0 in[,]),R=function(){return!1};if(typeof document=="object"){var v=document.all;i.call(v)===i.call(document.all)&&(R=function(E){if((w||!E)&&(typeof E>"u"||typeof E=="object"))try{var x=i.call(E);return(x===p||x===d||x===I||x===f)&&E("")==null}catch{}return!1})}return Or=t?function(E){if(R(E))return!0;if(!E||typeof E!="function"&&typeof E!="object")return!1;try{t(E,null,n)}catch(x){if(x!==r)return!1}return!s(E)&&u(E)}:function(E){if(R(E))return!0;if(!E||typeof E!="function"&&typeof E!="object")return!1;if(S)return u(E);if(s(E))return!1;var x=i.call(E);return x!==h&&x!==a&&!/^\[object HTML/.test(x)?!1:u(E)},Or}var Vr,li;function kf(){if(li)return Vr;li=1;var e=Uf(),t=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(i,f,h){for(var a=0,p=i.length;a=3&&(a=h),u(i)?r(i,f,a):typeof i=="string"?o(i,f,a):s(i,f,a)},Vr}var fi,hi;function $f(){return hi||(hi=1,fi=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),fi}var zr,pi;function Ff(){if(pi)return zr;pi=1;var e=$f(),t=typeof globalThis>"u"?Oe:globalThis;return zr=function(){for(var n=[],r=0;r3&&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 i=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,p=!!r&&r(o,s);if(e)e(o,s,{configurable:h===null&&p?p.configurable:!h,enumerable:i===null&&p?p.enumerable:!i,value:u,writable:f===null&&p?p.writable:!f});else if(a||!i&&!f&&!h)o[s]=u;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Wr}var Yr,mi;function Of(){if(mi)return Yr;mi=1;var e=sr(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},Yr=t,Yr}var Hr,yi;function Vf(){if(yi)return Hr;yi=1;var e=uc(),t=Gf(),n=Of()(),r=pn(),o=Ln(),s=e("%Math.floor%");return Hr=function(u,i){if(typeof u!="function")throw new o("`fn` is not a function");if(typeof i!="number"||i<0||i>4294967295||s(i)!==i)throw new o("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],h=!0,a=!0;if("length"in u&&r){var p=r(u,"length");p&&!p.configurable&&(h=!1),p&&!p.writable&&(a=!1)}return(h||a||!f)&&(n?t(u,"length",i,!0,!0):t(u,"length",i)),u},Hr}var Xr,bi;function zf(){if(bi)return Xr;bi=1;var e=Bn(),t=ns(),n=ac();return Xr=function(){return n(e,t,arguments)},Xr}var wi;function Wf(){return wi||(wi=1,(function(e){var t=Vf(),n=sr(),r=rs(),o=zf();e.exports=function(s){var u=r(arguments),i=1+s.length-(arguments.length-1);return t(u,i>0?i:0,!0)},n?n(e.exports,"apply",{value:o}):e.exports.apply=o})(di)),di.exports}var Jr,vi;function cc(){if(vi)return Jr;vi=1;var e=kf(),t=Ff(),n=Wf(),r=jn(),o=pn(),s=os(),u=r("Object.prototype.toString"),i=or()(),f=typeof globalThis>"u"?Oe:globalThis,h=t(),a=r("String.prototype.slice"),p=r("Array.prototype.indexOf",!0)||function(v,E){for(var x=0;x-1}function R(v){if(!v||typeof v!="object")return!1;if(!i){var E=a(u(v),8,-1);return w(E)?E:E!=="Object"?!1:S(v)}return o?I(v):null}return Jr=R,Jr}var qr,Ei;function Yf(){if(Ei)return qr;Ei=1;var e=cc();return qr=function(t){return!!e(t)},qr}var _i;function Hf(){return _i||(_i=1,(function(e){var t=Bf(),n=Tf(),r=cc(),o=Yf();function s(X){return X.call.bind(X)}var u=typeof BigInt<"u",i=typeof Symbol<"u",f=s(Object.prototype.toString),h=s(Number.prototype.valueOf),a=s(String.prototype.valueOf),p=s(Boolean.prototype.valueOf);if(u)var d=s(BigInt.prototype.valueOf);if(i)var I=s(Symbol.prototype.valueOf);function S(X,wt){if(typeof X!="object")return!1;try{return wt(X),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=n,e.isTypedArray=o;function w(X){return typeof Promise<"u"&&X instanceof Promise||X!==null&&typeof X=="object"&&typeof X.then=="function"&&typeof X.catch=="function"}e.isPromise=w;function R(X){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(X):o(X)||z(X)}e.isArrayBufferView=R;function v(X){return r(X)==="Uint8Array"}e.isUint8Array=v;function E(X){return r(X)==="Uint8ClampedArray"}e.isUint8ClampedArray=E;function x(X){return r(X)==="Uint16Array"}e.isUint16Array=x;function N(X){return r(X)==="Uint32Array"}e.isUint32Array=N;function P(X){return r(X)==="Int8Array"}e.isInt8Array=P;function M(X){return r(X)==="Int16Array"}e.isInt16Array=M;function F(X){return r(X)==="Int32Array"}e.isInt32Array=F;function O(X){return r(X)==="Float32Array"}e.isFloat32Array=O;function q(X){return r(X)==="Float64Array"}e.isFloat64Array=q;function j(X){return r(X)==="BigInt64Array"}e.isBigInt64Array=j;function ct(X){return r(X)==="BigUint64Array"}e.isBigUint64Array=ct;function G(X){return f(X)==="[object Map]"}G.working=typeof Map<"u"&&G(new Map);function rt(X){return typeof Map>"u"?!1:G.working?G(X):X instanceof Map}e.isMap=rt;function pt(X){return f(X)==="[object Set]"}pt.working=typeof Set<"u"&&pt(new Set);function At(X){return typeof Set>"u"?!1:pt.working?pt(X):X instanceof Set}e.isSet=At;function Et(X){return f(X)==="[object WeakMap]"}Et.working=typeof WeakMap<"u"&&Et(new WeakMap);function lt(X){return typeof WeakMap>"u"?!1:Et.working?Et(X):X instanceof WeakMap}e.isWeakMap=lt;function mt(X){return f(X)==="[object WeakSet]"}mt.working=typeof WeakSet<"u"&&mt(new WeakSet);function Nt(X){return mt(X)}e.isWeakSet=Nt;function yt(X){return f(X)==="[object ArrayBuffer]"}yt.working=typeof ArrayBuffer<"u"&&yt(new ArrayBuffer);function Tt(X){return typeof ArrayBuffer>"u"?!1:yt.working?yt(X):X instanceof ArrayBuffer}e.isArrayBuffer=Tt;function ft(X){return f(X)==="[object DataView]"}ft.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&ft(new DataView(new ArrayBuffer(1),0,1));function z(X){return typeof DataView>"u"?!1:ft.working?ft(X):X instanceof DataView}e.isDataView=z;var H=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Q(X){return f(X)==="[object SharedArrayBuffer]"}function T(X){return typeof H>"u"?!1:(typeof Q.working>"u"&&(Q.working=Q(new H)),Q.working?Q(X):X instanceof H)}e.isSharedArrayBuffer=T;function Y(X){return f(X)==="[object AsyncFunction]"}e.isAsyncFunction=Y;function K(X){return f(X)==="[object Map Iterator]"}e.isMapIterator=K;function nt(X){return f(X)==="[object Set Iterator]"}e.isSetIterator=nt;function st(X){return f(X)==="[object Generator]"}e.isGeneratorObject=st;function L(X){return f(X)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=L;function B(X){return S(X,h)}e.isNumberObject=B;function b(X){return S(X,a)}e.isStringObject=b;function y(X){return S(X,p)}e.isBooleanObject=y;function k(X){return u&&S(X,d)}e.isBigIntObject=k;function D(X){return i&&S(X,I)}e.isSymbolObject=D;function ot(X){return B(X)||b(X)||y(X)||k(X)||D(X)}e.isBoxedPrimitive=ot;function _t(X){return typeof Uint8Array<"u"&&(Tt(X)||T(X))}e.isAnyArrayBuffer=_t,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(X){Object.defineProperty(e,X,{enumerable:!1,value:function(){throw new Error(X+" is not supported in userland")}})})})(ta)),ta}var Ai,Si;function Xf(){return Si||(Si=1,Ai=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),Ai}var Ni;function lc(){return Ni||(Ni=1,(function(e){var t={},n=Object.getOwnPropertyDescriptors||function(z){for(var H=Object.keys(z),Q={},T=0;T=Y)return L;switch(L){case"%s":return String(T[Q++]);case"%d":return Number(T[Q++]);case"%j":try{return JSON.stringify(T[Q++])}catch{return"[Circular]"}default:return L}}),nt=T[Q];Q"u")return function(){return e.deprecate(z,H).apply(this,arguments)};var Q=!1;function T(){if(!Q){if(vt.throwDeprecation)throw new Error(H);vt.traceDeprecation?console.trace(H):console.error(H),Q=!0}return z.apply(this,arguments)}return T};var o={},s=/^$/;if(t.NODE_DEBUG){var u=t.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+u+"$","i")}e.debuglog=function(z){if(z=z.toUpperCase(),!o[z])if(s.test(z)){var H=vt.pid;o[z]=function(){var Q=e.format.apply(e,arguments);console.error("%s %d: %s",z,H,Q)}}else o[z]=function(){};return o[z]};function i(z,H){var Q={seen:[],stylize:h};return arguments.length>=3&&(Q.depth=arguments[2]),arguments.length>=4&&(Q.colors=arguments[3]),E(H)?Q.showHidden=H:H&&e._extend(Q,H),O(Q.showHidden)&&(Q.showHidden=!1),O(Q.depth)&&(Q.depth=2),O(Q.colors)&&(Q.colors=!1),O(Q.customInspect)&&(Q.customInspect=!0),Q.colors&&(Q.stylize=f),p(Q,z,Q.depth)}e.inspect=i,i.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]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function f(z,H){var Q=i.styles[H];return Q?"\x1B["+i.colors[Q][0]+"m"+z+"\x1B["+i.colors[Q][1]+"m":z}function h(z,H){return z}function a(z){var H={};return z.forEach(function(Q,T){H[Q]=!0}),H}function p(z,H,Q){if(z.customInspect&&H&&rt(H.inspect)&&H.inspect!==e.inspect&&!(H.constructor&&H.constructor.prototype===H)){var T=H.inspect(Q,z);return M(T)||(T=p(z,T,Q)),T}var Y=d(z,H);if(Y)return Y;var K=Object.keys(H),nt=a(K);if(z.showHidden&&(K=Object.getOwnPropertyNames(H)),G(H)&&(K.indexOf("message")>=0||K.indexOf("description")>=0))return I(H);if(K.length===0){if(rt(H)){var st=H.name?": "+H.name:"";return z.stylize("[Function"+st+"]","special")}if(q(H))return z.stylize(RegExp.prototype.toString.call(H),"regexp");if(ct(H))return z.stylize(Date.prototype.toString.call(H),"date");if(G(H))return I(H)}var L="",B=!1,b=["{","}"];if(v(H)&&(B=!0,b=["[","]"]),rt(H)){var y=H.name?": "+H.name:"";L=" [Function"+y+"]"}if(q(H)&&(L=" "+RegExp.prototype.toString.call(H)),ct(H)&&(L=" "+Date.prototype.toUTCString.call(H)),G(H)&&(L=" "+I(H)),K.length===0&&(!B||H.length==0))return b[0]+L+b[1];if(Q<0)return q(H)?z.stylize(RegExp.prototype.toString.call(H),"regexp"):z.stylize("[Object]","special");z.seen.push(H);var k;return B?k=S(z,H,Q,nt,K):k=K.map(function(D){return w(z,H,Q,nt,D,B)}),z.seen.pop(),R(k,L,b)}function d(z,H){if(O(H))return z.stylize("undefined","undefined");if(M(H)){var Q="'"+JSON.stringify(H).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return z.stylize(Q,"string")}if(P(H))return z.stylize(""+H,"number");if(E(H))return z.stylize(""+H,"boolean");if(x(H))return z.stylize("null","null")}function I(z){return"["+Error.prototype.toString.call(z)+"]"}function S(z,H,Q,T,Y){for(var K=[],nt=0,st=H.length;nt-1&&(K?st=st.split(` `).map(function(B){return" "+B}).join(` `).slice(2):st=` `+st.split(` `).map(function(B){return" "+B}).join(` `))):st=z.stylize("[Circular]","special")),O(nt)){if(K&&Y.match(/^\d+$/))return st;nt=JSON.stringify(""+Y),nt.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(nt=nt.slice(1,-1),nt=z.stylize(nt,"name")):(nt=nt.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),nt=z.stylize(nt,"string"))}return nt+": "+st}function R(z,H,Q){var T=z.reduce(function(Y,K){return K.indexOf(` `)>=0,Y+K.replace(/\u001b\[\d\d?m/g,"").length+1},0);return T>60?Q[0]+(H===""?"":H+` `)+" "+z.join(`, `)+" "+Q[1]:Q[0]+H+" "+z.join(", ")+" "+Q[1]}e.types=Hf();function v(z){return Array.isArray(z)}e.isArray=v;function E(z){return typeof z=="boolean"}e.isBoolean=E;function x(z){return z===null}e.isNull=x;function N(z){return z==null}e.isNullOrUndefined=N;function P(z){return typeof z=="number"}e.isNumber=P;function M(z){return typeof z=="string"}e.isString=M;function F(z){return typeof z=="symbol"}e.isSymbol=F;function O(z){return z===void 0}e.isUndefined=O;function q(z){return j(z)&&At(z)==="[object RegExp]"}e.isRegExp=q,e.types.isRegExp=q;function j(z){return typeof z=="object"&&z!==null}e.isObject=j;function ct(z){return j(z)&&At(z)==="[object Date]"}e.isDate=ct,e.types.isDate=ct;function G(z){return j(z)&&(At(z)==="[object Error]"||z instanceof Error)}e.isError=G,e.types.isNativeError=G;function rt(z){return typeof z=="function"}e.isFunction=rt;function pt(z){return z===null||typeof z=="boolean"||typeof z=="number"||typeof z=="string"||typeof z=="symbol"||typeof z>"u"}e.isPrimitive=pt,e.isBuffer=Xf();function At(z){return Object.prototype.toString.call(z)}function Et(z){return z<10?"0"+z.toString(10):z.toString(10)}var lt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function mt(){var z=new Date,H=[Et(z.getHours()),Et(z.getMinutes()),Et(z.getSeconds())].join(":");return[z.getDate(),lt[z.getMonth()],H].join(" ")}e.log=function(){console.log("%s - %s",mt(),e.format.apply(e,arguments))},e.inherits=Qe(),e._extend=function(z,H){if(!H||!j(H))return z;for(var Q=Object.keys(H),T=Q.length;T--;)z[Q[T]]=H[Q[T]];return z};function Nt(z,H){return Object.prototype.hasOwnProperty.call(z,H)}var yt=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(z){if(typeof z!="function")throw new TypeError('The "original" argument must be of type Function');if(yt&&z[yt]){var H=z[yt];if(typeof H!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(H,yt,{value:H,enumerable:!1,writable:!1,configurable:!0}),H}function H(){for(var Q,T,Y=new Promise(function(st,L){Q=st,T=L}),K=[],nt=0;nt0?this.tail.next=R:this.head=R,this.tail=R,++this.length}},{key:"unshift",value:function(w){var R={data:w,next:this.head};this.length===0&&(this.tail=R),this.head=R,++this.length}},{key:"shift",value:function(){if(this.length!==0){var w=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,w}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(w){if(this.length===0)return"";for(var R=this.head,v=""+R.data;R=R.next;)v+=w+R.data;return v}},{key:"concat",value:function(w){if(this.length===0)return h.alloc(0);for(var R=h.allocUnsafe(w>>>0),v=this.head,E=0;v;)I(v.data,R,E),E+=v.data.length,v=v.next;return R}},{key:"consume",value:function(w,R){var v;return wx.length?x.length:w;if(N===x.length?E+=x:E+=x.slice(0,w),w-=N,w===0){N===x.length?(++v,R.next?this.head=R.next:this.head=this.tail=null):(this.head=R,R.data=x.slice(N));break}++v}return this.length-=v,E}},{key:"_getBuffer",value:function(w){var R=h.allocUnsafe(w),v=this.head,E=1;for(v.data.copy(R),w-=v.data.length;v=v.next;){var x=v.data,N=w>x.length?x.length:w;if(x.copy(R,R.length-w,0,N),w-=N,w===0){N===x.length?(++E,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=x.slice(N));break}++E}return this.length-=E,R}},{key:d,value:function(w,R){return p(this,t(t({},R),{},{depth:0,customInspect:!1}))}}]),S})(),Qr}var Zr,Ri;function fc(){if(Ri)return Zr;Ri=1;function e(u,i){var f=this,h=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return h||a?(i?i(u):u&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,vt.nextTick(o,this,u)):vt.nextTick(o,this,u)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(u||null,function(p){!i&&p?f._writableState?f._writableState.errorEmitted?vt.nextTick(n,f):(f._writableState.errorEmitted=!0,vt.nextTick(t,f,p)):vt.nextTick(t,f,p):i?(vt.nextTick(n,f),i(p)):vt.nextTick(n,f)}),this)}function t(u,i){o(u,i),n(u)}function n(u){u._writableState&&!u._writableState.emitClose||u._readableState&&!u._readableState.emitClose||u.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(u,i){u.emit("error",i)}function s(u,i){var f=u._readableState,h=u._writableState;f&&f.autoDestroy||h&&h.autoDestroy?u.destroy(i):u.emit("error",i)}return Zr={destroy:e,undestroy:r,errorOrDestroy:s},Zr}var Kr={},xi;function dn(){if(xi)return Kr;xi=1;function e(i,f){i.prototype=Object.create(f.prototype),i.prototype.constructor=i,i.__proto__=f}var t={};function n(i,f,h){h||(h=Error);function a(d,I,S){return typeof f=="string"?f:f(d,I,S)}var p=(function(d){e(I,d);function I(S,w,R){return d.call(this,a(S,w,R))||this}return I})(h);p.prototype.name=h.name,p.prototype.code=i,t[i]=p}function r(i,f){if(Array.isArray(i)){var h=i.length;return i=i.map(function(a){return String(a)}),h>2?"one of ".concat(f," ").concat(i.slice(0,h-1).join(", "),", or ")+i[h-1]:h===2?"one of ".concat(f," ").concat(i[0]," or ").concat(i[1]):"of ".concat(f," ").concat(i[0])}else return"of ".concat(f," ").concat(String(i))}function o(i,f,h){return i.substr(0,f.length)===f}function s(i,f,h){return(h===void 0||h>i.length)&&(h=i.length),i.substring(h-f.length,h)===f}function u(i,f,h){return typeof h!="number"&&(h=0),h+f.length>i.length?!1:i.indexOf(f,h)!==-1}return n("ERR_INVALID_OPT_VALUE",function(i,f){return'The value "'+f+'" is invalid for option "'+i+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(i,f,h){var a;typeof f=="string"&&o(f,"not ")?(a="must not be",f=f.replace(/^not /,"")):a="must be";var p;if(s(i," argument"))p="The ".concat(i," ").concat(a," ").concat(r(f,"type"));else{var d=u(i,".")?"property":"argument";p='The "'.concat(i,'" ').concat(d," ").concat(a," ").concat(r(f,"type"))}return p+=". Received type ".concat(typeof h),p},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(i){return"The "+i+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(i){return"Cannot call "+i+" 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(i){return"Unknown encoding: "+i},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Kr.codes=t,Kr}var to,Pi;function hc(){if(Pi)return to;Pi=1;var e=dn().codes.ERR_INVALID_OPT_VALUE;function t(r,o,s){return r.highWaterMark!=null?r.highWaterMark:o?r[s]:null}function n(r,o,s,u){var i=t(o,u,s);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var f=u?s:"highWaterMark";throw new e(f,i)}return Math.floor(i)}return r.objectMode?16:16*1024}return to={getHighWaterMark:n},to}var eo,Ci;function qf(){if(Ci)return eo;Ci=1,eo=e;function e(n,r){if(t("noDeprecation"))return n;var o=!1;function s(){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 s}function t(n){try{if(!Oe.localStorage)return!1}catch{return!1}var r=Oe.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return eo}var no,Li;function pc(){if(Li)return no;Li=1,no=O;function e(T){var Y=this;this.next=null,this.entry=null,this.finish=function(){Q(Y,T)}}var t;O.WritableState=M;var n={deprecate:qf()},r=tc(),o=rr().Buffer,s=(typeof Oe<"u"?Oe:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function u(T){return o.from(T)}function i(T){return o.isBuffer(T)||T instanceof s}var f=fc(),h=hc(),a=h.getHighWaterMark,p=dn().codes,d=p.ERR_INVALID_ARG_TYPE,I=p.ERR_METHOD_NOT_IMPLEMENTED,S=p.ERR_MULTIPLE_CALLBACK,w=p.ERR_STREAM_CANNOT_PIPE,R=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,E=p.ERR_STREAM_WRITE_AFTER_END,x=p.ERR_UNKNOWN_ENCODING,N=f.errorOrDestroy;Qe()(O,r);function P(){}function M(T,Y,K){t=t||fn(),T=T||{},typeof K!="boolean"&&(K=Y instanceof t),this.objectMode=!!T.objectMode,K&&(this.objectMode=this.objectMode||!!T.writableObjectMode),this.highWaterMark=a(this,T,"writableHighWaterMark",K),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var nt=T.decodeStrings===!1;this.decodeStrings=!nt,this.defaultEncoding=T.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(st){Et(Y,st)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=T.emitClose!==!1,this.autoDestroy=!!T.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}M.prototype.getBuffer=function(){for(var T=this.bufferedRequest,Y=[];T;)Y.push(T),T=T.next;return Y},(function(){try{Object.defineProperty(M.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var F;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(F=Function.prototype[Symbol.hasInstance],Object.defineProperty(O,Symbol.hasInstance,{value:function(T){return F.call(this,T)?!0:this!==O?!1:T&&T._writableState instanceof M}})):F=function(T){return T instanceof this};function O(T){t=t||fn();var Y=this instanceof t;if(!Y&&!F.call(O,this))return new O(T);this._writableState=new M(T,this,Y),this.writable=!0,T&&(typeof T.write=="function"&&(this._write=T.write),typeof T.writev=="function"&&(this._writev=T.writev),typeof T.destroy=="function"&&(this._destroy=T.destroy),typeof T.final=="function"&&(this._final=T.final)),r.call(this)}O.prototype.pipe=function(){N(this,new w)};function q(T,Y){var K=new E;N(T,K),vt.nextTick(Y,K)}function j(T,Y,K,nt){var st;return K===null?st=new v:typeof K!="string"&&!Y.objectMode&&(st=new d("chunk",["string","Buffer"],K)),st?(N(T,st),vt.nextTick(nt,st),!1):!0}O.prototype.write=function(T,Y,K){var nt=this._writableState,st=!1,L=!nt.objectMode&&i(T);return L&&!o.isBuffer(T)&&(T=u(T)),typeof Y=="function"&&(K=Y,Y=null),L?Y="buffer":Y||(Y=nt.defaultEncoding),typeof K!="function"&&(K=P),nt.ending?q(this,K):(L||j(this,nt,T,K))&&(nt.pendingcb++,st=G(this,nt,L,T,Y,K)),st},O.prototype.cork=function(){this._writableState.corked++},O.prototype.uncork=function(){var T=this._writableState;T.corked&&(T.corked--,!T.writing&&!T.corked&&!T.bufferProcessing&&T.bufferedRequest&&Nt(this,T))},O.prototype.setDefaultEncoding=function(T){if(typeof T=="string"&&(T=T.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((T+"").toLowerCase())>-1))throw new x(T);return this._writableState.defaultEncoding=T,this},Object.defineProperty(O.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ct(T,Y,K){return!T.objectMode&&T.decodeStrings!==!1&&typeof Y=="string"&&(Y=o.from(Y,K)),Y}Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function G(T,Y,K,nt,st,L){if(!K){var B=ct(Y,nt,st);nt!==B&&(K=!0,st="buffer",nt=B)}var b=Y.objectMode?1:nt.length;Y.length+=b;var y=Y.length>5===6?2:v>>4===14?3:v>>3===30?4:v>>6===2?-1:-2}function u(v,E,x){var N=E.length-1;if(N=0?(P>0&&(v.lastNeed=P-1),P):--N=0?(P>0&&(v.lastNeed=P-2),P):--N=0?(P>0&&(P===2?P=0:v.lastNeed=P-3),P):0))}function i(v,E,x){if((E[0]&192)!==128)return v.lastNeed=0,"�";if(v.lastNeed>1&&E.length>1){if((E[1]&192)!==128)return v.lastNeed=1,"�";if(v.lastNeed>2&&E.length>2&&(E[2]&192)!==128)return v.lastNeed=2,"�"}}function f(v){var E=this.lastTotal-this.lastNeed,x=i(this,v);if(x!==void 0)return x;if(this.lastNeed<=v.length)return v.copy(this.lastChar,E,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,E,0,v.length),this.lastNeed-=v.length}function h(v,E){var x=u(this,v,E);if(!this.lastNeed)return v.toString("utf8",E);this.lastTotal=x;var N=v.length-(x-this.lastNeed);return v.copy(this.lastChar,0,N),v.toString("utf8",E,N)}function a(v){var E=v&&v.length?this.write(v):"";return this.lastNeed?E+"�":E}function p(v,E){if((v.length-E)%2===0){var x=v.toString("utf16le",E);if(x){var N=x.charCodeAt(x.length-1);if(N>=55296&&N<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1],x.slice(0,-1)}return x}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=v[v.length-1],v.toString("utf16le",E,v.length-1)}function d(v){var E=v&&v.length?this.write(v):"";if(this.lastNeed){var x=this.lastTotal-this.lastNeed;return E+this.lastChar.toString("utf16le",0,x)}return E}function I(v,E){var x=(v.length-E)%3;return x===0?v.toString("base64",E):(this.lastNeed=3-x,this.lastTotal=3,x===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",E,v.length-x))}function S(v){var E=v&&v.length?this.write(v):"";return this.lastNeed?E+this.lastChar.toString("base64",0,3-this.lastNeed):E}function w(v){return v.toString(this.encoding)}function R(v){return v&&v.length?this.write(v):""}return oo}var ao,Ti;function ss(){if(Ti)return ao;Ti=1;var e=dn().codes.ERR_STREAM_PREMATURE_CLOSE;function t(s){var u=!1;return function(){if(!u){u=!0;for(var i=arguments.length,f=new Array(i),h=0;h0)if(typeof B!="string"&&!D.objectMode&&Object.getPrototypeOf(B)!==r.prototype&&(B=s(B)),y)D.endEmitted?P(L,new v):ct(L,D,B,!0);else if(D.ended)P(L,new w);else{if(D.destroyed)return!1;D.reading=!1,D.decoder&&!b?(B=D.decoder.write(B),D.objectMode||B.length!==0?ct(L,D,B,!1):Nt(L,D)):ct(L,D,B,!1)}else y||(D.reading=!1,Nt(L,D))}return!D.ended&&(D.length=rt?L=rt:(L--,L|=L>>>1,L|=L>>>2,L|=L>>>4,L|=L>>>8,L|=L>>>16,L++),L}function At(L,B){return L<=0||B.length===0&&B.ended?0:B.objectMode?1:L!==L?B.flowing&&B.length?B.buffer.head.data.length:B.length:(L>B.highWaterMark&&(B.highWaterMark=pt(L)),L<=B.length?L:B.ended?B.length:(B.needReadable=!0,0))}q.prototype.read=function(L){f("read",L),L=parseInt(L,10);var B=this._readableState,b=L;if(L!==0&&(B.emittedReadable=!1),L===0&&B.needReadable&&((B.highWaterMark!==0?B.length>=B.highWaterMark:B.length>0)||B.ended))return f("read: emitReadable",B.length,B.ended),B.length===0&&B.ended?K(this):lt(this),null;if(L=At(L,B),L===0&&B.ended)return B.length===0&&K(this),null;var y=B.needReadable;f("need readable",y),(B.length===0||B.length-L0?k=Y(L,B):k=null,k===null?(B.needReadable=B.length<=B.highWaterMark,L=0):(B.length-=L,B.awaitDrain=0),B.length===0&&(B.ended||(B.needReadable=!0),b!==L&&B.ended&&K(this)),k!==null&&this.emit("data",k),k};function Et(L,B){if(f("onEofChunk"),!B.ended){if(B.decoder){var b=B.decoder.end();b&&b.length&&(B.buffer.push(b),B.length+=B.objectMode?1:b.length)}B.ended=!0,B.sync?lt(L):(B.needReadable=!1,B.emittedReadable||(B.emittedReadable=!0,mt(L)))}}function lt(L){var B=L._readableState;f("emitReadable",B.needReadable,B.emittedReadable),B.needReadable=!1,B.emittedReadable||(f("emitReadable",B.flowing),B.emittedReadable=!0,vt.nextTick(mt,L))}function mt(L){var B=L._readableState;f("emitReadable_",B.destroyed,B.length,B.ended),!B.destroyed&&(B.length||B.ended)&&(L.emit("readable"),B.emittedReadable=!1),B.needReadable=!B.flowing&&!B.ended&&B.length<=B.highWaterMark,T(L)}function Nt(L,B){B.readingMore||(B.readingMore=!0,vt.nextTick(yt,L,B))}function yt(L,B){for(;!B.reading&&!B.ended&&(B.length1&&st(y.pipes,L)!==-1)&&!wt&&(f("false write response, pause",y.awaitDrain),y.awaitDrain++),b.pause())}function gt($t){f("onerror",$t),ne(),L.removeListener("error",gt),t(L,"error")===0&&P(L,$t)}F(L,"error",gt);function Ut(){L.removeListener("finish",Wt),ne()}L.once("close",Ut);function Wt(){f("onfinish"),L.removeListener("close",Ut),ne()}L.once("finish",Wt);function ne(){f("unpipe"),b.unpipe(L)}return L.emit("pipe",b),y.flowing||(f("pipe resume"),b.resume()),L};function Tt(L){return function(){var B=L._readableState;f("pipeOnDrain",B.awaitDrain),B.awaitDrain&&B.awaitDrain--,B.awaitDrain===0&&t(L,"data")&&(B.flowing=!0,T(L))}}q.prototype.unpipe=function(L){var B=this._readableState,b={hasUnpiped:!1};if(B.pipesCount===0)return this;if(B.pipesCount===1)return L&&L!==B.pipes?this:(L||(L=B.pipes),B.pipes=null,B.pipesCount=0,B.flowing=!1,L&&L.emit("unpipe",this,b),this);if(!L){var y=B.pipes,k=B.pipesCount;B.pipes=null,B.pipesCount=0,B.flowing=!1;for(var D=0;D0,y.flowing!==!1&&this.resume()):L==="readable"&&!y.endEmitted&&!y.readableListening&&(y.readableListening=y.needReadable=!0,y.flowing=!1,y.emittedReadable=!1,f("on readable",y.length,y.reading),y.length?lt(this):y.reading||vt.nextTick(z,this)),b},q.prototype.addListener=q.prototype.on,q.prototype.removeListener=function(L,B){var b=n.prototype.removeListener.call(this,L,B);return L==="readable"&&vt.nextTick(ft,this),b},q.prototype.removeAllListeners=function(L){var B=n.prototype.removeAllListeners.apply(this,arguments);return(L==="readable"||L===void 0)&&vt.nextTick(ft,this),B};function ft(L){var B=L._readableState;B.readableListening=L.listenerCount("readable")>0,B.resumeScheduled&&!B.paused?B.flowing=!0:L.listenerCount("data")>0&&L.resume()}function z(L){f("readable nexttick read 0"),L.read(0)}q.prototype.resume=function(){var L=this._readableState;return L.flowing||(f("resume"),L.flowing=!L.readableListening,H(this,L)),L.paused=!1,this};function H(L,B){B.resumeScheduled||(B.resumeScheduled=!0,vt.nextTick(Q,L,B))}function Q(L,B){f("resume",B.reading),B.reading||L.read(0),B.resumeScheduled=!1,L.emit("resume"),T(L),B.flowing&&!B.reading&&L.read(0)}q.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function T(L){var B=L._readableState;for(f("flow",B.flowing);B.flowing&&L.read()!==null;);}q.prototype.wrap=function(L){var B=this,b=this._readableState,y=!1;L.on("end",function(){if(f("wrapped end"),b.decoder&&!b.ended){var ot=b.decoder.end();ot&&ot.length&&B.push(ot)}B.push(null)}),L.on("data",function(ot){if(f("wrapped data"),b.decoder&&(ot=b.decoder.write(ot)),!(b.objectMode&&ot==null)&&!(!b.objectMode&&(!ot||!ot.length))){var _t=B.push(ot);_t||(y=!0,L.pause())}});for(var k in L)this[k]===void 0&&typeof L[k]=="function"&&(this[k]=(function(ot){return function(){return L[ot].apply(L,arguments)}})(k));for(var D=0;D=B.length?(B.decoder?b=B.buffer.join(""):B.buffer.length===1?b=B.buffer.first():b=B.buffer.concat(B.length),B.buffer.clear()):b=B.buffer.consume(L,B.decoder),b}function K(L){var B=L._readableState;f("endReadable",B.endEmitted),B.endEmitted||(B.ended=!0,vt.nextTick(nt,B,L))}function nt(L,B){if(f("endReadableNT",L.endEmitted,L.length),!L.endEmitted&&L.length===0&&(L.endEmitted=!0,B.readable=!1,B.emit("end"),L.autoDestroy)){var b=B._writableState;(!b||b.autoDestroy&&b.finished)&&B.destroy()}}typeof Symbol=="function"&&(q.from=function(L,B){return N===void 0&&(N=Kf()),N(q,L,B)});function st(L,B){for(var b=0,y=L.length;b0;return i(E,N,P,function(M){R||(R=M),M&&v.forEach(f),!N&&(v.forEach(f),w(R))})});return I.reduce(h)}return fo=p,fo}var ho,zi;function nh(){if(zi)return ho;zi=1,ho=n;var e=ts().EventEmitter,t=Qe();t(n,e),n.Readable=dc(),n.Writable=pc(),n.Duplex=fn(),n.Transform=gc(),n.PassThrough=th(),n.finished=ss(),n.pipeline=eh(),n.Stream=n;function n(){e.call(this)}return n.prototype.pipe=function(r,o){var s=this;function u(I){r.writable&&r.write(I)===!1&&s.pause&&s.pause()}s.on("data",u);function i(){s.readable&&s.resume&&s.resume()}r.on("drain",i),!r._isStdio&&(!o||o.end!==!1)&&(s.on("end",h),s.on("close",a));var f=!1;function h(){f||(f=!0,r.end())}function a(){f||(f=!0,typeof r.destroy=="function"&&r.destroy())}function p(I){if(d(),e.listenerCount(this,"error")===0)throw I}s.on("error",p),r.on("error",p);function d(){s.removeListener("data",u),r.removeListener("drain",i),s.removeListener("end",h),s.removeListener("close",a),s.removeListener("error",p),r.removeListener("error",p),s.removeListener("end",d),s.removeListener("close",d),r.removeListener("close",d)}return s.on("end",d),s.on("close",d),r.on("close",d),r.emit("pipe",s),r},ho}var Wi;function rh(){return Wi||(Wi=1,(function(e){(function(t){t.parser=function(b,y){return new r(b,y)},t.SAXParser=r,t.SAXStream=p,t.createStream=h,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(b,y){if(!(this instanceof r))return new r(b,y);var k=this;s(k),k.q=k.c="",k.bufferCheckPosition=t.MAX_BUFFER_LENGTH,k.encoding=null,k.opt=y||{},k.opt.lowercase=k.opt.lowercase||k.opt.lowercasetags,k.looseCase=k.opt.lowercase?"toLowerCase":"toUpperCase",k.opt.maxEntityCount=k.opt.maxEntityCount||512,k.opt.maxEntityDepth=k.opt.maxEntityDepth||4,k.entityCount=k.entityDepth=0,k.tags=[],k.closed=k.closedRoot=k.sawRoot=!1,k.tag=k.error=null,k.strict=!!b,k.noscript=!!(b||k.opt.noscript),k.state=j.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(R)),k.opt.unquotedAttributeValues===void 0&&(k.opt.unquotedAttributeValues=!b),k.trackPosition=k.opt.position!==!1,k.trackPosition&&(k.position=k.line=k.column=0),G(k,"onready")}Object.create||(Object.create=function(b){function y(){}y.prototype=b;var k=new y;return k}),Object.keys||(Object.keys=function(b){var y=[];for(var k in b)b.hasOwnProperty(k)&&y.push(k);return y});function o(b){for(var y=Math.max(t.MAX_BUFFER_LENGTH,10),k=0,D=0,ot=n.length;Dy)switch(n[D]){case"textNode":mt(b);break;case"cdata":lt(b,"oncdata",b.cdata),b.cdata="";break;case"script":lt(b,"onscript",b.script),b.script="";break;default:yt(b,"Max buffer length exceeded: "+n[D])}k=Math.max(k,_t)}var X=t.MAX_BUFFER_LENGTH-k;b.bufferCheckPosition=X+b.position}function s(b){for(var y=0,k=n.length;y=2){if(b[0]===255&&b[1]===254)return"utf-16le";if(b[0]===254&&b[1]===255)return"utf-16be"}return b.length>=3&&b[0]===239&&b[1]===187&&b[2]===191?"utf8":b.length>=4?b[0]===60&&b[1]===0&&b[2]===63&&b[3]===0?"utf-16le":b[0]===0&&b[1]===60&&b[2]===0&&b[3]===63?"utf-16be":"utf8":y?"utf8":null}function p(b,y){if(!(this instanceof p))return new p(b,y);i.apply(this),this._parser=new r(b,y),this.writable=!0,this.readable=!0;var k=this;this._parser.onend=function(){k.emit("end")},this._parser.onerror=function(D){k.emit("error",D),k._parser.error=null},this._decoder=null,this._decoderBuffer=null,f.forEach(function(D){Object.defineProperty(k,"on"+D,{get:function(){return k._parser["on"+D]},set:function(ot){if(!ot)return k.removeAllListeners(D),k._parser["on"+D]=ot,ot;k.on(D,ot)},enumerable:!0,configurable:!1})})}p.prototype=Object.create(i.prototype,{constructor:{value:p}}),p.prototype._decodeBuffer=function(b,y){if(this._decoderBuffer&&(b=rn.concat([this._decoderBuffer,b]),this._decoderBuffer=null),!this._decoder){var k=a(b,y);if(!k)return this._decoderBuffer=b,"";this._parser.encoding=k,this._decoder=new TextDecoder(k)}return this._decoder.decode(b,{stream:!y})},p.prototype.write=function(b){if(typeof rn=="function"&&typeof rn.isBuffer=="function"&&rn.isBuffer(b))b=this._decodeBuffer(b,!1);else if(this._decoderBuffer){var y=this._decodeBuffer(rn.alloc(0),!0);y&&(this._parser.write(y),this.emit("data",y))}return this._parser.write(b.toString()),this.emit("data",b),!0},p.prototype.end=function(b){if(b&&b.length&&this.write(b),this._decoderBuffer){var y=this._decodeBuffer(rn.alloc(0),!0);y&&(this._parser.write(y),this.emit("data",y))}else if(this._decoder){var k=this._decoder.decode();k&&(this._parser.write(k),this.emit("data",k))}return this._parser.end(),!0},p.prototype.on=function(b,y){var k=this;return!k._parser["on"+b]&&f.indexOf(b)!==-1&&(k._parser["on"+b]=function(){var D=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);D.splice(0,0,b),k.emit.apply(k,D)}),i.prototype.on.call(k,b,y)};var d=/^\[CDATA\[$/i,I=/^DOCTYPE$/i,S="http://www.w3.org/XML/1998/namespace",w="http://www.w3.org/2000/xmlns/",R={xml:S,xmlns:w},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]/,E=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,x=/[#:_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=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function P(b){return b===" "||b===` `||b==="\r"||b===" "}function M(b){return b==='"'||b==="'"}function F(b){return b===">"||P(b)}function O(b,y){return b.test(y)}function q(b,y){return!O(b,y)}var j=0;t.STATE={BEGIN:j++,BEGIN_WHITESPACE:j++,TEXT:j++,TEXT_ENTITY:j++,OPEN_WAKA:j++,SGML_DECL:j++,SGML_DECL_QUOTED:j++,DOCTYPE:j++,DOCTYPE_QUOTED:j++,DOCTYPE_DTD:j++,DOCTYPE_DTD_QUOTED:j++,COMMENT_STARTING:j++,COMMENT:j++,COMMENT_ENDING:j++,COMMENT_ENDED:j++,CDATA:j++,CDATA_ENDING:j++,CDATA_ENDING_2:j++,PROC_INST:j++,PROC_INST_BODY:j++,PROC_INST_ENDING:j++,OPEN_TAG:j++,OPEN_TAG_SLASH:j++,ATTRIB:j++,ATTRIB_NAME:j++,ATTRIB_NAME_SAW_WHITE:j++,ATTRIB_VALUE:j++,ATTRIB_VALUE_QUOTED:j++,ATTRIB_VALUE_CLOSED:j++,ATTRIB_VALUE_UNQUOTED:j++,ATTRIB_VALUE_ENTITY_Q:j++,ATTRIB_VALUE_ENTITY_U:j++,CLOSE_TAG:j++,CLOSE_TAG_SAW_WHITE:j++,SCRIPT:j++,SCRIPT_ENDING:j++},t.XML_ENTITIES=Object.assign(Object.create(null),{amp:"&",gt:">",lt:"<",quot:'"',apos:"'"}),t.ENTITIES=Object.assign(Object.create(null),{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(b){var y=t.ENTITIES[b],k=typeof y=="number"?String.fromCharCode(y):y;t.ENTITIES[b]=k});for(var ct in t.STATE)t.STATE[t.STATE[ct]]=ct;j=t.STATE;function G(b,y,k){b[y]&&b[y](k)}function rt(b){var y=b&&b.match(/(?:^|\s)encoding\s*=\s*(['"])([^'"]+)\1/i);return y?y[2]:null}function pt(b){return b?b.toLowerCase().replace(/[^a-z0-9]/g,""):null}function At(b,y){const k=pt(b),D=pt(y);return!k||!D?!0:D==="utf16"?k==="utf16le"||k==="utf16be":k===D}function Et(b,y){if(!(!b.strict||!b.encoding||!y||y.name!=="xml")){var k=rt(y.body);k&&!At(b.encoding,k)&&ft(b,"XML declaration encoding "+k+" does not match detected stream encoding "+b.encoding.toUpperCase())}}function lt(b,y,k){b.textNode&&mt(b),G(b,y,k)}function mt(b){b.textNode=Nt(b.opt,b.textNode),b.textNode&&G(b,"ontext",b.textNode),b.textNode=""}function Nt(b,y){return b.trim&&(y=y.trim()),b.normalize&&(y=y.replace(/\s+/g," ")),y}function yt(b,y){return mt(b),b.trackPosition&&(y+=` Line: `+b.line+` Column: `+b.column+` Char: `+b.c),y=new Error(y),b.error=y,G(b,"onerror",y),b}function Tt(b){return b.sawRoot&&!b.closedRoot&&ft(b,"Unclosed root tag"),b.state!==j.BEGIN&&b.state!==j.BEGIN_WHITESPACE&&b.state!==j.TEXT&&yt(b,"Unexpected end"),mt(b),b.c="",b.closed=!0,G(b,"onend"),r.call(b,b.strict,b.opt),b}function ft(b,y){if(typeof b!="object"||!(b instanceof r))throw new Error("bad call to strictFail");b.strict&&yt(b,y)}function z(b){b.strict||(b.tagName=b.tagName[b.looseCase]());var y=b.tags[b.tags.length-1]||b,k=b.tag={name:b.tagName,attributes:{}};b.opt.xmlns&&(k.ns=y.ns),b.attribList.length=0,lt(b,"onopentagstart",k)}function H(b,y){var k=b.indexOf(":"),D=k<0?["",b]:b.split(":"),ot=D[0],_t=D[1];return y&&b==="xmlns"&&(ot="xmlns",_t=""),{prefix:ot,local:_t}}function Q(b){if(b.strict||(b.attribName=b.attribName[b.looseCase]()),b.attribList.indexOf(b.attribName)!==-1||b.tag.attributes.hasOwnProperty(b.attribName)){b.attribName=b.attribValue="";return}if(b.opt.xmlns){var y=H(b.attribName,!0),k=y.prefix,D=y.local;if(k==="xmlns")if(D==="xml"&&b.attribValue!==S)ft(b,"xml: prefix must be bound to "+S+` Actual: `+b.attribValue);else if(D==="xmlns"&&b.attribValue!==w)ft(b,"xmlns: prefix must be bound to "+w+` Actual: `+b.attribValue);else{var ot=b.tag,_t=b.tags[b.tags.length-1]||b;ot.ns===_t.ns&&(ot.ns=Object.create(_t.ns)),ot.ns[D]=b.attribValue}b.attribList.push([b.attribName,b.attribValue])}else b.tag.attributes[b.attribName]=b.attribValue,lt(b,"onattribute",{name:b.attribName,value:b.attribValue});b.attribName=b.attribValue=""}function T(b,y){if(b.opt.xmlns){var k=b.tag,D=H(b.tagName);k.prefix=D.prefix,k.local=D.local,k.uri=k.ns[D.prefix]||"",k.prefix&&!k.uri&&(ft(b,"Unbound namespace prefix: "+JSON.stringify(b.tagName)),k.uri=D.prefix);var ot=b.tags[b.tags.length-1]||b;k.ns&&ot.ns!==k.ns&&Object.keys(k.ns).forEach(function(Pt){lt(b,"onopennamespace",{prefix:Pt,uri:k.ns[Pt]})});for(var _t=0,X=b.attribList.length;_t",b.tagName="",b.state=j.SCRIPT;return}lt(b,"onscript",b.script),b.script=""}var y=b.tags.length,k=b.tagName;b.strict||(k=k[b.looseCase]());for(var D=k;y--;){var ot=b.tags[y];if(ot.name!==D)ft(b,"Unexpected close tag");else break}if(y<0){ft(b,"Unmatched closing tag: "+b.tagName),b.textNode+="",b.state=j.TEXT;return}b.tagName=k;for(var _t=b.tags.length;_t-- >y;){var X=b.tag=b.tags.pop();b.tagName=b.tag.name,lt(b,"onclosetag",b.tagName);var wt={};for(var Bt in X.ns)wt[Bt]=X.ns[Bt];var dt=b.tags[b.tags.length-1]||b;b.opt.xmlns&&X.ns!==dt.ns&&Object.keys(X.ns).forEach(function(gt){var Ut=X.ns[gt];lt(b,"onclosenamespace",{prefix:gt,uri:Ut})})}y===0&&(b.closedRoot=!0),b.tagName=b.attribValue=b.attribName="",b.attribList.length=0,b.state=j.TEXT}function K(b){var y=b.entity,k=y.toLowerCase(),D,ot="";return b.ENTITIES[y]?b.ENTITIES[y]:b.ENTITIES[k]?b.ENTITIES[k]:(y=k,y.charAt(0)==="#"&&(y.charAt(1)==="x"?(y=y.slice(2),D=parseInt(y,16),ot=D.toString(16)):(y=y.slice(1),D=parseInt(y,10),ot=D.toString(10))),y=y.replace(/^0+/,""),isNaN(D)||ot.toLowerCase()!==y||D<0||D>1114111||!nt(D)?(ft(b,"Invalid character entity"),"&"+b.entity+";"):String.fromCodePoint(D))}function nt(b){return b===9||b===10||b===13||b>=32&&b<=55295||b>=57344&&b<=65533||b>=65536&&b<=1114111}function st(b,y){y==="<"?(b.state=j.OPEN_WAKA,b.startTagPosition=b.position):P(y)||(ft(b,"Non-whitespace before first tag."),b.textNode=y,b.state=j.TEXT)}function L(b,y){var k="";return y"?(lt(y,"onsgmldeclaration",y.sgmlDecl),y.sgmlDecl="",y.state=j.TEXT):(M(D)&&(y.state=j.SGML_DECL_QUOTED),y.sgmlDecl+=D);continue;case j.SGML_DECL_QUOTED:D===y.q&&(y.state=j.SGML_DECL,y.q=""),y.sgmlDecl+=D;continue;case j.DOCTYPE:D===">"?(y.state=j.TEXT,lt(y,"ondoctype",y.doctype),y.doctype=!0):(y.doctype+=D,D==="["?y.state=j.DOCTYPE_DTD:M(D)&&(y.state=j.DOCTYPE_QUOTED,y.q=D));continue;case j.DOCTYPE_QUOTED:y.doctype+=D,D===y.q&&(y.q="",y.state=j.DOCTYPE);continue;case j.DOCTYPE_DTD:D==="]"?(y.doctype+=D,y.state=j.DOCTYPE):D==="<"?(y.state=j.OPEN_WAKA,y.startTagPosition=y.position):M(D)?(y.doctype+=D,y.state=j.DOCTYPE_DTD_QUOTED,y.q=D):y.doctype+=D;continue;case j.DOCTYPE_DTD_QUOTED:y.doctype+=D,D===y.q&&(y.state=j.DOCTYPE_DTD,y.q="");continue;case j.COMMENT:D==="-"?y.state=j.COMMENT_ENDING:y.comment+=D;continue;case j.COMMENT_ENDING:D==="-"?(y.state=j.COMMENT_ENDED,y.comment=Nt(y.opt,y.comment),y.comment&<(y,"oncomment",y.comment),y.comment=""):(y.comment+="-"+D,y.state=j.COMMENT);continue;case j.COMMENT_ENDED:D!==">"?(ft(y,"Malformed comment"),y.comment+="--"+D,y.state=j.COMMENT):y.doctype&&y.doctype!==!0?y.state=j.DOCTYPE_DTD:y.state=j.TEXT;continue;case j.CDATA:for(var ot=k-1;D&&D!=="]";)D=L(b,k++),D&&y.trackPosition&&(y.position++,D===` `?(y.line++,y.column=0):y.column++);y.cdata+=b.substring(ot,k-1),D==="]"&&(y.state=j.CDATA_ENDING);continue;case j.CDATA_ENDING:D==="]"?y.state=j.CDATA_ENDING_2:(y.cdata+="]"+D,y.state=j.CDATA);continue;case j.CDATA_ENDING_2:D===">"?(y.cdata&<(y,"oncdata",y.cdata),lt(y,"onclosecdata"),y.cdata="",y.state=j.TEXT):D==="]"?y.cdata+="]":(y.cdata+="]]"+D,y.state=j.CDATA);continue;case j.PROC_INST:D==="?"?y.state=j.PROC_INST_ENDING:P(D)?y.state=j.PROC_INST_BODY:y.procInstName+=D;continue;case j.PROC_INST_BODY:if(!y.procInstBody&&P(D))continue;D==="?"?y.state=j.PROC_INST_ENDING:y.procInstBody+=D;continue;case j.PROC_INST_ENDING:if(D===">"){const dt={name:y.procInstName,body:y.procInstBody};Et(y,dt),lt(y,"onprocessinginstruction",dt),y.procInstName=y.procInstBody="",y.state=j.TEXT}else y.procInstBody+="?"+D,y.state=j.PROC_INST_BODY;continue;case j.OPEN_TAG:O(E,D)?y.tagName+=D:(z(y),D===">"?T(y):D==="/"?y.state=j.OPEN_TAG_SLASH:(P(D)||ft(y,"Invalid character in tag name"),y.state=j.ATTRIB));continue;case j.OPEN_TAG_SLASH:D===">"?(T(y,!0),Y(y)):(ft(y,"Forward-slash in opening tag not followed by >"),y.state=j.ATTRIB);continue;case j.ATTRIB:if(P(D))continue;D===">"?T(y):D==="/"?y.state=j.OPEN_TAG_SLASH:O(v,D)?(y.attribName=D,y.attribValue="",y.state=j.ATTRIB_NAME):ft(y,"Invalid attribute name");continue;case j.ATTRIB_NAME:D==="="?y.state=j.ATTRIB_VALUE:D===">"?(ft(y,"Attribute without value"),y.attribValue=y.attribName,Q(y),T(y)):P(D)?y.state=j.ATTRIB_NAME_SAW_WHITE:O(E,D)?y.attribName+=D:ft(y,"Invalid attribute name");continue;case j.ATTRIB_NAME_SAW_WHITE:if(D==="=")y.state=j.ATTRIB_VALUE;else{if(P(D))continue;ft(y,"Attribute without value"),y.tag.attributes[y.attribName]="",y.attribValue="",lt(y,"onattribute",{name:y.attribName,value:""}),y.attribName="",D===">"?T(y):O(v,D)?(y.attribName=D,y.state=j.ATTRIB_NAME):(ft(y,"Invalid attribute name"),y.state=j.ATTRIB)}continue;case j.ATTRIB_VALUE:if(P(D))continue;M(D)?(y.q=D,y.state=j.ATTRIB_VALUE_QUOTED):(y.opt.unquotedAttributeValues||yt(y,"Unquoted attribute value"),y.state=j.ATTRIB_VALUE_UNQUOTED,y.attribValue=D);continue;case j.ATTRIB_VALUE_QUOTED:if(D!==y.q){D==="&"?y.state=j.ATTRIB_VALUE_ENTITY_Q:y.attribValue+=D;continue}Q(y),y.q="",y.state=j.ATTRIB_VALUE_CLOSED;continue;case j.ATTRIB_VALUE_CLOSED:P(D)?y.state=j.ATTRIB:D===">"?T(y):D==="/"?y.state=j.OPEN_TAG_SLASH:O(v,D)?(ft(y,"No whitespace between attributes"),y.attribName=D,y.attribValue="",y.state=j.ATTRIB_NAME):ft(y,"Invalid attribute name");continue;case j.ATTRIB_VALUE_UNQUOTED:if(!F(D)){D==="&"?y.state=j.ATTRIB_VALUE_ENTITY_U:y.attribValue+=D;continue}Q(y),D===">"?T(y):y.state=j.ATTRIB;continue;case j.CLOSE_TAG:if(y.tagName)D===">"?Y(y):O(E,D)?y.tagName+=D:y.script?(y.script+=""?Y(y):ft(y,"Invalid characters in closing tag");continue;case j.TEXT_ENTITY:case j.ATTRIB_VALUE_ENTITY_Q:case j.ATTRIB_VALUE_ENTITY_U:var X,wt;switch(y.state){case j.TEXT_ENTITY:X=j.TEXT,wt="textNode";break;case j.ATTRIB_VALUE_ENTITY_Q:X=j.ATTRIB_VALUE_QUOTED,wt="attribValue";break;case j.ATTRIB_VALUE_ENTITY_U:X=j.ATTRIB_VALUE_UNQUOTED,wt="attribValue";break}if(D===";"){var Bt=K(y);y.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(Bt)?((y.entityCount+=1)>y.opt.maxEntityCount&&yt(y,"Parsed entity count exceeds max entity count"),(y.entityDepth+=1)>y.opt.maxEntityDepth&&yt(y,"Parsed entity depth exceeds max entity depth"),y.entity="",y.state=X,y.write(Bt),y.entityDepth-=1):(y[wt]+=Bt,y.entity="",y.state=X)}else O(y.entity.length?N:x,D)?y.entity+=D:(ft(y,"Invalid character in entity name"),y[wt]+="&"+y.entity+D,y.entity="",y.state=X);continue;default:throw new Error(y,"Unknown state: "+y.state)}return y.position>=y.bufferCheckPosition&&o(y),y}String.fromCodePoint||(function(){var b=String.fromCharCode,y=Math.floor,k=function(){var D=16384,ot=[],_t,X,wt=-1,Bt=arguments.length;if(!Bt)return"";for(var dt="";++wt1114111||y(gt)!==gt)throw RangeError("Invalid code point: "+gt);gt<=65535?ot.push(gt):(gt-=65536,_t=(gt>>10)+55296,X=gt%1024+56320,ot.push(_t,X)),(wt+1===Bt||ot.length>D)&&(dt+=b.apply(null,ot),ot.length=0)}return dt};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:k,configurable:!0,writable:!0}):String.fromCodePoint=k})()})(e)})(Ys)),Ys}var oh=rh();const sh=Qo(oh),ah={"http://www.w3.org/2000/svg":{ext:"svg",mime:"image/svg+xml"},"http://www.w3.org/1999/xhtml":{ext:"xhtml",mime:"application/xhtml+xml"},"http://www.opengis.net/kml/2.2":{ext:"kml",mime:"application/vnd.google-earth.kml+xml"},"http://www.opengis.net/gml":{ext:"gml",mime:"application/gml+xml"}},ih={rss:{ext:"rss",mime:"application/rss+xml"},"score-partwise":{ext:"musicxml",mime:"application/vnd.recordare.musicxml+xml"},svg:{ext:"svg",mime:"image/svg+xml"}};class uh{constructor(t){this.options=t??{},this.firstTag=!0,this.onEnd=!1,this.parser=sh.parser(!0,{xmlns:!0}),this.nesting=0,this.parser.onerror=n=>{n.message.startsWith("Invalid character entity")||(this.fileType=void 0,this.onEnd=!0)},this.parser.onopentag=n=>{++this.nesting,!(!this.firstTag||this.onEnd)&&(this.firstTag=!1,n.uri?this.fileType=ah[n.uri]:n.name&&(this.fileType=ih[n.name.toLowerCase()]),this.fileType&&!this.options.fullScan&&(this.onEnd=!0))},this.parser.onclosetag=()=>{--this.nesting}}write(t){this.parser.write(t)}close(){this.parser.close(),this.onEnd=!0}isValid(){return this.nesting===0}}function ch(e,{validate:t=!0}={}){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);if(e=e.trim(),e.length===0)return!1;const n=new uh({fullScan:t});if(t){if(n.write(e),!n.isValid())return!1}else{let r=0;for(;e.length>r&&!n.onEnd;)n.write(e.slice(r,Math.min(r+128,e.length))),r+=128}return n.fileType?.ext==="svg"}function as(e,t,n){const r=`#initial-state-${e}-${t}`;if(window._nc_initial_state?.has(r))return window._nc_initial_state.get(r);window._nc_initial_state||(window._nc_initial_state=new Map);const o=document.querySelector(r);if(o===null)return n;try{const s=JSON.parse(atob(o.value));return window._nc_initial_state.set(r,s),s}catch(s){return console.error("[@nextcloud/initial-state] Could not parse initial state",{key:t,app:e,error:s}),n}}function Yi(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n2?n-2:0),o=2;o1?t-1:0),r=1;r"u"?null:Qt(BigInt.prototype.toString),Zi=typeof Symbol>"u"?null:Qt(Symbol.prototype.toString),me=Qt(Object.prototype.hasOwnProperty),En=Qt(Object.prototype.toString),ie=Qt(RegExp.prototype.test),Ye=Ah(TypeError);function Qt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o2&&arguments[2]!==void 0?arguments[2]:In;if(Hi&&Hi(e,null),!cn(t))return e;let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const s=n(o);s!==o&&(gh(t)||(t[r]=s),o=s)}e[o]=!0}return e}function Sh(e){for(let t=0;t/g),Lh=re(/\${[\w\W]*/g),Bh=re(/^data-[\-\w.\u00B7-\uFFFF]+$/),jh=re(/^aria-[\-\w]+$/),ru=re(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Dh=re(/^(?:\w+script|data):/i),Mh=re(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Th=re(/^html$/i),Uh=re(/^[a-z][.\w]*(-[.\w]+)+$/i),ou=re(/<[/\w!]/g),su=re(/<[/\w]/g),kh=re(/<\/no(script|embed|frames)/i),$h=re(/\/>/i),be={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},bc=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Fh=Zt(It({},bc)),Gh=(function(){const e={};return Je(bc,t=>{e[t]=re(new RegExp("])","i"))}),Zt(e)})(),Oh=function(){return typeof window>"u"?null:window},Vh=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},au=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},$e=function(e,t,n,r){return me(e,t)&&cn(e[t])?It(r.base?ve(r.base):{},e[t],r.transform):n},wo=function(e,t,n){const r=me(e,t)?e[t]:void 0;return r&&typeof r=="object"?ve(r):n()};function wc(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Oh();const t=C=>wc(C);if(t.version="3.4.15",t.removed=[],!e||!e.document||e.document.nodeType!==be.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const r=n,o=r.currentScript;e.DocumentFragment;const s=e.HTMLTemplateElement,u=e.Node,i=e.Element,f=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const a=e.DOMParser,p=e.trustedTypes,d=i.prototype,I=Ae(d,"cloneNode"),S=Ae(d,"remove"),w=Ae(d,"removeAttributeNode"),R=Ae(d,"nextSibling"),v=Ae(d,"childNodes"),E=Ae(d,"parentNode"),x=Ae(d,"shadowRoot"),N=Ae(d,"attributes"),P=u&&u.prototype?Ae(u.prototype,"nodeType"):null,M=u&&u.prototype?Ae(u.prototype,"nodeName"):null,F=u&&u.prototype?Ae(u.prototype,"ownerDocument"):null,O=function(C){return P?P(C):C.nodeType},q=function(C){return M?M(C):C.nodeName};if(typeof s=="function"){const C=n.createElement("template");C.content&&C.content.ownerDocument&&(n=C.content.ownerDocument)}let j,ct="",G,rt=!1,pt=0;const At=function(){if(pt>0)throw Ye('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Et=function(C){At(),pt++;try{return j.createHTML(C)}finally{pt--}},lt=function(C){At(),pt++;try{return j.createScriptURL(C)}finally{pt--}},mt=function(){return rt||(G=Vh(p,o),rt=!0),G},Nt=n,yt=Nt.implementation,Tt=Nt.createNodeIterator,ft=Nt.createDocumentFragment,z=Nt.getElementsByTagName,H=r.importNode;let Q=au();t.isSupported=typeof mc=="function"&&typeof E=="function"&&yt&&yt.createHTMLDocument!==void 0;const T=Ph,Y=Ch,K=Lh,nt=Bh,st=jh,L=Dh,B=Mh,b=Uh;let y=ru,k=null;const D=It({},[...Ki,...go,...mo,...yo,...tu]);let ot=null;const _t=It({},[...eu,...bo,...nu,...Vn]);let X=Object.seal(on(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),wt=null,Bt=null;const dt=Object.seal(on(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let gt=!0,Ut=!0,Wt=!1,ne=!0,$t=!1,Pt=!0,se=!1,c=!1,g=null,_=null,$=!1,V=!1,Z=!1,at=!1,xt=!0,Ft=!1;const Ct="user-content-";let Rt=!0,Dt=!1,Ie={},oe=null;const Ze=It({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Dn=null;const Re=It({},["audio","video","img","source","image","track"]);let Mn=null;const l=It({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),m="http://www.w3.org/1998/Math/MathML",A="http://www.w3.org/2000/svg",U="http://www.w3.org/1999/xhtml";let W=U,tt=!1,it=null;const Mt=It({},[m,A,U],po),Jt=Zt(["mi","mo","mn","ms","mtext"]);let jt=It({},Jt);const Lt=Zt(["annotation-xml"]);let Gt=It({},Lt);const al=It({},["title","style","font","a","script"]);let mn=null;const il=["application/xhtml+xml","text/html"],ul="text/html";let Yt=null,Ke=null;const cl=n.createElement("form"),ws=function(C){return C instanceof RegExp||C instanceof Function},ur=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ke&&Ke===C)return;(!C||typeof C!="object")&&(C={}),C=ve(C),mn=il.indexOf(C.PARSER_MEDIA_TYPE)===-1?ul:C.PARSER_MEDIA_TYPE,Yt=mn==="application/xhtml+xml"?po:In,k=$e(C,"ALLOWED_TAGS",D,{transform:Yt}),ot=$e(C,"ALLOWED_ATTR",_t,{transform:Yt}),it=$e(C,"ALLOWED_NAMESPACES",Mt,{transform:po}),Mn=$e(C,"ADD_URI_SAFE_ATTR",l,{transform:Yt,base:l}),Dn=$e(C,"ADD_DATA_URI_TAGS",Re,{transform:Yt,base:Re}),oe=$e(C,"FORBID_CONTENTS",Ze,{transform:Yt}),wt=$e(C,"FORBID_TAGS",ve({}),{transform:Yt}),Bt=$e(C,"FORBID_ATTR",ve({}),{transform:Yt}),Ie=me(C,"USE_PROFILES")?C.USE_PROFILES&&typeof C.USE_PROFILES=="object"?ve(C.USE_PROFILES):C.USE_PROFILES:!1,gt=C.ALLOW_ARIA_ATTR!==!1,Ut=C.ALLOW_DATA_ATTR!==!1,Wt=C.ALLOW_UNKNOWN_PROTOCOLS||!1,ne=C.ALLOW_SELF_CLOSE_IN_ATTR!==!1,$t=C.SAFE_FOR_TEMPLATES||!1,Pt=C.SAFE_FOR_XML!==!1,se=C.WHOLE_DOCUMENT||!1,V=C.RETURN_DOM||!1,Z=C.RETURN_DOM_FRAGMENT||!1,at=C.RETURN_TRUSTED_TYPE||!1,$=C.FORCE_BODY||!1,xt=C.SANITIZE_DOM!==!1,Ft=C.SANITIZE_NAMED_PROPS||!1,Rt=C.KEEP_CONTENT!==!1,Dt=C.IN_PLACE||!1,y=Ih(C.ALLOWED_URI_REGEXP)?C.ALLOWED_URI_REGEXP:ru,W=typeof C.NAMESPACE=="string"?C.NAMESPACE:U,jt=wo(C,"MATHML_TEXT_INTEGRATION_POINTS",()=>It({},Jt)),Gt=wo(C,"HTML_INTEGRATION_POINTS",()=>It({},Lt));const J=wo(C,"CUSTOM_ELEMENT_HANDLING",()=>on(null));if(X=on(null),me(J,"tagNameCheck")&&ws(J.tagNameCheck)&&(X.tagNameCheck=J.tagNameCheck),me(J,"attributeNameCheck")&&ws(J.attributeNameCheck)&&(X.attributeNameCheck=J.attributeNameCheck),me(J,"allowCustomizedBuiltInElements")&&typeof J.allowCustomizedBuiltInElements=="boolean"&&(X.allowCustomizedBuiltInElements=J.allowCustomizedBuiltInElements),re(X),$t&&(Ut=!1),Z&&(V=!0),Ie&&(k=It({},tu),ot=on(null),Ie.html===!0&&(It(k,Ki),It(ot,eu)),Ie.svg===!0&&(It(k,go),It(ot,bo),It(ot,Vn)),Ie.svgFilters===!0&&(It(k,mo),It(ot,bo),It(ot,Vn)),Ie.mathMl===!0&&(It(k,yo),It(ot,nu),It(ot,Vn))),dt.tagCheck=null,dt.attributeCheck=null,me(C,"ADD_TAGS")&&(typeof C.ADD_TAGS=="function"?dt.tagCheck=C.ADD_TAGS:cn(C.ADD_TAGS)&&(k===D&&(k=ve(k)),It(k,C.ADD_TAGS,Yt))),me(C,"ADD_ATTR")&&(typeof C.ADD_ATTR=="function"?dt.attributeCheck=C.ADD_ATTR:cn(C.ADD_ATTR)&&(ot===_t&&(ot=ve(ot)),It(ot,C.ADD_ATTR,Yt))),me(C,"ADD_FORBID_CONTENTS")&&cn(C.ADD_FORBID_CONTENTS)&&(oe===Ze&&(oe=ve(oe)),It(oe,C.ADD_FORBID_CONTENTS,Yt)),Rt&&(k["#text"]=!0),se&&It(k,["html","head","body"]),k.table&&(It(k,["tbody"]),delete wt.tbody),C.TRUSTED_TYPES_POLICY){if(typeof C.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ye('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof C.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ye('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const et=j;j=C.TRUSTED_TYPES_POLICY;try{ct=Et("")}catch(ut){throw j=et,ut}}else C.TRUSTED_TYPES_POLICY===null?(j=void 0,ct=""):(j===void 0&&(j=mt()),j&&typeof ct=="string"&&(ct=Et("")));Zt&&Zt(C),Ke=C},vs=It({},[...go,...mo,...Rh]),Es=It({},[...yo,...xh]),ll=function(C,J,et){return J.namespaceURI===U?C==="svg":J.namespaceURI===m?C==="svg"&&(et==="annotation-xml"||jt[et]):!!vs[C]},fl=function(C,J,et){return J.namespaceURI===U?C==="math":J.namespaceURI===A?C==="math"&&Gt[et]:!!Es[C]},hl=function(C,J,et){return J.namespaceURI===A&&!Gt[et]||J.namespaceURI===m&&!jt[et]?!1:!Es[C]&&(al[C]||!vs[C])},pl=function(C){let J=E(C);(!J||!J.tagName)&&(J={namespaceURI:W,tagName:"template"});const et=In(C.tagName),ut=In(J.tagName);return it[C.namespaceURI]?C.namespaceURI===A?ll(et,J,ut):C.namespaceURI===m?fl(et,J,ut):C.namespaceURI===U?hl(et,J,ut):!!(mn==="application/xhtml+xml"&&it[C.namespaceURI]):!1},ze=function(C){wn(t.removed,{element:C});try{E(C).removeChild(C)}catch{if(S(C),!E(C))throw Ye("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},_s=function(C,J,et){try{w(C,J)}catch{try{C.removeAttribute(et)}catch{}}},Tn=function(C){Un(C);const J=v(C);if(J){const ut=[];Je(J,ht=>{wn(ut,ht)}),Je(ut,ht=>{try{S(ht)}catch{}})}const et=N(C);if(et)for(let ut=et.length-1;ut>=0;--ut){const ht=et[ut],bt=ht&&ht.name;typeof bt=="string"&&_s(C,ht,bt)}},We=function(C,J,et){if(!et)try{et=J.getAttributeNode(C)}catch{et=null}wn(t.removed,{attribute:et||null,from:J});try{et?w(J,et):J.removeAttribute(C)}catch{try{J.removeAttribute(C)}catch{}}if(C==="is")if(V||Z)try{ze(J)}catch{}else try{J.setAttribute(C,"")}catch{}},dl=function(C){const J=N(C);if(J)for(let et=J.length-1;et>=0;--et){const ut=J[et],ht=ut&&ut.name;typeof ht!="string"||ot[Yt(ht)]||_s(C,ut,ht)}},Un=function(C){const J=[C];for(;J.length>0;){const et=J.pop();O(et)===be.element&&dl(et);const ut=v(et);if(ut)for(let ht=ut.length-1;ht>=0;--ht)J.push(ut[ht])}},As=function(C,J){return Pt?C==="patchsrc"?!0:C==="for"&&J!=="label"&&J!=="output":!1},gl=function(C){if(!Pt)return;const J=[C];for(;J.length>0;){const et=J.pop(),ut=O(et);if(ut===be.processingInstruction||ut===be.comment&&ie(su,et.data)){try{S(et)}catch{}continue}if(ut===be.element){const bt=et,St=Yt(q(et));try{bt.hasAttribute&&bt.hasAttribute("patchsrc")&&bt.removeAttribute("patchsrc"),bt.hasAttribute&&bt.hasAttribute("for")&&As("for",St)&&bt.removeAttribute("for")}catch{}}const ht=v(et);if(ht)for(let bt=ht.length-1;bt>=0;--bt)J.push(ht[bt])}},Ss=function(C){let J=null,et=null;if($)C=""+C;else{const bt=Ji(C,/^[\r\n\t ]+/);et=bt&&bt[0]}mn==="application/xhtml+xml"&&W===U&&(C=''+C+"");const ut=j?Et(C):C;if(W===U)try{J=new a().parseFromString(ut,mn)}catch{}if(!J||!J.documentElement){J=yt.createDocument(W,"template",null);try{J.documentElement.innerHTML=tt?ct:ut}catch{}}const ht=J.body||J.documentElement;return C&&et&&ht.insertBefore(n.createTextNode(et),ht.childNodes[0]||null),W===U?z.call(J,se?"html":"body")[0]:se?J.documentElement:ht},Ns=function(C){const J=F?F(C):C.ownerDocument;return Tt.call(J||C,C,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT|f.SHOW_PROCESSING_INSTRUCTION|f.SHOW_CDATA_SECTION,null)},kn=function(C){return C=vn(C,T," "),C=vn(C,Y," "),C=vn(C,K," "),C},cr=function(C){var J;C.normalize();const et=F?F(C):C.ownerDocument,ut=Tt.call(et||C,C,f.SHOW_TEXT|f.SHOW_COMMENT|f.SHOW_CDATA_SECTION|f.SHOW_PROCESSING_INSTRUCTION,null);let ht=ut.nextNode();for(;ht;)ht.data=kn(ht.data),ht=ut.nextNode();const bt=(J=C.querySelectorAll)===null||J===void 0?void 0:J.call(C,"template");bt&&Je(bt,St=>{tn(St.content)&&cr(St.content)})},$n=function(C){const J=M?M(C):null;return typeof J!="string"||Yt(J)!=="form"?!1:typeof C.nodeName!="string"||typeof C.textContent!="string"||typeof C.removeChild!="function"||C.attributes!==N(C)||typeof C.removeAttribute!="function"||typeof C.removeAttributeNode!="function"||typeof C.getAttributeNode!="function"||typeof C.setAttribute!="function"||typeof C.namespaceURI!="string"||typeof C.insertBefore!="function"||typeof C.hasChildNodes!="function"||C.nodeType!==P(C)||C.childNodes!==v(C)},tn=function(C){if(!P||typeof C!="object"||C===null)return!1;try{return P(C)===be.documentFragment}catch{return!1}},yn=function(C){if(!P||typeof C!="object"||C===null)return!1;try{return typeof P(C)=="number"}catch{return!1}};function Pe(C,J,et){C.length!==0&&Je(C,ut=>{ut.call(t,J,et,Ke)})}const ml=function(C,J){return!!(Pt&&C.hasChildNodes()&&!yn(C.firstElementChild)&&ie(ou,C.textContent)&&ie(ou,C.innerHTML)||Pt&&C.namespaceURI===U&&Fh[J]&&(yn(C.firstElementChild)||typeof C.textContent=="string"&&ie(Gh[J],C.textContent))||C.nodeType===be.processingInstruction||Pt&&C.nodeType===be.comment&&ie(su,C.data))},Fn=function(C,J){if(C instanceof RegExp)return ie(C,J);if(C instanceof Function){for(var et=arguments.length,ut=new Array(et>2?et-2:0),ht=2;ht=0;--St){const Ce=C===et?I(ht[St],!0):ht[St];ut.insertBefore(Ce,R(C))}}}return ze(C),!0},Is=function(C,J,et,ut){return C.length===0?J:J===et||J===ut?ve(J):J},Rs=function(C,J){return C===J||E(C)!==null?!1:(Dt&&Un(C),!0)},xs=function(C,J){if(Pe(Q.beforeSanitizeElements,C,null),Rs(C,J))return!0;if($n(C))return ze(C),!0;const et=Yt(q(C));if(k=Is(Q.uponSanitizeElement,k,D,g),Pe(Q.uponSanitizeElement,C,{tagName:et,allowedTags:k}),Rs(C,J))return!0;if(ml(C,et))return ze(C),!0;if(wt[et]||!(dt.tagCheck instanceof Function&&dt.tagCheck(et))&&!k[et]){const ut=yl(C,et,J);return ut===!1&&Pe(Q.afterSanitizeElements,C,null),ut}if(O(C)===be.element&&!pl(C)||(et==="noscript"||et==="noembed"||et==="noframes")&&ie(kh,C.innerHTML))return ze(C),!0;if($t&&C.nodeType===be.text){const ut=kn(C.textContent);C.textContent!==ut&&(wn(t.removed,{element:C.cloneNode()}),C.textContent=ut)}return Pe(Q.afterSanitizeElements,C,null),!1},Ps=function(C,J,et){if(Bt[J]||As(J,C)||xt&&(J==="id"||J==="name")&&(et in n||et in cl))return!1;const ut=ot[J]||dt.attributeCheck instanceof Function&&dt.attributeCheck(J,C);return Ut&&ie(nt,J)||gt&&ie(st,J)?!0:ut?Mn[J]||ie(y,vn(et,B,""))||(J==="src"||J==="xlink:href"||J==="href")&&C!=="script"&&qi(et,"data:")===0&&Dn[C]||Wt&&!ie(L,vn(et,B,""))?!0:!et:Cs(C)&&Fn(X.tagNameCheck,C)&&Fn(X.attributeNameCheck,J,C)||J==="is"&&X.allowCustomizedBuiltInElements&&Fn(X.tagNameCheck,et)},bl=It({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Cs=function(C){return!bl[In(C)]&&ie(b,C)},wl=function(C,J,et,ut){if(j&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!et)switch(p.getAttributeType(C,J)){case"TrustedHTML":return Et(ut);case"TrustedScriptURL":return lt(ut)}return ut},vl=function(C,J,et,ut){try{return et?C.setAttributeNS(et,J,ut):C.setAttribute(J,ut),$n(C)?(ze(C),!1):!0}catch{return We(J,C),!1}},Ls=function(C){Pe(Q.beforeSanitizeAttributes,C,null);const J=C.attributes;if(!J||$n(C))return;ot=Is(Q.uponSanitizeAttribute,ot,_t,_);const et={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ot,forceKeepAttr:void 0};let ut=J.length;const ht=Yt(C.nodeName);for(;ut--;){const bt=J[ut],St=bt.name,Ce=bt.namespaceURI,Ue=bt.value,ae=Yt(St),xe=Ue;let le=St==="value"?xe:vh(xe),Bs=!1;if(et.attrName=ae,et.attrValue=le,et.keepAttr=!0,et.forceKeepAttr=void 0,Pe(Q.uponSanitizeAttribute,C,et),le=et.attrValue,Ft&&(ae==="id"||ae==="name")&&qi(le,Ct)!==0&&(We(St,C,bt),le=Ct+le,Bs=!0),Pt&&ie(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,le)){We(St,C,bt);continue}if(ae==="attributename"&&Ji(le,"href")){We(St,C,bt);continue}if(!et.forceKeepAttr){if(!et.keepAttr){We(St,C,bt);continue}if(!ne&&ie($h,le)){We(St,C,bt);continue}if($t&&(le=kn(le)),!Ps(ht,ae,le)){We(St,C,bt);continue}le=wl(ht,ae,Ce,le),le!==xe&&vl(C,St,Ce,le)&&Bs&&Xi(t.removed)}}Pe(Q.afterSanitizeAttributes,C,null)},Gn=function(C){let J=null;const et=Ns(C);for(Pe(Q.beforeSanitizeShadowDOM,C,null);J=et.nextNode();)if(Pe(Q.uponSanitizeShadowNode,J,null),xs(J,C),Ls(J),tn(J.content)&&Gn(J.content),O(J)===be.element){const ut=x(J);tn(ut)&&(lr(ut),Gn(ut))}Pe(Q.afterSanitizeShadowDOM,C,null)},lr=function(C){const J=[{node:C,shadow:null}];for(;J.length>0;){const et=J.pop();if(et.shadow){Gn(et.shadow);continue}const ut=et.node,ht=O(ut)===be.element,bt=v(ut);if(bt)for(let St=bt.length-1;St>=0;--St)J.push({node:bt[St],shadow:null});if(ht){const St=M?M(ut):null;if(typeof St=="string"&&Yt(St)==="template"){const Ce=ut.content;tn(Ce)&&J.push({node:Ce,shadow:null})}}if(ht){const St=x(ut);tn(St)&&J.push({node:null,shadow:St},{node:St,shadow:null})}}};return t.sanitize=function(C){let J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},et=null,ut=null,ht=null,bt=null;if(tt=!C,tt&&(C=""),typeof C!="string"&&!yn(C)&&(C=Nh(C),typeof C!="string"))throw Ye("dirty is not a string, aborting");if(!t.isSupported)return C;c?(k=g,ot=_):ur(J),(Q.uponSanitizeElement.length>0||Q.uponSanitizeAttribute.length>0)&&(k=ve(k)),Q.uponSanitizeAttribute.length>0&&(ot=ve(ot)),t.removed=[];const St=Dt&&typeof C!="string"&&yn(C);if(St){gl(C);const ae=q(C);if(typeof ae=="string"){const xe=Yt(ae);if(!k[xe]||wt[xe])throw Tn(C),Ye("root node is forbidden and cannot be sanitized in-place")}if($n(C))throw Tn(C),Ye("root node is clobbered and cannot be sanitized in-place");try{lr(C)}catch(xe){throw Tn(C),xe}}else if(yn(C))et=Ss(""),ut=et.ownerDocument.importNode(C,!0),ut.nodeType===be.element&&ut.nodeName==="BODY"||ut.nodeName==="HTML"?et=ut:et.appendChild(ut),lr(et);else{if(!V&&!$t&&!se&&C.indexOf("<")===-1)return j&&at?Et(C):C;if(et=Ss(C),!et)return V?null:at?ct:""}et&&$&&ze(et.firstChild);const Ce=St?C:et;try{const ae=Ns(Ce);for(;ht=ae.nextNode();)xs(ht,Ce),Ls(ht),tn(ht.content)&&Gn(ht.content)}catch(ae){throw St&&(Tn(C),Je(t.removed,xe=>{xe.element&&Un(xe.element)})),ae}if(St)return Je(t.removed,ae=>{ae.element&&Un(ae.element)}),$t&&cr(C),C;if(V){if($t&&cr(et),Z)for(bt=ft.call(et.ownerDocument);et.firstChild;)bt.appendChild(et.firstChild);else bt=et;return(ot.shadowroot||ot.shadowrootmode)&&(bt=H.call(r,bt,!0)),bt}let Ue=se?et.outerHTML:et.innerHTML;return se&&k["!doctype"]&&et.ownerDocument&&et.ownerDocument.doctype&&et.ownerDocument.doctype.name&&ie(Th,et.ownerDocument.doctype.name)&&(Ue=" `+Ue),$t&&(Ue=kn(Ue)),j&&at?Et(Ue):Ue},t.setConfig=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ur(C),c=!0,g=k,_=ot},t.clearConfig=function(){Ke=null,c=!1,g=null,_=null,j=G,ct=""},t.isValidAttribute=function(C,J,et){Ke||ur({});const ut=Yt(C),ht=Yt(J);return Ps(ut,ht,et)},t.addHook=function(C,J){typeof J=="function"&&me(Q,C)&&wn(Q[C],J)},t.removeHook=function(C,J){if(me(Q,C)){if(J!==void 0){const et=bh(Q[C],J);return et===-1?void 0:wh(Q[C],et,1)[0]}return Xi(Q[C])}},t.removeHooks=function(C){me(Q,C)&&(Q[C]=[])},t.removeAllHooks=function(){Q=au()},t}wc(),globalThis._nc_l10n_locale??=typeof document<"u"&&document.documentElement.dataset.locale||Intl.DateTimeFormat().resolvedOptions().locale.replaceAll(/-/g,"_"),globalThis._nc_l10n_language??=typeof document<"u"&&document.documentElement.lang||(globalThis.navigator?.language??"en"),globalThis._oc_l10n_registry_translations??={},globalThis._oc_l10n_registry_plural_functions??={};class zh extends of{}function vc(){return Ot.registry??=new zh,Ot.registry}function Wh(){return vc()}const Yh=Object.freeze({DEFAULT:"default",HIDDEN:"hidden"});function Hh(e){if(Jh(e),Ot.fileActions??=new Map,Ot.fileActions.has(e.id)){Ge.error(`FileAction ${e.id} already registered`,{action:e});return}Ot.fileActions.set(e.id,e),vc().dispatchTypedEvent("register:action",new CustomEvent("register:action",{detail:e}))}function Xh(){return Ot.fileActions?[...Ot.fileActions.values()]:[]}function Jh(e){if(!e.id||typeof e.id!="string")throw new Error("Invalid id");if(!e.displayName||typeof e.displayName!="function")throw new Error("Invalid displayName function");if("title"in e&&typeof e.title!="function")throw new Error("Invalid title function");if(!e.iconSvgInline||typeof e.iconSvgInline!="function")throw new Error("Invalid iconSvgInline function");if(!e.exec||typeof e.exec!="function")throw new Error("Invalid exec function");if("enabled"in e&&typeof e.enabled!="function")throw new Error("Invalid enabled function");if("execBatch"in e&&typeof e.execBatch!="function")throw new Error("Invalid execBatch function");if("order"in e&&typeof e.order!="number")throw new Error("Invalid order");if(e.destructive!==void 0&&typeof e.destructive!="boolean")throw new Error("Invalid destructive flag");if("parent"in e&&typeof e.parent!="string")throw new Error("Invalid parent");if(e.default&&!Object.values(Yh).includes(e.default))throw new Error("Invalid default");if("inline"in e&&typeof e.inline!="function")throw new Error("Invalid inline function");if("renderInline"in e&&typeof e.renderInline!="function")throw new Error("Invalid renderInline function");if("hotkey"in e&&e.hotkey!==void 0){if(typeof e.hotkey!="object")throw new Error("Invalid hotkey configuration");if(typeof e.hotkey.key!="string"||!e.hotkey.key)throw new Error("Missing or invalid hotkey key");if(typeof e.hotkey.description!="string"||!e.hotkey.description)throw new Error("Missing or invalid hotkey description")}}function qh(e){if(Qh(e),Ot.filesSidebarActions??=new Map,Ot.filesSidebarActions.has(e.id)){Ge.warn(`Sidebar action with id "${e.id}" already registered. Skipping.`);return}Ot.filesSidebarActions.set(e.id,e),Ge.debug(`New sidebar action with id "${e.id}" registered.`)}function Qh(e){if(typeof e!="object")throw new Error("Sidebar action is not an object");if(!e.id||typeof e.id!="string"||e.id!==CSS.escape(e.id))throw new Error("Sidebar actions need to have an id conforming to the HTML id attribute specifications");if(!e.displayName||typeof e.displayName!="function")throw new Error("Sidebar actions need to have a displayName function");if(!e.iconSvgInline||typeof e.iconSvgInline!="function")throw new Error("Sidebar actions need to have a iconSvgInline function");if(!e.enabled||typeof e.enabled!="function")throw new Error("Sidebar actions need to have an enabled function");if(!e.onClick||typeof e.onClick!="function")throw new Error("Sidebar actions need to have an onClick function")}function Ec(e){if(Zh(e),Ot.filesSidebarTabs??=new Map,Ot.filesSidebarTabs.has(e.id)){Ge.warn(`Sidebar tab with id "${e.id}" already registered. Skipping.`);return}Ot.filesSidebarTabs.set(e.id,e),Ge.debug(`New sidebar tab with id "${e.id}" registered.`)}function Zh(e){if(typeof e!="object")throw new Error("Sidebar tab is not an object");if(!e.id||typeof e.id!="string"||e.id!==CSS.escape(e.id))throw new Error("Sidebar tabs need to have an id conforming to the HTML id attribute specifications");if(!e.tagName||typeof e.tagName!="string")throw new Error("Sidebar tabs need to have the tagName name set");if(!e.tagName.match(/^[a-z][a-z0-9-_]+$/))throw new Error('Sidebar tab "tagName" is invalid');if(!e.displayName||typeof e.displayName!="string")throw new Error("Sidebar tabs need to have a name set");if(typeof e.iconSvgInline!="string"||!ch(e.iconSvgInline))throw new Error("Sidebar tabs need to have an valid SVG icon");if(typeof e.order!="number")throw new Error("Sidebar tabs need to have a numeric order set");if(e.enabled&&typeof e.enabled!="function")throw new Error('Sidebar tab "enabled" is not a function');if(e.onInit&&typeof e.onInit!="function")throw new Error('Sidebar tab "onInit" is not a function')}class Kh{get#e(){return window.OCA?.Files?._sidebar?.()}get available(){return!!this.#e}get isOpen(){return this.#e?.isOpen??!1}get activeTab(){return this.#e?.activeTab}get node(){return this.#e?.node}open(t,n){this.#e?.open(t,n)}close(){this.#e?.close()}setActiveTab(t){this.#e?.setActiveTab(t)}registerTab(t){Ec(t)}getTabs(t){return this.#e?.getTabs(t)??[]}getActions(t){return this.#e?.getActions(t)??[]}registerAction(t){qh(t)}}function _c(){return new Kh}function is(){return as("files_sharing","isPublic",null)??document.querySelector('input#isPublic[type="hidden"][name="isPublic"][value="1"]')!==null}function tp(){return as("files_sharing","sharingToken",null)??document.querySelector('input#sharingToken[type="hidden"]')?.value??null}const zn=globalThis||void 0||self;var vo={},ep={2(e){function t(o,s,u){o instanceof RegExp&&(o=n(o,u)),s instanceof RegExp&&(s=n(s,u));var i=r(o,s,u);return i&&{start:i[0],end:i[1],pre:u.slice(0,i[0]),body:u.slice(i[0]+o.length,i[1]),post:u.slice(i[1]+s.length)}}function n(o,s){var u=s.match(o);return u?u[0]:null}function r(o,s,u){var i,f,h,a,p,d=u.indexOf(o),I=u.indexOf(s,d+1),S=d;if(d>=0&&I>0){for(i=[],h=u.length;S>=0&&!p;)S==d?(i.push(S),d=u.indexOf(o,S+1)):i.length==1?p=[i.pop(),I]:((f=i.pop())=0?d:I;i.length&&(p=[h,a])}return p}e.exports=t,t.range=r},101(e,t,n){var r;e=n.nmd(e),(function(){var o=(e&&e.exports,typeof zn=="object"&&zn);o.global!==o&&o.window;var s=function(a){this.message=a};(s.prototype=new Error).name="InvalidCharacterError";var u=function(a){throw new s(a)},i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=/[\t\n\f\r ]/g,h={encode:function(a){a=String(a),/[^\0-\xFF]/.test(a)&&u("The string to be encoded contains characters outside of the Latin1 range.");for(var p,d,I,S,w=a.length%3,R="",v=-1,E=a.length-w;++v>18&63)+i.charAt(S>>12&63)+i.charAt(S>>6&63)+i.charAt(63&S);return w==2?(p=a.charCodeAt(v)<<8,d=a.charCodeAt(++v),R+=i.charAt((S=p+d)>>10)+i.charAt(S>>4&63)+i.charAt(S<<2&63)+"="):w==1&&(S=a.charCodeAt(v),R+=i.charAt(S>>2)+i.charAt(S<<4&63)+"=="),R},decode:function(a){var p=(a=String(a).replace(f,"")).length;p%4==0&&(p=(a=a.replace(/==?$/,"")).length),(p%4==1||/[^+a-zA-Z0-9/]/.test(a))&&u("Invalid character: the string to be decoded is not correctly encoded.");for(var d,I,S=0,w="",R=-1;++R>(-2*S&6)));return w},version:"1.0.0"};(r=function(){return h}.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 s=n.charCodeAt(o);56320<=s&&s<=57343&&o--,127>>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;o0;r--)o.push(Math.floor(256*Math.random()));return o},bytesToWords:function(r){for(var o=[],s=0,u=0;s>>5]|=r[s]<<24-u%32;return o},wordsToBytes:function(r){for(var o=[],s=0;s<32*r.length;s+=8)o.push(r[s>>>5]>>>24-s%32&255);return o},bytesToHex:function(r){for(var o=[],s=0;s>>4).toString(16)),o.push((15&r[s]).toString(16));return o.join("")},hexToBytes:function(r){for(var o=[],s=0;s>>6*(3-i)&63)):o.push("=");return o.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/gi,"");for(var o=[],s=0,u=0;s>>6-2*u);return o}},e.exports=n},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,s=n(135),u=n(526).bin,i=function(f,h){f.constructor==String?f=h&&h.encoding==="binary"?u.stringToBytes(f):o.stringToBytes(f):s(f)?f=Array.prototype.slice.call(f,0):Array.isArray(f)||f.constructor===Uint8Array||(f=f.toString());for(var a=r.bytesToWords(f),p=8*f.length,d=1732584193,I=-271733879,S=-1732584194,w=271733878,R=0;R>>24)|4278255360&(a[R]<<24|a[R]>>>8);a[p>>>5]|=128<>>9<<4)]=p;var v=i._ff,E=i._gg,x=i._hh,N=i._ii;for(R=0;R>>0,I=I+M>>>0,S=S+F>>>0,w=w+O>>>0}return r.endian([d,I,S,w])};i._ff=function(f,h,a,p,d,I,S){var w=f+(h&a|~h&p)+(d>>>0)+S;return(w<>>32-I)+h},i._gg=function(f,h,a,p,d,I,S){var w=f+(h&p|a&~p)+(d>>>0)+S;return(w<>>32-I)+h},i._hh=function(f,h,a,p,d,I,S){var w=f+(h^a^p)+(d>>>0)+S;return(w<>>32-I)+h},i._ii=function(f,h,a,p,d,I,S){var w=f+(a^(h|~p))+(d>>>0)+S;return(w<>>32-I)+h},i._blocksize=16,i._digestsize=16,e.exports=function(f,h){if(f==null)throw new Error("Illegal argument "+f);var a=r.wordsToBytes(i(f,h));return h&&h.asBytes?a:h&&h.asString?u.bytesToString(a):r.bytesToHex(a)}})()},285(e,t,n){var r=n(2);e.exports=function(v,E){if(!v)return[];var x=(E=E||{}).max==null?1/0:E.max;return v.substr(0,2)==="{}"&&(v="\\{\\}"+v.substr(2)),R((function(N){return N.split("\\\\").join(o).split("\\{").join(s).split("\\}").join(u).split("\\,").join(i).split("\\.").join(f)})(v),x,!0).map(a)};var o="\0SLASH"+Math.random()+"\0",s="\0OPEN"+Math.random()+"\0",u="\0CLOSE"+Math.random()+"\0",i="\0COMMA"+Math.random()+"\0",f="\0PERIOD"+Math.random()+"\0";function h(v){return parseInt(v,10)==v?parseInt(v,10):v.charCodeAt(0)}function a(v){return v.split(o).join("\\").split(s).join("{").split(u).join("}").split(i).join(",").split(f).join(".")}function p(v){if(!v)return[""];var E=[],x=r("{","}",v);if(!x)return v.split(",");var N=x.pre,P=x.body,M=x.post,F=N.split(",");F[F.length-1]+="{"+P+"}";var O=p(M);return M.length&&(F[F.length-1]+=O.shift(),F.push.apply(F,O)),E.push.apply(E,F),E}function d(v){return"{"+v+"}"}function I(v){return/^-?0\d/.test(v)}function S(v,E){return v<=E}function w(v,E){return v>=E}function R(v,E,x){var N=[],P=r("{","}",v);if(!P)return[v];var M=P.pre,F=P.post.length?R(P.post,E,!1):[""];if(/\$$/.test(P.pre))for(var O=0;O=0;if(!pt&&!At)return P.post.match(/,(?!,).*\}/)?R(v=P.pre+"{"+P.body+u+P.post,E,!0):[v];if(pt)j=P.body.split(/\.\./);else if((j=p(P.body)).length===1&&(j=R(j[0],E,!1).map(d)).length===1)return F.map((function(Y){return P.pre+j[0]+Y}));if(pt){var Et=h(j[0]),lt=h(j[1]),mt=Math.max(j[0].length,j[1].length),Nt=j.length==3?Math.max(Math.abs(h(j[2])),1):1,yt=S;lt0){var Q=new Array(H+1).join("0");z=ft<0?"-"+Q+z.slice(1):Q+z}}ct.push(z)}}else{ct=[];for(var T=0;T"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,I,S){var w=[null];w.push.apply(w,I);var R=new(Function.bind.apply(d,w));return S&&o(R,S.prototype),R},r.apply(null,arguments)}function o(h,a){return o=Object.setPrototypeOf||function(p,d){return p.__proto__=d,p},o(h,a)}function s(h){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},s(h)}var u=(function(h){function a(p){var d;return(function(I,S){if(!(I instanceof S))throw new TypeError("Cannot call a class as a function")})(this,a),(d=(function(I,S){return!S||t(S)!=="object"&&typeof S!="function"?(function(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w})(I):S})(this,s(a).call(this,p))).name="ObjectPrototypeMutationError",d}return(function(p,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(d&&d.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),d&&o(p,d)})(a,h),a})(n(Error));function i(h,a){for(var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},d=a.split("."),I=d.length,S=function(v){var E=d[v];if(!h)return{v:void 0};if(E==="+"){if(Array.isArray(h))return{v:h.map((function(N,P){var M=d.slice(v+1);return M.length>0?i(N,M.join("."),p):p(h,P,d,v)}))};var x=d.slice(0,v).join(".");throw new Error("Object at wildcard (".concat(x,") is not an array"))}h=p(h,E,d,v)},w=0;w2&&arguments[2]!==void 0?arguments[2]:{};if(t(h)!="object"||h===null||a===void 0)return!1;if(typeof a=="number")return a in h;try{var d=!1;return i(h,a,(function(I,S,w,R){if(!f(w,R))return I&&I[S];d=p.own?I.hasOwnProperty(S):S in I})),d}catch{return!1}},hasOwn:function(h,a,p){return this.has(h,a,p||{own:!0})},isIn:function(h,a,p){var d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(h)!="object"||h===null||a===void 0)return!1;try{var I=!1,S=!1;return i(h,a,(function(w,R,v,E){return I=I||w===p||!!w&&w[R]===p,S=f(v,E)&&t(w)==="object"&&R in w,w&&w[R]})),d.validPath?I&&S:I}catch{return!1}},ObjectPrototypeMutationError:u}},47(e,t,n){var r=n(410),o=function(h){return typeof h=="string"};function s(h,a){for(var p=[],d=0;d=-1&&!a;p--){var d=p>=0?arguments[p]:vt.cwd();if(!o(d))throw new TypeError("Arguments to path.resolve must be strings");d&&(h=d+"/"+h,a=d.charAt(0)==="/")}return(a?"/":"")+(h=s(h.split("/"),!a).join("/"))||"."},i.normalize=function(h){var a=i.isAbsolute(h),p=h.substr(-1)==="/";return(h=s(h.split("/"),!a).join("/"))||a||(h="."),h&&p&&(h+="/"),(a?"/":"")+h},i.isAbsolute=function(h){return h.charAt(0)==="/"},i.join=function(){for(var h="",a=0;a=0&&E[N]==="";N--);return x>N?[]:E.slice(x,N+1)}h=i.resolve(h).substr(1),a=i.resolve(a).substr(1);for(var d=p(h.split("/")),I=p(a.split("/")),S=Math.min(d.length,I.length),w=S,R=0;R=2&&(N=N.slice(2)):w(M)?N=P[4]:M?F&&(N=N.slice(2)):q>=2&&w(x.protocol)&&(N=P[4]),{protocol:M,slashes:F||w(M),slashesCount:q,rest:N}}function v(E,x,N){if(E=(E=p(E)).replace(u,""),!(this instanceof v))return new v(E,x,N);var P,M,F,O,q,j,ct=d.slice(),G=typeof x,rt=this,pt=0;for(G!=="object"&&G!=="string"&&(N=x,x=null),N&&typeof N!="function"&&(N=o.parse),P=!(M=R(E||"",x=S(x))).protocol&&!M.slashes,rt.slashes=M.slashes||P&&x.slashes,rt.protocol=M.protocol||x.protocol||"",E=M.rest,(M.protocol==="file:"&&(M.slashesCount!==2||a.test(E))||!M.slashes&&(M.protocol||M.slashesCount<2||!w(rt.protocol)))&&(ct[3]=[/(.*)/,"pathname"]);pt{var t=e&&e.__esModule?()=>e.default:()=>e;return kt.d(t,{a:t}),t},kt.d=(e,t)=>{for(var n in t)kt.o(t,n)&&!kt.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},kt.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),kt.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var np=kt(737),rp=kt.n(np);function Eo(e){if(!Fo(e))throw new Error("Parameter was not an error")}function Fo(e){return!!e&&typeof e=="object"&&(t=e,Object.prototype.toString.call(t)==="[object Error]")||e instanceof Error;var t}class pe extends Error{constructor(t,n){const r=[...arguments],{options:o,shortMessage:s}=(function(i){let f,h="";if(i.length===0)f={};else if(Fo(i[0]))f={cause:i[0]},h=i.slice(1).join(" ")||"";else if(i[0]&&typeof i[0]=="object")f=Object.assign({},i[0]),h=i.slice(1).join(" ")||"";else{if(typeof i[0]!="string")throw new Error("Invalid arguments passed to Layerr");f={},h=h=i.join(" ")||""}return{options:f,shortMessage:h}})(r);let u=s;if(o.cause&&(u=`${u}: ${o.cause.message}`),super(u),this.message=u,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 i=o.constructorOpt||this.constructor;Error.captureStackTrace(this,i)}}static cause(t){return Eo(t),t._cause&&Fo(t._cause)?t._cause:null}static fullStack(t){Eo(t);const n=pe.cause(t);return n?`${t.stack} caused by: ${pe.fullStack(n)}`:t.stack??""}static info(t){Eo(t);const n={},r=pe.cause(t);return r&&Object.assign(n,pe.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 op=kt(47),qn=kt.n(op);const uu="__PATH_SEPARATOR_POSIX__",cu="__PATH_SEPARATOR_WINDOWS__";function Vt(e){try{const t=e.replace(/\//g,uu).replace(/\\\\/g,cu);return encodeURIComponent(t).split(cu).join("\\\\").split(uu).join("/")}catch(t){throw new pe(t,"Failed encoding path")}}function lu(e){return e.startsWith("/")?e:"/"+e}function Cn(e){let t=e;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function sp(e){let t=new(rp())(e).pathname;return t.length<=0&&(t="/"),Cn(t)}function zt(){for(var e=arguments.length,t=new Array(e),n=0;n1){var s=r.shift();r[0]=s+r[0]}r[0].match(/^file:\/\/\//)?r[0]=r[0].replace(/^([^/:]+):\/*/,"$1:///"):r[0]=r[0].replace(/^([^/:]+):\/*/,"$1://");for(var u=0;u0&&(i=i.replace(/^[\/]+/,"")),i=u0?"?":"")+h.join("&")})(typeof arguments[0]=="object"?arguments[0]:[].slice.call(arguments))})(t.reduce(((r,o,s)=>((s===0||o!=="/"||o==="/"&&r[r.length-1]!=="/")&&r.push(o),r)),[]))}var ap=kt(542),_n=kt.n(ap);function fu(e,t){const n=e.url.replace("//",""),r=n.indexOf("/")==-1?"/":n.slice(n.indexOf("/")),o=e.method?e.method.toUpperCase():"GET",s=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&"auth",u=`00000000${t.nc}`.slice(-8),i=(function(d,I,S,w,R,v,E){const x=E||_n()(`${I}:${S}:${w}`);return d&&d.toLowerCase()==="md5-sess"?_n()(`${x}:${R}:${v}`):x})(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),f=_n()(`${o}:${r}`),h=s?_n()(`${i}:${t.nonce}:${u}:${t.cnonce}:${s}:${f}`):_n()(`${i}:${t.nonce}:${f}`),a={username:t.username,realm:t.realm,nonce:t.nonce,uri:r,qop:s,response:h,nc:u,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},p=[];for(const d in a)a[d]&&(d==="qop"||d==="nc"||d==="algorithm"?p.push(`${d}=${a[d]}`):p.push(`${d}="${a[d]}"`));return`Digest ${p.join(", ")}`}function Ac(e){return(e.headers&&e.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var ip=kt(101),Sc=kt.n(ip);function hu(e){return Sc().decode(e)}function pu(e,t){var n;return`Basic ${n=`${e}:${t}`,Sc().encode(n)}`}const du=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,up=du.fetch.bind(du);let ye=(function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e})({}),Ve=(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 Nc(e,t,n,r,o){switch(e.authType){case ye.Auto:t&&n&&(e.headers.Authorization=pu(t,n));break;case ye.Digest:e.digest=(function(u,i,f){return{username:u,password:i,ha1:f,nc:0,algorithm:"md5",hasDigestAuth:!1}})(t,n,o);break;case ye.None:break;case ye.Password:e.headers.Authorization=pu(t,n);break;case ye.Token:e.headers.Authorization=`${(s=r).token_type} ${s.access_token}`;break;default:throw new pe({info:{code:Ve.InvalidAuthType}},`Invalid auth type: ${e.authType}`)}var s}kt(345),kt(800);const gu="@@HOTPATCHER",cp=()=>{};function _o(e){return{original:e,methods:[e],final:!1}}class lp{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=gu}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__!==gu)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)||cp;for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s0;)h=[o.shift().apply(a,h)];return h[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]=_o(n);else if(this.isPatched(t)){const{original:s}=this.configuration.registry[t];this.configuration.registry[t]=Object.assign(_o(n),{original:s})}else this.configuration.registry[t]=_o(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),s=2;s1?n-1:0),o=1;o{this.patch(t,s,{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 Ao=null;function Ic(){return Ao||(Ao=new lp),Ao}function Qn(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 mu(){for(var e=arguments.length,t=new Array(e),n=0;n0;){const s=o.shift();r=r?Rc(r,s):Qn(s)}return r}function Rc(e,t){const n=Qn(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]?Rc(n[r],t[r]):Qn(t[r]):n[r]=t[r]:n[r]=t[r]})),n}function fp(e){const t={};for(const n of e.keys())t[n]=e.get(n);return t}function Go(){for(var e=arguments.length,t=new Array(e),n=0;n(Object.keys(s).forEach((u=>{const i=u.toLowerCase();r.hasOwnProperty(i)?o[r[i]]=s[u]:(r[i]=u,o[u]=s[u])})),o)),{})}kt(805);const hp=typeof ArrayBuffer=="function",{toString:pp}=Object.prototype;function xc(e){return hp&&(e instanceof ArrayBuffer||pp.call(e)==="[object ArrayBuffer]")}function Pc(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function us(e){return function(){for(var t=[],n=0;nt.patchInline("fetch",up,n.url,(function(r){let o={};const s={method:r.method};if(r.headers&&(o=Go(o,r.headers)),r.data!==void 0){const[u,i]=(function(f){if(typeof f=="string")return[f,{}];if(Pc(f))return[f,{}];if(xc(f))return[f,{}];if(f&&typeof f=="object")return[JSON.stringify(f),{"content-type":"application/json"}];throw new Error("Unable to convert request body: Unexpected body type: "+typeof f)})(r.data);s.body=u,o=Go(o,i)}return r.signal&&(s.signal=r.signal),r.withCredentials&&(s.credentials="include"),s.headers=o,s})(n))),e)}var gp=kt(285);const Kn=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},mp={"[: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]},An=e=>e.replace(/[[\]\\-]/g,"\\$&"),yu=e=>e.join(""),yp=(e,t)=>{const n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");const r=[],o=[];let s=n+1,u=!1,i=!1,f=!1,h=!1,a=n,p="";t:for(;sp?r.push(An(p)+"-"+An(w)):w===p&&r.push(An(w)),p="",s++):e.startsWith("-]",s+1)?(r.push(An(w+"-")),s+=2):e.startsWith("-",s+1)?(p=w,s+=2):(r.push(An(w)),s++)}else f=!0,s++}else h=!0,s++}if(a1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")};var ge;const bp=new Set(["!","?","+","*","@"]),Vo=e=>bp.has(e),bu=e=>Vo(e.type),wp=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),vp=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Ep=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),wu=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),So="(?!\\.)",_p=new Set(["[","."]),Ap=new Set(["..","."]),Sp=new Set("().*{}+?[]^$\\!"),cs="[^/]",vu=cs+"*?",Eu=cs+"+?";class ls{type;#e;#r;#o=!1;#t=[];#n;#i;#c;#u=!1;#s;#a;#l=!1;constructor(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&(this.#r=!0),this.#n=n,this.#e=this.#n?this.#n.#e:this,this.#s=this.#e===this?r:this.#e.#s,this.#c=this.#e===this?[]:this.#e.#c,t!=="!"||this.#e.#u||this.#c.push(this),this.#i=this.#n?this.#n.#t.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(const t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#a!==void 0?this.#a:this.type?this.#a=this.type+"("+this.#t.map((t=>String(t))).join("|")+")":this.#a=this.#t.map((t=>String(t))).join("")}#y(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;let t;for(this.toString(),this.#u=!0;t=this.#c.pop();){if(t.type!=="!")continue;let n=t,r=n.#n;for(;r;){for(let o=n.#i+1;!r.type&&otypeof n=="string"?n:n.toJSON())):[this.type,...this.#t.map((n=>n.toJSON()))];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#n?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#n?.isStart())return!1;if(this.#i===0)return!0;const t=this.#n;for(let n=0;n1&&arguments[1]!==void 0?arguments[1]:wp;if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;const r=t.#t[0];return!(!r||typeof r!="object"||r.type===null)&&this.#h(r.type,n)}#h(t){return!!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ep).get(this.type)?.includes(t)}#w(t,n){const r=t.#t[0],o=new ge(null,r,this.options);o.#t.push(""),r.push(o),this.#g(t,n)}#g(t,n){const r=t.#t[0];this.#t.splice(n,1,...r.#t);for(const o of r.#t)typeof o=="object"&&(o.#n=this);this.#a=void 0}#v(t){return!!wu.get(this.type)?.has(t)}#E(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;const n=t.#t[0];return!(!n||typeof n!="object"||n.type===null)&&this.#v(n.type)}#_(t){const n=wu.get(this.type),r=t.#t[0],o=n?.get(r.type);if(!o)return!1;this.#t=r.#t;for(const s of this.#t)typeof s=="object"&&(s.#n=this);this.type=o,this.#a=void 0,this.#l=!1}#p(){if(bu(this)){let t=0,n=!1;do{n=!0;for(let r=0;r1&&arguments[1]!==void 0?arguments[1]:{};const r=new ge(null,void 0,n);return ge.#f(t,r,0,n,0),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();const t=this.toString(),[n,r,o,s]=this.toRegExpSource();if(!(o||this.#r||this.#s.nocase&&!this.#s.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;const u=(this.#s.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,u),{_src:n,_glob:t})}get options(){return this.#s}toRegExpSource(t){const n=t??!!this.#s.dot;if(this.#e===this&&(this.#p(),this.#y()),!bu(this)){const f=this.isStart()&&this.isEnd(),h=this.#t.map((d=>{const[I,S,w,R]=typeof d=="string"?ge.#A(d,this.#r,f):d.toRegExpSource(t);return this.#r=this.#r||w,this.#o=this.#o||R,I})).join("");let a="";if(this.isStart()&&typeof this.#t[0]=="string"&&(this.#t.length!==1||!Ap.has(this.#t[0]))){const d=_p,I=n&&d.has(h.charAt(0))||h.startsWith("\\.")&&d.has(h.charAt(2))||h.startsWith("\\.\\.")&&d.has(h.charAt(4)),S=!n&&!t&&d.has(h.charAt(0));a=I?"(?!(?:^|/)\\.\\.?(?:$|/))":S?So:""}let p="";return this.isEnd()&&this.#e.#u&&this.#n?.type==="!"&&(p="(?:$|\\/)"),[a+h+p,Rn(h),this.#r=!!this.#r,this.#o]}const r=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:";let s=this.#m(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){const f=this.toString(),h=this;return h.#t=[f],h.type=null,h.#r=void 0,[f,Rn(this.toString()),!1,!1]}let u=!r||t||n?"":this.#m(!0);u===s&&(u=""),u&&(s=`(?:${s})(?:${u})*?`);let i="";return i=this.type==="!"&&this.#l?(this.isStart()&&!n?So:"")+Eu:o+s+(this.type==="!"?"))"+(!this.isStart()||n||t?"":So)+vu+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&u?")":this.type==="*"&&u?")?":`)${this.type}`),[i,Rn(s),this.#r=!!this.#r,this.#o]}#m(t){return this.#t.map((n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");const[r,o,s,u]=n.toRegExpSource(t);return this.#o=this.#o||u,r})).filter((n=>!(this.isStart()&&this.isEnd()&&!n))).join("|")}static#A(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=!1,s="",u=!1,i=!1;for(let f=0;f2&&arguments[2]!==void 0?arguments[2]:{};return Kn(t),!(!n.nocomment&&t.charAt(0)==="#")&&new tr(t,n).match(e)},Np=/^\*+([^+@!?\*\[\(]*)$/,Ip=e=>t=>!t.startsWith(".")&&t.endsWith(e),Rp=e=>t=>t.endsWith(e),xp=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),Pp=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Cp=/^\*+\.\*+$/,Lp=e=>!e.startsWith(".")&&e.includes("."),Bp=e=>e!=="."&&e!==".."&&e.includes("."),jp=/^\.\*+$/,Dp=e=>e!=="."&&e!==".."&&e.startsWith("."),Mp=/^\*+$/,Tp=e=>e.length!==0&&!e.startsWith("."),Up=e=>e.length!==0&&e!=="."&&e!=="..",kp=/^\?+([^+@!?\*\[\(]*)?$/,$p=e=>{let[t,n=""]=e;const r=Lc([t]);return n?(n=n.toLowerCase(),o=>r(o)&&o.toLowerCase().endsWith(n)):r},Fp=e=>{let[t,n=""]=e;const r=Bc([t]);return n?(n=n.toLowerCase(),o=>r(o)&&o.toLowerCase().endsWith(n)):r},Gp=e=>{let[t,n=""]=e;const r=Bc([t]);return n?o=>r(o)&&o.endsWith(n):r},Op=e=>{let[t,n=""]=e;const r=Lc([t]);return n?o=>r(o)&&o.endsWith(n):r},Lc=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&!r.startsWith(".")},Bc=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&r!=="."&&r!==".."},jc=typeof vt=="object"&&vt?typeof vo=="object"&&vo&&vo.__MINIMATCH_TESTING_PLATFORM__||vt.platform:"posix";ce.sep=jc==="win32"?"\\":"/";const ue=Symbol("globstar **");ce.GLOBSTAR=ue,ce.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>ce(n,e,t)};const _e=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};ce.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return ce;const t=ce;return Object.assign((function(n,r){return t(n,r,_e(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}),{Minimatch:class extends t.Minimatch{constructor(n){super(n,_e(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(n){return t.defaults(_e(e,n)).Minimatch}},AST:class extends t.AST{constructor(n,r){super(n,r,_e(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,_e(e,r))}},unescape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(n,_e(e,r))},escape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(n,_e(e,r))},filter:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(n,_e(e,r))},defaults:n=>t.defaults(_e(e,n)),makeRe:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(n,_e(e,r))},braceExpand:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(n,_e(e,r))},match:function(n,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(n,r,_e(e,o))},sep:t.sep,GLOBSTAR:ue})};const Dc=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Kn(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:gp(e)};ce.braceExpand=Dc,ce.makeRe=function(e){return new tr(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},ce.match=function(e,t){const n=new tr(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 _u=/[?*]|[+@!]\(.*?\)|\[|\]/;class tr{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Kn(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||jc,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const n of t)if(typeof n!="string")return!0;return!1}debug(){}make(){const t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#")return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=function(){return console.error(...arguments)}),this.debug(this.pattern,this.globSet);const r=this.globSet.map((s=>this.slashSplit(s)));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let o=this.globParts.map(((s,u,i)=>{if(this.isWindows&&this.windowsNoMagicRoot){const f=!(s[0]!==""||s[1]!==""||s[2]!=="?"&&_u.test(s[2])||_u.test(s[3])),h=/^[a-z]:/i.test(s[0]);if(f)return[...s.slice(0,4),...s.slice(4).map((a=>this.parse(a)))];if(h)return[s[0],...s.slice(1).map((a=>this.parse(a)))]}return s.map((f=>this.parse(f)))}));if(this.debug(this.pattern,o),this.set=o.filter((s=>s.indexOf(!1)===-1)),this.isWindows)for(let s=0;s=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=n>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map((n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let o=r;for(;n[o+1]==="**";)o++;o!==r&&n.splice(r,o-r)}return n}))}levelOneOptimize(t){return t.map((n=>(n=n.reduce(((r,o)=>{const s=r[r.length-1];return o==="**"&&s==="**"?r:o===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(o),r)}),[])).length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let o=1;oo&&r.splice(o+1,u-o);let i=r[o+1];const f=r[o+2],h=r[o+3];if(i!==".."||!f||f==="."||f===".."||!h||h==="."||h==="..")continue;n=!0,r.splice(o,1);const a=r.slice(0);a[o]="**",t.push(a),o--}if(!this.preserveMultipleSlashes){for(let u=1;un.length))}partsMatch(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=0,s=0,u=[],i="";for(;o2&&arguments[2]!==void 0&&arguments[2],o=0,s=0;if(this.isWindows){const i=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),f=!i&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),h=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),a=f?3:i?0:void 0,p=!h&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])?3:h?0:void 0;if(typeof a=="number"&&typeof p=="number"){const[d,I]=[t[a],n[p]];d.toLowerCase()===I.toLowerCase()&&(n[p]=d,s=p,o=a)}}const{optimizationLevel:u=1}=this.options;return u>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(ue)?this.#e(t,n,r,o,s):this.#o(t,n,r,o,s)}#e(t,n,r,o,s){const u=n.indexOf(ue,s),i=n.lastIndexOf(ue),[f,h,a]=r?[n.slice(s,u),n.slice(u+1),[]]:[n.slice(s,u),n.slice(u+1,i),n.slice(i+1)];if(f.length){const E=t.slice(o,o+f.length);if(!this.#o(E,f,r,0,0))return!1;o+=f.length}let p=0;if(a.length){if(a.length+o>t.length)return!1;let E=t.length-a.length;if(this.#o(t,a,r,E,0))p=a.length;else{if(t[t.length-1]!==""||o+a.length===t.length||(E--,!this.#o(t,a,r,E,0)))return!1;p=a.length+1}}if(!h.length){let E=!!p;for(let x=o;x{const h=f.map((a=>{if(a instanceof RegExp)for(const p of a.flags.split(""))o.add(p);return typeof a=="string"?a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):a===ue?ue:a._src}));return h.forEach(((a,p)=>{const d=h[p+1],I=h[p-1];a===ue&&I!==ue&&(I===void 0?d!==void 0&&d!==ue?h[p+1]="(?:\\/|"+r+"\\/)?"+d:h[p]=r:d===void 0?h[p-1]=I+"(?:\\/|"+r+")?":d!==ue&&(h[p-1]=I+"(?:\\/|\\/"+r+"\\/)"+d,h[p+1]=ue))})),h.filter((a=>a!==ue)).join("/")})).join("|");const[u,i]=t.length>1?["(?:",")"]:["",""];s="^"+u+s+i+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.partial;if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;const r=this.options;this.isWindows&&(t=t.split("\\").join("/"));const o=this.slashSplit(t);this.debug(this.pattern,"split",o);const s=this.set;this.debug(this.pattern,"set",s);let u=o[o.length-1];if(!u)for(let i=o.length-2;!u&&i>=0;i--)u=o[i];for(let i=0;i1&&arguments[1]!==void 0?arguments[1]:""}Invalid response: ${e.status} ${e.statusText}`);return t.status=e.status,t.response=e,t}function ee(e,t){const{status:n}=t;if(n===401&&e.digest)return t;if(n>=400)throw fs(t);return t}function gn(e,t){return arguments.length>2&&arguments[2]!==void 0&&arguments[2]?{data:t,headers:e.headers?fp(e.headers):{},status:e.status,statusText:e.statusText}:t}ce.AST=ls,ce.Minimatch=tr,ce.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},ce.unescape=Rn;const Vp=(Au=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=te({url:zt(e.remoteURL,Vt(t)),method:"COPY",headers:{Destination:zt(e.remoteURL,Vt(n)),Overwrite:r.overwrite===!1?"F":"T",Depth:r.shallow?"0":"infinity"}},e,r);return u=function(i){ee(e,i)},(s=Kt(o,e))&&s.then||(s=Promise.resolve(s)),u?s.then(u):s;var s,u},function(){for(var e=[],t=0;ths.includes(e)?"__"+e:e,Wp={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(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:Uc};function Yp(e,t){if(typeof e!="string")return;const n=e.toLowerCase();if(hs.some((r=>n===r.toLowerCase())))throw new Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);if(Tc.some((r=>n===r.toLowerCase())))throw new Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`)}function kc(e,t){return typeof e=="boolean"?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:"all"}:typeof e=="object"&&e!==null?{enabled:e.enabled!==!1,maxEntitySize:Math.max(1,e.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,e.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,e.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,e.maxExpandedLength??1e5),maxEntityCount:Math.max(1,e.maxEntityCount??1e3),allowedTags:e.allowedTags??null,tagFilter:e.tagFilter??null,appliesTo:e.appliesTo??"all"}:kc(!0)}const Hp=function(e){const t=Object.assign({},Wp,e),n=[{value:t.attributeNamePrefix,name:"attributeNamePrefix"},{value:t.attributesGroupName,name:"attributesGroupName"},{value:t.textNodeName,name:"textNodeName"},{value:t.cdataPropName,name:"cdataPropName"},{value:t.commentPropName,name:"commentPropName"}];for(const{value:r,name:o}of n)r&&Yp(r,o);return t.onDangerousProperty===null&&(t.onDangerousProperty=Uc),t.processEntities=kc(t.processEntities,t.htmlEntities),t.unpairedTagsSet=new Set(t.unpairedTags),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map((r=>typeof r=="string"&&r.startsWith("*.")?".."+r.substring(2):r))),t};let zo;zo=typeof Symbol!="function"?"@@xmlMetadata":Symbol("XML Node Metadata");class Fe{constructor(t){this.tagname=t,this.child=[],this[":@"]=Object.create(null)}add(t,n){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:n})}addChild(t,n){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}),n!==void 0&&(this.child[this.child.length-1][zo]={startIndex:n})}static getMetaDataSymbol(){return zo}}class Xp{constructor(t){this.suppressValidationErr=!t,this.options=t}readDocType(t,n){const r=Object.create(null);let o=0;if(t[n+3]!=="O"||t[n+4]!=="C"||t[n+5]!=="T"||t[n+6]!=="Y"||t[n+7]!=="P"||t[n+8]!=="E")throw new Error("Invalid Tag instead of DOCTYPE");{n+=9;let s=1,u=!1,i=!1,f="";for(;n"){if(i?t[n-1]==="-"&&t[n-2]==="-"&&(i=!1,s--):s--,s===0)break}else t[n]==="["?u=!0:f+=t[n];else{if(u&&He(t,"!ENTITY",n)){let h,a;if(n+=7,[h,a,n]=this.readEntityExp(t,n+1,this.suppressValidationErr),a.indexOf("&")===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&o>=this.options.maxEntityCount)throw new Error(`Entity count (${o+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);r[h]=a,o++}}else if(u&&He(t,"!ELEMENT",n)){n+=8;const{index:h}=this.readElementExp(t,n+1);n=h}else if(u&&He(t,"!ATTLIST",n))n+=8;else if(u&&He(t,"!NOTATION",n)){n+=9;const{index:h}=this.readNotationExp(t,n+1,this.suppressValidationErr);n=h}else{if(!He(t,"!--",n))throw new Error("Invalid DOCTYPE");i=!0}s++,f=""}if(s!==0)throw new Error("Unclosed DOCTYPE")}return{entities:r,i:n}}readEntityExp(t,n){const r=n=de(t,n);for(;nthis.options.maxEntitySize)throw new Error(`Entity "${o}" size (${s.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return[o,s,--n]}readNotationExp(t,n){const r=n=de(t,n);for(;n{for(;t0?t[t.length-1].tag:void 0}getCurrentNamespace(){const t=this._matcher.path;return t.length>0?t[t.length-1].namespace:void 0}getAttrValue(t){const n=this._matcher.path;if(n.length!==0)return n[n.length-1].values?.[t]}hasAttr(t){const n=this._matcher.path;if(n.length===0)return!1;const r=n[n.length-1];return r.values!==void 0&&t in r.values}getPosition(){const t=this._matcher.path;return t.length===0?-1:t[t.length-1].position??0}getCounter(){const t=this._matcher.path;return t.length===0?-1:t[t.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(t){let n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return this._matcher.toString(t,n)}toArray(){return this._matcher.path.map((t=>t.tag))}matches(t){return this._matcher.matches(t)}matchesAny(t){return t.matchesAny(this._matcher)}}class ps{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.separator=t.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new Kp(this)}push(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);const o=this.path.length;this.siblingStacks[o]||(this.siblingStacks[o]=new Map);const s=this.siblingStacks[o],u=r?`${r}:${t}`:t,i=s.get(u)||0;let f=0;for(const a of s.values())f+=a;s.set(u,i+1);const h={tag:t,position:f,counter:i};r!=null&&(h.namespace=r),n!=null&&(h.values=n),this.path.push(h)}pop(){if(this.path.length===0)return;this._pathStringCache=null;const t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}updateCurrent(t){if(this.path.length>0){const n=this.path[this.path.length-1];t!=null&&(n.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(this.path.length!==0)return this.path[this.path.length-1].values?.[t]}hasAttr(t){if(this.path.length===0)return!1;const n=this.path[this.path.length-1];return n.values!==void 0&&t in n.values}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t){let n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];const r=t||this.separator;if(r===this.separator&&n===!0){if(this._pathStringCache!==null)return this._pathStringCache;const o=this.path.map((s=>s.namespace?`${s.namespace}:${s.tag}`:s.tag)).join(r);return this._pathStringCache=o,o}return this.path.map((o=>n&&o.namespace?`${o.namespace}:${o.tag}`:o.tag)).join(r)}toArray(){return this.path.map((t=>t.tag))}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}matches(t){const n=t.segments;return n.length!==0&&(t.hasDeepWildcard()?this._matchWithDeepWildcard(n):this._matchSimple(n))}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let n=0;n=0&&n>=0;){const o=t[r];if(o.type==="deep-wildcard"){if(r--,r<0)return!0;const s=t[r];let u=!1;for(let i=n;i>=0;i--)if(this._matchSegment(s,this.path[i],i===this.path.length-1)){n=i-1,r--,u=!0;break}if(!u)return!1}else{if(!this._matchSegment(o,this.path[n],n===this.path.length-1))return!1;n--,r--}}return r<0}_matchSegment(t,n,r){if(t.tag!=="*"&&t.tag!==n.tag||t.namespace!==void 0&&t.namespace!=="*"&&t.namespace!==n.namespace||t.attrName!==void 0&&(!r||!n.values||!(t.attrName in n.values)||t.attrValue!==void 0&&String(n.values[t.attrName])!==String(t.attrValue)))return!1;if(t.position!==void 0){if(!r)return!1;const o=n.counter??0;if(t.position==="first"&&o!==0||t.position==="odd"&&o%2!=1||t.position==="even"&&o%2!=0||t.position==="nth"&&o!==t.positionValue)return!1}return!0}matchesAny(t){return t.matchesAny(this)}snapshot(){return{path:this.path.map((t=>({...t}))),siblingStacks:this.siblingStacks.map((t=>new Map(t)))}}restore(t){this._pathStringCache=null,this.path=t.path.map((n=>({...n}))),this.siblingStacks=t.siblingStacks.map((n=>new Map(n)))}readOnly(){return this._view}}class hn{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;this.pattern=t,this.separator=n.separator||".",this.segments=this._parse(t),this.data=r,this._hasDeepWildcard=this.segments.some((o=>o.type==="deep-wildcard")),this._hasAttributeCondition=this.segments.some((o=>o.attrName!==void 0)),this._hasPositionSelector=this.segments.some((o=>o.position!==void 0))}_parse(t){const n=[];let r=0,o="";for(;r",lt:"<",quot:'"'},nd={nbsp:" ",copy:"©",reg:"®",trade:"™",mdash:"—",ndash:"–",hellip:"…",laquo:"«",raquo:"»",lsquo:"‘",rsquo:"’",ldquo:"“",rdquo:"”",bull:"•",para:"¶",sect:"§",deg:"°",frac12:"½",frac14:"¼",frac34:"¾"},rd=new Set("!?\\\\/[]$%{}^&*()<>|+");function Nu(e){if(e[0]==="#")throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${e}"`);for(const t of e)if(rd.has(t))throw new Error(`[EntityReplacer] Invalid character '${t}' in entity name: "${e}"`);return e}function No(){const e=Object.create(null);for(var t=arguments.length,n=new Array(t),r=0;r0&&arguments[0]!==void 0?arguments[0]:{};var n;this._limit=t.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof t.postCheck=="function"?t.postCheck:o=>o,this._limitTiers=(n=this._limit.applyLimitsTo??Xe)&&n!==Xe?n===Io?new Set([Io]):n===Wn?new Set([Wn]):Array.isArray(n)?new Set(n):new Set([Xe]):new Set([Xe]),this._numericAllowed=t.numericAllowed??!0,this._baseMap=No($c,t.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(t.remove&&Array.isArray(t.remove)?t.remove:[]),this._leaveSet=new Set(t.leave&&Array.isArray(t.leave)?t.leave:[]);const r=(function(o){if(!o)return{xmlVersion:1,onLevel:we.allow,nullLevel:we.remove};const s=o.xmlVersion===1.1?1.1:1,u=we[o.onNCR]??we.allow,i=we[o.nullNCR]??we.remove;return{xmlVersion:s,onLevel:u,nullLevel:Math.max(i,we.remove)}})(t.ncr);this._ncrXmlVersion=r.xmlVersion,this._ncrOnLevel=r.onLevel,this._ncrNullLevel=r.nullLevel}setExternalEntities(t){if(t)for(const n of Object.keys(t))Nu(n);this._externalMap=No(t)}addExternalEntity(t,n){Nu(t),typeof n=="string"&&n.indexOf("&")===-1&&(this._externalMap[t]=n)}addInputEntities(t){this._totalExpansions=0,this._expandedLength=0,this._inputMap=No(t)}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(t){this._ncrXmlVersion=t===1.1?1.1:1}decode(t){if(typeof t!="string"||t.length===0)return t;const n=t,r=[],o=t.length;let s=0,u=0;const i=this._maxTotalExpansions>0,f=this._maxExpandedLength>0,h=i||f;for(;u=o||t.charCodeAt(p)!==59){u++;continue}const d=t.slice(u+1,p);if(d.length===0){u++;continue}let I,S;if(this._removeSet.has(d))I="",S===void 0&&(S=Xe);else{if(this._leaveSet.has(d)){u++;continue}if(d.charCodeAt(0)===35){const w=this._resolveNCR(d);if(w===void 0){u++;continue}I=w,S=Wn}else{const w=this._resolveName(d);I=w?.value,S=w?.tier}}if(I!==void 0){if(u>s&&r.push(t.slice(s,u)),r.push(I),s=p+1,u=s,h&&this._tierCounts(S)){if(i&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(f){const w=I.length-(d.length+2);if(w>0&&(this._expandedLength+=w,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}else u++}s=55296&&t<=57343||this._ncrXmlVersion===1&&t>=1&&t<=31&&!od.has(t)?we.remove:-1}_applyNCRAction(t,n,r){switch(t){case we.allow:return String.fromCodePoint(r);case we.remove:return"";case we.leave:return;case we.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${n}; (U+${r.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(r)}}_resolveNCR(t){const n=t.charCodeAt(1);let r;if(r=n===120||n===88?parseInt(t.slice(2),16):parseInt(t.slice(1),10),Number.isNaN(r)||r<0||r>1114111)return;const o=this._classifyNCR(r);if(!this._numericAllowed&&o0){const n=e.substring(0,t);if(n!=="xmlns")return n}}class id{constructor(t,n){var r;this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=hd,this.parseTextData=ud,this.resolveNameSpace=cd,this.buildAttributesMap=fd,this.isItStopNode=md,this.replaceEntitiesValue=dd,this.readStopNodeData=bd,this.saveTextToParentTag=gd,this.addChild=pd,this.ignoreAttributesFn=typeof(r=this.options.ignoreAttributes)=="function"?r:Array.isArray(r)?u=>{for(const i of r)if(typeof i=="string"&&u===i||i instanceof RegExp&&i.test(u))return!0}:()=>!1,this.entityExpansionCount=0,this.currentExpandedLength=0;let o={...$c};this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(typeof this.options.htmlEntities=="object"?o=this.options.htmlEntities:this.options.htmlEntities===!0&&(o={...nd,...ed}),this.entityDecoder=new Fc({namedEntities:{...o,...n},numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo}})),this.matcher=new ps,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new td;const s=this.options.stopNodes;if(s&&s.length>0){for(let u=0;u0)){u||(e=this.replaceEntitiesValue(e,t,n));const f=i.jPath?n.toString():n,h=i.tagValueProcessor(t,e,f,o,s);return h==null?e:typeof h!=typeof e||h!==e?h:i.trimValues||e.trim()===e?Gc(e,i.parseTagValue,i.numberParseOptions):e}}function cd(e){if(this.options.removeNSPrefix){const t=e.split(":"),n=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=n+t[1])}return e}const ld=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function fd(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const o=this.options;if(r===!0||o.ignoreAttributes!==!0&&typeof e=="string"){const s=Mc(e,ld),u=s.length,i={},f=new Array(u);let h=!1;const a={};for(let I=0;I",i,"Closing Tag is not closed.");let a=e.substring(i+2,h).trim();if(o.removeNSPrefix){const d=a.indexOf(":");d!==-1&&(a=a.substr(d+1))}a=Ro(o.transformTagName,a,"",o).tagName,n&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher));const p=this.matcher.getCurrentTag();if(a&&o.unpairedTagsSet.has(a))throw new Error(`Unpaired tag can not be used as closing tag: `);p&&o.unpairedTagsSet.has(p)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,n=this.tagsNodeStack.pop(),r="",i=h}else if(f===63){let h=Wo(e,i,!1,"?>");if(!h)throw new Error("Pi Tag is not closed.");r=this.saveTextToParentTag(r,n,this.readonlyMatcher);const a=this.buildAttributesMap(h.tagExp,this.matcher,h.tagName,!0);if(a){const p=a[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(p)||1)}if(!(o.ignoreDeclaration&&h.tagName==="?xml"||o.ignorePiTags)){const p=new Fe(h.tagName);p.add(o.textNodeName,""),h.tagName!==h.tagExp&&h.attrExpPresent&&o.ignoreAttributes!==!0&&(p[":@"]=a),this.addChild(n,p,this.readonlyMatcher,i)}i=h.closeIndex+1}else if(f===33&&e.charCodeAt(i+2)===45&&e.charCodeAt(i+3)===45){const h=ln(e,"-->",i+4,"Comment is not closed.");if(o.commentPropName){const a=e.substring(i+4,h-2);r=this.saveTextToParentTag(r,n,this.readonlyMatcher),n.add(o.commentPropName,[{[o.textNodeName]:a}])}i=h}else if(f===33&&e.charCodeAt(i+2)===68){const h=s.readDocType(e,i);this.entityDecoder.addInputEntities(h.entities),i=h.i}else if(f===33&&e.charCodeAt(i+2)===91){const h=ln(e,"]]>",i,"CDATA is not closed.")-2,a=e.substring(i+9,h);r=this.saveTextToParentTag(r,n,this.readonlyMatcher);let p=this.parseTextData(a,n.tagname,this.readonlyMatcher,!0,!1,!0,!0);p==null&&(p=""),o.cdataPropName?n.add(o.cdataPropName,[{[o.textNodeName]:a}]):n.add(o.textNodeName,p),i=h+2}else{let h=Wo(e,i,o.removeNSPrefix);if(!h){const N=e.substring(Math.max(0,i-50),Math.min(u,i+50));throw new Error(`readTagExp returned undefined at position ${i}. Context: "${N}"`)}let a=h.tagName;const p=h.rawTagName;let d=h.tagExp,I=h.attrExpPresent,S=h.closeIndex;if({tagName:a,tagExp:d}=Ro(o.transformTagName,a,d,o),o.strictReservedNames&&(a===o.commentPropName||a===o.cdataPropName||a===o.textNodeName||a===o.attributesGroupName))throw new Error(`Invalid tag name: ${a}`);n&&r&&n.tagname!=="!xml"&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher,!1));const w=n;w&&o.unpairedTagsSet.has(w.tagname)&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let R=!1;d.length>0&&d.lastIndexOf("/")===d.length-1&&(R=!0,a[a.length-1]==="/"?(a=a.substr(0,a.length-1),d=a):d=d.substr(0,d.length-1),I=a!==d);let v,E=null;v=ad(p),a!==t.tagname&&this.matcher.push(a,{},v),a!==d&&I&&(E=this.buildAttributesMap(d,this.matcher,a),E&&sd(E,o)),a!==t.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());const x=i;if(this.isCurrentNodeStopNode){let N="";if(R)i=h.closeIndex;else if(o.unpairedTagsSet.has(a))i=h.closeIndex;else{const M=this.readStopNodeData(e,p,S+1);if(!M)throw new Error(`Unexpected end of ${p}`);i=M.i,N=M.tagContent}const P=new Fe(a);E&&(P[":@"]=E),P.add(o.textNodeName,N),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(n,P,this.readonlyMatcher,x)}else{if(R){({tagName:a,tagExp:d}=Ro(o.transformTagName,a,d,o));const N=new Fe(a);E&&(N[":@"]=E),this.addChild(n,N,this.readonlyMatcher,x),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else{if(o.unpairedTagsSet.has(a)){const N=new Fe(a);E&&(N[":@"]=E),this.addChild(n,N,this.readonlyMatcher,x),this.matcher.pop(),this.isCurrentNodeStopNode=!1,i=h.closeIndex;continue}{const N=new Fe(a);if(this.tagsNodeStack.length>o.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(n),E&&(N[":@"]=E),this.addChild(n,N,this.readonlyMatcher,x),n=N}}r="",i=S}}}else r+=e[i];return t.child};function pd(e,t,n,r){this.options.captureMetaData||(r=void 0);const o=this.options.jPath?n.toString():n,s=this.options.updateTag(t.tagname,o,t[":@"]);s===!1||(typeof s=="string"&&(t.tagname=s),e.addChild(t,r))}function dd(e,t,n){const r=this.options.processEntities;if(!r||!r.enabled)return e;if(r.allowedTags){const o=this.options.jPath?n.toString():n;if(!(Array.isArray(r.allowedTags)?r.allowedTags.includes(t):r.allowedTags(t,o)))return e}if(r.tagFilter){const o=this.options.jPath?n.toString():n;if(!r.tagFilter(t,o))return e}return this.entityDecoder.decode(e)}function gd(e,t,n,r){return e&&(r===void 0&&(r=t.child.length===0),(e=this.parseTextData(e,t.tagname,n,!1,!!t[":@"]&&Object.keys(t[":@"]).length!==0,r))!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function md(){return this.stopNodeExpressionsSet.size!==0&&this.matcher.matchesAny(this.stopNodeExpressionsSet)}function ln(e,t,n,r){const o=e.indexOf(t,n);if(o===-1)throw new Error(r);return o+t.length-1}function yd(e,t,n,r){const o=e.indexOf(t,n);if(o===-1)throw new Error(r);return o}function Wo(e,t,n){const r=(function(a,p){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",I=0;const S=a.length,w=d.charCodeAt(0),R=d.length>1?d.charCodeAt(1):-1;let v="",E=p;for(let x=p;x3&&arguments[3]!==void 0?arguments[3]:">");if(!r)return;let o=r.data;const s=r.index,u=o.search(/\s/);let i=o,f=!0;u!==-1&&(i=o.substring(0,u),o=o.substring(u+1).trimStart());const h=i;if(n){const a=i.indexOf(":");a!==-1&&(i=i.substr(a+1),f=i!==r.data.substr(a+1))}return{tagName:i,tagExp:o,closeIndex:s,attrExpPresent:f,rawTagName:h}}function bd(e,t,n){const r=n;let o=1;const s=e.length;for(;n",n,`${t} is not closed`);if(e.substring(n+2,i).trim()===t&&(o--,o===0))return{tagContent:e.substring(r,n),i};n=i}else if(u===63)n=ln(e,"?>",n+1,"StopNode is not closed.");else if(u===33&&e.charCodeAt(n+2)===45&&e.charCodeAt(n+3)===45)n=ln(e,"-->",n+3,"StopNode is not closed.");else if(u===33&&e.charCodeAt(n+2)===91)n=ln(e,"]]>",n,"StopNode is not closed.")-2;else{const i=Wo(e,n,">");i&&((i&&i.tagName)===t&&i.tagExp[i.tagExp.length-1]!=="/"&&o++,n=i.closeIndex)}}}function Gc(e,t,n){if(t&&typeof e=="string"){const r=e.trim();return r==="true"||r!=="false"&&(function(o){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s=Object.assign({},Qp,s),!o||typeof o!="string")return o;let u=o.trim();if(u.length===0||s.skipLike!==void 0&&s.skipLike.test(u))return o;if(u==="0")return 0;if(s.hex&&Jp.test(u))return(function(f){if(parseInt)return parseInt(f,16);if(Number.parseInt)return Number.parseInt(f,16);if(window&&window.parseInt)return window.parseInt(f,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")})(u);if(isFinite(u)){if(u.includes("e")||u.includes("E"))return(function(f,h,a){if(!a.eNotation)return f;const p=h.match(Zp);if(p){let d=p[1]||"";const I=p[3].indexOf("e")===-1?"E":"e",S=p[2],w=d?f[S.length+1]===I:f[S.length]===I;return S.length>1&&w?f:(S.length!==1||!p[3].startsWith(`.${I}`)&&p[3][0]!==I)&&S.length>0?a.leadingZeros&&!w?(h=(p[1]||"")+p[3],Number(h)):f:Number(h)}return f})(o,u,s);{const f=qp.exec(u);if(f){const h=f[1]||"",a=f[2];let p=((i=f[3])&&i.indexOf(".")!==-1&&((i=i.replace(/0+$/,""))==="."?i="0":i[0]==="."?i="0"+i:i[i.length-1]==="."&&(i=i.substring(0,i.length-1))),i);const d=h?o[a.length+1]===".":o[a.length]===".";if(!s.leadingZeros&&(a.length>1||a.length===1&&!d))return o;{const I=Number(u),S=String(I);if(I===0)return I;if(S.search(/[eE]/)!==-1)return s.eNotation?I:o;if(u.indexOf(".")!==-1)return S==="0"||S===p||S===`${h}${p}`?I:o;let w=a?p:u;return a?w===S||h+w===S?I:o:w===S||w===h+S?I:o}}return o}}var i;return(function(f,h,a){const p=h===1/0;switch(a.infinity.toLowerCase()){case"null":return null;case"infinity":return h;case"string":return p?"Infinity":"-Infinity";default:return f}})(o,Number(u),s)})(e,n)}return e!==void 0?e:""}function Ro(e,t,n,r){if(e){const o=e(t);n===t&&(n=o),t=o}return{tagName:t=Oc(t,r),tagExp:n}}function Oc(e,t){if(Tc.includes(e))throw new Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);return hs.includes(e)?t.onDangerousProperty(e):e}const xo=Fe.getMetaDataSymbol();function wd(e,t){if(!e||typeof e!="object")return{};if(!t)return e;const n={};for(const r in e)r.startsWith(t)?n[r.substring(t.length)]=e[r]:n[r]=e[r];return n}function vd(e,t,n,r){return Vc(e,t,n,r)}function Vc(e,t,n,r){let o;const s={};for(let u=0;u0&&(s[t.textNodeName]=o):o!==void 0&&(s[t.textNodeName]=o),s}function Ed(e){const t=Object.keys(e);for(let n=0;n5&&r==="xml")return Ht("InvalidXml","XML declaration allowed only at the start of the document.",fe(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}}return t}function xu(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){let n=1;for(t+=8;t"&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t"){t+=2;break}}return t}function Nd(e,t){let n="",r="",o=!1;for(;t"&&r===""){o=!0;break}n+=e[t]}return r===""&&{value:n,index:t,tagClosed:o}}const Id=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Pu(e,t){const n=Mc(e,Id),r={};for(let o=0;o"&&u[p]!==" "&&u[p]!==" "&&u[p]!==` `&&u[p]!=="\r";p++)S+=u[p];if(S=S.trim(),S[S.length-1]==="/"&&(S=S.substring(0,S.length-1),p--),!ar(S)){let v;return v=S.trim().length===0?"Invalid space after '<'.":"Tag '"+S+"' is an invalid name.",Ht("InvalidTag",v,fe(u,p))}const w=Nd(u,p);if(w===!1)return Ht("InvalidAttr","Attributes for '"+S+"' have open quote.",fe(u,p));let R=w.value;if(p=w.index,R[R.length-1]==="/"){const v=p-R.length;R=R.substring(0,R.length-1);const E=Pu(R,i);if(E!==!0)return Ht(E.err.code,E.err.msg,fe(u,v+E.err.line));h=!0}else if(I){if(!w.tagClosed)return Ht("InvalidTag","Closing tag '"+S+"' doesn't have proper closing.",fe(u,p));if(R.trim().length>0)return Ht("InvalidTag","Closing tag '"+S+"' can't have attributes or invalid starting.",fe(u,d));if(f.length===0)return Ht("InvalidTag","Closing tag '"+S+"' has not been opened.",fe(u,d));{const v=f.pop();if(S!==v.tagName){let E=fe(u,v.tagStartPos);return Ht("InvalidTag","Expected closing tag '"+v.tagName+"' (opened in line "+E.line+", col "+E.col+") instead of closing tag '"+S+"'.",fe(u,d))}f.length==0&&(a=!0)}}else{const v=Pu(R,i);if(v!==!0)return Ht(v.err.code,v.err.msg,fe(u,p-R.length+v.err.line));if(a===!0)return Ht("InvalidXml","Multiple possible root nodes found.",fe(u,p));i.unpairedTags.indexOf(S)!==-1||f.push({tagName:S,tagStartPos:d}),h=!0}for(p++;p0)||Ht("InvalidXml","Invalid '"+JSON.stringify(f.map((p=>p.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):Ht("InvalidXml","Start tag expected.",1)})(t,n);if(s!==!0)throw Error(`${s.err.msg}:${s.err.line}:${s.err.col}`)}const r=new id(this.options,this.externalEntities),o=r.parseXml(t);return this.options.preserveOrder||o===void 0?o:vd(o,this.options,r.matcher,r.readonlyMatcher)}addEntity(t,n){if(n.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '");if(n==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=n}static getMetaDataSymbol(){return Fe.getMetaDataSymbol()}}var Pd=kt(829),Me=kt.n(Pd),sn=(function(e){return e.Array="array",e.Object="object",e.Original="original",e})(sn||{});function Cu(e){return typeof e=="string"?e:e.toString(".",!1)}function Wc(e,t){if(!e.endsWith("propstat.prop.displayname"))return t}function Yn(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:sn.Original;const r=Me().get(e,t);return n==="array"&&Array.isArray(r)===!1?[r]:n==="object"&&Array.isArray(r)?r[0]:r}function ir(e,t){return t=t??{attributeNamePrefix:"@",attributeParsers:[],tagParsers:[Wc]},new Promise((n=>{n((function(r){const{multistatus:o}=r;if(o==="")return{multistatus:{response:[]}};if(!o)throw new Error("Invalid response: No root multistatus found");const s={multistatus:Array.isArray(o)?o[0]:o};return Me().set(s,"multistatus.response",Yn(s,"multistatus.response",sn.Array)),Me().set(s,"multistatus.response",Me().get(s,"multistatus.response").map((u=>(function(i){const f=Object.assign({},i);return f.status?Me().set(f,"status",Yn(f,"status",sn.Object)):(Me().set(f,"propstat",Yn(f,"propstat",sn.Object)),Me().set(f,"propstat.prop",Yn(f,"propstat.prop",sn.Object))),f})(u)))),s})((function(r){let{attributeNamePrefix:o,attributeParsers:s,entityDecoder:u,tagParsers:i}=r;const f={allowBooleanAttributes:!0,attributeNamePrefix:o,textNodeName:"text",ignoreAttributes:!1,removeNSPrefix:!0,jPath:!1,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor(h,a,p){const d=Cu(p);for(const I of s)try{const S=I(d,a);if(S!==a)return S}catch{}return a},tagValueProcessor(h,a,p){const d=Cu(p);for(const I of i)try{const S=I(d,a);if(S!==a)return S}catch{}return a}};return u&&(f.entityDecoder=new Fc({limit:{maxTotalExpansions:u.limit?.maxTotalExpansions??0,maxExpandedLength:u.limit?.maxExpandedLength??0}})),new zc(f)})(t).parse(e)))}))}function ds(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const{getlastmodified:r=null,getcontentlength:o="0",resourcetype:s=null,getcontenttype:u=null,getetag:i=null}=e,f=s&&typeof s=="object"&&s.collection!==void 0?"directory":"file",h={filename:t,basename:qn().basename(t),lastmod:r,size:parseInt(o,10),type:f,etag:typeof i=="string"?i.replace(/"/g,""):null};return f==="file"&&(h.mime=u&&typeof u=="string"?u.split(";")[0]:""),n&&(e.displayname!==void 0&&(e.displayname=String(e.displayname)),h.props=e),h}function Cd(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:s}}=r,[u,i,f]=s.split(" ",3),h=parseInt(i,10);if(h>=400){const a=new Error(`Invalid response: ${h} ${f}`);throw a.status=h,a}return ds(o,Cn(t),n)}function Ld(e){switch(String(e)){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(String(e),10)}}function Po(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const gs=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const{details:r=!1}=n,o=te({url:zt(e.remoteURL,Vt(t)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,n);return Po(Kt(o,e),(function(s){return ee(e,s),Po(s.text(),(function(u){return Po(ir(u,e.parsing),(function(i){const f=Cd(i,t,r);return gn(s,f,r)}))}))}))}));function Yc(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const Bd=Hc((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=(function(s){if(!s||s==="/")return[];let u=s;const i=[];do i.push(u),u=qn().dirname(u);while(u&&u!=="/");return i})(Cn(t));r.sort(((s,u)=>s.length>u.length?1:u.length>s.length?-1:0));let o=!1;return(function(s,u,i){if(typeof s[Bu]=="function"){let w=function(R){try{for(;!(f=p.next()).done;)if((R=u(f.value))&&R.then){if(!ju(R))return void R.then(w,a||(a=he.bind(null,h=new an,2)));R=R.v}h?he(h,1,R):h=R}catch(v){he(h||(h=new an),2,v)}};var f,h,a,p=s[Bu]();if(w(),p.return){var d=function(R){try{f.done||p.return()}catch{}return R};if(h&&h.then)return h.then(d,(function(R){throw d(R)}));d()}return h}if(!("length"in s))throw new TypeError("Object is not iterable");for(var I=[],S=0;S2&&arguments[2]!==void 0?arguments[2]:{};if(n.recursive===!0)return Bd(e,t,n);const r=te({url:zt(e.remoteURL,(o=Vt(t),o.endsWith("/")?o:o+"/")),method:"MKCOL"},e,n);var o;return Yc(Kt(r,e),(function(s){ee(e,s)}))}));var Dd=kt(388),Du=kt.n(Dd);const Md=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const r={};if(typeof n.range=="object"&&typeof n.range.start=="number"){let i=`bytes=${n.range.start}-`;typeof n.range.end=="number"&&(i=`${i}${n.range.end}`),r.Range=i}const o=te({url:zt(e.remoteURL,Vt(t)),method:"GET",headers:r},e,n);return u=function(i){if(ee(e,i),r.Range&&i.status!==206){const f=new Error(`Invalid response code for partial request: ${i.status}`);throw f.status=i.status,f}return n.callback&&setTimeout((()=>{n.callback(i)}),0),i.body},(s=Kt(o,e))&&s.then||(s=Promise.resolve(s)),u?s.then(u):s;var s,u})),Td=()=>{},Ud=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const r=te({url:zt(e.remoteURL,Vt(t)),method:"DELETE"},e,n);return s=function(u){ee(e,u)},(o=Kt(r,e))&&o.then||(o=Promise.resolve(o)),s?o.then(s):o;var o,s})),$d=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};return(function(r,o){try{var s=(u=gs(e,t,n),i=function(){return!0},f?i?i(u):u:(u&&u.then||(u=Promise.resolve(u)),i?u.then(i):u))}catch(h){return o(h)}var u,i,f;return s&&s.then?s.then(void 0,o):s})(0,(function(r){if(r.status===404)return!1;throw r}))}));function Co(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const Fd=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const r=te({url:zt(e.remoteURL,Vt(t),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:n.deep?"infinity":"1"}},e,n);return Co(Kt(r,e),(function(o){return ee(e,o),Co(o.text(),(function(s){if(!s)throw new Error("Failed parsing directory contents: Empty response");return Co(ir(s,e.parsing),(function(u){const i=lu(t);let f=(function(h,a,p){let d=arguments.length>3&&arguments[3]!==void 0&&arguments[3],I=arguments.length>4&&arguments[4]!==void 0&&arguments[4];const S=qn().join(a,"/"),{multistatus:{response:w}}=h,R=w.map((v=>{const E=(function(N){try{return N.replace(/^https?:\/\/[^\/]+/,"")}catch(P){throw new pe(P,"Failed normalising HREF")}})(v.href),{propstat:{prop:x}}=v;return ds(x,S==="/"?decodeURIComponent(Cn(E)):Cn(qn().relative(decodeURIComponent(S),decodeURIComponent(E))),d)}));return I?R:R.filter((v=>v.basename&&(v.type==="file"||v.filename!==p.replace(/\/$/,""))))})(u,lu(e.remoteBasePath||e.remotePath),i,n.details,n.includeSelf);return n.glob&&(f=(function(h,a){return h.filter((p=>ce(p.filename,a,{matchBase:!0})))})(f,n.glob)),gn(o,f,n.details)}))}))}))}));function ms(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const r=te({url:zt(e.remoteURL,Vt(t)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[zd]},e,n);return er(Kt(r,e),(function(o){return ee(e,o),er(o.text(),(function(s){return gn(o,s,n.details)}))}))}));function er(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const Od=ms((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=te({url:zt(e.remoteURL,Vt(t)),method:"GET"},e,n);return er(Kt(r,e),(function(o){let s;return ee(e,o),(function(u,i){var f=u();return f&&f.then?f.then(i):i()})((function(){return er(o.arrayBuffer(),(function(u){s=u}))}),(function(){return gn(o,s,n.details)}))}))})),Vd=ms((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 pe({info:{code:Ve.InvalidOutputFormat}},`Invalid output format: ${r}`);return r==="text"?Gd(e,t,n):Od(e,t,n)})),zd=e=>e;function Wd(e,t){let n="";t.format&&t.indentBy.length>0&&(n=` `);const r=[];if(t.stopNodes&&Array.isArray(t.stopNodes))for(let o=0;ot.maxNestedTags)throw new Error("Maximum nested tags exceeded");if(!Array.isArray(e)){if(e!=null){let i=e.toString();return i=Ho(i,t),i}return""}for(let i=0;i/g,"]]]]>")}]]>`,u=!1,r.pop();continue}if(h===t.commentPropName){const w=f[h][0][t.textNodeName];s+=n+``,u=!0,r.pop();continue}if(h[0]==="?"){const w=Mu(f[":@"],t,p),R=h==="?xml"?"":n;let v=f[h][0][t.textNodeName];v=v.length!==0?" "+v:"",s+=R+`<${h}${v}${w}?>`,u=!0,r.pop();continue}let d=n;d!==""&&(d+=t.indentBy);const I=n+`<${h}${Mu(f[":@"],t,p)}`;let S;S=p?Jc(f[h],t):Xc(f[h],t,d,r,o),t.unpairedTags.indexOf(h)!==-1?t.suppressUnpairedNode?s+=I+">":s+=I+"/>":S&&S.length!==0||!t.suppressEmptyNode?S&&S.endsWith(">")?s+=I+`>${S}${n}`:(s+=I+">",S&&n!==""&&(S.includes("/>")||S.includes("`):s+=I+"/>",u=!0,r.pop()}return s}function Yd(e,t){if(!e||t.ignoreAttributes)return null;const n={};let r=!1;for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o.startsWith(t.attributeNamePrefix)?o.substr(t.attributeNamePrefix.length):o]=e[o],r=!0);return r?n:null}function Jc(e,t){if(!Array.isArray(e))return e!=null?e.toString():"";let n="";for(let r=0;r${i}`:n+=`<${s}${u}/>`}}}return n}function Hd(e,t){let n="";if(e&&!t.ignoreAttributes)for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let o=e[r];o===!0&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${o}"`}return n}function qc(e){const t=Object.keys(e);for(let n=0;n0&&t.processEntities)for(let n=0;n","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0};function Se(e){if(this.options=Object.assign({},Jd,e),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map((n=>typeof n=="string"&&n.startsWith("*.")?".."+n.substring(2):n))),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(let n=0;n{for(const r of t)if(typeof r=="string"&&n===r||r instanceof RegExp&&r.test(n))return!0}:()=>!1,this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Zd),this.processTextOrObjNode=qd,this.options.format?(this.indentate=Qd,this.tagEndChar=`> `,this.newLine=` `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function qd(e,t,n,r){const o=this.extractAttributes(e);if(r.push(t,o),this.checkStopNode(r)){const u=this.buildRawContent(e),i=this.buildAttributesForStopNode(e);return r.pop(),this.buildObjectNode(u,t,i,n)}const s=this.j2x(e,n+1,r);return r.pop(),e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,s.attrStr,n,r):this.buildObjectNode(s.val,t,s.attrStr,n)}function Qd(e){return this.options.indentBy.repeat(e)}function Zd(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}Se.prototype.build=function(e){if(this.options.preserveOrder)return Wd(e,this.options);{Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e});const t=new ps;return this.j2x(e,0,t).val}},Se.prototype.j2x=function(e,t,n){let r="",o="";if(this.options.maxNestedTags&&n.getDepth()>=this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");const s=this.options.jPath?n.toString():n,u=this.checkStopNode(n);for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i))if(e[i]===void 0)this.isAttribute(i)&&(o+="");else if(e[i]===null)this.isAttribute(i)||i===this.options.cdataPropName?o+="":i[0]==="?"?o+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:o+=this.indentate(t)+"<"+i+"/"+this.tagEndChar;else if(e[i]instanceof Date)o+=this.buildTextValNode(e[i],i,"",t,n);else if(typeof e[i]!="object"){const f=this.isAttribute(i);if(f&&!this.ignoreAttributesFn(f,s))r+=this.buildAttrPairStr(f,""+e[i],u);else if(!f)if(i===this.options.textNodeName){let h=this.options.tagValueProcessor(i,""+e[i]);o+=this.replaceEntitiesValue(h)}else{n.push(i);const h=this.checkStopNode(n);if(n.pop(),h){const a=""+e[i];o+=a===""?this.indentate(t)+"<"+i+this.closeTag(i)+this.tagEndChar:this.indentate(t)+"<"+i+">"+a+""+S+"${o}`;else if(typeof o=="object"&&o!==null){const s=this.buildRawContent(o),u=this.buildAttributesForStopNode(o);t+=s===""?`<${n}${u}/>`:`<${n}${u}>${s}`}}else if(typeof r=="object"&&r!==null){const o=this.buildRawContent(r),s=this.buildAttributesForStopNode(r);t+=o===""?`<${n}${s}/>`:`<${n}${s}>${o}`}else t+=`<${n}>${r}`}return t},Se.prototype.buildAttributesForStopNode=function(e){if(!e||typeof e!="object")return"";let t="";if(this.options.attributesGroupName&&e[this.options.attributesGroupName]){const n=e[this.options.attributesGroupName];for(let r in n){if(!Object.prototype.hasOwnProperty.call(n,r))continue;const o=r.startsWith(this.options.attributeNamePrefix)?r.substring(this.options.attributeNamePrefix.length):r,s=n[r];s===!0&&this.options.suppressBooleanAttributes?t+=" "+o:t+=" "+o+'="'+s+'"'}}else for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;const r=this.isAttribute(n);if(r){const o=e[n];o===!0&&this.options.suppressBooleanAttributes?t+=" "+r:t+=" "+r+'="'+o+'"'}}return t},Se.prototype.buildObjectNode=function(e,t,n,r){if(e==="")return t[0]==="?"?this.indentate(r)+"<"+t+n+"?"+this.tagEndChar:this.indentate(r)+"<"+t+n+this.closeTag(t)+this.tagEndChar;{let o="`+this.newLine:this.indentate(r)+"<"+t+n+s+this.tagEndChar+e+this.indentate(r)+o:this.indentate(r)+"<"+t+n+s+">"+e+o}},Se.prototype.closeTag=function(e){let t="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`>/g,"]]]]>");return this.indentate(r)+``+this.newLine}if(this.options.commentPropName!==!1&&t===this.options.commentPropName){const s=String(e).replace(/--/g,"- -").replace(/-$/,"- ");return this.indentate(r)+``+this.newLine}if(t[0]==="?")return this.indentate(r)+"<"+t+n+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(t,e);return s=this.replaceEntitiesValue(s),s===""?this.indentate(r)+"<"+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(r)+"<"+t+n+">"+s+"0&&this.options.processEntities)for(let t=0;t3&&arguments[3]!==void 0?arguments[3]:{};const o=te({url:zt(e.remoteURL,Vt(t)),method:"UNLOCK",headers:{"Lock-Token":n}},e,r);return Xo(Kt(o,e),(function(s){if(ee(e,s),s.status!==204&&s.status!==200)throw fs(s)}))})),ng=Zc((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{refreshToken:r,timeout:o=rg}=n,s={Accept:"text/plain,application/xml",Timeout:o};r&&(s.If=r);const u=te({url:zt(e.remoteURL,Vt(t)),method:"LOCK",headers:s,data:tg(e.contactHref)},e,n);return Xo(Kt(u,e),(function(i){return ee(e,i),Xo(i.text(),(function(f){const h=(d=f,new zc({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(d)),a=Me().get(h,"prop.lockdiscovery.activelock.locktoken.href"),p=Me().get(h,"prop.lockdiscovery.activelock.timeout");var d;if(!a)throw fs(i,"No lock token received: ");return{token:a,serverTimeout:p}}))}))})),rg="Infinite, Second-4100000000";function Lo(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const og=(function(e){return function(){for(var t=[],n=0;n1&&arguments[1]!==void 0?arguments[1]:{};const n=t.path||"/",r=te({url:zt(e.remoteURL,n),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,t);return Lo(Kt(r,e),(function(o){return ee(e,o),Lo(o.text(),(function(s){return Lo(ir(s,e.parsing),(function(u){const i=(function(f){try{const[h]=f.multistatus.response,{propstat:{prop:{"quota-used-bytes":a,"quota-available-bytes":p}}}=h;return a!==void 0&&p!==void 0?{used:parseInt(String(a),10),available:Ld(p)}:null}catch{}return null})(u);return gn(o,i,t.details)}))}))}))}));function Bo(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const sg=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const{details:r=!1}=n,o=te({url:zt(e.remoteURL,Vt(t)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":e.headers["Content-Type"]||"application/xml; charset=utf-8"}},e,n);return Bo(Kt(o,e),(function(s){return ee(e,s),Bo(s.text(),(function(u){return Bo(ir(u,e.parsing),(function(i){const f=(function(h,a,p){const d={truncated:!1,results:[]};return d.truncated=h.multistatus.response.some((I=>(I.status||I.propstat?.status).split(" ",3)?.[1]==="507"&&I.href.replace(/\/$/,"").endsWith(Vt(a).replace(/\/$/,"")))),h.multistatus.response.forEach((I=>{if(I.propstat===void 0)return;const S=I.href.split("/").map(decodeURIComponent).join("/");d.results.push(ds(I.propstat.prop,S,p))})),d})(i,t,r);return gn(s,f,r)}))}))}))})),ag=(function(e){return function(){for(var t=[],n=0;n3&&arguments[3]!==void 0?arguments[3]:{};const o=te({url:zt(e.remoteURL,Vt(t)),method:"MOVE",headers:{Destination:zt(e.remoteURL,Vt(n)),Overwrite:r.overwrite===!1?"F":"T"}},e,r);return u=function(i){ee(e,i)},(s=Kt(o,e))&&s.then||(s=Promise.resolve(s)),u?s.then(u):s;var s,u}));var ig=kt(172);function ug(e){if(xc(e))return e.byteLength;if(Pc(e))return e.length;if(typeof e=="string")return(0,ig.d)(e);throw new pe({info:{code:Ve.DataTypeNoLength}},"Cannot calculate data length: Invalid type")}const cg=(function(e){return function(){for(var t=[],n=0;n3&&arguments[3]!==void 0?arguments[3]:{};const{contentLength:o=!0,overwrite:s=!0}=r,u={"Content-Type":"application/octet-stream"};o===!1||(u["Content-Length"]=typeof o=="number"?`${o}`:`${ug(n)}`),s||(u["If-None-Match"]="*");const i=te({url:zt(e.remoteURL,Vt(t)),method:"PUT",headers:u,data:n},e,r);return h=function(a){try{ee(e,a)}catch(p){const d=p;if(d.status!==412||s)throw d;return!1}return!0},(f=Kt(i,e))&&f.then||(f=Promise.resolve(f)),h?f.then(h):f;var f,h})),Kc=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const r=te({url:zt(e.remoteURL,Vt(t)),method:"OPTIONS"},e,n);return s=function(u){try{ee(e,u)}catch(i){throw i}return{compliance:(u.headers.get("DAV")??"").split(",").map((i=>i.trim())),server:u.headers.get("Server")??""}},(o=Kt(r,e))&&o.then||(o=Promise.resolve(o)),s?o.then(s):o;var o,s}));function Pn(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const lg=ys((function(e,t,n,r,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new pe({info:{code:Ve.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);const u={"Content-Type":"application/octet-stream","Content-Length":""+(r-n+1),"Content-Range":`bytes ${n}-${r}/*`},i=te({url:zt(e.remoteURL,Vt(t)),method:"PUT",headers:u,data:o},e,s);return Pn(Kt(i,e),(function(f){ee(e,f)}))}));function Tu(e,t){var n=e();return n&&n.then?n.then(t):t(n)}const fg=ys((function(e,t,n,r,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new pe({info:{code:Ve.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);const u={"Content-Type":"application/x-sabredav-partialupdate","Content-Length":""+(r-n+1),"X-Update-Range":`bytes=${n}-${r}`},i=te({url:zt(e.remoteURL,Vt(t)),method:"PATCH",headers:u,data:o},e,s);return Pn(Kt(i,e),(function(f){ee(e,f)}))}));function ys(e){return function(){for(var t=[],n=0;n5&&arguments[5]!==void 0?arguments[5]:{};return Pn(Kc(e,t,s),(function(u){let i=!1;return Tu((function(){if(u.compliance.includes("sabredav-partialupdate"))return Pn(fg(e,t,n,r,o,s),(function(f){return i=!0,f}))}),(function(f){let h=!1;return i?f:Tu((function(){if(u.server.includes("Apache")&&u.compliance.includes(""))return Pn(lg(e,t,n,r,o,s),(function(a){return h=!0,a}))}),(function(a){if(h)return a;throw new pe({info:{code:Ve.NotSupported}},"Not supported")}))}))}))})),pg="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function dg(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{authType:n=null,remoteBasePath:r,contactHref:o=pg,entityDecoder:s,ha1:u,headers:i={},httpAgent:f,httpsAgent:h,password:a,token:p,username:d,withCredentials:I}=t;let S=n;S||(S=d||a?ye.Password:ye.None);const w={authType:S,remoteBasePath:r,contactHref:o,ha1:u,headers:Object.assign({},i),httpAgent:f,httpsAgent:h,password:a,parsing:{attributeNamePrefix:t.attributeNamePrefix??"@",attributeParsers:[],entityDecoder:s,tagParsers:[Wc]},remotePath:sp(e),remoteURL:e,token:p,username:d,withCredentials:I};return Nc(w,d,a,p,u),{copyFile:(R,v,E)=>Vp(w,R,v,E),createDirectory:(R,v)=>Yo(w,R,v),createReadStream:(R,v)=>(function(E,x){let N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const P=new(Du()).PassThrough;return Md(E,x,N).then((M=>{M.pipe(P)})).catch((M=>{P.emit("error",M)})),P})(w,R,v),createWriteStream:(R,v,E)=>(function(x,N){let P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},M=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Td;const F=new(Du()).PassThrough,O={};P.overwrite===!1&&(O["If-None-Match"]="*");const q=te({url:zt(x.remoteURL,Vt(N)),method:"PUT",headers:O,data:F,maxRedirects:0},x,P);return Kt(q,x).then((j=>ee(x,j))).then((j=>{setTimeout((()=>{M(j)}),0)})).catch((j=>{F.emit("error",j)})),F})(w,R,v,E),customRequest:(R,v)=>Ud(w,R,v),deleteFile:(R,v)=>kd(w,R,v),exists:(R,v)=>$d(w,R,v),getDirectoryContents:(R,v)=>Fd(w,R,v),getFileContents:(R,v)=>Vd(w,R,v),getFileDownloadLink:R=>(function(v,E){let x=zt(v.remoteURL,Vt(E));const N=/^https:/i.test(x)?"https":"http";switch(v.authType){case ye.None:break;case ye.Password:{const P=hu(v.headers.Authorization.replace(/^Basic /i,"").trim());x=x.replace(/^https?:\/\//,`${N}://${P}@`);break}default:throw new pe({info:{code:Ve.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${v.authType}`)}return x})(w,R),getFileUploadLink:R=>(function(v,E){let x=`${zt(v.remoteURL,Vt(E))}?Content-Type=application/octet-stream`;const N=/^https:/i.test(x)?"https":"http";switch(v.authType){case ye.None:break;case ye.Password:{const P=hu(v.headers.Authorization.replace(/^Basic /i,"").trim());x=x.replace(/^https?:\/\//,`${N}://${P}@`);break}default:throw new pe({info:{code:Ve.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${v.authType}`)}return x})(w,R),getHeaders:()=>Object.assign({},w.headers),getQuota:R=>og(w,R),lock:(R,v)=>ng(w,R,v),moveFile:(R,v,E)=>ag(w,R,v,E),putFileContents:(R,v,E)=>cg(w,R,v,E),partialUpdateFileContents:(R,v,E,x,N)=>hg(w,R,v,E,x,N),getDAVCompliance:R=>Kc(w,R),search:(R,v)=>sg(w,R,v),setHeaders:R=>{w.headers=Object.assign({},R)},stat:(R,v)=>gs(w,R,v),unlock:(R,v,E)=>eg(w,R,v,E),registerAttributeParser:R=>{w.parsing.attributeParsers.push(R)},registerTagParser:R=>{w.parsing.tagParsers.push(R)}}}function gg(e=""){let t=Ee.NONE;return e&&(e.includes("G")&&(t|=Ee.READ),e.includes("W")&&(t|=Ee.WRITE),e.includes("CK")&&(t|=Ee.CREATE),e.includes("NV")&&(t|=Ee.UPDATE),e.includes("D")&&(t|=Ee.DELETE),e.includes("R")&&(t|=Ee.SHARE)),t}const tl=["d:getcontentlength","d:getcontenttype","d:getetag","d:getlastmodified","d:creationdate","d:displayname","d:quota-available-bytes","d:resourcetype","nc:has-preview","nc:is-encrypted","nc:mount-type","oc:comments-unread","oc:favorite","oc:fileid","oc:owner-display-name","oc:owner-id","oc:permissions","oc:size"],el={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"};function mg(e,t={nc:"http://nextcloud.org/ns"}){Ot.davNamespaces??={...el},Ot.davProperties??=[...tl];const n={...Ot.davNamespaces,...t};if(Ot.davProperties.find(o=>o===e))return Ge.warn(`${e} already registered`,{prop:e}),!1;if(e.startsWith("<")||e.split(":").length!==2)return Ge.error(`${e} is not valid. See example: 'oc:fileid'`,{prop:e}),!1;const r=e.split(":")[0];return n[r]?(Ot.davProperties.push(e),Ot.davNamespaces=n,!0):(Ge.error(`${e} namespace unknown`,{prop:e,namespaces:n}),!1)}function yg(){return Ot.davProperties??=[...tl],Ot.davProperties.map(e=>`<${e} />`).join(" ")}function bg(){return Ot.davNamespaces??={...el},Object.keys(Ot.davNamespaces).map(e=>`xmlns:${e}="${Ot.davNamespaces?.[e]}"`).join(" ")}function wg(){return is()?`/files/${tp()}`:`/files/${Ko()?.uid}`}const vg=wg();function Eg(){const e=kl("dav");return is()?e.replace("remote.php","public.php"):e}const nl=Eg();function _g(e=nl,t={}){const n=dg(e,{headers:t});function r(o){n.setHeaders({...t,"X-Requested-With":"XMLHttpRequest",requesttoken:o??""})}return Yl(r),r(zl()),Ic().patch("fetch",(o,s)=>{const u=s.headers;return u?.method&&(s.method=u.method,delete u.method),fetch(o,s)}),n}function Ag(e,t=vg,n=nl){let r=Ko()?.uid;if(is())r=r??"anonymous";else if(!r)throw new Error("No user id found");const o=e.props,s=gg(o?.permissions),u=String(o?.["owner-id"]||r),i=o.fileid||0,f=new Date(Date.parse(e.lastmod)),h=new Date(Date.parse(o.creationdate)),a={id:i,source:`${n}${e.filename}`,mtime:!isNaN(f.getTime())&&f.getTime()!==0?f:void 0,crtime:!isNaN(h.getTime())&&h.getTime()!==0?h:void 0,mime:e.mime||"application/octet-stream",displayname:o.displayname!==void 0?String(o.displayname):void 0,size:o?.size||Number.parseInt(o.getcontentlength||"0"),status:i<0?qu.FAILED:void 0,permissions:s,owner:u,root:t,attributes:{...e,...o,hasPreview:o?.["has-preview"]}};return delete a.attributes?.props,e.type==="file"?new nf(a):new rf(a)}const Jo="korean-comments-only",jo="korean_comments_action-comments-tab",Sg='',bs='';function rl(){return as("comments","activityEnabled",null)!==null}function Uu(e){const t=e.nodes[0]?.attributes?.["comments-count"];if(typeof t=="number")return t;if(typeof t=="string"){const n=Number.parseInt(t,10);return Number.isFinite(n)?n:0}return 0}function Ng(e){const t=e.nodes[0]?.attributes?.["comments-unread"];if(typeof t=="number")return t;if(typeof t=="string"){const n=Number.parseInt(t,10);return Number.isFinite(n)?n:0}return 0}function qo(e){const[t]=e.nodes;return e.nodes.length===1&&t!==void 0&&t.root.startsWith("/files/")&&t.permissions!==Ee.NONE&&t.fileid!==void 0&&_c().available&&rl()}const Do=new Map;async function Ig(e){const t=(Do.get(e.source)??0)+1;Do.set(e.source,t);const n=await _g().stat(`${e.root}${e.path}`,{details:!0,data:` ${yg()} `});if(Do.get(e.source)!==t)return;const r="data"in n?n.data:n,o=Ag(r,e.root).attributes["comments-count"],s=e.attributes["comments-count"],u=typeof s=="number"?s:typeof s=="string"?Number.parseInt(s,10):0;typeof o=="number"&&o!==u&&(e.update({"comments-count":o}),Yu("files:node:updated",e))}async function Rg(){const e=Date.now()+5e3;for(;Date.now()window.setTimeout(n,50))}throw new Error("Nextcloud Comments view is unavailable")}function xg(){return class extends HTMLElement{commentsView;container;currentNode;mutationObserver;refreshTimers=new Map;renderGeneration=0;active=!1;folder;view;get node(){return this.currentNode}set node(e){this.currentNode=e,this.renderComments()}connectedCallback(){this.style.display="block",this.style.height="100%",this.style.overflow="auto",this.container=document.createElement("div"),this.container.className="korean-comments-action__content",this.append(this.container),typeof MutationObserver<"u"&&(this.mutationObserver=new MutationObserver(()=>this.scheduleCountRefresh()),this.mutationObserver.observe(this.container,{childList:!0,subtree:!0})),this.renderComments()}disconnectedCallback(){this.renderGeneration+=1,this.mutationObserver?.disconnect(),this.mutationObserver=void 0;for(const e of this.refreshTimers.values())window.clearTimeout(e);this.refreshTimers.clear(),this.commentsView?.$unmount(),this.commentsView=void 0,this.container=void 0,this.replaceChildren()}async renderComments(){const e=this.currentNode,t=e?.fileid;if(!this.isConnected||!this.container||!e||t===void 0)return;if(this.commentsView){await this.commentsView.update(t),this.scheduleCountRefresh();return}const n=++this.renderGeneration;try{const r=await Rg();if(n!==this.renderGeneration||!this.isConnected||!this.container)return;this.commentsView=new r("files",{el:this.container,props:{resourceId:t}}),this.scheduleCountRefresh()}catch(r){n===this.renderGeneration&&this.renderRetry(r)}}renderRetry(e){if(!this.container)return;console.error("Could not initialize the native Comments view",e);const t=document.createElement("p");t.textContent="댓글 화면을 불러오지 못했습니다.";const n=document.createElement("button");n.type="button",n.textContent="다시 시도",n.addEventListener("click",()=>{this.renderComments()}),this.container.replaceChildren(t,n)}scheduleCountRefresh(){const e=this.currentNode;if(!e)return;const t=e.source,n=this.refreshTimers.get(t);n!==void 0&&window.clearTimeout(n);const r=window.setTimeout(()=>{this.refreshTimers.delete(t),Ig(e).catch(o=>{console.error("Could not refresh the comment count",o)})},200);this.refreshTimers.set(t,r)}}}mg("oc:comments-count"),Ec({id:Jo,displayName:"댓글",iconSvgInline:bs,order:45,tagName:jo,enabled({node:e}){return rl()&&e.root.startsWith("/files/")&&e.permissions!==Ee.NONE&&e.fileid!==void 0},onInit(){return window.customElements.get(jo)||window.customElements.define(jo,xg()),Promise.resolve()}});let ol=!1;const xn={id:"korean-comments-action",displayName:()=>"",title:e=>{const t=Uu(e);return t>0?`댓글 ${t}개`:"댓글 작성"},iconSvgInline:e=>Uu(e)>0?bs:Sg,enabled(e){return qo(e)&&(!ol||Ng(e)===0)},async exec(e){const[t]=e.nodes;if(!t||!qo(e))return!1;try{const n=_c();return n.isOpen&&n.node?.source===t.source?n.setActiveTab(Jo):n.open(t,Jo),null}catch(n){return console.error("Could not open the comments-only sidebar",n),!1}},inline:()=>!0,order:-45};function sl(e){if(e.id!=="comments-unread"||typeof e.enabled!="function")return!1;const t=e.enabled;return e.displayName=xn.displayName,e.title=xn.title,e.iconSvgInline=()=>bs,e.exec=xn.exec,e.inline=xn.inline,e.enabled=n=>qo(n)&&t(n)===!0,ol=!0,!0}for(const e of Xh())sl(e);Wh().addEventListener("register:action",e=>{sl(e.detail)}),Hh(xn); //# sourceMappingURL=korean_comments_action-main.mjs.map