import{p as Qt,g as Je,a as Wr,o as Yr}from"./index-CdM8BgQf.chunk.mjs";import{B as Ie,g as Hr,e as lr}from"./NcLoadingIcon-CBTC2zMe.chunk.mjs";import{i as tn,g as Zr,d as Qr}from"./NcNoteCard-CwNXZ4vV-Dyi378DT.chunk.mjs";import{b as Kr}from"./index-DCzdQJ7L.chunk.mjs";import{g as re}from"./vue.runtime.esm-B7-PK3p1.chunk.mjs";import{g as Jr}from"./index-Bnw2WuIx.chunk.mjs";import{g as ti}from"./emoji-picker-hi3Hwbeu.chunk.mjs";function Ut(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function On(e,t,n){ei(e,t),t.set(e,n)}function ei(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function pt(e,t){var n=hr(e,t,"get");return ni(e,n)}function ni(e,t){return t.get?t.get.call(e):t.value}function In(e,t,n){var i=hr(e,t,"set");return ri(e,i,n),n}function hr(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function ri(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}var ii=typeof Symbol<"u"?Symbol.toStringTag:"@@toStringTag",dt=new WeakMap,Wt=new WeakMap;class ye{constructor(t){var{executor:n=()=>{},internals:i=nn(),promise:a=new Promise((u,c)=>n(u,c,l=>{i.onCancelList.push(l)}))}=t;On(this,dt,{writable:!0,value:void 0}),On(this,Wt,{writable:!0,value:void 0}),Ut(this,ii,"CancelablePromise"),this.cancel=this.cancel.bind(this),In(this,dt,i),In(this,Wt,a||new Promise((u,c)=>n(u,c,l=>{i.onCancelList.push(l)})))}then(t,n){return ce(pt(this,Wt).then(ie(t,pt(this,dt)),ie(n,pt(this,dt))),pt(this,dt))}catch(t){return ce(pt(this,Wt).catch(ie(t,pt(this,dt))),pt(this,dt))}finally(t,n){return n&&pt(this,dt).onCancelList.push(t),ce(pt(this,Wt).finally(ie(()=>{if(t)return n&&(pt(this,dt).onCancelList=pt(this,dt).onCancelList.filter(i=>i!==t)),t()},pt(this,dt))),pt(this,dt))}cancel(){pt(this,dt).isCanceled=!0;var t=pt(this,dt).onCancelList;pt(this,dt).onCancelList=[];for(var n of t)if(typeof n=="function")try{n()}catch(i){console.error(i)}}isCanceled(){return pt(this,dt).isCanceled===!0}}class Pt extends ye{constructor(t){super({executor:t})}}Ut(Pt,"all",function(e){return se(e,Promise.all(e))}),Ut(Pt,"allSettled",function(e){return se(e,Promise.allSettled(e))}),Ut(Pt,"any",function(e){return se(e,Promise.any(e))}),Ut(Pt,"race",function(e){return se(e,Promise.race(e))}),Ut(Pt,"resolve",function(e){return Tn(Promise.resolve(e))}),Ut(Pt,"reject",function(e){return Tn(Promise.reject(e))}),Ut(Pt,"isCancelable",en);function Tn(e){return ce(e,nn())}function en(e){return e instanceof Pt||e instanceof ye}function ie(e,t){if(e)return n=>{if(!t.isCanceled){var i=e(n);return en(i)&&t.onCancelList.push(i.cancel),i}return n}}function ce(e,t){return new ye({internals:t,promise:e})}function se(e,t){var n=nn();return n.onCancelList.push(()=>{for(var i of e)en(i)&&i.cancel()}),new ye({internals:n,promise:t})}function nn(){return{isCanceled:!1,onCancelList:[]}}var Te={},si={2:e=>{function t(a,u,c){a instanceof RegExp&&(a=n(a,c)),u instanceof RegExp&&(u=n(u,c));var l=i(a,u,c);return l&&{start:l[0],end:l[1],pre:c.slice(0,l[0]),body:c.slice(l[0]+a.length,l[1]),post:c.slice(l[1]+u.length)}}function n(a,u){var c=u.match(a);return c?c[0]:null}function i(a,u,c){var l,m,f,s,d,p=c.indexOf(a),v=c.indexOf(u,p+1),w=p;if(p>=0&&v>0){for(l=[],f=c.length;w>=0&&!d;)w==p?(l.push(w),p=c.indexOf(a,w+1)):l.length==1?d=[l.pop(),v]:((m=l.pop())=0?p:v;l.length&&(d=[f,s])}return d}e.exports=t,t.range=i},101:function(e,t,n){var i;e=n.nmd(e),(function(a){var u=(e&&e.exports,typeof re=="object"&&re);u.global!==u&&u.window;var c=function(d){this.message=d};(c.prototype=new Error).name="InvalidCharacterError";var l=function(d){throw new c(d)},m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=/[\t\n\f\r ]/g,s={encode:function(d){d=String(d),/[^\0-\xFF]/.test(d)&&l("The string to be encoded contains characters outside of the Latin1 range.");for(var p,v,w,E,O=d.length%3,I="",h=-1,b=d.length-O;++h>18&63)+m.charAt(E>>12&63)+m.charAt(E>>6&63)+m.charAt(63&E);return O==2?(p=d.charCodeAt(h)<<8,v=d.charCodeAt(++h),I+=m.charAt((E=p+v)>>10)+m.charAt(E>>4&63)+m.charAt(E<<2&63)+"="):O==1&&(E=d.charCodeAt(h),I+=m.charAt(E>>2)+m.charAt(E<<4&63)+"=="),I},decode:function(d){var p=(d=String(d).replace(f,"")).length;p%4==0&&(p=(d=d.replace(/==?$/,"")).length),(p%4==1||/[^+a-zA-Z0-9/]/.test(d))&&l("Invalid character: the string to be decoded is not correctly encoded.");for(var v,w,E=0,O="",I=-1;++I>(-2*E&6)));return O},version:"1.0.0"};(i=function(){return s}.call(t,n,t,e))===void 0||(e.exports=i)})()},172:(e,t)=>{t.d=function(n){if(!n)return 0;for(var i=(n=n.toString()).length,a=n.length;a--;){var u=n.charCodeAt(a);56320<=u&&u<=57343&&a--,127{var t={utf8:{stringToBytes:function(n){return t.bin.stringToBytes(unescape(encodeURIComponent(n)))},bytesToString:function(n){return decodeURIComponent(escape(t.bin.bytesToString(n)))}},bin:{stringToBytes:function(n){for(var i=[],a=0;a{var t,n;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(i,a){return i<>>32-a},rotr:function(i,a){return i<<32-a|i>>>a},endian:function(i){if(i.constructor==Number)return 16711935&n.rotl(i,8)|4278255360&n.rotl(i,24);for(var a=0;a0;i--)a.push(Math.floor(256*Math.random()));return a},bytesToWords:function(i){for(var a=[],u=0,c=0;u>>5]|=i[u]<<24-c%32;return a},wordsToBytes:function(i){for(var a=[],u=0;u<32*i.length;u+=8)a.push(i[u>>>5]>>>24-u%32&255);return a},bytesToHex:function(i){for(var a=[],u=0;u>>4).toString(16)),a.push((15&i[u]).toString(16));return a.join("")},hexToBytes:function(i){for(var a=[],u=0;u>>6*(3-l)&63)):a.push("=");return a.join("")},base64ToBytes:function(i){i=i.replace(/[^A-Z0-9+\/]/gi,"");for(var a=[],u=0,c=0;u>>6-2*c);return a}},e.exports=n},635:(e,t,n)=>{const i=n(31),a=n(338),u=n(221);e.exports={XMLParser:a,XMLValidator:i,XMLBuilder:u}},118:e=>{e.exports=function(t){return typeof t=="function"?t:Array.isArray(t)?n=>{for(const i of t)if(typeof i=="string"&&n===i||i instanceof RegExp&&i.test(n))return!0}:()=>!1}},705:(e,t)=>{const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i="["+n+"]["+n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",a=new RegExp("^"+i+"$");t.isExist=function(u){return u!==void 0},t.isEmptyObject=function(u){return Object.keys(u).length===0},t.merge=function(u,c,l){if(c){const m=Object.keys(c),f=m.length;for(let s=0;s{const i=n(705),a={allowBooleanAttributes:!1,unpairedTags:[]};function u(h){return h===" "||h===" "||h===` `||h==="\r"}function c(h,b){const T=b;for(;b5&&P==="xml")return w("InvalidXml","XML declaration allowed only at the start of the document.",O(h,b));if(h[b]=="?"&&h[b+1]==">"){b++;break}}return b}function l(h,b){if(h.length>b+5&&h[b+1]==="-"&&h[b+2]==="-"){for(b+=3;b"){b+=2;break}}else if(h.length>b+8&&h[b+1]==="D"&&h[b+2]==="O"&&h[b+3]==="C"&&h[b+4]==="T"&&h[b+5]==="Y"&&h[b+6]==="P"&&h[b+7]==="E"){let T=1;for(b+=8;b"&&(T--,T===0))break}else if(h.length>b+9&&h[b+1]==="["&&h[b+2]==="C"&&h[b+3]==="D"&&h[b+4]==="A"&&h[b+5]==="T"&&h[b+6]==="A"&&h[b+7]==="["){for(b+=8;b"){b+=2;break}}return b}t.validate=function(h,b){b=Object.assign({},a,b);const T=[];let P=!1,R=!1;h[0]==="\uFEFF"&&(h=h.substr(1));for(let S=0;S"&&h[S]!==" "&&h[S]!==" "&&h[S]!==` `&&h[S]!=="\r";S++)M+=h[S];if(M=M.trim(),M[M.length-1]==="/"&&(M=M.substring(0,M.length-1),S--),L=M,!i.isName(L)){let F;return F=M.trim().length===0?"Invalid space after '<'.":"Tag '"+M+"' is an invalid name.",w("InvalidTag",F,O(h,S))}const C=s(h,S);if(C===!1)return w("InvalidAttr","Attributes for '"+M+"' have open quote.",O(h,S));let D=C.value;if(S=C.index,D[D.length-1]==="/"){const F=S-D.length;D=D.substring(0,D.length-1);const G=p(D,b);if(G!==!0)return w(G.err.code,G.err.msg,O(h,F+G.err.line));P=!0}else if(U){if(!C.tagClosed)return w("InvalidTag","Closing tag '"+M+"' doesn't have proper closing.",O(h,S));if(D.trim().length>0)return w("InvalidTag","Closing tag '"+M+"' can't have attributes or invalid starting.",O(h,A));if(T.length===0)return w("InvalidTag","Closing tag '"+M+"' has not been opened.",O(h,A));{const F=T.pop();if(M!==F.tagName){let G=O(h,F.tagStartPos);return w("InvalidTag","Expected closing tag '"+F.tagName+"' (opened in line "+G.line+", col "+G.col+") instead of closing tag '"+M+"'.",O(h,A))}T.length==0&&(R=!0)}}else{const F=p(D,b);if(F!==!0)return w(F.err.code,F.err.msg,O(h,S-D.length+F.err.line));if(R===!0)return w("InvalidXml","Multiple possible root nodes found.",O(h,S));b.unpairedTags.indexOf(M)!==-1||T.push({tagName:M,tagStartPos:A}),P=!0}for(S++;S0)||w("InvalidXml","Invalid '"+JSON.stringify(T.map((S=>S.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):w("InvalidXml","Start tag expected.",1)};const m='"',f="'";function s(h,b){let T="",P="",R=!1;for(;b"&&P===""){R=!0;break}T+=h[b]}return P===""&&{value:T,index:b,tagClosed:R}}const d=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function p(h,b){const T=i.getAllMatches(h,d),P={};for(let R=0;R{const i=n(87),a=n(118),u={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(s,d){return d},attributeValueProcessor:function(s,d){return d},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function c(s){this.options=Object.assign({},u,s),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=a(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=f),this.processTextOrObjNode=l,this.options.format?(this.indentate=m,this.tagEndChar=`> `,this.newLine=` `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function l(s,d,p,v){const w=this.j2x(s,p+1,v.concat(d));return s[this.options.textNodeName]!==void 0&&Object.keys(s).length===1?this.buildTextValNode(s[this.options.textNodeName],d,w.attrStr,p):this.buildObjectNode(w.val,d,w.attrStr,p)}function m(s){return this.options.indentBy.repeat(s)}function f(s){return!(!s.startsWith(this.options.attributeNamePrefix)||s===this.options.textNodeName)&&s.substr(this.attrPrefixLen)}c.prototype.build=function(s){return this.options.preserveOrder?i(s,this.options):(Array.isArray(s)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(s={[this.options.arrayNodeName]:s}),this.j2x(s,0,[]).val)},c.prototype.j2x=function(s,d,p){let v="",w="";const E=p.join(".");for(let O in s)if(Object.prototype.hasOwnProperty.call(s,O))if(s[O]===void 0)this.isAttribute(O)&&(w+="");else if(s[O]===null)this.isAttribute(O)?w+="":O[0]==="?"?w+=this.indentate(d)+"<"+O+"?"+this.tagEndChar:w+=this.indentate(d)+"<"+O+"/"+this.tagEndChar;else if(s[O]instanceof Date)w+=this.buildTextValNode(s[O],O,"",d);else if(typeof s[O]!="object"){const I=this.isAttribute(O);if(I&&!this.ignoreAttributesFn(I,E))v+=this.buildAttrPairStr(I,""+s[O]);else if(!I)if(O===this.options.textNodeName){let h=this.options.tagValueProcessor(O,""+s[O]);w+=this.replaceEntitiesValue(h)}else w+=this.buildTextValNode(s[O],O,"",d)}else if(Array.isArray(s[O])){const I=s[O].length;let h="",b="";for(let T=0;T`+this.newLine:this.indentate(v)+"<"+d+p+E+this.tagEndChar+s+this.indentate(v)+w:this.indentate(v)+"<"+d+p+E+">"+s+w}},c.prototype.closeTag=function(s){let d="";return this.options.unpairedTags.indexOf(s)!==-1?this.options.suppressUnpairedNode||(d="/"):d=this.options.suppressEmptyNode?"/":`>`+this.newLine;if(this.options.commentPropName!==!1&&d===this.options.commentPropName)return this.indentate(v)+``+this.newLine;if(d[0]==="?")return this.indentate(v)+"<"+d+p+"?"+this.tagEndChar;{let w=this.options.tagValueProcessor(d,s);return w=this.replaceEntitiesValue(w),w===""?this.indentate(v)+"<"+d+p+this.closeTag(d)+this.tagEndChar:this.indentate(v)+"<"+d+p+">"+w+"0&&this.options.processEntities)for(let d=0;d{function t(c,l,m,f){let s="",d=!1;for(let p=0;p`,d=!1;continue}if(w===l.commentPropName){s+=f+``,d=!0;continue}if(w[0]==="?"){const b=i(v[":@"],l),T=w==="?xml"?"":f;let P=v[w][0][l.textNodeName];P=P.length!==0?" "+P:"",s+=T+`<${w}${P}${b}?>`,d=!0;continue}let O=f;O!==""&&(O+=l.indentBy);const I=f+`<${w}${i(v[":@"],l)}`,h=t(v[w],l,E,O);l.unpairedTags.indexOf(w)!==-1?l.suppressUnpairedNode?s+=I+">":s+=I+"/>":h&&h.length!==0||!l.suppressEmptyNode?h&&h.endsWith(">")?s+=I+`>${h}${f}`:(s+=I+">",h&&f!==""&&(h.includes("/>")||h.includes("`):s+=I+"/>",d=!0}return s}function n(c){const l=Object.keys(c);for(let m=0;m0&&l.processEntities)for(let m=0;m0&&(m=` `),t(c,l,"",m)}},193:(e,t,n)=>{const i=n(705);function a(d,p){let v="";for(;p"){if(O?d[p-1]==="-"&&d[p-2]==="-"&&(O=!1,w--):w--,w===0)break}else d[p]==="["?E=!0:I+=d[p];else{if(E&&c(d,p)){let h,b;p+=7,[h,b,p]=a(d,p+1),b.indexOf("&")===-1&&(v[s(h)]={regx:RegExp(`&${h};`,"g"),val:b})}else if(E&&l(d,p))p+=8;else if(E&&m(d,p))p+=8;else if(E&&f(d,p))p+=9;else{if(!u)throw new Error("Invalid DOCTYPE");O=!0}w++,I=""}if(w!==0)throw new Error("Unclosed DOCTYPE")}return{entities:v,i:p}}},63:(e,t)=>{const n={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(i,a){return a},attributeValueProcessor:function(i,a){return a},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(i,a,u){return i}};t.buildOptions=function(i){return Object.assign({},n,i)},t.defaultOptions=n},299:(e,t,n)=>{const i=n(705),a=n(365),u=n(193),c=n(494),l=n(118);function m(R){const L=Object.keys(R);for(let S=0;S0)){C||(R=this.replaceEntitiesValue(R));const D=this.options.tagValueProcessor(L,R,S,U,M);return D==null?R:typeof D!=typeof R||D!==R?D:this.options.trimValues||R.trim()===R?P(R,this.options.parseTagValue,this.options.numberParseOptions):R}}function s(R){if(this.options.removeNSPrefix){const L=R.split(":"),S=R.charAt(0)==="/"?"/":"";if(L[0]==="xmlns")return"";L.length===2&&(R=S+L[1])}return R}const d=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function p(R,L,S){if(this.options.ignoreAttributes!==!0&&typeof R=="string"){const A=i.getAllMatches(R,d),U=A.length,M={};for(let C=0;C",M,"Closing Tag is not closed.");let D=R.substring(M+2,C).trim();if(this.options.removeNSPrefix){const X=D.indexOf(":");X!==-1&&(D=D.substr(X+1))}this.options.transformTagName&&(D=this.options.transformTagName(D)),S&&(A=this.saveTextToParentTag(A,S,U));const F=U.substring(U.lastIndexOf(".")+1);if(D&&this.options.unpairedTags.indexOf(D)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let G=0;F&&this.options.unpairedTags.indexOf(F)!==-1?(G=U.lastIndexOf(".",U.lastIndexOf(".")-1),this.tagsNodeStack.pop()):G=U.lastIndexOf("."),U=U.substring(0,G),S=this.tagsNodeStack.pop(),A="",M=C}else if(R[M+1]==="?"){let C=b(R,M,!1,"?>");if(!C)throw new Error("Pi Tag is not closed.");if(A=this.saveTextToParentTag(A,S,U),!(this.options.ignoreDeclaration&&C.tagName==="?xml"||this.options.ignorePiTags)){const D=new a(C.tagName);D.add(this.options.textNodeName,""),C.tagName!==C.tagExp&&C.attrExpPresent&&(D[":@"]=this.buildAttributesMap(C.tagExp,U,C.tagName)),this.addChild(S,D,U)}M=C.closeIndex+1}else if(R.substr(M+1,3)==="!--"){const C=h(R,"-->",M+4,"Comment is not closed.");if(this.options.commentPropName){const D=R.substring(M+4,C-2);A=this.saveTextToParentTag(A,S,U),S.add(this.options.commentPropName,[{[this.options.textNodeName]:D}])}M=C}else if(R.substr(M+1,2)==="!D"){const C=u(R,M);this.docTypeEntities=C.entities,M=C.i}else if(R.substr(M+1,2)==="!["){const C=h(R,"]]>",M,"CDATA is not closed.")-2,D=R.substring(M+9,C);A=this.saveTextToParentTag(A,S,U);let F=this.parseTextData(D,S.tagname,U,!0,!1,!0,!0);F==null&&(F=""),this.options.cdataPropName?S.add(this.options.cdataPropName,[{[this.options.textNodeName]:D}]):S.add(this.options.textNodeName,F),M=C+2}else{let C=b(R,M,this.options.removeNSPrefix),D=C.tagName;const F=C.rawTagName;let G=C.tagExp,X=C.attrExpPresent,V=C.closeIndex;this.options.transformTagName&&(D=this.options.transformTagName(D)),S&&A&&S.tagname!=="!xml"&&(A=this.saveTextToParentTag(A,S,U,!1));const Z=S;if(Z&&this.options.unpairedTags.indexOf(Z.tagname)!==-1&&(S=this.tagsNodeStack.pop(),U=U.substring(0,U.lastIndexOf("."))),D!==L.tagname&&(U+=U?"."+D:D),this.isItStopNode(this.options.stopNodes,U,D)){let W="";if(G.length>0&&G.lastIndexOf("/")===G.length-1)D[D.length-1]==="/"?(D=D.substr(0,D.length-1),U=U.substr(0,U.length-1),G=D):G=G.substr(0,G.length-1),M=C.closeIndex;else if(this.options.unpairedTags.indexOf(D)!==-1)M=C.closeIndex;else{const q=this.readStopNodeData(R,F,V+1);if(!q)throw new Error(`Unexpected end of ${F}`);M=q.i,W=q.tagContent}const ot=new a(D);D!==G&&X&&(ot[":@"]=this.buildAttributesMap(G,U,D)),W&&(W=this.parseTextData(W,D,U,!0,X,!0,!0)),U=U.substr(0,U.lastIndexOf(".")),ot.add(this.options.textNodeName,W),this.addChild(S,ot,U)}else{if(G.length>0&&G.lastIndexOf("/")===G.length-1){D[D.length-1]==="/"?(D=D.substr(0,D.length-1),U=U.substr(0,U.length-1),G=D):G=G.substr(0,G.length-1),this.options.transformTagName&&(D=this.options.transformTagName(D));const W=new a(D);D!==G&&X&&(W[":@"]=this.buildAttributesMap(G,U,D)),this.addChild(S,W,U),U=U.substr(0,U.lastIndexOf("."))}else{const W=new a(D);this.tagsNodeStack.push(S),D!==G&&X&&(W[":@"]=this.buildAttributesMap(G,U,D)),this.addChild(S,W,U),S=W}A="",M=V}}else A+=R[M];return L.child};function w(R,L,S){const A=this.options.updateTag(L.tagname,S,L[":@"]);A===!1||(typeof A=="string"&&(L.tagname=A),R.addChild(L))}const E=function(R){if(this.options.processEntities){for(let L in this.docTypeEntities){const S=this.docTypeEntities[L];R=R.replace(S.regx,S.val)}for(let L in this.lastEntities){const S=this.lastEntities[L];R=R.replace(S.regex,S.val)}if(this.options.htmlEntities)for(let L in this.htmlEntities){const S=this.htmlEntities[L];R=R.replace(S.regex,S.val)}R=R.replace(this.ampEntity.regex,this.ampEntity.val)}return R};function O(R,L,S,A){return R&&(A===void 0&&(A=Object.keys(L.child).length===0),(R=this.parseTextData(R,L.tagname,S,!1,!!L[":@"]&&Object.keys(L[":@"]).length!==0,A))!==void 0&&R!==""&&L.add(this.options.textNodeName,R),R=""),R}function I(R,L,S){const A="*."+S;for(const U in R){const M=R[U];if(A===M||L===M)return!0}return!1}function h(R,L,S,A){const U=R.indexOf(L,S);if(U===-1)throw new Error(A);return U+L.length-1}function b(R,L,S){const A=(function(X,V){let Z,W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",ot="";for(let q=V;q3&&arguments[3]!==void 0?arguments[3]:">");if(!A)return;let U=A.data;const M=A.index,C=U.search(/\s/);let D=U,F=!0;C!==-1&&(D=U.substring(0,C),U=U.substring(C+1).trimStart());const G=D;if(S){const X=D.indexOf(":");X!==-1&&(D=D.substr(X+1),F=D!==A.data.substr(X+1))}return{tagName:D,tagExp:U,closeIndex:M,attrExpPresent:F,rawTagName:G}}function T(R,L,S){const A=S;let U=1;for(;S",S,`${L} is not closed`);if(R.substring(S+2,M).trim()===L&&(U--,U===0))return{tagContent:R.substring(A,S),i:M};S=M}else if(R[S+1]==="?")S=h(R,"?>",S+1,"StopNode is not closed.");else if(R.substr(S+1,3)==="!--")S=h(R,"-->",S+3,"StopNode is not closed.");else if(R.substr(S+1,2)==="![")S=h(R,"]]>",S,"StopNode is not closed.")-2;else{const M=b(R,S,">");M&&((M&&M.tagName)===L&&M.tagExp[M.tagExp.length-1]!=="/"&&U++,S=M.closeIndex)}}function P(R,L,S){if(L&&typeof R=="string"){const A=R.trim();return A==="true"||A!=="false"&&c(R,S)}return i.isExist(R)?R:""}e.exports=class{constructor(R){this.options=R,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(L,S)=>String.fromCharCode(Number.parseInt(S,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(L,S)=>String.fromCharCode(Number.parseInt(S,16))}},this.addExternalEntities=m,this.parseXml=v,this.parseTextData=f,this.resolveNameSpace=s,this.buildAttributesMap=p,this.isItStopNode=I,this.replaceEntitiesValue=E,this.readStopNodeData=T,this.saveTextToParentTag=O,this.addChild=w,this.ignoreAttributesFn=l(this.options.ignoreAttributes)}}},338:(e,t,n)=>{const{buildOptions:i}=n(63),a=n(299),{prettify:u}=n(728),c=n(31);e.exports=class{constructor(l){this.externalEntities={},this.options=i(l)}parse(l,m){if(typeof l!="string"){if(!l.toString)throw new Error("XML data is accepted in String or Bytes[] form.");l=l.toString()}if(m){m===!0&&(m={});const d=c.validate(l,m);if(d!==!0)throw Error(`${d.err.msg}:${d.err.line}:${d.err.col}`)}const f=new a(this.options);f.addExternalEntities(this.externalEntities);const s=f.parseXml(l);return this.options.preserveOrder||s===void 0?s:u(s,this.options)}addEntity(l,m){if(m.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(l.indexOf("&")!==-1||l.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '");if(m==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[l]=m}}},728:(e,t)=>{function n(c,l,m){let f;const s={};for(let d=0;d0&&(s[l.textNodeName]=f):f!==void 0&&(s[l.textNodeName]=f),s}function i(c){const l=Object.keys(c);for(let m=0;m{e.exports=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,n){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:n})}addChild(t){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}},135:e=>{function t(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}e.exports=function(n){return n!=null&&(t(n)||(function(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&t(i.slice(0,0))})(n)||!!n._isBuffer)}},542:(e,t,n)=>{(function(){var i=n(298),a=n(526).utf8,u=n(135),c=n(526).bin,l=function(m,f){m.constructor==String?m=f&&f.encoding==="binary"?c.stringToBytes(m):a.stringToBytes(m):u(m)?m=Array.prototype.slice.call(m,0):Array.isArray(m)||m.constructor===Uint8Array||(m=m.toString());for(var s=i.bytesToWords(m),d=8*m.length,p=1732584193,v=-271733879,w=-1732584194,E=271733878,O=0;O>>24)|4278255360&(s[O]<<24|s[O]>>>8);s[d>>>5]|=128<>>9<<4)]=d;var I=l._ff,h=l._gg,b=l._hh,T=l._ii;for(O=0;O>>0,v=v+R>>>0,w=w+L>>>0,E=E+S>>>0}return i.endian([p,v,w,E])};l._ff=function(m,f,s,d,p,v,w){var E=m+(f&s|~f&d)+(p>>>0)+w;return(E<>>32-v)+f},l._gg=function(m,f,s,d,p,v,w){var E=m+(f&d|s&~d)+(p>>>0)+w;return(E<>>32-v)+f},l._hh=function(m,f,s,d,p,v,w){var E=m+(f^s^d)+(p>>>0)+w;return(E<>>32-v)+f},l._ii=function(m,f,s,d,p,v,w){var E=m+(s^(f|~d))+(p>>>0)+w;return(E<>>32-v)+f},l._blocksize=16,l._digestsize=16,e.exports=function(m,f){if(m==null)throw new Error("Illegal argument "+m);var s=i.wordsToBytes(l(m,f));return f&&f.asBytes?s:f&&f.asString?c.bytesToString(s):i.bytesToHex(s)}})()},285:(e,t,n)=>{var i=n(2);e.exports=function(I){return I?(I.substr(0,2)==="{}"&&(I="\\{\\}"+I.substr(2)),O((function(h){return h.split("\\\\").join(a).split("\\{").join(u).split("\\}").join(c).split("\\,").join(l).split("\\.").join(m)})(I),!0).map(s)):[]};var a="\0SLASH"+Math.random()+"\0",u="\0OPEN"+Math.random()+"\0",c="\0CLOSE"+Math.random()+"\0",l="\0COMMA"+Math.random()+"\0",m="\0PERIOD"+Math.random()+"\0";function f(I){return parseInt(I,10)==I?parseInt(I,10):I.charCodeAt(0)}function s(I){return I.split(a).join("\\").split(u).join("{").split(c).join("}").split(l).join(",").split(m).join(".")}function d(I){if(!I)return[""];var h=[],b=i("{","}",I);if(!b)return I.split(",");var T=b.pre,P=b.body,R=b.post,L=T.split(",");L[L.length-1]+="{"+P+"}";var S=d(R);return R.length&&(L[L.length-1]+=S.shift(),L.push.apply(L,S)),h.push.apply(h,L),h}function p(I){return"{"+I+"}"}function v(I){return/^-?0\d/.test(I)}function w(I,h){return I<=h}function E(I,h){return I>=h}function O(I,h){var b=[],T=i("{","}",I);if(!T)return[I];var P=T.pre,R=T.post.length?O(T.post,!1):[""];if(/\$$/.test(T.pre))for(var L=0;L=0;if(!D&&!F)return T.post.match(/,.*\}/)?O(I=T.pre+"{"+T.body+c+T.post):[I];if(D)A=T.body.split(/\.\./);else if((A=d(T.body)).length===1&&(A=O(A[0],!1).map(p)).length===1)return R.map((function(Tt){return T.pre+A[0]+Tt}));if(D){var G=f(A[0]),X=f(A[1]),V=Math.max(A[0].length,A[1].length),Z=A.length==3?Math.abs(f(A[2])):1,W=w;X0){var $t=new Array(kt+1).join("0");Q=q<0?"-"+$t+Q.slice(1):$t+Q}}U.push(Q)}}else{U=[];for(var Nt=0;Nt{function t(f){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},t(f)}function n(f){var s=typeof Map=="function"?new Map:void 0;return n=function(d){if(d===null||(p=d,Function.toString.call(p).indexOf("[native code]")===-1))return d;var p;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(s!==void 0){if(s.has(d))return s.get(d);s.set(d,v)}function v(){return i(d,arguments,u(this).constructor)}return v.prototype=Object.create(d.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),a(v,d)},n(f)}function i(f,s,d){return i=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch{return!1}})()?Reflect.construct:function(p,v,w){var E=[null];E.push.apply(E,v);var O=new(Function.bind.apply(p,E));return w&&a(O,w.prototype),O},i.apply(null,arguments)}function a(f,s){return a=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},a(f,s)}function u(f){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},u(f)}var c=(function(f){function s(d){var p;return(function(v,w){if(!(v instanceof w))throw new TypeError("Cannot call a class as a function")})(this,s),(p=(function(v,w){return!w||t(w)!=="object"&&typeof w!="function"?(function(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E})(v):w})(this,u(s).call(this,d))).name="ObjectPrototypeMutationError",p}return(function(d,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(p&&p.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),p&&a(d,p)})(s,f),s})(n(Error));function l(f,s){for(var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},p=s.split("."),v=p.length,w=function(I){var h=p[I];if(!f)return{v:void 0};if(h==="+"){if(Array.isArray(f))return{v:f.map((function(T,P){var R=p.slice(I+1);return R.length>0?l(T,R.join("."),d):d(f,P,p,I)}))};var b=p.slice(0,I).join(".");throw new Error("Object at wildcard (".concat(b,") is not an array"))}f=d(f,h,p,I)},E=0;E2&&arguments[2]!==void 0?arguments[2]:{};if(t(f)!="object"||f===null||s===void 0)return!1;if(typeof s=="number")return s in f;try{var p=!1;return l(f,s,(function(v,w,E,O){if(!m(E,O))return v&&v[w];p=d.own?v.hasOwnProperty(w):w in v})),p}catch{return!1}},hasOwn:function(f,s,d){return this.has(f,s,d||{own:!0})},isIn:function(f,s,d){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(f)!="object"||f===null||s===void 0)return!1;try{var v=!1,w=!1;return l(f,s,(function(E,O,I,h){return v=v||E===d||!!E&&E[O]===d,w=m(I,h)&&t(E)==="object"&&O in E,E&&E[O]})),p.validPath?v&&w:v}catch{return!1}},ObjectPrototypeMutationError:c}},47:(e,t,n)=>{var i=n(410),a=function(f){return typeof f=="string"};function u(f,s){for(var d=[],p=0;p=-1&&!s;d--){var p=d>=0?arguments[d]:Qt.cwd();if(!a(p))throw new TypeError("Arguments to path.resolve must be strings");p&&(f=p+"/"+f,s=p.charAt(0)==="/")}return(s?"/":"")+(f=u(f.split("/"),!s).join("/"))||"."},l.normalize=function(f){var s=l.isAbsolute(f),d=f.substr(-1)==="/";return(f=u(f.split("/"),!s).join("/"))||s||(f="."),f&&d&&(f+="/"),(s?"/":"")+f},l.isAbsolute=function(f){return f.charAt(0)==="/"},l.join=function(){for(var f="",s=0;s=0&&h[T]==="";T--);return b>T?[]:h.slice(b,T+1)}f=l.resolve(f).substr(1),s=l.resolve(s).substr(1);for(var p=d(f.split("/")),v=d(s.split("/")),w=Math.min(p.length,v.length),E=w,O=0;O{var n=Object.prototype.hasOwnProperty;function i(u){try{return decodeURIComponent(u.replace(/\+/g," "))}catch{return null}}function a(u){try{return encodeURIComponent(u)}catch{return null}}t.stringify=function(u,c){c=c||"";var l,m,f=[];for(m in typeof c!="string"&&(c="?"),u)if(n.call(u,m)){if((l=u[m])||l!=null&&!isNaN(l)||(l=""),m=a(m),l=a(l),m===null||l===null)continue;f.push(m+"="+l)}return f.length?c+f.join("&"):""},t.parse=function(u){for(var c,l=/([^=?#&]+)=?([^&]*)/g,m={};c=l.exec(u);){var f=i(c[1]),s=i(c[2]);f===null||s===null||f in m||(m[f]=s)}return m}},670:e=>{e.exports=function(t,n){if(n=n.split(":")[0],!(t=+t))return!1;switch(n){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0}},494:e=>{const t=/^[-+]?0x[a-fA-F0-9]+$/,n=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const i={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};e.exports=function(a){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(u=Object.assign({},i,u),!a||typeof a!="string")return a;let c=a.trim();if(u.skipLike!==void 0&&u.skipLike.test(c))return a;if(u.hex&&t.test(c))return Number.parseInt(c,16);{const m=n.exec(c);if(m){const f=m[1],s=m[2];let d=((l=m[3])&&l.indexOf(".")!==-1&&((l=l.replace(/0+$/,""))==="."?l="0":l[0]==="."?l="0"+l:l[l.length-1]==="."&&(l=l.substr(0,l.length-1))),l);const p=m[4]||m[6];if(!u.leadingZeros&&s.length>0&&f&&c[2]!=="."||!u.leadingZeros&&s.length>0&&!f&&c[1]!==".")return a;{const v=Number(c),w=""+v;return w.search(/[eE]/)!==-1||p?u.eNotation?v:a:c.indexOf(".")!==-1?w==="0"&&d===""||w===d||f&&w==="-"+d?v:a:s?d===w||f+d===w?v:a:c===w||c===f+w?v:a}}return a}var l}},737:(e,t,n)=>{var i=n(670),a=n(647),u=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,c=/[\n\r\t]/g,l=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,m=/:\d+$/,f=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,s=/^[a-zA-Z]:/;function d(h){return(h||"").toString().replace(u,"")}var p=[["#","hash"],["?","query"],function(h,b){return E(b.protocol)?h.replace(/\\/g,"/"):h},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],v={hash:1,query:1};function w(h){var b,T=(typeof window<"u"?window:typeof re<"u"?re:typeof self<"u"?self:{}).location||{},P={},R=typeof(h=h||T);if(h.protocol==="blob:")P=new I(unescape(h.pathname),{});else if(R==="string")for(b in P=new I(h,{}),v)delete P[b];else if(R==="object"){for(b in h)b in v||(P[b]=h[b]);P.slashes===void 0&&(P.slashes=l.test(h.href))}return P}function E(h){return h==="file:"||h==="ftp:"||h==="http:"||h==="https:"||h==="ws:"||h==="wss:"}function O(h,b){h=(h=d(h)).replace(c,""),b=b||{};var T,P=f.exec(h),R=P[1]?P[1].toLowerCase():"",L=!!P[2],S=!!P[3],A=0;return L?S?(T=P[2]+P[3]+P[4],A=P[2].length+P[3].length):(T=P[2]+P[4],A=P[2].length):S?(T=P[3]+P[4],A=P[3].length):T=P[4],R==="file:"?A>=2&&(T=T.slice(2)):E(R)?T=P[4]:R?L&&(T=T.slice(2)):A>=2&&E(b.protocol)&&(T=P[4]),{protocol:R,slashes:L||E(R),slashesCount:A,rest:T}}function I(h,b,T){if(h=(h=d(h)).replace(c,""),!(this instanceof I))return new I(h,b,T);var P,R,L,S,A,U,M=p.slice(),C=typeof b,D=this,F=0;for(C!=="object"&&C!=="string"&&(T=b,b=null),T&&typeof T!="function"&&(T=a.parse),P=!(R=O(h||"",b=w(b))).protocol&&!R.slashes,D.slashes=R.slashes||P&&b.slashes,D.protocol=R.protocol||b.protocol||"",h=R.rest,(R.protocol==="file:"&&(R.slashesCount!==2||s.test(h))||!R.slashes&&(R.protocol||R.slashesCount<2||!E(D.protocol)))&&(M[3]=[/(.*)/,"pathname"]);F{},388:()=>{},805:()=>{},345:()=>{},800:()=>{}},Rn={};function Y(e){var t=Rn[e];if(t!==void 0)return t.exports;var n=Rn[e]={id:e,loaded:!1,exports:{}};return si[e].call(n.exports,n,n.exports,Y),n.loaded=!0,n.exports}Y.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return Y.d(t,{a:t}),t},Y.d=(e,t)=>{for(var n in t)Y.o(t,n)&&!Y.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},Y.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Y.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var It={};Y.d(It,{hT:()=>Et,O4:()=>_t,Kd:()=>gi,YK:()=>di,UU:()=>ws,Gu:()=>dr,ky:()=>Or,h4:()=>te,ch:()=>Ee,hq:()=>Mt,i5:()=>Ir});var oi=Y(737),ai=Y.n(oi);function Re(e){if(!Ye(e))throw new Error("Parameter was not an error")}function Ye(e){return!!e&&typeof e=="object"&&(t=e,Object.prototype.toString.call(t)==="[object Error]")||e instanceof Error;var t}class vt extends Error{constructor(t,n){const i=[...arguments],{options:a,shortMessage:u}=(function(l){let m,f="";if(l.length===0)m={};else if(Ye(l[0]))m={cause:l[0]},f=l.slice(1).join(" ")||"";else if(l[0]&&typeof l[0]=="object")m=Object.assign({},l[0]),f=l.slice(1).join(" ")||"";else{if(typeof l[0]!="string")throw new Error("Invalid arguments passed to Layerr");m={},f=f=l.join(" ")||""}return{options:m,shortMessage:f}})(i);let c=u;if(a.cause&&(c=`${c}: ${a.cause.message}`),super(c),this.message=c,a.name&&typeof a.name=="string"?this.name=a.name:this.name="Layerr",a.cause&&Object.defineProperty(this,"_cause",{value:a.cause}),Object.defineProperty(this,"_info",{value:{}}),a.info&&typeof a.info=="object"&&Object.assign(this._info,a.info),Error.captureStackTrace){const l=a.constructorOpt||this.constructor;Error.captureStackTrace(this,l)}}static cause(t){return Re(t),t._cause&&Ye(t._cause)?t._cause:null}static fullStack(t){Re(t);const n=vt.cause(t);return n?`${t.stack} caused by: ${vt.fullStack(n)}`:t.stack??""}static info(t){Re(t);const n={},i=vt.cause(t);return i&&Object.assign(n,vt.info(i)),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 ui=Y(47),le=Y.n(ui);const Cn="__PATH_SEPARATOR_POSIX__",Sn="__PATH_SEPARATOR_WINDOWS__";function tt(e){try{const t=e.replace(/\//g,Cn).replace(/\\\\/g,Sn);return encodeURIComponent(t).split(Sn).join("\\\\").split(Cn).join("/")}catch(t){throw new vt(t,"Failed encoding path")}}function xn(e){return e.startsWith("/")?e:"/"+e}function Jt(e){let t=e;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function ci(e){let t=new(ai())(e).pathname;return t.length<=0&&(t="/"),Jt(t)}function et(){for(var e=arguments.length,t=new Array(e),n=0;n1){var u=i.shift();i[0]=u+i[0]}i[0].match(/^file:\/\/\//)?i[0]=i[0].replace(/^([^/:]+):\/*/,"$1:///"):i[0]=i[0].replace(/^([^/:]+):\/*/,"$1://");for(var c=0;c0&&(l=l.replace(/^[\/]+/,"")),l=c0?"?":"")+f.join("&")})(typeof arguments[0]=="object"?arguments[0]:[].slice.call(arguments))})(t.reduce(((i,a,u)=>((u===0||a!=="/"||a==="/"&&i[i.length-1]!=="/")&&i.push(a),i)),[]))}var li=Y(542),Yt=Y.n(li);const hi="abcdef0123456789";function Pn(e,t){const n=e.url.replace("//",""),i=n.indexOf("/")==-1?"/":n.slice(n.indexOf("/")),a=e.method?e.method.toUpperCase():"GET",u=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&"auth",c=`00000000${t.nc}`.slice(-8),l=(function(p,v,w,E,O,I,h){const b=h||Yt()(`${v}:${w}:${E}`);return p&&p.toLowerCase()==="md5-sess"?Yt()(`${b}:${O}:${I}`):b})(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),m=Yt()(`${a}:${i}`),f=u?Yt()(`${l}:${t.nonce}:${c}:${t.cnonce}:${u}:${m}`):Yt()(`${l}:${t.nonce}:${m}`),s={username:t.username,realm:t.realm,nonce:t.nonce,uri:i,qop:u,response:f,nc:c,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},d=[];for(const p in s)s[p]&&(p==="qop"||p==="nc"||p==="algorithm"?d.push(`${p}=${s[p]}`):d.push(`${p}="${s[p]}"`));return`Digest ${d.join(", ")}`}function fr(e){return(e.headers&&e.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var fi=Y(101),pr=Y.n(fi);function Ln(e){return pr().decode(e)}function _n(e,t){var n;return`Basic ${n=`${e}:${t}`,pr().encode(n)}`}const he=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,pi=he.fetch.bind(he),gi=he.Request,di=he.Response;let Et=(function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e})({}),_t=(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 gr(e,t,n,i,a){switch(e.authType){case Et.Auto:t&&n&&(e.headers.Authorization=_n(t,n));break;case Et.Digest:e.digest=(function(c,l,m){return{username:c,password:l,ha1:m,nc:0,algorithm:"md5",hasDigestAuth:!1}})(t,n,a);break;case Et.None:break;case Et.Password:e.headers.Authorization=_n(t,n);break;case Et.Token:e.headers.Authorization=`${(u=i).token_type} ${u.access_token}`;break;default:throw new vt({info:{code:_t.InvalidAuthType}},`Invalid auth type: ${e.authType}`)}var u}Y(345),Y(800);const $n="@@HOTPATCHER",mi=()=>{};function Ce(e){return{original:e,methods:[e],final:!1}}class yi{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=$n}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__!==$n)throw new Error("Failed taking control of target HotPatcher instance: Invalid type or object");return Object.keys(t.configuration.registry).forEach((i=>{this.configuration.registry.hasOwnProperty(i)?n&&(this.configuration.registry[i]=Object.assign({},t.configuration.registry[i])):this.configuration.registry[i]=Object.assign({},t.configuration.registry[i])})),t._configuration=this.configuration,this}execute(t){const n=this.get(t)||mi;for(var i=arguments.length,a=new Array(i>1?i-1:0),u=1;u0;)f=[a.shift().apply(s,f)];return f[0]}})(...n.methods)}isPatched(t){return!!this.configuration.registry[t]}patch(t,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{chain:a=!1}=i;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(a)this.configuration.registry[t]?this.configuration.registry[t].methods.push(n):this.configuration.registry[t]=Ce(n);else if(this.isPatched(t)){const{original:u}=this.configuration.registry[t];this.configuration.registry[t]=Object.assign(Ce(n),{original:u})}else this.configuration.registry[t]=Ce(n);return this}patchInline(t,n){this.isPatched(t)||this.patch(t,n);for(var i=arguments.length,a=new Array(i>2?i-2:0),u=2;u1?n-1:0),a=1;a{this.patch(t,u,{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 Se=null;function dr(){return Se||(Se=new yi),Se}function fe(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 Dn(){for(var e=arguments.length,t=new Array(e),n=0;n0;){const u=a.shift();i=i?mr(i,u):fe(u)}return i}function mr(e,t){const n=fe(e);return Object.keys(t).forEach((i=>{n.hasOwnProperty(i)?Array.isArray(t[i])?n[i]=Array.isArray(n[i])?[...n[i],...t[i]]:[...t[i]]:typeof t[i]=="object"&&t[i]?n[i]=typeof n[i]=="object"&&n[i]?mr(n[i],t[i]):fe(t[i]):n[i]=t[i]:n[i]=t[i]})),n}function Ei(e){const t={};for(const n of e.keys())t[n]=e.get(n);return t}function He(){for(var e=arguments.length,t=new Array(e),n=0;n(Object.keys(u).forEach((c=>{const l=c.toLowerCase();i.hasOwnProperty(l)?a[i[l]]=u[c]:(i[l]=c,a[c]=u[c])})),a)),{})}Y(805);const bi=typeof ArrayBuffer=="function",{toString:vi}=Object.prototype;function yr(e){return bi&&(e instanceof ArrayBuffer||vi.call(e)==="[object ArrayBuffer]")}function Er(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function rn(e){return function(){for(var t=[],n=0;nt.patchInline("fetch",pi,n.url,(function(i){let a={};const u={method:i.method};if(i.headers&&(a=He(a,i.headers)),i.data!==void 0){const[c,l]=(function(m){if(typeof m=="string")return[m,{}];if(Er(m))return[m,{}];if(yr(m))return[m,{}];if(m&&typeof m=="object")return[JSON.stringify(m),{"content-type":"application/json"}];throw new Error("Unable to convert request body: Unexpected body type: "+typeof m)})(i.data);u.body=c,a=He(a,l)}return i.signal&&(u.signal=i.signal),i.withCredentials&&(u.credentials="include"),u.headers=a,u})(n))),e)}var Ni=Y(285);const ge=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},Ai={"[: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]},Ht=e=>e.replace(/[[\]\\-]/g,"\\$&"),Bn=e=>e.join(""),Oi=(e,t)=>{const n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");const i=[],a=[];let u=n+1,c=!1,l=!1,m=!1,f=!1,s=n,d="";t:for(;ud?i.push(Ht(d)+"-"+Ht(E)):E===d&&i.push(Ht(E)),d="",u++):e.startsWith("-]",u+1)?(i.push(Ht(E+"-")),u+=2):e.startsWith("-",u+1)?(d=E,u+=2):(i.push(Ht(E)),u++)}else m=!0,u++}else f=!0,u++}if(s1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")},Ii=new Set(["!","?","+","*","@"]),Un=e=>Ii.has(e),xe="(?!\\.)",Ti=new Set(["[","."]),Ri=new Set(["..","."]),Ci=new Set("().*{}+?[]^$\\!"),sn="[^/]",jn=sn+"*?",Mn=sn+"+?";class yt{type;#n;#r;#s=!1;#t=[];#e;#o;#u;#a=!1;#i;#c;#h=!1;constructor(t,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&(this.#r=!0),this.#e=n,this.#n=this.#e?this.#e.#n:this,this.#i=this.#n===this?i:this.#n.#i,this.#u=this.#n===this?[]:this.#n.#u,t!=="!"||this.#n.#a||this.#u.push(this),this.#o=this.#e?this.#e.#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.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#t.map((t=>String(t))).join("|")+")":this.#c=this.#t.map((t=>String(t))).join("")}#p(){if(this!==this.#n)throw new Error("should only call on root");if(this.#a)return this;let t;for(this.toString(),this.#a=!0;t=this.#u.pop();){if(t.type!=="!")continue;let n=t,i=n.#e;for(;i;){for(let a=n.#o+1;!i.type&&atypeof n=="string"?n:n.toJSON())):[this.type,...this.#t.map((n=>n.toJSON()))];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#a&&this.#e?.type==="!")&&t.push({}),t}isStart(){if(this.#n===this)return!0;if(!this.#e?.isStart())return!1;if(this.#o===0)return!0;const t=this.#e;for(let n=0;n1&&arguments[1]!==void 0?arguments[1]:{};const i=new yt(null,void 0,n);return yt.#l(t,i,0,n),i}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();const t=this.toString(),[n,i,a,u]=this.toRegExpSource();if(!(a||this.#r||this.#i.nocase&&!this.#i.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return i;const c=(this.#i.nocase?"i":"")+(u?"u":"");return Object.assign(new RegExp(`^${n}$`,c),{_src:n,_glob:t})}get options(){return this.#i}toRegExpSource(t){const n=t??!!this.#i.dot;if(this.#n===this&&this.#p(),!this.type){const m=this.isStart()&&this.isEnd(),f=this.#t.map((p=>{const[v,w,E,O]=typeof p=="string"?yt.#g(p,this.#r,m):p.toRegExpSource(t);return this.#r=this.#r||E,this.#s=this.#s||O,v})).join("");let s="";if(this.isStart()&&typeof this.#t[0]=="string"&&(this.#t.length!==1||!Ri.has(this.#t[0]))){const p=Ti,v=n&&p.has(f.charAt(0))||f.startsWith("\\.")&&p.has(f.charAt(2))||f.startsWith("\\.\\.")&&p.has(f.charAt(4)),w=!n&&!t&&p.has(f.charAt(0));s=v?"(?!(?:^|/)\\.\\.?(?:$|/))":w?xe:""}let d="";return this.isEnd()&&this.#n.#a&&this.#e?.type==="!"&&(d="(?:$|\\/)"),[s+f+d,Zt(f),this.#r=!!this.#r,this.#s]}const i=this.type==="*"||this.type==="+",a=this.type==="!"?"(?:(?!(?:":"(?:";let u=this.#f(n);if(this.isStart()&&this.isEnd()&&!u&&this.type!=="!"){const m=this.toString();return this.#t=[m],this.type=null,this.#r=void 0,[m,Zt(this.toString()),!1,!1]}let c=!i||t||n?"":this.#f(!0);c===u&&(c=""),c&&(u=`(?:${u})(?:${c})*?`);let l="";return l=this.type==="!"&&this.#h?(this.isStart()&&!n?xe:"")+Mn:a+u+(this.type==="!"?"))"+(!this.isStart()||n||t?"":xe)+jn+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&c?")":this.type==="*"&&c?")?":`)${this.type}`),[l,Zt(u),this.#r=!!this.#r,this.#s]}#f(t){return this.#t.map((n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");const[i,a,u,c]=n.toRegExpSource(t);return this.#s=this.#s||c,i})).filter((n=>!(this.isStart()&&this.isEnd()&&!n))).join("|")}static#g(t,n){let i=arguments.length>2&&arguments[2]!==void 0&&arguments[2],a=!1,u="",c=!1;for(let l=0;l2&&arguments[2]!==void 0?arguments[2]:{};return ge(t),!(!n.nocomment&&t.charAt(0)==="#")&&new de(t,n).match(e)},Si=/^\*+([^+@!?\*\[\(]*)$/,xi=e=>t=>!t.startsWith(".")&&t.endsWith(e),Pi=e=>t=>t.endsWith(e),Li=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),_i=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),$i=/^\*+\.\*+$/,Di=e=>!e.startsWith(".")&&e.includes("."),Bi=e=>e!=="."&&e!==".."&&e.includes("."),Ui=/^\.\*+$/,ji=e=>e!=="."&&e!==".."&&e.startsWith("."),Mi=/^\*+$/,ki=e=>e.length!==0&&!e.startsWith("."),Gi=e=>e.length!==0&&e!=="."&&e!=="..",Fi=/^\?+([^+@!?\*\[\(]*)?$/,Vi=e=>{let[t,n=""]=e;const i=vr([t]);return n?(n=n.toLowerCase(),a=>i(a)&&a.toLowerCase().endsWith(n)):i},Xi=e=>{let[t,n=""]=e;const i=wr([t]);return n?(n=n.toLowerCase(),a=>i(a)&&a.toLowerCase().endsWith(n)):i},zi=e=>{let[t,n=""]=e;const i=wr([t]);return n?a=>i(a)&&a.endsWith(n):i},qi=e=>{let[t,n=""]=e;const i=vr([t]);return n?a=>i(a)&&a.endsWith(n):i},vr=e=>{let[t]=e;const n=t.length;return i=>i.length===n&&!i.startsWith(".")},wr=e=>{let[t]=e;const n=t.length;return i=>i.length===n&&i!=="."&&i!==".."},Nr=typeof Qt=="object"&&Qt?typeof Te=="object"&&Te&&Te.__MINIMATCH_TESTING_PLATFORM__||Qt.platform:"posix";mt.sep=Nr==="win32"?"\\":"/";const Ot=Symbol("globstar **");mt.GLOBSTAR=Ot,mt.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>mt(n,e,t)};const At=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};mt.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return mt;const t=mt;return Object.assign((function(n,i){return t(n,i,At(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}),{Minimatch:class extends t.Minimatch{constructor(n){super(n,At(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(n){return t.defaults(At(e,n)).Minimatch}},AST:class extends t.AST{constructor(n,i){super(n,i,At(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}static fromGlob(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.AST.fromGlob(n,At(e,i))}},unescape:function(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(n,At(e,i))},escape:function(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(n,At(e,i))},filter:function(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(n,At(e,i))},defaults:n=>t.defaults(At(e,n)),makeRe:function(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(n,At(e,i))},braceExpand:function(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(n,At(e,i))},match:function(n,i){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(n,i,At(e,a))},sep:t.sep,GLOBSTAR:Ot})};const Ar=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ge(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Ni(e)};mt.braceExpand=Ar,mt.makeRe=function(e){return new de(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},mt.match=function(e,t){const n=new de(t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{});return e=e.filter((i=>n.match(i))),n.options.nonull&&!e.length&&e.push(t),e};const kn=/[?*]|[+@!]\(.*?\)|\[|\]/;class de{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ge(t),n=n||{},this.options=n,this.pattern=t,this.platform=n.platform||Nr,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 i=this.globSet.map((u=>this.slashSplit(u)));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let a=this.globParts.map(((u,c,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){const m=!(u[0]!==""||u[1]!==""||u[2]!=="?"&&kn.test(u[2])||kn.test(u[3])),f=/^[a-z]:/i.test(u[0]);if(m)return[...u.slice(0,4),...u.slice(4).map((s=>this.parse(s)))];if(f)return[u[0],...u.slice(1).map((s=>this.parse(s)))]}return u.map((m=>this.parse(m)))}));if(this.debug(this.pattern,a),this.set=a.filter((u=>u.indexOf(!1)===-1)),this.isWindows)for(let u=0;u=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 i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let a=i;for(;n[a+1]==="**";)a++;a!==i&&n.splice(i,a-i)}return n}))}levelOneOptimize(t){return t.map((n=>(n=n.reduce(((i,a)=>{const u=i[i.length-1];return a==="**"&&u==="**"?i:a===".."&&u&&u!==".."&&u!=="."&&u!=="**"?(i.pop(),i):(i.push(a),i)}),[])).length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let a=1;aa&&i.splice(a+1,c-a);let l=i[a+1];const m=i[a+2],f=i[a+3];if(l!==".."||!m||m==="."||m===".."||!f||f==="."||f==="..")continue;n=!0,i.splice(a,1);const s=i.slice(0);s[a]="**",t.push(s),a--}if(!this.preserveMultipleSlashes){for(let c=1;cn.length))}partsMatch(t,n){let i=arguments.length>2&&arguments[2]!==void 0&&arguments[2],a=0,u=0,c=[],l="";for(;a2&&arguments[2]!==void 0&&arguments[2];const a=this.options;if(this.isWindows){const E=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),O=!E&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),I=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),h=O?3:E?0:void 0,b=!I&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])?3:I?0:void 0;if(typeof h=="number"&&typeof b=="number"){const[T,P]=[t[h],n[b]];T.toLowerCase()===P.toLowerCase()&&(n[b]=T,b>h?n=n.slice(b):h>b&&(t=t.slice(h)))}}const{optimizationLevel:u=1}=this.options;u>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:n}),this.debug("matchOne",t.length,n.length);for(var c=0,l=0,m=t.length,f=n.length;c>> no match, partial?`,t,p,n,v),p!==m))}let E;if(typeof s=="string"?(E=d===s,this.debug("string match",s,d,E)):(E=s.test(d),this.debug("pattern match",s,d,E)),!E)return!1}if(c===m&&l===f)return!0;if(c===m)return i;if(l===f)return c===m-1&&t[c]==="";throw new Error("wtf?")}braceExpand(){return Ar(this.pattern,this.options)}parse(t){ge(t);const n=this.options;if(t==="**")return Ot;if(t==="")return"";let i,a=null;(i=t.match(Mi))?a=n.dot?Gi:ki:(i=t.match(Si))?a=(n.nocase?n.dot?_i:Li:n.dot?Pi:xi)(i[1]):(i=t.match(Fi))?a=(n.nocase?n.dot?Xi:Vi:n.dot?zi:qi)(i):(i=t.match($i))?a=n.dot?Bi:Di:(i=t.match(Ui))&&(a=ji);const u=yt.fromGlob(t,this.options).toMMPattern();return a&&typeof u=="object"&&Reflect.defineProperty(u,"test",{value:a}),u}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const n=this.options,i=n.noglobstar?"[^/]*?":n.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",a=new Set(n.nocase?["i"]:[]);let u=t.map((m=>{const f=m.map((s=>{if(s instanceof RegExp)for(const d of s.flags.split(""))a.add(d);return typeof s=="string"?s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):s===Ot?Ot:s._src}));return f.forEach(((s,d)=>{const p=f[d+1],v=f[d-1];s===Ot&&v!==Ot&&(v===void 0?p!==void 0&&p!==Ot?f[d+1]="(?:\\/|"+i+"\\/)?"+p:f[d]=i:p===void 0?f[d-1]=v+"(?:\\/|"+i+")?":p!==Ot&&(f[d-1]=v+"(?:\\/|\\/"+i+"\\/)"+p,f[d+1]=Ot))})),f.filter((s=>s!==Ot)).join("/")})).join("|");const[c,l]=t.length>1?["(?:",")"]:["",""];u="^"+c+u+l+"$",this.negate&&(u="^(?!"+u+").+$");try{this.regexp=new RegExp(u,[...a].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 i=this.options;this.isWindows&&(t=t.split("\\").join("/"));const a=this.slashSplit(t);this.debug(this.pattern,"split",a);const u=this.set;this.debug(this.pattern,"set",u);let c=a[a.length-1];if(!c)for(let l=a.length-2;!c&&l>=0;l--)c=a[l];for(let l=0;l1&&arguments[1]!==void 0?arguments[1]:""}Invalid response: ${e.status} ${e.statusText}`);return t.status=e.status,t.response=e,t}function lt(e,t){const{status:n}=t;if(n===401&&e.digest)return t;if(n>=400)throw on(t);return t}function Mt(e,t){return arguments.length>2&&arguments[2]!==void 0&&arguments[2]?{data:t,headers:e.headers?Ei(e.headers):{},status:e.status,statusText:e.statusText}:t}mt.AST=yt,mt.Minimatch=de,mt.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},mt.unescape=Zt;const Wi=(Gn=function(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=ct({url:et(e.remoteURL,tt(t)),method:"COPY",headers:{Destination:et(e.remoteURL,tt(n)),Overwrite:i.overwrite===!1?"F":"T",Depth:i.shallow?"0":"infinity"}},e,i);return c=function(l){lt(e,l)},(u=ut(a,e))&&u.then||(u=Promise.resolve(u)),c?u.then(c):u;var u,c},function(){for(var e=[],t=0;t2&&arguments[2]!==void 0?arguments[2]:Vt.Original;const i=Lt().get(e,t);return n==="array"&&Array.isArray(i)===!1?[i]:n==="object"&&Array.isArray(i)?i[0]:i}function te(e){return new Promise((t=>{t((function(n){const{multistatus:i}=n;if(i==="")return{multistatus:{response:[]}};if(!i)throw new Error("Invalid response: No root multistatus found");const a={multistatus:Array.isArray(i)?i[0]:i};return Lt().set(a,"multistatus.response",oe(a,"multistatus.response",Vt.Array)),Lt().set(a,"multistatus.response",Lt().get(a,"multistatus.response").map((u=>(function(c){const l=Object.assign({},c);return l.status?Lt().set(l,"status",oe(l,"status",Vt.Object)):(Lt().set(l,"propstat",oe(l,"propstat",Vt.Object)),Lt().set(l,"propstat.prop",oe(l,"propstat.prop",Vt.Object))),l})(u)))),a})(new an.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",textNodeName:"text",ignoreAttributes:!1,removeNSPrefix:!0,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor:(n,i,a)=>i==="true"||i==="false"?i==="true":i,tagValueProcessor(n,i,a){if(!a.endsWith("propstat.prop.displayname"))return i}}).parse(e)))}))}function Ee(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const{getlastmodified:i=null,getcontentlength:a="0",resourcetype:u=null,getcontenttype:c=null,getetag:l=null}=e,m=u&&typeof u=="object"&&u.collection!==void 0?"directory":"file",f={filename:t,basename:le().basename(t),lastmod:i,size:parseInt(a,10),type:m,etag:typeof l=="string"?l.replace(/"/g,""):null};return m==="file"&&(f.mime=c&&typeof c=="string"?c.split(";")[0]:""),n&&(e.displayname!==void 0&&(e.displayname=String(e.displayname)),f.props=e),f}function Or(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],i=null;try{e.multistatus.response[0].propstat&&(i=e.multistatus.response[0])}catch{}if(!i)throw new Error("Failed getting item stat: bad response");const{propstat:{prop:a,status:u}}=i,[c,l,m]=u.split(" ",3),f=parseInt(l,10);if(f>=400){const s=new Error(`Invalid response: ${f} ${m}`);throw s.status=f,s}return Ee(a,Jt(t),n)}function Ir(e){switch(String(e)){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(String(e),10)}}function Pe(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const un=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const{details:i=!1}=n,a=ct({url:et(e.remoteURL,tt(t)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,n);return Pe(ut(a,e),(function(u){return lt(e,u),Pe(u.text(),(function(c){return Pe(te(c),(function(l){const m=Or(l,t,i);return Mt(u,m,i)}))}))}))}));function Tr(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const Hi=Rr((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=(function(u){if(!u||u==="/")return[];let c=u;const l=[];do l.push(c),c=le().dirname(c);while(c&&c!=="/");return l})(Jt(t));i.sort(((u,c)=>u.length>c.length?1:c.length>u.length?-1:0));let a=!1;return(function(u,c,l){if(typeof u[Vn]=="function"){let E=function(O){try{for(;!(m=d.next()).done;)if((O=c(m.value))&&O.then){if(!Xn(O))return void O.then(E,s||(s=bt.bind(null,f=new Xt,2)));O=O.v}f?bt(f,1,O):f=O}catch(I){bt(f||(f=new Xt),2,I)}};var m,f,s,d=u[Vn]();if(E(),d.return){var p=function(O){try{m.done||d.return()}catch{}return O};if(f&&f.then)return f.then(p,(function(O){throw p(O)}));p()}return f}if(!("length"in u))throw new TypeError("Object is not iterable");for(var v=[],w=0;w2&&arguments[2]!==void 0?arguments[2]:{};if(n.recursive===!0)return Hi(e,t,n);const i=ct({url:et(e.remoteURL,(a=tt(t),a.endsWith("/")?a:a+"/")),method:"MKCOL"},e,n);var a;return Tr(ut(i,e),(function(u){lt(e,u)}))}));var Qi=Y(388),zn=Y.n(Qi);const Ki=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const i={};if(typeof n.range=="object"&&typeof n.range.start=="number"){let l=`bytes=${n.range.start}-`;typeof n.range.end=="number"&&(l=`${l}${n.range.end}`),i.Range=l}const a=ct({url:et(e.remoteURL,tt(t)),method:"GET",headers:i},e,n);return c=function(l){if(lt(e,l),i.Range&&l.status!==206){const m=new Error(`Invalid response code for partial request: ${l.status}`);throw m.status=l.status,m}return n.callback&&setTimeout((()=>{n.callback(l)}),0),l.body},(u=ut(a,e))&&u.then||(u=Promise.resolve(u)),c?u.then(c):u;var u,c})),Ji=()=>{},ts=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const i=ct({url:et(e.remoteURL,tt(t)),method:"DELETE"},e,n);return u=function(c){lt(e,c)},(a=ut(i,e))&&a.then||(a=Promise.resolve(a)),u?a.then(u):a;var a,u})),ns=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};return(function(i,a){try{var u=(c=un(e,t,n),l=function(){return!0},m?l?l(c):c:(c&&c.then||(c=Promise.resolve(c)),l?c.then(l):c))}catch(f){return a(f)}var c,l,m;return u&&u.then?u.then(void 0,a):u})(0,(function(i){if(i.status===404)return!1;throw i}))}));function Le(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const rs=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const i=ct({url:et(e.remoteURL,tt(t),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:n.deep?"infinity":"1"}},e,n);return Le(ut(i,e),(function(a){return lt(e,a),Le(a.text(),(function(u){if(!u)throw new Error("Failed parsing directory contents: Empty response");return Le(te(u),(function(c){const l=xn(t);let m=(function(f,s,d){let p=arguments.length>3&&arguments[3]!==void 0&&arguments[3],v=arguments.length>4&&arguments[4]!==void 0&&arguments[4];const w=le().join(s,"/"),{multistatus:{response:E}}=f,O=E.map((I=>{const h=(function(T){try{return T.replace(/^https?:\/\/[^\/]+/,"")}catch(P){throw new vt(P,"Failed normalising HREF")}})(I.href),{propstat:{prop:b}}=I;return Ee(b,w==="/"?decodeURIComponent(Jt(h)):Jt(le().relative(decodeURIComponent(w),decodeURIComponent(h))),p)}));return v?O:O.filter((I=>I.basename&&(I.type==="file"||I.filename!==d.replace(/\/$/,""))))})(c,xn(e.remoteBasePath||e.remotePath),l,n.details,n.includeSelf);return n.glob&&(m=(function(f,s){return f.filter((d=>mt(d.filename,s,{matchBase:!0})))})(m,n.glob)),Mt(a,m,n.details)}))}))}))}));function cn(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const i=ct({url:et(e.remoteURL,tt(t)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[as]},e,n);return me(ut(i,e),(function(a){return lt(e,a),me(a.text(),(function(u){return Mt(a,u,n.details)}))}))}));function me(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const ss=cn((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=ct({url:et(e.remoteURL,tt(t)),method:"GET"},e,n);return me(ut(i,e),(function(a){let u;return lt(e,a),(function(c,l){var m=c();return m&&m.then?m.then(l):l()})((function(){return me(a.arrayBuffer(),(function(c){u=c}))}),(function(){return Mt(a,u,n.details)}))}))})),os=cn((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{format:i="binary"}=n;if(i!=="binary"&&i!=="text")throw new vt({info:{code:_t.InvalidOutputFormat}},`Invalid output format: ${i}`);return i==="text"?is(e,t,n):ss(e,t,n)})),as=e=>e;function us(e){return new an.XMLBuilder({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(Cr({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:e}}},"d"))}function Cr(e,t){const n={...e};for(const i in n)n.hasOwnProperty(i)&&(n[i]&&typeof n[i]=="object"&&i.indexOf(":")===-1?(n[`${t}:${i}`]=Cr(n[i],t),delete n[i]):/^@_/.test(i)===!1&&(n[`${t}:${i}`]=n[i],delete n[i]));return n}function Ke(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Sr(e){return function(){for(var t=[],n=0;n3&&arguments[3]!==void 0?arguments[3]:{};const a=ct({url:et(e.remoteURL,tt(t)),method:"UNLOCK",headers:{"Lock-Token":n}},e,i);return Ke(ut(a,e),(function(u){if(lt(e,u),u.status!==204&&u.status!==200)throw on(u)}))})),ls=Sr((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{refreshToken:i,timeout:a=hs}=n,u={Accept:"text/plain,application/xml",Timeout:a};i&&(u.If=i);const c=ct({url:et(e.remoteURL,tt(t)),method:"LOCK",headers:u,data:us(e.contactHref)},e,n);return Ke(ut(c,e),(function(l){return lt(e,l),Ke(l.text(),(function(m){const f=(p=m,new an.XMLParser({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(p)),s=Lt().get(f,"prop.lockdiscovery.activelock.locktoken.href"),d=Lt().get(f,"prop.lockdiscovery.activelock.timeout");var p;if(!s)throw on(l,"No lock token received: ");return{token:s,serverTimeout:d}}))}))})),hs="Infinite, Second-4100000000";function _e(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const fs=(function(e){return function(){for(var t=[],n=0;n1&&arguments[1]!==void 0?arguments[1]:{};const n=t.path||"/",i=ct({url:et(e.remoteURL,n),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,t);return _e(ut(i,e),(function(a){return lt(e,a),_e(a.text(),(function(u){return _e(te(u),(function(c){const l=(function(m){try{const[f]=m.multistatus.response,{propstat:{prop:{"quota-used-bytes":s,"quota-available-bytes":d}}}=f;return s!==void 0&&d!==void 0?{used:parseInt(String(s),10),available:Ir(d)}:null}catch{}return null})(c);return Mt(a,l,t.details)}))}))}))}));function $e(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const ps=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const{details:i=!1}=n,a=ct({url:et(e.remoteURL,tt(t)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":e.headers["Content-Type"]||"application/xml; charset=utf-8"}},e,n);return $e(ut(a,e),(function(u){return lt(e,u),$e(u.text(),(function(c){return $e(te(c),(function(l){const m=(function(f,s,d){const p={truncated:!1,results:[]};return p.truncated=f.multistatus.response.some((v=>(v.status||v.propstat?.status).split(" ",3)?.[1]==="507"&&v.href.replace(/\/$/,"").endsWith(tt(s).replace(/\/$/,"")))),f.multistatus.response.forEach((v=>{if(v.propstat===void 0)return;const w=v.href.split("/").map(decodeURIComponent).join("/");p.results.push(Ee(v.propstat.prop,w,d))})),p})(l,t,i);return Mt(u,m,i)}))}))}))})),gs=(function(e){return function(){for(var t=[],n=0;n3&&arguments[3]!==void 0?arguments[3]:{};const a=ct({url:et(e.remoteURL,tt(t)),method:"MOVE",headers:{Destination:et(e.remoteURL,tt(n)),Overwrite:i.overwrite===!1?"F":"T"}},e,i);return c=function(l){lt(e,l)},(u=ut(a,e))&&u.then||(u=Promise.resolve(u)),c?u.then(c):u;var u,c}));var ds=Y(172);const ms=(function(e){return function(){for(var t=[],n=0;n3&&arguments[3]!==void 0?arguments[3]:{};const{contentLength:a=!0,overwrite:u=!0}=i,c={"Content-Type":"application/octet-stream"};a===!1||(c["Content-Length"]=typeof a=="number"?`${a}`:`${(function(s){if(yr(s))return s.byteLength;if(Er(s))return s.length;if(typeof s=="string")return(0,ds.d)(s);throw new vt({info:{code:_t.DataTypeNoLength}},"Cannot calculate data length: Invalid type")})(n)}`),u||(c["If-None-Match"]="*");const l=ct({url:et(e.remoteURL,tt(t)),method:"PUT",headers:c,data:n},e,i);return f=function(s){try{lt(e,s)}catch(d){const p=d;if(p.status!==412||u)throw p;return!1}return!0},(m=ut(l,e))&&m.then||(m=Promise.resolve(m)),f?m.then(f):m;var m,f})),xr=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const i=ct({url:et(e.remoteURL,tt(t)),method:"OPTIONS"},e,n);return u=function(c){try{lt(e,c)}catch(l){throw l}return{compliance:(c.headers.get("DAV")??"").split(",").map((l=>l.trim())),server:c.headers.get("Server")??""}},(a=ut(i,e))&&a.then||(a=Promise.resolve(a)),u?a.then(u):a;var a,u}));function Kt(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const ys=ln((function(e,t,n,i,a){let u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>i||n<0)throw new vt({info:{code:_t.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);const c={"Content-Type":"application/octet-stream","Content-Length":""+(i-n+1),"Content-Range":`bytes ${n}-${i}/*`},l=ct({url:et(e.remoteURL,tt(t)),method:"PUT",headers:c,data:a},e,u);return Kt(ut(l,e),(function(m){lt(e,m)}))}));function qn(e,t){var n=e();return n&&n.then?n.then(t):t(n)}const Es=ln((function(e,t,n,i,a){let u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>i||n<0)throw new vt({info:{code:_t.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);const c={"Content-Type":"application/x-sabredav-partialupdate","Content-Length":""+(i-n+1),"X-Update-Range":`bytes=${n}-${i}`},l=ct({url:et(e.remoteURL,tt(t)),method:"PATCH",headers:c,data:a},e,u);return Kt(ut(l,e),(function(m){lt(e,m)}))}));function ln(e){return function(){for(var t=[],n=0;n5&&arguments[5]!==void 0?arguments[5]:{};return Kt(xr(e,t,u),(function(c){let l=!1;return qn((function(){if(c.compliance.includes("sabredav-partialupdate"))return Kt(Es(e,t,n,i,a,u),(function(m){return l=!0,m}))}),(function(m){let f=!1;return l?m:qn((function(){if(c.server.includes("Apache")&&c.compliance.includes(""))return Kt(ys(e,t,n,i,a,u),(function(s){return f=!0,s}))}),(function(s){if(f)return s;throw new vt({info:{code:_t.NotSupported}},"Not supported")}))}))}))})),vs="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function ws(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{authType:n=null,remoteBasePath:i,contactHref:a=vs,ha1:u,headers:c={},httpAgent:l,httpsAgent:m,password:f,token:s,username:d,withCredentials:p}=t;let v=n;v||(v=d||f?Et.Password:Et.None);const w={authType:v,remoteBasePath:i,contactHref:a,ha1:u,headers:Object.assign({},c),httpAgent:l,httpsAgent:m,password:f,remotePath:ci(e),remoteURL:e,token:s,username:d,withCredentials:p};return gr(w,d,f,s,u),{copyFile:(E,O,I)=>Wi(w,E,O,I),createDirectory:(E,O)=>Qe(w,E,O),createReadStream:(E,O)=>(function(I,h){let b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const T=new(zn()).PassThrough;return Ki(I,h,b).then((P=>{P.pipe(T)})).catch((P=>{T.emit("error",P)})),T})(w,E,O),createWriteStream:(E,O,I)=>(function(h,b){let T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},P=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Ji;const R=new(zn()).PassThrough,L={};T.overwrite===!1&&(L["If-None-Match"]="*");const S=ct({url:et(h.remoteURL,tt(b)),method:"PUT",headers:L,data:R,maxRedirects:0},h,T);return ut(S,h).then((A=>lt(h,A))).then((A=>{setTimeout((()=>{P(A)}),0)})).catch((A=>{R.emit("error",A)})),R})(w,E,O,I),customRequest:(E,O)=>ts(w,E,O),deleteFile:(E,O)=>es(w,E,O),exists:(E,O)=>ns(w,E,O),getDirectoryContents:(E,O)=>rs(w,E,O),getFileContents:(E,O)=>os(w,E,O),getFileDownloadLink:E=>(function(O,I){let h=et(O.remoteURL,tt(I));const b=/^https:/i.test(h)?"https":"http";switch(O.authType){case Et.None:break;case Et.Password:{const T=Ln(O.headers.Authorization.replace(/^Basic /i,"").trim());h=h.replace(/^https?:\/\//,`${b}://${T}@`);break}default:throw new vt({info:{code:_t.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${O.authType}`)}return h})(w,E),getFileUploadLink:E=>(function(O,I){let h=`${et(O.remoteURL,tt(I))}?Content-Type=application/octet-stream`;const b=/^https:/i.test(h)?"https":"http";switch(O.authType){case Et.None:break;case Et.Password:{const T=Ln(O.headers.Authorization.replace(/^Basic /i,"").trim());h=h.replace(/^https?:\/\//,`${b}://${T}@`);break}default:throw new vt({info:{code:_t.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${O.authType}`)}return h})(w,E),getHeaders:()=>Object.assign({},w.headers),getQuota:E=>fs(w,E),lock:(E,O)=>ls(w,E,O),moveFile:(E,O,I)=>gs(w,E,O,I),putFileContents:(E,O,I)=>ms(w,E,O,I),partialUpdateFileContents:(E,O,I,h,b)=>bs(w,E,O,I,h,b),getDAVCompliance:E=>xr(w,E),search:(E,O)=>ps(w,E,O),setHeaders:E=>{w.headers=Object.assign({},E)},stat:(E,O)=>un(w,E,O),unlock:(E,O,I)=>cs(w,E,O,I)}}It.hT,It.O4,It.Kd,It.YK;var Ns=It.UU,As=It.Gu;It.ky,It.h4,It.ch,It.hq,It.i5;function Os(e){return e&&e.split("/").map(encodeURIComponent).join("/")}function Pr(e,t){return e=e.replace(/\\/g,"/").replace(/\/+$/g,"").replace(/.*\//,""),e}function ae(e){e=e.replaceAll(/\\/g,"/");const t=e.split("/");return t.length<=1?".":(t.pop(),t.length===1&&t[0]===""?"/":t.join("/"))}function Is(e){const t=Pr(e),n=t.lastIndexOf(".");return n>0?t.substring(n):""}function Ts(...e){if(arguments.length<1)return"";const t=e.filter(m=>m.length>0);if(t.length<1)return"";const n=t[t.length-1],i=t[0].charAt(0)==="/",a=n.charAt(n.length-1)==="/",u=t.reduce((m,f)=>m.concat(f.split("/")),[]);let c=!i;const l=u.reduce((m,f)=>f===""?m:c?(c=!1,m+f):m+"/"+f,"");return a?l+"/":l}const jt=Jr().setApp("@nextcloud/files").detectUser().build();var be=(e=>(e.Folder="folder",e.File="file",e))(be||{}),Ct=(e=>(e[e.NONE=0]="NONE",e[e.CREATE=4]="CREATE",e[e.READ=1]="READ",e[e.UPDATE=2]="UPDATE",e[e.DELETE=8]="DELETE",e[e.SHARE=16]="SHARE",e[e.ALL=31]="ALL",e))(Ct||{});const Lr=function(e,t){return e.match(t)!==null},Bt=(e,t)=>{if(e.id&&typeof e.id!="number")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.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>=Ct.NONE&&e.permissions<=Ct.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.root&&typeof e.root!="string")throw new Error("Invalid root type");if(e.root&&!e.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(e.root&&!e.source.includes(e.root))throw new Error("Root must be part of the source");if(e.root&&Lr(e.source,t)){const n=e.source.match(t)[0];if(!e.source.includes(Ts(n,e.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(e.status&&!Object.values(hn).includes(e.status))throw new Error("Status must be a valid NodeStatus")};var hn=(e=>(e.NEW="new",e.FAILED="failed",e.LOADING="loading",e.LOCKED="locked",e))(hn||{});class ve{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;readonlyAttributes=Object.entries(Object.getOwnPropertyDescriptors(ve.prototype)).filter(t=>typeof t[1].get=="function"&&t[0]!=="__proto__").map(t=>t[0]);handler={set:(t,n,i)=>this.readonlyAttributes.includes(n)?!1:Reflect.set(t,n,i),deleteProperty:(t,n)=>this.readonlyAttributes.includes(n)?!1:Reflect.deleteProperty(t,n),get:(t,n,i)=>this.readonlyAttributes.includes(n)?(jt.warn(`Accessing "Node.attributes.${n}" is deprecated, access it directly on the Node instance.`),Reflect.get(this,n)):Reflect.get(t,n,i)};constructor(t,n){t.mime||(t.mime="application/octet-stream"),Bt(t,n||this._knownDavService),this._data={displayname:t.attributes?.displayname,...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+Os(this.source.slice(t.length))}get basename(){return Pr(this.source)}get displayname(){return this._data.displayname||this.basename}set displayname(t){Bt({...this._data,displayname:t},this._knownDavService),this._data.displayname=t}get extension(){return Is(this.source)}get dirname(){if(this.root){let n=this.source;this.isDavResource&&(n=n.split(this._knownDavService).pop());const i=n.indexOf(this.root),a=this.root.replace(/\/$/,"");return ae(n.slice(i+a.length)||"/")}const t=new URL(this.source);return ae(t.pathname)}get mime(){return this._data.mime||"application/octet-stream"}set mime(t){t??="application/octet-stream",Bt({...this._data,mime:t},this._knownDavService),this._data.mime=t}get mtime(){return this._data.mtime}set mtime(t){Bt({...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){Bt({...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?Ct.READ:this._data.permissions!==void 0?this._data.permissions:Ct.NONE}set permissions(t){Bt({...this._data,permissions:t},this._knownDavService),this.updateMtime(),this._data.permissions=t}get owner(){return this.isDavResource?this._data.owner:null}get isDavResource(){return Lr(this.source,this._knownDavService)}get isDavRessource(){return this.isDavResource}get root(){return this._data.root?this._data.root.replace(/^(.+)\/$/,"$1"):this.isDavResource&&ae(this.source).split(this._knownDavService).pop()||null}get path(){if(this.root){let t=this.source;this.isDavResource&&(t=t.split(this._knownDavService).pop());const n=t.indexOf(this.root),i=this.root.replace(/\/$/,"");return t.slice(n+i.length)||"/"}return(this.dirname+"/"+this.basename).replace(/\/\//g,"/")}get fileid(){return this._data?.id}get status(){return this._data?.status}set status(t){Bt({...this._data,status:t},this._knownDavService),this._data.status=t}get data(){return structuredClone(this._data)}move(t){Bt({...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(ae(this.source)+"/"+t)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}update(t){for(const[n,i]of Object.entries(t))try{i===void 0?delete this.attributes[n]:this.attributes[n]=i}catch(a){if(a instanceof TypeError)continue;throw a}}}class fn extends ve{get type(){return be.File}clone(){return new fn(this.data)}}class pn extends ve{constructor(t){super({...t,mime:"httpd/unix-directory"})}get type(){return be.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}clone(){return new pn(this.data)}}const Rs=function(e=""){let t=Ct.NONE;return e&&((e.includes("C")||e.includes("K"))&&(t|=Ct.CREATE),e.includes("G")&&(t|=Ct.READ),(e.includes("W")||e.includes("N")||e.includes("V"))&&(t|=Ct.UPDATE),e.includes("D")&&(t|=Ct.DELETE),e.includes("R")&&(t|=Ct.SHARE)),t},_r=["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"],$r={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"},no=function(e,t={nc:"http://nextcloud.org/ns"}){typeof window._nc_dav_properties>"u"&&(window._nc_dav_properties=[..._r],window._nc_dav_namespaces={...$r});const n={...window._nc_dav_namespaces,...t};if(window._nc_dav_properties.find(a=>a===e))return jt.warn(`${e} already registered`,{prop:e}),!1;if(e.startsWith("<")||e.split(":").length!==2)return jt.error(`${e} is not valid. See example: 'oc:fileid'`,{prop:e}),!1;const i=e.split(":")[0];return n[i]?(window._nc_dav_properties.push(e),window._nc_dav_namespaces=n,!0):(jt.error(`${e} namespace unknown`,{prop:e,namespaces:n}),!1)},gn=function(){return typeof window._nc_dav_properties>"u"&&(window._nc_dav_properties=[..._r]),window._nc_dav_properties.map(e=>`<${e} />`).join(" ")},dn=function(){return typeof window._nc_dav_namespaces>"u"&&(window._nc_dav_namespaces={...$r}),Object.keys(window._nc_dav_namespaces).map(e=>`xmlns:${e}="${window._nc_dav_namespaces?.[e]}"`).join(" ")},ro=function(){return` ${gn()} `},Cs=function(){return` ${gn()} 1 `},io=function(e){return` ${gn()} /files/${Je()?.uid}/ infinity httpd/unix-directory 0 ${e} 100 0 `};function Ss(){return tn()?`/files/${Zr()}`:`/files/${Je()?.uid}`}const Dr=Ss();function xs(){const e=Kr("dav");return tn()?e.replace("remote.php","public.php"):e}const Br=xs(),so=function(e=Br,t={}){const n=Ns(e,{headers:t});function i(a){n.setHeaders({...t,"X-Requested-With":"XMLHttpRequest",requesttoken:a??""})}return Yr(i),i(Wr()),As().patch("fetch",(a,u)=>{const c=u.headers;return c?.method&&(u.method=c.method,delete c.method),fetch(a,u)}),n},oo=(e,t="/",n=Dr)=>{const i=new AbortController;return new Pt(async(a,u,c)=>{c(()=>i.abort());try{const l=(await e.getDirectoryContents(`${n}${t}`,{signal:i.signal,details:!0,data:Cs(),headers:{method:"REPORT"},includeSelf:!0})).data.filter(m=>m.filename!==t).map(m=>Ps(m,n));a(l)}catch(l){u(l)}})},Ps=function(e,t=Dr,n=Br){let i=Je()?.uid;if(tn())i=i??"anonymous";else if(!i)throw new Error("No user id found");const a=e.props,u=Rs(a?.permissions),c=String(a?.["owner-id"]||i),l=a.fileid||0,m=new Date(Date.parse(e.lastmod)),f=new Date(Date.parse(a.creationdate)),s={id:l,source:`${n}${e.filename}`,mtime:!isNaN(m.getTime())&&m.getTime()!==0?m:void 0,crtime:!isNaN(f.getTime())&&f.getTime()!==0?f:void 0,mime:e.mime||"application/octet-stream",displayname:a.displayname!==void 0?String(a.displayname):void 0,size:a?.size||Number.parseInt(a.getcontentlength||"0"),status:l<0?hn.FAILED:void 0,permissions:u,owner:c,root:t,attributes:{...e,...a,hasPreview:a?.["has-preview"]}};return delete s.attributes?.props,e.type==="file"?new fn(s):new pn(s)};var De={},Be={exports:{}},Wn={},Yn;function Ls(){return Yn||(Yn=1,(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},n={};n.byteLength=s,n.toByteArray=p,n.fromByteArray=E;for(var i=[],a=[],u=typeof Uint8Array<"u"?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,m=c.length;l0)throw new Error("Invalid string. Length must be a multiple of 4");var T=h.indexOf("=");T===-1&&(T=b);var P=T===b?0:4-T%4;return[T,P]}function s(h){var b=f(h),T=b[0],P=b[1];return(T+P)*3/4-P}function d(h,b,T){return(b+T)*3/4-T}function p(h){var b,T=f(h),P=T[0],R=T[1],L=new u(d(h,P,R)),S=0,A=R>0?P-4:P,U;for(U=0;U>16&255,L[S++]=b>>8&255,L[S++]=b&255;return R===2&&(b=a[h.charCodeAt(U)]<<2|a[h.charCodeAt(U+1)]>>4,L[S++]=b&255),R===1&&(b=a[h.charCodeAt(U)]<<10|a[h.charCodeAt(U+1)]<<4|a[h.charCodeAt(U+2)]>>2,L[S++]=b>>8&255,L[S++]=b&255),L}function v(h){return i[h>>18&63]+i[h>>12&63]+i[h>>6&63]+i[h&63]}function w(h,b,T){for(var P,R=[],L=b;LA?A:S+L));return P===1?(b=h[T-1],R.push(i[b>>2]+i[b<<4&63]+"==")):P===2&&(b=(h[T-2]<<8)+h[T-1],R.push(i[b>>10]+i[b>>4&63]+i[b<<2&63]+"=")),R.join("")}var O={};O.read=function(h,b,T,P,R){var L,S,A=R*8-P-1,U=(1<>1,C=-7,D=T?R-1:0,F=T?-1:1,G=h[b+D];for(D+=F,L=G&(1<<-C)-1,G>>=-C,C+=A;C>0;L=L*256+h[b+D],D+=F,C-=8);for(S=L&(1<<-C)-1,L>>=-C,C+=P;C>0;S=S*256+h[b+D],D+=F,C-=8);if(L===0)L=1-M;else{if(L===U)return S?NaN:(G?-1:1)*(1/0);S=S+Math.pow(2,P),L=L-M}return(G?-1:1)*S*Math.pow(2,L-P)},O.write=function(h,b,T,P,R,L){var S,A,U,M=L*8-R-1,C=(1<>1,F=R===23?Math.pow(2,-24)-Math.pow(2,-77):0,G=P?0:L-1,X=P?1:-1,V=b<0||b===0&&1/b<0?1:0;for(b=Math.abs(b),isNaN(b)||b===1/0?(A=isNaN(b)?1:0,S=C):(S=Math.floor(Math.log(b)/Math.LN2),b*(U=Math.pow(2,-S))<1&&(S--,U*=2),S+D>=1?b+=F/U:b+=F*Math.pow(2,1-D),b*U>=2&&(S++,U/=2),S+D>=C?(A=0,S=C):S+D>=1?(A=(b*U-1)*Math.pow(2,R),S=S+D):(A=b*Math.pow(2,D-1)*Math.pow(2,R),S=0));R>=8;h[T+G]=A&255,G+=X,A/=256,R-=8);for(S=S<0;h[T+G]=S&255,G+=X,S/=256,M-=8);h[T+G-X]|=V*128},(function(h){const b=n,T=O,P=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;h.Buffer=C,h.SlowBuffer=kt,h.INSPECT_MAX_BYTES=50;const R=2147483647;h.kMaxLength=R;const{Uint8Array:L,ArrayBuffer:S,SharedArrayBuffer:A}=globalThis;C.TYPED_ARRAY_SUPPORT=U(),!C.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function U(){try{const r=new L(1),o={foo:function(){return 42}};return Object.setPrototypeOf(o,L.prototype),Object.setPrototypeOf(r,o),r.foo()===42}catch{return!1}}Object.defineProperty(C.prototype,"parent",{enumerable:!0,get:function(){if(C.isBuffer(this))return this.buffer}}),Object.defineProperty(C.prototype,"offset",{enumerable:!0,get:function(){if(C.isBuffer(this))return this.byteOffset}});function M(r){if(r>R)throw new RangeError('The value "'+r+'" is invalid for option "size"');const o=new L(r);return Object.setPrototypeOf(o,C.prototype),o}function C(r,o,g){if(typeof r=="number"){if(typeof o=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return X(r)}return D(r,o,g)}C.poolSize=8192;function D(r,o,g){if(typeof r=="string")return V(r,o);if(S.isView(r))return W(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(St(r,S)||r&&St(r.buffer,S)||typeof A<"u"&&(St(r,A)||r&&St(r.buffer,A)))return ot(r,o,g);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const x=r.valueOf&&r.valueOf();if(x!=null&&x!==r)return C.from(x,o,g);const $=q(r);if($)return $;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return C.from(r[Symbol.toPrimitive]("string"),o,g);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}C.from=function(r,o,g){return D(r,o,g)},Object.setPrototypeOf(C.prototype,L.prototype),Object.setPrototypeOf(C,L);function F(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function G(r,o,g){return F(r),r<=0?M(r):o!==void 0?typeof g=="string"?M(r).fill(o,g):M(r).fill(o):M(r)}C.alloc=function(r,o,g){return G(r,o,g)};function X(r){return F(r),M(r<0?0:Q(r)|0)}C.allocUnsafe=function(r){return X(r)},C.allocUnsafeSlow=function(r){return X(r)};function V(r,o){if((typeof o!="string"||o==="")&&(o="utf8"),!C.isEncoding(o))throw new TypeError("Unknown encoding: "+o);const g=$t(r,o)|0;let x=M(g);const $=x.write(r,o);return $!==g&&(x=x.slice(0,$)),x}function Z(r){const o=r.length<0?0:Q(r.length)|0,g=M(o);for(let x=0;x=R)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+R.toString(16)+" bytes");return r|0}function kt(r){return+r!=r&&(r=0),C.alloc(+r)}C.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==C.prototype},C.compare=function(r,o){if(St(r,L)&&(r=C.from(r,r.offset,r.byteLength)),St(o,L)&&(o=C.from(o,o.offset,o.byteLength)),!C.isBuffer(r)||!C.isBuffer(o))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===o)return 0;let g=r.length,x=o.length;for(let $=0,B=Math.min(g,x);$x.length?(C.isBuffer(B)||(B=C.from(B)),B.copy(x,$)):L.prototype.set.call(x,B,$);else if(C.isBuffer(B))B.copy(x,$);else throw new TypeError('"list" argument must be an Array of Buffers');$+=B.length}return x};function $t(r,o){if(C.isBuffer(r))return r.length;if(S.isView(r)||St(r,S))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);const g=r.length,x=arguments.length>2&&arguments[2]===!0;if(!x&&g===0)return 0;let $=!1;for(;;)switch(o){case"ascii":case"latin1":case"binary":return g;case"utf8":case"utf-8":return Ae(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g*2;case"hex":return g>>>1;case"base64":return An(r).length;default:if($)return x?-1:Ae(r).length;o=(""+o).toLowerCase(),$=!0}}C.byteLength=$t;function Nt(r,o,g){let x=!1;if((o===void 0||o<0)&&(o=0),o>this.length||((g===void 0||g>this.length)&&(g=this.length),g<=0)||(g>>>=0,o>>>=0,g<=o))return"";for(r||(r="utf8");;)switch(r){case"hex":return ee(this,o,g);case"utf8":case"utf-8":return ht(this,o,g);case"ascii":return Rt(this,o,g);case"latin1":case"binary":return we(this,o,g);case"base64":return gt(this,o,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return zt(this,o,g);default:if(x)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),x=!0}}C.prototype._isBuffer=!0;function Tt(r,o,g){const x=r[o];r[o]=r[g],r[g]=x}C.prototype.swap16=function(){const r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let o=0;oo&&(r+=" ... "),""},P&&(C.prototype[P]=C.prototype.inspect),C.prototype.compare=function(r,o,g,x,$){if(St(r,L)&&(r=C.from(r,r.offset,r.byteLength)),!C.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(o===void 0&&(o=0),g===void 0&&(g=r?r.length:0),x===void 0&&(x=0),$===void 0&&($=this.length),o<0||g>r.length||x<0||$>this.length)throw new RangeError("out of range index");if(x>=$&&o>=g)return 0;if(x>=$)return-1;if(o>=g)return 1;if(o>>>=0,g>>>=0,x>>>=0,$>>>=0,this===r)return 0;let B=$-x,k=g-o;const K=Math.min(B,k),ft=this.slice(x,$),J=r.slice(o,g);for(let H=0;H2147483647?g=2147483647:g<-2147483648&&(g=-2147483648),g=+g,Oe(g)&&(g=$?0:r.length-1),g<0&&(g=r.length+g),g>=r.length){if($)return-1;g=r.length-1}else if(g<0)if($)g=0;else return-1;if(typeof o=="string"&&(o=C.from(o,x)),C.isBuffer(o))return o.length===0?-1:y(r,o,g,x,$);if(typeof o=="number")return o=o&255,typeof L.prototype.indexOf=="function"?$?L.prototype.indexOf.call(r,o,g):L.prototype.lastIndexOf.call(r,o,g):y(r,[o],g,x,$);throw new TypeError("val must be string, number or Buffer")}function y(r,o,g,x,$){let B=1,k=r.length,K=o.length;if(x!==void 0&&(x=String(x).toLowerCase(),x==="ucs2"||x==="ucs-2"||x==="utf16le"||x==="utf-16le")){if(r.length<2||o.length<2)return-1;B=2,k/=2,K/=2,g/=2}function ft(H,st){return B===1?H[st]:H.readUInt16BE(st*B)}let J;if($){let H=-1;for(J=g;Jk&&(g=k-K),J=g;J>=0;J--){let H=!0;for(let st=0;st$&&(x=$)):x=$;const B=o.length;x>B/2&&(x=B/2);let k;for(k=0;k>>0,isFinite(g)?(g=g>>>0,x===void 0&&(x="utf8")):(x=g,g=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const $=this.length-o;if((g===void 0||g>$)&&(g=$),r.length>0&&(g<0||o<0)||o>this.length)throw new RangeError("Attempt to write outside buffer bounds");x||(x="utf8");let B=!1;for(;;)switch(x){case"hex":return j(this,r,o,g);case"utf8":case"utf-8":return _(this,r,o,g);case"ascii":case"latin1":case"binary":return z(this,r,o,g);case"base64":return nt(this,r,o,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return rt(this,r,o,g);default:if(B)throw new TypeError("Unknown encoding: "+x);x=(""+x).toLowerCase(),B=!0}},C.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function gt(r,o,g){return o===0&&g===r.length?b.fromByteArray(r):b.fromByteArray(r.slice(o,g))}function ht(r,o,g){g=Math.min(r.length,g);const x=[];let $=o;for(;$239?4:B>223?3:B>191?2:1;if($+K<=g){let ft,J,H,st;switch(K){case 1:B<128&&(k=B);break;case 2:ft=r[$+1],(ft&192)===128&&(st=(B&31)<<6|ft&63,st>127&&(k=st));break;case 3:ft=r[$+1],J=r[$+2],(ft&192)===128&&(J&192)===128&&(st=(B&15)<<12|(ft&63)<<6|J&63,st>2047&&(st<55296||st>57343)&&(k=st));break;case 4:ft=r[$+1],J=r[$+2],H=r[$+3],(ft&192)===128&&(J&192)===128&&(H&192)===128&&(st=(B&15)<<18|(ft&63)<<12|(J&63)<<6|H&63,st>65535&&st<1114112&&(k=st))}}k===null?(k=65533,K=1):k>65535&&(k-=65536,x.push(k>>>10&1023|55296),k=56320|k&1023),x.push(k),$+=K}return at(x)}const xt=4096;function at(r){const o=r.length;if(o<=xt)return String.fromCharCode.apply(String,r);let g="",x=0;for(;xx)&&(g=x);let $="";for(let B=o;Bg&&(r=g),o<0?(o+=g,o<0&&(o=0)):o>g&&(o=g),og)throw new RangeError("Trying to access beyond buffer length")}C.prototype.readUintLE=C.prototype.readUIntLE=function(r,o,g){r=r>>>0,o=o>>>0,g||it(r,o,this.length);let x=this[r],$=1,B=0;for(;++B>>0,o=o>>>0,g||it(r,o,this.length);let x=this[r+--o],$=1;for(;o>0&&($*=256);)x+=this[r+--o]*$;return x},C.prototype.readUint8=C.prototype.readUInt8=function(r,o){return r=r>>>0,o||it(r,1,this.length),this[r]},C.prototype.readUint16LE=C.prototype.readUInt16LE=function(r,o){return r=r>>>0,o||it(r,2,this.length),this[r]|this[r+1]<<8},C.prototype.readUint16BE=C.prototype.readUInt16BE=function(r,o){return r=r>>>0,o||it(r,2,this.length),this[r]<<8|this[r+1]},C.prototype.readUint32LE=C.prototype.readUInt32LE=function(r,o){return r=r>>>0,o||it(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216},C.prototype.readUint32BE=C.prototype.readUInt32BE=function(r,o){return r=r>>>0,o||it(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])},C.prototype.readBigUInt64LE=Dt(function(r){r=r>>>0,Ft(r,"offset");const o=this[r],g=this[r+7];(o===void 0||g===void 0)&&qt(r,this.length-8);const x=o+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,$=this[++r]+this[++r]*2**8+this[++r]*2**16+g*2**24;return BigInt(x)+(BigInt($)<>>0,Ft(r,"offset");const o=this[r],g=this[r+7];(o===void 0||g===void 0)&&qt(r,this.length-8);const x=o*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],$=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+g;return(BigInt(x)<>>0,o=o>>>0,g||it(r,o,this.length);let x=this[r],$=1,B=0;for(;++B=$&&(x-=Math.pow(2,8*o)),x},C.prototype.readIntBE=function(r,o,g){r=r>>>0,o=o>>>0,g||it(r,o,this.length);let x=o,$=1,B=this[r+--x];for(;x>0&&($*=256);)B+=this[r+--x]*$;return $*=128,B>=$&&(B-=Math.pow(2,8*o)),B},C.prototype.readInt8=function(r,o){return r=r>>>0,o||it(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]},C.prototype.readInt16LE=function(r,o){r=r>>>0,o||it(r,2,this.length);const g=this[r]|this[r+1]<<8;return g&32768?g|4294901760:g},C.prototype.readInt16BE=function(r,o){r=r>>>0,o||it(r,2,this.length);const g=this[r+1]|this[r]<<8;return g&32768?g|4294901760:g},C.prototype.readInt32LE=function(r,o){return r=r>>>0,o||it(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},C.prototype.readInt32BE=function(r,o){return r=r>>>0,o||it(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},C.prototype.readBigInt64LE=Dt(function(r){r=r>>>0,Ft(r,"offset");const o=this[r],g=this[r+7];(o===void 0||g===void 0)&&qt(r,this.length-8);const x=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(g<<24);return(BigInt(x)<>>0,Ft(r,"offset");const o=this[r],g=this[r+7];(o===void 0||g===void 0)&&qt(r,this.length-8);const x=(o<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(x)<>>0,o||it(r,4,this.length),T.read(this,r,!0,23,4)},C.prototype.readFloatBE=function(r,o){return r=r>>>0,o||it(r,4,this.length),T.read(this,r,!1,23,4)},C.prototype.readDoubleLE=function(r,o){return r=r>>>0,o||it(r,8,this.length),T.read(this,r,!0,52,8)},C.prototype.readDoubleBE=function(r,o){return r=r>>>0,o||it(r,8,this.length),T.read(this,r,!1,52,8)};function wt(r,o,g,x,$,B){if(!C.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(o>$||or.length)throw new RangeError("Index out of range")}C.prototype.writeUintLE=C.prototype.writeUIntLE=function(r,o,g,x){if(r=+r,o=o>>>0,g=g>>>0,!x){const k=Math.pow(2,8*g)-1;wt(this,r,o,g,k,0)}let $=1,B=0;for(this[o]=r&255;++B>>0,g=g>>>0,!x){const k=Math.pow(2,8*g)-1;wt(this,r,o,g,k,0)}let $=g-1,B=1;for(this[o+$]=r&255;--$>=0&&(B*=256);)this[o+$]=r/B&255;return o+g},C.prototype.writeUint8=C.prototype.writeUInt8=function(r,o,g){return r=+r,o=o>>>0,g||wt(this,r,o,1,255,0),this[o]=r&255,o+1},C.prototype.writeUint16LE=C.prototype.writeUInt16LE=function(r,o,g){return r=+r,o=o>>>0,g||wt(this,r,o,2,65535,0),this[o]=r&255,this[o+1]=r>>>8,o+2},C.prototype.writeUint16BE=C.prototype.writeUInt16BE=function(r,o,g){return r=+r,o=o>>>0,g||wt(this,r,o,2,65535,0),this[o]=r>>>8,this[o+1]=r&255,o+2},C.prototype.writeUint32LE=C.prototype.writeUInt32LE=function(r,o,g){return r=+r,o=o>>>0,g||wt(this,r,o,4,4294967295,0),this[o+3]=r>>>24,this[o+2]=r>>>16,this[o+1]=r>>>8,this[o]=r&255,o+4},C.prototype.writeUint32BE=C.prototype.writeUInt32BE=function(r,o,g){return r=+r,o=o>>>0,g||wt(this,r,o,4,4294967295,0),this[o]=r>>>24,this[o+1]=r>>>16,this[o+2]=r>>>8,this[o+3]=r&255,o+4};function mn(r,o,g,x,$){Nn(o,x,$,r,g,7);let B=Number(o&BigInt(4294967295));r[g++]=B,B=B>>8,r[g++]=B,B=B>>8,r[g++]=B,B=B>>8,r[g++]=B;let k=Number(o>>BigInt(32)&BigInt(4294967295));return r[g++]=k,k=k>>8,r[g++]=k,k=k>>8,r[g++]=k,k=k>>8,r[g++]=k,g}function yn(r,o,g,x,$){Nn(o,x,$,r,g,7);let B=Number(o&BigInt(4294967295));r[g+7]=B,B=B>>8,r[g+6]=B,B=B>>8,r[g+5]=B,B=B>>8,r[g+4]=B;let k=Number(o>>BigInt(32)&BigInt(4294967295));return r[g+3]=k,k=k>>8,r[g+2]=k,k=k>>8,r[g+1]=k,k=k>>8,r[g]=k,g+8}C.prototype.writeBigUInt64LE=Dt(function(r,o=0){return mn(this,r,o,BigInt(0),BigInt("0xffffffffffffffff"))}),C.prototype.writeBigUInt64BE=Dt(function(r,o=0){return yn(this,r,o,BigInt(0),BigInt("0xffffffffffffffff"))}),C.prototype.writeIntLE=function(r,o,g,x){if(r=+r,o=o>>>0,!x){const K=Math.pow(2,8*g-1);wt(this,r,o,g,K-1,-K)}let $=0,B=1,k=0;for(this[o]=r&255;++$>0)-k&255;return o+g},C.prototype.writeIntBE=function(r,o,g,x){if(r=+r,o=o>>>0,!x){const K=Math.pow(2,8*g-1);wt(this,r,o,g,K-1,-K)}let $=g-1,B=1,k=0;for(this[o+$]=r&255;--$>=0&&(B*=256);)r<0&&k===0&&this[o+$+1]!==0&&(k=1),this[o+$]=(r/B>>0)-k&255;return o+g},C.prototype.writeInt8=function(r,o,g){return r=+r,o=o>>>0,g||wt(this,r,o,1,127,-128),r<0&&(r=255+r+1),this[o]=r&255,o+1},C.prototype.writeInt16LE=function(r,o,g){return r=+r,o=o>>>0,g||wt(this,r,o,2,32767,-32768),this[o]=r&255,this[o+1]=r>>>8,o+2},C.prototype.writeInt16BE=function(r,o,g){return r=+r,o=o>>>0,g||wt(this,r,o,2,32767,-32768),this[o]=r>>>8,this[o+1]=r&255,o+2},C.prototype.writeInt32LE=function(r,o,g){return r=+r,o=o>>>0,g||wt(this,r,o,4,2147483647,-2147483648),this[o]=r&255,this[o+1]=r>>>8,this[o+2]=r>>>16,this[o+3]=r>>>24,o+4},C.prototype.writeInt32BE=function(r,o,g){return r=+r,o=o>>>0,g||wt(this,r,o,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[o]=r>>>24,this[o+1]=r>>>16,this[o+2]=r>>>8,this[o+3]=r&255,o+4},C.prototype.writeBigInt64LE=Dt(function(r,o=0){return mn(this,r,o,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),C.prototype.writeBigInt64BE=Dt(function(r,o=0){return yn(this,r,o,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function En(r,o,g,x,$,B){if(g+x>r.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("Index out of range")}function bn(r,o,g,x,$){return o=+o,g=g>>>0,$||En(r,o,g,4),T.write(r,o,g,x,23,4),g+4}C.prototype.writeFloatLE=function(r,o,g){return bn(this,r,o,!0,g)},C.prototype.writeFloatBE=function(r,o,g){return bn(this,r,o,!1,g)};function vn(r,o,g,x,$){return o=+o,g=g>>>0,$||En(r,o,g,8),T.write(r,o,g,x,52,8),g+8}C.prototype.writeDoubleLE=function(r,o,g){return vn(this,r,o,!0,g)},C.prototype.writeDoubleBE=function(r,o,g){return vn(this,r,o,!1,g)},C.prototype.copy=function(r,o,g,x){if(!C.isBuffer(r))throw new TypeError("argument should be a Buffer");if(g||(g=0),!x&&x!==0&&(x=this.length),o>=r.length&&(o=r.length),o||(o=0),x>0&&x=this.length)throw new RangeError("Index out of range");if(x<0)throw new RangeError("sourceEnd out of bounds");x>this.length&&(x=this.length),r.length-o>>0,g=g===void 0?this.length:g>>>0,r||(r=0);let $;if(typeof r=="number")for($=o;$2**32?$=wn(String(g)):typeof g=="bigint"&&($=String(g),(g>BigInt(2)**BigInt(32)||g<-(BigInt(2)**BigInt(32)))&&($=wn($)),$+="n"),x+=` It must be ${o}. Received ${$}`,x},RangeError);function wn(r){let o="",g=r.length;const x=r[0]==="-"?1:0;for(;g>=x+4;g-=3)o=`_${r.slice(g-3,g)}${o}`;return`${r.slice(0,g)}${o}`}function kr(r,o,g){Ft(o,"offset"),(r[o]===void 0||r[o+g]===void 0)&&qt(o,r.length-(g+1))}function Nn(r,o,g,x,$,B){if(r>g||r= 0${k} and < 2${k} ** ${(B+1)*8}${k}`:K=`>= -(2${k} ** ${(B+1)*8-1}${k}) and < 2 ** ${(B+1)*8-1}${k}`,new Gt.ERR_OUT_OF_RANGE("value",K,r)}kr(x,$,B)}function Ft(r,o){if(typeof r!="number")throw new Gt.ERR_INVALID_ARG_TYPE(o,"number",r)}function qt(r,o,g){throw Math.floor(r)!==r?(Ft(r,g),new Gt.ERR_OUT_OF_RANGE("offset","an integer",r)):o<0?new Gt.ERR_BUFFER_OUT_OF_BOUNDS:new Gt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${o}`,r)}const Gr=/[^+/0-9A-Za-z-_]/g;function Fr(r){if(r=r.split("=")[0],r=r.trim().replace(Gr,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function Ae(r,o){o=o||1/0;let g;const x=r.length;let $=null;const B=[];for(let k=0;k55295&&g<57344){if(!$){if(g>56319){(o-=3)>-1&&B.push(239,191,189);continue}else if(k+1===x){(o-=3)>-1&&B.push(239,191,189);continue}$=g;continue}if(g<56320){(o-=3)>-1&&B.push(239,191,189),$=g;continue}g=($-55296<<10|g-56320)+65536}else $&&(o-=3)>-1&&B.push(239,191,189);if($=null,g<128){if((o-=1)<0)break;B.push(g)}else if(g<2048){if((o-=2)<0)break;B.push(g>>6|192,g&63|128)}else if(g<65536){if((o-=3)<0)break;B.push(g>>12|224,g>>6&63|128,g&63|128)}else if(g<1114112){if((o-=4)<0)break;B.push(g>>18|240,g>>12&63|128,g>>6&63|128,g&63|128)}else throw new Error("Invalid code point")}return B}function Vr(r){const o=[];for(let g=0;g>8,$=g%256,B.push($),B.push(x);return B}function An(r){return b.toByteArray(Fr(r))}function ne(r,o,g,x){let $;for($=0;$=o.length||$>=r.length);++$)o[$+g]=r[$];return $}function St(r,o){return r instanceof o||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===o.name}function Oe(r){return r!==r}const zr=(function(){const r="0123456789abcdef",o=new Array(256);for(let g=0;g<16;++g){const x=g*16;for(let $=0;$<16;++$)o[x+$]=r[g]+r[$]}return o})();function Dt(r){return typeof BigInt>"u"?qr:r}function qr(){throw new Error("BigInt not supported")}})(t);const I=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=I,e.isAscii=t.isAscii,e.isUtf8=t.isUtf8,e.kMaxLength=t.kMaxLength,e.kStringMaxLength=t.kStringMaxLength,e.resolveObjectURL=t.resolveObjectURL,e.transcode=t.transcode})(Wn)),Wn}var Hn;function _s(){return Hn||(Hn=1,(function(e,t){var n=Ls(),i=n.Buffer;function a(c,l){for(var m in c)l[m]=c[m]}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(a(n,t),t.Buffer=u);function u(c,l,m){return i(c,l,m)}u.prototype=Object.create(i.prototype),a(i,u),u.from=function(c,l,m){if(typeof c=="number")throw new TypeError("Argument must not be a number");return i(c,l,m)},u.alloc=function(c,l,m){if(typeof c!="number")throw new TypeError("Argument must be a number");var f=i(c);return l!==void 0?typeof m=="string"?f.fill(l,m):f.fill(l):f.fill(0),f},u.allocUnsafe=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return i(c)},u.allocUnsafeSlow=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(c)}})(Be,Be.exports)),Be.exports}var Zn;function $s(){if(Zn)return De;Zn=1;var e=_s().Buffer,t=e.isEncoding||function(I){switch(I=""+I,I&&I.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(I){if(!I)return"utf8";for(var h;;)switch(I){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return I;default:if(h)return;I=(""+I).toLowerCase(),h=!0}}function i(I){var h=n(I);if(typeof h!="string"&&(e.isEncoding===t||!t(I)))throw new Error("Unknown encoding: "+I);return h||I}De.StringDecoder=a;function a(I){this.encoding=i(I);var h;switch(this.encoding){case"utf16le":this.text=d,this.end=p,h=4;break;case"utf8":this.fillLast=m,h=4;break;case"base64":this.text=v,this.end=w,h=3;break;default:this.write=E,this.end=O;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(h)}a.prototype.write=function(I){if(I.length===0)return"";var h,b;if(this.lastNeed){if(h=this.fillLast(I),h===void 0)return"";b=this.lastNeed,this.lastNeed=0}else b=0;return b>5===6?2:I>>4===14?3:I>>3===30?4:I>>6===2?-1:-2}function c(I,h,b){var T=h.length-1;if(T=0?(P>0&&(I.lastNeed=P-1),P):--T=0?(P>0&&(I.lastNeed=P-2),P):--T=0?(P>0&&(P===2?P=0:I.lastNeed=P-3),P):0))}function l(I,h,b){if((h[0]&192)!==128)return I.lastNeed=0,"�";if(I.lastNeed>1&&h.length>1){if((h[1]&192)!==128)return I.lastNeed=1,"�";if(I.lastNeed>2&&h.length>2&&(h[2]&192)!==128)return I.lastNeed=2,"�"}}function m(I){var h=this.lastTotal-this.lastNeed,b=l(this,I);if(b!==void 0)return b;if(this.lastNeed<=I.length)return I.copy(this.lastChar,h,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);I.copy(this.lastChar,h,0,I.length),this.lastNeed-=I.length}function f(I,h){var b=c(this,I,h);if(!this.lastNeed)return I.toString("utf8",h);this.lastTotal=b;var T=I.length-(b-this.lastNeed);return I.copy(this.lastChar,0,T),I.toString("utf8",h,T)}function s(I){var h=I&&I.length?this.write(I):"";return this.lastNeed?h+"�":h}function d(I,h){if((I.length-h)%2===0){var b=I.toString("utf16le",h);if(b){var T=b.charCodeAt(b.length-1);if(T>=55296&&T<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=I[I.length-2],this.lastChar[1]=I[I.length-1],b.slice(0,-1)}return b}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=I[I.length-1],I.toString("utf16le",h,I.length-1)}function p(I){var h=I&&I.length?this.write(I):"";if(this.lastNeed){var b=this.lastTotal-this.lastNeed;return h+this.lastChar.toString("utf16le",0,b)}return h}function v(I,h){var b=(I.length-h)%3;return b===0?I.toString("base64",h):(this.lastNeed=3-b,this.lastTotal=3,b===1?this.lastChar[0]=I[I.length-1]:(this.lastChar[0]=I[I.length-2],this.lastChar[1]=I[I.length-1]),I.toString("base64",h,I.length-b))}function w(I){var h=I&&I.length?this.write(I):"";return this.lastNeed?h+this.lastChar.toString("base64",0,3-this.lastNeed):h}function E(I){return I.toString(this.encoding)}function O(I){return I&&I.length?this.write(I):""}return De}var Ds=$s();const Bs=ti(Ds);var Ue={},Qn,Kn;function Ur(){return Kn||(Kn=1,Qn=typeof Qt=="object"&&Ue&&Ue.NODE_DEBUG&&/\bsemver\b/i.test(Ue.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}),Qn}var je,Jn;function jr(){if(Jn)return je;Jn=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,a=t-6;return je={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:a,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},je}var Me={exports:{}},tr;function Us(){return tr||(tr=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:a}=jr(),u=Ur();t=e.exports={};const c=t.re=[],l=t.safeRe=[],m=t.src=[],f=t.safeSrc=[],s=t.t={};let d=0;const p="[a-zA-Z0-9-]",v=[["\\s",1],["\\d",a],[p,i]],w=O=>{for(const[I,h]of v)O=O.split(`${I}*`).join(`${I}{0,${h}}`).split(`${I}+`).join(`${I}{1,${h}}`);return O},E=(O,I,h)=>{const b=w(I),T=d++;u(O,T,I),s[O]=T,m[T]=I,f[T]=b,c[T]=new RegExp(I,h?"g":void 0),l[T]=new RegExp(b,h?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*"),E("NUMERICIDENTIFIERLOOSE","\\d+"),E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),E("MAINVERSION",`(${m[s.NUMERICIDENTIFIER]})\\.(${m[s.NUMERICIDENTIFIER]})\\.(${m[s.NUMERICIDENTIFIER]})`),E("MAINVERSIONLOOSE",`(${m[s.NUMERICIDENTIFIERLOOSE]})\\.(${m[s.NUMERICIDENTIFIERLOOSE]})\\.(${m[s.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASEIDENTIFIER",`(?:${m[s.NONNUMERICIDENTIFIER]}|${m[s.NUMERICIDENTIFIER]})`),E("PRERELEASEIDENTIFIERLOOSE",`(?:${m[s.NONNUMERICIDENTIFIER]}|${m[s.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASE",`(?:-(${m[s.PRERELEASEIDENTIFIER]}(?:\\.${m[s.PRERELEASEIDENTIFIER]})*))`),E("PRERELEASELOOSE",`(?:-?(${m[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${m[s.PRERELEASEIDENTIFIERLOOSE]})*))`),E("BUILDIDENTIFIER",`${p}+`),E("BUILD",`(?:\\+(${m[s.BUILDIDENTIFIER]}(?:\\.${m[s.BUILDIDENTIFIER]})*))`),E("FULLPLAIN",`v?${m[s.MAINVERSION]}${m[s.PRERELEASE]}?${m[s.BUILD]}?`),E("FULL",`^${m[s.FULLPLAIN]}$`),E("LOOSEPLAIN",`[v=\\s]*${m[s.MAINVERSIONLOOSE]}${m[s.PRERELEASELOOSE]}?${m[s.BUILD]}?`),E("LOOSE",`^${m[s.LOOSEPLAIN]}$`),E("GTLT","((?:<|>)?=?)"),E("XRANGEIDENTIFIERLOOSE",`${m[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),E("XRANGEIDENTIFIER",`${m[s.NUMERICIDENTIFIER]}|x|X|\\*`),E("XRANGEPLAIN",`[v=\\s]*(${m[s.XRANGEIDENTIFIER]})(?:\\.(${m[s.XRANGEIDENTIFIER]})(?:\\.(${m[s.XRANGEIDENTIFIER]})(?:${m[s.PRERELEASE]})?${m[s.BUILD]}?)?)?`),E("XRANGEPLAINLOOSE",`[v=\\s]*(${m[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${m[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${m[s.XRANGEIDENTIFIERLOOSE]})(?:${m[s.PRERELEASELOOSE]})?${m[s.BUILD]}?)?)?`),E("XRANGE",`^${m[s.GTLT]}\\s*${m[s.XRANGEPLAIN]}$`),E("XRANGELOOSE",`^${m[s.GTLT]}\\s*${m[s.XRANGEPLAINLOOSE]}$`),E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),E("COERCE",`${m[s.COERCEPLAIN]}(?:$|[^\\d])`),E("COERCEFULL",m[s.COERCEPLAIN]+`(?:${m[s.PRERELEASE]})?(?:${m[s.BUILD]})?(?:$|[^\\d])`),E("COERCERTL",m[s.COERCE],!0),E("COERCERTLFULL",m[s.COERCEFULL],!0),E("LONETILDE","(?:~>?)"),E("TILDETRIM",`(\\s*)${m[s.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",E("TILDE",`^${m[s.LONETILDE]}${m[s.XRANGEPLAIN]}$`),E("TILDELOOSE",`^${m[s.LONETILDE]}${m[s.XRANGEPLAINLOOSE]}$`),E("LONECARET","(?:\\^)"),E("CARETTRIM",`(\\s*)${m[s.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",E("CARET",`^${m[s.LONECARET]}${m[s.XRANGEPLAIN]}$`),E("CARETLOOSE",`^${m[s.LONECARET]}${m[s.XRANGEPLAINLOOSE]}$`),E("COMPARATORLOOSE",`^${m[s.GTLT]}\\s*(${m[s.LOOSEPLAIN]})$|^$`),E("COMPARATOR",`^${m[s.GTLT]}\\s*(${m[s.FULLPLAIN]})$|^$`),E("COMPARATORTRIM",`(\\s*)${m[s.GTLT]}\\s*(${m[s.LOOSEPLAIN]}|${m[s.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",E("HYPHENRANGE",`^\\s*(${m[s.XRANGEPLAIN]})\\s+-\\s+(${m[s.XRANGEPLAIN]})\\s*$`),E("HYPHENRANGELOOSE",`^\\s*(${m[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${m[s.XRANGEPLAINLOOSE]})\\s*$`),E("STAR","(<|>)?=?\\s*\\*"),E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Me,Me.exports)),Me.exports}var ke,er;function js(){if(er)return ke;er=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return ke=n=>n?typeof n!="object"?e:n:t,ke}var Ge,nr;function Ms(){if(nr)return Ge;nr=1;const e=/^[0-9]+$/,t=(n,i)=>{if(typeof n=="number"&&typeof i=="number")return n===i?0:nt(i,n)},Ge}var Fe,rr;function Mr(){if(rr)return Fe;rr=1;const e=Ur(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=jr(),{safeRe:i,t:a}=Us(),u=js(),{compareIdentifiers:c}=Ms();class l{constructor(f,s){if(s=u(s),f instanceof l){if(f.loose===!!s.loose&&f.includePrerelease===!!s.includePrerelease)return f;f=f.version}else if(typeof f!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof f}".`);if(f.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",f,s),this.options=s,this.loose=!!s.loose,this.includePrerelease=!!s.includePrerelease;const d=f.trim().match(s.loose?i[a.LOOSE]:i[a.FULL]);if(!d)throw new TypeError(`Invalid Version: ${f}`);if(this.raw=f,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(p=>{if(/^[0-9]+$/.test(p)){const v=+p;if(v>=0&&vf.major?1:this.minorf.minor?1:this.patchf.patch?1:0}comparePre(f){if(f instanceof l||(f=new l(f,this.options)),this.prerelease.length&&!f.prerelease.length)return-1;if(!this.prerelease.length&&f.prerelease.length)return 1;if(!this.prerelease.length&&!f.prerelease.length)return 0;let s=0;do{const d=this.prerelease[s],p=f.prerelease[s];if(e("prerelease compare",s,d,p),d===void 0&&p===void 0)return 0;if(p===void 0)return 1;if(d===void 0)return-1;if(d!==p)return c(d,p)}while(++s)}compareBuild(f){f instanceof l||(f=new l(f,this.options));let s=0;do{const d=this.build[s],p=f.build[s];if(e("build compare",s,d,p),d===void 0&&p===void 0)return 0;if(p===void 0)return 1;if(d===void 0)return-1;if(d!==p)return c(d,p)}while(++s)}inc(f,s,d){if(f.startsWith("pre")){if(!s&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(s){const p=`-${s}`.match(this.options.loose?i[a.PRERELEASELOOSE]:i[a.PRERELEASE]);if(!p||p[1]!==s)throw new Error(`invalid identifier: ${s}`)}}switch(f){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",s,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",s,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",s,d),this.inc("pre",s,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",s,d),this.inc("pre",s,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 p=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[p];else{let v=this.prerelease.length;for(;--v>=0;)typeof this.prerelease[v]=="number"&&(this.prerelease[v]++,v=-2);if(v===-1){if(s===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(p)}}if(s){let v=[s,p];d===!1&&(v=[s]),c(this.prerelease[0],s)===0?isNaN(this.prerelease[1])&&(this.prerelease=v):this.prerelease=v}break}default:throw new Error(`invalid increment argument: ${f}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Fe=l,Fe}var Ve,ir;function ks(){if(ir)return Ve;ir=1;const e=Mr();return Ve=(t,n)=>new e(t,n).major,Ve}ks();var Xe,sr;function Gs(){if(sr)return Xe;sr=1;const e=Mr();return Xe=(t,n,i=!1)=>{if(t instanceof e)return t;try{return new e(t,n)}catch(a){if(!i)return null;throw a}},Xe}var ze,or;function Fs(){if(or)return ze;or=1;const e=Gs();return ze=(t,n)=>{const i=e(t,n);return i?i.version:null},ze}Fs();class ao{_header;constructor(t){this.validateHeader(t),this._header=t}get id(){return this._header.id}get order(){return this._header.order}get enabled(){return this._header.enabled}get render(){return this._header.render}get updated(){return this._header.updated}validateHeader(t){if(!t.id||!t.render||!t.updated)throw new Error("Invalid header: id, render and updated are required");if(typeof t.id!="string")throw new Error("Invalid id property");if(t.enabled!==void 0&&typeof t.enabled!="function")throw new Error("Invalid enabled property");if(t.render&&typeof t.render!="function")throw new Error("Invalid render property");if(t.updated&&typeof t.updated!="function")throw new Error("Invalid updated property")}}const uo=function(e){if(typeof window._nc_filelistheader>"u"&&(window._nc_filelistheader=[],jt.debug("FileListHeaders initialized")),window._nc_filelistheader.find(t=>t.id===e.id)){jt.error(`Header ${e.id} already registered`,{header:e});return}window._nc_filelistheader.push(e)};var ar={},ur;function Vs(){return ur||(ur=1,(function(e){(function(t){t.parser=function(N,y){return new i(N,y)},t.SAXParser=i,t.SAXStream=s,t.createStream=f,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 i(N,y){if(!(this instanceof i))return new i(N,y);var j=this;u(j),j.q=j.c="",j.bufferCheckPosition=t.MAX_BUFFER_LENGTH,j.opt=y||{},j.opt.lowercase=j.opt.lowercase||j.opt.lowercasetags,j.looseCase=j.opt.lowercase?"toLowerCase":"toUpperCase",j.tags=[],j.closed=j.closedRoot=j.sawRoot=!1,j.tag=j.error=null,j.strict=!!N,j.noscript=!!(N||j.opt.noscript),j.state=A.BEGIN,j.strictEntities=j.opt.strictEntities,j.ENTITIES=j.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),j.attribList=[],j.opt.xmlns&&(j.ns=Object.create(E)),j.opt.unquotedAttributeValues===void 0&&(j.opt.unquotedAttributeValues=!N),j.trackPosition=j.opt.position!==!1,j.trackPosition&&(j.position=j.line=j.column=0),M(j,"onready")}Object.create||(Object.create=function(N){function y(){}y.prototype=N;var j=new y;return j}),Object.keys||(Object.keys=function(N){var y=[];for(var j in N)N.hasOwnProperty(j)&&y.push(j);return y});function a(N){for(var y=Math.max(t.MAX_BUFFER_LENGTH,10),j=0,_=0,z=n.length;_y)switch(n[_]){case"textNode":D(N);break;case"cdata":C(N,"oncdata",N.cdata),N.cdata="";break;case"script":C(N,"onscript",N.script),N.script="";break;default:G(N,"Max buffer length exceeded: "+n[_])}j=Math.max(j,nt)}var rt=t.MAX_BUFFER_LENGTH-j;N.bufferCheckPosition=rt+N.position}function u(N){for(var y=0,j=n.length;y"||T(N)}function L(N,y){return N.test(y)}function S(N,y){return!L(N,y)}var A=0;t.STATE={BEGIN:A++,BEGIN_WHITESPACE:A++,TEXT:A++,TEXT_ENTITY:A++,OPEN_WAKA:A++,SGML_DECL:A++,SGML_DECL_QUOTED:A++,DOCTYPE:A++,DOCTYPE_QUOTED:A++,DOCTYPE_DTD:A++,DOCTYPE_DTD_QUOTED:A++,COMMENT_STARTING:A++,COMMENT:A++,COMMENT_ENDING:A++,COMMENT_ENDED:A++,CDATA:A++,CDATA_ENDING:A++,CDATA_ENDING_2:A++,PROC_INST:A++,PROC_INST_BODY:A++,PROC_INST_ENDING:A++,OPEN_TAG:A++,OPEN_TAG_SLASH:A++,ATTRIB:A++,ATTRIB_NAME:A++,ATTRIB_NAME_SAW_WHITE:A++,ATTRIB_VALUE:A++,ATTRIB_VALUE_QUOTED:A++,ATTRIB_VALUE_CLOSED:A++,ATTRIB_VALUE_UNQUOTED:A++,ATTRIB_VALUE_ENTITY_Q:A++,ATTRIB_VALUE_ENTITY_U:A++,CLOSE_TAG:A++,CLOSE_TAG_SAW_WHITE:A++,SCRIPT:A++,SCRIPT_ENDING:A++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(N){var y=t.ENTITIES[N],j=typeof y=="number"?String.fromCharCode(y):y;t.ENTITIES[N]=j});for(var U in t.STATE)t.STATE[t.STATE[U]]=U;A=t.STATE;function M(N,y,j){N[y]&&N[y](j)}function C(N,y,j){N.textNode&&D(N),M(N,y,j)}function D(N){N.textNode=F(N.opt,N.textNode),N.textNode&&M(N,"ontext",N.textNode),N.textNode=""}function F(N,y){return N.trim&&(y=y.trim()),N.normalize&&(y=y.replace(/\s+/g," ")),y}function G(N,y){return D(N),N.trackPosition&&(y+=` Line: `+N.line+` Column: `+N.column+` Char: `+N.c),y=new Error(y),N.error=y,M(N,"onerror",y),N}function X(N){return N.sawRoot&&!N.closedRoot&&V(N,"Unclosed root tag"),N.state!==A.BEGIN&&N.state!==A.BEGIN_WHITESPACE&&N.state!==A.TEXT&&G(N,"Unexpected end"),D(N),N.c="",N.closed=!0,M(N,"onend"),i.call(N,N.strict,N.opt),N}function V(N,y){if(typeof N!="object"||!(N instanceof i))throw new Error("bad call to strictFail");N.strict&&G(N,y)}function Z(N){N.strict||(N.tagName=N.tagName[N.looseCase]());var y=N.tags[N.tags.length-1]||N,j=N.tag={name:N.tagName,attributes:{}};N.opt.xmlns&&(j.ns=y.ns),N.attribList.length=0,C(N,"onopentagstart",j)}function W(N,y){var j=N.indexOf(":"),_=j<0?["",N]:N.split(":"),z=_[0],nt=_[1];return y&&N==="xmlns"&&(z="xmlns",nt=""),{prefix:z,local:nt}}function ot(N){if(N.strict||(N.attribName=N.attribName[N.looseCase]()),N.attribList.indexOf(N.attribName)!==-1||N.tag.attributes.hasOwnProperty(N.attribName)){N.attribName=N.attribValue="";return}if(N.opt.xmlns){var y=W(N.attribName,!0),j=y.prefix,_=y.local;if(j==="xmlns")if(_==="xml"&&N.attribValue!==v)V(N,"xml: prefix must be bound to "+v+` Actual: `+N.attribValue);else if(_==="xmlns"&&N.attribValue!==w)V(N,"xmlns: prefix must be bound to "+w+` Actual: `+N.attribValue);else{var z=N.tag,nt=N.tags[N.tags.length-1]||N;z.ns===nt.ns&&(z.ns=Object.create(nt.ns)),z.ns[_]=N.attribValue}N.attribList.push([N.attribName,N.attribValue])}else N.tag.attributes[N.attribName]=N.attribValue,C(N,"onattribute",{name:N.attribName,value:N.attribValue});N.attribName=N.attribValue=""}function q(N,y){if(N.opt.xmlns){var j=N.tag,_=W(N.tagName);j.prefix=_.prefix,j.local=_.local,j.uri=j.ns[_.prefix]||"",j.prefix&&!j.uri&&(V(N,"Unbound namespace prefix: "+JSON.stringify(N.tagName)),j.uri=_.prefix);var z=N.tags[N.tags.length-1]||N;j.ns&&z.ns!==j.ns&&Object.keys(j.ns).forEach(function(it){C(N,"onopennamespace",{prefix:it,uri:j.ns[it]})});for(var nt=0,rt=N.attribList.length;nt",N.tagName="",N.state=A.SCRIPT;return}C(N,"onscript",N.script),N.script=""}var y=N.tags.length,j=N.tagName;N.strict||(j=j[N.looseCase]());for(var _=j;y--;){var z=N.tags[y];if(z.name!==_)V(N,"Unexpected close tag");else break}if(y<0){V(N,"Unmatched closing tag: "+N.tagName),N.textNode+="",N.state=A.TEXT;return}N.tagName=j;for(var nt=N.tags.length;nt-- >y;){var rt=N.tag=N.tags.pop();N.tagName=N.tag.name,C(N,"onclosetag",N.tagName);var gt={};for(var ht in rt.ns)gt[ht]=rt.ns[ht];var xt=N.tags[N.tags.length-1]||N;N.opt.xmlns&&rt.ns!==xt.ns&&Object.keys(rt.ns).forEach(function(at){var Rt=rt.ns[at];C(N,"onclosenamespace",{prefix:at,uri:Rt})})}y===0&&(N.closedRoot=!0),N.tagName=N.attribValue=N.attribName="",N.attribList.length=0,N.state=A.TEXT}function kt(N){var y=N.entity,j=y.toLowerCase(),_,z="";return N.ENTITIES[y]?N.ENTITIES[y]:N.ENTITIES[j]?N.ENTITIES[j]:(y=j,y.charAt(0)==="#"&&(y.charAt(1)==="x"?(y=y.slice(2),_=parseInt(y,16),z=_.toString(16)):(y=y.slice(1),_=parseInt(y,10),z=_.toString(10))),y=y.replace(/^0+/,""),isNaN(_)||z.toLowerCase()!==y?(V(N,"Invalid character entity"),"&"+N.entity+";"):String.fromCodePoint(_))}function $t(N,y){y==="<"?(N.state=A.OPEN_WAKA,N.startTagPosition=N.position):T(y)||(V(N,"Non-whitespace before first tag."),N.textNode=y,N.state=A.TEXT)}function Nt(N,y){var j="";return y"?(C(y,"onsgmldeclaration",y.sgmlDecl),y.sgmlDecl="",y.state=A.TEXT):(P(_)&&(y.state=A.SGML_DECL_QUOTED),y.sgmlDecl+=_);continue;case A.SGML_DECL_QUOTED:_===y.q&&(y.state=A.SGML_DECL,y.q=""),y.sgmlDecl+=_;continue;case A.DOCTYPE:_===">"?(y.state=A.TEXT,C(y,"ondoctype",y.doctype),y.doctype=!0):(y.doctype+=_,_==="["?y.state=A.DOCTYPE_DTD:P(_)&&(y.state=A.DOCTYPE_QUOTED,y.q=_));continue;case A.DOCTYPE_QUOTED:y.doctype+=_,_===y.q&&(y.q="",y.state=A.DOCTYPE);continue;case A.DOCTYPE_DTD:_==="]"?(y.doctype+=_,y.state=A.DOCTYPE):_==="<"?(y.state=A.OPEN_WAKA,y.startTagPosition=y.position):P(_)?(y.doctype+=_,y.state=A.DOCTYPE_DTD_QUOTED,y.q=_):y.doctype+=_;continue;case A.DOCTYPE_DTD_QUOTED:y.doctype+=_,_===y.q&&(y.state=A.DOCTYPE_DTD,y.q="");continue;case A.COMMENT:_==="-"?y.state=A.COMMENT_ENDING:y.comment+=_;continue;case A.COMMENT_ENDING:_==="-"?(y.state=A.COMMENT_ENDED,y.comment=F(y.opt,y.comment),y.comment&&C(y,"oncomment",y.comment),y.comment=""):(y.comment+="-"+_,y.state=A.COMMENT);continue;case A.COMMENT_ENDED:_!==">"?(V(y,"Malformed comment"),y.comment+="--"+_,y.state=A.COMMENT):y.doctype&&y.doctype!==!0?y.state=A.DOCTYPE_DTD:y.state=A.TEXT;continue;case A.CDATA:_==="]"?y.state=A.CDATA_ENDING:y.cdata+=_;continue;case A.CDATA_ENDING:_==="]"?y.state=A.CDATA_ENDING_2:(y.cdata+="]"+_,y.state=A.CDATA);continue;case A.CDATA_ENDING_2:_===">"?(y.cdata&&C(y,"oncdata",y.cdata),C(y,"onclosecdata"),y.cdata="",y.state=A.TEXT):_==="]"?y.cdata+="]":(y.cdata+="]]"+_,y.state=A.CDATA);continue;case A.PROC_INST:_==="?"?y.state=A.PROC_INST_ENDING:T(_)?y.state=A.PROC_INST_BODY:y.procInstName+=_;continue;case A.PROC_INST_BODY:if(!y.procInstBody&&T(_))continue;_==="?"?y.state=A.PROC_INST_ENDING:y.procInstBody+=_;continue;case A.PROC_INST_ENDING:_===">"?(C(y,"onprocessinginstruction",{name:y.procInstName,body:y.procInstBody}),y.procInstName=y.procInstBody="",y.state=A.TEXT):(y.procInstBody+="?"+_,y.state=A.PROC_INST_BODY);continue;case A.OPEN_TAG:L(I,_)?y.tagName+=_:(Z(y),_===">"?q(y):_==="/"?y.state=A.OPEN_TAG_SLASH:(T(_)||V(y,"Invalid character in tag name"),y.state=A.ATTRIB));continue;case A.OPEN_TAG_SLASH:_===">"?(q(y,!0),Q(y)):(V(y,"Forward-slash in opening tag not followed by >"),y.state=A.ATTRIB);continue;case A.ATTRIB:if(T(_))continue;_===">"?q(y):_==="/"?y.state=A.OPEN_TAG_SLASH:L(O,_)?(y.attribName=_,y.attribValue="",y.state=A.ATTRIB_NAME):V(y,"Invalid attribute name");continue;case A.ATTRIB_NAME:_==="="?y.state=A.ATTRIB_VALUE:_===">"?(V(y,"Attribute without value"),y.attribValue=y.attribName,ot(y),q(y)):T(_)?y.state=A.ATTRIB_NAME_SAW_WHITE:L(I,_)?y.attribName+=_:V(y,"Invalid attribute name");continue;case A.ATTRIB_NAME_SAW_WHITE:if(_==="=")y.state=A.ATTRIB_VALUE;else{if(T(_))continue;V(y,"Attribute without value"),y.tag.attributes[y.attribName]="",y.attribValue="",C(y,"onattribute",{name:y.attribName,value:""}),y.attribName="",_===">"?q(y):L(O,_)?(y.attribName=_,y.state=A.ATTRIB_NAME):(V(y,"Invalid attribute name"),y.state=A.ATTRIB)}continue;case A.ATTRIB_VALUE:if(T(_))continue;P(_)?(y.q=_,y.state=A.ATTRIB_VALUE_QUOTED):(y.opt.unquotedAttributeValues||G(y,"Unquoted attribute value"),y.state=A.ATTRIB_VALUE_UNQUOTED,y.attribValue=_);continue;case A.ATTRIB_VALUE_QUOTED:if(_!==y.q){_==="&"?y.state=A.ATTRIB_VALUE_ENTITY_Q:y.attribValue+=_;continue}ot(y),y.q="",y.state=A.ATTRIB_VALUE_CLOSED;continue;case A.ATTRIB_VALUE_CLOSED:T(_)?y.state=A.ATTRIB:_===">"?q(y):_==="/"?y.state=A.OPEN_TAG_SLASH:L(O,_)?(V(y,"No whitespace between attributes"),y.attribName=_,y.attribValue="",y.state=A.ATTRIB_NAME):V(y,"Invalid attribute name");continue;case A.ATTRIB_VALUE_UNQUOTED:if(!R(_)){_==="&"?y.state=A.ATTRIB_VALUE_ENTITY_U:y.attribValue+=_;continue}ot(y),_===">"?q(y):y.state=A.ATTRIB;continue;case A.CLOSE_TAG:if(y.tagName)_===">"?Q(y):L(I,_)?y.tagName+=_:y.script?(y.script+=""?Q(y):V(y,"Invalid characters in closing tag");continue;case A.TEXT_ENTITY:case A.ATTRIB_VALUE_ENTITY_Q:case A.ATTRIB_VALUE_ENTITY_U:var rt,gt;switch(y.state){case A.TEXT_ENTITY:rt=A.TEXT,gt="textNode";break;case A.ATTRIB_VALUE_ENTITY_Q:rt=A.ATTRIB_VALUE_QUOTED,gt="attribValue";break;case A.ATTRIB_VALUE_ENTITY_U:rt=A.ATTRIB_VALUE_UNQUOTED,gt="attribValue";break}if(_===";"){var ht=kt(y);y.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(ht)?(y.entity="",y.state=rt,y.write(ht)):(y[gt]+=ht,y.entity="",y.state=rt)}else L(y.entity.length?b:h,_)?y.entity+=_:(V(y,"Invalid character in entity name"),y[gt]+="&"+y.entity+_,y.entity="",y.state=rt);continue;default:throw new Error(y,"Unknown state: "+y.state)}return y.position>=y.bufferCheckPosition&&a(y),y}String.fromCodePoint||(function(){var N=String.fromCharCode,y=Math.floor,j=function(){var _=16384,z=[],nt,rt,gt=-1,ht=arguments.length;if(!ht)return"";for(var xt="";++gt1114111||y(at)!==at)throw RangeError("Invalid code point: "+at);at<=65535?z.push(at):(at-=65536,nt=(at>>10)+55296,rt=at%1024+56320,z.push(nt,rt)),(gt+1===ht||z.length>_)&&(xt+=N.apply(null,z),z.length=0)}return xt};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:j,configurable:!0,writable:!0}):String.fromCodePoint=j})()})(e)})(ar)),ar}Vs();var Xs=(e=>(e[e.UploadFromDevice=0]="UploadFromDevice",e[e.CreateNew=1]="CreateNew",e[e.Other=2]="Other",e))(Xs||{});class zs{_entries=[];registerEntry(t){this.validateEntry(t),t.category=t.category??1,this._entries.push(t)}unregisterEntry(t){const n=typeof t=="string"?this.getEntryIndex(t):this.getEntryIndex(t.id);if(n===-1){jt.warn("Entry not found, nothing removed",{entry:t,entries:this.getEntries()});return}this._entries.splice(n,1)}getEntries(t){return t?this._entries.filter(n=>typeof n.enabled=="function"?n.enabled(t):!0):this._entries}getEntryIndex(t){return this._entries.findIndex(n=>n.id===t)}validateEntry(t){if(!t.id||!t.displayName||!(t.iconSvgInline||t.iconClass)||!t.handler)throw new Error("Invalid entry");if(typeof t.id!="string"||typeof t.displayName!="string")throw new Error("Invalid id or displayName property");if(t.iconClass&&typeof t.iconClass!="string"||t.iconSvgInline&&typeof t.iconSvgInline!="string")throw new Error("Invalid icon provided");if(t.enabled!==void 0&&typeof t.enabled!="function")throw new Error("Invalid enabled property");if(typeof t.handler!="function")throw new Error("Invalid handler property");if("order"in t&&typeof t.order!="number")throw new Error("Invalid order property");if(this.getEntryIndex(t.id)!==-1)throw new Error("Duplicate entry")}}function qs(){return typeof window._nc_newfilemenu>"u"&&(window._nc_newfilemenu=new zs,jt.debug("NewFileMenu initialized")),window._nc_newfilemenu}function co(e){return qs().registerEntry(e)}var Ws=(e=>(e.ReservedName="reserved name",e.Character="character",e.Extension="extension",e))(Ws||{});class ue extends Error{constructor(t){super(`Invalid ${t.reason} '${t.segment}' in filename '${t.filename}'`,{cause:t})}get filename(){return this.cause.filename}get reason(){return this.cause.reason}get segment(){return this.cause.segment}}function lo(e){const t=Qr().files,n=t.forbidden_filename_characters??window._oc_config?.forbidden_filenames_characters??["/","\\"];for(const c of n)if(e.includes(c))throw new ue({segment:c,reason:"character",filename:e});if(e=e.toLocaleLowerCase(),(t.forbidden_filenames??[".htaccess"]).includes(e))throw new ue({filename:e,segment:e,reason:"reserved name"});const i=e.indexOf(".",1),a=e.substring(0,i===-1?void 0:i);if((t.forbidden_filename_basenames??[]).includes(a))throw new ue({filename:e,segment:a,reason:"reserved name"});const u=t.forbidden_filename_extensions??[".part",".filepart"];for(const c of u)if(e.length>c.length&&e.endsWith(c))throw new ue({segment:c,reason:"extension",filename:e})}const qe=["B","KB","MB","GB","TB","PB"],We=["B","KiB","MiB","GiB","TiB","PiB"];function ho(e,t=!1,n=!1,i=!1){n=n&&!i,typeof e=="string"&&(e=Number(e));let a=e>0?Math.floor(Math.log(e)/Math.log(i?1e3:1024)):0;a=Math.min((n?We.length:qe.length)-1,a);const u=n?We[a]:qe[a];let c=(e/Math.pow(i?1e3:1024,a)).toFixed(1);return t===!0&&a===0?(c!=="0.0"?"< 1 ":"0 ")+(n?We[1]:qe[1]):(a<2?c=parseFloat(c).toFixed(0):c=parseFloat(c).toLocaleString(lr()),c+" "+u)}function cr(e){return e instanceof Date?e.toISOString():String(e)}function Ys(e,t,n){t=t??[u=>u],n=n??[];const i=t.map((u,c)=>(n[c]??"asc")==="asc"?1:-1),a=Intl.Collator([Hr(),lr()],{numeric:!0,usage:"sort"});return[...e].sort((u,c)=>{for(const[l,m]of t.entries()){const f=a.compare(cr(m(u)),cr(m(c)));if(f!==0)return f*i[l]}return 0})}function fo(e,t={}){const n={sortingMode:"basename",sortingOrder:"asc",...t};function i(c){const l=c.displayname||c.attributes?.displayname||c.basename||"";return c.type===be.Folder?l:l.lastIndexOf(".")>0?l.slice(0,l.lastIndexOf(".")):l}const a=[...n.sortFavoritesFirst?[c=>c.attributes?.favorite!==1]:[],...n.sortFoldersFirst?[c=>c.type!=="folder"]:[],...n.sortingMode!=="basename"?[c=>c[n.sortingMode]??c.attributes[n.sortingMode]]:[],c=>i(c),c=>c.basename],u=[...n.sortFavoritesFirst?["asc"]:[],...n.sortFoldersFirst?["asc"]:[],...n.sortingMode==="mtime"?[n.sortingOrder==="asc"?"desc":"asc"]:[],...n.sortingMode!=="mtime"&&n.sortingMode!=="basename"?[n.sortingOrder]:[],n.sortingOrder,n.sortingOrder];return Ys(e,a,u)}export{Pt as C,fn as F,ao as H,ue as I,Xs as N,Ct as P,co as a,uo as b,Ss as c,oo as d,Dr as e,Ws as f,so as g,be as h,io as i,Ps as j,ro as k,ho as l,no as r,fo as s,lo as v}; //# sourceMappingURL=index-kwZOOyqh.chunk.mjs.map